Bug 333911

Summary: csv importer: credits/debits recognition
Product: [Applications] kmymoney Reporter: Yasin Zähringer <yasinzaehringer+kde>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED WORKSFORME    
Severity: normal CC: agander93
Priority: NOR    
Version: 4.6.4   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: spaces.csv
nospaces.csv

Description Yasin Zähringer 2014-04-26 12:45:28 UTC
The CSV importer has some issues. The first issue is highlighted by the following procedure:

Steps to reproduce:
1. Load spaces.csv in the CSV importer
2. Select the following columns: Date: 1, Payee: 2, Debits: 4, Credits: 3
3. Select the following settings: Decimal symbol: comma, date format: d m y
4. Click import and select an account (don't be confused by the fact that the default button seems to be the skip (or abort) button, so don't click enter)

What now happens is that the parser gets confused and thinks the spaces in the 'Debits' row mean that it is an withdrawal transaction of value 0. What I would expect to happen is that it disregards the spaces (maybe trim?) sees that it is a deposit transaction.


This leads to the second issue, skipping the spaces leads to a weird problem:

Steps to reproduce:
1. Load nospaces.csv
2. Import it with the same settings as before.
3. Ignore the warning that certain lines aren't as long as expected.

What happens is that all three transactions are recognized as deposits which is obviously not what should happen.

Reproducible: Always
Comment 1 Yasin Zähringer 2014-04-26 12:46:28 UTC
Created attachment 86276 [details]
spaces.csv
Comment 2 Yasin Zähringer 2014-04-26 12:47:13 UTC
Created attachment 86277 [details]
nospaces.csv
Comment 3 allan 2014-04-26 13:21:12 UTC
I don't see those results here.
Accepting that the files are incomplete, nevertheless, they import as would be expected from the parameters you gave.
In fact, with nospaces.csv, I then changed the three dates to be different, to make sure that they were importing correctly, and got the same expected results.
I'm using the development branch.
Comment 4 Yasin Zähringer 2014-04-27 00:49:56 UTC
Indeed, I can confirm that the issues do not appear with git master anymore.