When entering investment transactions with currency conversion and taxes (or fees), then the amount in the checking account is often incorrect (rounding error). I use KMyMoney 4.8.0 (on Ubuntu 16.04 LTS), and I confirmed that the same rounding error still exists in the latest development version from git://anongit.kde.org/kmymoney.git
*** Example ***
From the bank statement: dividend of 9000 JPY, taxes of 1378 JPY, exchange rate 0.8981 CHF for 100 JPY, amount received 68.45 CHF. This is correct: (9000 - 1378) * 0.8981 / 100 = 68.453, rounded to 68.45
In KMyMoney, the conversion dialog asks to convert 1378 JPY to CHF. When I enter the exchange rate (0.008981) then the final amount is 68.60 CHF (i.e., 0.15 CHF too high). When I instead enter the value (12.38 CHF for 1378 JPY) then the final amount is 68.48 CHF (i.e., 0.03 CHF too high).
*** Preferred solution ***
The conversion dialog asks for the final amount (in the above example 7622 JPY), which allows to enter the correct, final amount in CHF. The converted dividend and the converted tax is not showing up in any account statement (only in performance reports and the like), thus a small deviation by a few cents does not matter.
*** Possibly easier to implement solution ***
In case of split transactions, always have the user confirm the converted amount for each part of the split (although in theory the same rate is correct for all those splits as occuring on the same day).
Does this problem still exist in a recent version, such as 5.1.1? I don't know if this may have been addressed, but there were fixes related to some rounding issues.
Thanks for looking into this. I tested on KMyMoney 5.1.0-1; this is the up-to-date version on the newest on Kubuntu 20.10.
Outcome: the problem still persists. The deviation from the correct amount is slightly different, but still incorrect (the deviation is even larger then what I reported back in 2018).
Can you provide a small kmy file which demonstrates the problem? I'm unable to duplicate this, although I may be using different currency for each account and category, and different number of decimal places for each account. Thanks.
Please try entering the inverse conversion rate - instead of .008981 CHF per JPY try 111.35 JPY per CHF. I think there is limited precision of the stored conversion rate, so .008981 is only being stored as .0089. You can check that by looking at the Price Editor (menu item Tools/Prices) and looking at both JPY/CHF and CHF/JPY.
Created attachment 136622 [details]
Minimal data file
Thanks, Jack. Attached the requested minimal data file. I have entered the same transaction twice: once using the JPY -> CHF conversion *rate*, once entering the converted CHF *amount* (see comments to the two transactions). Both time the amount in the bank account is inaccurate: 108.00 CHF, should be 108.48 CHF.
Created attachment 136623 [details]
Screenshot of conversion Dialog
Workaround was suggested to enter the inverted conversion rate. However, the conversion dialog does not have an option to use the inverted rate, see screenshot ConversionDialog.png
You have to use the Price Editor to enter the inverted conversion rate for that date, and do that before you enter the transaction. That's why you need to look at both conversion rated in the Price Editor to be sure there isn't a conflicting one already entered for that date.
Created attachment 136629 [details]
Minimal data file
Attached the updated minimal data file. I have entered the same transaction three times: (1) using the pre-entered CHF -> JPY conversion rate; (2) using the JPY -> CHF conversion *rate*; (3) using the converted CHF *amount* (see comments to the three transactions). Each time the amount in the bank account is inaccurate: 108.00 CHF, should be 108.48 CHF.
Additionally, note that the conversion rate CHF -> JPY entered in the price editor (1/0.008539 = 117.109731819) is correct when looked up in the price editor (albeit rounded to 117.1097) but incorrect in the conversion dialog when entering a transaction: JPY -> CHF = 0.0085 and CHF -> JPY = 117.1341. The latter is 1/0.0085.
Git commit e9786584d3f23e168ec52029437bfcd46ca5f072 by Thomas Baumgart.
Committed on 14/03/2021 at 09:02.
Pushed by tbaumgart into branch '5.1'.
Differentiate between trading currency and others
If the trading currency of a security has a smaller fraction than the
currencies of the other accounts in a transaction the values will be
truncated. This change fixes the problem by using the fraction
information from the account involved.
M +13 -9 kmymoney/dialogs/investtransactioneditor.cpp