Juan Felipe Muñoz Ramos has proposed merging lp:~juan-munoz-clearcorp/openerp-costa-rica/cr_hr_report_feature into lp:openerp-costa-rica/6.1.
Requested reviews: CLEARCORP development team (clearcorp) For more details, see: https://code.launchpad.net/~juan-munoz-clearcorp/openerp-costa-rica/cr_hr_report_feature/+merge/104747 add hr_payroll_report -- https://code.launchpad.net/~juan-munoz-clearcorp/openerp-costa-rica/cr_hr_report_feature/+merge/104747 Your team CLEARCORP development team is requested to review the proposed merge of lp:~juan-munoz-clearcorp/openerp-costa-rica/cr_hr_report_feature into lp:openerp-costa-rica/6.1.
=== added directory 'cr_hr_report' === added file 'cr_hr_report/__init__.py' --- cr_hr_report/__init__.py 1970-01-01 00:00:00 +0000 +++ cr_hr_report/__init__.py 2012-05-04 14:22:21 +0000 @@ -0,0 +1,34 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# __init__.py +# cic_voucher_report +# First author: Mag Guevara Rivera <[email protected]> (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 report === added file 'cr_hr_report/__terp__.py' --- cr_hr_report/__terp__.py 1970-01-01 00:00:00 +0000 +++ cr_hr_report/__terp__.py 2012-05-04 14:22:21 +0000 @@ -0,0 +1,59 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# __terp__.py +# payment_receipt +# First author: Mag Guevara <[email protected]> (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.. +# +############################################################################## + +{ + 'name': 'ClearCorp report module for voucher and other payments', + 'version': '0.1', + 'url': 'http://launchpad.net/openerp-costa-rica', + 'author': 'CLEARCORP S.A.', + 'website': 'http://clearcorp.co.cr', + 'category': '', + 'description': """ClearCorp 'reports' for vouchers: + Reports: + * Voucher + """, + 'depends': [ + 'account', + 'account_voucher_payment_method', + 'base_currency_symbol', + 'report_webkit', + ], + 'init_xml': [], + 'update_xml': [ + 'payment_receipt_report.xml', + ], + 'license': 'Other OSI approved licence', + 'installable': True, + 'active': False, +} === added file 'cr_hr_report/data.xml' --- cr_hr_report/data.xml 1970-01-01 00:00:00 +0000 +++ cr_hr_report/data.xml 2012-05-04 14:22:21 +0000 @@ -0,0 +1,217 @@ +<?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> + </data> +</openerp> === added directory 'cr_hr_report/i18n' === added file 'cr_hr_report/i18n/es_CR.po' --- cr_hr_report/i18n/es_CR.po 1970-01-01 00:00:00 +0000 +++ cr_hr_report/i18n/es_CR.po 2012-05-04 14:22:21 +0000 @@ -0,0 +1,86 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * ccorp_payment_receipt +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0.3\n" +"Report-Msgid-Bugs-To: [email protected]\n" +"POT-Creation-Date: 2012-01-03 22:28+0000\n" +"PO-Revision-Date: 2012-01-03 22:28+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: ccorp_payment_receipt +#: report:report.account.voucher.layout_ccorp:39 +msgid "Check No." +msgstr "CHEQUE No." + +#. module: ccorp_payment_receipt +#: report:report.account.voucher.layout_ccorp:13 +msgid "No." +msgstr "No." + +#. module: ccorp_payment_receipt +#: model:ir.actions.report.xml,name:ccorp_payment_receipt.account_voucher_ccorp +msgid "Payment Voucher" +msgstr "Imprimir Recibo" + +#. module: ccorp_payment_receipt +#: report:report.account.voucher.layout_ccorp:46 +msgid "AUTORIZADO MEDIANTE OFICIO No.04-00007-97 DE FECHA 30-09-97 DE LA D.G.T.D." +msgstr "AUTORIZADO MEDIANTE OFICIO No.04-00007-97 DE FECHA 30-09-97 DE LA D.G.T.D." + +#. module: ccorp_payment_receipt +#: report:report.account.voucher.layout_ccorp:23 +msgid "Concept of" +msgstr "POR CONCEPTO DE" + +#. module: ccorp_payment_receipt +#: report:report.account.voucher.layout_ccorp:45 +msgid "LA VALIDEZ DE ESTE RECIBO QUEDA SUJETA A QUE LOS CHEQUES RECIBIDOS SEAN PAGADOS POR EL BANCO A NUESTRA SATISFACCION" +msgstr "LA VALIDEZ DE ESTE RECIBO QUEDA SUJETA A QUE LOS CHEQUES RECIBIDOS SEAN PAGADOS POR EL BANCO A NUESTRA SATISFACCION" + +#. module: ccorp_payment_receipt +#: report:report.account.voucher.layout_ccorp:37 +msgid "Cash" +msgstr "EFECTIVO" + +#. module: ccorp_payment_receipt +#: report:report.account.voucher.layout_ccorp:20 +msgid "The amount of" +msgstr "LA SUMA DE" + +#. module: ccorp_payment_receipt +#: report:report.account.voucher.layout_ccorp:26 +msgid "Observations" +msgstr "OBSERVACIONES" + +#. module: ccorp_payment_receipt +#: report:report.account.voucher.layout_ccorp:49 +msgid "P/" +msgstr "P/" + +#. module: ccorp_payment_receipt +#: report:report.account.voucher.layout_ccorp:17 +msgid "We recieve from" +msgstr "RECIBIMOS DE" + +#. module: ccorp_payment_receipt +#: report:report.account.voucher.layout_ccorp:1 +msgid "MONEY RECEIPT" +msgstr "RECIBO DE DINERO" + +#. module: ccorp_payment_receipt +#: report:report.account.voucher.layout_ccorp:1 +msgid "Date" +msgstr "FECHA" + +#. module: ccorp_payment_receipt +#: report:report.account.voucher.layout_ccorp:1 +msgid "In words" +msgstr "EN LETRAS" === added file 'cr_hr_report/payment_receipt_report.xml' --- cr_hr_report/payment_receipt_report.xml 1970-01-01 00:00:00 +0000 +++ cr_hr_report/payment_receipt_report.xml 2012-05-04 14:22:21 +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/payment_receipt.mako" string="Planilla Semanal" report_type="webkit"/> + </data> +</openerp> === added directory 'cr_hr_report/report' === added file 'cr_hr_report/report/__init__.py' --- cr_hr_report/report/__init__.py 1970-01-01 00:00:00 +0000 +++ cr_hr_report/report/__init__.py 2012-05-04 14:22:21 +0000 @@ -0,0 +1,35 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# __init__.py +# payment_receipt +# First author: Carlos Vásquez <[email protected]> (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 payment_receipt === added file 'cr_hr_report/report/amount_to_text.py' --- cr_hr_report/report/amount_to_text.py 1970-01-01 00:00:00 +0000 +++ cr_hr_report/report/amount_to_text.py 2012-05-04 14:22:21 +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 'cr_hr_report/report/header.html' --- cr_hr_report/report/header.html 1970-01-01 00:00:00 +0000 +++ cr_hr_report/report/header.html 2012-05-04 14:22:21 +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 'cr_hr_report/report/payment_receipt.mako' --- cr_hr_report/report/payment_receipt.mako 1970-01-01 00:00:00 +0000 +++ cr_hr_report/report/payment_receipt.mako 2012-05-04 14:22:21 +0000 @@ -0,0 +1,68 @@ +<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 ''}</div> + ## nh + <div class="act_as_cell">${get_nh(slip.worked_days_line_ids) or ''}</div> + ## eh + <div class="act_as_cell">${get_eh(slip.worked_days_line_ids) or ''}</div> + ## ef + <div class="act_as_cell">${get_ef(slip.worked_days_line_ids) or ''}</div> + ## basic + <div class="act_as_cell amount">${get_basic(slip.line_ids) or '0'}</div> + ## exs + <div class="act_as_cell amount">${get_exs(slip.line_ids) or '0'}</div> + ## fes + <div class="act_as_cell amount">${get_fes(slip.line_ids) or '0'}</div> + ## otros + <div class="act_as_cell amount">${ '0'}</div> + ## fes + <div class="act_as_cell amount">${get_gross(slip.line_ids) or '0'}</div> + ## ccss + <div class="act_as_cell amount">${get_ccss(slip.line_ids) or '0'}</div> + ## RENTA + <div class="act_as_cell amount">${ '0'}</div> + ## otros + <div class="act_as_cell amount">${ '0'}</div> + ## NETOS + <div class="act_as_cell amount">${ get_net(slip.line_ids) or '0'}</div> + </div> + %endfor + </div> + + </br> + <div>${'HECHO POR: ___________________________________' } </div> + </br> + <div> ${'REVISADO POR: ___________________________________'} </div> + </br> + <div> ${'APROBADO POR: ___________________________________'} </div> + + + + + </div> + + + + <p style="page-break-after:always"></p> + %endfor +</body> +</html> === added file 'cr_hr_report/report/payment_receipt.py' --- cr_hr_report/report/payment_receipt.py 1970-01-01 00:00:00 +0000 +++ cr_hr_report/report/payment_receipt.py 2012-05-04 14:22:21 +0000 @@ -0,0 +1,192 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# +# payment_receipt +# First author: Mag Guevara <[email protected]> (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) === added file 'cr_hr_report/report/style.css' --- cr_hr_report/report/style.css 1970-01-01 00:00:00 +0000 +++ cr_hr_report/report/style.css 2012-05-04 14:22:21 +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; +}
_______________________________________________ Mailing list: https://launchpad.net/~clearcorp Post to : [email protected] Unsubscribe : https://launchpad.net/~clearcorp More help : https://help.launchpad.net/ListHelp

