mirror of
https://github.com/aclindsa/moneygo.git
synced 2025-07-01 12:08:37 -04:00
Move RemoteId from transactions to splits
This is the more sensible location for it, since we import things on a per-account basis - so there can be more than one remote ID associated with a transaction, and the splits are the per-account portion of transactions anyway.
This commit is contained in:
7
ofx.go
7
ofx.go
@ -44,8 +44,7 @@ func (i *OFXImport) AddTransaction(tran *ofxgo.Transaction, account *Account) er
|
||||
var t Transaction
|
||||
|
||||
t.Date = tran.DtPosted.UTC()
|
||||
t.RemoteId = tran.FiTID.String()
|
||||
// TODO CorrectFiTID/CorrectAction?
|
||||
|
||||
// Construct the description from whichever of the descriptive OFX fields are present
|
||||
if len(tran.Name) > 0 {
|
||||
t.Description = string(tran.Name)
|
||||
@ -80,6 +79,10 @@ func (i *OFXImport) AddTransaction(tran *ofxgo.Transaction, account *Account) er
|
||||
if account.SecurityId < 1 || account.SecurityId > int64(len(i.Securities)) {
|
||||
return errors.New("Internal error: security index not found in OFX import\n")
|
||||
}
|
||||
|
||||
s1.RemoteId = tran.FiTID.String()
|
||||
// TODO CorrectFiTID/CorrectAction?
|
||||
|
||||
security := i.Securities[account.SecurityId-1]
|
||||
s1.Amount = amt.FloatString(security.Precision)
|
||||
s2.Amount = amt.Neg(amt).FloatString(security.Precision)
|
||||
|
Reference in New Issue
Block a user