fix(fusion_clock): build paystub from payslip.line_ids, not fusion_payroll fields
entech runs the enterprise hr_payroll module (not the custom fusion_payroll), whose hr.payslip lacks employee_cpp/ytd_* fields. Render the inline paystub from payslip.line_ids (name + total) so it works on any payroll provider. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -80,54 +80,30 @@
|
|||||||
t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Deductions -->
|
<!-- Breakdown — iterate the payslip's computed lines so this
|
||||||
|
works for any payroll provider (enterprise hr_payroll or
|
||||||
|
the custom fusion_payroll), independent of one field schema. -->
|
||||||
<div class="fclk-status-card fclk-payslip-section">
|
<div class="fclk-status-card fclk-payslip-section">
|
||||||
<h4 class="fclk-payslip-section-title">Deductions</h4>
|
<h4 class="fclk-payslip-section-title">Breakdown</h4>
|
||||||
<div class="fclk-payslip-row">
|
<t t-foreach="payslip.line_ids" t-as="line">
|
||||||
<span>CPP</span>
|
<div t-attf-class="fclk-payslip-row#{' fclk-payslip-row--total' if line.code == 'NET' else ''}">
|
||||||
<span t-field="payslip.employee_cpp" t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
<span t-esc="line.name"/>
|
||||||
</div>
|
<span t-field="line.total"
|
||||||
<div class="fclk-payslip-row" t-if="payslip.employee_cpp2">
|
t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
||||||
<span>CPP2</span>
|
</div>
|
||||||
<span t-field="payslip.employee_cpp2" t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
</t>
|
||||||
</div>
|
<t t-if="not payslip.line_ids">
|
||||||
<div class="fclk-payslip-row">
|
<div class="fclk-payslip-row">
|
||||||
<span>EI</span>
|
<span>Gross</span>
|
||||||
<span t-field="payslip.employee_ei" t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
<span t-field="payslip.gross_wage"
|
||||||
</div>
|
t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
||||||
<div class="fclk-payslip-row">
|
</div>
|
||||||
<span>Income Tax</span>
|
<div class="fclk-payslip-row fclk-payslip-row--total">
|
||||||
<span t-field="payslip.employee_income_tax" t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
<span>Net</span>
|
||||||
</div>
|
<span t-field="payslip.net_wage"
|
||||||
<div class="fclk-payslip-row fclk-payslip-row--total">
|
t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
||||||
<span>Total Deductions</span>
|
</div>
|
||||||
<span t-field="payslip.total_employee_deductions" t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
</t>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Year to date -->
|
|
||||||
<div class="fclk-status-card fclk-payslip-section">
|
|
||||||
<h4 class="fclk-payslip-section-title">Year to Date</h4>
|
|
||||||
<div class="fclk-payslip-row">
|
|
||||||
<span>Gross</span>
|
|
||||||
<span t-field="payslip.ytd_gross" t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
|
||||||
</div>
|
|
||||||
<div class="fclk-payslip-row">
|
|
||||||
<span>CPP</span>
|
|
||||||
<span t-field="payslip.ytd_cpp" t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
|
||||||
</div>
|
|
||||||
<div class="fclk-payslip-row">
|
|
||||||
<span>EI</span>
|
|
||||||
<span t-field="payslip.ytd_ei" t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
|
||||||
</div>
|
|
||||||
<div class="fclk-payslip-row">
|
|
||||||
<span>Income Tax</span>
|
|
||||||
<span t-field="payslip.ytd_income_tax" t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
|
||||||
</div>
|
|
||||||
<div class="fclk-payslip-row fclk-payslip-row--total">
|
|
||||||
<span>Net</span>
|
|
||||||
<span t-field="payslip.ytd_net" t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<t t-if="has_pdf">
|
<t t-if="has_pdf">
|
||||||
|
|||||||
Reference in New Issue
Block a user