<?xml version="1.0" encoding="UTF-8" ?>
<odoo>

    <!-- Parameters -->
    <record id="rule_parameter_ee_ir_4ta_cat" model="hr.rule.parameter">
        <field name="name">EE: IR 4ta Cat.</field>
        <field name="code">ee_ir_4ta_cat</field>
        <field name="country_id" ref="base.pe"/>
    </record>
    <record id="rule_parameter_ee_ir_4ta_cat_2020" model="hr.rule.parameter.value">
        <field name="parameter_value">8.0</field>
        <field name="rule_parameter_id" ref="rule_parameter_ee_ir_4ta_cat"/>
        <field name="date_from" eval="datetime(2020, 1, 1).date()"/>
    </record>

    <!-- EE Rules -->
    <record id="hr_payroll_rule_ee_ir_4ta_cat" model="hr.salary.rule">
        <field name="sequence" eval="190"/>
        <field name="struct_id" ref="hr_payroll_structure_4ta_cat"/>
        <field name="category_id" ref="hr_payroll_category_ee_ir_4ta_cat"/>
        <field name="name">EE: PE IR 4th Cat.</field>
        <field name="code">EE_PE_IR_4TA_CAT</field>
        <field name="condition_select">python</field>
        <field name="condition_python">result, _ = ir_4ta_cat(payslip, categories, worked_days, inputs)</field>
        <field name="amount_select">code</field>
        <field name="amount_python_compute">result, result_rate = ir_4ta_cat(payslip, categories, worked_days, inputs)</field>
        <field name="appears_on_payslip" eval="True"/>
        <field name="partner_id" ref="partner_sunat"/>
    </record>

</odoo>
