Bug 323788 - QIF import incorrectly matches reversing transactions
Summary: QIF import incorrectly matches reversing transactions
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: git (master)
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-20 16:08 UTC by George Baltz
Modified: 2013-10-21 19:43 UTC (History)
2 users (show)

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


Attachments
test file (8.12 KB, application/x-qw)
2013-08-20 17:12 UTC, George Baltz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description George Baltz 2013-08-20 16:08:02 UTC
QIF import in current GIT drops transactions that reverse others.  Common cause is returning a purchased item. The initial purchase is recorded, but the transaction for the credit return is incorrectly considered a match, and dropped.


Reproducible: Always

Steps to Reproduce:
1. Start with a new file
2. Import *.qif file with a purchase and credit for same amount
3. 
Actual Results:  
Second transaction is dropped, leaving an incorrect balance.

Expected Results:  
Both recorded, leaving zero balance.

I have small example file, but I don't see any way to attach it.
Comment 1 allan 2013-08-20 17:02:44 UTC
(In reply to comment #0)

> I have small example file, but I don't see any way to attach it.

Near the bottom of the bug report, below the Add Comment box, you should see 
"Attachments
Add an attachment (proposed patch, testcase, etc.)"

That's the place.
Comment 2 George Baltz 2013-08-20 17:12:00 UTC
Created attachment 81813 [details]
test file

OK, that's not on the simplified bug creation page.

BTW, this file imports correctly on 4.6.3
Comment 3 George Baltz 2013-10-21 16:21:46 UTC
git bisect between HEAD and 4.6.4 gives this result:

gwb@cloyd:~/kde/src/kmymoney> git bisect good
7683caffba5f748301e140d276b25f985a9093dd is the first bad commit
commit 7683caffba5f748301e140d276b25f985a9093dd
Author: Lukasz Maszczynski <lukasz@maszczynski.net>
Date:   Sat Jan 19 17:33:15 2013 +0100

    removed superfluous condition check for matching an imported transaction
    
    REVIEW: 108489

:040000 040000 502092c86b3d0df92570bdd11d105c8f0d487be2 50ac349f22215e27ba4b209263e572908d6e07c6 M      kmymoney
Comment 4 Cristian Oneț 2013-10-21 19:18:12 UTC
Git commit 8fd264f742cbe4ee516bc34bbbcca04f10ce67b3 by Cristian Oneț.
Committed on 21/10/2013 at 19:12.
Pushed by conet into branch 'master'.

Check that splits reference the same account before matching them.

This check was present in the old transaction matcher but was lost
during the refactoring done by Łukasz. Strange though in the comment
of the splitsMatch method the condition was still there.
CCMAIL: lukasz@maszczynski.net

M  +7    -1    kmymoney/converter/transactionmatchfinder.cpp
M  +9    -0    kmymoney/converter/transactionmatchfinder.h

http://commits.kde.org/kmymoney/8fd264f742cbe4ee516bc34bbbcca04f10ce67b3