mt940

Message32

Author diva
Recipients ced
Date 2022-12-08.10:34:58
Message-id <1670495698.3164835.OHTKNVYLJXKSWUW3.bug14@b2ck.com>
In-reply-to
I don't have a good idea about the "ABN Amro" bank , as i said i work with different bancs , The story that I have applied the example on a deutch bank that put the IBAN number inside the description and not on the beginning of the description and seems to me the same happen with abn_amro_description(according to the example that i have provided) and that's why i have give an example about abn_amro to find solution about how the search will not be limited on first line from the descrption.


This is code customised for the deutch banc:
Deutsche_Bank_ACCOUNT = re.compile(r"""
    ^(31DE+[0-9]{1,20})""", re.VERBOSE)
Deutsche_Bank_TAGS = [
    ('/TRTP/', 'trtp'),
    ('/IBAN/', 'iban'),
    ('/BIC/', 'bic'),
    ('/CSID', 'csid'),
    ('/NAME/', 'name'),
    ('/REMI/', 'remi'),
    ('/EREF/', 'eref'),
    ('/ORDP//ID/', 'ordp'),
    ('/BENM//ID/', 'benm'),
    ]

def deutsche_bank_description(description):
    "Return dictionary with Deutsche Bank informations"
    description = ''.join(description.splitlines())
    values = {}
    m = Deutsche_Bank_ACCOUNT.match(description)
    if m:
        values['account'] = m.group(1).replace('31', '')
    values.update(_find_swift_tags(Deutsche_Bank_TAGS, description))
    return values
this example description picked up from a book related to the deutch bank 
 and here is an example picked up from a deutch book banc where the iban is puted exactly after (?31):

:86:105?00SEPA-BASIS-LASTSCHRIFT?109316
?20EREF+987654123497?21MREF+10023?22CRED+DE5
4ZZZ09999999999?23SVWZ+Versicherungsbeitrag 2
?24013?30WELADED1MST?31DE87240501501234567890
?32XYZ Versicherungs AG?34991
the iban number (DE87240501501234567890) is inside the description

-----> the search limited in the first line happen in abn_amro and on the deutch banc  that i have customised and added the code by me on mt940 library,I have just customised the regular expression and the file as i say  worked with me if i put the IBAN number on first line and not working if i let it as the example on the book(inside the descrption).
History
Date User Action Args
2022-12-08 10:34:58divasetmessageid: <1670495698.3164835.OHTKNVYLJXKSWUW3.bug14@b2ck.com>
2022-12-08 10:34:58divasetrecipients: + ced
2022-12-08 10:34:58divalinkbug14 messages
2022-12-08 10:34:58divacreate