--- /dev/null
+#-*- coding:utf-8 -*-
+
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# d$
+#
+# 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
+from report import report_sxw
+import time
+import pooler
+
+class report_salary_rule_bymonth(report_sxw.rml_parse):
+
+ def __init__(self, cr, uid, name, context):
+ super(report_salary_rule_bymonth, self).__init__(cr, uid, name, 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.mnths =[]
+ self.mnths_tol = []
+ self.total=0.0
+
+ def get_periods(self,form):
+# Get start year-month-date and end year-month-date
+ fy = int(form['start_date'][0:4])
+ ly = int(form['end_date'][0:4])
+
+ fm = int(form['start_date'][5:7])
+ lm = int(form['end_date'][5:7])
+ no_months = (ly-fy)*12+lm-fm + 1
+ cm = fm
+ cy = fy
+
+# Get name of the months from integer
+ mnth_name = []
+ for count in range(0,no_months):
+ m = datetime.date(cy, cm, 1).strftime('%b')
+ mnth_name.append(m)
+ self.mnths.append(str(cm)+'-'+str(cy))
+ if cm == 12:
+ cm = 0
+ cy = ly
+ cm = cm +1
+ for c in range(0,(12-no_months)):
+ mnth_name.append('None')
+ self.mnths.append('None')
+ return [mnth_name]
+
+ def get_employee(self,form):
+ ls1=[]
+ ls = []
+ tol_mnths=['Total',0,0,0,0,0,0,0,0,0,0,0,0]
+ emp = pooler.get_pool(self.cr.dbname).get('hr.employee')
+ emp_ids = form['employee_ids']
+ empll = emp.browse(self.cr,self.uid, emp_ids)
+ cnt = 1
+ for emp_id in empll:
+ ls1.append(emp_id.name)
+ tol = 0.0
+ for mnth in self.mnths:
+ if mnth <> 'None':
+ if len(mnth) != 7:
+ mnth = '0' + str(mnth)
+ self.cr.execute('''select sum(pl.total)
+ 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.employee_id = '''+str(emp_id.id)+''' \
+ and to_char(date_to,'mm-yyyy') like '%'''+mnth+'''%'
+ group by r.name, p.date_to,emp.id''')
+# self.cr.execute(query)
+ sal = self.cr.fetchall()
+ if sal:
+ ls1.append(sal[0][0])
+ tol += sal[0][0]
+ tol_mnths[cnt] = tol_mnths[cnt] + sal[0][0]
+ else:
+ ls1.append(0.00)
+ tol_mnths[cnt] = 0.0
+ else:
+ ls1.append('')
+ tol_mnths[cnt] = ''
+ cnt = cnt + 1
+ cnt = 1
+ ls1.append(tol)
+ ls.append(ls1)
+ ls1 = []
+ self.mnths_tol.append(tol_mnths)
+ return ls
+
+ def get_months_tol(self):
+ return self.mnths_tol
+
+ def get_total(self):
+ for item in self.mnths_tol:
+ for count in range(1,len(item)):
+ if item[count] == '':
+ continue
+ self.total += item[count]
+ return self.total
+
+report_sxw.report_sxw('report.salary.rule.bymonth', 'salary.rule.month', 'l10n_in_hr_payroll/report/report_salary_rule_bymonth.rml', parser=report_salary_rule_bymonth)
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<document filename="test.pdf">
+ <template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
+ <pageTemplate id="first">
+ <frame id="first" x1="28.0" y1="28.0" width="400" height="786"/>
+ </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="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.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="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.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="9.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>
+ <section>
+ <para style="terp_default_1">[[ repeatIn(get_periods(data['form']),'m') ]]</para>
+ <blockTable colWidths="71.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,35.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="71.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,35.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="9.0">[[ (e[1]!='' and formatLang(e[1])) or removeParentNode('font') ]] [[company.currency_id.symbol]]</font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_8">
+ <font face="Helvetica" size="9.0">[[ (e[2]!='' and formatLang(e[2])) or removeParentNode('font') ]] [[company.currency_id.symbol]]</font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_8">
+ <font face="Helvetica" size="9.0">[[ (e[3]!='' and formatLang(e[3])) or removeParentNode('font') ]] [[company.currency_id.symbol]]</font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_8">
+ <font face="Helvetica" size="9.0">[[ (e[4]!='' and formatLang(e[4])) or removeParentNode('font') ]] [[company.currency_id.symbol]]</font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_8">
+ <font face="Helvetica" size="9.0">[[ (e[5]!='' and formatLang(e[5])) or removeParentNode('font') ]] [[company.currency_id.symbol]]</font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_8">
+ <font face="Helvetica" size="9.0">[[ (e[6]!='' and formatLang(e[6])) or removeParentNode('font') ]] [[company.currency_id.symbol]]</font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_8">
+ <font face="Helvetica" size="9.0">[[ (e[7]!='' and formatLang(e[7])) or removeParentNode('font') ]] [[company.currency_id.symbol]]</font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_8">
+ <font face="Helvetica" size="9.0">[[ (e[8]!='' and formatLang(e[8])) or removeParentNode('font') ]] [[company.currency_id.symbol]]</font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_8">
+ <font face="Helvetica" size="9.0">[[ (e[9]!='' and formatLang(e[9])) or removeParentNode('font') ]] [[company.currency_id.symbol]]</font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_8">
+ <font face="Helvetica" size="9.0">[[ (e[10]!='' and formatLang(e[10])) or removeParentNode('font') ]] [[company.currency_id.symbol]]</font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_8">
+ <font face="Helvetica" size="9.0">[[ (e[11]!='' and formatLang(e[11])) or removeParentNode('font') ]] [[company.currency_id.symbol]]</font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_8">
+ <font face="Helvetica" size="9.0">[[ (e[12]!='' and formatLang(e[12])) or removeParentNode('font') ]] [[company.currency_id.symbol]]</font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9_Bold">[[ formatLang(e[13]) ]] [[company.currency_id.symbol]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="P2">
+ <font color="white"> </font>
+ </para>
+ </section>
+ <para style="P2">
+ <font color="white"> </font>
+ </para>
+ </section>
+ <section>
+ <para style="terp_default_1">[[ repeatIn(get_months_tol(),'t') ]]</para>
+ <blockTable colWidths="71.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,31.0,35.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>
+ <para style="P2">
+ <font color="white"> </font>
+ </para>
+ </section>
+ <para style="P6">
+ <font color="white"> </font>
+ </para>
+ </story>
+</document>
--- /dev/null
+# -*- 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 time
+
+from osv import osv, fields
+
+class salary_rule_bymonth(osv.osv_memory):
+ _name = 'salary.rule.month'
+# _inherit = 'hr.employee'
+ _description = 'Print Monthly Salary Rule 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),
+# 'rule_id': fields.many2one('hr.salary.rule.category', 'Rule Category', 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
+ datas['ids'] = res.get('employee_ids',[])
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'salary.rule.bymonth',
+ 'datas': datas,
+ }
+
+salary_rule_bymonth()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file