diff --git a/account_financial_report/report/account_balance.py b/account_financial_report/report/account_balance.py index 89339504..1f4a14ca 100644 --- a/account_financial_report/report/account_balance.py +++ b/account_financial_report/report/account_balance.py @@ -53,7 +53,8 @@ class account_balance(report_sxw.rml_parse): 'lines': self.lines, 'get_fiscalyear_text': self.get_fiscalyear_text, 'get_periods_and_date_text': self.get_periods_and_date_text, - 'get_inf_text': self.get_informe_text, + 'get_inf_text': self.get_informe_text, + 'get_month':self._get_month, }) self.context = context @@ -70,6 +71,22 @@ class account_balance(report_sxw.rml_parse): else: fiscalyear = fiscalyear_obj.browse(self.cr, self.uid, fiscalyear_obj.find(self.cr, self.uid)) return "%s*" % (fiscalyear.name or fiscalyear.code) + + def _get_month(self, form): + ''' + return day, year and month + ''' + + months=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"] + + mes = months[time.strptime(form['date_to'],"%Y-%m-%d")[1]-1] + ano = time.strptime(form['date_to'],"%Y-%m-%d")[0] + dia = time.strptime(form['date_to'],"%Y-%m-%d")[2] + + if form['inf_type']=='edogp': + return 'DESDE: '+self.formatLang(form['date_from'], date=True)+' HASTA: '+self.formatLang(form['date_to'], date=True) + else: + return 'AL '+str(dia) + ' DE ' + mes.upper() + ' DE ' + str(ano) def get_informe_text(self, form): """ diff --git a/account_financial_report/report/account_balance_2_cols.py b/account_financial_report/report/account_balance_2_cols.py index 7ead2a03..5bea8465 100644 --- a/account_financial_report/report/account_balance_2_cols.py +++ b/account_financial_report/report/account_balance_2_cols.py @@ -53,7 +53,8 @@ class account_balance(report_sxw.rml_parse): 'lines': self.lines, 'get_fiscalyear_text': self.get_fiscalyear_text, 'get_periods_and_date_text': self.get_periods_and_date_text, - 'get_inf_text': self.get_informe_text, + 'get_inf_text': self.get_informe_text, + 'get_month':self._get_month, }) self.context = context @@ -77,11 +78,28 @@ class account_balance(report_sxw.rml_parse): """ inf_type = { 'bgen' : ' Balance General', - 'bcom' : ' Balance de Comprobacion', - 'edogp': 'Estado de Ganancias y Perdidas' + 'bcom' : ' Balance de Comprobacion', + 'edogp': 'Estado de Ganancias y Perdidas', + 'bdl': 'Libro Diario Legal', } return inf_type[form['inf_type']] + def _get_month(self, form): + ''' + return day, year and month + ''' + + months=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"] + + mes = months[time.strptime(form['date_to'],"%Y-%m-%d")[1]-1] + ano = time.strptime(form['date_to'],"%Y-%m-%d")[0] + dia = time.strptime(form['date_to'],"%Y-%m-%d")[2] + + if form['inf_type']=='edogp': + return 'DESDE: '+self.formatLang(form['date_from'], date=True)+' HASTA: '+self.formatLang(form['date_to'], date=True) + else: + return 'AL '+str(dia) + ' DE ' + mes.upper() + ' DE ' + str(ano) + def get_periods_and_date_text(self, form): """ Returns the text with the periods/dates used on the report. diff --git a/account_financial_report/report/account_balance_4_cols.py b/account_financial_report/report/account_balance_4_cols.py index 6112f58a..959a84d8 100644 --- a/account_financial_report/report/account_balance_4_cols.py +++ b/account_financial_report/report/account_balance_4_cols.py @@ -53,7 +53,8 @@ class account_balance(report_sxw.rml_parse): 'lines': self.lines, 'get_fiscalyear_text': self.get_fiscalyear_text, 'get_periods_and_date_text': self.get_periods_and_date_text, - 'get_inf_text': self.get_informe_text, + 'get_inf_text': self.get_informe_text, + 'get_month':self._get_month, }) self.context = context @@ -77,11 +78,28 @@ class account_balance(report_sxw.rml_parse): """ inf_type = { 'bgen' : ' Balance General', - 'bcom' : ' Balance de Comprobacion', - 'edogp': 'Estado de Ganancias y Perdidas' + 'bcom' : ' Balance de Comprobacion', + 'edogp': 'Estado de Ganancias y Perdidas', + 'bml': 'Libro Mayor Legal', } return inf_type[form['inf_type']] + def _get_month(self, form): + ''' + return day, year and month + ''' + + months=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"] + + mes = months[time.strptime(form['date_to'],"%Y-%m-%d")[1]-1] + ano = time.strptime(form['date_to'],"%Y-%m-%d")[0] + dia = time.strptime(form['date_to'],"%Y-%m-%d")[2] + + if form['inf_type']=='edogp': + return 'DESDE: '+self.formatLang(form['date_from'], date=True)+' HASTA: '+self.formatLang(form['date_to'], date=True) + else: + return 'AL '+str(dia) + ' DE ' + mes.upper() + ' DE ' + str(ano) + def get_periods_and_date_text(self, form): """ Returns the text with the periods/dates used on the report. diff --git a/account_financial_report/report/balance_full.rml b/account_financial_report/report/balance_full.rml index 00d82a09..67149646 100644 --- a/account_financial_report/report/balance_full.rml +++ b/account_financial_report/report/balance_full.rml @@ -2,23 +2,40 @@