mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
Use ebcdic pattern of allowed characters for user message
This commit is contained in:
@@ -31,6 +31,7 @@ class HSBCParser(object):
|
||||
|
||||
def __init__( self ):
|
||||
recparse = dict()
|
||||
patterns = {'ebcdic': "\w/\?:\(\).,'+{} -"}
|
||||
|
||||
# MT940 header
|
||||
recparse["20"] = ":(?P<recordid>20):(?P<transref>.{1,16})"
|
||||
@@ -43,16 +44,18 @@ class HSBCParser(object):
|
||||
+ "(?P<startingbalance>[\d,]{1,15})"
|
||||
|
||||
# Transaction
|
||||
recparse["61"] = ":(?P<recordid>61):" \
|
||||
+ "(?P<valuedate>\d{6})(?P<bookingdate>\d{4})?" \
|
||||
+ "(?P<creditmarker>R?[CD])" \
|
||||
+ "(?P<currency>[A-Z])?" \
|
||||
+ "(?P<amount>[\d,]{1,15})" \
|
||||
+ "(?P<bookingcode>[A-Z][A-Z0-9]{3})" \
|
||||
+ "(?P<custrefno>[A-Za-z0-9 _-]{1,16})" \
|
||||
+ "(?://)" \
|
||||
+ "(?P<bankref>[A-Za-z0-9 _]{1,16})?" \
|
||||
+ "(?:\n(?P<furtherinfo>[A-Za-z0-9 _.]))?"
|
||||
recparse["61"] = """\
|
||||
:(?P<recordid>61):\
|
||||
(?P<valuedate>\d{6})(?P<bookingdate>\d{4})?\
|
||||
(?P<creditmarker>R?[CD])\
|
||||
(?P<currency>[A-Z])?\
|
||||
(?P<amount>[\d,]{1,15})\
|
||||
(?P<bookingcode>[A-Z][A-Z0-9]{3})\
|
||||
(?P<custrefno>[%(ebcdic)s]{1,16})\
|
||||
(?://)\
|
||||
(?P<bankref>[%(ebcdic)s]{1,16})?\
|
||||
(?:\n(?P<furtherinfo>[%(ebcdic)s]))?\
|
||||
""" % (patterns)
|
||||
|
||||
# Further info
|
||||
recparse["86"] = ":(?P<recordid>86):" \
|
||||
|
||||
Reference in New Issue
Block a user