Summary: | Investment transactions dropped without notification during import. | ||
---|---|---|---|
Product: | [Applications] kmymoney | Reporter: | allan <agander93> |
Component: | general | Assignee: | KMyMoney Devel Mailing List <kmymoney-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | git (master) | ||
Target Milestone: | --- | ||
Platform: | Mint (Ubuntu based) | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kmymoney/22107d5c17f7a7c55b2abe0e09efc09c05e419a8 | Version Fixed In: | |
Attachments: | Investment transactions dropped without notification during import and mymoneystatementreader.cpp matching problem. |
Description
allan
2013-11-19 11:38:21 UTC
The imported file does contain the security name, and imports correctly into an account which contains that security. When another file, formatted differently, and containing security symbols, is imported into an account that does not include those securities, then new securities are created. So, it appears that the imports work correctly, except for the non-appearance of the message box. Truncating the instruction to - " KMessageBox::information(0, i18n("This investment account does not contain the \"%1\" security. Transactions involving this security will be ignored.", statementTransactionUnderImport.m_strSecurity), i18n("Security not found")); " allows the message box to appear as expected. It looks like this is a feature of the "dontAskAgainName" feature, and I don't think I care for it, at least in this situation, as it might be some considerable time from accepting the "dontAskAgainName" question, until the problem recurs, by which time it's been forgotten, and time is wasted chasing a non-existent problem. I think I would prefer a question asking whether or not to abort the import, especially when there could be quite a number of similar transactions being imported, where the only option is a forced need to abort KMM. @Thomas again, please. I've replaced the " KMessageBox::information(0, i18n("This investment account does not contain the \"%1\" security. Transactions involving this security will be ignored.", statementTransactionUnderImport.m_strSecurity), i18n("Security not found"), QString("MissingSecurity%1").arg(statementTransactionUnderImport.m_strSecurity.trimmed()));" with "int ret = KMessageBox::warningContinueCancel(0, i18n("<center>This investment account does not contain the \"%1\" security.</center>" "<center>Transactions involving this security will be ignored.</center>", statementTransactionUnderImport.m_strSecurity), i18n("Security not found"), KStandardGuiItem::cont(), KStandardGuiItem::cancel()); if (ret == KMessageBox::Cancel) { m_userAbort = true;" to be less likely to allow the user to fall into a trap, and this, from my point of view, seems much better, and was going to ask if it was OK to go ahead. However, something a bit unexpected has happened. Having installed Chris Tucker's patch and my additions - see Bug 328127 - mymoneystatementreader.cpp matching problem - when I came back to this and tested again, instead of encountering the new messagebox when importing into the 'wrong' investment account, instead the imported transaction resulted in the creation of the new security in that investment account. In a way, this could be useful in creating a new investment on the fly, although it might not be so good if it has done this in the 'wrong account', ie, the user made a mistake. I see no warning on the console of what was happening, and I'm inclined to accept this 'new functionality', but to add a warning message box for the user to accept or cancel. Any thoughts, please? Created attachment 83794 [details]
Investment transactions dropped without notification during import and mymoneystatementreader.cpp matching problem.
Here's the combined patch for the two bugs.
Git commit 22107d5c17f7a7c55b2abe0e09efc09c05e419a8 by Allan Anderson. Committed on 09/12/2013 at 21:58. Pushed by allananderson into branch 'master'. M +8 -3 kmymoney/converter/mymoneystatementreader.cpp M +1 -0 kmymoney/plugins/csvimport/investprocessing.cpp http://commits.kde.org/kmymoney/22107d5c17f7a7c55b2abe0e09efc09c05e419a8 I have not yet committed the patch submitted by Chris Tucker referred to above, but only the changes related to the use of KMessageBox::warningContinueCancel, plus the addition of adding tr.m_strSymbol = (*it_s).m_strSymbol to inInvestProcessing::investCsvImport(), discovered during testing. |