Bug 416274

Summary: Investment reports show incorrect annualized return percentage
Product: [Applications] kmymoney Reporter: Ian Neal <iann_bugzilla>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal CC: avizit
Priority: NOR    
Version: git (master)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=413667
Latest Commit: Version Fixed In: 5.0.8
Sentry Crash Report:
Attachments: Test file that demonstrates issue

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