mirror of
https://github.com/aclindsa/moneygo.git
synced 2025-07-03 04:38:38 -04:00
Store currency/security values/prices using big.Rat natively
This adds 'shadow' types used only by the store/db internal package whch handle converting these types to their DB-equivalent values. This change should allow reports to be generated significantly faster since it allows a large portion of the computation to be shifted to the database engines.
This commit is contained in:
@ -31,9 +31,8 @@ func GetTransactionImbalances(tx store.Tx, t *models.Transaction) (map[int64]big
|
||||
}
|
||||
securityid = account.SecurityId
|
||||
}
|
||||
amount, _ := t.Splits[i].GetAmount()
|
||||
sum := sums[securityid]
|
||||
(&sum).Add(&sum, amount)
|
||||
(&sum).Add(&sum, &t.Splits[i].Amount.Rat)
|
||||
sums[securityid] = sum
|
||||
}
|
||||
return sums, nil
|
||||
|
Reference in New Issue
Block a user