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:
4
ofx.go
4
ofx.go
@ -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
|
||||
|
Reference in New Issue
Block a user