-
-
Notifications
You must be signed in to change notification settings - Fork 416
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] account_statement_import_camt: multi account support
The module account_statement_import_file supports handling files containing informations related to multiple accounts, but this was not taken advantage of by account_statement_import_camt. We update the structure returned by parser.parse() to use the expected format in case of multiple accounts encountered in CAMT file. This has the side effect of fixing a bug in the previous implementation, when all the transactions in a CAMT file would be parsed as being on the same account (the one on the last statement found in the file), and possibly even more wrong, in the currency of the last statement).
- Loading branch information
1 parent
401b855
commit 63932d5
Showing
9 changed files
with
175 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
account_statement_import_camt/test_files/golden-camt053-no-ntry.pydata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
(None, None, []) | ||
[] |
88 changes: 44 additions & 44 deletions
88
account_statement_import_camt/test_files/golden-camt053-txdtls.pydata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
('CHF', | ||
'CH1111000000123456789', | ||
[{'balance_end_real': 79443.15, | ||
'balance_start': 75960.15, | ||
'date': '2017-03-22', | ||
'name': '20170323123456789012345', | ||
'transactions': [{'account_number': 'CH2222000000123456789', | ||
'amount': 2187.0, | ||
'date': '2017-03-22', | ||
'narration': 'Partner Name (RltdPties/Nm): Banque Cantonale Vaudoise\n' | ||
'Partner Account Number (RltdPties/Acct): CH2222000000123456789\n' | ||
'Transaction Date (BookgDt): 2017-03-22\n' | ||
'Reference: 302388292000011111111111111\n' | ||
'Communication: \n' | ||
'Transaction Type (BkTxCd): PMNT-RCDT-VCOM\n' | ||
'Additional Entry Information (AddtlNtryInf): CRÉDIT GROUPÉ BVR TRAITEMENT DU 22.03.2017 NUMÉRO CLIENT 01-70884-3 PAQUET ID: ' | ||
'123456CHCAFEBABE\n' | ||
'Reversal Indicator (RvslInd): false\n' | ||
'Structured Reference (RmtInf/Strd/CdtrRefInf/Ref): 302388292000011111111111111\n' | ||
'Account Servicer Reference (Refs/AcctSvcrRef): 123456CHCAFEBABE\n' | ||
'Postal Address (PstlAdr): Place Saint-François | 14 | 1003 | Lausanne | CH1', | ||
'partner_name': 'Banque Cantonale Vaudoise', | ||
'payment_ref': '/', | ||
'ref': '302388292000011111111111111', | ||
'transaction_type': 'PMNT-RCDT-VCOM'}, | ||
{'account_number': 'CH3333000000123456789', | ||
'amount': 1296.0, | ||
'date': '2017-03-22', | ||
'narration': 'Partner Name (RltdPties/Nm): Banque Cantonale Vaudoise\n' | ||
'Partner Account Number (RltdPties/Acct): CH3333000000123456789\n' | ||
'Transaction Date (BookgDt): 2017-03-22\n' | ||
'Reference: 302388292000022222222222222\n' | ||
'Communication: \n' | ||
'Transaction Type (BkTxCd): PMNT-RCDT-VCOM\n' | ||
'Additional Entry Information (AddtlNtryInf): CRÉDIT GROUPÉ BVR TRAITEMENT DU 22.03.2017 NUMÉRO CLIENT 01-70884-3 PAQUET ID: ' | ||
'123456CHCAFEBABE\n' | ||
'Reversal Indicator (RvslInd): false\n' | ||
'Structured Reference (RmtInf/Strd/CdtrRefInf/Ref): 302388292000022222222222222\n' | ||
'Account Servicer Reference (Refs/AcctSvcrRef): 123456CHCAFEBABE\n' | ||
'Postal Address (PstlAdr): Place Saint-François | 14 | 1003 | Lausanne | CH2', | ||
'partner_name': 'Banque Cantonale Vaudoise', | ||
'payment_ref': '/', | ||
'ref': '302388292000022222222222222', | ||
'transaction_type': 'PMNT-RCDT-VCOM'}]}]) | ||
[('CHF', | ||
'CH1111000000123456789', | ||
[{'balance_end_real': 79443.15, | ||
'balance_start': 75960.15, | ||
'date': '2017-03-22', | ||
'name': '20170323123456789012345', | ||
'transactions': [{'account_number': 'CH2222000000123456789', | ||
'amount': 2187.0, | ||
'date': '2017-03-22', | ||
'narration': 'Partner Name (RltdPties/Nm): Banque Cantonale Vaudoise\n' | ||
'Partner Account Number (RltdPties/Acct): CH2222000000123456789\n' | ||
'Transaction Date (BookgDt): 2017-03-22\n' | ||
'Reference: 302388292000011111111111111\n' | ||
'Communication: \n' | ||
'Transaction Type (BkTxCd): PMNT-RCDT-VCOM\n' | ||
'Additional Entry Information (AddtlNtryInf): CRÉDIT GROUPÉ BVR TRAITEMENT DU 22.03.2017 NUMÉRO CLIENT 01-70884-3 PAQUET ' | ||
'ID: 123456CHCAFEBABE\n' | ||
'Reversal Indicator (RvslInd): false\n' | ||
'Structured Reference (RmtInf/Strd/CdtrRefInf/Ref): 302388292000011111111111111\n' | ||
'Account Servicer Reference (Refs/AcctSvcrRef): 123456CHCAFEBABE\n' | ||
'Postal Address (PstlAdr): Place Saint-François | 14 | 1003 | Lausanne | CH1', | ||
'partner_name': 'Banque Cantonale Vaudoise', | ||
'payment_ref': '/', | ||
'ref': '302388292000011111111111111', | ||
'transaction_type': 'PMNT-RCDT-VCOM'}, | ||
{'account_number': 'CH3333000000123456789', | ||
'amount': 1296.0, | ||
'date': '2017-03-22', | ||
'narration': 'Partner Name (RltdPties/Nm): Banque Cantonale Vaudoise\n' | ||
'Partner Account Number (RltdPties/Acct): CH3333000000123456789\n' | ||
'Transaction Date (BookgDt): 2017-03-22\n' | ||
'Reference: 302388292000022222222222222\n' | ||
'Communication: \n' | ||
'Transaction Type (BkTxCd): PMNT-RCDT-VCOM\n' | ||
'Additional Entry Information (AddtlNtryInf): CRÉDIT GROUPÉ BVR TRAITEMENT DU 22.03.2017 NUMÉRO CLIENT 01-70884-3 PAQUET ' | ||
'ID: 123456CHCAFEBABE\n' | ||
'Reversal Indicator (RvslInd): false\n' | ||
'Structured Reference (RmtInf/Strd/CdtrRefInf/Ref): 302388292000022222222222222\n' | ||
'Account Servicer Reference (Refs/AcctSvcrRef): 123456CHCAFEBABE\n' | ||
'Postal Address (PstlAdr): Place Saint-François | 14 | 1003 | Lausanne | CH2', | ||
'partner_name': 'Banque Cantonale Vaudoise', | ||
'payment_ref': '/', | ||
'ref': '302388292000022222222222222', | ||
'transaction_type': 'PMNT-RCDT-VCOM'}]}])] |
Oops, something went wrong.