[MERGE] l10n_in_hr_payroll: Report employee wise yearly salary (Still need to improve query)
bzr revid: mra@tinyerp.com-20120726044935-cjmm90uilmq14os8
This commit is contained in:
commit
bc2ef16941
|
@ -21,5 +21,6 @@
|
|||
|
||||
import l10n_in_hr_payroll
|
||||
import report
|
||||
import wizard
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -50,7 +50,9 @@ Indian Payroll Salary Rules.
|
|||
'security/ir.model.access.csv',
|
||||
'l10n_in_hr_payroll_report.xml',
|
||||
'l10n_in_hr_payroll_sequence.xml',
|
||||
'wizard/hr_salary_employee_bymonth_view.xml',
|
||||
'report/payment_advice_report_view.xml',
|
||||
|
||||
],
|
||||
'demo_xml': ['l10n_in_hr_payroll_demo.xml'],
|
||||
'installable': True
|
||||
|
|
|
@ -18,5 +18,12 @@
|
|||
rml="l10n_in_hr_payroll/report/report_payroll_advice.rml"
|
||||
string="Print Advice" />
|
||||
|
||||
<report
|
||||
auto="False"
|
||||
id="hr_salary_employee_bymonth"
|
||||
model="hr.salary.employee.month"
|
||||
name="salary.employee.bymonth"
|
||||
rml="l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.rml"
|
||||
string="Salary Register" />
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
import report_payslip_details
|
||||
import report_payroll_advice
|
||||
import report_hr_salary_employee_bymonth
|
||||
import payment_advice_report
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -0,0 +1,139 @@
|
|||
#-*- coding:utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import datetime
|
||||
import time
|
||||
|
||||
from report import report_sxw
|
||||
|
||||
class report_hr_salary_employee_bymonth(report_sxw.rml_parse):
|
||||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(report_hr_salary_employee_bymonth, self).__init__(cr, uid, name, context=context)
|
||||
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'get_employee': self.get_employee,
|
||||
'get_periods': self.get_periods,
|
||||
'get_months_tol': self.get_months_tol,
|
||||
'get_total': self.get_total,
|
||||
})
|
||||
|
||||
self.context = context
|
||||
self.mnths = []
|
||||
self.mnths_total = []
|
||||
self.total = 0.0
|
||||
|
||||
def get_periods(self, form):
|
||||
# Get start year-month-date and end year-month-date
|
||||
first_year = int(form['start_date'][0:4])
|
||||
last_year = int(form['end_date'][0:4])
|
||||
|
||||
first_month = int(form['start_date'][5:7])
|
||||
last_month = int(form['end_date'][5:7])
|
||||
no_months = (last_year-first_year) * 12 + last_month - first_month + 1
|
||||
current_month = first_month
|
||||
current_year = first_year
|
||||
|
||||
# Get name of the months from integer
|
||||
mnth_name = []
|
||||
for count in range(0, no_months):
|
||||
m = datetime.date(current_year, current_month, 1).strftime('%b')
|
||||
mnth_name.append(m)
|
||||
self.mnths.append(str(current_month) + '-' + str(current_year))
|
||||
if current_month == 12:
|
||||
current_month = 0
|
||||
current_year = last_year
|
||||
current_month = current_month + 1
|
||||
for c in range(0, (12-no_months)):
|
||||
mnth_name.append('None')
|
||||
self.mnths.append('None')
|
||||
return [mnth_name]
|
||||
|
||||
def get_salary(self, form, emp_id, emp_salary, total_mnths):
|
||||
# Get salary of the employee
|
||||
|
||||
emp_obj = self.pool.get('hr.employee')
|
||||
emp_ids = form.get('employee_ids', [])
|
||||
date_from = form.get('start_date', [])
|
||||
date_to = form.get('end_date', [])
|
||||
employees = emp_obj.browse(self.cr, self.uid, emp_ids, context=self.context)
|
||||
|
||||
self.cr.execute("select to_char(date_to,'mm-yyyy') as to_date ,sum(pl.total) as net \
|
||||
from hr_payslip_line as pl \
|
||||
left join hr_payslip as p on pl.slip_id = p.id \
|
||||
left join hr_employee as emp on emp.id = p.employee_id \
|
||||
left join resource_resource as r on r.id = emp.resource_id \
|
||||
where pl.code = 'NET' and p.state = 'done' and p.employee_id in %s \
|
||||
group by r.name, p.date_to,emp.id",(tuple([emp_id]),))
|
||||
sal = self.cr.fetchall()
|
||||
salary = dict(sal)
|
||||
total = 0.0
|
||||
cnt = 1
|
||||
|
||||
for month in self.mnths:
|
||||
if month <> 'None':
|
||||
if len(month) != 7:
|
||||
month = '0' + str(month)
|
||||
if month in salary and salary[month]:
|
||||
emp_salary.append(salary[month])
|
||||
total += salary[month]
|
||||
total_mnths[cnt] = total_mnths[cnt] + salary[month]
|
||||
else:
|
||||
emp_salary.append(0.00)
|
||||
else:
|
||||
emp_salary.append('')
|
||||
total_mnths[cnt] = ''
|
||||
cnt = cnt + 1
|
||||
return emp_salary,total,total_mnths
|
||||
|
||||
def get_employee(self, form):
|
||||
emp_salary = []
|
||||
salary_list = []
|
||||
total_mnths=['Total', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
emp_obj = self.pool.get('hr.employee')
|
||||
emp_ids = form.get('employee_ids', [])
|
||||
employees = emp_obj.browse(self.cr, self.uid, emp_ids, context=self.context)
|
||||
|
||||
for emp_id in employees:
|
||||
emp_salary.append(emp_id.name)
|
||||
total = 0.0
|
||||
emp_salary, total, total_mnths = self.get_salary(form, emp_id.id, emp_salary, total_mnths)
|
||||
emp_salary.append(total)
|
||||
salary_list.append(emp_salary)
|
||||
emp_salary = []
|
||||
self.mnths_total.append(total_mnths)
|
||||
return salary_list
|
||||
|
||||
def get_months_tol(self):
|
||||
return self.mnths_total
|
||||
|
||||
def get_total(self):
|
||||
for item in self.mnths_total:
|
||||
for count in range(1, len(item)):
|
||||
if item[count] == '':
|
||||
continue
|
||||
self.total += item[count]
|
||||
return self.total
|
||||
|
||||
report_sxw.report_sxw('report.salary.employee.bymonth', 'hr.salary.employee.month', 'l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.rml', parser=report_hr_salary_employee_bymonth, header='internal')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -0,0 +1,293 @@
|
|||
<?xml version="1.0"?>
|
||||
<document filename="yearly salary report.pdf">
|
||||
<template pageSize="(620.0,842.0)" title="Yearly Salary Report" author="OpenERP" allowSplitting="50">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="28.0" y1="28.0" width="539" height="772"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="5,0" stop="5,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="6,0" stop="6,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="7,0" stop="7,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="7,-1" stop="7,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="8,0" stop="8,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="8,-1" stop="8,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="9,0" stop="9,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="9,-1" stop="9,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="10,0" stop="10,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="10,-1" stop="10,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="11,0" stop="11,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="11,-1" stop="11,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="12,0" stop="12,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="12,-1" stop="12,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="13,0" stop="13,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="13,-1" stop="13,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="7,-1" stop="7,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="8,-1" stop="8,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="9,-1" stop="9,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="10,-1" stop="10,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="11,-1" stop="11,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="12,-1" stop="12,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="13,-1" stop="13,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="5,0" stop="5,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="6,0" stop="6,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="7,0" stop="7,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="8,0" stop="8,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="9,0" stop="9,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="10,0" stop="10,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="11,0" stop="11,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="12,0" stop="12,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="13,0" stop="13,0"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P4" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P5" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P6" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Standard" fontName="Helvetica"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="7.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="7.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_1" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Table Contents" fontName="Helvetica"/>
|
||||
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
|
||||
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="5.0" leading="5" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="5.0" leading="2" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="7.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="5.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="5.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<images/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<para style="P1">Yearly Salary Details </para>
|
||||
<para style="P5">From [[ formatLang(data['form']['start_date'], date=True) ]] To [[ formatLang(data['form']['end_date'], date=True) ]]</para>
|
||||
<para style="P6">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<section>
|
||||
<para style="terp_default_1">[[ repeatIn(get_periods(data['form']),'m') ]]</para>
|
||||
<blockTable colWidths="55.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,57.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Name</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ m[0] != 'None' and m[0] or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ m[1] != 'None' and m[1] or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ m[2] != 'None' and m[2] or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ m[3] != 'None' and m[3] or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ m[4] != 'None' and m[4] or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ m[5] != 'None' and m[5] or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ m[6] != 'None' and m[6] or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ m[7] != 'None' and m[7] or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ m[8] != 'None' and m[8] or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ m[9] != 'None' and m[9] or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ m[10] != 'None' and m[10] or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ m[11] != 'None' and m[11] or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Total</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_1">[[ repeatIn(get_employee(data['form']),'e') ]]</para>
|
||||
<blockTable colWidths="55.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,57.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ e[0] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_8">
|
||||
<font face="Helvetica" size="5.0">[[ (e[1]!='' and formatLang(e[1])) or removeParentNode('font') ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_8">
|
||||
<font face="Helvetica" size="5.0">[[ (e[2]!='' and formatLang(e[2])) or removeParentNode('font') ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_8">
|
||||
<font face="Helvetica" size="5.0">[[ (e[3]!='' and formatLang(e[3])) or removeParentNode('font') ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_8">
|
||||
<font face="Helvetica" size="5.0">[[ (e[4]!='' and formatLang(e[4])) or removeParentNode('font') ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_8">
|
||||
<font face="Helvetica" size="5.0">[[ (e[5]!='' and formatLang(e[5])) or removeParentNode('font') ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_8">
|
||||
<font face="Helvetica" size="5.0">[[ (e[6]!='' and formatLang(e[6])) or removeParentNode('font') ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_8">
|
||||
<font face="Helvetica" size="5.0">[[ (e[7]!='' and formatLang(e[7])) or removeParentNode('font') ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_8">
|
||||
<font face="Helvetica" size="5.0">[[ (e[8]!='' and formatLang(e[8])) or removeParentNode('font') ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_8">
|
||||
<font face="Helvetica" size="5.0">[[ (e[9]!='' and formatLang(e[9])) or removeParentNode('font') ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_8">
|
||||
<font face="Helvetica" size="5.0">[[ (e[10]!='' and formatLang(e[10])) or removeParentNode('font') ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_8">
|
||||
<font face="Helvetica" size="5.0">[[ (e[11]!='' and formatLang(e[11])) or removeParentNode('font') ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_8">
|
||||
<font face="Helvetica" size="5.0">[[ (e[12]!='' and formatLang(e[12])) or removeParentNode('font') ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ formatLang(e[13]) ]] [[company.currency_id.symbol]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
</section>
|
||||
<section>
|
||||
<para style="terp_default_1">[[ repeatIn(get_months_tol(),'t') ]]</para>
|
||||
<blockTable colWidths="55.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,57.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Total</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Right">[[ formatLang(t[1]) or removeParentNode('para') ]] [[company.currency_id.symbol]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Right">[[ formatLang(t[2]) or removeParentNode('para')]] [[company.currency_id.symbol]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Right">[[ formatLang(t[3]) or removeParentNode('para')]] [[company.currency_id.symbol]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Right">[[ formatLang(t[4]) or removeParentNode('para')]] [[company.currency_id.symbol]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Right">[[ formatLang(t[5]) or removeParentNode('para')]] [[company.currency_id.symbol]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Right">[[ formatLang(t[6]) or removeParentNode('para')]] [[company.currency_id.symbol]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Right">[[ formatLang(t[7]) or removeParentNode('para')]] [[company.currency_id.symbol]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Right">[[ formatLang(t[8]) or removeParentNode('para')]] [[company.currency_id.symbol]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Right">[[ formatLang(t[9]) or removeParentNode('para')]] [[company.currency_id.symbol]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Right">[[ formatLang(t[10]) or removeParentNode('para')]] [[company.currency_id.symbol]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Right">[[ formatLang(t[11]) or removeParentNode('para')]] [[company.currency_id.symbol]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Right">[[ formatLang(t[12]) or removeParentNode('para')]] [[company.currency_id.symbol]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Right">[[ formatLang(get_total()) ]] [[company.currency_id.symbol]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
</story>
|
||||
</document>
|
|
@ -0,0 +1,24 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import hr_salary_employee_bymonth
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -0,0 +1,66 @@
|
|||
#-*- coding:utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
from osv import osv, fields
|
||||
|
||||
class hr_salary_employee_bymonth(osv.osv_memory):
|
||||
|
||||
_name = 'hr.salary.employee.month'
|
||||
_description = 'Print Hr Salary Employee By Month Report'
|
||||
_columns = {
|
||||
'start_date': fields.date('Starting Date', required=True),
|
||||
'end_date': fields.date('Ending Date', required=True),
|
||||
'employee_ids': fields.many2many('hr.employee', 'payroll_year_rel', 'payroll_year_id', 'emp_id', 'Employees', required=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'start_date': lambda *a: time.strftime('%Y-01-01'),
|
||||
'end_date': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
}
|
||||
|
||||
def print_report(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
To get the date and print the report
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param context: A standard dictionary
|
||||
@return: return report
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
datas = {'ids': context.get('active_ids', [])}
|
||||
|
||||
res = self.read(cr, uid, ids, ['employee_ids', 'start_date', 'end_date'], context=context)
|
||||
res = res and res[0] or {}
|
||||
datas['form'] = res
|
||||
res['employee_ids'] = res.get('employee_ids', [])
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'salary.employee.bymonth',
|
||||
'datas': datas,
|
||||
}
|
||||
|
||||
hr_salary_employee_bymonth()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_salary_employee_month" model="ir.ui.view">
|
||||
<field name="name">Hr monthly Employee Salary</field>
|
||||
<field name="model">hr.salary.employee.month</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Print Hr monthly Employee Salary" version="7.0">
|
||||
<header>
|
||||
<button name="print_report" string="Print" type="object" class="oe_highlight"/>
|
||||
or
|
||||
<button string="Cancel" class="oe_link" special="cancel" />
|
||||
</header>
|
||||
<group>
|
||||
<field name="start_date"/>
|
||||
<field name="end_date"/>
|
||||
<separator string="Employee" />
|
||||
<field name="employee_ids" nolabel="1" colspan="4"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_salary_employee_month" model="ir.actions.act_window">
|
||||
<field name="name">Salary Register</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.salary.employee.month</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
name="Reporting"
|
||||
parent="hr.menu_hr_root"
|
||||
id="menu_salary_employee_month_report" sequence="50"
|
||||
/>
|
||||
|
||||
<menuitem
|
||||
name="Salary Register"
|
||||
parent="menu_salary_employee_month_report"
|
||||
action="action_salary_employee_month"
|
||||
id="menu_salary_employee_month"
|
||||
/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
Loading…
Reference in New Issue