Bug 416274 - Investment reports show incorrect annualized return percentage
Summary: Investment reports show incorrect annualized return percentage
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (other bugs)
Version First Reported In: git (master)
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
: 413667 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-01-15 01:49 UTC by Ian Neal
Modified: 2026-06-09 07:05 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 5.0.8
Sentry Crash Report:


Attachments
Test file that demonstrates issue (1.58 KB, application/x-kmymoney)
2020-01-15 01:49 UTC, Ian Neal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Neal 2020-01-15 01:49:05 UTC
Created attachment 125131 [details]
Test file that demonstrates issue

SUMMARY
The Investment performance by account shows incorrect percentage for some annualized returns when run against multiple investment accounts.

STEPS TO REPRODUCE
1. Create a number of different investment accounts with investments in, some with multiple investments, some with single.
2. Add price information so that an annualized return can be shown
3. Run report for Investment performance by account with date set to last 12 months.

OBSERVED RESULT
The report calculates the a

EXPECTED RESULT
The report calculates the annualized return percentages correctly for all investment accounts. Information from the annualized return percentage of prior investment accounts seems to get reused.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 29
(available in About System)
KDE Plasma Version: 5.14.5.1
KDE Frameworks Version: 5.59.0
Qt Version: 5.11.3

ADDITIONAL INFORMATION
If you select one account at a time, the report has the correct annualized return percentages.
Comment 1 Ian Neal 2020-01-15 01:51:26 UTC
OBSERVED RESULT
The report calculates the annualized return percentages for some lines incorrectly.
Comment 2 Thomas Baumgart 2020-01-17 18:07:13 UTC
Git commit f8ae85c34889b0023fe32d6e75569f18f2a8deac by Thomas Baumgart.
Committed on 17/01/2020 at 18:06.
Pushed by tbaumgart into branch '5.0'.

Fix subtotals in investment performance by account report

The subtotal rows were attached to the wrong groups. This change fixes
the order of the rows.
FIXED-IN: 5.0.8

M  +18   -6    kmymoney/plugins/views/reports/core/querytable.cpp

https://commits.kde.org/kmymoney/f8ae85c34889b0023fe32d6e75569f18f2a8deac
Comment 3 Thomas Baumgart 2020-01-17 18:08:37 UTC
*** Bug 413667 has been marked as a duplicate of this bug. ***
Comment 4 Thomas Baumgart 2020-01-17 18:10:03 UTC
Git commit bc83cbfd2eab462b764e1b62f0320c5b5647f680 by Thomas Baumgart.
Committed on 17/01/2020 at 18:09.
Pushed by tbaumgart into branch 'master'.

Fix subtotals in investment performance by account report

The subtotal rows were attached to the wrong groups. This change fixes
the order of the rows.
FIXED-IN: 5.0.8
(cherry picked from commit f8ae85c34889b0023fe32d6e75569f18f2a8deac)

M  +18   -6    kmymoney/plugins/views/reports/core/querytable.cpp

https://commits.kde.org/kmymoney/bc83cbfd2eab462b764e1b62f0320c5b5647f680
Comment 5 Ralf Habacker 2026-06-09 07:05:48 UTC
Git commit dfb0045928b8dd86be6c156b1021597c2d966aca by Ralf Habacker.
Committed on 09/06/2026 at 06:59.
Pushed by habacker into branch 'master'.

Add additional report test cases

The test cases were derived from tickets reporting bugs
in the reporting engine and were added to monitor the
relevant functionality.
Related: bug 385993, bug 396301, bug 403825, bug 406403, bug 406525, bug 426241, bug 441023, bug 452096, bug 452692, bug 498031, bug 498033, bug 498054, bug 499180

