Bug 452692

Summary: Investment Performance by Account Only Owned
Product: [Applications] kmymoney Reporter: Peter Orczykowski <petero>
Component: reportsAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: major CC: ralf.habacker
Priority: NOR    
Version: 5.1.2   
Target Milestone: ---   
Platform: macOS (DMG)   
OS: macOS   
Latest Commit: Version Fixed In: 5.2
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 488491, 463974    
Attachments: Exhibit A
Exhibit B
attachment-3583-0.txt
Test.kmy
Screenshot from previous major version (
Screenshot from previous major version (update)
Test file (updated)

Description Peter Orczykowski 2022-04-17 08:29:23 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Select Investment Report By Account as of today
2. Change Report option to Only Owned
3. 

OBSERVED RESULT
Column Dividends Paid Out not showing

EXPECTED RESULT
Dividends Paid Out shown

SOFTWARE/OS VERSIONS
Windows: 
macOS: 12.3.1 (21E258)
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Peter Orczykowski 2022-04-21 01:26:37 UTC
Further, missing  Dividends Paid Out affect performance figures. This should be seen as a critical bug now IMHO.
Comment 2 Jack 2022-04-21 02:44:45 UTC
The column not being displayed on the report is completely separate from whether or not the dividends are accounted for in performance figures.  It would help a great deal if you could share a small test file demonstrating the problem, especially if the problem is more than simply a display issue.
Comment 3 Peter Orczykowski 2022-04-21 03:10:02 UTC
Created attachment 148276 [details]
Exhibit A
Comment 4 Peter Orczykowski 2022-04-21 03:10:40 UTC
Created attachment 148277 [details]
Exhibit B
Comment 5 Peter Orczykowski 2022-04-21 03:13:15 UTC
I have added two screen shots that clearly show the issue. Would that be sufficient?
Comment 6 Jack 2022-04-23 22:54:33 UTC
(In reply to Peter Orczykowski from comment #1)
The screen shots show that the columns disappear, and I believe one of the developers already had a solution in mind for that issue.  However, you claim that this affects performance figures.  This is what we need a demonstration of.  As I said in Comment #2, I do not believe that the missing columns have any effect on performance figures.
Comment 7 Peter Orczykowski 2022-04-24 01:48:32 UTC
Created attachment 148332 [details]
attachment-3583-0.txt

I have created a small test file with only one stock and few transactions. There are two saved reports under Favourite that show the issue,

Kind Regards,
Peter
Comment 8 Peter Orczykowski 2022-04-24 01:48:33 UTC
Created attachment 148333 [details]
Test.kmy
Comment 9 Jack 2022-04-24 23:29:57 UTC
Thanks, that is useful.  I realize that the change in values is likely not because of the hidden columns, but due to differences in how the report is generated when limited to only owned.  Now we just need to trace through the code to understand those differences.
Comment 10 Ralf Habacker 2024-11-10 07:15:56 UTC
Created attachment 175700 [details]
Screenshot from previous major version (

In the previous major version of kmymoney the column "Dividends paid out" is included in the associated report.
Comment 11 Ralf Habacker 2024-11-10 07:38:22 UTC
Created attachment 175702 [details]
Screenshot from previous major version (update)

Screenshot from previous version updated with corrected date range
Comment 12 Thomas Baumgart 2024-11-24 08:59:07 UTC
After looking at the code, I have to disagree with what has been stated in comment #2 and comment #9 above: it does make a difference if the column is included or not, at least for the totals. A possible change to adjust the code has been proposed on https://invent.kde.org/office/kmymoney/-/merge_requests/242.
Comment 13 Ralf Habacker 2024-11-26 13:34:15 UTC
Created attachment 176134 [details]
Test file (updated)

I updated the test file to show associated values directly on opening the reports. Also reports has been added showing that the column "annualized return" depends on the date range of the report.
Comment 14 Ralf Habacker 2024-12-02 06:22:18 UTC
Git commit d14267d1ed0872c29b8e2617e3cc5ed310f16878 by Ralf Habacker.
Committed on 02/12/2024 at 06:22.
Pushed by habacker into branch 'master'.

Correct name for column for IRR calculation in report code

The column with the name ‘ctReturn’ actually contains the IRR value and
is therefore renamed ‘ctInternalRateOfReturn’.

The problem was found by Thomas Baumgart (see
https://invent.kde.org/office/kmymoney/-/merge_requests/242#note_1083245).

M  +3    -3    kmymoney/plugins/views/reports/core/listtable.cpp
M  +1    -1    kmymoney/plugins/views/reports/core/listtable.h
M  +17   -25   kmymoney/plugins/views/reports/core/querytable.cpp
M  +3    -3    kmymoney/plugins/views/reports/core/tests/querytable-test.cpp

https://invent.kde.org/office/kmymoney/-/commit/d14267d1ed0872c29b8e2617e3cc5ed310f16878
Comment 15 Ralf Habacker 2024-12-04 10:19:50 UTC
Git commit 2a9b7af9d7a9b1693836b6aa0a110c4962225380 by Ralf Habacker.
Committed on 04/12/2024 at 10:19.
Pushed by habacker into branch 'master'.

Rename IRR-related enum and method to match what is actually calculated (XIRR)

Fixup for commit d14267d1e

M  +3    -3    kmymoney/plugins/views/reports/core/listtable.cpp
M  +1    -1    kmymoney/plugins/views/reports/core/listtable.h
M  +16   -16   kmymoney/plugins/views/reports/core/querytable.cpp
M  +1    -1    kmymoney/plugins/views/reports/core/querytable.h
M  +3    -3    kmymoney/plugins/views/reports/core/tests/querytable-test.cpp

https://invent.kde.org/office/kmymoney/-/commit/2a9b7af9d7a9b1693836b6aa0a110c4962225380
Comment 16 Ralf Habacker 2025-01-09 00:02:40 UTC
(In reply to Ralf Habacker from comment #15)
> Rename IRR-related enum and method to match what is actually calculated
> (XIRR)

As it turned out that the output under the ‘annualised return’ actually corresponds to the XIRR value, a column for the output of the ‘annualised return’ with the correct calculation based on the ROI and the report time range was added with https://invent.kde.org/office/kmymoney/-/merge_requests/251.
Comment 17 Ralf Habacker 2025-01-09 00:02:54 UTC
Git commit 710581e2fb247734eb194811262d3f4edff6054e by Ralf Habacker.
Committed on 09/01/2025 at 00:02.
Pushed by habacker into branch 'master'.

Add missing column "Dividends paid out"

Since the column was added to the calculation, it should also
be displayed.
FIXED-IN:5.2

M  +4    -2    kmymoney/plugins/views/reports/core/querytable.cpp

https://invent.kde.org/office/kmymoney/-/commit/710581e2fb247734eb194811262d3f4edff6054e