Summary: | This transaction has a missing assignment of XXX 0.01 | ||
---|---|---|---|
Product: | [Applications] kmymoney | Reporter: | Thomas Pircher <tehpeh-kde> |
Component: | general | Assignee: | KMyMoney Devel Mailing List <kmymoney-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | lukasz.wojnilowicz, onet.cristian, pmw.gover, romain.pub |
Priority: | NOR | ||
Version: | 4.6.2 | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kmymoney/1a76540fbc936dd6e80cfe9faaeef7b35d0c166b | Version Fixed In: | 4.7.1 |
Sentry Crash Report: | |||
Bug Depends on: | |||
Bug Blocks: | 345655 | ||
Attachments: | Test case with the problem |
Description
Thomas Pircher
2012-07-04 17:29:44 UTC
Could you provide a test file to reproduce this? Created attachment 89183 [details]
Test case with the problem
Attached a test case that shows the yellow triangle in the "Stocks" and in the "Stocks (Brokerage)" accounts.
The triangle shown in the transaction from 04/09/2014.
I have tested this with KMymoney 4.6.6.
In the KMyMoney settings I have a Price Precision of 6 digits.
*** Bug 253007 has been marked as a duplicate of this bug. *** The problem is visible in the attached file now we just need to figure out what's causing it. Git commit 1506b0ccacb9d4efa2b6aaeb725c2e73f5507d83 by Cristian Oneț. Committed on 18/10/2014 at 12:57. Pushed by conet into branch 'master'. Fix the validation of investment transactions. Don't ajust the values to the smallest account fraction of the currency. This will cause roundings that will lead to the reported validation error. Because at 0.5 AlkValue::RoundRound can round up/down depending on the result it could be that one split it rounded up while the other is rounded down leading to a 0.1 error while summing them. Having a value which is more precise than the smallest account fraction should not cause any issues since the UI should render the value according to this fraction anyway. If rounding is necessary a fix rounding method should be applied for all splits which are going to be summed up. M +0 -8 kmymoney/dialogs/investtransactioneditor.cpp http://commits.kde.org/kmymoney/1506b0ccacb9d4efa2b6aaeb725c2e73f5507d83 Git commit 1a76540fbc936dd6e80cfe9faaeef7b35d0c166b by Cristian Oneț. Committed on 18/10/2014 at 12:57. Pushed by conet into branch '4.7'. Fix the validation of investment transactions. Don't ajust the values to the smallest account fraction of the currency. This will cause roundings that will lead to the reported validation error. Because at 0.5 AlkValue::RoundRound can round up/down depending on the result it could be that one split it rounded up while the other is rounded down leading to a 0.1 error while summing them. Having a value which is more precise than the smallest account fraction should not cause any issues since the UI should render the value according to this fraction anyway. If rounding is necessary a fix rounding method should be applied for all splits which are going to be summed up. (cherry picked from commit 1506b0ccacb9d4efa2b6aaeb725c2e73f5507d83) M +0 -8 kmymoney/dialogs/investtransactioneditor.cpp http://commits.kde.org/kmymoney/1a76540fbc936dd6e80cfe9faaeef7b35d0c166b Proposed patch does not work when reconciliating accounts : values that appear in Kmymoney and on your bank statement are not the ones that are summed to calculate the current balance. Example : Your account has 0.01€ precision, but 2 operations have 0.001€ precision. Displayed | Internally Op1 1.01€ | 1.014€ Op2 2.01€ | 2.014€ Sum = 3.02€ 3.028 What your bank will show on your statement is a balance of 3.02€ while Kmymoney's balance is round(3.028) = 3.03€, and you get an error when you try to reconcile your account. I've just hit this problem, with the same cure (edit the price to have a non-zero final digit) in KMyMoney 5.0.3, running on Linux, encrypted database, not SQL. |