<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
    <!-- Wage Base -->
    <record id="rule_parameter_us_nv_suta_wage_base" model="hr.rule.parameter">
        <field name="name">US NV Nevada SUTA Wage Base</field>
        <field name="code">us_nv_suta_wage_base</field>
        <field name="country_id" ref="base.us"/>
    </record>
    <record id="rule_parameter_us_nv_suta_wage_base_2020" model="hr.rule.parameter.value">
        <field name="parameter_value">32500.00</field>
        <field name="rule_parameter_id" ref="rule_parameter_us_nv_suta_wage_base"/>
        <field name="date_from" eval="datetime(2020, 1, 1).date()"/>
    </record>

    <!-- Rate -->
    <record id="rule_parameter_us_nv_suta_rate" model="hr.rule.parameter">
        <field name="name">US NV Nevada SUTA Rate</field>
        <field name="code">us_nv_suta_rate</field>
        <field name="country_id" ref="base.us"/>
    </record>
    <data noupdate="1">
        <record id="rule_parameter_us_nv_suta_rate_2020" model="hr.rule.parameter.value">
            <field name="parameter_value">2.95</field>
            <field name="rule_parameter_id" ref="rule_parameter_us_nv_suta_rate"/>
            <field name="date_from" eval="datetime(2020, 1, 1).date()"/>
        </record>
    </data>

    <!-- Partners and Contribution Registers -->
    <record id="res_partner_us_nv_dor" model="res.partner">
        <field name="name">US Nevada -  Department of Employment, Training, and Rehabilitation, Employment Security Division - Unemployment Tax</field>
    </record>

    <!-- Categories -->

    <!-- Rules -->
    <record id="hr_payroll_rule_er_us_nv_suta" model="hr.salary.rule">
        <field name="sequence" eval="450"/>
        <field name="struct_id" ref="hr_payroll_structure"/>
        <field name="category_id" ref="hr_payroll_category_er_us_suta"/>
        <field name="name">ER: US NV Nevada State Unemployment (RT-6)</field>
        <field name="code">ER_US_NV_SUTA</field>
        <field name="condition_select">python</field>
        <field name="condition_python">result, _ = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_nv_suta_wage_base', rate='us_nv_suta_rate', state_code='NV')</field>
        <field name="amount_select">code</field>
        <field name="amount_python_compute">result, result_rate = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_nv_suta_wage_base', rate='us_nv_suta_rate', state_code='NV')</field>
        <field name="partner_id" ref="res_partner_us_nv_dor"/>
        <field name="appears_on_payslip" eval="False"/>
    </record>

</odoo>