clearcorp team mailing list archive
-
clearcorp team
-
Mailing list archive
-
Message #00138
[Merge] lp:~rr.clearcorp/openerp-costa-rica/6.1-cr_hr_report into lp:openerp-costa-rica/6.1
Ronald Rubi has proposed merging lp:~rr.clearcorp/openerp-costa-rica/6.1-cr_hr_report into lp:openerp-costa-rica/6.1.
Requested reviews:
CLEARCORP development team (clearcorp)
For more details, see:
https://code.launchpad.net/~rr.clearcorp/openerp-costa-rica/6.1-cr_hr_report/+merge/104803
Fix columns: HN, HE, FE.
Add date of start and date of end
--
https://code.launchpad.net/~rr.clearcorp/openerp-costa-rica/6.1-cr_hr_report/+merge/104803
Your team CLEARCORP development team is requested to review the proposed merge of lp:~rr.clearcorp/openerp-costa-rica/6.1-cr_hr_report into lp:openerp-costa-rica/6.1.
=== modified file 'cr_hr_report/report/payment_receipt.py'
--- cr_hr_report/report/payment_receipt.py 2012-05-04 14:04:10 +0000
+++ cr_hr_report/report/payment_receipt.py 2012-05-04 20:20:22 +0000
@@ -1,192 +1,61 @@
-# -*- 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_nh':self.get_nh,
- 'get_eh':self.get_eh,
- 'get_ef':self.get_ef,
- '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,
- })
-
- 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_nh(self,line_ids):
- code = 'NH'
- res = '0'
- for line in line_ids:
- if line.code == code:
- res = line.number_of_hours
-
-
- return res
-
- def get_eh(self,line_ids):
- code = 'EH'
- res = '0'
- for line in line_ids:
- if line.code == code:
- res = line.number_of_hours
-
-
- return res
-
-
- def get_ef(self,line_ids):
- code = 'EF'
- 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_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)
+<html>
+<head>
+ <style style="text/css">
+ ${css}
+ </style>
+</head>
+<body class = "data">
+ %for payslips in objects :
+ <div class="act_as_tbody">
+ <div class="act_as_table data_table">
+ %for slip in payslips.slip_ids:
+ <div class="act_as_row lines" style="vertical-align: top;">
+ ## 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">${get_hn(slip.worked_days_line_ids) or '0'}</div>
+ ## eh
+ <div class="act_as_cell">${get_he(slip.worked_days_line_ids) or '0'}</div>
+ ## ef
+ <div class="act_as_cell">${get_fe(slip.worked_days_line_ids) or '0'}</div>
+ ## basic
+ <div class="act_as_cell">${get_basic(slip.line_ids) or '0'}</div>
+ ## exs
+ <div class="act_as_cell">${get_exs(slip.line_ids) or '0'}</div>
+ ## fes
+ <div class="act_as_cell">${get_fes(slip.line_ids) or '0'}</div>
+ ## otros
+ <div class="act_as_cell">${ '0'}</div>
+ ## fes
+ <div class="act_as_cell">${get_gross(slip.line_ids) or '0'}</div>
+ ## ccss
+ <div class="act_as_cell">${get_ccss(slip.line_ids) or '0'}</div>
+ ## RENTA
+ <div class="act_as_cell">${ '0'}</div>
+ ## otros
+ <div class="act_as_cell">${ '0'}</div>
+ ## NETOS
+ <div class="act_as_cell">${ get_net(slip.line_ids) or '0'}</div>
+ </div>
+ %endfor
+ </div>
+
+ </br></br>
+ <div>Fecha desde: ${payslips.date_start}</div></br>
+ <div>Fecha hasta: ${payslips.date_end}</div>
+
+ </br></br></br></br>
+ <div>${'HECHO POR: ___________________________________' } </div>
+ </br></br></br></br>
+ <div> ${'REVISADO POR: ___________________________________'} </div>
+ </br></br></br></br>
+ <div> ${'APROBADO POR: ___________________________________'} </div>
+
+ </div>
+
+ <p style="page-break-after:always"></p>
+ %endfor
+</body>
+</html>
Follow ups