1
# -*- encoding: utf-8 -*-
2
##############################################################################
4
# OpenERP, Open Source Management Solution
5
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
8
# This program is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation, either version 3 of the License, or
11
# (at your option) any later version.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
##############################################################################
28
from report import report_sxw
31
class fiscal_statements(rml_parse.rml_parse):
32
def __init__(self, cr, uid, name, context):
34
self.date_lst_string = ''
35
super(fiscal_statements, self).__init__(cr, uid, name, context)
36
self.localcontext.update( {
38
'comma_me': self.comma_me,
39
'get_company': self._get_company,
40
'get_title': self._get_title,
41
'get_date_end': self._get_date_end,
42
'lines': self._get_lines,
43
'get_information': self._get_information,
46
def comma_me(self,amount):
47
if type(amount) is float :
48
amount = str('%.2f'%amount)
54
new = re.sub("^(-?\d+)(\d{3})", "\g<1>,\g<2>", amount)
58
return self.comma_me(new)
60
def set_context(self, objects, data, ids, report_type = None):
61
self.fis_obj = self.pool.get('fiscal.statements')
62
objects, new_ids = self.fis_obj._get_context(self.cr, self.uid, objects, data, ids, report_type = None)
63
super(fiscal_statements, self).set_context(objects, data, new_ids, report_type)
65
def _get_information(self, form):
66
return self.fis_obj._get_information(self.cr, self.uid, form)
68
def _get_company(self, form):
69
self.fis_obj = self.pool.get('fiscal.statements')
70
return self.fis_obj._get_company(self.cr, self.uid, form)
72
def _get_title(self, form):
73
return self.fis_obj._get_title(self.cr, self.uid, form)
75
def _get_date_end(self, form):
76
return self.fis_obj._get_date_end(self.cr, self.uid, form)
78
def _get_lines(self, obj, data):
79
return self.fis_obj._get_lines(self.cr, self.uid, obj, data)
81
report_sxw.report_sxw('report.fiscal_statements_balance', 'res.partner',
82
'addons/bias_fiscal_statements/report/fiscal_statements_balance.rml',parser=fiscal_statements,
84
report_sxw.report_sxw('report.fiscal_statements_income', 'res.partner',
85
'addons/bias_fiscal_statements/report/fiscal_statements_income.rml',parser=fiscal_statements,