Bug 506346

Summary: Closed accounts are not being processed correctly in reports
Product: [Applications] kmymoney Reporter: StephenJH <stephen.henstridge>
Component: reportsAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.2.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description StephenJH 2025-06-29 14:42:49 UTC
SUMMARY
The default Net Worth graph (and customisations of it) are not handling closed accounts correctly. If I transfer the balance of one account to a new empty account (& close the source account), then the Net Worth graph should show a constant total balance. This is how it worked until the latest update (5.2.0). However, now it seems to be treating the source account as having a zero balance for the time period of the report, right up to the point where the transfer occurs. At that point the account's balance goes negative. The destination account shows the correct value. The resulting graph just shows a zero balance line. Re-opening the closed source account results in correct behaviour.

STEPS TO REPRODUCE
1. Choose 2 accounts involved in a transfer.
2. Close the source account (remember to re-open it later).
3. Select the Reports menu item and open the Net Worth graph. 
2. Click on New Report to create a custom report.
3. Click Filters -> Accounts and select just the 2 accounts involved in the transfer.
4. Click Report -> Rows/columns and select "Assets & Liabilities" and "Totals".
5. Select Range and set a date range covering the period of the transfer.
6. Set Data Range to Automatic
7. Click apply to save the custom report and then run it.

OBSERVED RESULT
The graph line (total of the 2 accounts) will dip permanently at the point where the transfer occurs.

EXPECTED RESULT
The line should remain level at that point.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: openSUSE Tumbleweed 20250626; Kernel 6.15.3-1-default (64-bit); Wayland.
KDE Plasma Version: 6.4.1
KDE Frameworks Version: 6.15
Qt Version: 6.9.1

ADDITIONAL INFORMATION