Skip to content

Reports: the five tabs give four different totals for the same date range #142

Description

@KenTaniguchi-R

Opening /reports and clicking through the tabs gives four different answers to "how much did I spend in the last 3 months?", all under an identical Last 3 months chip.

Tab Tile Value
Spending Total Spent $25,495.49
Income vs Expense Total Expenses $28,494.34
Trends Total Spent $9,905.63
Cash Flow Spent So Far $0.00

Observed live against the dev database on 2026-09-02, range Jun 2 – Sep 2.

Why each differs

  • SpendingspendingBaseConditions (src/lib/spending-helpers.ts:26) requires normalizedAmount < 0, pending = false, isTransfer = false, transferPairId IS NULL, notIncome, and aggregates with sumAbs.
  • Income vs ExpensegetIncomeVsExpense (src/queries/reports.ts:88) sums the raw signed amount and drops the normalizedAmount < 0 and notIncome conditions.
  • Trends — exactly 25,495.49 − 15,589.86 = 9,905.63. It is total spending minus Uncategorized, not a subset of selected categories.
  • Cash FlowgetSafeToSpend is hardcoded to the current calendar month. See Cash Flow tiles ignore the date filter; the "(current month)" hint is suppressed exactly when needed #145.

Money that exists on one tab and not another

Rent/Mortgage, $2,600.00 — absent from the Spending tab entirely. Its transactions net positive, so normalizedAmount < 0 drops them. The largest line in most budgets is missing from "Spending by Category".

Uncategorized, $15,589.86 (61% of spending) — absent from the Income vs Expense breakdown. isNotNull(transactions.categoryId) (src/queries/reports.ts:308) excludes it from the table while the tile above counts it.

The income breakdown covers 46% of the income tile. Investment $8,889.37 + Salary $5,835.65 + Other $600.00 = $15,325.02 against a stated $33,185.24 — same isNotNull cause.

Categories present in both tabs disagree, because Spending takes sumAbs of negatives (gross) while Income vs Expense sums signed amounts (net of refunds):

Category Spending Income vs Expense Delta
Clothing $2,252.19 $1,878.60 $373.59
Home Goods $326.72 $301.97 $24.75
Internet $120.35 $119.84 $0.51

There is no tab on which a user can see all of their money at once.

Proposal

One shared definition of "spending" behind a single helper, used by every tab. Anything deliberately excluded from it (rent netting positive, transfers, pending) is named on screen, not silently dropped. Where a tile and the table beneath it use different scopes, the tile says so.

This is a trust bug: the first thing a new user does with a finance app is check whether it agrees with itself, and this page fails that check in four clicks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: uiFrontend / UI componentsbugSomething isn't workingpriority: criticalBreaking or security issue

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions