SUMMARY *** Incorrect Currency Conversion in Reports *** Transaction reports of foreign currency transactions (dividends in my case) do not work as intended. Selecting "Convert Values to base Currency" corrupts values and provides erroneous totals (which should not bethere since the reports contains mixed currencies). NOT selecting "Convert Values to base Currency" DOES convert values into the base currency with correct values & totals (and a nuisance currency code before each value when their all in the base currency. An inability to report accurately invalidates storing the data. STEPS TO REPRODUCE 1. Create a foreign currency dividend 2. Run the report "Transactions by Category" 3. Tick the box "Convert Values to base Currency" OBSERVED RESULT The report of foreign values are wrong and not converted to the base currency EXPECTED RESULT Foreign values should be converted to the base currency SOFTWARE/OS VERSIONS Windows: macOS: kmymoney: 5.1.1-ad14462 Linux/KDE Plasma: opensuse 15.2 (available in About System) KDE Plasma Version: 15.8.6 KDE Frameworks Version: 5.71.0 Qt Version: 5.12.7 ADDITIONAL INFORMATION This is a variation of bug 419519 in Vn 5.0.8 Do NOT tick the "Convert Values to base Currency" box & foreign values WILL be converted to base currency (and totalled correctly). DO tick "Convert Values to base Currency" & random wrong values appear with erroneous totals.
*** Bug 451269 has been marked as a duplicate of this bug. ***
Created attachment 173063 [details] test case I checked this with a build from the master branch with the appended test case and think that there is an issue. In the report "Buchungen nach Kategorie (mit Umrechnung)" there is dividend 29.08.2024 [Leerer Zahlungsempfänger] [Kein Stichwort] checking (BTC) 0,57 while in the report "Buchungen nach Kategorie (ohne Umrechnung)" there is dividend 29.08.2024 [Leerer Zahlungsempfänger] [Kein Stichwort] checking (BTC) EUR 0,57 Shouldn't “BTC 0,00001000” be displayed there ?
(In reply to Ralf Habacker from comment #2) > while in the report "Buchungen nach Kategorie (ohne Umrechnung)" there is > > dividend 29.08.2024 [Leerer Zahlungsempfänger] [Kein Stichwort] checking (BTC) EUR 0,57 > > Shouldn't “BTC 0,00001000” be displayed there ? .. which is displayed with kmymoney version 4.8
(In reply to Ralf Habacker from comment #3) > (In reply to Ralf Habacker from comment #2) > > while in the report "Buchungen nach Kategorie (ohne Umrechnung)" there is > > > > dividend 29.08.2024 [Leerer Zahlungsempfänger] [Kein Stichwort] checking (BTC) EUR 0,57 > > > > Shouldn't “BTC 0,00001000” be displayed there ? > > .. which is displayed with kmymoney version 4.8 Also the tooltip in the checkbox for "Convert values to base currency" (https://invent.kde.org/office/kmymoney/-/blob/master/kmymoney/plugins/views/reports/reporttabgeneral.ui#L68) shows > Select this option to convert all values in the report to your base currency. > Leave it unchecked if you would like to see values in their original currency. > If currencies are not converted, then subtotals will not be shown.
Commit https://invent.kde.org/office/kmymoney/commit/467f0cc2d07104d4770868c8b8b3b6d16345700d has been added to fix the error 382245 is responsible for this problem. A revert shows the amount in the currency of the account in question.
A possibly relevant merge request was started @ https://invent.kde.org/office/kmymoney/-/merge_requests/230
A possibly relevant merge request was started @ https://invent.kde.org/office/kmymoney/-/merge_requests/231
Git commit b71085f8ad71eb614b69483190056b53d7264081 by Ralf Habacker. Committed on 15/09/2024 at 06:24. Pushed by habacker into branch 'master'. Add test case for working reports Currently the report with currency conversion has been added for testing as it looks as expected. M +1 -0 kmymoney/plugins/views/reports/core/tests/data/CMakeLists.txt A +9 -0 kmymoney/plugins/views/reports/core/tests/data/test-448788-report-querytable-Buchungen-nach-Kategorie-_mit-Umrechnung_.csv A +200 -0 kmymoney/plugins/views/reports/core/tests/data/test-448788.xml https://invent.kde.org/office/kmymoney/-/commit/b71085f8ad71eb614b69483190056b53d7264081
Git commit bf6ec53563beff53c52c0d0eabc82e664be0bad9 by Ralf Habacker. Committed on 15/09/2024 at 06:24. Pushed by habacker into branch 'master'. Add reference file with expected behavior without currency conversion A +9 -0 kmymoney/plugins/views/reports/core/tests/data/test-448788-report-querytable-Buchungen-nach-Kategorie-_ohne-Umrechnung_.csv https://invent.kde.org/office/kmymoney/-/commit/bf6ec53563beff53c52c0d0eabc82e664be0bad9
Git commit 26c6a5c827be45c2021f4d53af03c4a7f142ecb9 by Ralf Habacker. Committed on 15/09/2024 at 06:33. Pushed by habacker into branch 'master'. Fix not showing correct currency in multi currency category report The basic fix has been extracted from the 4.8 branch. FIXED-IN:5.2 M +15 -8 kmymoney/plugins/views/reports/core/querytable.cpp https://invent.kde.org/office/kmymoney/-/commit/26c6a5c827be45c2021f4d53af03c4a7f142ecb9
Git commit eec2645f3a5623a32390d209169c780a8c5c653e by Ralf Habacker. Committed on 30/10/2024 at 14:14. Pushed by habacker into branch 'master'. Fix conversion to base currency for reports containing categories The previously used logic to recognize the conversion to the base currency was not correct for the report mentioned in this error. It was added to fix bug 448788 and worked there because the base currency was taken from the first split, which happened to be the same as the one from the file. In general, when converting to the base currency, the base currency of the file should be used and not the currency from the first split, which has been corrected with this commit. Related: bug 382245 FIXED-IN:5.2.0 M +2 -2 kmymoney/plugins/views/reports/core/querytable.cpp https://invent.kde.org/office/kmymoney/-/commit/eec2645f3a5623a32390d209169c780a8c5c653e
Git commit 95e46fc151cfdabc5493983800facb32475d41a2 by Ralf Habacker. Committed on 30/10/2024 at 14:15. Pushed by habacker into branch 'master'. Correction of the expected test report values for “test-448788.xml” After the problem reported in bug 382245 was fixed, the expected values in the report “Bookings by category without conversion” from the mentioned test have changed and need to be adjusted. M +5 -5 kmymoney/plugins/views/reports/core/tests/data/test-448788-report-querytable-Buchungen-nach-Kategorie-_ohne-Umrechnung_.csv https://invent.kde.org/office/kmymoney/-/commit/95e46fc151cfdabc5493983800facb32475d41a2