STEPS TO REPRODUCE 1. start kmymoney 2. load attached test file 3. Open report "Investment Capital Gains by Account (Customized - no conversion)" 4. Inspect report OBSERVED RESULT In the column “Capital gains” there is an incorrect output in line 6 EXPECTED RESULT Line 6 should be empty SOFTWARE/OS VERSIONS Operating System: openSUSE Leap 15.6 KDE Plasma Version: 5.27.11 KDE Frameworks Version: 5.115.0 Qt Version: 5.15.12 ADDITIONAL INFORMATION Followup for bug 451392
Created attachment 177656 [details] test file
Created attachment 177657 [details] Screenshot showing the issue
The mark on line 6 should not cover the right most column, because USD 0,00 as grand total is valid information.
Git commit 8639f5773cc2d6b5afd18b75a030aad281e18948 by Thomas Baumgart. Committed on 25/01/2025 at 14:25. Pushed by tbaumgart into branch 'master'. Fix grand total of multi currency list table report FIXED-IN: 5.2 M +2 -0 kmymoney/plugins/views/reports/core/listtable.cpp https://invent.kde.org/office/kmymoney/-/commit/8639f5773cc2d6b5afd18b75a030aad281e18948
Git commit 1a28c87d8596294c3082793c284d220b219fb9ec by Ralf Habacker. Committed on 25/01/2025 at 16:15. Pushed by habacker into branch 'master'. In ListTable class rename macro FORCE_FIRST_RANK to OPEN_BALANCE_RANK In the source code this rank value is mentioned as "opening balance" rank. M +1 -1 kmymoney/plugins/views/reports/core/listtable.h M +2 -2 kmymoney/plugins/views/reports/core/querytable.cpp https://invent.kde.org/office/kmymoney/-/commit/1a28c87d8596294c3082793c284d220b219fb9ec
Git commit 51be3149933ee9aec882fc7b798a389e5b6f1117 by Ralf Habacker. Committed on 25/01/2025 at 16:14. Pushed by habacker into branch 'master'. Convert variable rank to be an enum for more visibility M +22 -27 kmymoney/plugins/views/reports/core/listtable.cpp M +4 -0 kmymoney/plugins/views/reports/core/listtable.h https://invent.kde.org/office/kmymoney/-/commit/51be3149933ee9aec882fc7b798a389e5b6f1117
Created attachment 177674 [details] Screenshot showing investment gains by account after colum fix Thank you for fixing the column problem. Looking at the updated report, it makes me wonder what the basic definition of Grant Total is, as currently it simply repeats the values of “Total investment”.
Created attachment 177675 [details] Updated test file This test file shows why the grand total it is not simply a duplicate. Another question would be if it makes sense to show totals on price columns at all.
Created attachment 177676 [details] Test file with 3 currencies involved Thank you, i.e. the lines with “Total Investment” contain the totals of an investment (sub) account and the lines with “Grant Total” contain the totals grouped by currency, which becomes even clearer with the test case with 3 currencies.
(In reply to Thomas Baumgart from comment #8) > Another question would be if it makes sense to show totals on price columns at all. It does not make sense to add the prices together, as this leads to an incorrect percentage and capital gain. It may be possible to calculate the sum buy price as the sum of the purchase values / sum of the shares and sum last price as sum of ending market value / sum of shares
(In reply to Ralf Habacker from comment #7) > the basic definition of Grant Total is s/Grant total/Grand Total/ - thanks to Thomas for pointing out.
Git commit 5cdf5c2374957ae4af41c23b2dd1fa65c7281234 by Thomas Baumgart. Committed on 26/01/2025 at 16:25. Pushed by tbaumgart into branch 'master'. Prevent showing totals for columns where this does not make sense For some columns it does not make sense to sum up the separate row values. This change prevents from showing them. It also prevents from showing a zero price in rows for which no price information is present. M +21 -6 kmymoney/plugins/views/reports/core/listtable.cpp M +2 -2 kmymoney/plugins/views/reports/core/tests/data/test-investment-report-querytable-Investment-Capital-Gains-by-Account-_Customized_.csv M +16 -16 kmymoney/plugins/views/reports/core/tests/data/test-investment-report-querytable-Investment-Transactions-_Customized_.csv https://invent.kde.org/office/kmymoney/-/commit/5cdf5c2374957ae4af41c23b2dd1fa65c7281234