Bug 466809 - .ofx and .qfx files imported into wrong account
Summary: .ofx and .qfx files imported into wrong account
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: importer (show other bugs)
Version: 5.1.3
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-04 06:19 UTC by maps
Modified: 2023-03-04 16:09 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.1.4


Attachments
pdf series of five screenshots showing problem (3.37 MB, application/pdf)
2023-03-04 06:19 UTC, maps
Details

Note You need to log in before you can comment on or make changes to this bug.
Description maps 2023-03-04 06:19:48 UTC
Created attachment 156984 [details]
pdf series of five screenshots showing problem

SUMMARY:  

Background:  I started with version 4.7.2 in approximately 2013.  After a few years, the previously working account update feature stopped working, first for American Express, then for every credit card, banking, and brokerage service.  So I just download .qfx, .ofx, or .csv files from each institution's website each month one by one into a dedicated separate folder, one per institution, and import them into KMyMoney.  When I go to import them, the first time, KMyMoney asks me to pick the account into which to import the first time - then for all subsequent months, when I choose the downloaded file from its folder, KMyMoney remembers that the folder from which the file has been downloaded corresponds to the correct account and imports it without having to navigate again to the correct account.  After a few years, I added a new Liability account , credit card type, to the dozen or so I already had.  

BUG#1:  The first time I went to import it, I clicked on the WRONG account.  Every subsequent month, KMyMoney associates any file in that folder with this WRONG account when I go to import.  OK, no big deal.  Version 4.7.2 allows me to click the dropdown arrow and choose the correct account, and imports it into the correct account.

BUG#2:  On 3/3/2023, I copied my KMyMoney .kmy database to a different computer, both prior and current computers are Windows10Professional Operating Systems.  I downloaded the current version 5.1.3 of KMyMoney to my current computer, opened it, and directed it to open my copied .kmy database.  Then for the Liability credit card account in question, I downloaded this month's statement .ofx file, and imported it (I copied the folder into an identical tree structure as the prior computer).  The new v5.1.3 instance of KMyMoney dialog box asked into which account I wished the data to be imported (instead of version 4.7.2 defaulting to the WRONG account it always associates with this folder), and I navigated to the correct account.  However, KMyMoney imported it into the same WRONG account as it did on my prior computer.  I have to open the WRONG account, and select every transaction, right click to move them to the correct account.  I tried multiple times to choose the correct account from the drop down list, and version 5.1.3 ignores my selection and imports it into the WRONG account I mistakenly chose many years ago the first time I imported the first statement.  Somehow the database is remembering the folder in the tree structure, and associating it with this WRONG KMyMoney account, and ignoring the correct account I select from the drop down list.
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Thomas Baumgart 2023-03-04 15:37:17 UTC
Git commit c6357119672f3b124ffcc18f5078b2d65c9f9153 by Thomas Baumgart.
Committed on 04/03/2023 at 15:32.
Pushed by tbaumgart into branch 'master'.

Completely update reference to account during import

When data of an account is imported from a file, the KMyMoney account
will get a reference to the imported account using the account number
found. This allows to pre-select the account during import.

In case the user decided to override that pre-selected account, the
reference on the old account was not removed and the data of the
selected account was not used in the process of the import.

This change removes the reference on the previous account and uses the
the selected account to import the data.

M  +18   -0    kmymoney/converter/mymoneystatementreader.cpp
M  +3    -11   kmymoney/dialogs/kaccountselectdlg.cpp

https://invent.kde.org/office/kmymoney/commit/c6357119672f3b124ffcc18f5078b2d65c9f9153
Comment 2 Thomas Baumgart 2023-03-04 16:09:07 UTC
Git commit bec6e49d0e7c3e0f15ce422e26b11285d8a5660d by Thomas Baumgart.
Committed on 04/03/2023 at 15:38.
Pushed by tbaumgart into branch '5.1'.

Completely update reference to account during import

When data of an account is imported from a file, the KMyMoney account
will get a reference to the imported account using the account number
found. This allows to pre-select the account during import.

In case the user decided to override that pre-selected account, the
reference on the old account was not removed and the data of the
selected account was not used in the process of the import.

This change removes the reference on the previous account and uses the
the selected account to import the data.
FIXED-IN: 5.1.4

(cherry picked from commit c6357119672f3b124ffcc18f5078b2d65c9f9153)

M  +18   -0    kmymoney/converter/mymoneystatementreader.cpp
M  +3    -11   kmymoney/dialogs/kaccountselectdlg.cpp

https://invent.kde.org/office/kmymoney/commit/bec6e49d0e7c3e0f15ce422e26b11285d8a5660d