Bug 415668

Summary: Networth by month shows incorrect values for investment
Product: [Applications] kmymoney Reporter: Thomas Baumgart <tbaumgart>
Component: reportsAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: grave CC: chrisito
Priority: NOR    
Version: 5.0.7   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.0.8
Attachments: Sample file showing the networth by month report error

Description Thomas Baumgart 2019-12-29 09:05:47 UTC
Created attachment 124768 [details]
Sample file showing the networth by month report error

SUMMARY
The reported values for an investment differ between the reports. Networth By Year report shows correct values, the numbers provided in Networth By Month are wrong. From the numbers it seems that the number of shares is multiplied twice with the price instead of once.

STEPS TO REPRODUCE
1. Open attached sample file
2. Open Networth by month report
3. Open Networth by year report

OBSERVED RESULT
Values for Portfolio account differ

EXPECTED RESULT
Values for Portfolio account are identical
Comment 1 Thomas Baumgart 2019-12-29 13:39:47 UTC
Looks like I introduced this myself when fixing bug 398982 with https://cgit.kde.org/kmymoney.git/commit/?id=83dd7a0d14b9700ca2632bafb8aba4c522d68685
Comment 2 Thomas Baumgart 2019-12-30 07:48:49 UTC
Git commit c4c0e3c3a0453f806c0fff5de884788c8953bba1 by Thomas Baumgart.
Committed on 30/12/2019 at 07:48.
Pushed by tbaumgart into branch '5.0'.

Avoid duplicate multiplication with price for investments

In non forecast reports, the number of shares of investment accounts was
multiplied twice with the price due to a change made with commit
83dd7a0d.

This change reverts commit 83dd7a0d and fixes the original problem in
the right place.
FIXED-IN: 5.0.8

M  +5    -5    kmymoney/plugins/views/reports/core/pivottable.cpp

https://commits.kde.org/kmymoney/c4c0e3c3a0453f806c0fff5de884788c8953bba1
Comment 3 Thomas Baumgart 2019-12-30 07:49:55 UTC
Git commit f382487fc966383282a704b4f91f8e26c0b20b18 by Thomas Baumgart.
Committed on 30/12/2019 at 07:49.
Pushed by tbaumgart into branch 'master'.

Avoid duplicate multiplication with price for investments

In non forecast reports, the number of shares of investment accounts was
multiplied twice with the price due to a change made with commit
83dd7a0d.

This change reverts commit 83dd7a0d and fixes the original problem in
the right place.
FIXED-IN: 5.0.8
(cherry picked from commit c4c0e3c3a0453f806c0fff5de884788c8953bba1)

M  +5    -5    kmymoney/plugins/views/reports/core/pivottable.cpp

https://commits.kde.org/kmymoney/f382487fc966383282a704b4f91f8e26c0b20b18
Comment 4 Thomas Baumgart 2020-01-25 14:47:11 UTC
*** Bug 414246 has been marked as a duplicate of this bug. ***