← Back to team overview

clearcorp team mailing list archive

[Merge] lp:~dr.clearcorp/openerp-costa-rica/6.1-fix_parser_bcr into lp:openerp-costa-rica/6.1

 

Diana Rodríguez Martínez has proposed merging lp:~dr.clearcorp/openerp-costa-rica/6.1-fix_parser_bcr into lp:openerp-costa-rica/6.1.

Requested reviews:
  CLEARCORP drivers (clearcorp-drivers)

For more details, see:
https://code.launchpad.net/~dr.clearcorp/openerp-costa-rica/6.1-fix_parser_bcr/+merge/191485

[FIX] Fix size for debit and credit column. Resize the space (again)
-- 
https://code.launchpad.net/~dr.clearcorp/openerp-costa-rica/6.1-fix_parser_bcr/+merge/191485
Your team CLEARCORP development team is subscribed to branch lp:openerp-costa-rica/6.1.
=== modified file 'l10n_cr_account_banking_cr_bcr/bcr_parser.py'
--- l10n_cr_account_banking_cr_bcr/bcr_parser.py	2013-10-14 00:48:07 +0000
+++ l10n_cr_account_banking_cr_bcr/bcr_parser.py	2013-10-16 19:27:42 +0000
@@ -230,11 +230,20 @@
             mapping['name'] = sub[27:80]
             mapping['id'] = sub[27:80]
             
-            amount = sub[120:]
-            amount.replace('\t',' ')
-            debit = amount[0:40]
-            credit = amount[40:]
+            #First version of file: Amounts are in center
+            amount = sub[120:]            
+            if amount != '':
+                amount.replace('\t',' ')
+                debit = amount[0:40]
+                credit = amount[40:]
             
+            #Second version of file: Amounts are in left
+            else:
+                amount = sub[106:]
+                amount.replace('\t',' ')
+                debit = amount[0:16]
+                credit = amount[16:]
+                
             if (parser.extract_float(debit) is not ''): #debit
                 cad = parser.extract_float(debit)
                 mapping['transferred_amount'] = -float(cad)      


Follow ups