Bug 419519 - Reports: Base Currency Conversions Incorrect
Summary: Reports: Base Currency Conversions Incorrect
Status: REPORTED
Alias: None
Product: kmymoney
Classification: Applications
Component: reports (show other bugs)
Version: 5.0.8
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-01 22:39 UTC by JAH
Modified: 2020-04-08 11:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Anonmised data in support of bug (2.91 MB, application/xml)
2020-04-08 11:41 UTC, JAH
Details

Note You need to log in before you can comment on or make changes to this bug.
Description JAH 2020-04-01 22:39:54 UTC
SUMMARY
When reporting foreign currency transactions with the flag "Convert to Base Currency" ticked kmymoney calculates the wrong value for base currency

STEPS TO REPRODUCE
1. Create a dividend for a security denominated in a foreign currency
2. The transaction is correctly converted to a base currency value in the brokerage account
3. Report the transaction and tick "Convert to base currency"

OBSERVED RESULT
The reported "base currency" value does not match that in the base currency brokerage account.

REMOVE the "Convert to base currency" flag and the report DOES convert the value into the base currency value (& CORRECTLY!) but precedes it with the foreign currency code (expected).

It seems to me that with the "Convert to base Currency" flag:
UNTICKED: kmymoney converts the values to base currency anyway (but accurately).
TICKED  : kmymoney does the conversion TWICE over by the same rate (by my calculation)

EXPECTED RESULT
UNTICKED: kmymoney should NOT convert foreign currency values to base currency at all.
TICKED  : kmymoney should convert foreign currency values base currency accurately


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: openSUSE 15.1
(available in About System)
KDE Plasma Version: 5.12.8
KDE Frameworks Version: 5.550
Qt Version: 5.9.7

ADDITIONAL INFORMATION
Also a problem in kmymoney 5.0.5
Comment 1 Thomas Baumgart 2020-04-02 05:51:24 UTC
Can you provide a small sample file that shows the problem and attach it here, please? That would significantly reduce the time to duplicate the problem and help us a lot in fixing it. Thanks in advance.
Comment 2 JAH 2020-04-08 11:41:56 UTC
Created attachment 127387 [details]
Anonmised data in support of bug

In this anonomysed version of my data the Report 000020 exemplifies the error I reported.

Under the report sub-section A000150: A000151 the last transaction is denominated in Euros and has the following characteristics:

With the "Convert to base currency" flag OFF:
Date                                    Account Memo                            Action          Amount     
02/03/2020	A000150: A000151	A000208	T000000000000004300/S0002	Dividend	EUR 3,347.60 

Date                                    Account Memo                            Action           BaseCurrency Value     
02/03/2020	A000150: A000151	A000208	T000000000000004300/S0002	Dividend	 2,173.06

If you drill through the report to the original transaction account A000113 the Euro Amount should be Eur 5,157
And drill though to the base currency brokerage account  A000114 the correct base currency value shows as GBP 3,347.6

Thus 
When the report is set to show the Foreign Currency value it instead shows Base Currency value (but preceded by the correct Foreign Currency Symbol)
When the report is set to show the Base Currency Value it instead shows a completely wrong value  (which seems to me to be the original Foreign Currency but "exchanged" twice i.e. compound exchange rate ^2)  

I hope this clarify the problem I encountered.
Comment 3 JAH 2020-04-08 11:43:08 UTC
Forgot to set flag to reported with submission of anonomyzed data.