Created attachment 186443 [details] Net worth by month with wrong balance SUMMARY I have a 0 balance reconcilled account. In the net worth by month report it shows correctly as currently balance 0 if I have the account open but if I close the account, it then shows an incorrect negative balance on the monthly report. STEPS TO REPRODUCE 1. Have an account with 0 balance where it went to zero a few months ago. 2. View net worth by month report, account shows up with currently 0 balance. 3. Close account 4. View net worth by month report, account shows up with new incorrect negative balance. OBSERVED RESULT Incorrect balance in net worth by month report for closed account with 0 balance. EXPECTED RESULT Correct 0 balance in net worth by month report for closed account with 0 balance. SOFTWARE/OS VERSIONS Windows: 10 22H2 KDE Frameworks Version: 6.18.0 ADDITIONAL INFORMATION Balances show correctly if account is open or closed in the net worth by year report and all other reports that I can find. It is only the monthly report that is wrong. This happens even if I create a new monthly report from scratch so it isn't my customisations.
Created attachment 186444 [details] Account with correct balance when open
Created attachment 186445 [details] Transactions showing 0 balance on account
Problem seems to be, that when the account is closed, the starting balance for the report is not calculated/used.
I've just seen that changing the range on the monthly report from 12 months to 6 months produces a different wrong negative balance. It was -300 for 12 months, but changes to -1211.10 for the 6 month view.
Git commit 2eedc2ec2bb7c46209c411702e63da81dae77d61 by Thomas Baumgart. Committed on 08/11/2025 at 16:48. Pushed by tbaumgart into branch 'master'. Fix pivot reports with transactions in closed accounts The calculation of the balance of closed accounts when they need to be included in a pivot report did not work properly. This change fixes the problem and provides a test case for the scenario. FIXED-IN: 5.2.2 M +10 -10 kmymoney/mymoney/mymoneyfile.h M +1 -1 kmymoney/mymoney/storage/journalmodel.cpp M +16 -9 kmymoney/plugins/views/reports/core/pivottable.cpp M +1 -0 kmymoney/plugins/views/reports/core/tests/data/CMakeLists.txt A +8 -0 kmymoney/plugins/views/reports/core/tests/data/csv/test-closed-account-report-pivottable-Net-Worth-By-Month-_Customized_.csv A +95 -0 kmymoney/plugins/views/reports/core/tests/data/test-closed-account.xml https://invent.kde.org/office/kmymoney/-/commit/2eedc2ec2bb7c46209c411702e63da81dae77d61
Git commit 4887bebb128cdce0278cf721645bbf50eca4d319 by Thomas Baumgart. Committed on 08/11/2025 at 16:55. Pushed by tbaumgart into branch '5.2'. Fix pivot reports with transactions in closed accounts The calculation of the balance of closed accounts when they need to be included in a pivot report did not work properly. This change fixes the problem and provides a test case for the scenario. FIXED-IN: 5.2.2 (cherry picked from commit 2eedc2ec2bb7c46209c411702e63da81dae77d61) M +10 -10 kmymoney/mymoney/mymoneyfile.h M +1 -1 kmymoney/mymoney/storage/journalmodel.cpp M +16 -9 kmymoney/plugins/views/reports/core/pivottable.cpp M +1 -0 kmymoney/plugins/views/reports/core/tests/data/CMakeLists.txt A +8 -0 kmymoney/plugins/views/reports/core/tests/data/test-closed-account-report-pivottable-Net-Worth-By-Month-_Customized_.csv A +95 -0 kmymoney/plugins/views/reports/core/tests/data/test-closed-account.xml https://invent.kde.org/office/kmymoney/-/commit/4887bebb128cdce0278cf721645bbf50eca4d319
I've downloaded the latest build and tried it out and it does indeed work for my use case. Thank you very much!