SUMMARY Importing investment transactions through CSV reclassifies "remove" transactions as "Add Shares". STEPS TO REPRODUCE 1. Create CSV file with action as "remove", "Remove", "REMOVE", or any other variant (such as "Out"). 2. Import CSV file into KmyMoney 3. If the term is not "remove", it will correctly recognize an invalid transaction type and prompt the user to select a transaction type. Select "Remove Shares" from the dropdown menu. 3. The importer imports each transaction but erroneously assigns them the the "Add Shares" activity. OBSERVED RESULT The transaction is assigned to the "Add Shares" activity EXPECTED RESULT The transaction should be assigned to the "Remove Shares" activity SOFTWARE/OS VERSIONS Windows: N/A macOS: N/A Linux/KDE Plasma: Kubuntu 18.04 (available in About System) KDE Plasma Version: 5.12.7 KDE Frameworks Version: 5.44.0 Qt Version: 5.9.5 ADDITIONAL INFORMATION I have tried a number of different variations: positive and negative share quantities upper and lower case combinations different recognized and unrecognized keywords modifying csvimporterrc but that file is not present on computer
Also turned on logging and the import seemed good at the point the log is created. Below is an example of a line: <TRANSACTION number="" security="security name xxx" action="remove" amount="0/1" shares="1436594533/100000000" brokerageaccount="" dateposted="2017-02-22" payee="" bankid="" reconcile="0" memo="Quarterly Rebalancing"/>
Also a similar thing happens when I import an QFX through the OFX importer: where buy transactions get turned into sell transactions.
Located the csvimporterrc file and confirmed that invalid transaction types that the user maps to the "Remove Shares" action are correctly being appended to the "ShrsoutParam" line.
*** Bug 459006 has been marked as a duplicate of this bug. ***
Duplicate bug was also reported in the forum (https://forum.kde.org/viewtopic.php?f=69&t=176023) for 5.1.3. I reproduced in git master appimage Version 5.1.80-06ee79919. (I currently get a crash on File/Import/CSV in my Gentoo git master version.)
Created attachment 152035 [details] simple csv file to demonstrate bug I think you can demonstrate the bug importing this csv file into any Investment Account.
Git commit ddc85c396f3931f4920a1f820be44d00a8c7ec1d by Thomas Baumgart. Committed on 17/09/2022 at 09:04. Pushed by tbaumgart into branch 'master'. Use correct sign for import of 'remove shares' transactions M +7 -3 kmymoney/converter/mymoneystatementreader.cpp https://invent.kde.org/office/kmymoney/commit/ddc85c396f3931f4920a1f820be44d00a8c7ec1d
Git commit a0f7c20bab58b07b48e7fbc038138c48952f3eab by Thomas Baumgart. Committed on 24/09/2022 at 05:08. Pushed by tbaumgart into branch '5.1'. Use correct sign for import of 'remove shares' transactions FIXED-IN: 5.1.4 (cherry picked from commit ddc85c396f3931f4920a1f820be44d00a8c7ec1d) M +7 -3 kmymoney/converter/mymoneystatementreader.cpp https://invent.kde.org/office/kmymoney/commit/a0f7c20bab58b07b48e7fbc038138c48952f3eab