diff --git a/server/budgeting.go b/server/budgeting.go index 5d2e97e..1424f8d 100644 --- a/server/budgeting.go +++ b/server/budgeting.go @@ -88,7 +88,7 @@ func (*Handler) getAvailableBalance(budget postgres.Budget, month Month, continue } - if !month.nextMonth().isAfter(bal.Date) { + if !month.InPast(bal.Date) { continue } @@ -152,19 +152,19 @@ func (h *Handler) calculateBalances(budget postgres.Budget, month Month, } // skip everything in the future - if month.nextMonth().isAfter(bal.Date) { + if month.InFuture(bal.Date) { continue } moneyUsed.SubI(bal.Assignments) categoryWithBalance.Available.AddI(bal.Assignments) categoryWithBalance.Available.AddI(bal.Transactions) - if !categoryWithBalance.Available.IsPositive() && month.isAfter(bal.Date) { + if !categoryWithBalance.Available.IsPositive() && month.InPast(bal.Date) { moneyUsed.AddI(categoryWithBalance.Available) categoryWithBalance.Available = numeric.Zero() } - if month.contains(bal.Date) { + if month.InPresent(bal.Date) { categoryWithBalance.Activity = bal.Transactions categoryWithBalance.Assigned = bal.Assignments }