SUMMARY My Brokerage account and investments are in local currency (US$) with one exception. One investment was purchased in a foreign currency (JPY) and that investment account is designated in JPY. When I run the Capital Gains report (for investments I still own), it lists the correct market value for the JPY investment but cost is wrong. It appears to have divided the cost in JPY twice by the US$ to JPY rate. In this case, correct cost per share is $52.24 (5550 JPY @ 106.2392 JPY/USD) but the program reports a cost of $0.49. Reviewing Price pairs, only the correct price pair of USD -> JPY = 106.2392 exists for that date. There is no JPY -> USD pair that might conflict. Investment Ledger also shows all amounts correctly. STEPS TO REPRODUCE 1. Setup a foreign currency investment account 2. Purchase an investment in the foreign currency 3. Run Capital Gains report for owned investments OBSERVED RESULT Market value of foreign currency is correctly displayed in local currency but cost is wrong EXPECTED RESULT Cost should be calculated correctly in local currency SOFTWARE/OS VERSIONS (available in About System) KDE Frameworks Version 5.91.0 Qt Version 5.15.2 (built against 5.15.2) ADDITIONAL INFORMATION
A test file would be helpful to determine whether the problem is also reproducible on the current git master branch.
Created attachment 175230 [details] possible test file
Created attachment 175231 [details] Screenshot showing investment gains by account report with KMyMoney 4.8
Created attachment 175232 [details] Screenshot showing investment gains by account report with KMyMoney 5.1.80 With kmymoney 5.1.80 the same report is empty.
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME. For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging. Thank you for helping us make KDE software even better for everyone!
(In reply to Ralf Habacker from comment #2) > Created attachment 175230 [details] > possible test file This test file does not match the initial reported error. An update is required.
(In reply to Ralf Habacker from comment #6) > This test file does not match the initial reported error. An update is > required. It looks not to be possible to create an according test file for an investment using a security. How to produce 1. start kmymoney 2. select tab investments 3. Create new account 4. enter values 5. enable "creating security" 6. finish creating After processing step 6. there is no security account added.
(In reply to Ralf Habacker from comment #7) > (In reply to Ralf Habacker from comment #6) > > This test file does not match the initial reported error. An update is > > required. > > It looks not to be possible to create an according test file for an > investment using a security. > > How to produce > 1. start kmymoney > 2. select tab investments > 3. Create new account > 4. enter values > 5. enable "creating security" > 6. finish creating > > After processing step 6. there is no security account added. To add a security, the investment account must be selected in the account list and ‘New investment’ selected in the right-click menu. Alternatively, you can select ‘New investment’ in the right-click menu via the open investment account in the general ledger.
Created attachment 176867 [details] test file (updated)
Created attachment 176868 [details] Screenshot showing Capital Gains report (only owned)
Git commit ff72e2d8ab942436fdc4e0758a4030672ed33a11 by Ralf Habacker. Committed on 23/01/2025 at 07:15. Pushed by habacker into branch 'master'. Add test report for investment transactions The still incorrect display of values for added/removed shares is caused by an incorrect mixing of the implementation of price and currency conversion and will be fixed elsewhere. Related: bug 498033 A +27 -0 kmymoney/plugins/views/reports/core/tests/data/test-investment-report-querytable-Investment-Transactions-_Customized_.csv M +7 -4 kmymoney/plugins/views/reports/core/tests/data/test-investment.xml https://invent.kde.org/office/kmymoney/-/commit/ff72e2d8ab942436fdc4e0758a4030672ed33a11
Created attachment 177652 [details] Screenshot from version 5.1.90 - Investment Capital Gains by Account (Customized) Values are looking correct
Created attachment 177653 [details] Screenshot from version 5.1.90 - Copy of Investment Capital Gains by Account (Customized - no conversion) Values are looking correct, but there is a duplicated line displayed (see red rectangle in the screenshot)
(In reply to Ralf Habacker from comment #13) > but there is a duplicated line displayed (see red rectangle in the screenshot) The wrong output is generated here https://invent.kde.org/office/kmymoney/-/blob/master/kmymoney/plugins/views/reports/core/listtable.cpp#L313 with rank == 5.
(In reply to Ralf Habacker from comment #14) > (In reply to Ralf Habacker from comment #13) > > but there is a duplicated line displayed (see red rectangle in the screenshot) > > The wrong output is generated here > https://invent.kde.org/office/kmymoney/-/blob/master/kmymoney/plugins/views/ > reports/core/listtable.cpp#L313 with rank == 5. Moved to bug 499116