mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[FIX] l10n_us_hr_payroll: Fix parameters dates, python errors, and result values
Fixed parameter dates in Hawaii, Python errors in wa_washington.xml, some results in Alabama and Iowa, and removing 2019 info in test_us_payslip_2020.py
This commit is contained in:
@@ -33,10 +33,10 @@
|
|||||||
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||||
</record>
|
</record>
|
||||||
<!-- https://labor.hawaii.gov/ui/tax-rate-schedule-and-weekly-benefit-amount/ -->
|
<!-- https://labor.hawaii.gov/ui/tax-rate-schedule-and-weekly-benefit-amount/ -->
|
||||||
<record id="rule_parameter_us_hi_suta_rate_2020" model="hr.rule.parameter.value">
|
<record id="rule_parameter_us_hi_suta_rate_2021" model="hr.rule.parameter.value">
|
||||||
<field name="parameter_value">5.2</field>
|
<field name="parameter_value">5.2</field>
|
||||||
<field name="rule_parameter_id" ref="rule_parameter_us_hi_suta_rate"/>
|
<field name="rule_parameter_id" ref="rule_parameter_us_hi_suta_rate"/>
|
||||||
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
<field name="date_from" eval="datetime(2021, 1, 1).date()"/>
|
||||||
</record>
|
</record>
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
|
|||||||
@@ -202,8 +202,7 @@
|
|||||||
<field name="condition_select">python</field>
|
<field name="condition_select">python</field>
|
||||||
<field name="condition_python">result = is_us_state(payslip, 'WA') and payslip.contract_id.us_payroll_config_value('workers_comp_ee_code') and worked_days.WORK100 and worked_days.WORK100.number_of_hours and payslip.rule_parameter(payslip.contract_id.us_payroll_config_value('workers_comp_er_code')) </field>
|
<field name="condition_python">result = is_us_state(payslip, 'WA') and payslip.contract_id.us_payroll_config_value('workers_comp_ee_code') and worked_days.WORK100 and worked_days.WORK100.number_of_hours and payslip.rule_parameter(payslip.contract_id.us_payroll_config_value('workers_comp_er_code')) </field>
|
||||||
<field name="amount_select">code</field>
|
<field name="amount_select">code</field>
|
||||||
<field name="amount_python_compute">result, result_rate = worked_days.WORK100.number_of_hours,
|
<field name="amount_python_compute">result, result_rate = worked_days.WORK100.number_of_hours, -payslip.rule_parameter(payslip.contract_id.us_payroll_config_value('workers_comp_er_code'))
|
||||||
-payslip.rule_parameter(payslip.contract_id.us_payroll_config_value('workers_comp_er_code'))
|
|
||||||
</field>
|
</field>
|
||||||
<field name="partner_id" ref="res_partner_us_wa_dor_lni"/>
|
<field name="partner_id" ref="res_partner_us_wa_dor_lni"/>
|
||||||
<field name="appears_on_payslip" eval="False"/>
|
<field name="appears_on_payslip" eval="False"/>
|
||||||
@@ -218,8 +217,7 @@
|
|||||||
<field name="condition_select">python</field>
|
<field name="condition_select">python</field>
|
||||||
<field name="condition_python">result = is_us_state(payslip, 'WA') and payslip.contract_id.us_payroll_config_value('workers_comp_ee_code') and worked_days.WORK100 and worked_days.WORK100.number_of_hours and payslip.rule_parameter(payslip.contract_id.us_payroll_config_value('workers_comp_ee_code'))</field>
|
<field name="condition_python">result = is_us_state(payslip, 'WA') and payslip.contract_id.us_payroll_config_value('workers_comp_ee_code') and worked_days.WORK100 and worked_days.WORK100.number_of_hours and payslip.rule_parameter(payslip.contract_id.us_payroll_config_value('workers_comp_ee_code'))</field>
|
||||||
<field name="amount_select">code</field>
|
<field name="amount_select">code</field>
|
||||||
<field name="amount_python_compute">result, result_rate = worked_days.WORK100.number_of_hours,
|
<field name="amount_python_compute">result, result_rate = worked_days.WORK100.number_of_hours, -payslip.rule_parameter(payslip.contract_id.us_payroll_config_value('workers_comp_ee_code'))
|
||||||
-payslip.rule_parameter(payslip.contract_id.us_payroll_config_value('workers_comp_ee_code'))
|
|
||||||
</field>
|
</field>
|
||||||
<field name="partner_id" ref="res_partner_us_wa_dor_lni"/>
|
<field name="partner_id" ref="res_partner_us_wa_dor_lni"/>
|
||||||
<field name="appears_on_payslip" eval="True"/>
|
<field name="appears_on_payslip" eval="True"/>
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ class TestUsALPayslip(TestUsPayslip):
|
|||||||
|
|
||||||
def test_2021_taxes_example(self):
|
def test_2021_taxes_example(self):
|
||||||
self._test_er_suta('AL', self.AL_UNEMP, date(2021, 1, 1), wage_base=self.AL_UNEMP_MAX_WAGE)
|
self._test_er_suta('AL', self.AL_UNEMP, date(2021, 1, 1), wage_base=self.AL_UNEMP_MAX_WAGE)
|
||||||
self._test_sit(10000.0, 'S', False, 0.0, 1.0, 'weekly', date(2021, 1, 1), 349.08)
|
self._test_sit(10000.0, 'S', False, 0.0, 1.0, 'weekly', date(2021, 1, 1), 349.37)
|
||||||
self._test_sit(850.0, 'M', False, 0.0, 2.0, 'weekly', date(2021, 1, 1), 29.98)
|
self._test_sit(850.0, 'M', False, 0.0, 2.0, 'weekly', date(2021, 1, 1), 30.00)
|
||||||
self._test_sit(5000.0, 'H', False, 0.0, 2.0, 'bi-weekly', date(2021, 1, 1), 191.15)
|
self._test_sit(5000.0, 'H', False, 0.0, 2.0, 'bi-weekly', date(2021, 1, 1), 191.33)
|
||||||
self._test_sit(20000.0, 'MS', False, 2.0, 0, 'monthly', date(2021, 1, 1), 757.6)
|
self._test_sit(20000.0, 'MS', False, 2.0, 0, 'monthly', date(2021, 1, 1), 758.86)
|
||||||
self._test_sit(5500.0, '', True, 2.0, 150, 'weekly', date(2021, 1, 1), 0.00)
|
self._test_sit(5500.0, '', True, 2.0, 150, 'weekly', date(2021, 1, 1), 0.00)
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ class TestUsIAPayslip(TestUsPayslip):
|
|||||||
|
|
||||||
def test_2021_taxes_example(self):
|
def test_2021_taxes_example(self):
|
||||||
self._test_er_suta('IA', self.IA_UNEMP, date(2021, 1, 1), wage_base=self.IA_UNEMP_MAX_WAGE)
|
self._test_er_suta('IA', self.IA_UNEMP, date(2021, 1, 1), wage_base=self.IA_UNEMP_MAX_WAGE)
|
||||||
self._test_sit(2100.0, False, 0.0, 3.0, 'bi-weekly', date(2021, 1, 1), 79.13)
|
self._test_sit(2100.0, False, 0.0, 3.0, 'bi-weekly', date(2021, 1, 1), 79.31)
|
||||||
self._test_sit(3000.0, True, 10.0, 1.0, 'bi-weekly', date(2021, 1, 1), 0.00)
|
self._test_sit(3000.0, True, 10.0, 1.0, 'bi-weekly', date(2021, 1, 1), 0.00)
|
||||||
self._test_sit(300.0, False, 0.0, 1.0, 'weekly', date(2021, 1, 1), 6.14)
|
self._test_sit(300.0, False, 0.0, 1.0, 'weekly', date(2021, 1, 1), 6.14)
|
||||||
self._test_sit(5000.0, False, 0.0, 1.0, 'monthly', date(2021, 1, 1), 217.60)
|
self._test_sit(5000.0, False, 0.0, 1.0, 'monthly', date(2021, 1, 1), 218.06)
|
||||||
self._test_sit(7500.0, False, 10.0, 2.0, 'semi-monthly', date(2021, 1, 1), 420.87)
|
self._test_sit(7500.0, False, 10.0, 2.0, 'semi-monthly', date(2021, 1, 1), 421.71)
|
||||||
|
|||||||
@@ -39,16 +39,6 @@ class TestUsPayslip2020(TestUsPayslip):
|
|||||||
contract = self._createContract(employee, wage=salary)
|
contract = self._createContract(employee, wage=salary)
|
||||||
self._log(contract.read())
|
self._log(contract.read())
|
||||||
|
|
||||||
self._log('2019 tax last slip')
|
|
||||||
payslip = self._createPayslip(employee, '2019-12-01', '2019-12-31')
|
|
||||||
self.assertEqual(payslip.contract_id, contract)
|
|
||||||
self._log(payslip.read())
|
|
||||||
process_payslip(payslip)
|
|
||||||
|
|
||||||
# Ensure amounts are there, they shouldn't be added in the next year...
|
|
||||||
cats = self._getCategories(payslip)
|
|
||||||
self.assertTrue(cats['ER_US_940_FUTA'], ' Value should be well above whatever was available that year!')
|
|
||||||
|
|
||||||
self._log('2020 tax first payslip:')
|
self._log('2020 tax first payslip:')
|
||||||
payslip = self._createPayslip(employee, '2020-01-01', '2020-01-31')
|
payslip = self._createPayslip(employee, '2020-01-01', '2020-01-31')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user