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}"/>
|
||||
</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">
|
||||
<h4 class="fclk-payslip-section-title">Deductions</h4>
|
||||
<div class="fclk-payslip-row">
|
||||
<span>CPP</span>
|
||||
<span t-field="payslip.employee_cpp" t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
||||
</div>
|
||||
<div class="fclk-payslip-row" t-if="payslip.employee_cpp2">
|
||||
<span>CPP2</span>
|
||||
<span t-field="payslip.employee_cpp2" t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
||||
</div>
|
||||
<div class="fclk-payslip-row">
|
||||
<span>EI</span>
|
||||
<span t-field="payslip.employee_ei" t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
||||
</div>
|
||||
<div class="fclk-payslip-row">
|
||||
<span>Income Tax</span>
|
||||
<span t-field="payslip.employee_income_tax" t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
||||
</div>
|
||||
<div class="fclk-payslip-row fclk-payslip-row--total">
|
||||
<span>Total Deductions</span>
|
||||
<span t-field="payslip.total_employee_deductions" t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
||||
</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>
|
||||
<h4 class="fclk-payslip-section-title">Breakdown</h4>
|
||||
<t t-foreach="payslip.line_ids" t-as="line">
|
||||
<div t-attf-class="fclk-payslip-row#{' fclk-payslip-row--total' if line.code == 'NET' else ''}">
|
||||
<span t-esc="line.name"/>
|
||||
<span t-field="line.total"
|
||||
t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
||||
</div>
|
||||
</t>
|
||||
<t t-if="not payslip.line_ids">
|
||||
<div class="fclk-payslip-row">
|
||||
<span>Gross</span>
|
||||
<span t-field="payslip.gross_wage"
|
||||
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.net_wage"
|
||||
t-options="{'widget': 'monetary', 'display_currency': payslip.currency_id}"/>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
|
||||
<t t-if="has_pdf">
|
||||
|
||||
Reference in New Issue
Block a user