Bug 455171 - Reports that include transactions in other currencies do not convert currencies to default, so totals are wrong
Summary: Reports that include transactions in other currencies do not convert currenci...
Status: REPORTED
Alias: None
Product: kmymoney
Classification: Applications
Component: reports (show other bugs)
Version: 5.1.2
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-12 02:03 UTC by jlboz
Modified: 2022-06-13 09:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jlboz 2022-06-12 02:03:05 UTC
SUMMARY
Reports that include transactions in other currencies do not convert currencies to default, so totals are wrong

***
My data include several currencies.  When I make a report such as 'Income and Expenses for Year' in my default currency that includes any category where the entries are in another currency, those entries are entered in the report without conversion. So if the conversion rate should be 50:1 between the other currency and the default, the number entered in the report for that category is 50 times what it should be and all the totals in the report that include that number are wrong. 

In the report configuration there is an option 'Convert values to base currency' but it makes no difference whether it is selected or not.

STEPS TO REPRODUCE
1. Open a data file that includes a lot of data of transactions in a number of categories where some of the entries in some categories are in currencies other than the default currency
2. Select a report such as Income and Expenses by Year
3. Find a category where some transactions in a particular year are not in the default currency and note the total given in the report.
4. Compare that result with the total expected when the transactions are all correctly converted to the default currency

OBSERVED RESULT
The total in the report is the result of adding up the numerical values of transactions without any conversion. For example if the default currency is AUD and a transaction is 500 AUD it appears in the report as '500', which is correct. If a transaction is 25,000 RUB it appears in the report as '25,000' which is wrong because it should be converted to '607' for the report when that reflects the chosen rate of conversion. The number '25,000' in the report then makes all the relevant totals in the report wrong.

EXPECTED RESULT
A report should convert all transactions to the default currency when that option is selected.

SOFTWARE/OS VERSIONS
Windows: Edition	Windows 10 Pro
Version	21H2
Installed on	‎2020-‎06-‎02
OS build	19044.1706
Experience	Windows Feature Experience Pack 120.2212.4170.0

macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 5.93
Qt Version: 5.15.2

ADDITIONAL INFORMATION
PLEASE NOTE  I raised this issue before as bug 426796 and it was treated as a duplicate of bug 423870. This was an error. Bug 423870 appears to be a different problem where transactions ARE converted to the default currency. The problem here is that foreign currency transactions ARE NOT converted (no matter how the report options are set) and all reports affected by this bug are wrong. Bug 423870 is 'resolved/fixed' but the bug I describe in this report is not fixed. It is the same now as it was.
Comment 1 jlboz 2022-06-12 12:36:49 UTC
Since making this bug report I have discovered the transactions causing the problem have a currency conversion rate of 1:1. I am not at all sure how these transactions came to be saved in that condition, but at least it makes sense of the way they are handled in reports.

However it leaves me with a big difficulty. There appears to be no easy way of identifying which foreign exchange transactions have this erroneous conversion rate. I can easily enough find all transactions that are in currencies other than the default of course, but that does not show which transactions are affected.  It seems the only way to check the conversion rates is to open each transaction one at a time and perform some edit that results in it being saved again so that I can see the conversion dialogue window, and if needed correct the rate before saving. When there are many hundreds of transactions this is a very tedious and protracted task.  

If there was some way of displaying the conversion rate of each transaction in a report or a ledger view it would be  a considerable help.

It would be even better if there was a way of setting conversion rates for past transations in bulk, but I suspect that may be far from easy.

If you have any suggestions for an efficient way of correcting my data I would be very grateful.
Comment 2 Jack 2022-06-12 19:05:44 UTC
Instead of finding the problem transactions, find the problem exchange rates.  Go to Tool/Prices... and narrow the display by typing the foreign currency in the search box.  Then click the "show all stored prices" box.  That should display all conversions for the two currencies, and you can find those with a rate of 1.  You can either delete those prices or updated them to the correct conversion on that date.  If you delete them, I am not certain, but  believe KMM will use the most recent conversion rate prior to the date of the transaction, which may or may not be close enough for you.
Comment 3 jlboz 2022-06-13 09:33:03 UTC
Jack, many thanks for that helpful advice. It worked as you said and I have corrected as required all the conversions detected using the Price Editor. However, there are many more transactions, which also require correction, it did not detect. I cannot see any explanation for this. These are transactions in a currency where the Price Editor identified a considerable number of transactions but it omitted many more. I wondered if the particular categories might make a difference, but  all my categories use my default currency so this seems unlikely to be the reason why some transactions in other currencies are not detected by the Price Editor.