clearcorp team mailing list archive
-
clearcorp team
-
Mailing list archive
-
Message #00149
[Merge] lp:~as.clearcorp/openerp-costa-rica/6.1-l10n_cr_hr_payroll into lp:openerp-costa-rica/6.1
Armando Soto Rodríguez has proposed merging lp:~as.clearcorp/openerp-costa-rica/6.1-l10n_cr_hr_payroll into lp:openerp-costa-rica/6.1.
Requested reviews:
CLEARCORP drivers (clearcorp-drivers)
For more details, see:
https://code.launchpad.net/~as.clearcorp/openerp-costa-rica/6.1-l10n_cr_hr_payroll/+merge/107050
[ADD] Added payroll_report to l10n_cr_hr_payroll
--
https://code.launchpad.net/~as.clearcorp/openerp-costa-rica/6.1-l10n_cr_hr_payroll/+merge/107050
Your team CLEARCORP development team is subscribed to branch lp:openerp-costa-rica/6.1.
=== modified file 'cr_hr_report/__terp__.py'
--- cr_hr_report/__terp__.py 2012-05-04 14:04:10 +0000
+++ cr_hr_report/__terp__.py 2012-05-23 15:38:20 +0000
@@ -51,7 +51,7 @@
],
'init_xml': [],
'update_xml': [
- 'payment_receipt_report.xml',
+ 'payroll_report.xml',
],
'license': 'Other OSI approved licence',
'installable': True,
=== removed file 'cr_hr_report/payment_receipt_report.xml'
--- cr_hr_report/payment_receipt_report.xml 2012-05-18 00:35:46 +0000
+++ cr_hr_report/payment_receipt_report.xml 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-<openerp>
- <data>
- <report auto="False" id="hr_payslip_run_ccorp" model="hr.payslip.run"
- name="hr.payslip.run.layout_ccorp" file="cr_hr_report/report/payment_receipt.mako" string="Reporte de Planilla" report_type="webkit"/>
- </data>
-</openerp>
=== added file 'cr_hr_report/payroll_report.xml'
--- cr_hr_report/payroll_report.xml 1970-01-01 00:00:00 +0000
+++ cr_hr_report/payroll_report.xml 2012-05-23 15:38:20 +0000
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<openerp>
+ <data>
+ <report auto="False" id="hr_payslip_run_ccorp" model="hr.payslip.run"
+ name="hr.payslip.run.layout_ccorp" file="cr_hr_report/report/payroll_report.mako" string="Reporte de Planilla" report_type="webkit"/>
+ </data>
+</openerp>
=== modified file 'cr_hr_report/report/__init__.py'
--- cr_hr_report/report/__init__.py 2012-05-04 14:04:10 +0000
+++ cr_hr_report/report/__init__.py 2012-05-23 15:38:20 +0000
@@ -2,7 +2,7 @@
##############################################################################
#
# __init__.py
-# payment_receipt
+# payroll_report
# First author: Carlos Vásquez <carlos.vasquez@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
#
@@ -32,4 +32,4 @@
#
##############################################################################
-import payment_receipt
+import payroll_report
=== removed file 'cr_hr_report/report/payment_receipt.mako'
--- cr_hr_report/report/payment_receipt.mako 2012-05-18 00:35:46 +0000
+++ cr_hr_report/report/payment_receipt.mako 1970-01-01 00:00:00 +0000
@@ -1,155 +0,0 @@
-<html>
- <head>
- <style type="text/css">
- ${css}
-
- .list_table .act_as_row {
- margin-top: 10px;
- margin-bottom: 10px;
- font-size:10px;
- }
-
- .account_line {
- font-weight: bold;
- font-size: 15px;
- background-color:#F0F0F0;
- }
-
- .account_line .act_as_cell {
- height: 30px;
- vertical-align: bottom;
- }
-
- </style>
- </head>
-<body class = "data">
- <%
- total_hn = 0.0
- total_he = 0.0
- total_fe = 0.0
- total_basic = 0.0
- total_exs = 0.0
- total_fes = 0.0
- total_gross = 0.0
- total_basic = 0.0
- total_rent = 0.0
- total_ccss = 0.0
- total_net = 0.0
- total_emp = 0
- dep = []
- %>
- %for deparments in objects:
- <%
- dep.append(deparments)
-
- %>
- %endfor
- %for payslips in objects :
- <div style="font-size: 20px; font-weight: bold; text-align: center;"> ${company.partner_id.name | entity} - ${company.currency_id.name | entity}</div>
- <div style="font-size: 25px; font-weight: bold; text-align: center;"> Reporte de Planilla</div>
- <div style="font-size: 20px; font-weight: bold; text-align: center;"> ${payslips.name}</div>
- <div style="font-size: 16px; font-weight: bold; text-align: center;">Periodo de ${payslips.date_start} a ${payslips.date_end}</div>
- </br></br>
- <div class="act_as_table list_table">
- <div class="act_as_thead">
- <div class="act_as_row labels" style="font-weight: bold; font-size: 11x;">
- <div class="act_as_cell first_column" style="width: 85px; vertical-align: middle">${_('Cedula')}</div>
- <div class="act_as_cell" style="width: 250px; vertical-align: middle">${_('Nombre')}</div>
- <div class="act_as_cell amount" style="width: 40px;">${_('Hrs.')}<br />${_('Nor')}</div>
- <div class="act_as_cell amount" style="width: 40px;">${_('Hrs.')}<br />${_('Ext')}</div>
- <div class="act_as_cell amount" style="width: 40px;">${_('Hrs.')}<br />${_('Dob')}</div>
- <div class="act_as_cell amount">${_('Ingr.')}<br />${_('Normal')}</div>
- <div class="act_as_cell amount">${_('Ingr.')}<br />${_('Extra')}</div>
- <div class="act_as_cell amount">${_('Ingr.')}<br />${_('Doble')}</div>
- <div class="act_as_cell amount">${_('Otros')}<br />${_('Ingr.')}</div>
- <div class="act_as_cell amount">${_('Salario')}<br />${_('Bruto')}</div>
- <div class="act_as_cell amount">${_('Deducc.')}<br />${_('CCSS/BP')}</div>
- <div class="act_as_cell amount">${_('Impuesto')}<br />${_('Renta')}</div>
- <div class="act_as_cell amount">${_('Otras')}<br />${_('Deducc.')}</div>
- <div class="act_as_cell amount">${_('Salario')}<br />${_('Neto')}</div>
- </div>
- </div>
-
- <div class="act_as_tbody">
- %for slip in sorted(payslips.slip_ids, key=lambda slip: slip.employee_id.name):
- <div class="act_as_row lines">
- ## cedula
- <div class="act_as_cell first_column" style="width: 80px;">${slip.employee_id.identification_id or ''}</div>
- ## nombre
- <div class="act_as_cell">${slip.employee_id.name or '0'}</div>
- ## nh
- <div class="act_as_cell amount">${get_hn(slip.worked_days_line_ids) or '0'}</div>
- ## eh
- <div class="act_as_cell amount">${get_he(slip.worked_days_line_ids) or '0'}</div>
- ## ef
- <div class="act_as_cell amount">${get_fe(slip.worked_days_line_ids) or '0'}</div>
- ## basic
- <div class="act_as_cell amount">${formatLang(get_basic(slip.line_ids)) or '0'}</div>
- ## exs
- <div class="act_as_cell amount">${formatLang(get_exs(slip.line_ids)) or '0'}</div>
- ## fes
- <div class="act_as_cell amount">${formatLang(get_fes(slip.line_ids)) or '0'}</div>
- ## otros
- <div class="act_as_cell amount">${ '0'}</div>
- ## gross
- <div class="act_as_cell amount ">${formatLang(get_gross(slip.line_ids)) or '0'}</div>
- ## ccss
- <div class="act_as_cell amount">${formatLang(get_ccss(slip.line_ids)) or '0'}</div>
- ## RENTA
- <div class="act_as_cell amount">${formatLang(get_rent(slip.line_ids)) or '0'}</div>
- ## otros
- <div class="act_as_cell amount">${ '0'}</div>
- ## NETOS
- <div class="act_as_cell amount">${formatLang(get_net(slip.line_ids)) or '0'}</div>
- <%
- total_hn += get_hn(slip.worked_days_line_ids)
- total_he += get_he(slip.worked_days_line_ids)
- total_fe += get_fe(slip.worked_days_line_ids)
- total_basic += get_basic(slip.line_ids)
- total_exs += get_exs(slip.line_ids)
- total_fes += get_fes(slip.line_ids)
- total_gross += get_gross(slip.line_ids)
- total_rent += get_rent(slip.line_ids)
- total_ccss += get_ccss(slip.line_ids)
- total_net += get_net(slip.line_ids)
- total_emp += 1
- %>
- </div>
- %endfor
- </div>
- <div class="act_as_tfoot">
- <div class="act_as_row labels" style="font-weight: bold; font-size: 11x">
- <div class="act_as_cell first_column">${_('Total')}</div>
- <div class="act_as_cell">${total_emp} Empleados</div>
- <div class="act_as_cell amount">${total_hn}</div>
- <div class="act_as_cell amount">${total_he}</div>
- <div class="act_as_cell amount">${total_fe}</div>
- <div class="act_as_cell amount">${formatLang(total_basic)}</div>
- <div class="act_as_cell amount">${formatLang(total_exs)}</div>
- <div class="act_as_cell amount">${formatLang(total_fes)}</div>
- <div class="act_as_cell amount">${_('0')}</div>
- <div class="act_as_cell amount">${formatLang(total_gross)}</div>
- <div class="act_as_cell amount">${formatLang(total_ccss)}</div>
- <div class="act_as_cell amount">${formatLang(total_rent)}</div>
- <div class="act_as_cell amount">${_('0')}</div>
- <div class="act_as_cell amount">${formatLang(total_net)}</div>
- </div>
- </div>
- </div>
-
- <div class="act_as_table data_table" style="margin-top:20px">
- <div class="act_as_tbody">
- <div class="act_as_row" style="vertical-align: bottom">
- <div class="act_as_cell" style="padding-top:80px;padding-bottom:5px">${'HECHO POR:'}</div>
- <div class="act_as_cell" style="padding-top:80px;padding-bottom:5px">${'REVISADO POR:'}</div>
- <div class="act_as_cell" style="padding-top:80px;padding-bottom:5px">${'APROBADO POR:'}</div>
- </div>
- </div>
- </div>
-
-
- <p style="page-break-after:always"></p>
- %endfor
-
-</body>
-</html>
=== removed file 'cr_hr_report/report/payment_receipt.py'
--- cr_hr_report/report/payment_receipt.py 2012-05-18 00:35:46 +0000
+++ cr_hr_report/report/payment_receipt.py 1970-01-01 00:00:00 +0000
@@ -1,200 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-#
-# payment_receipt
-# First author: Mag Guevara <mag.guevara@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
-##############################################################################
-
-import time
-import pooler
-from report import report_sxw
-from amount_to_text import number_to_text_es
-import locale
-
-class hr_payslip_run_report(report_sxw.rml_parse):
- def __init__(self, cr, uid, name, context):
- super(hr_payslip_run_report, self).__init__(cr, uid, name, context=context)
- self.localcontext.update({
- 'time': time,
- 'cr' : cr,
- 'uid': uid,
- 'get_text':self.get_text,
- 'get_hn':self.get_hn,
- 'get_he':self.get_he,
- 'get_fe':self.get_fe,
- 'get_basic':self.get_basic,
- 'get_exs':self.get_exs,
- 'get_fes':self.get_fes,
- 'get_gross':self.get_gross,
- 'get_ccss':self.get_ccss,
- 'get_net':self.get_net,
- 'get_rent':self.get_rent,
- })
-
- def get_prefix(self,currency,company_id):
- separator = ','
- decimal_point = '.'
- res = ''
- name_currency = currency.currency_name
- if name_currency == False:
- name_currency = company_id.currency_id.currency_name
- res = company_id.currency_id.symbol_prefix
- if name_currency == None:
- name_currency = company_id.currency_id.currency_name
- res = company_id.currency_id.symbol_prefix
-
-
- return res
-
- def get_hn(self,line_ids):
- code = 'HN'
- res = 0
- for line in line_ids:
- if line.code == code:
- res += line.number_of_hours
-
- return res
-
- def get_he(self,line_ids):
- code = 'HE'
- res = 0
- for line in line_ids:
- if line.code == code:
- res += line.number_of_hours
-
- return res
-
-
- def get_fe(self,line_ids):
- code = 'FE'
- res = 0
- for line in line_ids:
- if line.code == code:
- res += line.number_of_hours
-
- return res
-
- def get_basic(self,line_ids):
- code = 'BASIC'
- res = 0
- for line in line_ids:
- if line.code == code:
- res += line.total
-
- return res
-
- def get_exs(self,line_ids):
- code = 'EXS'
- res = 0
- for line in line_ids:
- if line.code == code:
- res += line.total
-
-
- return res
-
-
- def get_fes(self,line_ids):
- code = 'FES'
- res = 0
- for line in line_ids:
- if line.code == code:
- res += line.total
-
-
- return res
-
-
- def get_gross(self,line_ids):
- code = 'GROSS'
- res = 0
- for line in line_ids:
- if line.code == code:
- res += line.total
-
-
- return res
-
- def get_ccss(self,line_ids):
- code = 'CCSS-EMP'
- code2 = 'Banco Popular-EMP'
- res = 0
- for line in line_ids:
- if line.code == code:
- res += line.total
- elif line.code == code2:
- res += line.total
-
- return res
-
-
- def get_net(self,line_ids):
- code = 'NET'
- res = 0
- for line in line_ids:
- if line.code == code:
- res += line.total
-
-
- return round(res)
-
-
- def get_rent(self,line_ids):
- code = 'Renta'
- res = 0
- for line in line_ids:
- if line.code == code:
- res += line.total
-
-
- return res
-
- def get_text(self,amount,currency,lang,company_id):
- separator = ','
- decimal_point = '.'
- name_currency = currency.currency_name
- if name_currency == False:
- name_currency = company_id.currency_id.currency_name
- if name_currency == None:
- name_currency = company_id.currency_id.currency_name
- if lang:
- lang_pool = self.pool.get('res.lang')
- id_lang = lang_pool.search(self.cr,self.uid,[('code','=',lang)])
- obj_lang = lang_pool.browse(self.cr,self.uid,id_lang)[0]
- separator = obj_lang and obj_lang.thousands_sep or separator
- decimal_point = obj_lang and obj_lang.decimal_point or decimal_point
- res = number_to_text_es(amount,name_currency,separator=separator,decimal_point=decimal_point)
- return res
-
-report_sxw.report_sxw(
- 'report.hr.payslip.run.layout_ccorp',
- 'hr.payslip.run',
- 'addons/cr_hr_report/report/payment_receipt.mako',
- parser=hr_payslip_run_report)
=== added file 'cr_hr_report/report/payroll_report.mako'
--- cr_hr_report/report/payroll_report.mako 1970-01-01 00:00:00 +0000
+++ cr_hr_report/report/payroll_report.mako 2012-05-23 15:38:20 +0000
@@ -0,0 +1,202 @@
+<html>
+ <head>
+ <style type="text/css">
+ ${css}
+
+ .list_table .act_as_row {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ font-size:10px;
+ }
+
+ .account_line {
+ font-weight: bold;
+ font-size: 15px;
+ background-color:#F0F0F0;
+ }
+
+ .account_line .act_as_cell {
+ height: 30px;
+ vertical-align: bottom;
+ }
+
+ </style>
+ </head>
+<body class = "data">
+ %for run in objects :
+ <%
+ emp_by_dep = get_obj_by_dep(run)
+ %>
+ <%
+ total_hn = 0.0
+ total_he = 0.0
+ total_fe = 0.0
+ total_basic = 0.0
+ total_exs = 0.0
+ total_fes = 0.0
+ total_gross = 0.0
+ total_basic = 0.0
+ total_rent = 0.0
+ total_ccss = 0.0
+ total_net = 0.0
+ total_emp = 0
+ %>
+ <div style="font-size: 20px; font-weight: bold; text-align: center;"> ${company.partner_id.name | entity} - ${company.currency_id.name | entity}</div>
+ <div style="font-size: 25px; font-weight: bold; text-align: center;"> Reporte de Planilla</div>
+ <div style="font-size: 20px; font-weight: bold; text-align: center;"> ${run.name}</div>
+ <div style="font-size: 16px; font-weight: bold; text-align: center;">Periodo de ${run.date_start} a ${run.date_end}</div>
+ </br></br>
+ %for department in emp_by_dep:
+ <%
+ total_hn_dep = 0.0
+ total_he_dep = 0.0
+ total_fe_dep = 0.0
+ total_basic_dep = 0.0
+ total_exs_dep = 0.0
+ total_fes_dep = 0.0
+ total_gross_dep = 0.0
+ total_basic_dep = 0.0
+ total_rent_dep = 0.0
+ total_ccss_dep = 0.0
+ total_net_dep = 0.0
+ total_emp_dep = 0
+ %>
+ <div class="account_title bg" style="margin-top: 20px; font-size: 12px; width: 1080px;">${department[0]}</div>
+ <div class="act_as_table list_table">
+ <div class="act_as_thead">
+ <div class="act_as_row labels" style="font-weight: bold; font-size: 11x;">
+ <div class="act_as_cell first_column" style="width: 85px; vertical-align: middle">${_('Cedula')}</div>
+ <div class="act_as_cell" style="width: 250px; vertical-align: middle">${_('Nombre')}</div>
+ <div class="act_as_cell amount" style="width: 40px;">${_('Hrs.')}<br />${_('Nor')}</div>
+ <div class="act_as_cell amount" style="width: 40px;">${_('Hrs.')}<br />${_('Ext')}</div>
+ <div class="act_as_cell amount" style="width: 40px;">${_('Hrs.')}<br />${_('Dob')}</div>
+ <div class="act_as_cell amount">${_('Ingr.')}<br />${_('Normal')}</div>
+ <div class="act_as_cell amount">${_('Ingr.')}<br />${_('Extra')}</div>
+ <div class="act_as_cell amount">${_('Ingr.')}<br />${_('Doble')}</div>
+ <div class="act_as_cell amount">${_('Otros')}<br />${_('Ingr.')}</div>
+ <div class="act_as_cell amount">${_('Salario')}<br />${_('Bruto')}</div>
+ <div class="act_as_cell amount">${_('Deducc.')}<br />${_('CCSS/BP')}</div>
+ <div class="act_as_cell amount">${_('Impuesto')}<br />${_('Renta')}</div>
+ <div class="act_as_cell amount">${_('Otras')}<br />${_('Deducc.')}</div>
+ <div class="act_as_cell amount">${_('Salario')}<br />${_('Neto')}</div>
+ </div>
+ </div>
+
+ <div class="act_as_tbody">
+ %for slip in sorted(department[1], key=lambda slip: slip.employee_id.name):
+ <div class="act_as_row lines">
+ ## cedula
+ <div class="act_as_cell first_column" style="width: 80px;">${slip.employee_id.identification_id or ''}</div>
+ ## nombre
+ <div class="act_as_cell">${slip.employee_id.name or '0'}</div>
+ ## nh
+ <div class="act_as_cell amount">${get_hn(slip.worked_days_line_ids) or '0'}</div>
+ ## eh
+ <div class="act_as_cell amount">${get_he(slip.worked_days_line_ids) or '0'}</div>
+ ## ef
+ <div class="act_as_cell amount">${get_fe(slip.worked_days_line_ids) or '0'}</div>
+ ## basic
+ <div class="act_as_cell amount">${formatLang(get_basic(slip.line_ids)) or '0'}</div>
+ ## exs
+ <div class="act_as_cell amount">${formatLang(get_exs(slip.line_ids)) or '0'}</div>
+ ## fes
+ <div class="act_as_cell amount">${formatLang(get_fes(slip.line_ids)) or '0'}</div>
+ ## otros
+ <div class="act_as_cell amount">${ '0'}</div>
+ ## gross
+ <div class="act_as_cell amount ">${formatLang(get_gross(slip.line_ids)) or '0'}</div>
+ ## ccss
+ <div class="act_as_cell amount">${formatLang(get_ccss(slip.line_ids)) or '0'}</div>
+ ## RENTA
+ <div class="act_as_cell amount">${formatLang(get_rent(slip.line_ids)) or '0'}</div>
+ ## otros
+ <div class="act_as_cell amount">${ '0'}</div>
+ ## NETOS
+ <div class="act_as_cell amount">${formatLang(get_net(slip.line_ids)) or '0'}</div>
+ <%
+ ## Totales por Departamento
+ total_hn_dep += get_hn(slip.worked_days_line_ids)
+ total_he_dep += get_he(slip.worked_days_line_ids)
+ total_fe_dep += get_fe(slip.worked_days_line_ids)
+ total_basic_dep += get_basic(slip.line_ids)
+ total_exs_dep += get_exs(slip.line_ids)
+ total_fes_dep += get_fes(slip.line_ids)
+ total_gross_dep += get_gross(slip.line_ids)
+ total_rent_dep += get_rent(slip.line_ids)
+ total_ccss_dep += get_ccss(slip.line_ids)
+ total_net_dep += get_net(slip.line_ids)
+ total_emp_dep += 1
+
+ ## Totales Generales
+ total_hn += get_hn(slip.worked_days_line_ids)
+ total_he += get_he(slip.worked_days_line_ids)
+ total_fe += get_fe(slip.worked_days_line_ids)
+ total_basic += get_basic(slip.line_ids)
+ total_exs += get_exs(slip.line_ids)
+ total_fes += get_fes(slip.line_ids)
+ total_gross += get_gross(slip.line_ids)
+ total_rent += get_rent(slip.line_ids)
+ total_ccss += get_ccss(slip.line_ids)
+ total_net += get_net(slip.line_ids)
+ total_emp += 1
+ %>
+ </div>
+ %endfor
+ </div>
+ <div class="act_as_tfoot">
+ <div class="act_as_row labels" style="font-weight: bold; font-size: 11x">
+ <div class="act_as_cell first_column">${_('Total')}</div>
+ <div class="act_as_cell">${total_emp_dep} Empleados</div>
+ <div class="act_as_cell amount">${total_hn_dep}</div>
+ <div class="act_as_cell amount">${total_he_dep}</div>
+ <div class="act_as_cell amount">${total_fe_dep}</div>
+ <div class="act_as_cell amount">${formatLang(total_basic_dep)}</div>
+ <div class="act_as_cell amount">${formatLang(total_exs_dep)}</div>
+ <div class="act_as_cell amount">${formatLang(total_fes_dep)}</div>
+ <div class="act_as_cell amount">${_('0')}</div>
+ <div class="act_as_cell amount">${formatLang(total_gross_dep)}</div>
+ <div class="act_as_cell amount">${formatLang(total_ccss_dep)}</div>
+ <div class="act_as_cell amount">${formatLang(total_rent_dep)}</div>
+ <div class="act_as_cell amount">${_('0')}</div>
+ <div class="act_as_cell amount">${formatLang(total_net_dep)}</div>
+ </div>
+ </div>
+ </div>
+
+
+ %endfor
+ <div class="act_as_table list_table " style="margin-top: 20px;">
+ <div class="act_as_tfoot">
+ <div class="act_as_row labels" style="font-weight: bold; font-size: 11px;">
+ <div class="act_as_cell first_column" style="width: 85px; font-size: 12px; text-align: left">${_('TOTAL GENERAL')}</div>
+ <div class="act_as_cell" style="width: 250px;">${total_emp} Empleados</div>
+ <div class="act_as_cell amount" style="width: 40px;">${total_hn}</div>
+ <div class="act_as_cell amount" style="width: 40px;">${total_he}</div>
+ <div class="act_as_cell amount" style="width: 40px;">${total_fe}</div>
+ <div class="act_as_cell amount">${formatLang(total_basic)}</div>
+ <div class="act_as_cell amount">${formatLang(total_exs)}</div>
+ <div class="act_as_cell amount">${formatLang(total_fes)}</div>
+ <div class="act_as_cell amount">${_('0')}</div>
+ <div class="act_as_cell amount">${formatLang(total_gross)}</div>
+ <div class="act_as_cell amount">${formatLang(total_ccss)}</div>
+ <div class="act_as_cell amount">${formatLang(total_rent)}</div>
+ <div class="act_as_cell amount">${_('0')}</div>
+ <div class="act_as_cell amount">${formatLang(total_net)}</div>
+ </div>
+ </div>
+ </div>
+ %endfor
+ <div class="act_as_table data_table" style="margin-top:30px">
+ <div class="act_as_tbody">
+ <div class="act_as_row" style="vertical-align: bottom">
+ <div class="act_as_cell" style="padding-top:80px;padding-bottom:5px">${'HECHO POR:'}</div>
+ <div class="act_as_cell" style="padding-top:80px;padding-bottom:5px">${'REVISADO POR:'}</div>
+ <div class="act_as_cell" style="padding-top:80px;padding-bottom:5px">${'APROBADO POR:'}</div>
+ </div>
+ </div>
+ </div>
+ <p style="page-break-after:always"></p>
+
+
+</body>
+</html>
=== added file 'cr_hr_report/report/payroll_report.py'
--- cr_hr_report/report/payroll_report.py 1970-01-01 00:00:00 +0000
+++ cr_hr_report/report/payroll_report.py 2012-05-23 15:38:20 +0000
@@ -0,0 +1,228 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#
+# payment_receipt
+# First author: Mag Guevara <mag.guevara@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
+# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification, are
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this list of
+# conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice, this list
+# of conditions and the following disclaimer in the documentation and/or other materials
+# provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# The views and conclusions contained in the software and documentation are those of the
+# authors and should not be interpreted as representing official policies, either expressed
+# or implied, of ClearCorp S.A..
+#
+##############################################################################
+
+import time
+import pooler
+from report import report_sxw
+from amount_to_text import number_to_text_es
+import locale
+
+class hr_payslip_run_report(report_sxw.rml_parse):
+ def __init__(self, cr, uid, name, context):
+ super(hr_payslip_run_report, self).__init__(cr, uid, name, context=context)
+ self.localcontext.update({
+ 'time': time,
+ 'cr' : cr,
+ 'uid': uid,
+ 'get_text':self.get_text,
+ 'get_hn':self.get_hn,
+ 'get_he':self.get_he,
+ 'get_fe':self.get_fe,
+ 'get_basic':self.get_basic,
+ 'get_exs':self.get_exs,
+ 'get_fes':self.get_fes,
+ 'get_gross':self.get_gross,
+ 'get_ccss':self.get_ccss,
+ 'get_net':self.get_net,
+ 'get_rent':self.get_rent,
+ 'get_obj_by_dep':self.get_obj_by_dep,
+ })
+
+ def get_prefix(self,currency,company_id):
+ separator = ','
+ decimal_point = '.'
+ res = ''
+ name_currency = currency.currency_name
+ if name_currency == False:
+ name_currency = company_id.currency_id.currency_name
+ res = company_id.currency_id.symbol_prefix
+ if name_currency == None:
+ name_currency = company_id.currency_id.currency_name
+ res = company_id.currency_id.symbol_prefix
+
+
+ return res
+
+ def get_hn(self,line_ids):
+ code = 'HN'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.number_of_hours
+
+ return res
+
+ def get_he(self,line_ids):
+ code = 'HE'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.number_of_hours
+
+ return res
+
+
+ def get_fe(self,line_ids):
+ code = 'FE'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.number_of_hours
+
+ return res
+
+ def get_basic(self,line_ids):
+ code = 'BASIC'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.total
+
+ return res
+
+ def get_exs(self,line_ids):
+ code = 'EXS'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.total
+
+
+ return res
+
+
+ def get_fes(self,line_ids):
+ code = 'FES'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.total
+
+
+ return res
+
+
+ def get_gross(self,line_ids):
+ code = 'GROSS'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.total
+
+
+ return res
+
+ def get_ccss(self,line_ids):
+ code = 'CCSS-EMP'
+ code2 = 'Banco Popular-EMP'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.total
+ elif line.code == code2:
+ res += line.total
+
+ return res
+
+
+ def get_net(self,line_ids):
+ code = 'NET'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.total
+
+
+ return res
+
+
+ def get_rent(self,line_ids):
+ code = 'Renta'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.total
+
+
+ return res
+
+
+ def get_obj_by_dep(self,run):
+ obj_by_dep = []
+ dep_list = []
+ emp_by_dep = []
+
+ for payslip in run.slip_ids:
+ dep_name = payslip.employee_id.department_id.name
+ if dep_name not in dep_list:
+ dep_list.append(dep_name)
+
+ for dep in dep_list:
+ dep_emp = []
+ for payslip in run.slip_ids:
+ if payslip.employee_id.department_id.name == dep:
+ dep_emp.append(payslip)
+ obj_by_dep.append(dep_emp)
+
+ i = 0
+ for dep in dep_list:
+ tup_temp = (dep, obj_by_dep[i])
+ emp_by_dep.append(tup_temp)
+ i += 1
+
+
+ return emp_by_dep
+
+ def get_text(self,amount,currency,lang,company_id):
+ separator = ','
+ decimal_point = '.'
+ name_currency = currency.currency_name
+ if name_currency == False:
+ name_currency = company_id.currency_id.currency_name
+ if name_currency == None:
+ name_currency = company_id.currency_id.currency_name
+ if lang:
+ lang_pool = self.pool.get('res.lang')
+ id_lang = lang_pool.search(self.cr,self.uid,[('code','=',lang)])
+ obj_lang = lang_pool.browse(self.cr,self.uid,id_lang)[0]
+ separator = obj_lang and obj_lang.thousands_sep or separator
+ decimal_point = obj_lang and obj_lang.decimal_point or decimal_point
+ res = number_to_text_es(amount,name_currency,separator=separator,decimal_point=decimal_point)
+ return res
+
+report_sxw.report_sxw(
+ 'report.hr.payslip.run.layout_ccorp',
+ 'hr.payslip.run',
+ 'addons/cr_hr_report/report/payroll_report.mako',
+ parser=hr_payslip_run_report)
=== modified file 'l10n_cr_hr_payroll/__init__.py'
--- l10n_cr_hr_payroll/__init__.py 2012-04-26 21:16:29 +0000
+++ l10n_cr_hr_payroll/__init__.py 2012-05-23 15:38:20 +0000
@@ -21,5 +21,6 @@
##############################################################################
import l10n_cr_hr_payroll
+import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'l10n_cr_hr_payroll/__openerp__.py'
--- l10n_cr_hr_payroll/__openerp__.py 2012-05-18 00:35:46 +0000
+++ l10n_cr_hr_payroll/__openerp__.py 2012-05-23 15:38:20 +0000
@@ -30,15 +30,21 @@
=======================
* Employee Contracts
* Fortnightly Payroll Register
+ * Payroll Report
""",
- 'author':'Ronald Rubi',
+ 'author':'Ronald Rubi', 'Armando Soto'
'website':'http://www.clearcorp.co.cr',
'depends': [
'hr',
'hr_contract',
'hr_payroll',
+ 'account',
+ 'account_voucher_payment_method',
+ 'base_currency_symbol',
+ 'report_webkit',
],
'update_xml': [
+ 'payroll_report.xml',
],
'installable': True,
'auto_install': False,
=== added file 'l10n_cr_hr_payroll/data.xml'
--- l10n_cr_hr_payroll/data.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_payroll/data.xml 2012-05-23 15:38:20 +0000
@@ -0,0 +1,218 @@
+<?xml version="1.0" ?>
+ <openerp>
+ <data noupdate="1">
+ <record id="ir_header_webkit_base_check" model="ir.header_webkit">
+ <field eval=""""Portrait"""" name="orientation"/>
+ <field eval=""""Letter"""" name="format"/>
+ <field name="html"><![CDATA[<html>
+ <head>
+ <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
+ <script>
+ function subst() {
+ var vars={};
+ var x=document.location.search.substring(1).split('&');
+ for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
+ var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
+ for(var i in x) {
+ var y = document.getElementsByClassName(x[i]);
+ for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
+ }
+ }
+ </script>
+ <style type="text/css">
+ ${css}
+ </style>
+ </head>
+ <body class = "header" onload="subst()">
+ <table class="header-table" cellspacing = "3">
+ <tbody>
+ <tr>
+ <td>
+ <div id="header_logo">${helper.embed_logo_by_name('company_logo')|n}</div>
+ </td>
+ <td>
+ <table class="company_data">
+ <tr class = "title">
+ <td>${company.partner_id.name |entity}</td>
+ <td style = "text-align : right;" rowspan = "6">${_("MONEY RECEIPT")}</td>
+ </tr>
+ <tr>
+ <td>${company.partner_id.address[0].street or ''|entity}, ${company.partner_id.address[0].street2 or ''|entity}</td>
+ <td style = "text-align : right;"></td>
+ </tr>
+ <tr>
+ <td>${_("Tel. PBX")}: ${company.partner_id.address[0].phone or '-'|entity} - ${_("FAX")}: ${company.partner_id.address[0].fax or '-'|entity}</td>
+ <td style = "text-align : right;"> </td>
+ </tr>
+ <tr>
+ <td>${company.partner_id.address[0].zip or ''|entity} ${company.partner_id.address[0].city or ''|entity}, ${company.partner_id.address[0].country_id and company.partner_id.address[0].country_id.name or ''|entity}</td>
+ <td style = "text-align : right;"> </td>
+ </tr>
+ <tr>
+ <td>${_("CED. JUR")}: ${company.partner_id.ref or '-'|entity}</td>
+ <td style = "text-align : right;"> </td>
+ </tr>
+ <tr>
+ <td>${_("Web")}: ${company.partner_id.website or '-'|entity}</td>
+ <td style = "text-align : right;"> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <hr/>
+ ${_debug or ''|n} </body>
+</html>]]>
+ </field>
+ <field eval="95.0" name="margin_top"/>
+ <field eval="14.0" name="margin_left"/>
+ <field eval="14.0" name="margin_right"/>
+ <field name="css" ><![CDATA[
+ /*HEADER*/
+.header {
+ padding : 100px 10px 5px 10px;
+ border:0; margin: 0;
+}
+.header-table {
+ width: 100%;
+ margin-top: 8%;
+}
+
+.title {
+ font-size:16;
+ font-weight: bold;
+}
+
+.company_address{
+ width : 100%;
+ text-align: right;
+ font-family: Arial,Verdana, Sans, Serif;
+ font-size: 13;
+}
+
+.company_data {
+ width : 100%;
+ text-align: center;
+ font-family: Arial,Verdana, Sans, Serif;
+ font-size: 13;
+}
+
+.header_logo{
+ width : 150px;
+}
+
+/*BODY*/
+
+
+
+#document_data{
+ margin-bottom : 50px;
+ width : 100%;
+}
+
+#number{
+ text-align : left;
+ color : red;
+ font-size : 0.9em;
+ float : left;
+}
+
+#date {
+ margin : 20px 0px 5px 400px;
+}
+
+.detail {
+ margin-top : 10px;
+ width : 100%;
+}
+
+.text_font{
+ font-family : courier, arial, sans, serif;
+ font-size : 14px;
+ font-style : bold;
+ margin-left : 15px
+}
+
+.detail_line{
+ width : 100%;
+ float : left;
+}
+.amount_text{
+ font-family : courier, arial, sans, serif;
+ font-size : 16px;
+ font-style : italic;
+ margin : 5px;
+ width : 100%;
+ font-style : bold;
+}
+
+.info{
+ padding-top : 35px;
+}
+
+.info_detail{
+ font-family : courier, arial, sans, serif;
+ font-size : 9px;
+ font-style : italic;
+}
+
+.signature {
+ text-align : center;
+ background-color : #BFBFBF;
+ border: 1px solid black;
+ -webkit-border-radius: 10px;
+}
+.sign_detail {
+ margin-bottom : 40px;
+}
+
+.payment_method{
+ width : 50%;
+ float :left;
+ margin-left : 30px;
+}
+
+#val_first{
+ width : 100%;
+ margin-top : 20px;
+ margin-bottom : 20px;
+}
+
+#val_second{
+ width : 100%;
+}
+
+.line{
+ width : 30%;
+ float :left;
+ margin-left : 10px;
+}
+
+#validation {
+ border-collapse:separate;
+ border-spacing: 20px;
+ margin-top : 30px;
+}
+
+#wrapper{
+ margin-top : 30px;
+}
+
+.text_doct{
+ font-family : arial, sans, serif;
+ font-size : 16px;
+ font-weight : bolder;
+}
+
+.sign_line{
+ margin-top : 50px;
+ border-top: 1px solid black;
+ width : 100%;
+ height : 1px;
+}
+]]>
+ </field>
+ </record>
+ </data>
+</openerp>
=== added file 'l10n_cr_hr_payroll/payroll_report.xml'
--- l10n_cr_hr_payroll/payroll_report.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_payroll/payroll_report.xml 2012-05-23 15:38:20 +0000
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<openerp>
+ <data>
+ <report auto="False" id="hr_payslip_run_ccorp" model="hr.payslip.run"
+ name="hr.payslip.run.layout_ccorp" file="l10n_cr_hr_payroll/report/payroll_report.mako" string="Reporte de Planilla" report_type="webkit"/>
+ </data>
+</openerp>
=== added directory 'l10n_cr_hr_payroll/report'
=== added file 'l10n_cr_hr_payroll/report/__init__.py'
--- l10n_cr_hr_payroll/report/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_payroll/report/__init__.py 2012-05-23 15:38:20 +0000
@@ -0,0 +1,35 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# __init__.py
+# payroll_report
+# First author: Carlos Vásquez <carlos.vasquez@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
+# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification, are
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this list of
+# conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice, this list
+# of conditions and the following disclaimer in the documentation and/or other materials
+# provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# The views and conclusions contained in the software and documentation are those of the
+# authors and should not be interpreted as representing official policies, either expressed
+# or implied, of ClearCorp S.A..
+#
+##############################################################################
+
+import payroll_report
=== added file 'l10n_cr_hr_payroll/report/amount_to_text.py'
--- l10n_cr_hr_payroll/report/amount_to_text.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_payroll/report/amount_to_text.py 2012-05-23 15:38:20 +0000
@@ -0,0 +1,127 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+#from tools import #debug
+UNIDADES = (
+ '',
+ 'UN ',
+ 'DOS ',
+ 'TRES ',
+ 'CUATRO ',
+ 'CINCO ',
+ 'SEIS ',
+ 'SIETE ',
+ 'OCHO ',
+ 'NUEVE ',
+ 'DIEZ ',
+ 'ONCE ',
+ 'DOCE ',
+ 'TRECE ',
+ 'CATORCE ',
+ 'QUINCE ',
+ 'DIECISEIS ',
+ 'DIECISIETE ',
+ 'DIECIOCHO ',
+ 'DIECINUEVE ',
+ 'VEINTE '
+)
+DECENAS = (
+ 'VENTI',
+ 'TREINTA ',
+ 'CUARENTA ',
+ 'CINCUENTA ',
+ 'SESENTA ',
+ 'SETENTA ',
+ 'OCHENTA ',
+ 'NOVENTA ',
+ 'CIEN '
+)
+CENTENAS = (
+ 'CIENTO ',
+ 'DOSCIENTOS ',
+ 'TRESCIENTOS ',
+ 'CUATROCIENTOS ',
+ 'QUINIENTOS ',
+ 'SEISCIENTOS ',
+ 'SETECIENTOS ',
+ 'OCHOCIENTOS ',
+ 'NOVECIENTOS '
+)
+
+def number_to_text_es(number_in,currency,join_dec=' Y ',separator=',',decimal_point='.'):
+
+ converted = ''
+ if currency == False:
+ currency = ''
+
+ if type(number_in) != 'str':
+ number = str(number_in)
+ else:
+ number = number_in
+
+ number_str=number
+ #if we are using the coma as separator we need to remove them from the string
+ try:
+ number_str = number_str.replace(separator,'')
+ except ValueError:
+ print 'The separator used for the thousands its not supported'
+
+ #debug(number_str)
+
+ try:
+ number_int, number_dec = number_str.split(decimal_point)
+ except ValueError:
+ number_int = number_str
+ number_dec = ""
+
+ number_str = number_int.zfill(9)
+ millones = number_str[:3]
+ miles = number_str[3:6]
+ cientos = number_str[6:]
+
+ if(millones):
+ if(millones == '001'):
+ converted += 'UN MILLON '
+ elif(int(millones) > 0):
+ converted += '%sMILLONES ' % __convertNumber(millones)
+
+ if(miles):
+ if(miles == '001'):
+ converted += 'MIL '
+ elif(int(miles) > 0):
+ converted += '%sMIL ' % __convertNumber(miles)
+ if(cientos):
+ if(cientos == '001'):
+ converted += 'UN '
+ elif(int(cientos) > 0):
+ converted += '%s ' % __convertNumber(cientos)
+
+ if number_dec == "":
+ number_dec = "00"
+ if (len(number_dec) < 2 ):
+ number_dec+='0'
+
+ has_decimal = float(number_dec) != 0 and join_dec + number_dec + "/100" or ' EXACTOS'
+ converted += currency + has_decimal
+
+
+ return converted
+
+def __convertNumber(n):
+ output = ''
+
+ if(n == '100'):
+ output = "CIEN "
+ elif(n[0] != '0'):
+ output = CENTENAS[int(n[0])-1]
+
+ k = int(n[1:])
+ if(k <= 20):
+ output += UNIDADES[k]
+ else:
+ if((k > 30) & (n[2] != '0')):
+ output += '%sY %s' % (DECENAS[int(n[1])-2], UNIDADES[int(n[2])])
+ else:
+ output += '%s%s' % (DECENAS[int(n[1])-2], UNIDADES[int(n[2])])
+
+ return output
=== added file 'l10n_cr_hr_payroll/report/header.html'
--- l10n_cr_hr_payroll/report/header.html 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_payroll/report/header.html 2012-05-23 15:38:20 +0000
@@ -0,0 +1,88 @@
+<html>
+ <head>
+ <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
+ <script>
+ function subst() {
+ var vars={};
+ var x=document.location.search.substring(1).split('&');
+ for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
+ var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
+ for(var i in x) {
+ var y = document.getElementsByClassName(x[i]);
+ for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
+ }
+ }
+ </script>
+ <style type="text/css">
+ ${css}
+ </style>
+ </head>
+ <body class = "header" onload="subst()">
+ <table class="header-table" cellspacing = "3">
+ <tbody>
+ <tr>
+ <td>
+ ${helper.embed_logo_by_name('company_logo')|n}
+ </td>
+ <td>
+ <table class="company_data">
+ <tr class = "title">
+ <td>${company.partner_id.name |entity}</td>
+ <td style = "text-align : right;" rowspan = "6">${_("MONEY RECEIPT")}</td>
+ </tr>
+ <tr>
+ <td>${company.partner_id.address[0].street or ''|entity}, ${company.partner_id.address[0].street2 or ''|entity}</td>
+ <td style = "text-align : right;"></td>
+ </tr>
+ <tr>
+ <td>${_("Tel. PBX")}: ${company.partner_id.address[0].phone or '-'|entity} - ${_("FAX")}: ${company.partner_id.address[0].fax or '-'|entity}</td>
+ <td style = "text-align : right;"> </td>
+ </tr>
+ <tr>
+ <td>${company.partner_id.address[0].zip or ''|entity} ${company.partner_id.address[0].city or ''|entity}, ${company.partner_id.address[0].country_id and company.partner_id.address[0].country_id.name or ''|entity}</td>
+ <td style = "text-align : right;"> </td>
+ </tr>
+ <tr>
+ <td>${_("CED. JUR")}: ${company.partner_id.ref or '-'|entity}</td>
+ <td style = "text-align : right;"> </td>
+ </tr>
+ <tr>
+ <td>${_("Web")}: ${company.partner_id.website or '-'|entity}</td>
+ <td style = "text-align : right;"> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <hr/>
+ ${_debug or ''|n} </body>
+</html>
+
+<html>
+ <head>
+ <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
+ <script>
+ function subst() {
+ var vars={};
+ var x=document.location.search.substring(1).split('&');
+ for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
+ var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
+ for(var i in x) {
+ var y = document.getElementsByClassName(x[i]);
+ for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
+ }
+ }
+ </script>
+ <style type="text/css">
+ ${css}
+ </style>
+ </head>
+ <body class = "footer" onload="subst()">
+ <table class = "footer_table">
+ <tr><td><p class ="company_footer">${company.webkit_footer1 or ' '}</p></td></tr>
+ <tr><td><p class ="company_footer">${company.webkit_footer2 or ' '}</p></td></tr>
+ <tr><td><p class ="company_footer">${company.webkit_footer3 or ' '}</p></td></tr>
+ </table>
+ </body>
+</html>
=== added file 'l10n_cr_hr_payroll/report/payroll_report.mako'
--- l10n_cr_hr_payroll/report/payroll_report.mako 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_payroll/report/payroll_report.mako 2012-05-23 15:38:20 +0000
@@ -0,0 +1,202 @@
+<html>
+ <head>
+ <style type="text/css">
+ ${css}
+
+ .list_table .act_as_row {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ font-size:10px;
+ }
+
+ .account_line {
+ font-weight: bold;
+ font-size: 15px;
+ background-color:#F0F0F0;
+ }
+
+ .account_line .act_as_cell {
+ height: 30px;
+ vertical-align: bottom;
+ }
+
+ </style>
+ </head>
+<body class = "data">
+ %for run in objects :
+ <%
+ emp_by_dep = get_obj_by_dep(run)
+ %>
+ <%
+ total_hn = 0.0
+ total_he = 0.0
+ total_fe = 0.0
+ total_basic = 0.0
+ total_exs = 0.0
+ total_fes = 0.0
+ total_gross = 0.0
+ total_basic = 0.0
+ total_rent = 0.0
+ total_ccss = 0.0
+ total_net = 0.0
+ total_emp = 0
+ %>
+ <div style="font-size: 20px; font-weight: bold; text-align: center;"> ${company.partner_id.name | entity} - ${company.currency_id.name | entity}</div>
+ <div style="font-size: 25px; font-weight: bold; text-align: center;"> Reporte de Planilla</div>
+ <div style="font-size: 20px; font-weight: bold; text-align: center;"> ${run.name}</div>
+ <div style="font-size: 16px; font-weight: bold; text-align: center;">Periodo de ${run.date_start} a ${run.date_end}</div>
+ </br></br>
+ %for department in emp_by_dep:
+ <%
+ total_hn_dep = 0.0
+ total_he_dep = 0.0
+ total_fe_dep = 0.0
+ total_basic_dep = 0.0
+ total_exs_dep = 0.0
+ total_fes_dep = 0.0
+ total_gross_dep = 0.0
+ total_basic_dep = 0.0
+ total_rent_dep = 0.0
+ total_ccss_dep = 0.0
+ total_net_dep = 0.0
+ total_emp_dep = 0
+ %>
+ <div class="account_title bg" style="margin-top: 20px; font-size: 12px; width: 1080px;">${department[0]}</div>
+ <div class="act_as_table list_table">
+ <div class="act_as_thead">
+ <div class="act_as_row labels" style="font-weight: bold; font-size: 11x;">
+ <div class="act_as_cell first_column" style="width: 85px; vertical-align: middle">${_('Cedula')}</div>
+ <div class="act_as_cell" style="width: 250px; vertical-align: middle">${_('Nombre')}</div>
+ <div class="act_as_cell amount" style="width: 40px;">${_('Hrs.')}<br />${_('Nor')}</div>
+ <div class="act_as_cell amount" style="width: 40px;">${_('Hrs.')}<br />${_('Ext')}</div>
+ <div class="act_as_cell amount" style="width: 40px;">${_('Hrs.')}<br />${_('Dob')}</div>
+ <div class="act_as_cell amount">${_('Ingr.')}<br />${_('Normal')}</div>
+ <div class="act_as_cell amount">${_('Ingr.')}<br />${_('Extra')}</div>
+ <div class="act_as_cell amount">${_('Ingr.')}<br />${_('Doble')}</div>
+ <div class="act_as_cell amount">${_('Otros')}<br />${_('Ingr.')}</div>
+ <div class="act_as_cell amount">${_('Salario')}<br />${_('Bruto')}</div>
+ <div class="act_as_cell amount">${_('Deducc.')}<br />${_('CCSS/BP')}</div>
+ <div class="act_as_cell amount">${_('Impuesto')}<br />${_('Renta')}</div>
+ <div class="act_as_cell amount">${_('Otras')}<br />${_('Deducc.')}</div>
+ <div class="act_as_cell amount">${_('Salario')}<br />${_('Neto')}</div>
+ </div>
+ </div>
+
+ <div class="act_as_tbody">
+ %for slip in sorted(department[1], key=lambda slip: slip.employee_id.name):
+ <div class="act_as_row lines">
+ ## cedula
+ <div class="act_as_cell first_column" style="width: 80px;">${slip.employee_id.identification_id or ''}</div>
+ ## nombre
+ <div class="act_as_cell">${slip.employee_id.name or '0'}</div>
+ ## nh
+ <div class="act_as_cell amount">${get_hn(slip.worked_days_line_ids) or '0'}</div>
+ ## eh
+ <div class="act_as_cell amount">${get_he(slip.worked_days_line_ids) or '0'}</div>
+ ## ef
+ <div class="act_as_cell amount">${get_fe(slip.worked_days_line_ids) or '0'}</div>
+ ## basic
+ <div class="act_as_cell amount">${formatLang(get_basic(slip.line_ids)) or '0'}</div>
+ ## exs
+ <div class="act_as_cell amount">${formatLang(get_exs(slip.line_ids)) or '0'}</div>
+ ## fes
+ <div class="act_as_cell amount">${formatLang(get_fes(slip.line_ids)) or '0'}</div>
+ ## otros
+ <div class="act_as_cell amount">${ '0'}</div>
+ ## gross
+ <div class="act_as_cell amount ">${formatLang(get_gross(slip.line_ids)) or '0'}</div>
+ ## ccss
+ <div class="act_as_cell amount">${formatLang(get_ccss(slip.line_ids)) or '0'}</div>
+ ## RENTA
+ <div class="act_as_cell amount">${formatLang(get_rent(slip.line_ids)) or '0'}</div>
+ ## otros
+ <div class="act_as_cell amount">${ '0'}</div>
+ ## NETOS
+ <div class="act_as_cell amount">${formatLang(get_net(slip.line_ids)) or '0'}</div>
+ <%
+ ## Totales por Departamento
+ total_hn_dep += get_hn(slip.worked_days_line_ids)
+ total_he_dep += get_he(slip.worked_days_line_ids)
+ total_fe_dep += get_fe(slip.worked_days_line_ids)
+ total_basic_dep += get_basic(slip.line_ids)
+ total_exs_dep += get_exs(slip.line_ids)
+ total_fes_dep += get_fes(slip.line_ids)
+ total_gross_dep += get_gross(slip.line_ids)
+ total_rent_dep += get_rent(slip.line_ids)
+ total_ccss_dep += get_ccss(slip.line_ids)
+ total_net_dep += get_net(slip.line_ids)
+ total_emp_dep += 1
+
+ ## Totales Generales
+ total_hn += get_hn(slip.worked_days_line_ids)
+ total_he += get_he(slip.worked_days_line_ids)
+ total_fe += get_fe(slip.worked_days_line_ids)
+ total_basic += get_basic(slip.line_ids)
+ total_exs += get_exs(slip.line_ids)
+ total_fes += get_fes(slip.line_ids)
+ total_gross += get_gross(slip.line_ids)
+ total_rent += get_rent(slip.line_ids)
+ total_ccss += get_ccss(slip.line_ids)
+ total_net += get_net(slip.line_ids)
+ total_emp += 1
+ %>
+ </div>
+ %endfor
+ </div>
+ <div class="act_as_tfoot">
+ <div class="act_as_row labels" style="font-weight: bold; font-size: 11x">
+ <div class="act_as_cell first_column">${_('Total')}</div>
+ <div class="act_as_cell">${total_emp_dep} Empleados</div>
+ <div class="act_as_cell amount">${total_hn_dep}</div>
+ <div class="act_as_cell amount">${total_he_dep}</div>
+ <div class="act_as_cell amount">${total_fe_dep}</div>
+ <div class="act_as_cell amount">${formatLang(total_basic_dep)}</div>
+ <div class="act_as_cell amount">${formatLang(total_exs_dep)}</div>
+ <div class="act_as_cell amount">${formatLang(total_fes_dep)}</div>
+ <div class="act_as_cell amount">${_('0')}</div>
+ <div class="act_as_cell amount">${formatLang(total_gross_dep)}</div>
+ <div class="act_as_cell amount">${formatLang(total_ccss_dep)}</div>
+ <div class="act_as_cell amount">${formatLang(total_rent_dep)}</div>
+ <div class="act_as_cell amount">${_('0')}</div>
+ <div class="act_as_cell amount">${formatLang(total_net_dep)}</div>
+ </div>
+ </div>
+ </div>
+
+
+ %endfor
+ <div class="act_as_table list_table " style="margin-top: 20px;">
+ <div class="act_as_tfoot">
+ <div class="act_as_row labels" style="font-weight: bold; font-size: 11px;">
+ <div class="act_as_cell first_column" style="width: 85px; font-size: 12px; text-align: left">${_('TOTAL GENERAL')}</div>
+ <div class="act_as_cell" style="width: 250px;">${total_emp} Empleados</div>
+ <div class="act_as_cell amount" style="width: 40px;">${total_hn}</div>
+ <div class="act_as_cell amount" style="width: 40px;">${total_he}</div>
+ <div class="act_as_cell amount" style="width: 40px;">${total_fe}</div>
+ <div class="act_as_cell amount">${formatLang(total_basic)}</div>
+ <div class="act_as_cell amount">${formatLang(total_exs)}</div>
+ <div class="act_as_cell amount">${formatLang(total_fes)}</div>
+ <div class="act_as_cell amount">${_('0')}</div>
+ <div class="act_as_cell amount">${formatLang(total_gross)}</div>
+ <div class="act_as_cell amount">${formatLang(total_ccss)}</div>
+ <div class="act_as_cell amount">${formatLang(total_rent)}</div>
+ <div class="act_as_cell amount">${_('0')}</div>
+ <div class="act_as_cell amount">${formatLang(total_net)}</div>
+ </div>
+ </div>
+ </div>
+ %endfor
+ <div class="act_as_table data_table" style="margin-top:30px">
+ <div class="act_as_tbody">
+ <div class="act_as_row" style="vertical-align: bottom">
+ <div class="act_as_cell" style="padding-top:80px;padding-bottom:5px">${'HECHO POR:'}</div>
+ <div class="act_as_cell" style="padding-top:80px;padding-bottom:5px">${'REVISADO POR:'}</div>
+ <div class="act_as_cell" style="padding-top:80px;padding-bottom:5px">${'APROBADO POR:'}</div>
+ </div>
+ </div>
+ </div>
+ <p style="page-break-after:always"></p>
+
+
+</body>
+</html>
=== added file 'l10n_cr_hr_payroll/report/payroll_report.py'
--- l10n_cr_hr_payroll/report/payroll_report.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_payroll/report/payroll_report.py 2012-05-23 15:38:20 +0000
@@ -0,0 +1,228 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#
+# payment_receipt
+# First author: Mag Guevara <mag.guevara@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
+# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification, are
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this list of
+# conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice, this list
+# of conditions and the following disclaimer in the documentation and/or other materials
+# provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# The views and conclusions contained in the software and documentation are those of the
+# authors and should not be interpreted as representing official policies, either expressed
+# or implied, of ClearCorp S.A..
+#
+##############################################################################
+
+import time
+import pooler
+from report import report_sxw
+from amount_to_text import number_to_text_es
+import locale
+
+class hr_payslip_run_report(report_sxw.rml_parse):
+ def __init__(self, cr, uid, name, context):
+ super(hr_payslip_run_report, self).__init__(cr, uid, name, context=context)
+ self.localcontext.update({
+ 'time': time,
+ 'cr' : cr,
+ 'uid': uid,
+ 'get_text':self.get_text,
+ 'get_hn':self.get_hn,
+ 'get_he':self.get_he,
+ 'get_fe':self.get_fe,
+ 'get_basic':self.get_basic,
+ 'get_exs':self.get_exs,
+ 'get_fes':self.get_fes,
+ 'get_gross':self.get_gross,
+ 'get_ccss':self.get_ccss,
+ 'get_net':self.get_net,
+ 'get_rent':self.get_rent,
+ 'get_obj_by_dep':self.get_obj_by_dep,
+ })
+
+ def get_prefix(self,currency,company_id):
+ separator = ','
+ decimal_point = '.'
+ res = ''
+ name_currency = currency.currency_name
+ if name_currency == False:
+ name_currency = company_id.currency_id.currency_name
+ res = company_id.currency_id.symbol_prefix
+ if name_currency == None:
+ name_currency = company_id.currency_id.currency_name
+ res = company_id.currency_id.symbol_prefix
+
+
+ return res
+
+ def get_hn(self,line_ids):
+ code = 'HN'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.number_of_hours
+
+ return res
+
+ def get_he(self,line_ids):
+ code = 'HE'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.number_of_hours
+
+ return res
+
+
+ def get_fe(self,line_ids):
+ code = 'FE'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.number_of_hours
+
+ return res
+
+ def get_basic(self,line_ids):
+ code = 'BASIC'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.total
+
+ return res
+
+ def get_exs(self,line_ids):
+ code = 'EXS'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.total
+
+
+ return res
+
+
+ def get_fes(self,line_ids):
+ code = 'FES'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.total
+
+
+ return res
+
+
+ def get_gross(self,line_ids):
+ code = 'GROSS'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.total
+
+
+ return res
+
+ def get_ccss(self,line_ids):
+ code = 'CCSS-EMP'
+ code2 = 'Banco Popular-EMP'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.total
+ elif line.code == code2:
+ res += line.total
+
+ return res
+
+
+ def get_net(self,line_ids):
+ code = 'NET'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.total
+
+
+ return res
+
+
+ def get_rent(self,line_ids):
+ code = 'Renta'
+ res = 0
+ for line in line_ids:
+ if line.code == code:
+ res += line.total
+
+
+ return res
+
+
+ def get_obj_by_dep(self,run):
+ obj_by_dep = []
+ dep_list = []
+ emp_by_dep = []
+
+ for payslip in run.slip_ids:
+ dep_name = payslip.employee_id.department_id.name
+ if dep_name not in dep_list:
+ dep_list.append(dep_name)
+
+ for dep in dep_list:
+ dep_emp = []
+ for payslip in run.slip_ids:
+ if payslip.employee_id.department_id.name == dep:
+ dep_emp.append(payslip)
+ obj_by_dep.append(dep_emp)
+
+ i = 0
+ for dep in dep_list:
+ tup_temp = (dep, obj_by_dep[i])
+ emp_by_dep.append(tup_temp)
+ i += 1
+
+
+ return emp_by_dep
+
+ def get_text(self,amount,currency,lang,company_id):
+ separator = ','
+ decimal_point = '.'
+ name_currency = currency.currency_name
+ if name_currency == False:
+ name_currency = company_id.currency_id.currency_name
+ if name_currency == None:
+ name_currency = company_id.currency_id.currency_name
+ if lang:
+ lang_pool = self.pool.get('res.lang')
+ id_lang = lang_pool.search(self.cr,self.uid,[('code','=',lang)])
+ obj_lang = lang_pool.browse(self.cr,self.uid,id_lang)[0]
+ separator = obj_lang and obj_lang.thousands_sep or separator
+ decimal_point = obj_lang and obj_lang.decimal_point or decimal_point
+ res = number_to_text_es(amount,name_currency,separator=separator,decimal_point=decimal_point)
+ return res
+
+report_sxw.report_sxw(
+ 'report.hr.payslip.run.layout_ccorp',
+ 'hr.payslip.run',
+ 'addons/cr_hr_report/report/payroll_report.mako',
+ parser=hr_payslip_run_report)
=== added file 'l10n_cr_hr_payroll/report/style.css'
--- l10n_cr_hr_payroll/report/style.css 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_payroll/report/style.css 2012-05-23 15:38:20 +0000
@@ -0,0 +1,143 @@
+/*HEADER*/
+.header {
+ padding : 100px 10px 5px 10px;
+ border:0; margin: 0;
+}
+.header-table {
+ width: 100%;
+ margin-top: 8%;
+}
+
+.title {
+ font-size:16;
+ font-weight: bold;
+}
+
+.company_address{
+ width : 100%;
+ text-align: right;
+ font-family: Arial,Verdana, Sans, Serif;
+ font-size: 13;
+}
+
+.company_data {
+ width : 100%;
+ text-align: center;
+ font-family: Arial,Verdana, Sans, Serif;
+ font-size: 13;
+}
+
+.header_logo{
+ width : 150px;
+}
+
+/*BODY*/
+
+
+
+#document_data{
+ margin-bottom : 50px;
+ width : 100%;
+}
+
+#number{
+ text-align : left;
+ color : red;
+ font-size : 0.9em;
+ float : left;
+}
+
+#date {
+ margin : 20px 0px 5px 400px;
+}
+
+.detail {
+ margin-top : 10px;
+ width : 100%;
+}
+
+.text_font{
+ font-family : Arial,Verdana, Sans, Serif;
+ font-size : 16px;
+ font-style : bold;
+ margin-left : 15px;
+}
+
+.detail_line{
+ width : 100%;
+ float : left;
+}
+.amount_text{
+ font-family : Arial,Verdana, Sans, Serif;
+ font-size : 16px;
+ margin-left : 15px;
+ font-style : bold;
+}
+
+.info{
+ padding-top : 35px;
+ width: 100%;
+}
+
+.info_detail{
+ font-family : Arial,Verdana, Sans, Serif;
+ font-size : 11px;
+ font-style : italic;
+}
+
+.signature {
+ text-align : center;
+ background-color : #EBEBEB;
+ border: 1px solid black;
+ -webkit-border-radius: 10px;
+ width : 100%;
+}
+.sign_detail {
+ margin-bottom : 40px;
+}
+
+.payment_method{
+ width : 50%;
+ float :left;
+ margin-left : 30px;
+}
+
+#val_first{
+ width : 100%;
+ margin-top : 20px;
+ margin-bottom : 20px;
+}
+
+#val_second{
+ width : 100%;
+}
+
+.line{
+ width : 50%;
+ float :left;
+ margin-left : 10px;
+}
+
+#validation {
+ border-collapse:separate;
+ border-spacing: 20px;
+ margin-top : 30px;
+ width : 100%;
+}
+
+#wrapper{
+ margin-top : 30px;
+}
+
+.text_doct{
+ font-family : Arial,Verdana, Sans, Serif;
+ font-size : 16px;
+ font-weight : bolder;
+}
+
+.sign_line{
+ margin-top : 38px;
+ border-top: 1px solid black;
+ width : 100%;
+ height : 1px;
+}
Follow ups