diff --git a/mt940/__about__.py b/mt940/__about__.py index 9679583..10916f4 100644 --- a/mt940/__about__.py +++ b/mt940/__about__.py @@ -6,7 +6,7 @@ statistics and manipulation. '''.strip().split()) __email__ = 'wolph@wol.ph' -__version__ = '4.29.0' +__version__ = '4.30.0' __license__ = 'BSD' __copyright__ = 'Copyright 2015 Rick van Hattem (wolph)' __url__ = 'https://github.com/WoLpH/mt940' diff --git a/mt940/models.py b/mt940/models.py index 64c4cae..ec4e37b 100644 --- a/mt940/models.py +++ b/mt940/models.py @@ -261,7 +261,10 @@ class Transactions(abc.Sequence): pre_related_reference=[], post_related_reference=[], pre_statement=[processors.date_fixup_pre_processor], - post_statement=[processors.date_cleanup_post_processor], + post_statement=[ + processors.date_cleanup_post_processor, + processors.transactions_to_transaction('transaction_reference'), + ], pre_statement_number=[], post_statement_number=[], pre_non_swift=[], @@ -282,6 +285,12 @@ class Transactions(abc.Sequence): pre_sum_debit_entries=[], post_sum_debit_entries=[]) + def __getstate__(self): # pragma: no cover + # Processors are not always safe to dump so ignore them entirely + state = self.__dict__.copy() + del state['processors'] + return state + def __init__(self, processors=None, tags=None): self.processors = self.DEFAULT_PROCESSORS.copy() self.tags = Transactions.defaultTags().copy() diff --git a/mt940/processors.py b/mt940/processors.py index 91fc224..a4df98e 100644 --- a/mt940/processors.py +++ b/mt940/processors.py @@ -46,7 +46,8 @@ def mBank_set_transaction_code(transactions, tag, tag_dict, *args): processing """ tag_dict['transaction_code'] = int( - tag_dict[tag.slug].split(';')[0].split(' ', 1)[0]) + tag_dict[tag.slug].split(';')[0].split(' ', 1)[0] + ) return tag_dict @@ -67,8 +68,10 @@ def mBank_set_iph_id(transactions, tag, tag_dict, *args): return tag_dict -tnr_re = re.compile(r'TNR:[ \n](?P\d+\.\d+)', - flags=re.MULTILINE | re.UNICODE) +tnr_re = re.compile( + r'TNR:[ \n](?P\d+\.\d+)', + flags=re.MULTILINE | re.UNICODE +) def mBank_set_tnr(transactions, tag, tag_dict, *args): @@ -205,8 +208,8 @@ def _parse_mt940_gvcodes(purpose): return result -def transaction_details_post_processor(transactions, tag, tag_dict, result, - space=False): +def transaction_details_post_processor( + transactions, tag, tag_dict, result, space=False): '''Parse the extra details in some transaction formats such as the 60-65 keys. @@ -226,8 +229,10 @@ def transaction_details_post_processor(transactions, tag, tag_dict, result, purpose = result.get('purpose') - if purpose and any(gvk in purpose for gvk in GVC_KEYS - if gvk != ''): # pragma: no branch + if purpose and any( + gvk in purpose for gvk in GVC_KEYS + if gvk != '' + ): # pragma: no branch result.update(_parse_mt940_gvcodes(result['purpose'])) del result['transaction_details'] @@ -236,4 +241,29 @@ def transaction_details_post_processor(transactions, tag, tag_dict, result, transaction_details_post_processor_with_space = functools.partial( - transaction_details_post_processor, space=True) + transaction_details_post_processor, space=True +) + + +def transactions_to_transaction(*keys): + '''Copy the global transactions details to the transaction. + + Args: + *keys (str): the keys to copy to the transaction + ''' + def _transactions_to_transaction(transactions, tag, tag_dict, result): + '''Copy the global transactions details to the transaction. + + Args: + transactions (mt940.models.Transactions): list of transactions + tag (mt940.tags.Tag): tag + tag_dict (dict): dict with the raw tag details + result (dict): the resulting tag dict + ''' + for key in keys: + if key in transactions.data: + result[key] = transactions.data[key] + + return result + + return _transactions_to_transaction diff --git a/mt940/tags.py b/mt940/tags.py index e3c7421..fb86399 100644 --- a/mt940/tags.py +++ b/mt940/tags.py @@ -84,7 +84,6 @@ print('MT940 requires the `enum34` package', file=sys.stderr) - class enum(object): @staticmethod def unique(*args, **kwargs): @@ -109,7 +108,7 @@ def parse(self, transactions, value): match = self.re.match(value) if match: # pragma: no branch self.logger.debug( - 'matched (%d) %r against %r, got: %s', + 'matched (%d) %r against "%s", got: %s', len(value), value, self.pattern, match.groupdict() ) diff --git a/mt940_tests/betterplace/amount_formats.yml b/mt940_tests/betterplace/amount_formats.yml index 09044b3..c4c4976 100644 --- a/mt940_tests/betterplace/amount_formats.yml +++ b/mt940_tests/betterplace/amount_formats.yml @@ -9,53 +9,11 @@ data: - !!binary | B9oDEg== status: C -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -71,15 +29,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -87,18 +45,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -112,24 +71,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/betterplace/currency_in_25.yml b/mt940_tests/betterplace/currency_in_25.yml index c0faabd..568c44a 100644 --- a/mt940_tests/betterplace/currency_in_25.yml +++ b/mt940_tests/betterplace/currency_in_25.yml @@ -1,53 +1,11 @@ !!python/object:mt940.models.Transactions data: account_identification: 51210600/9223382012EUR -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -63,15 +21,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -79,18 +37,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -104,24 +63,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/betterplace/empty_86.yml b/mt940_tests/betterplace/empty_86.yml index 115aa0e..b1582f1 100644 --- a/mt940_tests/betterplace/empty_86.yml +++ b/mt940_tests/betterplace/empty_86.yml @@ -1,52 +1,10 @@ !!python/object:mt940.models.Transactions data: {} -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -62,15 +20,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -78,18 +36,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -103,24 +62,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/betterplace/empty_entry_date.yml b/mt940_tests/betterplace/empty_entry_date.yml index 864b9b8..694922e 100644 --- a/mt940_tests/betterplace/empty_entry_date.yml +++ b/mt940_tests/betterplace/empty_entry_date.yml @@ -1,52 +1,10 @@ &id003 !!python/object:mt940.models.Transactions data: {} -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -62,15 +20,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -78,18 +36,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -103,24 +62,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/betterplace/empty_line.yml b/mt940_tests/betterplace/empty_line.yml index bab0e7f..f30f4c0 100644 --- a/mt940_tests/betterplace/empty_line.yml +++ b/mt940_tests/betterplace/empty_line.yml @@ -1,53 +1,11 @@ !!python/object:mt940.models.Transactions data: transaction_reference: TELEREPORTING -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -63,15 +21,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -79,18 +37,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -104,24 +63,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/betterplace/missing_crlf_at_end.yml b/mt940_tests/betterplace/missing_crlf_at_end.yml index d66565e..c22a804 100644 --- a/mt940_tests/betterplace/missing_crlf_at_end.yml +++ b/mt940_tests/betterplace/missing_crlf_at_end.yml @@ -9,53 +9,11 @@ data: - !!binary | B9oDFw== status: C -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -71,15 +29,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -87,18 +45,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -112,24 +71,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/betterplace/sepa_mt9401.yml b/mt940_tests/betterplace/sepa_mt9401.yml index b74ec48..abfad31 100644 --- a/mt940_tests/betterplace/sepa_mt9401.yml +++ b/mt940_tests/betterplace/sepa_mt9401.yml @@ -49,53 +49,11 @@ data: sequence_number: '00001' statement_number: '00001' transaction_reference: T089414136000001 -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -111,15 +69,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -127,18 +85,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -152,24 +111,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -225,6 +184,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089413946000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -275,6 +235,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089413946000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -325,6 +286,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089413946000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -358,6 +320,7 @@ transactions: return_debit_notes: null status: C transaction_code: 079 + transaction_reference: T089413946000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -408,6 +371,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089413946000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -441,6 +405,7 @@ transactions: return_debit_notes: null status: RC transaction_code: 079 + transaction_reference: T089413946000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -474,6 +439,7 @@ transactions: return_debit_notes: null status: D transaction_code: 079 + transaction_reference: T089413946000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -524,6 +490,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089413956000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -576,6 +543,7 @@ transactions: settlement_tag: null status: D transaction_code: '191' + transaction_reference: T089413956000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -625,6 +593,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089413966000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -674,6 +643,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089413966000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -723,6 +693,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089413966000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -775,6 +746,7 @@ transactions: settlement_tag: null status: D transaction_code: '191' + transaction_reference: T089413966000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -827,6 +799,7 @@ transactions: settlement_tag: null status: D transaction_code: '191' + transaction_reference: T089413966000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -876,6 +849,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089413976000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -925,6 +899,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089413976000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -974,6 +949,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089413976000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1007,6 +983,7 @@ transactions: return_debit_notes: null status: C transaction_code: 079 + transaction_reference: T089413986000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1040,6 +1017,7 @@ transactions: return_debit_notes: null status: RC transaction_code: '116' + transaction_reference: T089413986000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1091,6 +1069,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089413986000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1143,6 +1122,7 @@ transactions: settlement_tag: null status: D transaction_code: '191' + transaction_reference: T089413986000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1176,6 +1156,7 @@ transactions: return_debit_notes: null status: D transaction_code: '191' + transaction_reference: T089413986000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1225,6 +1206,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089413996000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1275,6 +1257,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414006000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1327,6 +1310,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414006000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1377,6 +1361,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414006000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1429,6 +1414,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414006000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1481,6 +1467,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414006000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1533,6 +1520,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414006000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1585,6 +1573,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414006000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1637,6 +1626,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414006000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1687,6 +1677,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089414016000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1737,6 +1728,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089414016000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1787,6 +1779,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089414016000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1838,6 +1831,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089414016000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1889,6 +1883,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089414016000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1941,6 +1936,7 @@ transactions: settlement_tag: null status: D transaction_code: '191' + transaction_reference: T089414016000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -1974,6 +1970,7 @@ transactions: return_debit_notes: null status: D transaction_code: '191' + transaction_reference: T089414016000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2007,6 +2004,7 @@ transactions: return_debit_notes: null status: D transaction_code: '191' + transaction_reference: T089414016000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2041,6 +2039,7 @@ transactions: return_debit_notes: null status: D transaction_code: '191' + transaction_reference: T089414016000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2075,6 +2074,7 @@ transactions: return_debit_notes: null status: D transaction_code: '191' + transaction_reference: T089414016000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2127,6 +2127,7 @@ transactions: settlement_tag: null status: D transaction_code: '191' + transaction_reference: T089414016000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2177,6 +2178,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089414026000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2227,6 +2229,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089414026000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2278,6 +2281,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414026000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2329,6 +2333,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414026000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2380,6 +2385,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414026000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2431,6 +2437,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414026000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2482,6 +2489,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414026000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2533,6 +2541,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414026000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2585,6 +2594,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414026000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2619,6 +2629,7 @@ transactions: return_debit_notes: null status: D transaction_code: '191' + transaction_reference: T089414026000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2671,6 +2682,7 @@ transactions: settlement_tag: null status: D transaction_code: '191' + transaction_reference: T089414026000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2723,6 +2735,7 @@ transactions: settlement_tag: null status: D transaction_code: '191' + transaction_reference: T089414026000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2773,6 +2786,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089414036000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2823,6 +2837,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089414036000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2875,6 +2890,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414036000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2927,6 +2943,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414036000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -2978,6 +2995,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414036000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3011,6 +3029,7 @@ transactions: return_debit_notes: null status: D transaction_code: '191' + transaction_reference: T089414036000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3063,6 +3082,7 @@ transactions: settlement_tag: null status: D transaction_code: '191' + transaction_reference: T089414036000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3115,6 +3135,7 @@ transactions: settlement_tag: null status: D transaction_code: '191' + transaction_reference: T089414036000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3149,6 +3170,7 @@ transactions: return_debit_notes: null status: D transaction_code: '191' + transaction_reference: T089414036000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3198,6 +3220,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414046000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3249,6 +3272,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414056000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3300,6 +3324,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414056000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3351,6 +3376,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414056000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3402,6 +3428,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414056000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3453,6 +3480,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414056000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3504,6 +3532,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414056000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3556,6 +3585,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414056000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3607,6 +3637,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414056000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3659,6 +3690,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414056000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3711,6 +3743,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414056000002 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3763,6 +3796,7 @@ transactions: settlement_tag: null status: D transaction_code: '191' + transaction_reference: T089414056000003 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3816,6 +3850,7 @@ transactions: settlement_tag: null status: D transaction_code: '116' + transaction_reference: T089414056000003 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3865,6 +3900,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414066000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3914,6 +3950,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414076000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -3963,6 +4000,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414076000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -4012,6 +4050,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414076000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -4061,6 +4100,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414086000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -4110,6 +4150,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414086000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -4159,6 +4200,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414086000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -4211,6 +4253,7 @@ transactions: settlement_tag: null status: D transaction_code: '191' + transaction_reference: T089414086000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -4261,6 +4304,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089414096000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -4311,6 +4355,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089414096000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -4361,6 +4406,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089414096000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -4411,6 +4457,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414096000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -4460,6 +4507,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414096000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -4510,6 +4558,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089414096000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -4543,6 +4592,7 @@ transactions: return_debit_notes: null status: D transaction_code: 079 + transaction_reference: T089414096000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -4592,6 +4642,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414106000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -4641,6 +4692,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414106000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -4693,6 +4745,7 @@ transactions: settlement_tag: null status: D transaction_code: '191' + transaction_reference: T089414106000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -4745,6 +4798,7 @@ transactions: settlement_tag: null status: D transaction_code: '191' + transaction_reference: T089414116000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -4797,6 +4851,7 @@ transactions: settlement_tag: null status: D transaction_code: '191' + transaction_reference: T089414126000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -4847,4 +4902,5 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414136000001 transactions: *id003 diff --git a/mt940_tests/betterplace/sepa_snippet.yml b/mt940_tests/betterplace/sepa_snippet.yml index f00f8f2..9271a6a 100644 --- a/mt940_tests/betterplace/sepa_snippet.yml +++ b/mt940_tests/betterplace/sepa_snippet.yml @@ -31,53 +31,11 @@ data: sequence_number: '00001' statement_number: '00004' transaction_reference: T089414096000001 -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -93,15 +51,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -109,18 +67,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -134,24 +93,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -206,6 +165,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414086000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -255,6 +215,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414086000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -304,6 +265,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414086000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -356,6 +318,7 @@ transactions: settlement_tag: null status: D transaction_code: '191' + transaction_reference: T089414086000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -406,6 +369,7 @@ transactions: settlement_tag: null status: D transaction_code: '159' + transaction_reference: T089414096000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -456,6 +420,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089414096000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -506,6 +471,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089414096000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -556,6 +522,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414096000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -605,6 +572,7 @@ transactions: settlement_tag: null status: C transaction_code: '166' + transaction_reference: T089414096000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -655,6 +623,7 @@ transactions: settlement_tag: null status: C transaction_code: '159' + transaction_reference: T089414096000001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -688,4 +657,5 @@ transactions: return_debit_notes: null status: D transaction_code: 079 + transaction_reference: T089414096000001 transactions: *id003 diff --git a/mt940_tests/betterplace/sepa_snippet_broken.yml b/mt940_tests/betterplace/sepa_snippet_broken.yml index 2d1f4fe..f0ccf29 100644 --- a/mt940_tests/betterplace/sepa_snippet_broken.yml +++ b/mt940_tests/betterplace/sepa_snippet_broken.yml @@ -31,53 +31,11 @@ data: sequence_number: '00001' statement_number: '00004' transaction_reference: T089414086000001 -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -93,15 +51,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -109,18 +67,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -134,24 +93,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -180,4 +139,5 @@ transactions: B9cJBA== id: NTRF status: C + transaction_reference: T089414086000001 transactions: *id003 diff --git a/mt940_tests/betterplace/with_binary_character.yml b/mt940_tests/betterplace/with_binary_character.yml index b78dbb6..2f478ae 100644 --- a/mt940_tests/betterplace/with_binary_character.yml +++ b/mt940_tests/betterplace/with_binary_character.yml @@ -22,53 +22,11 @@ data: sequence_number: '00001' statement_number: '00053' transaction_reference: "STAR1\xDCTUMS" -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -84,15 +42,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -100,18 +58,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -125,24 +84,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -181,6 +140,7 @@ transactions: return_debit_notes: '000' status: C transaction_code: '051' + transaction_reference: "STAR1\xDCT\xDFUMS" transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -214,6 +174,7 @@ transactions: return_debit_notes: '000' status: C transaction_code: '051' + transaction_reference: "STAR1\xDCT\xDFUMS" transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -248,6 +209,7 @@ transactions: return_debit_notes: '540' status: D transaction_code: '035' + transaction_reference: "STAR1\xDCT\xDFUMS" transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -276,10 +238,11 @@ transactions: id: N085 posting_text: Zahlung m.Elektr.Unterschr. prima_nota: '991135' - purpose: "Belegloser Zahlungsauftrag\xDCberweisung:19.03.2010Anzahl Posten :7Anw-Nr.:\ - \ 69725663086" + purpose: "Belegloser Zahlungsauftrag\xDCberweisung:19.03.2010Anzahl Posten :7Anw-Nr.: + 69725663086" recipient_name: null return_debit_notes: '540' status: C transaction_code: 085 + transaction_reference: "STAR1\xDCTUMS" transactions: *id003 diff --git a/mt940_tests/cmxl/account_balance_credit.yml b/mt940_tests/cmxl/account_balance_credit.yml index 10694dd..4e9b93c 100644 --- a/mt940_tests/cmxl/account_balance_credit.yml +++ b/mt940_tests/cmxl/account_balance_credit.yml @@ -9,53 +9,11 @@ data: - !!binary | B94IHQ== status: C -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -71,15 +29,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -87,18 +45,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -112,24 +71,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/cmxl/account_balance_debit.yml b/mt940_tests/cmxl/account_balance_debit.yml index 27d6b5e..d316f8b 100644 --- a/mt940_tests/cmxl/account_balance_debit.yml +++ b/mt940_tests/cmxl/account_balance_debit.yml @@ -9,53 +9,11 @@ data: - !!binary | B94IHQ== status: D -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -71,15 +29,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -87,18 +45,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -112,24 +71,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/cmxl/account_identification_iban.yml b/mt940_tests/cmxl/account_identification_iban.yml index 5b658ab..fa0ccf3 100644 --- a/mt940_tests/cmxl/account_identification_iban.yml +++ b/mt940_tests/cmxl/account_identification_iban.yml @@ -1,53 +1,11 @@ !!python/object:mt940.models.Transactions data: account_identification: PL25106000760000888888888888 -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -63,15 +21,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -79,18 +37,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -104,24 +63,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/cmxl/account_identification_legacy.yml b/mt940_tests/cmxl/account_identification_legacy.yml index 85baba8..82babd4 100644 --- a/mt940_tests/cmxl/account_identification_legacy.yml +++ b/mt940_tests/cmxl/account_identification_legacy.yml @@ -1,53 +1,11 @@ !!python/object:mt940.models.Transactions data: account_identification: 70011110/4005287001EUR -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -63,15 +21,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -79,18 +37,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -104,24 +63,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/cmxl/available_balance.yml b/mt940_tests/cmxl/available_balance.yml index b1064bb..0ffeda1 100644 --- a/mt940_tests/cmxl/available_balance.yml +++ b/mt940_tests/cmxl/available_balance.yml @@ -9,53 +9,11 @@ data: - !!binary | B94JAQ== status: D -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -71,15 +29,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -87,18 +45,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -112,24 +71,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/cmxl/closing_balance.yml b/mt940_tests/cmxl/closing_balance.yml index 03479a9..087b789 100644 --- a/mt940_tests/cmxl/closing_balance.yml +++ b/mt940_tests/cmxl/closing_balance.yml @@ -9,53 +9,11 @@ data: - !!binary | B94JAQ== status: C -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -71,15 +29,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -87,18 +45,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -112,24 +71,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/cmxl/mt940.yml b/mt940_tests/cmxl/mt940.yml index bc80d71..a06b264 100644 --- a/mt940_tests/cmxl/mt940.yml +++ b/mt940_tests/cmxl/mt940.yml @@ -23,53 +23,11 @@ data: sequence_number: '001' statement_number: 00084 transaction_reference: TELEWIZORY S.A. -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -85,15 +43,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -101,18 +59,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -126,24 +85,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -167,6 +126,7 @@ transactions: id: NCHK status: D transaction_details: 999PN5477SCHECK-NR. 0000016703074 + transaction_reference: '131110' transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -185,6 +145,7 @@ transactions: id: NSTO status: D transaction_details: 999PN0911DAUERAUFTR.NR. 14 + transaction_reference: '131110' transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -203,6 +164,7 @@ transactions: id: NCLR status: C transaction_details: 999PN2406SCHECK + transaction_reference: '131110' transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -221,6 +183,7 @@ transactions: id: NBOE status: D transaction_details: 999PN0920WECHSEL + transaction_reference: '131110' transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -239,6 +202,7 @@ transactions: id: NTRF status: D transaction_details: 999PN0920SCHNELLUEB + transaction_reference: '131110' transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -257,6 +221,7 @@ transactions: id: NMSC status: C transaction_details: 999PN2506AUSSENH. NR. 1 + transaction_reference: '131110' transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -275,6 +240,7 @@ transactions: id: NTRF status: D transaction_details: 999PN0907UEBERTRAG + transaction_reference: '131110' transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -293,6 +259,7 @@ transactions: id: NTRF status: D transaction_details: 999PN0891BTX + transaction_reference: '131110' transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -311,6 +278,7 @@ transactions: id: NMSC status: C transaction_details: 999PN0850EINZAHLG.N + transaction_reference: '131110' transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -329,6 +297,7 @@ transactions: id: NMSC status: C transaction_details: 999PN0812LT.ANLAGE + transaction_reference: '131110' transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -347,6 +316,7 @@ transactions: id: NCHK status: D transaction_details: 999PN5329AUSLSCHECK + transaction_reference: '131110' transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -380,6 +350,7 @@ transactions: return_debit_notes: '339' status: D transaction_code: 008 + transaction_reference: '1234567' transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -413,6 +384,7 @@ transactions: return_debit_notes: '339' status: C transaction_code: '051' + transaction_reference: '1234567' transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -448,6 +420,7 @@ transactions: return_debit_notes: null status: C transaction_code: '020' + transaction_reference: TELEWIZORY S.A. transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -483,6 +456,7 @@ transactions: return_debit_notes: null status: D transaction_code: '020' + transaction_reference: TELEWIZORY S.A. transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -516,4 +490,5 @@ transactions: return_debit_notes: null status: C transaction_code: '844' + transaction_reference: TELEWIZORY S.A. transactions: *id003 diff --git a/mt940_tests/cmxl/reference.yml b/mt940_tests/cmxl/reference.yml index c96a374..8692ec9 100644 --- a/mt940_tests/cmxl/reference.yml +++ b/mt940_tests/cmxl/reference.yml @@ -1,53 +1,11 @@ !!python/object:mt940.models.Transactions data: transaction_reference: D140902049 -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -63,15 +21,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -79,18 +37,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -104,24 +63,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/cmxl/statement_details.yml b/mt940_tests/cmxl/statement_details.yml index c84a1cc..e3843b4 100644 --- a/mt940_tests/cmxl/statement_details.yml +++ b/mt940_tests/cmxl/statement_details.yml @@ -1,52 +1,10 @@ &id003 !!python/object:mt940.models.Transactions data: {} -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -62,15 +20,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -78,18 +36,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -103,24 +62,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/cmxl/statement_line.yml b/mt940_tests/cmxl/statement_line.yml index 2e785be..e801d0c 100644 --- a/mt940_tests/cmxl/statement_line.yml +++ b/mt940_tests/cmxl/statement_line.yml @@ -1,52 +1,10 @@ &id003 !!python/object:mt940.models.Transactions data: {} -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -62,15 +20,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -78,18 +36,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -103,24 +62,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/cmxl/statement_number.yml b/mt940_tests/cmxl/statement_number.yml index d8e4c9a..3e341f2 100644 --- a/mt940_tests/cmxl/statement_number.yml +++ b/mt940_tests/cmxl/statement_number.yml @@ -2,53 +2,11 @@ data: sequence_number: '001' statement_number: '00035' -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -64,15 +22,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -80,18 +38,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -105,24 +64,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/jejik/abnamro.yml b/mt940_tests/jejik/abnamro.yml index 46b4d1e..9c79e50 100644 --- a/mt940_tests/jejik/abnamro.yml +++ b/mt940_tests/jejik/abnamro.yml @@ -40,53 +40,11 @@ data: sequence_number: '1' statement_number: '19322' transaction_reference: ABN AMRO BANK NV -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -102,15 +60,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -118,18 +76,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -143,24 +102,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -194,6 +153,7 @@ transactions: 5314606715 BETREFT FACTUUR D.D. 20-05-2011 INCL. 1,44 BTW' + transaction_reference: ABN AMRO BANK NV transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -218,6 +178,7 @@ transactions: id: N426 status: D transaction_details: BEA NR:XXX1234 21.05.11/12.54 DIRCKIII FIL2500 KATWIJK,PAS999 + transaction_reference: ABN AMRO BANK NV transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -243,6 +204,7 @@ transactions: status: D transaction_details: BEA NR:XXX1234 23.05.11/09.08 DIGROS FIL1015 KATWIJK Z,PAS999 + transaction_reference: ABN AMRO BANK NV transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -267,6 +229,7 @@ transactions: id: N426 status: D transaction_details: BEA NR:XXX1234 22.05.11/14.25 MC DONALDS A44 LEIDEN,PAS999 + transaction_reference: ABN AMRO BANK NV transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -292,6 +255,7 @@ transactions: status: D transaction_details: BEA NR:XXX1234 21.05.11/12.09 PRINCE FIL. 55 KATWIJK Z,PAS999 + transaction_reference: ABN AMRO BANK NV transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -317,6 +281,7 @@ transactions: status: D transaction_details: BEA NR:XXX1234 21.05.11/12.55 DIRX FIL6017 KATWIJK ZH ,PAS999 + transaction_reference: ABN AMRO BANK NV transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -341,6 +306,7 @@ transactions: id: N426 status: D transaction_details: BEA NR:XXX1234 21.05.11/12.04 HANS ANDERS OPT./056 KAT,PAS999 + transaction_reference: ABN AMRO BANK NV transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -365,6 +331,7 @@ transactions: id: N426 status: D transaction_details: BEA NR:XXX1234 22.05.11/13.45 MYCOM DEN HAAG S-GRAVEN,PAS999 + transaction_reference: ABN AMRO BANK NV transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -389,6 +356,7 @@ transactions: id: N426 status: D transaction_details: BEA NR:XXX1234 24.05.11/09.18 PETS PLACE KATWIJK KATWI,PAS999 + transaction_reference: ABN AMRO BANK NV transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -413,4 +381,5 @@ transactions: id: N426 status: D transaction_details: 52.89.39.882 MYCOM DEN HAAG + transaction_reference: ABN AMRO BANK NV transactions: *id003 diff --git a/mt940_tests/jejik/generic.yml b/mt940_tests/jejik/generic.yml index d015c51..947913c 100644 --- a/mt940_tests/jejik/generic.yml +++ b/mt940_tests/jejik/generic.yml @@ -22,53 +22,11 @@ data: sequence_number: null statement_number: '2' transaction_reference: GENERIC -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -84,15 +42,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -100,18 +58,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -125,24 +84,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -166,6 +125,7 @@ transactions: id: N000 status: D transaction_details: '' + transaction_reference: GENERIC transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -184,4 +144,5 @@ transactions: id: N000 status: D transaction_details: '' + transaction_reference: GENERIC transactions: *id003 diff --git a/mt940_tests/jejik/ing.yml b/mt940_tests/jejik/ing.yml index 98cb79a..fa008d2 100644 --- a/mt940_tests/jejik/ing.yml +++ b/mt940_tests/jejik/ing.yml @@ -22,53 +22,11 @@ data: sequence_number: null statement_number: '000' transaction_reference: MPBZ -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -84,15 +42,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -100,18 +58,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -125,24 +84,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -170,6 +129,7 @@ transactions: BETREFT REKENING 4715589 PERIODE: 01-10-2010 / 31-12-2010 ING Bank N.V. tarifering ING' + transaction_reference: MPBZ transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -188,6 +148,7 @@ transactions: id: NTRF status: D transaction_details: "0111111111 GPSEOUL SPOEDBETALING\tMPBZS1016000047 GPSEOUL" + transaction_reference: MPBZ transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -205,8 +166,9 @@ transactions: funds_code: null id: NTRF status: D - transaction_details: "0111111111 ING iDEAL KN: TMG TANGO TRANSACTIENR 0050000534527978\ - \ 10\xAD06\xAD2010 15:32 TMG TANGO ING Bank inzake GPKyoto" + transaction_details: "0111111111 ING iDEAL KN: TMG TANGO TRANSACTIENR 0050000534527978 + 10\xAD06\xAD2010 15:32 TMG TANGO ING Bank inzake GPKyoto" + transaction_reference: MPBZ transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -225,6 +187,7 @@ transactions: id: NTRF status: D transaction_details: "ABN AMRO BANK>AMSTERDAM 22\xAD07\xAD2010 09:57 002\t5595781" + transaction_reference: MPBZ transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -243,6 +206,7 @@ transactions: id: NTRF status: D transaction_details: 0111111111 GPPeking 170000001AC + transaction_reference: MPBZ transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -261,6 +225,7 @@ transactions: id: NTRF status: C transaction_details: 0123456789 EJ46GREENP100610T1456 CLIEOP TMG GPHONGKONG AMSTERDAM + transaction_reference: MPBZ transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -287,4 +252,5 @@ transactions: D000004C000002D25,24C28,71 -XXX' + transaction_reference: MPBZ transactions: *id003 diff --git a/mt940_tests/jejik/knab.yml b/mt940_tests/jejik/knab.yml index 88c31f7..05e83e8 100644 --- a/mt940_tests/jejik/knab.yml +++ b/mt940_tests/jejik/knab.yml @@ -22,53 +22,11 @@ data: sequence_number: '1' statement_number: '999' transaction_reference: B4G30MS9D00A003D -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -84,15 +42,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -100,18 +58,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -125,24 +84,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -174,6 +133,7 @@ transactions: transaction_details: 'HIER EEN MOOIE OMSCHRIJVING IN HOOFDLETTERS WANT DAT IS ZOALS DE NEDERLANDSE BANKEN COMMUNICEREN' + transaction_reference: B4E08MS9D00A0009 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -200,6 +160,7 @@ transactions: transaction_details: 'FACTUUR 201403110, 201403113 REK: NL65INGB0123456789/NAAM: PICQER' + transaction_reference: B4G30MS9D00A003D transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -227,4 +188,5 @@ transactions: NE REK: NL84INGB0234561789/NAAM: MMS ONLINE NEDERLAND B.V.' + transaction_reference: B4G30MS9D00A003D transactions: *id003 diff --git a/mt940_tests/jejik/postfinance.yml b/mt940_tests/jejik/postfinance.yml index b006194..46940a2 100644 --- a/mt940_tests/jejik/postfinance.yml +++ b/mt940_tests/jejik/postfinance.yml @@ -40,53 +40,11 @@ data: sequence_number: '2' statement_number: '999' transaction_reference: '2014040708285928' -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -102,15 +60,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -118,18 +76,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -143,24 +102,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -189,8 +148,9 @@ transactions: B90MCQ== id: FMSC status: C - transaction_details: "GIRO AUS ONLINE-SIC 80532 AUFTRAGGEBER: JANE DOE EXAMPLESTRASSE\n\ - \ 10 1234 XXXX 131209CH98765432 MITTEILUNGEN: RECHNUNG XXXXXXXXXXXX" + transaction_details: "GIRO AUS ONLINE-SIC 80532 AUFTRAGGEBER: JANE DOE EXAMPLESTRASSE\n + 10 1234 XXXX 131209CH98765432 MITTEILUNGEN: RECHNUNG XXXXXXXXXXXX" + transaction_reference: '2014040708285927' transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -214,8 +174,9 @@ transactions: B90MCQ== id: FMSC status: C - transaction_details: "GIRO AUS ONLINE-SIC 81379 AUFTRAGGEBER: JOHN DOE EXAMPLESTRASSE\n\ - \ 12 1234 XXXXXXXXXX 131209CH87654321" + transaction_details: "GIRO AUS ONLINE-SIC 81379 AUFTRAGGEBER: JOHN DOE EXAMPLESTRASSE\n + 12 1234 XXXXXXXXXX 131209CH87654321" + transaction_reference: '2014040708285927' transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -244,6 +205,7 @@ transactions: ASSE 111 1234 XXXXXXXXXXXX 131216CH12345678 MITTEILUNGEN: 1 SONNE NGLAESER' + transaction_reference: '2014040708285928' transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -268,4 +230,5 @@ transactions: id: FMSC status: C transaction_details: EINZAHLUNGSSCHEIN + transaction_reference: '2014040708285928' transactions: *id003 diff --git a/mt940_tests/jejik/rabobank-iban.yml b/mt940_tests/jejik/rabobank-iban.yml index e273610..0d80ddc 100644 --- a/mt940_tests/jejik/rabobank-iban.yml +++ b/mt940_tests/jejik/rabobank-iban.yml @@ -22,53 +22,11 @@ data: sequence_number: null statement_number: '0' transaction_reference: 940S130101 -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -84,15 +42,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -100,18 +58,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -125,24 +84,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -169,6 +128,7 @@ transactions: ACCOUN T HOLDER/REMI//ISDT/2013-07-11' + transaction_reference: 940S130101 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -187,6 +147,7 @@ transactions: id: N154 status: D transaction_details: /BENM//NAME/JOHN DOE/REMI/Reference 201301234/ISDT/2013-01-02 + transaction_reference: 940S130101 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -208,6 +169,7 @@ transactions: ACCOUN T HOLDER/REMI//ISDT/2013-07-11' + transaction_reference: 940S130101 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -226,4 +188,5 @@ transactions: id: N154 status: D transaction_details: /BENM//NAME/JOHN DOE/REMI/Reference 201301234/ISDT/2013-01-09 + transaction_reference: 940S130101 transactions: *id003 diff --git a/mt940_tests/jejik/rabobank.yml b/mt940_tests/jejik/rabobank.yml index 512bc3a..80928b6 100644 --- a/mt940_tests/jejik/rabobank.yml +++ b/mt940_tests/jejik/rabobank.yml @@ -22,53 +22,11 @@ data: sequence_number: '00' statement_number: '00000' transaction_reference: 940A120829 -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -84,15 +42,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -100,18 +58,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -125,24 +84,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -172,6 +131,7 @@ transactions: KOSTEN KINDEROPVANG JUNI 20095731' + transaction_reference: 940A110615 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -192,6 +152,7 @@ transactions: transaction_details: 'BETALINGSKENM. 123456789 FACTUURNUMMER 987654321' + transaction_reference: 940A110617 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -210,6 +171,7 @@ transactions: id: N030 status: D transaction_details: Betaalautomaat 14:23 pasnr. 065 + transaction_reference: 940A110617 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -234,6 +196,7 @@ transactions: ZIE REKENING OP KPN.COM OF HI.NL KPN - MOBIEL' + transaction_reference: 940A120829 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -252,4 +215,5 @@ transactions: id: NMSC status: D transaction_details: Betaalautomaat 08:22 pasnr. 001 + transaction_reference: 940A120829 transactions: *id003 diff --git a/mt940_tests/jejik/sns.yml b/mt940_tests/jejik/sns.yml index 5c3d75c..a647d2c 100644 --- a/mt940_tests/jejik/sns.yml +++ b/mt940_tests/jejik/sns.yml @@ -22,53 +22,11 @@ data: sequence_number: '1' statement_number: '161' transaction_reference: '0000000000' -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -84,15 +42,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -100,18 +58,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -125,24 +84,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -174,6 +133,7 @@ transactions: transaction_details: '0987654321 marechal s dit is een test' + transaction_reference: '0000000000' transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -200,4 +160,5 @@ transactions: transaction_details: '0987654321 marechal s dit is test 2' + transaction_reference: '0000000000' transactions: *id003 diff --git a/mt940_tests/jejik/triodos.yml b/mt940_tests/jejik/triodos.yml index e3862f0..1dd8851 100644 --- a/mt940_tests/jejik/triodos.yml +++ b/mt940_tests/jejik/triodos.yml @@ -22,53 +22,11 @@ data: sequence_number: null statement_number: '1' transaction_reference: 1308728725026/1 -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -84,15 +42,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -100,18 +58,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -125,24 +84,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -170,6 +129,7 @@ transactions: >20ALGEMENE TUSSENREKENING KOS>21TEN VAN 01-10-2010 TOT EN M >22ET 31-12-2010>310390123456' + transaction_reference: 1308728725026/1 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -190,4 +150,5 @@ transactions: transaction_details: '000>100133967858 >20 HUUR>21 KANTOOR - FEB 2010' + transaction_reference: 1308728725026/1 transactions: *id003 diff --git a/mt940_tests/mBank/mt940.yml b/mt940_tests/mBank/mt940.yml index baecaf5..2c8fa74 100644 --- a/mt940_tests/mBank/mt940.yml +++ b/mt940_tests/mBank/mt940.yml @@ -31,53 +31,11 @@ data: sequence_number: '1' statement_number: '1' transaction_reference: ST170119CYC/1 -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -93,15 +51,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -109,18 +67,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -134,24 +93,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -187,6 +146,7 @@ transactions: UL. NIJAKA 1 M 2 31-234 KRAKOW; TYT.: PRZELEW SRODKOW ; TNR: 179171073864111.010001' + transaction_reference: ST170119CYC/1 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -217,6 +177,7 @@ transactions: UL. NIJAKA 1 M 2 31-234 KRAKOW; TYT.: PRZELEW SRODKOW ; TNR: 179171073864192.000001' + transaction_reference: ST170119CYC/1 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -247,4 +208,5 @@ transactions: UL. NIJAKA 1 M 2 31-234 KRAKOW; TYT.: PRZELEW SRODKOW ; TNR: 179171073864291.000001' + transaction_reference: ST170119CYC/1 transactions: *id003 diff --git a/mt940_tests/mBank/mt942.yml b/mt940_tests/mBank/mt942.yml index 1fab2fa..85eeed8 100644 --- a/mt940_tests/mBank/mt942.yml +++ b/mt940_tests/mBank/mt942.yml @@ -32,53 +32,11 @@ data: currency: PLN number: '0' transaction_reference: ST170119CYC/0001 -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -94,15 +52,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -110,18 +68,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -135,24 +94,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -188,6 +147,7 @@ transactions: UL. NIJAKA 1 M 2 31-234 KRAKOW; TYT.: PRZELEW SRODKOW ; TNR: 179171073864111.010001' + transaction_reference: ST170119CYC/0001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -218,6 +178,7 @@ transactions: UL. NIJAKA 1 M 2 31-234 KRAKOW; TYT.: PRZELEW SRODKOW ; TNR: 179171073864192.000001' + transaction_reference: ST170119CYC/0001 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -248,4 +209,5 @@ transactions: UL. NIJAKA 1 M 2 31-234 KRAKOW; TYT.: PRZELEW SRODKOW ; TNR: 179171073864291.000001' + transaction_reference: ST170119CYC/0001 transactions: *id003 diff --git a/mt940_tests/mBank/with_newline_in_tnr.yml b/mt940_tests/mBank/with_newline_in_tnr.yml index ec9ce1e..bec13a6 100644 --- a/mt940_tests/mBank/with_newline_in_tnr.yml +++ b/mt940_tests/mBank/with_newline_in_tnr.yml @@ -31,53 +31,11 @@ data: sequence_number: '1' statement_number: '3' transaction_reference: ST170201CYC/1 -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -93,15 +51,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -109,18 +67,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -134,24 +93,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -189,6 +148,7 @@ transactions: AAAAA AAAAAA UL. AAAAAAAAAAA 220/22 ; TNR: 179301073837502.000001' + transaction_reference: ST170201CYC/1 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -219,4 +179,5 @@ transactions: AAAAAAAAAAAAA 22 31-000 AAAAAA; TYT.: AAAAAA AA AAAAAAAA ; TNR: 179301073844398.000001' + transaction_reference: ST170201CYC/1 transactions: *id003 diff --git a/mt940_tests/sberbank/171011_01234945.yml b/mt940_tests/sberbank/171011_01234945.yml index c4c4444..969979a 100644 --- a/mt940_tests/sberbank/171011_01234945.yml +++ b/mt940_tests/sberbank/171011_01234945.yml @@ -59,53 +59,11 @@ data: sequence_number: null statement_number: '00046' transaction_reference: STARTUMS -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -121,15 +79,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -137,18 +95,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -162,24 +121,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -207,9 +166,8 @@ transactions: - !!binary | B+EKCw== id: 'S ' - non_swift: "01526715\n02A12596785 20170926000100\n031366\n04526715\n09Tranzakci\uFFFD\ - s Illet\uFFFDk:7.21HUF\n15ERGO Versicherung AG Fiokte\n16lep\n17G200000137791678\n\ - 18652055\n3310918001\n340000004279070017" + non_swift: "01526715\n02A12596785 20170926000100\n031366\n04526715\n09Tranzakci\uFFFDs + Illet\uFFFDk:7.21HUF\n15ERGO Versicherung AG Fiokte\n16lep\n17G200000137791678\n18652055\n3310918001\n340000004279070017" non_swift_01: '526715' non_swift_02: A12596785 20170926000100 non_swift_03: '1366' @@ -221,10 +179,10 @@ transactions: non_swift_18: '652055' non_swift_33: '10918001' non_swift_34: 0000004279070017 - non_swift_text: "526715\nA12596785 20170926000100\n1366\n526715\nTranzakci\uFFFD\ - s Illet\uFFFDk:7.21HUF\nERGO Versicherung AG Fiokte\nlep\nG200000137791678\n\ - 652055\n10918001\n0000004279070017" + non_swift_text: "526715\nA12596785 20170926000100\n1366\n526715\nTranzakci\uFFFDs + Illet\uFFFDk:7.21HUF\nERGO Versicherung AG Fiokte\nlep\nG200000137791678\n652055\n10918001\n0000004279070017" status: D + transaction_reference: STARTUMS transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -247,9 +205,8 @@ transactions: - !!binary | B+EKCw== id: 'S ' - non_swift: "01136508\n02A10580361 20170926000100\n033009\n04136508\n09Tranz.\ - \ Illet\uFFFDk: 10.38HUF\n15ERGO Eletbiztosito Zrt.\n17G200000015891789\n18791033\n\ - 3310918001\n340000002595841185" + non_swift: "01136508\n02A10580361 20170926000100\n033009\n04136508\n09Tranz. + Illet\uFFFDk: 10.38HUF\n15ERGO Eletbiztosito Zrt.\n17G200000015891789\n18791033\n3310918001\n340000002595841185" non_swift_01: '136508' non_swift_02: A10580361 20170926000100 non_swift_03: '3009' @@ -260,9 +217,10 @@ transactions: non_swift_18: '791033' non_swift_33: '10918001' non_swift_34: 0000002595841185 - non_swift_text: "136508\nA10580361 20170926000100\n3009\n136508\nTranz. Illet\uFFFD\ - k: 10.38HUF\nERGO Eletbiztosito Zrt.\nG200000015891789\n791033\n10918001\n0000002595841185" + non_swift_text: "136508\nA10580361 20170926000100\n3009\n136508\nTranz. Illet\uFFFDk: + 10.38HUF\nERGO Eletbiztosito Zrt.\nG200000015891789\n791033\n10918001\n0000002595841185" status: D + transaction_reference: STARTUMS transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -285,9 +243,8 @@ transactions: - !!binary | B+EKCw== id: 'S ' - non_swift: "01625006\n02A14282085 20170926000100\n031221\n04625006\n09Tranz.\ - \ Illet\uFFFDk: 10.73HUF\n15ERGO Versicherung AG Fiokte\n16lep\n17G200011025720127\n\ - 18561351\n3310918001\n340000004279070017" + non_swift: "01625006\n02A14282085 20170926000100\n031221\n04625006\n09Tranz. + Illet\uFFFDk: 10.73HUF\n15ERGO Versicherung AG Fiokte\n16lep\n17G200011025720127\n18561351\n3310918001\n340000004279070017" non_swift_01: '625006' non_swift_02: A14282085 20170926000100 non_swift_03: '1221' @@ -299,8 +256,8 @@ transactions: non_swift_18: '561351' non_swift_33: '10918001' non_swift_34: 0000004279070017 - non_swift_text: "625006\nA14282085 20170926000100\n1221\n625006\nTranz. Illet\uFFFD\ - k: 10.73HUF\nERGO Versicherung AG Fiokte\nlep\nG200011025720127\n561351\n10918001\n\ - 0000004279070017" + non_swift_text: "625006\nA14282085 20170926000100\n1221\n625006\nTranz. Illet\uFFFDk: + 10.73HUF\nERGO Versicherung AG Fiokte\nlep\nG200011025720127\n561351\n10918001\n0000004279070017" status: D + transaction_reference: STARTUMS transactions: *id003 diff --git a/mt940_tests/self-provided/account_identification.yml b/mt940_tests/self-provided/account_identification.yml index 647d26e..07d2b67 100644 --- a/mt940_tests/self-provided/account_identification.yml +++ b/mt940_tests/self-provided/account_identification.yml @@ -2,53 +2,11 @@ data: account_identification: ACXXXXXX000000XXXXXX3 transaction_reference: 0003478756 -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -64,15 +22,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -80,18 +38,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -105,24 +64,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/self-provided/details_60-63.yml b/mt940_tests/self-provided/details_60-63.yml index ca4dccc..d282f22 100644 --- a/mt940_tests/self-provided/details_60-63.yml +++ b/mt940_tests/self-provided/details_60-63.yml @@ -22,53 +22,11 @@ data: sequence_number: null statement_number: '0' transaction_reference: STARTUMS -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -84,15 +42,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -100,18 +58,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -125,24 +84,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -192,4 +151,5 @@ transactions: settlement_tag: null status: D transaction_code: '105' + transaction_reference: STARTUMS transactions: *id003 diff --git a/mt940_tests/self-provided/empty_non_swift.yml b/mt940_tests/self-provided/empty_non_swift.yml index 13ad516..b5c394a 100644 --- a/mt940_tests/self-provided/empty_non_swift.yml +++ b/mt940_tests/self-provided/empty_non_swift.yml @@ -2,53 +2,11 @@ data: non_swift: '' non_swift_text: '' -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -64,15 +22,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -80,18 +38,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -105,24 +64,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/self-provided/february_30.yml b/mt940_tests/self-provided/february_30.yml index b2051fd..3e8f41a 100644 --- a/mt940_tests/self-provided/february_30.yml +++ b/mt940_tests/self-provided/february_30.yml @@ -22,53 +22,11 @@ data: sequence_number: '001' statement_number: '00000' transaction_reference: STARTUMSE -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -84,15 +42,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -100,18 +58,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -125,24 +84,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -181,4 +140,5 @@ transactions: return_debit_notes: null status: D transaction_code: '805' + transaction_reference: STARTUMSE transactions: *id003 diff --git a/mt940_tests/self-provided/gv_codes.yml b/mt940_tests/self-provided/gv_codes.yml index 5dcce2b..8776860 100644 --- a/mt940_tests/self-provided/gv_codes.yml +++ b/mt940_tests/self-provided/gv_codes.yml @@ -13,53 +13,11 @@ data: sequence_number: null statement_number: '0' transaction_reference: STARTUMS -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -75,15 +33,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -91,18 +49,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -116,24 +75,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -182,6 +141,7 @@ transactions: settlement_tag: null status: D transaction_code: '835' + transaction_reference: STARTUMS transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -205,4 +165,5 @@ transactions: B+MKGQ== id: NMSC status: D + transaction_reference: STARTUMS transactions: *id003 diff --git a/mt940_tests/self-provided/invalid_statement.yml b/mt940_tests/self-provided/invalid_statement.yml index 115aa0e..b1582f1 100644 --- a/mt940_tests/self-provided/invalid_statement.yml +++ b/mt940_tests/self-provided/invalid_statement.yml @@ -1,52 +1,10 @@ !!python/object:mt940.models.Transactions data: {} -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -62,15 +20,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -78,18 +36,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -103,24 +62,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/self-provided/long_statement_number.yml b/mt940_tests/self-provided/long_statement_number.yml index 815c9c6..4817073 100644 --- a/mt940_tests/self-provided/long_statement_number.yml +++ b/mt940_tests/self-provided/long_statement_number.yml @@ -22,53 +22,11 @@ data: sequence_number: '18101' statement_number: '18101' transaction_reference: '12345678' -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -84,15 +42,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -100,18 +58,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -125,24 +84,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/self-provided/malformed_details.yml b/mt940_tests/self-provided/malformed_details.yml index 68ffe47..b083edb 100644 --- a/mt940_tests/self-provided/malformed_details.yml +++ b/mt940_tests/self-provided/malformed_details.yml @@ -22,53 +22,11 @@ data: sequence_number: null statement_number: '0' transaction_reference: STARTUMS -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -84,15 +42,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -100,18 +58,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -125,24 +84,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -193,4 +152,5 @@ transactions: settlement_tag: null status: D transaction_code: '105' + transaction_reference: STARTUMS transactions: *id003 diff --git a/mt940_tests/self-provided/mt942.yml b/mt940_tests/self-provided/mt942.yml index 384e048..64caf3c 100644 --- a/mt940_tests/self-provided/mt942.yml +++ b/mt940_tests/self-provided/mt942.yml @@ -27,53 +27,11 @@ data: currency: EUR number: '1' transaction_reference: CGNGHKLI0290980 -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -89,15 +47,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -105,18 +63,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -130,24 +89,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -179,4 +138,5 @@ transactions: transaction_details: 'REMIT:Costs to MT940 Parsing. This is Somuchfun.' + transaction_reference: CGNGHKLI0290980 transactions: *id003 diff --git a/mt940_tests/self-provided/multiline.yml b/mt940_tests/self-provided/multiline.yml index 57a9ae9..8cf2016 100644 --- a/mt940_tests/self-provided/multiline.yml +++ b/mt940_tests/self-provided/multiline.yml @@ -31,53 +31,11 @@ data: sequence_number: '001' statement_number: '00115' transaction_reference: BILMT940 -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -93,15 +51,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -109,18 +67,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -134,24 +93,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -201,6 +160,7 @@ transactions: FREE TEXT FREE TEXT' + transaction_reference: BILMT940 transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -224,4 +184,5 @@ transactions: B+YMFA== id: NMSC status: C + transaction_reference: BILMT940 transactions: *id003 diff --git a/mt940_tests/self-provided/overly_long_details.yml b/mt940_tests/self-provided/overly_long_details.yml index 68ffe47..b083edb 100644 --- a/mt940_tests/self-provided/overly_long_details.yml +++ b/mt940_tests/self-provided/overly_long_details.yml @@ -22,53 +22,11 @@ data: sequence_number: null statement_number: '0' transaction_reference: STARTUMS -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -84,15 +42,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -100,18 +58,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -125,24 +84,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -193,4 +152,5 @@ transactions: settlement_tag: null status: D transaction_code: '105' + transaction_reference: STARTUMS transactions: *id003 diff --git a/mt940_tests/self-provided/raiffeisen-cmi.yml b/mt940_tests/self-provided/raiffeisen-cmi.yml index b08d7f6..2de194a 100644 --- a/mt940_tests/self-provided/raiffeisen-cmi.yml +++ b/mt940_tests/self-provided/raiffeisen-cmi.yml @@ -40,53 +40,11 @@ data: sequence_number: null statement_number: '0072' transaction_reference: STARTUMS -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -102,15 +60,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -118,18 +76,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -143,24 +102,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -183,9 +142,10 @@ transactions: funds_code: F id: N527 status: C - transaction_details: "CAB18D1700041116\n109876543210000012345678\nHUNGARY KFT.\n\ - UV, napi \xF6sszevont ut\xE1nv\xE9t, 2018.04\n.17, A13947109201804175000000097,\ - \ X" + transaction_details: "CAB18D1700041116\n109876543210000012345678\nHUNGARY KFT.\nUV, + napi \xF6sszevont ut\xE1nv\xE9t, 2018.04\n.17, A13947109201804175000000097, + X" + transaction_reference: STARTUMS transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -210,6 +170,7 @@ transactions: SPYMARKET S.R.O. 18175' + transaction_reference: STARTUMS transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -232,6 +193,7 @@ transactions: HUF 1.218.882,00 Carma Ex Varna' + transaction_reference: STARTUMS transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -252,6 +214,7 @@ transactions: transaction_details: 'OLD18D038146 HUF 1.218.882,00' + transaction_reference: STARTUMS transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -272,6 +235,7 @@ transactions: transaction_details: 'OLD18D038146 HUF 1.218.882,00' + transaction_reference: STARTUMS transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -292,6 +256,7 @@ transactions: transaction_details: 'OLD18D038146 HUF 1.218.882,00' + transaction_reference: STARTUMS transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -312,4 +277,5 @@ transactions: transaction_details: 'OLD18D038146 HUF 1.218.882,00' + transaction_reference: STARTUMS transactions: *id003 diff --git a/mt940_tests/self-provided/raphaelm.yml b/mt940_tests/self-provided/raphaelm.yml index ea08528..08c9330 100644 --- a/mt940_tests/self-provided/raphaelm.yml +++ b/mt940_tests/self-provided/raphaelm.yml @@ -80,53 +80,11 @@ data: sequence_number: '1' statement_number: '2' transaction_reference: STARTUMS -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -142,15 +100,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -158,18 +116,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -183,24 +142,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -228,8 +187,7 @@ transactions: - !!binary | B9IDFA== id: S051 - non_swift: "01Verwendungszweck 1\n02Verwendungszweck 2\n15Empf\xE4nger\n17Buchungstext\n\ - 1812345\n191000\n204711" + non_swift: "01Verwendungszweck 1\n02Verwendungszweck 2\n15Empf\xE4nger\n17Buchungstext\n1812345\n191000\n204711" non_swift_01: Verwendungszweck 1 non_swift_02: Verwendungszweck 2 non_swift_15: "Empf\xE4nger" @@ -237,9 +195,9 @@ transactions: non_swift_18: '12345' non_swift_19: '1000' non_swift_20: '4711' - non_swift_text: "Verwendungszweck 1\nVerwendungszweck 2\nEmpf\xE4nger\nBuchungstext\n\ - 12345\n1000\n4711" + non_swift_text: "Verwendungszweck 1\nVerwendungszweck 2\nEmpf\xE4nger\nBuchungstext\n12345\n1000\n4711" status: C + transaction_reference: STARTUMS transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -257,6 +215,7 @@ transactions: funds_code: M id: NCHG status: C + transaction_reference: STARTUMS transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -274,6 +233,7 @@ transactions: funds_code: M id: S051 status: C + transaction_reference: STARTUMS transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -291,6 +251,7 @@ transactions: funds_code: M id: S051 status: C + transaction_reference: STARTUMS transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -308,6 +269,7 @@ transactions: funds_code: M id: S051 status: C + transaction_reference: STARTUMS transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -328,6 +290,7 @@ transactions: non_swift_22: '3037010000' non_swift_text: '3037010000' status: C + transaction_reference: STARTUMS transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -345,6 +308,7 @@ transactions: funds_code: M id: S051 status: C + transaction_reference: STARTUMS transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -380,6 +344,7 @@ transactions: 87132101' status: C + transaction_reference: STARTUMS transactions: *id003 - !!python/object:mt940.models.Transaction data: @@ -405,4 +370,5 @@ transactions: 12345' status: D + transaction_reference: STARTUMS transactions: *id003 diff --git a/mt940_tests/self-provided/sparkassen.yml b/mt940_tests/self-provided/sparkassen.yml index 2f5562c..07bf243 100644 --- a/mt940_tests/self-provided/sparkassen.yml +++ b/mt940_tests/self-provided/sparkassen.yml @@ -1,52 +1,10 @@ &id003 !!python/object:mt940.models.Transactions data: {} -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -62,15 +20,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -78,18 +36,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -103,24 +62,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 diff --git a/mt940_tests/self-provided/transaction_details_wrapped.yml b/mt940_tests/self-provided/transaction_details_wrapped.yml index 5f6d09a..799f521 100644 --- a/mt940_tests/self-provided/transaction_details_wrapped.yml +++ b/mt940_tests/self-provided/transaction_details_wrapped.yml @@ -22,53 +22,11 @@ data: sequence_number: '001' statement_number: '00000' transaction_reference: STARTUMSE -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -84,15 +42,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -100,18 +58,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -125,24 +84,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -181,4 +140,5 @@ transactions: return_debit_notes: null status: D transaction_code: '805' + transaction_reference: STARTUMSE transactions: *id003 diff --git a/mt940_tests/self-provided/whitespace.yml b/mt940_tests/self-provided/whitespace.yml index 1a687f6..8c8f8d7 100644 --- a/mt940_tests/self-provided/whitespace.yml +++ b/mt940_tests/self-provided/whitespace.yml @@ -22,53 +22,11 @@ data: sequence_number: null statement_number: '0' transaction_reference: STARTUMS -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -84,15 +42,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -100,18 +58,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -125,24 +84,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -175,4 +134,5 @@ transactions: return_debit_notes: null status: D transaction_code: '820' + transaction_reference: STARTUMS transactions: *id003 diff --git a/mt940_tests/self-provided/wrapped_timestamp.yml b/mt940_tests/self-provided/wrapped_timestamp.yml index aad6134..aa19d33 100644 --- a/mt940_tests/self-provided/wrapped_timestamp.yml +++ b/mt940_tests/self-provided/wrapped_timestamp.yml @@ -22,53 +22,11 @@ data: sequence_number: '001' statement_number: '00000' transaction_reference: STARTUMSE -processors: - post_account_identification: [] - post_available_balance: [] - post_closing_balance: [] - post_date_time_indication: [] - post_final_closing_balance: [] - post_final_opening_balance: [] - post_floor_limit_indicator: [] - post_forward_available_balance: [] - post_intermediate_closing_balance: [] - post_intermediate_opening_balance: [] - post_non_swift: [] - post_opening_balance: [] - post_related_reference: [] - post_statement: - - !!python/name:mt940.processors.date_cleanup_post_processor '' - post_statement_number: [] - post_sum_credit_entries: [] - post_sum_debit_entries: [] - post_transaction_details: - - !!python/name:mt940.processors.transaction_details_post_processor '' - post_transaction_reference_number: [] - pre_account_identification: [] - pre_available_balance: [] - pre_closing_balance: [] - pre_date_time_indication: [] - pre_final_closing_balance: [] - pre_final_opening_balance: [] - pre_floor_limit_indicator: [] - pre_forward_available_balance: [] - pre_intermediate_closing_balance: [] - pre_intermediate_opening_balance: [] - pre_non_swift: [] - pre_opening_balance: [] - pre_related_reference: [] - pre_statement: - - !!python/name:mt940.processors.date_fixup_pre_processor '' - pre_statement_number: [] - pre_sum_credit_entries: [] - pre_sum_debit_entries: [] - pre_transaction_details: [] - pre_transaction_reference_number: [] tags: 13: !!python/object:mt940.tags.DateTimeIndication re: !!python/object/apply:re._compile - - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\\ - d{2})\n (?P\\d{2})\n (\\+(?P\\d{4})|)\n " + - "^\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n (?P\\d{2})\n + \ (?P\\d{2})\n (\\+(?P\\d{4})|)\n " - 98 20: !!python/object:mt940.tags.TransactionReferenceNumber re: !!python/object/apply:re._compile @@ -84,15 +42,15 @@ tags: - 98 28: !!python/object:mt940.tags.StatementNumber re: !!python/object/apply:re._compile - - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\\ - d{1,5}))? # [/5n]\n $" + - "\n (?P\\d{1,5}) # 5n\n (?:/?(?P\\d{1,5}))? + \ # [/5n]\n $" - 98 60: !!python/object:mt940.tags.OpeningBalance re: &id001 !!python/object/apply:re._compile - - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value\ - \ Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3})\ - \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n " + - "^\n (?P[DC]) # 1!a Debit/Credit\n (?P\\d{2}) # 6!n Value + Date (YYMMDD)\n (?P\\d{2})\n (?P\\d{2})\n (?P.{3}) + \ # 3!a Currency\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n " - 98 60M: !!python/object:mt940.tags.IntermediateOpeningBalance re: *id001 @@ -100,18 +58,19 @@ tags: re: *id001 61: !!python/object:mt940.tags.Statement re: !!python/object/apply:re._compile - - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n\ - \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n\ - \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n\ - \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n\ - \ # code, if needed)\n \\n? # apparently some\ - \ banks (sparkassen) incorporate newlines here\n (?P[\\d,]{1,15})\ - \ # 15d Amount\n (?P[A-Z][A-Z0-9 ]{3})? # 1!a3!c Transaction Type Identification\ - \ Code\n # We need the (slow) repeating negative lookahead to search for\ - \ // so we\n # don't acciddntly include the bank reference in the customer\ - \ reference.\n (?P((?!//)[^\\n]){0,16}) # 16x Customer\ - \ Reference\n (//(?P.{0,23}))? # [//23x] Bank Reference\n\ - \ (\\n?(?P.{0,34}))? # [34x] Supplementary Details\n $" + - "^\n (?P\\d{2}) # 6!n Value Date (YYMMDD)\n (?P\\d{2})\n + \ (?P\\d{2})\n (?P\\d{2})? # [4!n] Entry Date (MMDD)\n + \ (?P\\d{2})?\n (?PR?[DC]) # 2a Debit/Credit Mark\n + \ (?P[A-Z])? # [1!a] Funds Code (3rd character of the currency\n + \ # code, if needed)\n [\\n ]? # apparently some + banks (sparkassen) incorporate newlines here\n # cuscal can also send a space + here as well\n (?P[\\d,]{1,15}) # 15d Amount\n (?P[A-Z][A-Z0-9 + ]{3})? # 1!a3!c Transaction Type Identification Code\n # We need the (slow) + repeating negative lookahead to search for // so we\n # don't acciddntly + include the bank reference in the customer reference.\n (?P((?!//)[^\\n]){0,16}) + \ # 16x Customer Reference\n (//(?P.{0,23}))? # [//23x] + Bank Reference\n (\\n?(?P.{0,34}))? # [34x] Supplementary + Details\n $" - 98 62: !!python/object:mt940.tags.ClosingBalance re: *id001 @@ -125,24 +84,24 @@ tags: re: *id001 86: !!python/object:mt940.tags.TransactionDetails re: !!python/object/apply:re._compile - - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n\ - \ " + - "\n (?P(([\\s\\S]{0,65}\\r?\\n?){0,8}[\\s\\S]{0,65}))\n + \ " - 98 34: !!python/object:mt940.tags.FloorLimitIndicator re: !!python/object/apply:re._compile - - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a\ - \ Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal\ - \ sign, so 16)\n $" + - "^\n (?P[A-Z]{3}) # 3!a Currency\n (?P[DC ]?) # 2a + Debit/Credit Mark\n (?P[0-9,]{0,16}) # 15d Amount (includes decimal + sign, so 16)\n $" - 98 NS: !!python/object:mt940.tags.NonSwift re: !!python/object/apply:re._compile - - "\n (?P\n (\n (\\d{2}.{0,})\n (\\\ - n\\d{2}.{0,})*\n )|(\n [^\\n]*\n )\n )\n $" + - "\n (?P\n (\n (\\d{2}.{0,})\n (\\n\\d{2}.{0,})*\n + \ )|(\n [^\\n]*\n )\n )\n $" - 98 90: !!python/object:mt940.tags.SumEntries re: &id002 !!python/object/apply:re._compile - - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\\ - d,]{1,15}) # 15d Amount\n " + - "^\n (?P\\d*)\n (?P.{3}) # 3!a Currency\n (?P[\\d,]{1,15}) + \ # 15d Amount\n " - 98 90D: !!python/object:mt940.tags.SumDebitEntries re: *id002 @@ -198,4 +157,5 @@ transactions: settlement_tag: null status: D transaction_code: '106' + transaction_reference: STARTUMSE transactions: *id003 diff --git a/mt940_tests/test_parse.py b/mt940_tests/test_parse.py index 1ed9603..418153d 100644 --- a/mt940_tests/test_parse.py +++ b/mt940_tests/test_parse.py @@ -1,21 +1,25 @@ +import pathlib import pytest import mt940 +_tests_path = pathlib.Path(__file__).parent -@pytest.mark.parametrize('filename,encoding', [ - ('mt940_tests/jejik/ing.sta', 'utf-8'), - ('mt940_tests/self-provided/raphaelm.sta', 'utf-8'), - ('mt940_tests/betterplace/with_binary_character.sta', 'utf-8'), -]) -def test_non_ascii_parse(filename, encoding): + +@pytest.mark.parametrize( + 'path,encoding', [ + (_tests_path / 'jejik' / 'ing.sta', 'utf-8'), + (_tests_path / 'self-provided' / 'raphaelm.sta', 'utf-8'), + (_tests_path / 'betterplace' / 'with_binary_character.sta', 'utf-8'), + ] +) +def test_non_ascii_parse(path, encoding): # Read as binary - with open(filename, 'rb') as fh: + with path.open('rb') as fh: data = fh.read() data = data.decode(encoding) mt940.parse(data) # Read as text - with open(filename, 'r') as fh: + with path.open('r') as fh: data = fh.read() mt940.parse(data) - diff --git a/mt940_tests/test_processors.py b/mt940_tests/test_processors.py index 60cc348..c9f709f 100644 --- a/mt940_tests/test_processors.py +++ b/mt940_tests/test_processors.py @@ -1,16 +1,21 @@ +import os +import pathlib + import pytest import mt940 +_tests_path = pathlib.Path(__file__).parent + @pytest.fixture def sta_data(): - with open('mt940_tests/jejik/abnamro.sta') as fh: + with (_tests_path / 'jejik' / 'abnamro.sta').open() as fh: return fh.read() @pytest.fixture def february_30_data(): - with open('mt940_tests/self-provided/february_30.sta') as fh: + with (_tests_path / 'self-provided' / 'february_30.sta').open() as fh: return fh.read() @@ -25,17 +30,19 @@ def test_date_fixup_pre_processor(february_30_data): def test_parse_data(): - with open('mt940_tests/jejik/abnamro.sta') as fh: + with (_tests_path / 'jejik' / 'abnamro.sta').open() as fh: mt940.parse(fh.read()) def test_parse_fh(): - with open('mt940_tests/jejik/abnamro.sta') as fh: + with (_tests_path / 'jejik' / 'abnamro.sta').open() as fh: mt940.parse(fh) def test_parse_filename(): - mt940.parse('mt940_tests/jejik/abnamro.sta') + path = 'mt940_tests/jejik/abnamro.sta' + path = path.replace('/', os.pathsep) + mt940.parse(path) def test_pre_processor(sta_data): @@ -66,7 +73,7 @@ def test_post_processor(sta_data): @pytest.fixture def mBank_mt942_data(): - with open('mt940_tests/mBank/mt942.sta') as fh: + with (_tests_path / 'mBank' / 'mt942.sta').open() as fh: return fh.read() @@ -86,7 +93,7 @@ def test_mBank_processors(mBank_mt942_data): def test_transaction_details_post_processor_with_space(): - filename = 'mt940_tests/betterplace/sepa_mt9401.sta' + filename = _tests_path / 'betterplace' / 'sepa_mt9401.sta' transactions = mt940.parse(filename) transaction2 = transactions[0].data @@ -104,7 +111,7 @@ def test_transaction_details_post_processor_with_space(): @pytest.fixture def mBank_with_newline_in_tnr(): - with open('mt940_tests/mBank/with_newline_in_tnr.sta') as fh: + with (_tests_path / 'mBank' / 'with_newline_in_tnr.sta').open() as fh: return fh.read() diff --git a/mt940_tests/test_sta_parsing.py b/mt940_tests/test_sta_parsing.py index 26c7875..c67eedc 100644 --- a/mt940_tests/test_sta_parsing.py +++ b/mt940_tests/test_sta_parsing.py @@ -9,6 +9,11 @@ from mt940 import _compat +try: + from yaml import CLoader as Loader, CDumper as Dumper +except ImportError: + from yaml import Loader, Dumper + logger = logging.getLogger(__name__) @@ -31,13 +36,13 @@ def get_sta_files(): def get_yaml_data(sta_file): yml_file = sta_file.replace('.sta', '.yml') with open(yml_file) as fh: - return yaml.load(fh, Loader=yaml.Loader) + return yaml.load(fh, Loader=Loader) def write_yaml_data(sta_file, data): yml_file = sta_file.replace('.sta', '.yml') with open(yml_file, 'w') as fh: - fh.write(yaml.dump(data, Dumper=yaml.Dumper)) + fh.write(yaml.dump(data, Dumper=Dumper)) def compare(a, b, key=''): diff --git a/mt940_tests/test_tags.py b/mt940_tests/test_tags.py index 6cf036f..ef5e140 100644 --- a/mt940_tests/test_tags.py +++ b/mt940_tests/test_tags.py @@ -1,13 +1,19 @@ +import pathlib + import pytest import mt940 from mt940 import tags from mt940 import models import pprint +_tests_path = pathlib.Path(__file__).parent + @pytest.fixture def long_statement_number(): - with open('mt940_tests/self-provided/long_statement_number.sta') as fh: + with ( + _tests_path / 'self-provided' / 'long_statement_number.sta').open() \ + as fh: return fh.read() @@ -25,24 +31,30 @@ class MyStatementNumber(tags.Tag): def test_specify_different_tag_classes(long_statement_number): tag_parser = MyStatementNumber() - transactions = mt940.models.Transactions(tags={ - tag_parser.id: tag_parser - }) + transactions = mt940.models.Transactions( + tags={ + tag_parser.id: tag_parser + } + ) transactions.parse(long_statement_number) assert transactions.data.get('statement_number') == '1810118101' @pytest.fixture def ASNB_mt940_data(): - with open('mt940_tests/ASNB/0708271685_09022020_164516.940.txt') as fh: + with ( + _tests_path / 'ASNB' / '0708271685_09022020_164516.940.txt').open() \ + as fh: return fh.read() def test_ASNB_tags(ASNB_mt940_data): tag_parser = tags.StatementASNB() - trs = mt940.models.Transactions(tags={ - tag_parser.id: tag_parser - }) + trs = mt940.models.Transactions( + tags={ + tag_parser.id: tag_parser + } + ) trs.parse(ASNB_mt940_data) @@ -83,21 +95,28 @@ def test_ASNB_tags(ASNB_mt940_data): 'date': models.Date(2020, 1, 1), 'entry_date': models.Date(2020, 1, 1), 'guessed_entry_date': models.Date(2020, 1, 1), + 'transaction_reference': '0000000000', } assert td == 'NL47INGB9999999999 hr gjlm paulissen\nBetaling sieraden' assert trs.transactions[1].data['amount'] == models.Amount( - '1000.00', 'C', 'EUR') + '1000.00', 'C', 'EUR' + ) assert trs.transactions[2].data['amount'] == models.Amount( - '801.55', 'D', 'EUR') + '801.55', 'D', 'EUR' + ) assert trs.transactions[3].data['amount'] == models.Amount( - '1.65', 'D', 'EUR') + '1.65', 'D', 'EUR' + ) assert trs.transactions[4].data['amount'] == models.Amount( - '828.72', 'C', 'EUR') + '828.72', 'C', 'EUR' + ) assert trs.transactions[5].data['amount'] == models.Amount( - '1000.00', 'D', 'EUR') + '1000.00', 'D', 'EUR' + ) assert trs.transactions[6].data['amount'] == models.Amount( - '1000.18', 'C', 'EUR') + '1000.18', 'C', 'EUR' + ) td = trs.transactions[7].data.pop('transaction_details') assert trs.transactions[7].data == { @@ -112,10 +131,10 @@ def test_ASNB_tags(ASNB_mt940_data): 'date': models.Date(2020, 1, 31), 'entry_date': models.Date(2020, 1, 31), 'guessed_entry_date': models.Date(2020, 1, 31), + 'transaction_reference': '0000000000', } assert td[0:46] == 'NL08ABNA9999999999 international card services' assert td[47:112] == \ - '000000000000000000000000000000000 0000000000000000 Betaling aan I' + '000000000000000000000000000000000 0000000000000000 Betaling aan I' assert td[113:176] == \ - 'CS 99999999999 ICS Referentie: 2020-01-31 21:27 000000000000000' - + 'CS 99999999999 ICS Referentie: 2020-01-31 21:27 000000000000000' diff --git a/setup.py b/setup.py index aefc450..ab6cf5b 100755 --- a/setup.py +++ b/setup.py @@ -3,12 +3,7 @@ import os import sys -from setuptools.command.test import test as TestCommand - -try: - from setuptools import setup, find_packages -except ImportError: - from distutils.core import setup, find_packages +from setuptools import setup, find_packages # To prevent importing about and thereby breaking the coverage info we use this # exec hack @@ -17,21 +12,6 @@ exec(fp.read(), about) -class PyTest(TestCommand): - user_options = [('pytest-args=', 'a', 'Arguments to pass to pytest')] - - def initialize_options(self): - TestCommand.initialize_options(self) - self.pytest_args = '' - - def run_tests(self): - import shlex - # import here, cause outside the eggs aren't loaded - import pytest - errno = pytest.main(shlex.split(self.pytest_args)) - sys.exit(errno) - - tests_require = [ 'pyyaml', 'pytest', @@ -103,7 +83,6 @@ def run_tests(self): 'setuptools>=39.1.0', ], zip_safe=False, - cmdclass={'test': PyTest}, extras_require={ 'docs': [ 'sphinx>=1.7.2',