diff --git a/addons/l10n_be/__openerp__.py b/addons/l10n_be/__openerp__.py index 8e607ba3120..c828190aaf4 100644 --- a/addons/l10n_be/__openerp__.py +++ b/addons/l10n_be/__openerp__.py @@ -18,7 +18,8 @@ # along with this program. If not, see . # ############################################################################## -{ + +{ 'name': 'Belgium - Accounting', 'version': '1.1', 'category': 'Localization/Account Charts', @@ -72,12 +73,16 @@ Wizards provided by this module: 'wizard/l10n_be_partner_vat_listing.xml', 'wizard/account_wizard.xml', 'l10n_be_sequence.xml', + 'l10n_be_reports.xml', 'fiscal_templates.xml', 'account_fiscal_position_tax_template.xml', 'security/ir.model.access.csv', + 'views/report_vatintraprint.xml', + 'views/report_vatpartnerlisting.xml', ], 'demo': [], 'installable': True, 'images': ['images/1_config_chart_l10n_be.jpeg','images/2_l10n_be_chart.jpeg'], } + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_be/l10n_be_reports.xml b/addons/l10n_be/l10n_be_reports.xml new file mode 100644 index 00000000000..6077b67e262 --- /dev/null +++ b/addons/l10n_be/l10n_be_reports.xml @@ -0,0 +1,23 @@ + + + + + + + diff --git a/addons/l10n_be/views/report_vatintraprint.xml b/addons/l10n_be/views/report_vatintraprint.xml new file mode 100644 index 00000000000..94568e3f106 --- /dev/null +++ b/addons/l10n_be/views/report_vatintraprint.xml @@ -0,0 +1,51 @@ + + + + + + diff --git a/addons/l10n_be/views/report_vatpartnerlisting.xml b/addons/l10n_be/views/report_vatpartnerlisting.xml new file mode 100644 index 00000000000..b087ffc5802 --- /dev/null +++ b/addons/l10n_be/views/report_vatpartnerlisting.xml @@ -0,0 +1,44 @@ + + + + + + diff --git a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py index 0ffa0c16a24..3bdee77956e 100644 --- a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py +++ b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py @@ -205,7 +205,6 @@ class partner_vat_list(osv.osv_memory): country = ads.country_id.code data = self.read(cr, uid, ids)[0] - sender_date = time.strftime('%Y-%m-%d') comp_name = obj_cmpny.name if not email: @@ -305,19 +304,16 @@ class partner_vat_list(osv.osv_memory): def print_vatlist(self, cr, uid, ids, context=None): if context is None: context = {} - obj_vat_lclient = self.pool.get('vat.listing.clients') datas = {'ids': []} datas['model'] = 'res.company' datas['year'] = context['year'] datas['limit_amount'] = context['limit_amount'] datas['client_datas'] = self._get_datas(cr, uid, ids, context=context) if not datas['client_datas']: - raise osv.except_osv(_('Error!'),_('No record to print.')) - return { - 'type': 'ir.actions.report.xml', - 'report_name': 'partner.vat.listing.print', - 'datas': datas, - } + raise osv.except_osv(_('Error!'), _('No record to print.')) + return self.pool['report'].get_action( + cr, uid, [], 'l10n_be.report_l10nvatpartnerlisting', data=datas, context=context + ) class partner_vat_listing_print(report_sxw.rml_parse): @@ -338,6 +334,11 @@ class partner_vat_listing_print(report_sxw.rml_parse): }) super(partner_vat_listing_print, self).set_context(objects, data, ids) -report_sxw.report_sxw('report.partner.vat.listing.print', 'res.partner', 'addons/l10n_be/wizard/l10n_be_partner_vat_listing.rml', parser=partner_vat_listing_print,header=False) + +class wrapped_vat_listing_print(osv.AbstractModel): + _name = 'report.l10n_be.report_l10nvatpartnerlisting' + _inherit = 'report.abstract_report' + _template = 'l10n_be.report_l10nvatpartnerlisting' + _wrapped_report_class = partner_vat_listing_print # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.rml b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.rml deleted file mode 100644 index 81b0635fa37..00000000000 --- a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.rml +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [[ company.name ]] - - - [[ year ]] - - - Annual Listing of VAT-Subjected Customers - - - - - - - - - - Nr - - - Partner - - - VAT Number - - - Base Amount - - - VAT Amount - - - - - - - - - - - - - - - - [[ sum_turnover ]] - - - - - [[ sum_tax ]] - - - - - - - -
- [[ repeatIn(client_list, 'l') ]] - - - - [[ l['seq'] ]] - - - [[ l['partner_name'] ]] - - - [[ l['vat'] ]] - - - [[ l['turnover'] ]] - - - [[ l['vat_amount'] ]] - - - - - - -
- - - - - - -
-
- diff --git a/addons/l10n_be/wizard/l10n_be_vat_intra.py b/addons/l10n_be/wizard/l10n_be_vat_intra.py index 1a2d9201790..e698973fef4 100644 --- a/addons/l10n_be/wizard/l10n_be_vat_intra.py +++ b/addons/l10n_be/wizard/l10n_be_vat_intra.py @@ -29,6 +29,7 @@ from openerp.osv import fields, osv from openerp.tools.translate import _ from openerp.report import report_sxw + class partner_vat_intra(osv.osv_memory): """ Partner Vat Intra @@ -276,11 +277,9 @@ class partner_vat_intra(osv.osv_memory): 'model': 'partner.vat.intra', 'form': xml_data } - return { - 'type': 'ir.actions.report.xml', - 'report_name': 'partner.vat.intra.print', - 'datas': datas, - } + return self.pool['report'].get_action( + cr, uid, [], 'l10n_be.report_l10nvatintraprint', data=datas, context=context + ) class vat_intra_print(report_sxw.rml_parse): @@ -290,6 +289,11 @@ class vat_intra_print(report_sxw.rml_parse): 'time': time, }) -report_sxw.report_sxw('report.partner.vat.intra.print', 'partner.vat.intra', 'addons/l10n_be/wizard/l10n_be_vat_intra_print.rml', parser=vat_intra_print, header="internal") + +class wrapped_vat_intra_print(osv.AbstractModel): + _name = 'report.l10n_be.report_l10nvatintraprint' + _inherit = 'report.abstract_report' + _template = 'l10n_be.report_l10nvatintraprint' + _wrapped_report_class = vat_intra_print # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_be/wizard/l10n_be_vat_intra_print.rml b/addons/l10n_be/wizard/l10n_be_vat_intra_print.rml deleted file mode 100644 index a25f01ff348..00000000000 --- a/addons/l10n_be/wizard/l10n_be_vat_intra_print.rml +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Partner VAT Intra - - - - - - - - - - Company Name - - - VAT Number - - - Partners without VAT - - - - - [[ data['form']['company_name'] ]] - - - [[ data['form']['company_vat'] ]] - - - [[ data['form']['partner_wo_vat'] or '-']] - - - - - - - - - - Partner Name - - - Partner VAT - - - Code (Tax Code) - - - Amount - - - -
- [[ repeatIn(data['form']['clientlist'],'l') ]] - - - - [[ l['partner_name'] ]] - - - [[ l['vat'] ]] - - - [[ l['code'] ]]([[ l['intra_code'] ]]) - - - [[ formatLang(l['amount'], currency_obj=company.currency_id) ]] - - - -
- - - - - - - - - - - - - - Total: - - - [[ formatLang(data['form']['amountsum'], currency_obj=company.currency_id) ]] - - - - - - -
-
- diff --git a/addons/l10n_fr/__openerp__.py b/addons/l10n_fr/__openerp__.py index 9a563eeb197..5bc3a82bbc3 100644 --- a/addons/l10n_fr/__openerp__.py +++ b/addons/l10n_fr/__openerp__.py @@ -55,6 +55,9 @@ configuration of their taxes and fiscal positions manually. """, 'depends': ['base_iban', 'account', 'account_chart', 'base_vat', 'l10n_fr_rib'], 'data': [ + 'views/report_l10nfrbilan.xml', + 'views/report_l10nfrresultat.xml', + 'l10n_fr_reports.xml', 'fr_report.xml', 'plan_comptable_general.xml', 'l10n_fr_view.xml', @@ -72,5 +75,5 @@ configuration of their taxes and fiscal positions manually. 'installable': True, 'images': ['images/config_chart_l10n_fr.jpeg','images/l10n_fr_chart.jpeg'], } -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_fr/l10n_fr_reports.xml b/addons/l10n_fr/l10n_fr_reports.xml new file mode 100644 index 00000000000..ab97cf84c30 --- /dev/null +++ b/addons/l10n_fr/l10n_fr_reports.xml @@ -0,0 +1,23 @@ + + + + + + + diff --git a/addons/l10n_fr/report/base_report.py b/addons/l10n_fr/report/base_report.py index bc2cd308bf8..14fcce0d88f 100644 --- a/addons/l10n_fr/report/base_report.py +++ b/addons/l10n_fr/report/base_report.py @@ -27,9 +27,9 @@ ############################################################################## import time - from openerp.report import report_sxw + class base_report(report_sxw.rml_parse): def __init__(self, cr, uid, name, context=None): super(base_report, self).__init__(cr, uid, name, context=context) diff --git a/addons/l10n_fr/report/bilan_report.py b/addons/l10n_fr/report/bilan_report.py index 2ffbd24cc4f..51a2dd64a10 100644 --- a/addons/l10n_fr/report/bilan_report.py +++ b/addons/l10n_fr/report/bilan_report.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -############################################################################## +# # # Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr # @@ -24,16 +24,118 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # -############################################################################## +# import base_report -from openerp.report import report_sxw +from openerp.osv import osv + class bilan(base_report.base_report): + def __init__(self, cr, uid, name, context): super(bilan, self).__init__(cr, uid, name, context) -report_sxw.report_sxw('report.l10n.fr.bilan', 'account.move.line','addons/l10n_fr/report/bilan_report.rml', parser=bilan, header=False) + def set_context(self, objects, data, ids): + super(bilan, self).set_context(objects, data, ids) + + self._load('bilan', self.localcontext['data']['form']) + self._set_variable( + 'at1a', + self.localcontext['bavar1'] + self.localcontext['bavar2'] + self.localcontext['bavar3'] + + self.localcontext['bavar4'] + self.localcontext[ + 'bavar5'] + self.localcontext['bavar6'] + + self.localcontext['bavar7'] + self.localcontext[ + 'bavar8'] + self.localcontext['bavar9'] + + self.localcontext['bavar10'] + self.localcontext[ + 'bavar11'] + self.localcontext['bavar12'] + + self.localcontext['bavar13'] + self.localcontext[ + 'bavar14'] + self.localcontext['bavar15'] + + self.localcontext['bavar16'] + self.localcontext[ + 'bavar17'] + self.localcontext['bavar18'] + + self.localcontext['bavar19'] + self.localcontext['bavar20'] + ) + self._set_variable( + 'at1b', + self.localcontext['bavar2b'] + self.localcontext[ + 'bavar3b'] + self.localcontext['bavar4b'] + + self.localcontext['bavar5b'] + self.localcontext[ + 'bavar6b'] + self.localcontext['bavar7b'] + + self.localcontext['bavar9b'] + self.localcontext[ + 'bavar10b'] + self.localcontext['bavar11b'] + + self.localcontext['bavar12b'] + self.localcontext[ + 'bavar13b'] + self.localcontext['bavar15b'] + + self.localcontext['bavar16b'] + self.localcontext[ + 'bavar17b'] + self.localcontext['bavar18b'] + + self.localcontext['bavar19b'] + self.localcontext['bavar20b'] + ) + self._set_variable( + 'at1', + self.localcontext['at1a'] + self.localcontext['at1b'] + ) + self._set_variable( + 'at2a', + self.localcontext['bavar21'] + self.localcontext[ + 'bavar22'] + self.localcontext['bavar23'] + + self.localcontext['bavar24'] + self.localcontext[ + 'bavar25'] + self.localcontext['bavar26'] + + self.localcontext['bavar27'] + self.localcontext[ + 'bavar28'] + self.localcontext['bavar29'] + + self.localcontext['bavar30'] + self.localcontext[ + 'bavar31'] + self.localcontext['bavar32'] + + self.localcontext['bavar33'] + ) + self._set_variable( + 'at2b', + self.localcontext['bavar21b'] + self.localcontext[ + 'bavar22b'] + self.localcontext['bavar23b'] + + self.localcontext['bavar24b'] + self.localcontext[ + 'bavar26b'] + self.localcontext['bavar27b'] + + self.localcontext['bavar29b'] + self.localcontext['bavar30b'] + ) + self._set_variable( + 'at2', + self.localcontext['at2a'] + self.localcontext['at2b'] + ) + self._set_variable( + 'actif', + self.localcontext['at1'] + self.localcontext['at2'] + self.localcontext['bavar34'] + + self.localcontext['bavar35'] + self.localcontext['bavar36'] + ) + self._set_variable( + 'pt1', + self.localcontext['bpvar1'] + self.localcontext['bpvar2'] + self.localcontext['bpvar3'] + + self.localcontext['bpvar4'] + self.localcontext[ + 'bpvar5'] + self.localcontext['bpvar6'] + + self.localcontext['bpvar7'] + self.localcontext[ + 'bpvar8'] + self.localcontext['bpvar9'] + + self.localcontext['bpvar10'] + self.localcontext[ + 'bpvar11'] + self.localcontext['bpvar12'] + ) + self._set_variable( + 'pt2', + self.localcontext['bpvar13'] + self.localcontext['bpvar14'] + ) + self._set_variable( + 'pt3', + self.localcontext['bpvar15'] + self.localcontext[ + 'bpvar16'] + self.localcontext['bpvar17'] + + self.localcontext['bpvar18'] + self.localcontext[ + 'bpvar19'] + self.localcontext['bpvar20'] + + self.localcontext['bpvar21'] + self.localcontext[ + 'bpvar22'] + self.localcontext['bpvar23'] + + self.localcontext['bpvar24'] + self.localcontext['bpvar25'] + ) + self._set_variable( + 'passif', + self.localcontext['pt1'] + self.localcontext['pt2'] + self.localcontext['pt3'] + + self.localcontext['bpvar26'] + ) + + +class wrapped_report_bilan(osv.AbstractModel): + _name = 'report.l10n_fr.report_l10nfrbilan' + _inherit = 'report.abstract_report' + _template = 'l10n_fr.report_l10nfrbilan' + _wrapped_report_class = bilan # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/l10n_fr/report/bilan_report.rml b/addons/l10n_fr/report/bilan_report.rml deleted file mode 100644 index f448d63a81a..00000000000 --- a/addons/l10n_fr/report/bilan_report.rml +++ /dev/null @@ -1,548 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [[ _load('bilan',data['form'])]] - [[ _set_variable('at1a',bavar1+bavar2+bavar3+bavar4+bavar5+bavar6+bavar7+bavar8+bavar9+bavar10+bavar11+bavar12+bavar13+bavar14+bavar15+bavar16+bavar17+bavar18+bavar19+bavar20)]] - [[ _set_variable('at1b', bavar2b+bavar3b+bavar4b+bavar5b+bavar6b+bavar7b+bavar9b+bavar10b+bavar11b+bavar12b+bavar13b+bavar15b+ bavar16b+bavar17b+bavar18b+bavar19b+bavar20b)]] - [[ _set_variable('at1', at1a+at1b)]] - [[ _set_variable('at2a', bavar21+bavar22+bavar23+bavar24+bavar25+bavar26+bavar27+bavar28+bavar29+bavar30+bavar31+bavar32+bavar33)]] - [[ _set_variable('at2b', bavar21b+bavar22b+bavar23b+bavar24b+bavar26b+bavar27b+bavar29b+bavar30b)]] - [[ _set_variable('at2', at2a+at2b)]] - [[ _set_variable('actif', at1+at2+bavar34+bavar35+bavar36)]] - [[ _set_variable('pt1', bpvar1+bpvar2+bpvar3+bpvar4+bpvar5+bpvar6+bpvar7+bpvar8+bpvar9+bpvar10+bpvar11+bpvar12)]] - [[ _set_variable('pt2', bpvar13+bpvar14)]] - [[ _set_variable('pt3', bpvar15+bpvar16+bpvar17+bpvar18+bpvar19+bpvar20+bpvar21+bpvar22+bpvar23+bpvar24+bpvar25)]] - [[ _set_variable('passif', pt1+pt2+pt3+bpvar26)]] - - - [[ company.name ]]au [[ time.strftime('%d-%m-%Y',time.strptime(date_stop,'%Y-%m-%d'))]] - Bilan - Imprimé le : [[ time.strftime('%d-%m-%Y') ]] - - - - - Tenue de Compte : [[ company.currency_id.name ]] - - - ACTIF - - - - Brut - Amortissements et dépréciations - Net - - - Capital souscrit - non appelé - [[bavar1]] - - [[bavar1]] - - - ACTIF IMMOBILISÉ - - - - - - IMMOBILISATIONS INCORPORELLES - - - - - - Frais d'établissement - [[bavar2]] - [[-bavar2b]] - [[bavar2+bavar2b]] - - - Frais de recherche et de développement - [[bavar3]][[-bavar3b]] - [[bavar3+bavar3b]] - - - Concessions, brevets, licences,..., droits et valeurs similaires - [[bavar4]] - [[-bavar4b]] - [[bavar4+bavar4b]] - - - Fonds commercial - [[bavar5]] - [[-bavar5b]] - [[bavar5+bavar5b]] - - - Autres - [[bavar6]] - [[-bavar6b]] - [[bavar6+bavar6b]] - - - Immobilisations incorporelles en cours - [[bavar7]] - [[-bavar7b]] - [[bavar7+bavar7b]] - - - Avances et acomptes - [[bavar8]] - - [[bavar8]] - - - IMMOBILISATIONS CORPORELLES - - - - - - Terrains - [[bavar9]] - [[-bavar9b]] - [[bavar9+bavar9b]] - - - Constructions - [[bavar10]] - [[-bavar10b]] - [[bavar10+bavar10b]] - - - Installations techniques,matériel et outillage - [[bavar11]] - [[-bavar11b]] - [[bavar11+bavar11b]] - - - Autres - [[bavar12]] - [[-bavar12b]] - [[bavar12+bavar12b]] - - - Immobilisations corporelles en cours - [[bavar13]] - [[-bavar13b]] - [[bavar13+bavar13b]] - - - Avances et acomptes - [[bavar14]] - - [[bavar14]] - - - IMMOBILISATIONS FINANCIÉRES - - - - - - Participations - [[bavar15]] - [[-bavar15b]] - [[bavar15+bavar15b]] - - - Créances rattachées à des participations - [[bavar16]] - [[-bavar16b]] - [[bavar16+bavar16b]] - - - Titres immobilisés de l'activité de portefeuille - [[bavar17]] - [[-bavar17b]] - [[bavar17+bavar17b]] - - - Autres titres immobilisés - [[bavar18]] - [[-bavar18b]] - [[bavar18+bavar18b]] - - - Prêts - [[bavar19]] - [[-bavar19b]] - [[bavar19+bavar19b]] - - - Autres - [[bavar20]] - [[-bavar20b]] - [[bavar20+bavar20b]] - - - TOTAL I - [[at1a]] - [[-at1b]] - [[at1]] - - - ACTIF CIRCULANT - - - - - - STOCK EN COURS - - - - - - Matières premières et autres approvisionnements - [[bavar21]] - [[-bavar21b]] - [[bavar21+bavar21b]] - - - En-cours de production [biens et services] - [[bavar22]] - [[-bavar22b]] - [[bavar22+bavar22b]] - - - Produits intermédiaires et finis - [[bavar23]] - [[-bavar23b]] - [[bavar23+bavar23b]] - - - Marchandises - [[bavar24]] - [[-bavar24b]] - [[bavar24+bavar24b]] - - - Avances et acomptes versés sur commandes - [[bavar25]] - - [[bavar25]] - - - CRÉANCES - - - - - - Créances clients et comptes rattachés - [[bavar26]] - [[-bavar26b]] - [[bavar26+bavar26b]] - - - Autres - [[bavar27]] - [[-bavar27b]] - [[bavar27+bavar27b]] - - - Capital souscrit - appelé , non versé - [[bavar28]] - - [[bavar28]] - - - VALEURS MOBILIÈRES DE PLACEMENT - - - - - - Actions propres - [[bavar29]] - [[-bavar29b]] - [[bavar29+bavar29b]] - - - Autres titres - [[bavar30]] - [[-bavar30b]] - [[bavar30+bavar30b]] - - - Instruments de trésorerie - [[bavar31]] - - [[bavar31]] - - - Disponibilités - [[bavar32]] - - [[bavar32]] - - - Charges constatés d'avance - [[bavar33]] - - [[bavar33]] - - - TOTAL II - [[at2a]] - [[-at2b]] - [[at2]] - - - Charges à répartir sur plusieurs exercices ( III ) - [[bavar34]] - - [[bavar34]] - - - Primes de remboursement des emprunts ( IV ) - [[bavar35]] - - [[bavar35]] - - - Écarts de conversion actif ( V ) - [[bavar36]] - - [[bavar36]] - - - TOTAL ACTIF ( I + II + III + IV + V ) - [[at1a+at2a]] - [[-at1b-at2b]] - [[actif]] - - - PASSIF - - - CAPITAUX PROPRES - - - - Capital [dont versé...] - [[bpvar1]] - - - Primes d'émission, de fusion, d'apport - [[bpvar2]] - - - Écarts de réévaluation - [[bpvar3]] - - - Écart d'équivalence - [[bpvar4]] - - - RÉSERVES - - - - Réserve légale - [[bpvar5]] - - - Réserves statutaires ou contractuelles - [[bpvar6]] - - - Réserves réglementées[[bpvar7]] - - Autres réserves - [[bpvar8]] - - - Report à nouveau - [[bpvar9]] - - - RÉSULTAT DE L'EXERCICE [bénéfice ou perte] - [[bpvar10]] - - - Subventions d'investissement - [[bpvar11]] - - - Provisions réglementées - [[bpvar12]] - - - TOTAL I - [[pt1]] - - - PROVISIONS - - - - Provisions pour risques - [[bpvar13]] - - - Provisions pour charges - [[bpvar14]] - - - TOTAL II - [[pt2]] - - - DETTES - - - - Emprunts obligataires convertibles - [[bpvar15]] - - - Autres emprunts obligataires - [[bpvar16]] - - - Emprunts et dettes auprès des établissements de crédit - [[bpvar17]] - - - Emprunts et dettes financières diverses - [[bpvar18]] - - - Avances et acomptes reçus sur commandes en cours - [[bpvar19]] - - - Dettes fournisseurs et comptes rattachés - [[bpvar20]] - - - Dettes fiscales et sociales - [[bpvar21]] - - - Dettes sur immobilisations et comptes rattachés - [[bpvar22]] - - - Autres dettes - [[bpvar23]] - - - Instruments de trésorerie - [[bpvar24]] - - - Produits constatés d'avance - [[bpvar25]] - - - TOTAL III - [[pt3]] - - - Écarts de conversion passif ( IV ) - [[bpvar26]] - - - TOTAL GÉNÉRAL (I + II + III + IV) - [[passif]] - - - ACTIF - PASSIF - [[round(actif-passif,2)]] - - - - [[ abs(bpcheck)<0.0001 and removeParentNode('para') ]] Attention, pour que votre bilan soit correct, vous devez solder les comptes 120 ou 129 (Résultat de l'exercice précédant) dans un compte de report à nouveau (compte 110 ou 119) ou dans le compte 108. Renseignez vous sur votre structure juridique et son fonctionnement comptable. - - \ No newline at end of file diff --git a/addons/l10n_fr/report/compute_resultant_report.py b/addons/l10n_fr/report/compute_resultant_report.py index 5eb62d7e82d..e371bcc12e6 100644 --- a/addons/l10n_fr/report/compute_resultant_report.py +++ b/addons/l10n_fr/report/compute_resultant_report.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -############################################################################## +# # # Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr # @@ -24,16 +24,75 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # -############################################################################## +# import base_report -from openerp.report import report_sxw +from openerp.osv import osv + class cdr(base_report.base_report): def __init__(self, cr, uid, name, context): super(cdr, self).__init__(cr, uid, name, context) -report_sxw.report_sxw('report.l10n.fr.compute_resultant', 'account.move.line','addons/l10n_fr/report/compute_resultant_report.rml', parser=cdr, header=False) + def set_context(self, objects, data, ids): + super(cdr, self).set_context(objects, data, ids) + + self._load('cdr', self.localcontext['data']['form']) + self._set_variable( + 'ct1', + self.localcontext['cdrc1']+self.localcontext['cdrc2']+self.localcontext['cdrc3']+ + self.localcontext['cdrc4']+self.localcontext['cdrc5']+self.localcontext['cdrc6']+ + self.localcontext['cdrc7']+self.localcontext['cdrc8']+self.localcontext['cdrc9']+ + self.localcontext['cdrc10']+self.localcontext['cdrc11']+self.localcontext['cdrc12']+ + self.localcontext['cdrc13']+self.localcontext['cdrc14']+self.localcontext['cdrc15'] + ) + self._set_variable( + 'ct3', + self.localcontext['cdrc17']+self.localcontext['cdrc18']+self.localcontext['cdrc19']+ + self.localcontext['cdrc20'] + ) + self._set_variable( + 'ct4', + self.localcontext['cdrc21']+self.localcontext['cdrc22']+self.localcontext['cdrc23'] + ) + self._set_variable( + 'charges', + self.localcontext['ct1']+self.localcontext['cdrc16']+self.localcontext['ct3']+ + self.localcontext['ct4']+self.localcontext['cdrc24']+self.localcontext['cdrc25'] + ) + self._set_variable( + 'pta', + self.localcontext['cdrp1']+self.localcontext['cdrp2'] + ) + self._set_variable( + 'ptb', + self.localcontext['cdrp3']+self.localcontext['cdrp4']+self.localcontext['cdrp5']+ + self.localcontext['cdrp6']+self.localcontext['cdrp7'] + ) + self._set_variable( + 'pt1', + self.localcontext['pta']+self.localcontext['ptb'] + ) + self._set_variable( + 'pt3', + self.localcontext['cdrp9']+self.localcontext['cdrp10']+self.localcontext['cdrp11']+ + self.localcontext['cdrp12']+self.localcontext['cdrp13']+self.localcontext['cdrp14'] + ) + self._set_variable( + 'pt4', + self.localcontext['cdrp15']+self.localcontext['cdrp16']+self.localcontext['cdrp17'] + ) + self._set_variable( + 'produits', + self.localcontext['pt1']+self.localcontext['cdrp8']+self.localcontext['pt3']+ + self.localcontext['pt4'] + ) + + +class wrapped_report_resultat(osv.AbstractModel): + _name = 'report.l10n_fr.report_l10nfrresultat' + _inherit = 'report.abstract_report' + _template = 'l10n_fr.report_l10nfrresultat' + _wrapped_report_class = cdr # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/l10n_fr/report/compute_resultant_report.rml b/addons/l10n_fr/report/compute_resultant_report.rml deleted file mode 100644 index b3897c8a839..00000000000 --- a/addons/l10n_fr/report/compute_resultant_report.rml +++ /dev/null @@ -1,652 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [[ _load('cdr',data['form'])]] - [[ _set_variable('ct1', cdrc1+cdrc2+cdrc3+cdrc4+cdrc5+cdrc6+cdrc7+cdrc8+cdrc9+cdrc10+cdrc11+cdrc12+cdrc13+cdrc14+cdrc15)]] - [[ _set_variable('ct3', cdrc17+cdrc18+cdrc19+cdrc20)]] - [[ _set_variable('ct4', cdrc21+cdrc22+cdrc23)]] - [[ _set_variable('charges', ct1+cdrc16+ct3+ct4+cdrc24+cdrc25)]] - [[ _set_variable('pta', cdrp1+cdrp2)]] - [[ _set_variable('ptb', cdrp3+cdrp4+cdrp5+cdrp6+cdrp7)]] - [[ _set_variable('pt1', pta+ptb)]] - [[ _set_variable('pt3', cdrp9+cdrp10+cdrp11+cdrp12+cdrp13+cdrp14)]] - [[ _set_variable('pt4', cdrp15+cdrp16+cdrp17)]] - [[ _set_variable('produits', pt1+cdrp8+pt3+pt4)]] - - - - [[ company.name ]] - période du [[ time.strftime('%d-%m-%Y',time.strptime(date_start,'%Y-%m-%d'))]] au [[ time.strftime('%d-%m-%Y',time.strptime(date_stop,'%Y-%m-%d'))]] - - - Compte de résultat - - - Imprimé le : [[ time.strftime('%d-%m-%Y') ]] - - - - - - - - - - - - - - - Tenue de Compte : [[ company.currency_id.name ]] - - - - - - - - - - CHARGES ( hors taxes ) - - - - - - - - - - CHARGES D'EXPLOITATION - - - - - - - - - - Achat de marchandises - - - [[cdrc1]] - - - - - Variation des stocks - - - [[cdrc2]] - - - - - Achats de matières premières et autres approvisionnements - - - [[cdrc3]] - - - - - Variation des stocks - - - [[cdrc4]] - - - - - Autres achats et charges externes - - - [[cdrc5]] - - - - - Redevances de crédit-bail mobilier - - - [[cdrc6]] - - - - - Redevances de crédit-bail immobilier - - - [[cdrc7]] - - - - - Impôts, taxes et versements assimilés - - - [[cdrc8]] - - - - - Salaires et traitements - - - [[cdrc9]] - - - - - Charges sociales - - - [[cdrc10]] - - - - - Dotation aux amortissements et aux dépréciations - - - - - - - - - - Sur immobilisations : dotations aux amortissements - - - [[cdrc11]] - - - - - Sur immobilisations : dotations aux dépréciations - - - [[cdrc12]] - - - - - Sur actif circulant : dotations aux dépréciations - - - [[cdrc13]] - - - - - Dotations aux provisions - - - [[cdrc14]] - - - - - Autres charges - - - [[cdrc15]] - - - - - TOTAL I - - - [[ct1]] - - - - - Quotes-parts de résultat sur opérations faites en commun ( II ) - - - [[cdrc16]] - - - - - CHARGES FINANCIÈRES - - - - - - - - - - Dotations aux amortissements, aux dépréciations et aux provisions - - - [[cdrc17]] - - - - - Intérêts et charges assimilées - - - [[cdrc18]] - - - - - Différences négatives de change - - - [[cdrc19]] - - - - - Charges nettes sur cessions de valeurs mobilières de placement - - - [[cdrc20]] - - - - - TOTAL III - - - [[ct3]] - - - - - CHARGES EXCEPTIONNELLES - - - - - - - - - - Sur opérations de gestion - - - [[cdrc21]] - - - - - Sur opérations en capital - - - [[cdrc22]] - - - - - Dotations aux amortissements, aux dépréciations et aux provisions - - - [[cdrc23]] - - - - - TOTAL IV - - - [[ct4]] - - - - - Participation des salariés aux résultats ( V ) - - - [[cdrc24]] - - - - - Impôts sur les bénéfices ( VI ) - - - [[cdrc25]] - - - - - TOTAL CHARGES ( I + II + III + IV+ V+ VI ) - - - [[charges]] - - - - - - - - - - - - - - - - - PRODUITS (hors taxes) - - - - - - - - - - PRODUITS D'EXPLOITATION - - - - - - - - - - Vente de marchandises - - - [[cdrp1]] - - - - - Production vendue [biens et services] - - - [[cdrp2]] - - - - - Sous-total A - Montant net du chiffre d'affaires - - - [[pta]] - - - - - Production stockée - - - [[cdrp3]] - - - - - Production immobilisée - - - [[cdrp4]] - - - - - Subventions d'exploitation - - - [[cdrp5]] - - - - - Reprises sur provisions, dépréciations (et amortissements) et transferts de charges - - - [[cdrp6]] - - - - - Autres produits - - - [[cdrp7]] - - - - - Sous-total B - - - [[ptb]] - - - - - TOTAL I ( A + B ) - - - [[pt1]] - - - - - Quotes-parts de résultat sur opérations faites en commun (II) - - - [[cdrp8]] - - - - - PRODUITS FINANCIERS - - - - - - - - - - De participation - - - [[cdrp9]] - - - - - D'autres valeurs mobilières et créances de l'actif immobilisé - - - [[cdrp10]] - - - - - Autres intérêts et produits assimilés - - - [[cdrp11]] - - - - - Reprises sur provisions, dépréciations et transferts de charges - - - [[cdrp12]] - - - - - Différences positives de change - - - [[cdrp13]] - - - - - Produits nets sur cessions de valeurs mobilières de placement - - - [[cdrp14]] - - - - - TOTAL III - - - [[pt3]] - - - - - PRODUITS EXCEPTIONNELS - - - - - - - - - - Sur opérations de gestion - - - [[cdrp15]] - - - - - Sur opérations en capital - - - [[cdrp16]] - - - - - Reprises sur provisions, dépréciations et transferts de charges - - - [[cdrp17]] - - - - - TOTAL IV - - - [[pt4]] - - - - - TOTAL DES PRODUITS ( I + II + III + IV ) - - - [[produits]] - - - - - PRODUITS - CHARGES - - - [[produits-charges]] - - - - - - - - diff --git a/addons/l10n_fr/test/l10n_fr_report.yml b/addons/l10n_fr/test/l10n_fr_report.yml index 25de74dd313..7038887ef52 100644 --- a/addons/l10n_fr/test/l10n_fr_report.yml +++ b/addons/l10n_fr/test/l10n_fr_report.yml @@ -5,7 +5,7 @@ import os import openerp.report from openerp import tools - data, format = openerp.report.render_report(cr, uid, [], 'l10n.fr.bilan', {'model':'account.move.line', 'form':{'fiscalyear_id': ref('account.data_fiscalyear')}}, {}) + data, format = openerp.report.render_report(cr, uid, [], 'l10n_fr.report_l10nfrbilan', {'model':'account.move.line', 'form':{'fiscalyear_id': ref('account.data_fiscalyear')}}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'l10n_fr-bilan_report.'+format), 'wb+').write(data) @@ -16,6 +16,6 @@ import os import openerp.report from openerp import tools - data, format = openerp.report.render_report(cr, uid, [], 'l10n.fr.compute_resultant', {'model':'account.move.line', 'form':{'fiscalyear_id': ref('account.data_fiscalyear')}}, {}) + data, format = openerp.report.render_report(cr, uid, [], 'l10n_fr.report_l10nfrresultat', {'model':'account.move.line', 'form':{'fiscalyear_id': ref('account.data_fiscalyear')}}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'l10n_fr-compute_resultant_report.'+format), 'wb+').write(data) diff --git a/addons/l10n_fr/views/report_l10nfrbilan.xml b/addons/l10n_fr/views/report_l10nfrbilan.xml new file mode 100644 index 00000000000..5b7335e0db0 --- /dev/null +++ b/addons/l10n_fr/views/report_l10nfrbilan.xml @@ -0,0 +1,546 @@ + + + + + + diff --git a/addons/l10n_fr/views/report_l10nfrresultat.xml b/addons/l10n_fr/views/report_l10nfrresultat.xml new file mode 100644 index 00000000000..9938e3fad6f --- /dev/null +++ b/addons/l10n_fr/views/report_l10nfrresultat.xml @@ -0,0 +1,395 @@ + + + + + + diff --git a/addons/l10n_fr/wizard/fr_report_bilan.py b/addons/l10n_fr/wizard/fr_report_bilan.py index e7ae542fa3f..3fde3c19d80 100644 --- a/addons/l10n_fr/wizard/fr_report_bilan.py +++ b/addons/l10n_fr/wizard/fr_report_bilan.py @@ -28,6 +28,7 @@ from openerp.osv import fields, osv + class account_bilan_report(osv.osv_memory): _name = 'account.bilan.report' _description = 'Account Bilan Report' @@ -41,7 +42,7 @@ class account_bilan_report(osv.osv_memory): } _defaults = { - 'fiscalyear_id':_get_default_fiscalyear + 'fiscalyear_id': _get_default_fiscalyear } def print_bilan_report(self, cr, uid, ids, context=None): @@ -50,7 +51,8 @@ class account_bilan_report(osv.osv_memory): data['form'] = {} data['ids'] = active_ids data['form']['fiscalyear_id'] = self.browse(cr, uid, ids)[0].fiscalyear_id.id - return {'type': 'ir.actions.report.xml', 'report_name': 'l10n.fr.bilan', 'datas': data} - + return self.pool['report'].get_action( + cr, uid, ids, 'l10n_fr.report_l10nfrbilan', data=data, context=context + ) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_fr/wizard/fr_report_compute_resultant.py b/addons/l10n_fr/wizard/fr_report_compute_resultant.py index c83f7494d4a..3e13da8f69f 100644 --- a/addons/l10n_fr/wizard/fr_report_compute_resultant.py +++ b/addons/l10n_fr/wizard/fr_report_compute_resultant.py @@ -28,6 +28,7 @@ from openerp.osv import fields, osv + class account_cdr_report(osv.osv_memory): _name = 'account.cdr.report' _description = 'Account CDR Report' @@ -50,7 +51,8 @@ class account_cdr_report(osv.osv_memory): data['form'] = {} data['ids'] = active_ids data['form']['fiscalyear_id'] = self.browse(cr, uid, ids)[0].fiscalyear_id.id - return { 'type': 'ir.actions.report.xml', 'report_name': 'l10n.fr.compute_resultant', 'datas': data} - + return self.pool['report'].get_action( + cr, uid, ids, 'l10n_fr.report_l10nfrresultat', data=data, context=context + ) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_fr_hr_payroll/__openerp__.py b/addons/l10n_fr_hr_payroll/__openerp__.py index eb9ede34570..f7ea758d53a 100644 --- a/addons/l10n_fr_hr_payroll/__openerp__.py +++ b/addons/l10n_fr_hr_payroll/__openerp__.py @@ -48,6 +48,8 @@ TODO: 'data': [ 'l10n_fr_hr_payroll_view.xml', 'l10n_fr_hr_payroll_data.xml', + 'views/report_l10nfrfichepaye.xml', + 'l10n_fr_hr_payroll_reports.xml', ], 'installable': True } diff --git a/addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll_reports.xml b/addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll_reports.xml new file mode 100644 index 00000000000..7e992fabffb --- /dev/null +++ b/addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll_reports.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/addons/l10n_fr_hr_payroll/report/fiche_paye.py b/addons/l10n_fr_hr_payroll/report/fiche_paye.py index daa7c6fd6ac..c6933228687 100755 --- a/addons/l10n_fr_hr_payroll/report/fiche_paye.py +++ b/addons/l10n_fr_hr_payroll/report/fiche_paye.py @@ -22,8 +22,10 @@ # ############################################################################## +from openerp.osv import osv from openerp.report import report_sxw + class fiche_paye_parser(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): @@ -45,7 +47,6 @@ class fiche_paye_parser(report_sxw.rml_parse): res = payslip_line.browse(self.cr, self.uid, ids) return res - def get_total_by_rule_category(self, obj, code): payslip_line = self.pool.get('hr.payslip.line') rule_cate_obj = self.pool.get('hr.salary.rule.category') @@ -60,9 +61,7 @@ class fiche_paye_parser(report_sxw.rml_parse): return category_total - def get_employer_line(self, obj, parent_line): - payslip_line = self.pool.get('hr.payslip.line') line_ids = payslip_line.search(self.cr, self.uid, [('slip_id', '=', obj.id), ('salary_rule_id.parent_rule_id.id', '=', parent_line.salary_rule_id.id )]) @@ -71,6 +70,10 @@ class fiche_paye_parser(report_sxw.rml_parse): return res -report_sxw.report_sxw('report.fiche.paye', 'hr.payslip', 'l10n_fr_hr_payroll/report/fiche_paye.rml', parser=fiche_paye_parser) +class wrapped_report_fiche_paye(osv.AbstractModel): + _name = 'report.l10n_fr_hr_payroll.report_l10nfrfichepaye' + _inherit = 'report.abstract_report' + _template = 'l10n_fr_hr_payroll.report_l10nfrfichepaye' + _wrapped_report_class = fiche_paye_parser # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_fr_hr_payroll/report/fiche_paye.rml b/addons/l10n_fr_hr_payroll/report/fiche_paye.rml deleted file mode 100644 index 2d1a6bff8b2..00000000000 --- a/addons/l10n_fr_hr_payroll/report/fiche_paye.rml +++ /dev/null @@ -1,447 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [[repeatIn(objects,'o')]] - - - - - - - BULLETIN DE PAIE - - - - PAIE DU [[ formatLang(o.date_from, date=True) or '']] AU [[ formatLang(o.date_to, date=True) or '' ]] - - - - Matricule : - N° s.s : - Emploi : - Qualif : - Niveau : - Coef : - Entrée : - - - [[o.employee_id.sinid or '_']] - [[o.employee_id.ssnid or '_']] - [[o.contract_id.job_id.name or '_']] - [[o.contract_id.qualif or '_']] - [[o.contract_id.niveau or '_']] - [[o.contract_id.coef or '_']] - [[o.contract_id.date_start or '_']] Sortie : [[o.contract_id.date_end or '']] - - - - - ORG. S.S : - - - [[o.employee_id.company_id.org_ss or '_']] - - - - - - - - - - - - - - - - - [[o.employee_id.company_id.partner_id.title.name or '']] [[o.employee_id.company_id.name or '_']] - [[o.employee_id.company_id.street or '_']] - [[o.employee_id.company_id.street2 or '']] - [[o.employee_id.company_id.zip or '_']] [[o.employee_id.company_id.city or '']] - SIRET : [[o.employee_id.company_id.siret or '_']] APE : [[o.employee_id.company_id.ape or '_']] - - - - - - - - - - - - - - - - [[o.employee_id.name or '_']] - [[display_address(o.employee_id.address_home_id) or '_' ]] - - - - - - - - - - - - - - - - - - - DESIGNATION - - - QUANTITE / BASE - - - TAUX - - - MONTANT - - - CHARGES PATRONALES - - - -
- [[repeatIn(get_payslip_lines(o.line_ids),'p')]] - - - - [[ p.code or '' ]] - - - [[ p.name or '' ]] - - - [[ ((p.amount_select== 'percentage') or removeParentNode('para')) and '' ]] [[ p.amount or '' ]] - [[ ((p.amount_select== 'fix') or removeParentNode('para')) and '' ]] [[ p.quantity or '' ]] - [[ ((p.amount_select<> 'fix' and p.amount_select<> 'percentage') or removeParentNode('para')) and '' ]] - - - [[ ((p.amount_select == 'percentage') or removeParentNode('para')) and '' ]] [[ p.rate or '' ]] - [[ ((p.amount_select <> 'percentage') or removeParentNode('para')) and '' ]] - - - [[ p.total or '' ]] - - - [[ get_employer_line(o, p) and get_employer_line(o, p).rate or '']] - - - [[ get_employer_line(o,p) and get_employer_line(o,p).total or '' ]] - - - -
- - - - - - - - - - Mode de reglement : [[ o.payment_mode or '' ]] - Paye le : [[ formatLang(o.move_id.date, date=True) or '']] - - - NET A PAYER - - - TOTAL CHARGES PATRONALES - - - - - Conv. Coll.: [[ o.employee_id.company_id.conv_coll or '' ]] - - - [[ get_total_by_rule_category(o, 'NET') ]] - - - [[ get_total_by_rule_category(o, 'COMP') ]] - - - - - - - SALAIRE BRUT - - - TOTAL CHARGES SALARIALES - - - NET IMPOSABLE - - - PLAFOND S.S. - - - - - - - - COUT GLOBAL SALARIE - - - - - [[ get_total_by_rule_category(o, 'BRUT') ]] - - - [[ get_total_by_rule_category(o, 'SALC') ]] - - - [[ get_total_by_rule_category(o, 'C_IMP') ]] - - - [[ o.employee_id.company_id.plafond_secu or '' ]] - - - - - - - - [[ get_total_by_rule_category(o, 'TOTAL') ]] - - - - - - - - - - - DANS VOTRE INTERET ET POUR VOUS AIDER A FAIRE VALOIR VOS DROITS, CONSERVEZ CE BULLETIN DE PAIE SANS LIMITATION DE DUREE - -
-
- diff --git a/addons/l10n_fr_hr_payroll/views/report_l10nfrfichepaye.xml b/addons/l10n_fr_hr_payroll/views/report_l10nfrfichepaye.xml new file mode 100644 index 00000000000..8aa0d4e125d --- /dev/null +++ b/addons/l10n_fr_hr_payroll/views/report_l10nfrfichepaye.xml @@ -0,0 +1,147 @@ + + + + + + diff --git a/addons/l10n_in_hr_payroll/__openerp__.py b/addons/l10n_in_hr_payroll/__openerp__.py index 2522d543548..c56417fbce4 100644 --- a/addons/l10n_in_hr_payroll/__openerp__.py +++ b/addons/l10n_in_hr_payroll/__openerp__.py @@ -49,11 +49,14 @@ Indian Payroll Salary Rules. 'security/ir.model.access.csv', 'l10n_in_hr_payroll_report.xml', 'l10n_in_hr_payroll_sequence.xml', + 'views/report_payslipdetails.xml', + 'views/report_hrsalarybymonth.xml', 'wizard/hr_salary_employee_bymonth_view.xml', 'wizard/hr_yearly_salary_detail_view.xml', 'report/payment_advice_report_view.xml', 'report/payslip_report_view.xml', - + 'views/report_hryearlysalary.xml', + 'views/report_payrolladvice.xml', ], 'test': [ 'test/payment_advice.yml', diff --git a/addons/l10n_in_hr_payroll/l10n_in_hr_payroll_report.xml b/addons/l10n_in_hr_payroll/l10n_in_hr_payroll_report.xml index 7f27291051f..427e9111017 100644 --- a/addons/l10n_in_hr_payroll/l10n_in_hr_payroll_report.xml +++ b/addons/l10n_in_hr_payroll/l10n_in_hr_payroll_report.xml @@ -3,35 +3,37 @@ + string="PaySlip Details" + report_type="qweb-pdf" + name="l10n_in_hr_payroll.report_payslipdetails" + file="l10n_in_hr_payroll.report_payslipdetails" /> + string="Print Advice" + report_type="qweb-pdf" + name="l10n_in_hr_payroll.report_payrolladvice" + file="l10n_in_hr_payroll.report_payrolladvice"/> - + diff --git a/addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.py b/addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.py index f4b282dd89c..31ea9cb4b3c 100644 --- a/addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.py +++ b/addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.py @@ -21,7 +21,7 @@ import datetime import time - +from openerp.osv import osv from openerp.report import report_sxw class report_hr_salary_employee_bymonth(report_sxw.rml_parse): @@ -64,8 +64,8 @@ class report_hr_salary_employee_bymonth(report_sxw.rml_parse): current_year = last_year current_month = current_month + 1 for c in range(0, (12-no_months)): - mnth_name.append('None') - self.mnths.append('None') + mnth_name.append('') + self.mnths.append('') return [mnth_name] def get_salary(self, form, emp_id, emp_salary, total_mnths): @@ -81,10 +81,10 @@ class report_hr_salary_employee_bymonth(report_sxw.rml_parse): sal = self.cr.fetchall() salary = dict(sal) total = 0.0 - cnt = 1 + cnt = 0 for month in self.mnths: - if month <> 'None': + if month <> '': if len(month) != 7: month = '0' + str(month) if month in salary and salary[month]: @@ -102,7 +102,7 @@ class report_hr_salary_employee_bymonth(report_sxw.rml_parse): def get_employee(self, form): emp_salary = [] salary_list = [] - total_mnths=['Total', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + total_mnths=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] emp_obj = self.pool.get('hr.employee') emp_ids = form.get('employee_ids', []) employees = emp_obj.browse(self.cr, self.uid, emp_ids, context=self.context) @@ -128,6 +128,10 @@ class report_hr_salary_employee_bymonth(report_sxw.rml_parse): self.total += item[count] return self.total -report_sxw.report_sxw('report.salary.employee.bymonth', 'hr.salary.employee.month', 'l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.rml', parser=report_hr_salary_employee_bymonth, header='internal') +class wrapped_report_employee_salary_bymonth(osv.AbstractModel): + _name = 'report.l10n_in_hr_payroll.report_hrsalarybymonth' + _inherit = 'report.abstract_report' + _template = 'l10n_in_hr_payroll.report_hrsalarybymonth' + _wrapped_report_class = report_hr_salary_employee_bymonth -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.rml b/addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.rml deleted file mode 100644 index 6368a644f4b..00000000000 --- a/addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.rml +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Yearly Salary Details - From [[ formatLang(data['form']['start_date'], date=True) ]] To [[ formatLang(data['form']['end_date'], date=True) ]] of [[ (data['form']['category_id'][1]) ]] Category - - - -
- [[ repeatIn(get_periods(data['form']),'m') ]] - - - - Name - - - [[ m[0] != 'None' and m[0] or '' ]] - - - [[ m[1] != 'None' and m[1] or '' ]] - - - [[ m[2] != 'None' and m[2] or '' ]] - - - [[ m[3] != 'None' and m[3] or '' ]] - - - [[ m[4] != 'None' and m[4] or '' ]] - - - [[ m[5] != 'None' and m[5] or '' ]] - - - [[ m[6] != 'None' and m[6] or '' ]] - - - [[ m[7] != 'None' and m[7] or '' ]] - - - [[ m[8] != 'None' and m[8] or '' ]] - - - [[ m[9] != 'None' and m[9] or '' ]] - - - [[ m[10] != 'None' and m[10] or '' ]] - - - [[ m[11] != 'None' and m[11] or '' ]] - - - Total - - - -
- [[ repeatIn(get_employee(data['form']),'e') ]] - - - - [[ e[0] ]] - - - - [[ (e[1]!='' and formatLang(e[1])) or removeParentNode('font') ]] - - - - - [[ (e[2]!='' and formatLang(e[2])) or removeParentNode('font') ]] - - - - - [[ (e[3]!='' and formatLang(e[3])) or removeParentNode('font') ]] - - - - - [[ (e[4]!='' and formatLang(e[4])) or removeParentNode('font') ]] - - - - - [[ (e[5]!='' and formatLang(e[5])) or removeParentNode('font') ]] - - - - - [[ (e[6]!='' and formatLang(e[6])) or removeParentNode('font') ]] - - - - - [[ (e[7]!='' and formatLang(e[7])) or removeParentNode('font') ]] - - - - - [[ (e[8]!='' and formatLang(e[8])) or removeParentNode('font') ]] - - - - - [[ (e[9]!='' and formatLang(e[9])) or removeParentNode('font') ]] - - - - - [[ (e[10]!='' and formatLang(e[10])) or removeParentNode('font') ]] - - - - - [[ (e[11]!='' and formatLang(e[11])) or removeParentNode('font') ]] - - - - - [[ (e[12]!='' and formatLang(e[12])) or removeParentNode('font') ]] - - - - [[ formatLang(e[13],currency_obj= company.currency_id)]] - - - -
-
-
- [[ repeatIn(get_months_tol(),'t') ]] - - - - Total - - - [[ formatLang(t[1],currency_obj= company.currency_id) or removeParentNode('para') ]] - - - [[ formatLang(t[2],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(t[3],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(t[4],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(t[5],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(t[6],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(t[7],currency_obj= company.currency_id) or removeParentNode('para')]] ] - - - [[ formatLang(t[8],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(t[9],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(t[10],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(t[11],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(t[12],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(get_total(), currency_obj = company.currency_id)]] - - - -
-
-
diff --git a/addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.py b/addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.py index 220bcdb5552..e396e611a3f 100644 --- a/addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.py +++ b/addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.py @@ -22,6 +22,7 @@ import time import datetime from openerp.report import report_sxw +from openerp.osv import osv class employees_yearly_salary_report(report_sxw.rml_parse): @@ -64,8 +65,8 @@ class employees_yearly_salary_report(report_sxw.rml_parse): current_year = last_year current_month = current_month + 1 for c in range(0, (12-no_months)): - mnth_name.append('None') - self.mnths.append('None') + mnth_name.append('') + self.mnths.append('') return [mnth_name] def get_employee(self, form): @@ -159,6 +160,10 @@ class employees_yearly_salary_report(report_sxw.rml_parse): def get_total(self): return self.total -report_sxw.report_sxw('report.salary.detail.byyear', 'yearly.salary.detail', 'hr_payroll/report/report_hr_yearly_salary_detail.rml', parser=employees_yearly_salary_report, header='internal landscape') +class wrapped_report_payslip(osv.AbstractModel): + _name = 'report.l10n_in_hr_payroll.report_hryearlysalary' + _inherit = 'report.abstract_report' + _template = 'l10n_in_hr_payroll.report_hryearlysalary' + _wrapped_report_class = employees_yearly_salary_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.rml b/addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.rml deleted file mode 100644 index 502eaa7b0ff..00000000000 --- a/addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.rml +++ /dev/null @@ -1,588 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [[ repeatIn(get_employee(data['form']), 'o') ]] - - - - From [[ formatLang(data['form']['date_from'], date=True) ]] To [[ formatLang(data['form']['date_to'], date=True) ]] - - - - - - - - - - Employee Code - - - [[ o.identification_id ]] - - - Department - - - [[ o.department_id and o.department_id.name or '' ]] - - - Bank - - - [[ o.bank_account_id and o.bank_account_id.bank.name or '' ]] - - - - - - - Employee Name - - - [[ o.name ]] - - - Other No. - - - [[ o.otherid or '' ]] - - - Address - - - [[o.address_home_id and o.address_home_id.name or '' ]] - - - - - - - Designation - - - [[ o.job_id and o.job_id.name or '' ]] - - - Phone No. - - - [[ o.work_phone or '' ]] - - - E-mail Address - - - [[o.work_email or '' ]] - - - - - - -
- [[ repeatIn(get_periods(data['form']),'m') ]] - [[ get_employee_detail((data['form']),o) ]] - - - - Title - - - [[ m[0] != 'None' and m[0] or '' ]] - - - [[ m[1] != 'None' and m[1] or '' ]] - - - [[ m[2] != 'None' and m[2] or '' ]] - - - [[ m[3] != 'None' and m[3] or '' ]] - - - [[ m[4] != 'None' and m[4] or '' ]] - - - [[ m[5] != 'None' and m[5] or '' ]] - - - [[ m[6] != 'None' and m[6] or '' ]] - - - [[ m[7] != 'None' and m[7] or '' ]] - - - [[ m[8] != 'None' and m[8] or '' ]] - - - [[ m[9] != 'None' and m[9] or '' ]] - - - [[ m[10] != 'None' and m[10] or '' ]] - - - [[ m[11] != 'None' and m[11] or '' ]] - - - Total - - - - - - -
- - - - Allowances with Basic: - - - -
- [[ repeatIn(get_allow(),'e1') ]] - - - - [[ e1[0] in ["Basic","Gross"] and e1[0] ]] - [[ e1[0] not in ["Basic","Gross"] and e1[0] ]] - - - - [[ (e1[0] in ["Basic","Gross"] and e1[1]!='' and formatLang(e1[1])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[1]!='' and formatLang(e1[1])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[2]!='' and formatLang(e1[2])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[2]!='' and formatLang(e1[2])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[3]!='' and formatLang(e1[3])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[3]!='' and formatLang(e1[3])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[4]!='' and formatLang(e1[4])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[4]!='' and formatLang(e1[4])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[5]!='' and formatLang(e1[5])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[5]!='' and formatLang(e1[5])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[6]!='' and formatLang(e1[6])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[6]!='' and formatLang(e1[6])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[7]!='' and formatLang(e1[7])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[7]!='' and formatLang(e1[7])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[8]!='' and formatLang(e1[8])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[8]!='' and formatLang(e1[8])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[9]!='' and formatLang(e1[9])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[9]!='' and formatLang(e1[9])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[10]!='' and formatLang(e1[10])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[10]!='' and formatLang(e1[10])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[11]!='' and formatLang(e1[11])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[11]!='' and formatLang(e1[11])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[12]!='' and formatLang(e1[12])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[12]!='' and formatLang(e1[12])) or removeParentNode('font') ]] - - - - [[ formatLang(e1[13],currency_obj= company.currency_id) ]] - - - -
- - - - Deductions: - - - -
- [[ repeatIn(get_deduct(),'e2') ]] - - - - [[ e2[0] in ["Net"] and e2[0] ]] - [[ e2[0] not in ["Net"] and e2[0] ]] - - - - [[ (e2[0] in ["Net"] and e2[1]!='' and formatLang(e2[1])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[1]!='' and formatLang(e2[1])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[2]!='' and formatLang(e2[2])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[2]!='' and formatLang(e2[2])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[3]!='' and formatLang(e2[3])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[3]!='' and formatLang(e2[3])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[4]!='' and formatLang(e2[4])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[4]!='' and formatLang(e2[4])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[5]!='' and formatLang(e2[5])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[5]!='' and formatLang(e2[5])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[6]!='' and formatLang(e2[6])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[6]!='' and formatLang(e2[6])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[7]!='' and formatLang(e2[7])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[7]!='' and formatLang(e2[7])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[8]!='' and formatLang(e2[8])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[8]!='' and formatLang(e2[8])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[9]!='' and formatLang(e2[9])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[9]!='' and formatLang(e2[9])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[10]!='' and formatLang(e2[10])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[10]!='' and formatLang(e2[10])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[11]!='' and formatLang(e2[11])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[11]!='' and formatLang(e2[11])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[12]!='' and formatLang(e2[12])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[12]!='' and formatLang(e2[12])) or removeParentNode('font') ]] - - - - [[ formatLang(e2[13],currency_obj= company.currency_id) ]] - - - -
-
- - - -
- - - -
-
diff --git a/addons/l10n_in_hr_payroll/report/report_payroll_advice.py b/addons/l10n_in_hr_payroll/report/report_payroll_advice.py index eaece823f6d..41f4b5880d3 100644 --- a/addons/l10n_in_hr_payroll/report/report_payroll_advice.py +++ b/addons/l10n_in_hr_payroll/report/report_payroll_advice.py @@ -23,7 +23,7 @@ import time from datetime import datetime - +from openerp.osv import osv from openerp.report import report_sxw from openerp.tools import amount_to_text_en @@ -77,6 +77,10 @@ class payroll_advice_report(report_sxw.rml_parse): result.append(res) return result -report_sxw.report_sxw('report.payroll.advice', 'hr.payroll.advice', 'l10n_in_hr_payroll/report/report_payroll_advice.rml', parser=payroll_advice_report, header="external") +class wrapped_report_payroll_advice(osv.AbstractModel): + _name = 'report.l10n_in_hr_payroll.report_payrolladvice' + _inherit = 'report.abstract_report' + _template = 'l10n_in_hr_payroll.report_payrolladvice' + _wrapped_report_class = payroll_advice_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in_hr_payroll/report/report_payroll_advice.rml b/addons/l10n_in_hr_payroll/report/report_payroll_advice.rml deleted file mode 100644 index 879314a24d9..00000000000 --- a/addons/l10n_in_hr_payroll/report/report_payroll_advice.rml +++ /dev/null @@ -1,425 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [[repeatIn(objects,'o')]] - - - - [[ formatLang(time.strftime('%Y-%m-%d'),date=True) ]] - - - - - - - - - - - - - - To, - The Manager - - - - - - - - - - [[ o.bank_id.name ]] Bank - - - - - - - - - - - - - Dear Sir/Madam, - - - - - - - - - - - - Payment Advice from [[ o.name ]] A/C no. [[ o.company_id.bank_ids and o.company_id.bank_ids[0].acc_number ]] form period [[ get_month(o.date)['from_name'] ]] to [[ get_month(o.date)['to_name'] ]] - - - - - - - [[ o.note ]] - - - - - - - [[ o.neft == True and removeParentNode('blockTable') ]] - - - SI. No. - - - Name of the Employe - - - Bank Account No. - - - By Salary - - - C/D - - - -
- [[ repeatIn(get_detail(o.line_ids),'line') ]] - [[ o.neft == True and removeParentNode('blockTable') ]] - - - - . - - - - - [[ line['name'] ]] - - - [[ line['acc_no'] ]] - - - [[formatLang(line['bysal'], currency_obj = company.currency_id) ]] - - - [[ line['debit_credit'] ]] - - - -
- [[ o.neft != True and removeParentNode('blockTable') ]] - - - SI. No. - - - Name of the Employe - - - Bank Account No. - - - IFSC Code - - - By Salary - - - C/D - - - -
- [[ repeatIn(get_detail(o.line_ids),'line') ]] - [[ o.neft !=True and removeParentNode('blockTable') ]] - - - - . - - - - [[ line['name'] ]] - - - [[ line['acc_no'] ]] - - - [[ line['ifsc_code'] ]] - - - [[formatLang(line['bysal'], currency_obj = company.currency_id) ]] - - - [[ line['debit_credit'] ]] - - - -
- [[ o.neft == True and removeParentNode('blockTable') ]] - - - - - - - - - - - - - Total : [[ o.line_ids==[] and removeParentNode('para') ]] - - - - [[ o.line_ids==[] and removeParentNode('para') ]][[ formatLang(get_bysal_total(), currency_obj = company.currency_id) ]] - - - - - - - - - [[ o.neft !=True and removeParentNode('blockTable') ]] - - - - - - - - - - - - - Total : [[ o.line_ids==[] and removeParentNode('para') ]] - - - - [[ o.line_ids==[] and removeParentNode('para') ]][[ formatLang(get_bysal_total(), currency_obj = company.currency_id) ]] - - - - - - - - - - - - - - - Yours Sincerely - - - - - - - - - - For [[ company.name ]] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Authorized Signature - - - - - - - - - - - - - - -
-
diff --git a/addons/l10n_in_hr_payroll/report/report_payslip_details.py b/addons/l10n_in_hr_payroll/report/report_payslip_details.py index 37cb7c2a0b7..2c3b20fcd7a 100644 --- a/addons/l10n_in_hr_payroll/report/report_payslip_details.py +++ b/addons/l10n_in_hr_payroll/report/report_payslip_details.py @@ -20,6 +20,7 @@ ############################################################################## from openerp.report import report_sxw +from openerp.osv import osv from openerp.addons.hr_payroll import report class payslip_details_report_in(report.report_payslip_details.payslip_details_report): @@ -30,6 +31,10 @@ class payslip_details_report_in(report.report_payslip_details.payslip_details_re 'get_details_by_rule_category': self.get_details_by_rule_category, }) -report_sxw.report_sxw('report.paylip.details.in', 'hr.payslip', 'l10n_in_hr_payroll/report/report_payslip_details.rml', parser=payslip_details_report_in) +class wrapped_report_payslipdetailsin(osv.AbstractModel): + _name = 'report.l10n_in_hr_payroll.report_payslipdetails' + _inherit = 'report.abstract_report' + _template = 'l10n_in_hr_payroll.report_payslipdetails' + _wrapped_report_class = payslip_details_report_in # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in_hr_payroll/report/report_payslip_details.rml b/addons/l10n_in_hr_payroll/report/report_payslip_details.rml deleted file mode 100644 index c4ce55bfa41..00000000000 --- a/addons/l10n_in_hr_payroll/report/report_payslip_details.rml +++ /dev/null @@ -1,372 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [[repeatIn(objects,'o')]] - - - - Pay Slip Details - - - - - [[o.credit_note==False and removeParentNode('para')]] - Credit - - Note - - ([[o.name or removeParentNode('para')]]) - - - - Name - - - [[o.employee_id.name]] - - - Designation - - - [[ o.employee_id.job_id.name or '' ]] - - - - - - - - Address - - - - [[o.employee_id.address_home_id and o.employee_id.address_home_id.name or '' ]],[[o.employee_id.address_home_id and display_address(o.employee_id.address_home_id)]] - - - - - - - Email - - - [[ o.employee_id.work_email or '' ]] - - - - Identification No - - - - [[ o.employee_id.identification_id or '' ]] - - - - - - - Reference - - - [[ o.number or '' ]] - - - Bank Account - - - [[ o.employee_id.otherid or '' ]] - - - - - - - Date From - - - [[ o.date_from or '']] - - - - Date To - - - - [[ o.date_to or '' ]] - - - - - - - - - - - - - - Details by Salary Rule Category: - - - - - - - Code - - - Salary Rule Category - - - Total - - - - - - -
- [[repeatIn(get_details_by_rule_category(o.details_by_salary_rule_category),'h') ]] - - - - - [[ h['code'] ]] - [[ h['level']!=0 and ( setTag('para','para',{'style':'terp_default_8'})) or removeParentNode('font')]] - - - - [[ '..'*h['level'] ]][[ h['rule_category'] ]][[ h['level']!=0 and ( setTag('para','para',{'style':'terp_default_8'})) or removeParentNode('font') ]] - - - [[ formatLang(h['total'], currency_obj = o.company_id and o.company_id.currency_id)]] [[ h['level']==0 and ( setTag('para','para',{'style':'terp_default_10'})) or removeParentNode('font') ]] - - - -
- - - - - - - - - - - - - - - - - - - - - - Authorized Signature - - - - - - -
-
- diff --git a/addons/l10n_in_hr_payroll/test/payment_advice.yml b/addons/l10n_in_hr_payroll/test/payment_advice.yml index 0b4b16a629c..173bbe6fb20 100644 --- a/addons/l10n_in_hr_payroll/test/payment_advice.yml +++ b/addons/l10n_in_hr_payroll/test/payment_advice.yml @@ -38,6 +38,6 @@ import os import openerp.report from openerp import tools - data, format = openerp.report.render_report(cr, uid, [ref('l10n_in_hr_payroll.payment_advice_1')], 'payroll.advice', {}, {}) + data, format = openerp.report.render_report(cr, uid, [ref('payment_advice_1')], 'l10n_in_hr_payroll.report_payrolladvice', {}, {}) if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'l10n_in_hr_payroll_summary report'+format), 'wb+').write(data) + file(os.path.join(tools.config['test_report_directory'], 'l10n_in_hr_payroll_summary_report.'+format), 'wb+').write(data) diff --git a/addons/l10n_in_hr_payroll/views/report_hrsalarybymonth.xml b/addons/l10n_in_hr_payroll/views/report_hrsalarybymonth.xml new file mode 100644 index 00000000000..2f1f2ac8a9d --- /dev/null +++ b/addons/l10n_in_hr_payroll/views/report_hrsalarybymonth.xml @@ -0,0 +1,60 @@ + + + + + + diff --git a/addons/l10n_in_hr_payroll/views/report_hryearlysalary.xml b/addons/l10n_in_hr_payroll/views/report_hryearlysalary.xml new file mode 100644 index 00000000000..189dfd29e5a --- /dev/null +++ b/addons/l10n_in_hr_payroll/views/report_hryearlysalary.xml @@ -0,0 +1,126 @@ + + + + + + diff --git a/addons/l10n_in_hr_payroll/views/report_payrolladvice.xml b/addons/l10n_in_hr_payroll/views/report_payrolladvice.xml new file mode 100644 index 00000000000..03bb91f567d --- /dev/null +++ b/addons/l10n_in_hr_payroll/views/report_payrolladvice.xml @@ -0,0 +1,92 @@ + + + + + + \ No newline at end of file diff --git a/addons/l10n_in_hr_payroll/views/report_payslipdetails.xml b/addons/l10n_in_hr_payroll/views/report_payslipdetails.xml new file mode 100644 index 00000000000..426a71de1ee --- /dev/null +++ b/addons/l10n_in_hr_payroll/views/report_payslipdetails.xml @@ -0,0 +1,94 @@ + + + + + + \ No newline at end of file diff --git a/addons/l10n_in_hr_payroll/wizard/hr_salary_employee_bymonth.py b/addons/l10n_in_hr_payroll/wizard/hr_salary_employee_bymonth.py index 93594e1dff8..6e37f5b58d5 100644 --- a/addons/l10n_in_hr_payroll/wizard/hr_salary_employee_bymonth.py +++ b/addons/l10n_in_hr_payroll/wizard/hr_salary_employee_bymonth.py @@ -20,7 +20,6 @@ ############################################################################## import time - from openerp.osv import fields, osv class hr_salary_employee_bymonth(osv.osv_memory): @@ -60,11 +59,8 @@ class hr_salary_employee_bymonth(osv.osv_memory): res = self.read(cr, uid, ids, context=context) res = res and res[0] or {} datas.update({'form': res}) - return { - 'type': 'ir.actions.report.xml', - 'report_name': 'salary.employee.bymonth', - 'datas': datas, - } + return self.pool['report'].get_action(cr, uid, ids, + 'l10n_in_hr_payroll.report_hrsalarybymonth', + data=datas, context=context) - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in_hr_payroll/wizard/hr_yearly_salary_detail.py b/addons/l10n_in_hr_payroll/wizard/hr_yearly_salary_detail.py index de3680f2dd3..2846970211a 100644 --- a/addons/l10n_in_hr_payroll/wizard/hr_yearly_salary_detail.py +++ b/addons/l10n_in_hr_payroll/wizard/hr_yearly_salary_detail.py @@ -54,12 +54,7 @@ class yearly_salary_detail(osv.osv_memory): res = self.read(cr, uid, ids, context=context) res = res and res[0] or {} - datas.update({'form': res}) - return { - 'type': 'ir.actions.report.xml', - 'report_name': 'salary.detail.byyear', - 'datas': datas, - } - + datas.update({'form':res}) + return self.pool['report'].get_action(cr, uid, ids, 'l10n_in_hr_payroll.report_hryearlysalary', data=datas, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report/models/abstract_report.py b/addons/report/models/abstract_report.py index 2da32b6c0f6..4f38b39b5e2 100644 --- a/addons/report/models/abstract_report.py +++ b/addons/report/models/abstract_report.py @@ -58,7 +58,7 @@ class AbstractReport(osv.AbstractModel): docargs = wrapped_report.localcontext docargs['docs'] = docargs.get('objects') - # Used in template translating (see render_doc method from report model) + # Used in template translation (see translate_doc method from report model) docargs['doc_ids'] = context['active_ids'] docargs['doc_model'] = model diff --git a/addons/report/models/report.py b/addons/report/models/report.py index 8dd8a4dce6f..212555dbc8a 100644 --- a/addons/report/models/report.py +++ b/addons/report/models/report.py @@ -262,15 +262,15 @@ class Report(osv.Model): :param report_name: Name of the template to generate an action for """ - if context is None: - context = {} - report_obj = self.pool['ir.actions.report.xml'] idreport = report_obj.search(cr, uid, [('report_name', '=', report_name)], context=context) try: report = report_obj.browse(cr, uid, idreport[0], context=context) except IndexError: - raise osv.except_osv(_('Bad Report'), _('This report is not loaded into the database.')) + raise osv.except_osv( + _('Bad Report Reference'), + _('This report is not loaded into the database: %s.' % report_name) + ) action = { 'context': context,