mirror of
https://github.com/Zproger/Aurum.git
synced 2026-10-14 03:26:40 +07:00
get_budget_status() summed only transactions whose category_id matched the budgeted category exactly, while the Dashboard breakdown and the category report both roll a subcategory's spending up into its parent (coalesce(parent_id, id) in dashboard_service.py and reports_service.py). With one level of subcategories — the app supports exactly one — a budget on "Housing & Utilities" ignored everything filed under "Rent": the Dashboard showed 900 spent for the month and the Budget page showed 0 of 1000 for the same category, same month. Since insights_service's over-budget alert reads this same status, the alert stayed silent too. Budgets now count the budgeted category plus its children, matching the rollup the other two screens already use. A subcategory that has a budget of its own keeps tracking its own spending, so both bars move against their own limits — that case is pinned by a test as well.
5.5 KiB
5.5 KiB