Use in-place additions more
This commit is contained in:
parent
8ecfd6b87a
commit
fc29b1409d
@ -204,10 +204,10 @@ func (*Handler) CalculateCategoryBalances(cat *postgres.GetCategoriesRow,
|
|||||||
}
|
}
|
||||||
|
|
||||||
moneyUsed.SubI(bal.Assignments)
|
moneyUsed.SubI(bal.Assignments)
|
||||||
categoryWithBalance.Available = categoryWithBalance.Available.Add(bal.Assignments)
|
categoryWithBalance.Available.AddI(bal.Assignments)
|
||||||
categoryWithBalance.Available = categoryWithBalance.Available.Add(bal.Transactions)
|
categoryWithBalance.Available.AddI(bal.Transactions)
|
||||||
if !categoryWithBalance.Available.IsPositive() && bal.Date.Before(firstOfMonth) {
|
if !categoryWithBalance.Available.IsPositive() && bal.Date.Before(firstOfMonth) {
|
||||||
moneyUsed.Add(categoryWithBalance.Available)
|
moneyUsed.AddI(categoryWithBalance.Available)
|
||||||
categoryWithBalance.Available = numeric.Zero()
|
categoryWithBalance.Available = numeric.Zero()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user