Summary: | Buying / selling investments interest / fees round to 2 decimal places even when currency is to 6 decimal places | ||
---|---|---|---|
Product: | [Applications] kmymoney | Reporter: | Ian Neal <iann_bugzilla> |
Component: | general | Assignee: | KMyMoney Devel Mailing List <kmymoney-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | git (master) | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/kmymoney/d03dd8e1b5303a8292401047c2a725fb9c4ca024 | Version Fixed In: | 5.0.4 |
Sentry Crash Report: | |||
Attachments: |
Test kmy file
Patched test file Test kmy created using git master |
Description
Ian Neal
2019-02-03 09:59:27 UTC
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 |