Summary: | loan payment calculated using wrong currency when currencies of loan and payment account differ | ||
---|---|---|---|
Product: | [Applications] kmymoney | Reporter: | Igor Šuljić <igor.suljic> |
Component: | general | Assignee: | KMyMoney Devel Mailing List <kmymoney-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | onet.cristian |
Priority: | NOR | ||
Version: | 4.6.3 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kmymoney/6fed3349e20c2ce9898058b036b3a20ec90ad033 | Version Fixed In: | 4.7.2 |
Sentry Crash Report: | |||
Attachments: |
screenshot of the final step of the Create Loan Account wizard
Home page after creating the Loan Account Test file that shows this issue. |
Description
Igor Šuljić
2013-10-08 20:46:41 UTC
Created attachment 82728 [details]
screenshot of the final step of the Create Loan Account wizard
The state of the account after finishing the Create Loan Account wizard. Everything is as expected.
Created attachment 82729 [details]
Home page after creating the Loan Account
The schedule of loan payments labeled with incorrect currency resulting in wrong amount deducted.
I suspect that the conversion rate setup when creating the loan is no used properly. Also found that the loan account currency keeps changing back to the base currency if, while creating the loan, new payees or accounts are created. Created attachment 88049 [details]
Test file that shows this issue.
It seems that when 'SCH000004' (attached to the loan) is created a conversion rate of 1 is used even though the price was entered in the wizard.
Today, while fixing BUG 335277, I stumbled upon this 'FIXME' marker https://projects.kde.org/projects/extragear/office/kmymoney/repository/revisions/ed3ef1673cc960e48949fb310881b74a29ce657a/entry/kmymoney/mymoney/mymoneyforecast.cpp#L1282 which might be the cause of this issue. Since I got my hands dirty recently with multi-currency stuff (BUG 339262) I think I could give this a shot. That calcAutoLoan method in MyMoneyForecast is copied from the original one, in MyMoneySchedule IIRC. The fix should go into the original one, which is the one used to calculate payments (the one in MyMoneyForecast is only used for forecasts, not for entering transactions) Thanks for the info Alvaro, it's really helpful :), without it I would have been looking at the wrong place. Nevertheless forecast should also be fixed. A fix is being reviewed at https://git.reviewboard.kde.org/r/123177/ Git commit d87427c4e8fad8226c1f1a80bbb094d9cc59a2ab by Cristian Oneț. Committed on 31/03/2015 at 16:15. Pushed by conet into branch 'master'. Properly handle loan payments from accounts using a different currency If a payment account that has a different currency than the currency of the loan is selected in the loan wizard, the resulting scheduled transaction would not have the proper value in the currency of the payment account. Fixed this by requesting the user to perform the currency conversion from the amount of the payment in the currency of the loan to the amount in the currency of the payment account. This conversion is done using the standard mechanism provided by the currency calculator. After this was fixed I observed that the amount of the scheduled transaction was not being rendered properly in the homepage. Fixed this by using the same amount formating that is used in the ledger. REVIEW: 123177 M +3 -3 kmymoney/views/khomeview.cpp M +12 -6 kmymoney/wizards/newaccountwizard/knewaccountwizard.cpp http://commits.kde.org/kmymoney/d87427c4e8fad8226c1f1a80bbb094d9cc59a2ab Git commit 6fed3349e20c2ce9898058b036b3a20ec90ad033 by Cristian Oneț. Committed on 31/03/2015 at 16:18. Pushed by conet into branch '4.7'. Properly handle loan payments from accounts using a different currency If a payment account that has a different currency than the currency of the loan is selected in the loan wizard, the resulting scheduled transaction would not have the proper value in the currency of the payment account. Fixed this by requesting the user to perform the currency conversion from the amount of the payment in the currency of the loan to the amount in the currency of the payment account. This conversion is done using the standard mechanism provided by the currency calculator. After this was fixed I observed that the amount of the scheduled transaction was not being rendered properly in the homepage. Fixed this by using the same amount formating that is used in the ledger. REVIEW: 123177 (cherry picked from commit d87427c4e8fad8226c1f1a80bbb094d9cc59a2ab) Conflicts: kmymoney/views/khomeview.cpp M +3 -3 kmymoney/views/khomeview.cpp M +12 -6 kmymoney/wizards/newaccountwizard/knewaccountwizard.cpp http://commits.kde.org/kmymoney/6fed3349e20c2ce9898058b036b3a20ec90ad033 |