Bug 372786 - Can't import some investments on KF5
Summary: Can't import some investments on KF5
Status: RESOLVED FIXED
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-22 13:52 UTC by allan
Modified: 2018-03-28 08:00 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description allan 2016-11-22 13:52:08 UTC
On completing the CSV importer fields/columns, when I clicked Import,
the account selector showed only checking accounts.


This is the result of a recent code change circa line 646 in MyMoneyStatementReader::processTransactionEntry() -
"
if (brokerageactid.isEmpty()) {
      brokerageactid = SelectBrokerageAccount();
  }"
as it supplies a checking account for the investment account import.  On removing this code change, the import completed, but without any
account selection being offered.

In my case, KMM choses to import into an account which happens to be closed.  The user needs to be able to select the account into which to import, as a security/stock could be present in more than one investment account.  The importing CSV file cannot know what the user requires.

To avoid importing into a closed account, I've added a test for closed accounts  circa line 468 in csvwizard() -
"if ((statementHeader.contains(txt, Qt::CaseInsensitive)) && (!(*account).isClosed()))"

The import now proceeds and produces the account selection dialog, as required.
Comment 1 wojnilowicz 2017-02-03 17:01:06 UTC
Git commit 102ab58bb4717aa2e8ff516ef66ba6f29ab2f5a0 by Łukasz Wojniłowicz.
Committed on 03/02/2017 at 17:00.
Pushed by wojnilowicz into branch 'master'.

Don't find closed accounts in CSVWizard::findAccounts

Importing into closed account shouldn't occur automatically.
FIXED-IN:5.0

Signed-off-by: Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>

M  +1    -1    kmymoney/plugins/csvimport/csvwizard.cpp

https://commits.kde.org/kmymoney/102ab58bb4717aa2e8ff516ef66ba6f29ab2f5a0