[IMP] hr_payroll: minor changes on payslip report, still major changes are yet to be completed
bzr revid: mtr@mtr-20110405133834-u5u2k3toqfn2brej
This commit is contained in:
parent
55739910e7
commit
440392700c
|
@ -392,7 +392,7 @@
|
||||||
<para style="terp_default_Bold_9">Basic Salary</para>
|
<para style="terp_default_Bold_9">Basic Salary</para>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<para style="terp_default_9">[[ formatLang(o.basic_before_leaves, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] </para>
|
<para style="terp_default_9">[[ formatLang(o.contract_id.wage, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] </para>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<para style="terp_default_Bold_9">Leaved Deduction</para>
|
<para style="terp_default_Bold_9">Leaved Deduction</para>
|
||||||
|
@ -521,35 +521,7 @@
|
||||||
<para style="terp_default_space">
|
<para style="terp_default_space">
|
||||||
<font color="white"> </font>
|
<font color="white"> </font>
|
||||||
</para>
|
</para>
|
||||||
<blockTable colWidths="269.0,134.0,135.0" style="Table21">
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<para style="terp_tblheader_Details">Other Lines</para>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<para style="terp_tblheader_Details_Right">Payments - [[ get_month(o) ]]</para>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<para style="terp_tblheader_Details_Right">Deduction -[[ get_month(o) ]]</para>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</blockTable>
|
|
||||||
<section>
|
|
||||||
<para style="terp_default_9">[[repeatIn(get_others(o.line_ids),'ol') ]]</para>
|
|
||||||
<blockTable colWidths="269.0,134.0,135.0" style="Table22">
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<para style="terp_default_9">[[ ol.code or '' ]]</para>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<para style="terp_default_Right_9">[[ ol.type in ['advance','loan','otherpay'] and formatLang(ol.total, dp='Account') or '' ]] [[ ol.type in ['advance','loan','otherpay'] and o.company_id and o.company_id.currency_id.symbol or '' ]]</para>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<para style="terp_default_Right_9">[[ ol.type in ['otherdeduct','installment'] and formatLang(ol.total, dp='Account') or '' ]] [[ ol.type in ['otherdeduct','installment'] and o.company_id and o.company_id.currency_id.symbol or '' ]]</para>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</blockTable>
|
|
||||||
</section>
|
|
||||||
<blockTable colWidths="269.0,177.0,93.0" style="Table5">
|
<blockTable colWidths="269.0,177.0,93.0" style="Table5">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|
|
@ -36,33 +36,21 @@ class payslip_report(report_sxw.rml_parse):
|
||||||
'get_earnings': self.get_earnings,
|
'get_earnings': self.get_earnings,
|
||||||
'get_deductions':self.get_deductions,
|
'get_deductions':self.get_deductions,
|
||||||
'get_leave':self.get_leave,
|
'get_leave':self.get_leave,
|
||||||
'get_others':self.get_others,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
def convert(self, amount, cur):
|
def convert(self, amount, cur):
|
||||||
amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur)
|
amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur)
|
||||||
return amt_en
|
return amt_en
|
||||||
|
|
||||||
def get_others(self, obj):
|
|
||||||
payslip_line = self.pool.get('hr.payslip.line')
|
|
||||||
res = []
|
|
||||||
ids = []
|
|
||||||
for id in range(len(obj)):
|
|
||||||
if obj[id].category_id.type in ('advance', 'loan', 'otherpay', 'otherdeduct', 'installment'):
|
|
||||||
ids.append(obj[id].id)
|
|
||||||
if ids:
|
|
||||||
res = payslip_line.browse(self.cr, self.uid, ids)
|
|
||||||
return res
|
|
||||||
|
|
||||||
def get_leave(self, obj):
|
def get_leave(self, obj):
|
||||||
payslip_line = self.pool.get('hr.payslip.line')
|
payslip_line = self.pool.get('hr.payslip.line')
|
||||||
res = []
|
res = []
|
||||||
ids = []
|
# ids = []
|
||||||
for id in range(len(obj)):
|
# for id in range(len(obj)):
|
||||||
if obj[id].type == 'leaves':
|
# if obj[id].type == 'leaves':
|
||||||
ids.append(obj[id].id)
|
# ids.append(obj[id].id)
|
||||||
if ids:
|
# if ids:
|
||||||
res = payslip_line.browse(self.cr, self.uid, ids)
|
# res = payslip_line.browse(self.cr, self.uid, ids)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def get_earnings(self, obj):
|
def get_earnings(self, obj):
|
||||||
|
@ -70,7 +58,7 @@ class payslip_report(report_sxw.rml_parse):
|
||||||
res = []
|
res = []
|
||||||
ids = []
|
ids = []
|
||||||
for id in range(len(obj)):
|
for id in range(len(obj)):
|
||||||
if obj[id].category_id.type == 'allowance' and obj[id].type != 'leaves':
|
if obj[id].category_id.parent_id.name == 'Allowance':
|
||||||
ids.append(obj[id].id)
|
ids.append(obj[id].id)
|
||||||
if ids:
|
if ids:
|
||||||
res = payslip_line.browse(self.cr, self.uid, ids)
|
res = payslip_line.browse(self.cr, self.uid, ids)
|
||||||
|
@ -81,7 +69,7 @@ class payslip_report(report_sxw.rml_parse):
|
||||||
res = []
|
res = []
|
||||||
ids = []
|
ids = []
|
||||||
for id in range(len(obj)):
|
for id in range(len(obj)):
|
||||||
if obj[id].category_id.type == 'deduction' and obj[id].type != 'leaves':
|
if obj[id].category_id.parent_id.name == 'Deduction':
|
||||||
ids.append(obj[id].id)
|
ids.append(obj[id].id)
|
||||||
if ids:
|
if ids:
|
||||||
res = payslip_line.browse(self.cr, self.uid, ids)
|
res = payslip_line.browse(self.cr, self.uid, ids)
|
||||||
|
|
Loading…
Reference in New Issue