Bug 381562 - csv file import: unable to detect matching account
Summary: csv file import: unable to detect matching account
Status: RESOLVED FIXED
Alias: None
Product: skrooge
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: 25.1.0
Assignee: Stephane MANKOWSKI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-23 09:01 UTC by Bernhard Scheirle
Modified: 2017-07-01 13:58 UTC (History)
1 user (show)

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


Attachments
Patch 1 (2.16 KB, patch)
2017-06-23 09:01 UTC, Bernhard Scheirle
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Scheirle 2017-06-23 09:01:43 UTC
Created attachment 106257 [details]
Patch 1

If the account number in skrooge contains non-digit characters and the name of the csv file is the account number, skrooge does not import the operations into the correct account.

Example:
Skrooge account with iban account number: "DE00 1234 5678 9012 3456 78"
CSV file name: "DE00 1234 5678 9012 3456 78.csv"

If you import the csv file skrooge will create a new account with the name "DE78 2004 1155 0652 6701 05" instead of using the existing one.

The attached patch probably fixes this issue.
But I couldn't test it yet, since skrooge crashes at startup if I build it myself.

Skrooge version: 2.8.1
Comment 1 Stephane MANKOWSKI 2017-07-01 12:49:02 UTC
Hi Bernhard,

I tried to reproduce the issue but without success.
I did that:
1- Creation of an account with "Number"= "DE00 1234 5678 9012 3456 78"
2- Import of a CSV file having the file name = "DE00 1234 5678 9012 3456 78.csv"
The operations are well imported in the created account.

Could you detail how you set the different fields "Number", "Agency number" and "Bank number" for the matching account?

Regards.
Comment 2 Stephane MANKOWSKI 2017-07-01 13:16:17 UTC
Done! I am able to reproduce it.
Comment 3 Bernhard Scheirle 2017-07-01 13:21:43 UTC
My setup is following:
* "Agency number" not set (setting it doesn't seem to change anything)
* "Bank number" not set (setting it doesn't seem to change anything)
* "Number" is "DE00 1234 5678 9012 3456 78"
* bank name is "TestBank"
* account name "TestAccount".

The content of the csv file ("DE00 1234 5678 9012 3456 78.csv") looks like: 
"date";"mode";"comment";"payee";"amount";"unit"
"2017/05/11";"TestMode";"TestComment";"TestPayee";"100.00";"EUR"

(In reply to Stephane MANKOWSKI from comment #2)
> Done! I am able to reproduce it.

Ah (Good), just wrote the comment so I'm posting it anyway :)
Comment 4 Stephane MANKOWSKI 2017-07-01 13:58:48 UTC
Git commit 27c969181de6d7395bb44848b5a6e261a2f90399 by Stephane Mankowski.
Committed on 01/07/2017 at 13:56.
Pushed by smankowski into branch 'master'.

csv file import: unable to detect matching account

M  +1    -0    CHANGELOG
M  +4    -0    skgbankmodeler/skgimportexportmanager.cpp
A  +9    -0    tests/input/skgtestimportcsv/DE00 1234 5678 9012 3456 78.csv
M  +50   -0    tests/skgbankmodelertest/skgtestimportcsv.cpp

https://commits.kde.org/skrooge/27c969181de6d7395bb44848b5a6e261a2f90399