Summary: | Changing investment fraction doesn't change rounding behavior | ||
---|---|---|---|
Product: | [Applications] kmymoney | Reporter: | David Chamberlain <dc46and2> |
Component: | general | Assignee: | KMyMoney Devel Mailing List <kmymoney-devel> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | ecjbosu, lnxusr, ostroffjh |
Priority: | NOR | ||
Version: | 4.8.0 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/kmymoney/c6e31c96a03ad5a7ec5e3695bbfa8336181ab81c | Version Fixed In: | 5.0.0 |
Sentry Crash Report: | |||
Bug Depends on: | |||
Bug Blocks: | 388698 |
Description
David Chamberlain
2016-07-07 03:56:46 UTC
Please clarify: do you see the correct numbers after restarting KMM? If so, the issue is not that the rounding behaviour isn't change, but that it isn't changed immediately, and requires a restart of KMM to take effect. One is a real bug, the other is simply an inconvenience, although it might be possible to have the change take effect immediately. No, if you restart after step 3 (above) the incorrectly rounded number is still on the ledger. However, after the restart you can edit the transaction, reenter the precise quantity, and then the rounding is correct. In order to get the correct quantity recorded in the ledger, you must: change investment "Fraction", restart, then create/edit transaction. BTW, I've only tried this with Stock type investments. Not sure if it matters. *** Bug 377087 has been marked as a duplicate of this bug. *** Git commit c6e31c96a03ad5a7ec5e3695bbfa8336181ab81c by Łukasz Wojniłowicz. Committed on 01/04/2017 at 06:16. Pushed by wojnilowicz into branch 'master'. Fix rounding problem with investments Patch introduces rounding rules per security for fixing bug #372163. It seems that this broker always rounds amounts down while my broker rounds amounts depending on the outlying digit, so it couldn't work for both of us without rules. Rounding is done in InvestTransactionEditor because it has all needed informations at hand. No rounding of shares is done in InvestTransactionEditor::setupPrice. Transaction from bug #372163 looks as follows: brokerage: shares = 1,009 ; value = 1,009 investment: shares = -1 ; value = 1,009 InvestTransactionEditor::setupPrice causes brokerage to look as follows: shares = 1,01 ; value = 1,009 As we can see shares and value diverge, which is unacceptable here. Patch makes assumption that transaction has only single split of stock/mutual fund/bond. Related: bug 345655, bug 357784, bug 372163 FIXED-IN:5.0 Differential Revision: https://phabricator.kde.org/D5187 Signed-off-by: Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com> M +32 -15 kmymoney/dialogs/investtransactioneditor.cpp M +31 -0 kmymoney/kmymoneyutils.cpp M +22 -0 kmymoney/kmymoneyutils.h M +39 -0 kmymoney/mymoney/mymoneysecurity.cpp M +27 -8 kmymoney/mymoney/mymoneysecurity.h M +1 -0 kmymoney/mymoney/storage/mymoneydbdef.cpp M +3 -0 kmymoney/mymoney/storage/mymoneystoragesql.cpp M +4 -3 kmymoney/widgets/transaction.cpp M +11 -0 kmymoney/wizards/newinvestmentwizard/kinvestmentdetailswizardpage.cpp M +104 -90 kmymoney/wizards/newinvestmentwizard/kinvestmentdetailswizardpagedecl.ui M +2 -0 kmymoney/wizards/newinvestmentwizard/knewinvestmentwizard.cpp https://commits.kde.org/kmymoney/c6e31c96a03ad5a7ec5e3695bbfa8336181ab81c Was this fixed so a restart is not required? I see this issue in Version 4.8.0. |