Also handle transactions without category #51

Merged
jacob1123 merged 4 commits from transactions_without_category into master 2022-04-14 22:35:32 +02:00
Showing only changes of commit df7b691bdd - Show all commits

View File

@ -139,6 +139,11 @@ func (h *Handler) calculateBalances(budget postgres.Budget, month Month,
categoriesWithBalance := []CategoryWithBalance{} categoriesWithBalance := []CategoryWithBalance{}
moneyUsed := numeric.Zero() moneyUsed := numeric.Zero()
categories = append(categories, postgres.GetCategoriesRow{
Group: "Income",
Name: "No Category",
ID: uuid.UUID{},
})
for i := range categories { for i := range categories {
cat := &categories[i] cat := &categories[i]
if cat.ID == budget.IncomeCategoryID { if cat.ID == budget.IncomeCategoryID {