From 7cd05463cf20cdc5a93413219e2ff78b871d471c Mon Sep 17 00:00:00 2001 From: davidwul Date: Wed, 25 Oct 2023 09:30:42 +0200 Subject: [PATCH 1/2] [IMP] account_bank_statement_import_camt: parse additional information - A Danish (Sydbank) bank is setting the additional information in node This commits takes this in the narration field. --- account_statement_import_camt/models/parser.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/account_statement_import_camt/models/parser.py b/account_statement_import_camt/models/parser.py index 15b526739..6747366ca 100644 --- a/account_statement_import_camt/models/parser.py +++ b/account_statement_import_camt/models/parser.py @@ -85,6 +85,14 @@ def parse_transaction_details(self, ns, node, transaction): "%s (RmtInf/Strd/CdtrRefInf/Ref)" % _("Structured Reference"), join_str=" ", ) + self.add_value_from_node( + ns, + node, + ["./ns:BkTxCd/ns:Prtry/ns:Cd"], + transaction["narration"], + "%s (BkTxCd/Prtry/Cd)" % _("Additional Information"), + join_str=" ", + ) self.add_value_from_node( ns, node, From 05a006aa9a95fa48a8779991ffedeb53052bef8c Mon Sep 17 00:00:00 2001 From: davidwul Date: Thu, 29 Feb 2024 09:25:58 +0100 Subject: [PATCH 2/2] add parsing the QR-IBAN (#18) TODO: - move in camt54 module * add parsing the QR-IBAN * Update parser.py match only first entry --- account_statement_import_camt/models/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_statement_import_camt/models/parser.py b/account_statement_import_camt/models/parser.py index 6747366ca..791829002 100644 --- a/account_statement_import_camt/models/parser.py +++ b/account_statement_import_camt/models/parser.py @@ -385,7 +385,7 @@ def parse_statement(self, ns, node): self.add_value_from_node( ns, node, - ["./ns:Acct/ns:Id/ns:IBAN", "./ns:Acct/ns:Id/ns:Othr/ns:Id"], + ["./ns:Ntry[1]/ns:NtryRef","./ns:Acct/ns:Id/ns:IBAN", "./ns:Acct/ns:Id/ns:Othr/ns:Id"], result, "account_number", )