Bug 337208 - Security names after a security with a missing trading symbol are replaced by that symbol.
Summary: Security names after a security with a missing trading symbol are replaced by...
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 4.6.4
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-07 22:36 UTC by george
Modified: 2014-10-21 05:12 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.7.1


Attachments
test19-Fidelity G-Roth.qif (9.56 KB, application/x-qw)
2014-07-08 21:39 UTC, george
Details
Patch for kmymoney/converter/mymoneystatementreader.cpp (1.99 KB, patch)
2014-10-20 16:07 UTC, george
Details

Note You need to log in before you can comment on or make changes to this bug.
Description george 2014-07-07 22:36:30 UTC
Missing trading symbols in the QIF import seem to hide any securitie names that follow.  All the date from the transaction other than the security name seem to flow through to the account, but the security name used for all following securities is the name of the first security with a missing symbol.  Likewise only the securities preceding and including the one with the missing trading symbol appear in the accounts security list.

Suggested fix: Detect missing trading symbol and generate a phony one, possibly asking for clean up later. 

Reproducible: Always

Steps to Reproduce:
1. Modify a QIF file with an investment account with  several securities to eliminate the "S" line of one of the early entries in the "!Type:Security" area.  It must have transactions referencing securities that follow the modified entry.
2. Import the file.
3. Look at the mess :)
Actual Results:  
Securities after the modify one will be replaced in the register with the modified securities name and will not appear in the security list for the account.

Expected Results:  
A nice clean import with all the security transactions with the imported names.
Comment 1 allan 2014-07-07 23:11:27 UTC
In case there are any other features in your file that influence the reported behaviour, it would be very helpful if you could provide a simple file, obviously with sensitive data disguised, as long as it still exhibits the problem.
Either attach it to the bug report (see 'Add an attachment') just above Additional comments, or send direct to me.
It is a requirement in KMyMoney that all securities have a symbol, as that is/should be its unique reference within the program.  This is not really a bug, but you could change this to a wishlist item (under Severity)
Comment 2 george 2014-07-08 21:39:31 UTC
Created attachment 87653 [details]
test19-Fidelity G-Roth.qif

One of my test files is attached.  I usually start a whole new instance 
with no accounts and use that to test, however, I think this will fail 
is all you do is import it, regardless of what else you do prior to the 
import.

FWIW this came from Fidelity by way of Quicken.  One of the stocks was a 
spin off the other.  While it now seems to have a symbol, when we got 
it, it did not.  So, Quicken must be translating something that Fidelity 
sends in the down load to this stock.

As to making this  an enhancement request: Given  that I have been 
struggling with this for over a month and that there is no hint from the 
code as to the problem, I would at the very least like to see an error 
message.  But if that much is done, why not just generate a random 
symbol AND a message.

I do hope that the download from a financial institution code in KMM 
will set up a translation between what the QIF brings in and what that 
institution thinks the security is named.
Comment 3 george 2014-07-08 22:08:09 UTC
This issue seems to be part of 305630, which seems to imply this has been around for some time,.
Comment 4 george 2014-09-18 23:03:42 UTC
(In reply to allan from comment #1)
> In case there are any other features in your file that influence the
> reported behaviour, it would be very helpful if you could provide a simple
> file, obviously with sensitive data disguised, as long as it still exhibits
> the problem.
> Either attach it to the bug report (see 'Add an attachment') just above
> Additional comments, or send direct to me.
> It is a requirement in KMyMoney that all securities have a symbol, as that
> is/should be its unique reference within the program.  This is not really a
> bug, but you could change this to a wishlist item (under Severity)

I have edited ../kmymoney/converter/mymoneystatementreader.cpp to fix this problem.  I do believe it is important to allow the match to be just on the security name as not all securities will have symbols.  When KMM advances to handle derivitives this will be needed.

I can send a patch or try to submit via git.  What do you suggest?
Comment 5 Cristian Oneț 2014-09-19 07:29:53 UTC
Attach it to this report or post a review for the kmymoney group at git.reviewboard.kde.org
Comment 6 george 2014-10-20 16:07:47 UTC
Created attachment 89217 [details]
Patch for kmymoney/converter/mymoneystatementreader.cpp

This patch changes ths "find securtiy" code to not attempt to match on the security symbol if the one in the security list "isEmpty".  The match then defaults to use the "security.name".

Not all securities have symbols (my broker seems to prefer CUSIP, for example.  This change allows KMM to still handle securities without trading symbols as long as the name stays unique.  My broker seems to often put the CUSIP in the name.

Since I did this the underlying file kmymoney/converter/mymoneystatementreader.cpp has changed so the line numbers may be a bit off.
Comment 7 Cristian Oneț 2014-10-21 05:11:41 UTC
Git commit 8299e4f37d6fdea9723501acec416d2e883a9a8a by Cristian Oneț.
Committed on 21/10/2014 at 04:53.
Pushed by conet into branch 'master'.

Fix security matching on import, don't match empty fields.

Use the same policy of matching two fields only if they are not
empty consistently for matching securities. Thanks to George
(george@wildturkeyranch.net) for figuring this out.

M  +12   -8    kmymoney/converter/mymoneystatementreader.cpp

http://commits.kde.org/kmymoney/8299e4f37d6fdea9723501acec416d2e883a9a8a
Comment 8 Cristian Oneț 2014-10-21 05:12:29 UTC
Git commit 4fc6fbbf314d007b53445b084cab2e095f51ccdd by Cristian Oneț.
Committed on 21/10/2014 at 04:53.
Pushed by conet into branch '4.7'.

Fix security matching on import, don't match empty fields.

Use the same policy of matching two fields only if they are not
empty consistently for matching securities. Thanks to George
(george@wildturkeyranch.net) for figuring this out.
(cherry picked from commit 8299e4f37d6fdea9723501acec416d2e883a9a8a)

M  +12   -8    kmymoney/converter/mymoneystatementreader.cpp

http://commits.kde.org/kmymoney/4fc6fbbf314d007b53445b084cab2e095f51ccdd