odex30_standard/exp_payroll_custom/templates/report_payslip.xml

85 lines
3.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_payslip_inherit" inherit_id="exp_hr_payroll.report_payslip">
<xpath expr="//span[@t-field='o.employee_id.identification_id']" position="replace">
<span t-field="o.employee_id.identity_number"/>
</xpath>
<xpath expr="//div/table[2]/tbody" position="inside">
<tr>
<td colspan="2">
<strong>Total Allowances</strong>
</td>
<td>
<strong>
<span t-esc="sum([s.amount for s in o.allowance_ids])"
t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
</strong>
</td>
<td>
<strong>
<span t-esc="sum([s.total for s in o.allowance_ids])"
t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
</strong>
</td>
</tr>
<tr>
<td colspan="2">
<strong>Total Deductions</strong>
</td>
<td>
<strong>
<span t-esc="sum([s.amount for s in o.deduction_ids])"
t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
</strong>
</td>
<td>
<strong>
<span t-esc="sum([s.total for s in o.deduction_ids])"
t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
</strong>
</td>
</tr>
<tr>
<td colspan="2">
<strong>Total Loans</strong>
</td>
<td>
<strong>
<span t-esc="sum([s.amount for s in o.loan_ids])"
t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
</strong>
</td>
<td>
<!-- <strong>-->
<!-- <span t-esc="sum([s.amount for s in o.loan_ids])"-->
<!-- t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>-->
<!-- </strong>-->
</td>
</tr>
<tfoot>
<tr>
<td colspan="2">
<strong>NET</strong>
</td>
<td>
<strong>
<span t-esc="round( sum([s.amount for s in o.line_ids.filtered(lambda line: line.appears_on_payslip)]) + sum([s.amount for s in o.loan_ids]), 2)"
t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
</strong>
</td>
<td>
<strong>
<span t-esc="round(sum([s.total for s in o.line_ids.filtered(lambda line: line.appears_on_payslip)]) + sum([s.amount for s in o.loan_ids]), 2)"
t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/>
</strong>
</td>
</tr>
</tfoot>
</xpath>
</template>
</odoo>