Bug 423870 - Report 'Transactions by Category' converts all records to base currency even if this option is not selected
Summary: Report 'Transactions by Category' converts all records to base currency even ...
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: reports (show other bugs)
Version: 5.1.0
Platform: PCLinuxOS Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
: 426796 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-07-04 13:15 UTC by danieljbridges
Modified: 2020-09-22 20:39 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.1.1


Attachments
Test File showing issue with report by category or payee (1.68 KB, application/x-kmymoney)
2020-08-15 14:31 UTC, danieljbridges
Details

Note You need to log in before you can comment on or make changes to this bug.
Description danieljbridges 2020-07-04 13:15:14 UTC
SUMMARY


STEPS TO REPRODUCE
1. Enter transactions in a ZMK denominated account
2. Configure 'Transactions by Payee Report' and deselect the 'Convert to Base Currency' option
3. Open report

OBSERVED RESULT
Currencies are always translated to the base currency whether or not this is selected. If base currency is not selected then value is prefixed with ZMK, but the value is the same.

EXPECTED RESULT
Value entered into the ledger with the currency prefix to be shown in the report.

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

ADDITIONAL INFORMATION
Comment 1 danieljbridges 2020-07-04 17:25:16 UTC
I can confirm that this appears to be generic and not related to the currency. My base currency is GBP and the following currencies (AUD, USD, EUR, MWK, ZMW) and are all converted to GBP in the report, whether convert to base currency is selected.
Comment 2 danieljbridges 2020-07-13 17:32:09 UTC
This seems like a major flaw in the report generation - it essentially can not deal with any currencies other than the base one.  This holds for all reports that report by category or payee.
Comment 3 Thomas Baumgart 2020-08-15 09:35:48 UTC
Can you supply a (small) demo file that shows the problem and attach it here at change the status to reported again? Many thanks in advance.
Comment 4 danieljbridges 2020-08-15 14:31:48 UTC
Created attachment 130888 [details]
Test File showing issue with report by category or payee

Have created a dummy file with two accounts in USD and GBP. Both have a single transaction worth 50 USD or 50 GBP. There are 4 favourite reports for Payee (base converted and unconverted) or for category (base converted and unconverted). Whether base converted or not the values are always converted to the base currency of the file (USD).
Comment 5 Thomas Baumgart 2020-08-17 18:43:07 UTC
Thanks for the file showing the problem. I did analyze it and in fact, the numbers are correct but the currency shown is wrong. For the reports you mention no GBP values should be shown as the categories are denominated in USD.

In order for this report to show foreign currencies and their values, the categories must be denominated in the foreign currency. So the fix will be to present the correct currency. If you want to see that it works, take a look at the transactions by account report.
Comment 6 Thomas Baumgart 2020-08-18 07:15:48 UTC
Git commit 49dcabca8bd912554185e49faff43c685b77764d by Thomas Baumgart.
Committed on 18/08/2020 at 06:25.
Pushed by tbaumgart into branch 'master'.

Show correct currency in report

In multi-currency transactions the transaction commodity was used as
currency instead of the categories currency. The value shown is correct.

This change fixes the problem by overriding the currency in this case
with the one of the category.

M  +11   -3    kmymoney/plugins/views/reports/core/querytable.cpp

https://invent.kde.org/office/kmymoney/commit/49dcabca8bd912554185e49faff43c685b77764d
Comment 7 Thomas Baumgart 2020-08-18 07:23:04 UTC
Git commit 1159cad3b33ab6cdd50985db7899228715b8fba1 by Thomas Baumgart.
Committed on 18/08/2020 at 07:21.
Pushed by tbaumgart into branch '5.1'.

Show correct currency in report

In multi-currency transactions the transaction commodity was used as
currency instead of the categories currency. The value shown is correct.

This change fixes the problem by overriding the currency in this case
with the one of the category.
FIXED-IN: 5.1.1

(cherry picked from commit 49dcabca8bd912554185e49faff43c685b77764d)

M  +11   -3    kmymoney/plugins/views/reports/core/querytable.cpp

https://invent.kde.org/office/kmymoney/commit/1159cad3b33ab6cdd50985db7899228715b8fba1
Comment 8 Jack 2020-09-22 20:39:34 UTC
*** Bug 426796 has been marked as a duplicate of this bug. ***