Bug 472390

Summary: Importing ISO 20022 XML creates bogus accounts
Product: [Applications] skrooge Reporter: Matija Šuklje <matija>
Component: generalAssignee: Stephane MANKOWSKI <stephane>
Status: RESOLVED FIXED    
Severity: normal CC: stephane
Priority: NOR    
Version: 2.29.0   
Target Milestone: 25.1.0   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Matija Šuklje 2023-07-19 09:49:01 UTC
SUMMARY

When importing a list of transactions in ISO 20022 XML format, Skrooge groups them under the wrong IBAN filed, scattering the transactions of a single account through several newly created wrong accounts.

STEPS TO REPRODUCE

1. have ISO 20022 XML (e.g. from your bank)
2. import it through File ↦ Import ↦ Import…

OBSERVED RESULT

To illustrate, let’s use the variable IBAN_my as the IBAN number of the user’s account and IBAN_other{?} as the IBAN accounts that are not theirs, with {?} being a number to differentiate between the different IBANs.

Under Operations what happens is:
• IBAN_my includes imported operations – that’s good
• but there are suddenly also new accounts created there as IBAN_other1, IBAN_other2, IBAN_other3, IBAN_other4, etc. which are empty.


EXPECTED RESULT
• IBAN_other{?} not being created at all

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.0

ADDITIONAL INFORMATION

What I suspect happens is that it wrongly pulls in also <Id><IBAN> from <DbtrAcct> and <CdtrAcct> (and not just from <Acct>).
Comment 1 Matija Šuklje 2023-07-19 10:39:09 UTC
Skrooge version 2.30.0
Comment 2 Stephane MANKOWSKI 2023-07-19 11:41:20 UTC
Hi, 

Could you provide a sample (and anonymized ) ISO 20022 file to reproduce the issue ?
Comment 3 Matija Šuklje 2023-07-19 14:06:43 UTC
I will send you an example by e-mail. Thank you for looking into it.
Comment 4 Stephane MANKOWSKI 2023-07-21 16:08:47 UTC
Issue reproduced
Comment 5 Stephane MANKOWSKI 2023-07-21 20:40:49 UTC
Git commit 91728a47ecaa8c0230c758de881a8d87fe997396 by Stephane MANKOWSKI.
Committed on 21/07/2023 at 20:40.
Pushed by smankowski into branch 'master'.

Importing ISO 20022 XML creates bogus accounts

M  +1    -0    CHANGELOG
M  +6    -6    plugins/import/skrooge_import_backend/skgimportpluginbackend.cpp
M  +3    -3    plugins/import/skrooge_import_xml/ISO20022.xslt
M  +1    -1    plugins/import/skrooge_import_xml/skgimportpluginxml.cpp
M  +3    -3    plugins/skrooge/skrooge_importexport/skgimportexportplugin.cpp
M  +3    -3    plugins/skrooge/skrooge_unit/skgunitplugin.cpp
M  +12   -12   skgbankmodeler/skgunitobject.cpp
M  +3    -3    skgbasegui/skgmainpanel.cpp

https://invent.kde.org/office/skrooge/-/commit/91728a47ecaa8c0230c758de881a8d87fe997396