Only show last month's overflow

This commit is contained in:
2021-12-08 15:21:10 +00:00
parent 11179a1593
commit 5e18d51b5d
4 changed files with 49 additions and 14 deletions

View File

@ -64,9 +64,10 @@ func (h *Handler) budgeting(c *gin.Context) {
firstOfPreviousMonth := firstOfMonth.AddDate(0, -1, 0)
params := postgres.GetCategoriesWithBalanceParams{
BudgetID: budgetUUID,
FromDate: firstOfMonth,
ToDate: firstOfNextMonth,
BudgetID: budgetUUID,
FromDate: firstOfMonth,
ToDate: firstOfNextMonth,
PrevFromDate: firstOfMonth.AddDate(0, -1, 0),
}
categories, err := h.Service.DB.GetCategoriesWithBalance(c.Request.Context(), params)
if err != nil {