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
1=== modified file 'account_banking_nl_ing_mt940/account_banking_nl_ing_mt940.py'
2--- account_banking_nl_ing_mt940/account_banking_nl_ing_mt940.py 2014-02-28 13:34:48 +0000
3+++ account_banking_nl_ing_mt940/account_banking_nl_ing_mt940.py 2014-06-10 07:57:04 +0000
4@@ -36,7 +36,7 @@
5 code = 'INT_MT940_STRUC'
6
7 tag_61_regex = re.compile(
8- '^(?P<date>\d{6})(?P<sign>[CD])(?P<amount>\d+,\d{2})N(?P<type>\d{3})'
9+ '^(?P<date>\d{6})(?P<sign>[CD])(?P<amount>\d+,\d{2})N(?P<type>.{3})'
10 '(?P<reference>\w{1,16})')
11
12 def create_transaction(self, cr):
13@@ -62,7 +62,8 @@
14 return
15 super(IngMT940Parser, self).handle_tag_86(cr, data)
16 codewords = ['RTRN', 'BENM', 'ORDP', 'CSID', 'BUSP', 'MARF', 'EREF',
17- 'PREF', 'REMI', 'ID', 'PURP', 'ULTB', 'ULTD']
18+ 'PREF', 'REMI', 'ID', 'PURP', 'ULTB', 'ULTD',
19+ 'CREF', 'IREF', 'CNTP', 'ULTC', 'EXCH', 'CHGS']
20 subfields = {}
21 current_codeword = None
22 for word in data.split('/'):
23@@ -72,7 +73,14 @@
24 current_codeword = word
25 subfields[current_codeword] = []
26 continue
27- subfields[current_codeword].append(word)
28+ if current_codeword in subfields:
29+ subfields[current_codeword].append(word)
30+
31+ if 'CNTP' in subfields:
32+ self.current_transaction.remote_account = subfields['CNTP'][0]
33+ self.current_transaction.remote_bank_bic = subfields['CNTP'][1]
34+ self.current_transaction.remote_owner = subfields['CNTP'][2]
35+ self.current_transaction.remote_owner_city = subfields['CNTP'][3]
36
37 if 'BENM' in subfields:
38 self.current_transaction.remote_account = subfields['BENM'][0]

Subscribers

People subscribed via source and target branches