Merge lp:~therp-nl/banking-addons/6.1-ing_mt940_update into lp:banking-addons/6.1

Proposed by Holger Brunn (Therp)
Status: Merged
Merged at revision: 196
Proposed branch: lp:~therp-nl/banking-addons/6.1-ing_mt940_update
Merge into: lp:banking-addons/6.1
Diff against target: 38 lines (+11/-3)
1 file modified
account_banking_nl_ing_mt940/account_banking_nl_ing_mt940.py (+11/-3)
To merge this branch: bzr merge lp:~therp-nl/banking-addons/6.1-ing_mt940_update
Reviewer Review Type Date Requested Status
Pedro Manuel Baeza code review Approve
Stefan Rijnhart (Opener) Approve
Review via email: mp+222597@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :
review: Approve
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Also approved as stated on 7.0 MP.

Regards.

review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account_banking_nl_ing_mt940/account_banking_nl_ing_mt940.py'
--- account_banking_nl_ing_mt940/account_banking_nl_ing_mt940.py 2014-02-28 13:34:48 +0000
+++ account_banking_nl_ing_mt940/account_banking_nl_ing_mt940.py 2014-06-10 07:57:04 +0000
@@ -36,7 +36,7 @@
36 code = 'INT_MT940_STRUC'36 code = 'INT_MT940_STRUC'
3737
38 tag_61_regex = re.compile(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 '(?P<reference>\w{1,16})')40 '(?P<reference>\w{1,16})')
4141
42 def create_transaction(self, cr):42 def create_transaction(self, cr):
@@ -62,7 +62,8 @@
62 return62 return
63 super(IngMT940Parser, self).handle_tag_86(cr, data)63 super(IngMT940Parser, self).handle_tag_86(cr, data)
64 codewords = ['RTRN', 'BENM', 'ORDP', 'CSID', 'BUSP', 'MARF', 'EREF',64 codewords = ['RTRN', 'BENM', 'ORDP', 'CSID', 'BUSP', 'MARF', 'EREF',
65 'PREF', 'REMI', 'ID', 'PURP', 'ULTB', 'ULTD']65 'PREF', 'REMI', 'ID', 'PURP', 'ULTB', 'ULTD',
66 'CREF', 'IREF', 'CNTP', 'ULTC', 'EXCH', 'CHGS']
66 subfields = {}67 subfields = {}
67 current_codeword = None68 current_codeword = None
68 for word in data.split('/'):69 for word in data.split('/'):
@@ -72,7 +73,14 @@
72 current_codeword = word73 current_codeword = word
73 subfields[current_codeword] = []74 subfields[current_codeword] = []
74 continue75 continue
75 subfields[current_codeword].append(word)76 if current_codeword in subfields:
77 subfields[current_codeword].append(word)
78
79 if 'CNTP' in subfields:
80 self.current_transaction.remote_account = subfields['CNTP'][0]
81 self.current_transaction.remote_bank_bic = subfields['CNTP'][1]
82 self.current_transaction.remote_owner = subfields['CNTP'][2]
83 self.current_transaction.remote_owner_city = subfields['CNTP'][3]
7684
77 if 'BENM' in subfields:85 if 'BENM' in subfields:
78 self.current_transaction.remote_account = subfields['BENM'][0]86 self.current_transaction.remote_account = subfields['BENM'][0]

Subscribers

People subscribed via source and target branches