~compassion/banking-addons/banking-addons-mandate

« back to all changes in this revision

Viewing changes to account_banking_nl_ing_mt940/account_banking_nl_ing_mt940.py

  • Committer: Stefan Rijnhart
  • Author(s): hbrunn at therp
  • Date: 2014-05-23 11:56:57 UTC
  • mfrom: (253.1.2 7.0-lp1317021)
  • Revision ID: stefan@therp.nl-20140523115657-1m7kchj773t9sxwg
[FIX] type field can be arbitrary characters
[FIX] don't choke on unstructured tag 86 (nothing usefule happend then
though)

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    code = 'INT_MT940_STRUC'
37
37
 
38
38
    tag_61_regex = re.compile(
39
 
        '^(?P<date>\d{6})(?P<sign>[CD])(?P<amount>\d+,\d{2})N(?P<type>\d{3})'
 
39
        '^(?P<date>\d{6})(?P<sign>[CD])(?P<amount>\d+,\d{2})N(?P<type>.{3})'
40
40
        '(?P<reference>\w{1,16})')
41
41
 
42
42
    def create_transaction(self, cr):
72
72
                current_codeword = word
73
73
                subfields[current_codeword] = []
74
74
                continue
75
 
            subfields[current_codeword].append(word)
 
75
            if current_codeword in subfields:
 
76
                subfields[current_codeword].append(word)
76
77
 
77
78
        if 'BENM' in subfields:
78
79
            self.current_transaction.remote_account = subfields['BENM'][0]