[FIX] l10n_pe_hr_payroll: add manual override for "IR 5th Cat." calculation

This commit is contained in:
Jared Kipe
2022-12-12 22:02:01 +00:00
parent ae61b2c8d1
commit 43e266d779
2 changed files with 13 additions and 0 deletions

View File

@@ -44,6 +44,15 @@
<!-- EE Rules -->
<record id="input_type_ee_ir_5ta_cat" model="hr.payslip.input.type">
<field name="name">Manual IR 5th Cat.</field>
<field name="code">EE_PE_IR_5TA_CAT</field>
<field name="country_id" ref="base.pe" />
<field name="struct_ids" eval="[
(4, ref('l10n_pe_hr_payroll.hr_payroll_structure')),
]" />
</record>
<record id="hr_payroll_rule_ee_ir_5ta_cat" model="hr.salary.rule">
<field name="sequence" eval="196"/>
<field name="struct_id" ref="hr_payroll_structure"/>

View File

@@ -8,6 +8,10 @@ _logger = logging.getLogger(__name__)
def ir_5ta_cat(payslip, categories, worked_days, inputs):
if inputs.EE_PE_IR_5TA_CAT:
# cannot look for amount because it could be forced to zero
return inputs.EE_PE_IR_5TA_CAT.amount, 100.0
basic_wage = categories.BASIC
if payslip.dict.contract_id.pe_payroll_config_value('ee_5ta_cat_exempt'):
return 0.0, 0.0