1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-01 12:08:37 -04:00

Add direct OFX imports

This commit is contained in:
2017-06-04 16:01:42 -04:00
parent bf284dc591
commit fb59f9b3c5
13 changed files with 582 additions and 149 deletions

16
ofx.go
View File

@ -113,9 +113,11 @@ func (i *OFXImport) importOFXBank(stmt *ofxgo.StatementResponse) error {
Type: Bank,
}
for _, tran := range stmt.BankTranList.Transactions {
if err := i.AddTransaction(&tran, &account); err != nil {
return err
if stmt.BankTranList != nil {
for _, tran := range stmt.BankTranList.Transactions {
if err := i.AddTransaction(&tran, &account); err != nil {
return err
}
}
}
@ -139,9 +141,11 @@ func (i *OFXImport) importOFXCC(stmt *ofxgo.CCStatementResponse) error {
}
i.Accounts = append(i.Accounts, account)
for _, tran := range stmt.BankTranList.Transactions {
if err := i.AddTransaction(&tran, &account); err != nil {
return err
if stmt.BankTranList != nil {
for _, tran := range stmt.BankTranList.Transactions {
if err := i.AddTransaction(&tran, &account); err != nil {
return err
}
}
}