← Back to team overview

banking-addons-team team mailing list archive

[Merge] lp:~hbrunn/banking-addons/lp-1106831-handle-P into lp:banking-addons

 

Holger Brunn (Therp) has proposed merging lp:~hbrunn/banking-addons/lp-1106831-handle-P into lp:banking-addons.

Requested reviews:
  Banking Addons Team (banking-addons-team)
Related bugs:
  Bug #1106831 in Banking Addons: "Old Dutch postbank numbers give "invalid literal for int() with base 10" when creating clieop file"
  https://bugs.launchpad.net/banking-addons/+bug/1106831

For more details, see:
https://code.launchpad.net/~hbrunn/banking-addons/lp-1106831-handle-P/+merge/145085
-- 
https://code.launchpad.net/~hbrunn/banking-addons/lp-1106831-handle-P/+merge/145085
Your team Banking Addons Team is requested to review the proposed merge of lp:~hbrunn/banking-addons/lp-1106831-handle-P into lp:banking-addons.
=== modified file 'account_banking_nl_clieop/wizard/clieop.py'
--- account_banking_nl_clieop/wizard/clieop.py	2013-01-14 15:21:11 +0000
+++ account_banking_nl_clieop/wizard/clieop.py	2013-01-27 11:25:23 +0000
@@ -319,7 +319,7 @@
     '''Payment transaction'''
     def __init__(self, *args, **kwargs):
         reknr = kwargs['accountno_beneficiary']
-        if len(reknr.lstrip('0')) > 7:
+        if len(reknr.lstrip('0P')) > 7:
             if not eleven_test(reknr):
                 raise ValueError, '%s is not a valid bank account' % reknr
         kwargs['type_'] = 5
@@ -388,8 +388,8 @@
     def total_accountnos(self):
         '''check number on account numbers'''
         return reduce(lambda x,y: 
-                          x + int(y.transaction.accountno_payer) + \
-                          int(y.transaction.accountno_beneficiary),
+                          x + int(y.transaction.accountno_payer.lstrip('P')) + \
+                          int(y.transaction.accountno_beneficiary.lstrip('P')),
                       self.transactions, 0
                      )
 


Follow ups