M  +15   -0    kmymoney/plugins/views/reports/core/tests/data/CMakeLists.txt
A  +46   -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-385993-report-querytable-Investitionsentwicklung-nach-Typen-_angepasst_.csv
A  +6    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-396301-report-querytable-Investment-Capital-Gains-by-Account-_Customized---no-conversion_.csv
A  +6    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-396301-report-querytable-Investment-Capital-Gains-by-Account-_Customized_.csv
A  +6    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-396301-report-querytable-Investment-Performance-by-Account-_Customized_.csv
A  +22   -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-396301-report-querytable-Investment-Transactions-_Customized_.csv
A  +7    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-403825-report-querytable-Transactions-by-Account-_Customized_.csv
A  +4    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-403825-report-querytable-Transactions-by-Payee-_Customized_.csv
A  +12   -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-416274-report-querytable-Investment-Performance-by-Account-_12m_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-426241-report-querytable-Investment-Capital-Gains-by-Account-_Customized_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-426241-report-querytable-Investment-Holdings-by-Account-_Customized_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-426241-report-querytable-Investment-Performance-by-Account-_Customized---from-period---one-year--start-later_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-426241-report-querytable-Investment-Performance-by-Account-_Customized---from-period---one-year_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-426241-report-querytable-Investment-Performance-by-Account-_Customized---from-period---three-year_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-426241-report-querytable-Investment-Performance-by-Account-_Customized---from-period---two-years_.csv
A  +27   -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-426241-report-querytable-Investment-Transactions-_Customized_.csv
A  +9    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-452096-report-querytable-Transactions-by-Category-_Customized_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-452692-report-querytable-Investment-Performance-by-Account-_Customized_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-452692-report-querytable-Investment-Performance-by-Account-_From-Period_---one-year.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-452692-report-querytable-Investment-Performance-by-Account-_Only-Owned_---until-2024.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-452692-report-querytable-Investment-Performance-by-Account-_Only-Owned_-one-year.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-452692-report-querytable-Kopie-von-Investment-Performance-by-Account-_From-Period_---until-2024.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-497935-report-querytable-Investment-Capital-Gains-by-Account-_custom-report---only-owned_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-497935-report-querytable-Investment-Performance-by-Account-_custom-report---only-owned_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-497935-report-querytable-Investment-Performance-by-Account-_custom-report---only-sold_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-497935-report-querytable-Investment-Performance-by-Account-_custom-report---owned-and-sold_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-497935-report-querytable-Investment-Performance-by-Account-_custom-report---period_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-498031-report-querytable-Investment-Capital-Gains-by-Account-_Customized_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-498031-report-querytable-Investment-Holdings-by-Account-_Customized_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-498031-report-querytable-Investment-Performance-by-Account-_Customized---from-period---one-year--start-later_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-498031-report-querytable-Investment-Performance-by-Account-_Customized---from-period---one-year_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-498031-report-querytable-Investment-Performance-by-Account-_Customized---from-period---three-year_.csv
A  +27   -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-498031-report-querytable-Investment-Transactions-_Customized_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-498033-report-querytable-Investment-Capital-Gains-by-Account-_Customized_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-498033-report-querytable-Investment-Holdings-by-Account-_Customized_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-498033-report-querytable-Investment-Performance-by-Account-_Customized---from-period---one-year--start-later_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-498033-report-querytable-Investment-Performance-by-Account-_Customized---from-period---one-year_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-498033-report-querytable-Investment-Performance-by-Account-_Customized---from-period---three-year_.csv
A  +27   -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-498033-report-querytable-Investment-Transactions-_Customized_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-498054-report-querytable-Investment-Capital-Gains-by-Account-_Customized_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-498054-report-querytable-Investment-Holdings-by-Account-_Customized_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-498054-report-querytable-Investment-Performance-by-Account-_Customized---from-period---one-year--start-later_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-498054-report-querytable-Investment-Performance-by-Account-_Customized---from-period---one-year_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-498054-report-querytable-Investment-Performance-by-Account-_Customized---from-period---three-year_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-499180-report-querytable-Investment-Capital-Gains-by-Account-_Customized_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-499180-report-querytable-Investment-Holdings-by-Account-_Customized_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-499180-report-querytable-Investment-Performance-by-Account-_Customized---from-period---one-year--start-later_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-499180-report-querytable-Investment-Performance-by-Account-_Customized---from-period---one-year_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-499180-report-querytable-Investment-Performance-by-Account-_Customized---from-period---three-year_.csv
A  +5    -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-499180-report-querytable-Investment-Performance-by-Account-_Customized---from-period---two-years_.csv
A  +27   -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-499180-report-querytable-Investment-Transactions-_Customized_.csv
A  +16   -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-516585-convert-currency-report-querytable-Transactions-by-Account-_Base-converted_.csv
A  +17   -0    kmymoney/plugins/views/reports/core/tests/data/csv/test-516585-convert-currency-report-querytable-Transactions-by-Account-_Base-unconverted_.csv
A  +1744 -0    kmymoney/plugins/views/reports/core/tests/data/test-385993.xml
A  +145  -0    kmymoney/plugins/views/reports/core/tests/data/test-396301.xml
A  +76   -0    kmymoney/plugins/views/reports/core/tests/data/test-403825.xml
A  +85   -0    kmymoney/plugins/views/reports/core/tests/data/test-406403.xml
A  +87   -0    kmymoney/plugins/views/reports/core/tests/data/test-406525.xml
A  +145  -0    kmymoney/plugins/views/reports/core/tests/data/test-416274.xml
A  +154  -0    kmymoney/plugins/views/reports/core/tests/data/test-426241.xml
A  +288  -0    kmymoney/plugins/views/reports/core/tests/data/test-441023.xml
A  +76   -0    kmymoney/plugins/views/reports/core/tests/data/test-452096.xml
A  +201  -0    kmymoney/plugins/views/reports/core/tests/data/test-452692.xml
A  +106  -0    kmymoney/plugins/views/reports/core/tests/data/test-497935.xml
A  +151  -0    kmymoney/plugins/views/reports/core/tests/data/test-498031.xml
A  +151  -0    kmymoney/plugins/views/reports/core/tests/data/test-498033.xml
A  +148  -0    kmymoney/plugins/views/reports/core/tests/data/test-498054.xml
A  +154  -0    kmymoney/plugins/views/reports/core/tests/data/test-499180.xml
A  +151  -0    kmymoney/plugins/views/reports/core/tests/data/test-516585-convert-currency.xml

https://invent.kde.org/office/kmymoney/-/commit/dfb0045928b8dd86be6c156b1021597c2d966aca