Reuse Correct Expense Total Calculation #1699
Reference in New Issue
Block a user
Delete Branch "fix/1663-consistent-expense-totals"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
fixes #1663
Root Cause:
"Spent" and "Expenses" values on the budget page are being calculated by different functions
The value under "Spent" is calculated with
budget.actual_spending, which does not include Uncategorized spending62%of the$3007is missingThis is because Uncategorized category is not present on the

budget_categoriesarray in thebudgetclassProposed Fix:
expense_categories_with_totals.total_moneywhich already calculates monthly expense totals, including Uncategorized spendingMoneytoamountto stay consistent with expected return type ofactual_spendingAlternatively
Could fix by explicit inclusion of uncategorized expenses in
actual_spending, butexpense_categories_with_totals.total_moneyalready calculates the desired value, and from the issue it seems we do expect the results to be the same, so I implemented the proposal above instead in this PR.Results
After implementing the fix, the totals are consistent

Nice, thanks for tracking this down! I think your chosen solution makes sense here.