banking-addons-team team mailing list archive
-
banking-addons-team team
-
Mailing list archive
-
Message #00149
lp:~therp-nl/banking-addons/6.1-abnamro_process_sepa_feedback_string into lp:banking-addons
Stefan Rijnhart (Therp) has proposed merging lp:~therp-nl/banking-addons/6.1-abnamro_process_sepa_feedback_string into lp:banking-addons.
Requested reviews:
Banking Addons Team (banking-addons-team)
For more details, see:
https://code.launchpad.net/~therp-nl/banking-addons/6.1-abnamro_process_sepa_feedback_string/+merge/128696
--
https://code.launchpad.net/~therp-nl/banking-addons/6.1-abnamro_process_sepa_feedback_string/+merge/128696
Your team Banking Addons Team is requested to review the proposed merge of lp:~therp-nl/banking-addons/6.1-abnamro_process_sepa_feedback_string into lp:banking-addons.
=== modified file 'account_banking/banking_import_transaction.py'
--- account_banking/banking_import_transaction.py 2012-05-07 11:38:26 +0000
+++ account_banking/banking_import_transaction.py 2012-10-09 12:55:26 +0000
@@ -1319,7 +1319,8 @@
transaction.remote_owner,
transaction.remote_owner_address,
transaction.remote_owner_city,
- country_code, results['log']
+ country_code, results['log'],
+ bic=transaction.remote_bank_bic
)
partner_banks = partner_bank_obj.browse(
cr, uid, [partner_bank_id]
=== modified file 'account_banking/wizard/banktools.py'
--- account_banking/wizard/banktools.py 2012-06-26 11:17:32 +0000
+++ account_banking/wizard/banktools.py 2012-10-09 12:55:26 +0000
@@ -318,7 +318,7 @@
def create_bank_account(pool, cursor, uid, partner_id,
account_number, holder_name, address, city,
- country_code, log
+ country_code, log, bic=False,
):
'''
Create a matching bank account with this holder for this partner.
@@ -328,7 +328,6 @@
owner_name = holder_name,
)
bankcode = None
- bic = None
country_obj = pool.get('res.country')
# Are we dealing with IBAN?
=== modified file 'account_banking_nl_abnamro/abnamro.py'
--- account_banking_nl_abnamro/abnamro.py 2012-01-17 08:48:10 +0000
+++ account_banking_nl_abnamro/abnamro.py 2012-10-09 12:55:26 +0000
@@ -88,6 +88,7 @@
'GIRO': bt.ORDER,
'INTL': bt.ORDER, # international order
'UNKN': bt.ORDER, # everything else
+ 'SEPA': bt.ORDER,
}
def __init__(self, line, *args, **kwargs):
@@ -134,18 +135,34 @@
size = 33
res = []
while(len(line) > col * size):
- if line[col * size : (col + 1) * size - 1].strip():
- res.append(line[col * size : (col + 1) * size - 1])
+ separation = (col + 1) * size - 1
+ if line[col * size : separation].strip():
+ part = line[col * size : separation]
+ # If the separation character is not a space, add it anyway
+ # presumably for sepa feedback strings only
+ if (len(line) > separation
+ and line[separation] != ' '):
+ part += line[separation]
+ res.append(part)
col += 1
return res
+ def get_sepa_dict(field):
+ items = field[1:].split('/') # skip leading slash
+ sepa_dict = {}
+ while items:
+ sepa_dict[items.pop(0)] = items.pop(1).strip()
+ return sepa_dict
+
def parse_type(field):
# here we process the first field, which identifies the statement type
# and in case of certain types contains additional information
transfer_type = 'UNKN'
remote_account = False
remote_owner = False
- if field.startswith('GIRO '):
+ if field.startswith('/TRTP/'):
+ transfer_type = 'SEPA'
+ elif field.startswith('GIRO '):
transfer_type = 'GIRO'
# columns 6 to 14 contain the left or right aligned account number
remote_account = field[:15].strip().zfill(10)
@@ -176,8 +193,18 @@
fields = split_blob(self.blob)
(self.transfer_type, self.remote_account, self.remote_owner) = parse_type(fields[0])
+ if self.transfer_type == 'SEPA':
+ sepa_dict = get_sepa_dict(''.join(fields))
+ sepa_type = sepa_dict.get('TRTP')
+ if sepa_type != 'SEPA OVERBOEKING':
+ raise ValueError,_('Sepa transaction type %s not handled yet')
+ self.remote_account = sepa_dict.get('IBAN',False)
+ self.remote_bank_bic = sepa_dict.get('BIC', False)
+ self.remote_owner = sepa_dict.get('NAME', False)
+ self.reference = sepa_dict.get('REMI', False)
+
# extract other information depending on type
- if self.transfer_type == 'GIRO':
+ elif self.transfer_type == 'GIRO':
self.message = ' '.join(field.strip() for field in fields[1:])
elif self.transfer_type == 'BEA':
Follow ups