Fix mortgage payments showing as Uncategorized with zero actual amounts on Balance view #227
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nidde/parenting-tool!227
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "copilot/fix-mortgage-payments-categorization"
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?
On the monthly Balance view, actualized mortgage payments landed in "Uncategorized" and always showed a zero actual amount — meaning paid periods looked identical to unpaid ones in both the doughnut chart and category list.
Root Cause
BalanceService::getDetailedMonthlyBalance()pushed mortgage interest and principal entries withoutcategory,actual_amount,is_virtual, oris_deferred:transaction.category?.nameevaluated toundefined→ fell back to'Uncategorized'parseFloat(undefined)returnsNaN;NaN || 0collapses to0, so actual amounts never renderedFix
Added the four missing fields to both mortgage push objects. Since these entries are constructed exclusively from
ActualizedMortgagerecords,actual_amountequals the recorded value andis_virtual/is_deferredare bothfalse:Type of Change
Testing
Code Quality
CI/CD Checks
Additional Notes
Extended the existing
'detailed monthly balance includes mortgage payments separately'test with 6 new assertions coveringactual_amount,is_virtual,is_deferred, andcategory->namefor both mortgage entries.Comment
@coderabbitai helpto get the list of available commands and usage tips.Pull request overview
Fixes monthly Balance view mortgage entries rendering as “Uncategorized” with
0actual amounts by ensuring mortgage expense detail objects include the same key fields as other expenses, and adds assertions to prevent regressions.Changes:
category,actual_amount,expected_amount,is_virtual, andis_deferredinBalanceService::getDetailedMonthlyBalance().DEVLOG.mdandCHANGELOG.md.Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
@ -12,2 +17,4 @@- Updated `.github/workflows/copilot-setup-steps.yml`:This section now contains multiple consecutive blank lines (17–19) and the workflow update bullets (20–21) appear to be orphaned from their prior heading (removed in this diff). Please either reintroduce an appropriate heading for the workflow note, move it under an existing section, or remove it if it’s unrelated to this entry; also collapse the extra blank lines to keep the devlog readable.
@ -374,3 +383,4 @@'is_mortgage' => true,'category' => (object) ['name' => 'Mortgage'],]);}The two push objects duplicate the same set of fields (
expected_amount,actual_amount,is_virtual,is_deferred,is_mortgage,category), which increases the risk of future drift (e.g., adding a new required field to one but not the other). Consider extracting a small private helper (or building a shared base array/object and overridingname/amount) and reusing a single$mortgageCategoryobject/value to keep these entries consistent.