← 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/191538

[FIX] Fix (one more time) columns for debit and credit. Extract the amounts for each columns
-- 
https://code.launchpad.net/~dr.clearcorp/openerp-costa-rica/6.1-fix_parser_bcr/+merge/191538
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-16 21:39:55 +0000
+++ l10n_cr_account_banking_cr_bcr/bcr_parser.py	2013-10-17 00:05:49 +0000
@@ -230,13 +230,14 @@
             mapping['name'] = sub[27:80]
             mapping['id'] = sub[27:80]
             
+            ############### AMOUNTS 
+          
+            #substring amount MUST HAVE AT LEAST one character diferent to whitespace and amount must have one character
+                      
             #First version of file: Amounts are in center
-            amount = ''
-            credit = ''
-            debit = ''
-                        
-            amount = sub[120:]            
-            if amount != '':
+            amount = sub[120:]  
+
+            if not amount.isspace() and len(amount) > 0: #"Return true if there are only whitespace characters in the string and there is at least one character, false otherwise."
                 amount.replace('\t',' ')
                 debit = amount[0:40]
                 credit = amount[40:]


Follow ups