SUMMARY When buying or selling investments the interest and/or fees round to 2 decimal places even when the currency is set to calculate to 6 decimal places (e.g. palladium) STEPS TO REPRODUCE 1. Create an investment account with currency of palladium 2. Create a category for the investment interest with currency of palladium 3. Create and buy some investments in palladium 4. Sell some investments in palladium with interest added using the category created. OBSERVED RESULT Interest is rounded to 2 decimal places. EXPECTED RESULT Interest is rounded to 6 decimal places. SOFTWARE/OS VERSIONS Windows: MacOS: Linux/KDE Plasma: Fedora 29 (xcb windowing system) (available in About System) KDE Plasma Version: 5.13.5-1 KDE Frameworks Version: 5.54.0 Qt Version: 5.11.3 ADDITIONAL INFORMATION Workaround is to go into the brokerage account and edit the interest amount there.
Can you attach a testfile here, please?
Created attachment 117808 [details] Test kmy file Test file with investment and brokerage accounts in Palladium currency. Investment Bond 01 created in palladium with a buy and a sell transaction.
Testfile added
Created attachment 117811 [details] Patched test file Looks like you did not create the test file with today's git master and that is (still) causing the problem. I added a fix provided on Jan 19 to the source repo in this commit: https://cgit.kde.org/kmymoney.git/commit/?id=e38492cbc059796addb5a62861e75b851b2428e0 Unfortunately, your test file is older: <CREATION_DATE date="2019-01-13"/> The fix creates the XPD currency with the necessary SAF setting. The first line below comes from your test file. The second one is from the file I patched (just added that bunch of zeroes as per the instructions in the commit message). 69c69 < <CURRENCY pp="4" symbol="XPD" type="3" saf="100" rounding-method="7" id="XPD" scf="1000000" name="Palladium"/> --- > <CURRENCY pp="4" symbol="XPD" type="3" saf="1000000" rounding-method="7" id="XPD" scf="1000000" name="Palladium"/> I attach the modified file here as well. Opening this, you should instantaneously see correct results. Let me check if I can come up with a more automated solution.
Created attachment 117812 [details] Test kmy created using git master Test file created using latest git master
Tried to create sale with interest payment of 0.015 and it was rounded to 0.02
Git commit 2fe372e97b012442f6f5be462ee23ebfcd19a5ab by Thomas Baumgart. Committed on 03/02/2019 at 18:46. Pushed by tbaumgart into branch '5.0'. Added automatic fix to adjust settings of precious metals Files created before Jan 19th 2019 will most certainly have a false setting for the smallest account fraction of the precious metals gold, platinum, palladium and silver. This change fixes the problem in the file when the file is opened. At the same time it initializes an investment transaction with the commodity of the account and not the base currency. FIXED-IN: 5.0.4 M +27 -0 kmymoney/kmymoney.cpp M +1 -1 kmymoney/mymoney/storage/mymoneystoragemgr_p.h M +3 -1 kmymoney/views/kgloballedgerview_p.h https://commits.kde.org/kmymoney/2fe372e97b012442f6f5be462ee23ebfcd19a5ab
(In reply to Thomas Baumgart from comment #7) > Git commit 2fe372e97b012442f6f5be462ee23ebfcd19a5ab by Thomas Baumgart. > Committed on 03/02/2019 at 18:46. > Pushed by tbaumgart into branch '5.0'. > > Added automatic fix to adjust settings of precious metals > > Files created before Jan 19th 2019 will most certainly have a false > setting for the smallest account fraction of the precious metals gold, > platinum, palladium and silver. > > This change fixes the problem in the file when the file is opened. > > At the same time it initializes an investment transaction with the > commodity of the account and not the base currency. > FIXED-IN: 5.0.4 > > M +27 -0 kmymoney/kmymoney.cpp > M +1 -1 kmymoney/mymoney/storage/mymoneystoragemgr_p.h > M +3 -1 kmymoney/views/kgloballedgerview_p.h > > https://commits.kde.org/kmymoney/2fe372e97b012442f6f5be462ee23ebfcd19a5ab Will this be going on master as well as 5.0?
Once I merge the latest changes back onto master they will automatically be there.
Just tested with latest git master with fix in and it is still rounding. When you first try and create a new sell transaction, it wouldn't know what currency the interest is in until you select the category, is that why it is still failing?
Fixed with https://commits.kde.org/kmymoney/d292de0b7f976d38d7c4e966aff573d7bb88fdd6 (I dropped the wrong bug number into the commit message hence a bit of manual cleanup here)
(In reply to Thomas Baumgart from comment #11) > Fixed with > https://commits.kde.org/kmymoney/d292de0b7f976d38d7c4e966aff573d7bb88fdd6 (I > dropped the wrong bug number into the commit message hence a bit of manual > cleanup here) When's this going to get merged into git master as it been a few weeks now?
Done. Sorry for the delay and thanks for the reminder.
It's not quiet fixed, it's working fine if you create one but as soon as you click edit on a previously created one, the interest / fees are immediately rounded to 2 decimal places.
Git commit d03dd8e1b5303a8292401047c2a725fb9c4ca024 by Thomas Baumgart. Committed on 02/03/2019 at 09:27. Pushed by tbaumgart into branch '5.0'. Set precision of edit widget before loading value If used the other way around, the value loaded will be rounded to the standard precision of 2 digits. M +2 -2 kmymoney/dialogs/investtransactioneditor.cpp https://commits.kde.org/kmymoney/d03dd8e1b5303a8292401047c2a725fb9c4ca024