Bug 372166 - CSV import not allowing choice of account for import on KF5.
Summary: CSV import not allowing choice of account for import on KF5.
Status: RESOLVED NOT A BUG
Alias: None
Product: kmymoney
Classification: Applications
Component: importer (show other bugs)
Version: git (master)
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-06 23:51 UTC by allan
Modified: 2016-12-31 16:20 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description allan 2016-11-06 23:51:07 UTC
When I imported a CSV file (or tried to),  I went through the set-up,
but on clicking Import, I didn't get the account selector, but did get the
Statement stats screen, which seemed to be indicating a successful import.

However, the account into which I had intended to do the import showed
no sign of the data.  After doing a search, I found the import had gone to a
different account altogether.  This account is a temporary credit card account I created when it was not possible to import into credit card accounts, even the file being imported was for a checking account.  The data went into a credit card account named cc.

I've looked at the code, but it has been much rewritten lately, and I'm unfamiliar with it, so it's possible that what follows is wrong.  However...

in bool CSVWizard::detectAccount(MyMoneyStatement& st), circa line 523,
accounts = findAccounts(accountTypes, statementHeader) gets loaded with the first line of data -
"Date, Type, Description, Value, Balance, Account Name, Account Number".
What then seems to happen is that that line is scanned for a possible account name for the import, but there is none.  However, there are two strings -
Account Name" and "Account Number", which contain a valid account name, "cc" in my .kmy file.
So, on the basis of a line of data happening to contain part of a string that matches an account name, the data is imported into a completely unconnected account.
To confirm this suspicion, I changed the two strings in the header line to "Name" and "Number", and the file then imported correctly.

I'm unsure about the validity of the logic here, apparently hoping to match data imported from a bank with an account name that the user has invented, totally unbeknown to the bank.

Totally unconnected, but I also noticed in that area also that circa line 513, accountTypes MyMoneyAccount::Checkings, MyMoneyAccount::Savings and MyMoneyAccount::Liability are duplicated, but apparently harmlessly.
Comment 1 NSLW 2016-12-31 11:42:24 UTC
It's not an bug, it's a feature to lessen user interaction. Look at last Thomas' comment here https://git.reviewboard.kde.org/r/127920/ to get the directions.
Feature can be improved or disabled through Settings->Configure KMyMoney...->Plugins->CSV Importer configuration button and deselecting two last checkboxes.
Comment 2 allan 2016-12-31 16:20:51 UTC
(In reply to NSLW from comment #1)
> It's not an bug, it's a feature to lessen user interaction. Look at last
> Thomas' comment here https://git.reviewboard.kde.org/r/127920/ to get the
> directions.
> Feature can be improved or disabled through Settings->Configure
> KMyMoney...->Plugins->CSV Importer configuration button and deselecting two
> last checkboxes.

Sorry, but it doesn't just lessen lessen user interaction, it prevents it by assuming that the required account name is contained within the file header, or possibly in a column.  If this is not the case, the user needs to be able to specify the account in question.

I don't think this bug should be closed as Invalid.