Bug 388698 - OFX imports defaults to 2 decimals on security creation and if changed to 3 or 4 transactions will not recognized change
Summary: OFX imports defaults to 2 decimals on security creation and if changed to 3 o...
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: importer (show other bugs)
Version: 4.8.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on: 365177
Blocks:
  Show dependency treegraph
 
Reported: 2018-01-08 21:04 UTC by Joe Byers
Modified: 2019-09-02 17:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.2
Sentry Crash Report:


Attachments
OFX test file (3.54 KB, application/vnd.intu.qfx)
2018-01-08 21:04 UTC, Joe Byers
Details
screenshot from version 4.8.3 (18.28 KB, image/png)
2019-09-02 17:09 UTC, Ralf Habacker
Details
screenshot from version 4.8.3 (18.63 KB, image/png)
2019-09-02 17:18 UTC, Ralf Habacker
Details
Screenshot from 5.0.4 (20.13 KB, image/png)
2019-09-02 17:21 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Byers 2018-01-08 21:04:26 UTC
Created attachment 109742 [details]
OFX test file

I tried to import an OFX file of security transactions.  The import required the automatic creation of securities.  This default to 2 decimals on the security quantities and is a problem today with Funds with the fraction being 100.  The default should be 4 decimals.

I changed the newly create security to a 10000 and 1000 fraction. I then tried to edit the new transaction where I found this issue.  No matter how many times I edited the security or the transaction, the transaction returned to the original imported quantity.

I deleted all new transactions and created the security before import. I saved it with 100 fraction, then changed it to 10000.  The same problem occurred on import and transaction edits..  The transaction failed over to the original divisor.  

I had to again delete all transactions, recreate the security taking care to set the fraction to 10000 before saving the new security, the import.  SUCCESS!!

This is not very good. 

I have attached an OFX file for you to test.
Comment 1 Ralf Habacker 2018-01-08 23:53:46 UTC
I imported this file with 4.8.1(.1) into an empty kmymoney file using EUR as base currenty and could not reproduce this issue. On importing I was asked to create a new account and to enter an exchange rate. After the import I opened the ledger and see 4 transactions all having an amount of for example 31,458 with a price of 9,5500 € (displayed 4 digits). Also editing this transaction shows the same value. Please retest with 4.8.1 and reopen this bug if you have still an issue.
Comment 2 Ralf Habacker 2018-01-09 00:18:50 UTC
Just for the record - also the price editor shows 4 decimals in 4.8.1.
Comment 3 Ralf Habacker 2018-01-09 00:25:10 UTC
Git commit 1b615d6bc92e9cc808cd021f069b60f61b26e4ea by Ralf Habacker.
Committed on 09/01/2018 at 00:24.
Pushed by habacker into branch '4.8'.

Fixup of commit 53550fbf

Fixing the default online price source for ofx import is also required.
Related: bug 386462
CCMAIL:tbaumgart@kde.org

M  +1    -1    kmymoney/converter/mymoneystatementreader.cpp

https://commits.kde.org/kmymoney/1b615d6bc92e9cc808cd021f069b60f61b26e4ea
Comment 4 Ralf Habacker 2018-01-09 00:50:40 UTC
To be exact: the number of security units seems to be rounded to 3 decimals - the ofx file contains "<UNITS>31.4576" and in kmymoney it is displayed with 31.458
Comment 5 Ralf Habacker 2018-01-09 19:04:16 UTC
(In reply to Ralf Habacker from comment #4)
> To be exact: the number of security units seems to be rounded to 3 decimals
> - the ofx file contains "<UNITS>31.4576" and in kmymoney it is displayed
> with 31.458

This related to bug 365177
Comment 6 Ralf Habacker 2018-01-09 19:52:29 UTC
Git commit df9d81336368ce4a805779416185bdaeaa8695bf by Ralf Habacker.
Committed on 09/01/2018 at 19:52.
Pushed by habacker into branch '4.8'.

Increase smallest account fraction on ofx import from 3 to 4 decimals
FIXED-IN:4.8.2

M  +1    -1    kmymoney/converter/mymoneystatementreader.cpp

https://commits.kde.org/kmymoney/df9d81336368ce4a805779416185bdaeaa8695bf
Comment 7 Ralf Habacker 2019-09-02 17:09:14 UTC
Created attachment 122459 [details]
screenshot from version 4.8.3
Comment 8 Ralf Habacker 2019-09-02 17:18:03 UTC
Created attachment 122460 [details]
screenshot from version 4.8.3
Comment 9 Ralf Habacker 2019-09-02 17:21:44 UTC
Created attachment 122461 [details]
Screenshot from 5.0.4

In 5.0.4, 2 digits are displayed instead of 4 and the sum differs from the calculation of version 4.8.3.