mirror of
https://github.com/aclindsa/moneygo.git
synced 2024-10-30 07:40:05 -04:00
OFX imports: Create sub-accounts for sub-account splits
This commit is contained in:
parent
e38c49a556
commit
15b9bc8314
17
imports.go
17
imports.go
@ -132,6 +132,23 @@ func ofxImportHelper(r io.Reader, w http.ResponseWriter, user *User, accountid i
|
|||||||
}
|
}
|
||||||
split.AccountId = trading_account.AccountId
|
split.AccountId = trading_account.AccountId
|
||||||
split.SecurityId = -1
|
split.SecurityId = -1
|
||||||
|
} else if split.ImportSplitType == SubAccount {
|
||||||
|
subaccount := &Account{
|
||||||
|
UserId: user.UserId,
|
||||||
|
Name: sec.Name,
|
||||||
|
ParentAccountId: account.AccountId,
|
||||||
|
SecurityId: sec.SecurityId,
|
||||||
|
Type: account.Type,
|
||||||
|
}
|
||||||
|
subaccount, err := GetCreateAccountTx(sqltransaction, *subaccount)
|
||||||
|
if err != nil {
|
||||||
|
sqltransaction.Rollback()
|
||||||
|
WriteError(w, 999 /*Internal Error*/)
|
||||||
|
log.Print(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
split.AccountId = subaccount.AccountId
|
||||||
|
split.SecurityId = -1
|
||||||
} else {
|
} else {
|
||||||
split.SecurityId = sec.SecurityId
|
split.SecurityId = sec.SecurityId
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user