From ecf271732efc5a4f52447ecab2ba6c37acfce182 Mon Sep 17 00:00:00 2001 From: Aaron Lindsay Date: Mon, 5 Jun 2017 20:14:42 -0400 Subject: [PATCH] OFX imports: Remove restriction about account types ...but still update imported Credit Card account type to Liability --- imports.go | 7 ------- ofx.go | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/imports.go b/imports.go index 513c590..f50447f 100644 --- a/imports.go +++ b/imports.go @@ -66,13 +66,6 @@ func ofxImportHelper(r io.Reader, w http.ResponseWriter, user *User, accountid i 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 // referenced by the OFX import. Also create a map from placeholder import // SecurityIds to the actual SecurityIDs diff --git a/ofx.go b/ofx.go index b1ac1ef..e06e657 100644 --- a/ofx.go +++ b/ofx.go @@ -137,7 +137,7 @@ func (i *OFXImport) importOFXCC(stmt *ofxgo.CCStatementResponse) error { ExternalAccountId: stmt.CCAcctFrom.AcctID.String(), SecurityId: security.SecurityId, ParentAccountId: -1, - Type: Bank, + Type: Liability, } i.Accounts = append(i.Accounts, account)