| Summary: | Foreign Currency Amounts inaccurate in Transaction Report | ||
|---|---|---|---|
| Product: | [Applications] kmymoney | Reporter: | JAH <vanquestor> |
| Component: | general | Assignee: | KMyMoney Devel Mailing List <kmymoney-devel> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | onet.cristian, ralf.habacker |
| Priority: | NOR | ||
| Version First Reported In: | 4.6.6 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | http://commits.kde.org/kmymoney/e3967e5918ba887c69e4de809605072686bc2f91 | Version Fixed/Implemented In: | 4.7.2 |
| Sentry Crash Report: | |||
| Attachments: |
TEst1.kmy
Screenshot of the associated report without currency conversion Screenshot of the associated report with currency conversion showing the issue Updated test file Screenshot of the associated report with currency conversion to explain the results Updated test file (with price column in report with conversion) |
||
|
Description
JAH
2015-03-26 15:18:47 UTC
Could you create a test file or an anonymous test file that demonstrates this problem? Take a look at this description of the anonymous file: https://docs.kde.org/stable/en/extragear-office/kmymoney/details.formats.anonymous.html I'm asking for this because last time I've checked a report for an account using a currency other than the base currency everything looked fine. The fact that you said that you had the currency conversion checkbox unchecked makes me even more suspicious since in that case there is really no conversion of values performed so the amounts should match those in the account. Created attachment 91761 [details] TEst1.kmy Hi Cristian, Thanks you for the very quick reply. I have attached a test .kmy file which seems to clearly demonstrate the issue. I have posted 2 transactions to the Foreign account. The first I converted to an absolute GBP value and the second I used an exchange rate. If you run the Transactions report for the account you'll see it does not accurately reflect the Dollar amounts posted when the "use base currency" box is unchecked. I saved the report as a Transaction report too. I trust the fault is not mine and that this helps identify the problem (in an otherwise great piece of software) Regards John On 26/03/15 15:26, Cristian Oneț wrote: > https://bugs.kde.org/show_bug.cgi?id=345550 > > Cristian Oneț <onet.cristian@gmail.com> changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > Status|UNCONFIRMED |NEEDSINFO > CC| |onet.cristian@gmail.com > Resolution|--- |WAITINGFORINFO > > --- Comment #1 from Cristian Oneț <onet.cristian@gmail.com> --- > Could you create a test file or an anonymous test file that demonstrates this > problem? Take a look at this description of the anonymous file: > https://docs.kde.org/stable/en/extragear-office/kmymoney/details.formats.anonymous.html > > I'm asking for this because last time I've checked a report for an account > using a currency other than the base currency everything looked fine. The fact > that you said that you had the currency conversion checkbox unchecked makes me > even more suspicious since in that case there is really no conversion of values > performed so the amounts should match those in the account. > I saw the problem. From looking at the file, things seem to be stored correctly. One other thing to be aware of: in case you check the 'convert all values to base currency' then the opening balance is not adjusted. That could be due to a missing price information. For the other transactions we do have a price: the one that is stored with the transaction. This certainly looks like a little bug. Thanks to John for reporting and providing a test file. (In reply to Thomas Baumgart from comment #3) > I saw the problem. From looking at the file, things seem to be stored > correctly. One other thing to be aware of: in case you check the 'convert > all values to base currency' then the opening balance is not adjusted. That > could be due to a missing price information. For the other transactions we > do have a price: the one that is stored with the transaction. This certainly > looks like a little bug. Thanks to John for reporting and providing a test > file. I've identified the problem, it was introduced by this fix: https://projects.kde.org/projects/extragear/office/kmymoney/repository/revisions/9fc583d3db4fe2c16448790d7ee17145fbe8bd2f I've added a testcase to catch the issue and proposed a fix at: https://git.reviewboard.kde.org/r/123154/ Git commit 31adc38e7d632fb79eb3163998c8c568ee957383 by Cristian Oneț. Committed on 27/03/2015 at 17:08. Pushed by conet into branch 'master'. Fix foreign currency income/expense transactions in reports. Since commit 9fc583d3db4fe2c16448790d7ee17145fbe8bd2f was added as a fix for some currency conversions performed in reports income/expense transactions which involved a currency conversion were not properly displayed in the transactions by account report. Extended the multi-currency report testcase to catch this error and fixed the problem by resurrecting some conversion code which was removed by that commit, but moved it to a place where it's applied only to income/expense transactions. REVIEW: 123154 M +6 -1 kmymoney/reports/querytable.cpp M +7 -2 kmymoney/reports/querytabletest.cpp http://commits.kde.org/kmymoney/31adc38e7d632fb79eb3163998c8c568ee957383 Git commit 7b10760b947432e77078ade8d6ef1557321b3a74 by Cristian Oneț. Committed on 27/03/2015 at 17:08. Pushed by conet into branch '4.7'. Fix foreign currency income/expense transactions in reports. Since commit 9fc583d3db4fe2c16448790d7ee17145fbe8bd2f was added as a fix for some currency conversions performed in reports income/expense transactions which involved a currency conversion were not properly displayed in the transactions by account report. Extended the multi-currency report testcase to catch this error and fixed the problem by resurrecting some conversion code which was removed by that commit, but moved it to a place where it's applied only to income/expense transactions. REVIEW: 123154 (cherry picked from commit 31adc38e7d632fb79eb3163998c8c568ee957383) M +6 -1 kmymoney/reports/querytable.cpp M +7 -2 kmymoney/reports/querytabletest.cpp http://commits.kde.org/kmymoney/7b10760b947432e77078ade8d6ef1557321b3a74 Sorry to have to reopen this: using the attaced test file still does not show correct results when the 'convert all values to base currency' option is set/removed. The values do not change, only the currency is identified in case the option is turned off (USD in our case). I thought this would be caused by the conversion rate in the test file which is set to 1, but even if you change the rate to e.g. 1.5 , the values do not change in the report if the option is turned on. (In reply to Thomas Baumgart from comment #7) > Sorry to have to reopen this: using the attaced test file still does not > show correct results when the 'convert all values to base currency' option > is set/removed. The values do not change, only the currency is identified in > case the option is turned off (USD in our case). I thought this would be > caused by the conversion rate in the test file which is set to 1, but even > if you change the rate to e.g. 1.5 , the values do not change in the report > if the option is turned on. You are right, the code I brought back was originally on the else branch of the if 'convert all values to base currency' so I must add that check, I'll fix it in a minute. Git commit 6780bf61922eab24542f5d02b29a17b0df12299d by Cristian Oneț. Committed on 29/03/2015 at 12:48. Pushed by conet into branch 'master'. Fix foreign currency income/expense transactions in reports. The previous commit broke the convert all values to the base currency use case. Fixed this by properly checking that flag before converting a split's value to the currency of the starting account. Extended the multiple currencies report test case to check this scenario. M +1 -1 kmymoney/reports/querytable.cpp M +32 -1 kmymoney/reports/querytabletest.cpp http://commits.kde.org/kmymoney/6780bf61922eab24542f5d02b29a17b0df12299d Git commit e3967e5918ba887c69e4de809605072686bc2f91 by Cristian Oneț. Committed on 29/03/2015 at 12:48. Pushed by conet into branch '4.7'. Fix foreign currency income/expense transactions in reports. The previous commit broke the convert all values to the base currency use case. Fixed this by properly checking that flag before converting a split's value to the currency of the starting account. Extended the multiple currencies report test case to check this scenario. (cherry picked from commit 6780bf61922eab24542f5d02b29a17b0df12299d) M +1 -1 kmymoney/reports/querytable.cpp M +32 -1 kmymoney/reports/querytabletest.cpp http://commits.kde.org/kmymoney/e3967e5918ba887c69e4de809605072686bc2f91 It was stated that the error described in this ticket was fixed with version 4.7.2. However, it has been included again since at least version 4.8.5 and also 5.1.3. Created attachment 177804 [details]
Screenshot of the associated report without currency conversion
Created attachment 177805 [details]
Screenshot of the associated report with currency conversion showing the issue
This report has been generated with the kmymoney version 5.1.90 from git master branch
Created attachment 177806 [details]
Updated test file
Created attachment 177809 [details]
Screenshot of the associated report with currency conversion to explain the results
The problem is that the first test case contains an unusual conversion rate in the price database
<PRICEPAIR from=“GBP” to=“USD”>
<PRICE date=“2015-01-01” price=“1/1” source=“User”/>
</PRICEPAIR>
which explains the difference.
This cause, which is not apparent at first glance, can be avoided if the underlying conversion rate is included as a mandatory field in a report that contains a conversion to the base currency.
Created attachment 177810 [details]
Updated test file (with price column in report with conversion)
Git commit 0a516a8c9bd3776b45699ed418c566d33e72c8f0 by Ralf Habacker. Committed on 13/03/2025 at 07:38. Pushed by habacker into branch 'master'. Fix broken investment reports It turns out that activating the price column hides every result in performance and capital gains reports. Does loan report includes prices by default ? Fixup for commit ac819ee3e M +5 -2 kmymoney/mymoney/mymoneyfile.cpp M +5 -7 kmymoney/plugins/views/reports/core/querytable.cpp M +1 -1 kmymoney/plugins/views/reports/core/tests/data/test-investment.xml https://invent.kde.org/office/kmymoney/-/commit/0a516a8c9bd3776b45699ed418c566d33e72c8f0 Git commit 2a376469e934ecfe37d333fbaf25040ff8de1638 by Ralf Habacker. Committed on 19/03/2025 at 06:27. Pushed by habacker into branch 'master'. Fixup for price column setup in investment reports on loading files After fixing a bug with the mentioned commit, an increase of the file "fix version" was required, which did not happen. Fixup for commit 0a516a8c. Related: bug 501686 FIXED-IN:5.1.94 M +31 -2 kmymoney/mymoney/mymoneyfile.cpp M +1 -1 kmymoney/mymoney/mymoneyfile.h https://invent.kde.org/office/kmymoney/-/commit/2a376469e934ecfe37d333fbaf25040ff8de1638 Git commit d18712f2a1be425eedbfca1c1f12bae5d9883755 by Ralf Habacker. Committed on 24/03/2025 at 05:58. Pushed by habacker into branch 'master'. Use default update process to create additional columns for kmyPayees After adding a value for the initVersion parameter to the constructor of the MyMoneyDbTextColumn class, the standard update pattern with alterTable() can be used. Related: bug 501686 Fixup for commit 17659e328. M +2 -2 kmymoney/plugins/sql/mymoneydbdef.cpp M +2 -20 kmymoney/plugins/sql/mymoneystoragesql_p.h https://invent.kde.org/office/kmymoney/-/commit/d18712f2a1be425eedbfca1c1f12bae5d9883755 |