Merge lp:~gs.clearcorp/openerp-costa-rica/7.0_l10n_cr_account_banking_cr_bcr into lp:openerp-costa-rica

Proposed by Glen Sojo on 2014-06-26
Status: Merged
Merged at revision: 289
Proposed branch: lp:~gs.clearcorp/openerp-costa-rica/7.0_l10n_cr_account_banking_cr_bcr
Merge into: lp:openerp-costa-rica
Diff against target: 46 lines (+9/-9)
1 file modified
l10n_cr_account_banking_cr_bcr/bcr_parser.py (+9/-9)
To merge this branch: bzr merge lp:~gs.clearcorp/openerp-costa-rica/7.0_l10n_cr_account_banking_cr_bcr
Reviewer Review Type Date Requested Status
ClearCorp drivers 2014-06-26 Pending
Review via email: mp+224734@code.launchpad.net

Description of the change

[FIX] - l10n_cr_account_banking_cr_bcr: Modified parser to use the date from movements not the export date.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_cr_account_banking_cr_bcr/bcr_parser.py'
2--- l10n_cr_account_banking_cr_bcr/bcr_parser.py 2014-04-14 15:36:53 +0000
3+++ l10n_cr_account_banking_cr_bcr/bcr_parser.py 2014-06-26 22:44:14 +0000
4@@ -90,24 +90,24 @@
5 date_2 = self.extract_date_regular_expresion_line_format_2(l,1)
6
7 #date and hour -> FIRST REVISION
8- if (l.find('Solicitado el', 0, len('Solicitado el')) > -1):
9+ if (l.find('Movimiento realizado', 0, len('Movimiento realizado')) > -1):
10 date = hour = cad = ''
11 date = self.extract_date_regular_expresion(l)
12 if len(date) > 0:
13- hour = self.extract_hour_regular_expresion(l)
14- cad = date + ' ' + hour
15+ hour = '00:00:00'
16+ cad = date + ' ' + hour
17 line_dict['transref'] = cad
18 line_dict['bookingdate'] = cad
19
20 #date and hour -> SECOND REVISION
21- elif (l.find('SOLICITADO EL', 0, len('SOLICITADO EL')) > -1):
22+ elif (l.find('MOVIMIENTO REALIZADO', 0, len('MOVIMIENTO REALIZADO')) > -1):
23 date = hour = cad = ''
24 date = self.extract_date_regular_expresion(l)
25 if len(date) > 0:
26- hour = self.extract_hour_regular_expresion(l)
27- cad = date + ' ' + hour
28+ hour = "00:00:00"
29+ cad = date + ' ' + hour
30 line_dict['transref'] = cad
31- line_dict['bookingdate'] = cad
32+ line_dict['bookingdate'] = cad
33
34 #_opening_balance -> FIRST REVISION
35 if l.find('Saldo Inicial', 0, len('Saldo Inicial')) > -1:
36@@ -439,8 +439,8 @@
37 #FORMAT DATE SECOND REVISION
38 result = re.findall('[0-9]{1,2}-[0-9]{1,2}-[0-9]{4}',date)
39
40- for character in result:
41- cad = cad + character
42+ if result:
43+ cad = result[0]
44 return cad
45
46 #with the pos parameter is said which of the two dates must be brought

Subscribers

People subscribed via source and target branches

to all changes: