Changed the "Fraction" field on the investment details dialog from "1000" to "10000" so I could accurately record some dividend reinvestment transactions. On the ledger, the quantity is now shown with 4 decimal places, but any quantity I enter is still rounded to 3 decimal places. A workaround is to change the "Fraction", then exit and restart kmymoney before updating quantities on the ledger. Reproducible: Always Steps to Reproduce: 1.Create an investment, accept default "Fraction" of 100 2.Edit the investment and increase the "Fraction" to 1000 3.Open investment account ledger and create a transaction involving the above investment. Use a quantity with three numbers after the decimal, such as 1.123. Actual Results: The quantity on the ledger will be 1.120. Expected Results: The quantity on the ledger should be 1.123 It appears that the transaction price is correctly calculated using the unrounded quantity, causing the transaction data recorded in the ledger to be inconsistent. I.e. Quantity x Share price != Transaction price
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.