Summary: | Income and Expenses chart displays wrong stats when currency rate changes | ||
---|---|---|---|
Product: | [Applications] kmymoney | Reporter: | Tamer <tfawzy> |
Component: | reports | Assignee: | KMyMoney Devel Mailing List <kmymoney-devel> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | tfawzy |
Priority: | NOR | ||
Version: | 5.1.2 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Microsoft Windows | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Income and Expenses chart displays wrong stats when currency rate changes |
The problem is due to aggregation - which happens on the reporting period - and the conversion to the base currency which is performed on the aggregated values. That means, that at the time of conversion to the base currency, the actual transaction is not visible anymore but only the aggregated value for the month in this case. No matter if you pick the first or last date of the period to get the conversion rate at this point it maybe wrong depending when the rate changed. In your case, if the conversion changed back to 1:4 on March 24th it does not matter if you pick March 1st or March 31st: both will be provide the wrong result. To solve this issue, it would be better to aggregate not only on the basis of the account's currency but also on the base currency and do the conversion on the basis of the rate at the post date. Then during rendering of the report use the aggregated account's value or the aggregated converted value. That will provide more accurate results but means a large change to the reporting system. |
Created attachment 147812 [details] Income and Expenses chart displays wrong stats when currency rate changes SUMMARY *** "Income and Expenses This Year" Report showing incorrect values in a month if the currency conversion rate was changed during the month. *** STEPS TO REPRODUCE 1. Create a new KMyMoney file having base currency as EGP 2. ADD another currency AED and make the conversion rate of 1 AED = 4 EGP with a date of 1 Jan 2022 3. Make new entry for the conversion rate to be 1 AED = 5 EGP with a date of 20 Mar 2022 4. Create a saving account "My Bank" with AED Currency. 5. Create a category "Salary" with EGP Currency. 6. Change the base currency to be AED (tools -->Currencies) 7. Add a new transaction in "My Bank" account for 1,000 AED dated 22 Mar 2022 8. Go to (Reports --> 1. Income and Expenses) and select (Income and Expenses This year) OBSERVED RESULT The report will show an income of 1,250 AED EXPECTED RESULT The report must show an income of 1,000 AED as entered. MY ANALYSIS: It looks like the application did the following: 1. Converted the 1,000 AED with the rate of 1 AED= 5 EGP which made it 5,000 EGP (as this is the currency of the category "Salary") which is correct behavior as conversion rate was changed on 20 Mar 2022 so application picked the right rate. 2. Converted back the 5,000 EGP to the base currency (AED) at the rate of 1 AED=4 EGP which was the conversion rate at the beginning of the month, and the result is 1,250 AED which is totally wrong. This behavior is giving false stats on the income and expenses and users can make wrong decisions in their life. SOFTWARE/OS VERSIONS Windows: Windows 10 macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION