1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2024-12-26 23:42:29 -05:00

OFX imports: Remove restriction about account types

...but still update imported Credit Card account type to Liability
This commit is contained in:
Aaron Lindsay 2017-06-05 20:14:42 -04:00
parent 0095015053
commit ecf271732e
2 changed files with 1 additions and 8 deletions

View File

@ -66,13 +66,6 @@ func ofxImportHelper(r io.Reader, w http.ResponseWriter, user *User, accountid i
return return
} }
if account.Type != importedAccount.Type {
sqltransaction.Rollback()
WriteError(w, 3 /*Invalid Request*/)
log.Printf("Expected %s account, found %s in OFX file", account.Type.String(), importedAccount.Type.String())
return
}
// Find matching existing securities or create new ones for those // Find matching existing securities or create new ones for those
// referenced by the OFX import. Also create a map from placeholder import // referenced by the OFX import. Also create a map from placeholder import
// SecurityIds to the actual SecurityIDs // SecurityIds to the actual SecurityIDs

2
ofx.go
View File

@ -137,7 +137,7 @@ func (i *OFXImport) importOFXCC(stmt *ofxgo.CCStatementResponse) error {
ExternalAccountId: stmt.CCAcctFrom.AcctID.String(), ExternalAccountId: stmt.CCAcctFrom.AcctID.String(),
SecurityId: security.SecurityId, SecurityId: security.SecurityId,
ParentAccountId: -1, ParentAccountId: -1,
Type: Bank, Type: Liability,
} }
i.Accounts = append(i.Accounts, account) i.Accounts = append(i.Accounts, account)