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

Move 'status' from transactions to splits

This allows for a transaction to clear one account before the other (and
mirrors how Gnucash, and I suspect most other pieces of software, do it)
This commit is contained in:
2017-05-31 08:23:19 -04:00
parent 11c7f199c4
commit b37a20536f
6 changed files with 86 additions and 69 deletions

4
ofx.go
View File

@ -43,7 +43,6 @@ func (i *OFXImport) GetAddCurrency(isoname string) (*Security, error) {
func (i *OFXImport) AddTransaction(tran *ofxgo.Transaction, account *Account) error {
var t Transaction
t.Status = Imported
t.Date = tran.DtPosted.UTC()
t.RemoteId = tran.FiTID.String()
// TODO CorrectFiTID/CorrectAction?
@ -85,6 +84,9 @@ func (i *OFXImport) AddTransaction(tran *ofxgo.Transaction, account *Account) er
s1.Amount = amt.FloatString(security.Precision)
s2.Amount = amt.Neg(amt).FloatString(security.Precision)
s1.Status = Imported
s2.Status = Imported
s1.AccountId = account.AccountId
s2.AccountId = -1
s1.SecurityId = -1