diff --git a/server/budgeting.go b/server/budgeting.go index f4dd4af..5778c6b 100644 --- a/server/budgeting.go +++ b/server/budgeting.go @@ -98,6 +98,15 @@ func (h *Handler) budgetingForMonth(c *gin.Context) { categoriesWithBalance, moneyUsed := h.calculateBalances( budget, firstOfNextMonth, firstOfMonth, categories, cumultativeBalances) availableBalance := h.getAvailableBalance(budget, moneyUsed, cumultativeBalances, firstOfNextMonth) + for i := range categoriesWithBalance { + cat := &categoriesWithBalance[i] + if cat.ID != budget.IncomeCategoryID { + continue + } + + cat.Available = availableBalance + cat.AvailableLastMonth = availableBalance + } data := struct { Categories []CategoryWithBalance