[FIX] l10n_us_hr_payroll: 2021 fixes found during porting

This commit is contained in:
Jared Kipe
2021-02-22 14:28:42 -08:00
parent 6d0a99313a
commit a644613701
7 changed files with 19 additions and 25 deletions

View File

@@ -13,10 +13,10 @@
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
</record>
<!-- https://labor.mo.gov/news/press-releases/missouri-employers-receive-unemployment-tax-rate-reduction-2021#:~:text=Jefferson%20City%2C%20MO%20%E2%80%93%20Effective%20January,as%20of%20January%201%2C%202021. -->
<record id="rule_parameter_us_mo_suta_wage_base_2020" model="hr.rule.parameter.value">
<record id="rule_parameter_us_mo_suta_wage_base_2021" model="hr.rule.parameter.value">
<field name="parameter_value">11000.0</field>
<field name="rule_parameter_id" ref="rule_parameter_us_mo_suta_wage_base"/>
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
<field name="date_from" eval="datetime(2021, 1, 1).date()"/>
</record>
</data>

View File

@@ -77,10 +77,10 @@
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
</record>
<!-- https://www.nj.gov/labor/ea/employer-services/rate-info/ -->
<record id="rule_parameter_us_nj_sdi_ee_rate_2020" model="hr.rule.parameter.value">
<record id="rule_parameter_us_nj_sdi_ee_rate_2021" model="hr.rule.parameter.value">
<field name="parameter_value">0.47</field>
<field name="rule_parameter_id" ref="rule_parameter_us_nj_sdi_ee_rate"/>
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
<field name="date_from" eval="datetime(2021, 1, 1).date()"/>
</record>
</data>
@@ -140,10 +140,10 @@
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
</record>
<!-- https://www.nj.gov/labor/ea/employer-services/rate-info/ -->
<record id="rule_parameter_us_nj_fli_ee_rate_2020" model="hr.rule.parameter.value">
<record id="rule_parameter_us_nj_fli_ee_rate_2021" model="hr.rule.parameter.value">
<field name="parameter_value">0.28</field>
<field name="rule_parameter_id" ref="rule_parameter_us_nj_fli_ee_rate"/>
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
<field name="date_from" eval="datetime(2021, 1, 1).date()"/>
</record>
</data>

View File

@@ -98,7 +98,7 @@
<!-- Bullet 4 in: https://resources.paidleave.wa.gov/premium-calculator-->
<!-- "Employers may withhold up to 63.33% of the total premium from an employee."-->
<record id="rule_parameter_us_wa_fml_rate_ee_2021" model="hr.rule.parameter.value">
<field name="parameter_value">66.33</field>
<field name="parameter_value">63.33</field>
<field name="rule_parameter_id" ref="rule_parameter_us_wa_fml_rate_ee"/>
<field name="date_from" eval="datetime(2021, 1, 1).date()"/>
</record>
@@ -118,7 +118,7 @@
<!-- Bullet 4 also says in: https://resources.paidleave.wa.gov/premium-calculator-->
<!-- "The employer is responsible for paying the other 36.67%"-->
<record id="rule_parameter_us_wa_fml_rate_er_2021" model="hr.rule.parameter.value">
<field name="parameter_value">33.67</field>
<field name="parameter_value">36.67</field>
<field name="rule_parameter_id" ref="rule_parameter_us_wa_fml_rate_er"/>
<field name="date_from" eval="datetime(2021, 1, 1).date()"/>
</record>

View File

@@ -1,8 +1,6 @@
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
from .general import _state_applies, sit_wage
import logging
_logger = logging.getLogger(__name__)
def me_maine_state_income_withholding(payslip, categories, worked_days, inputs):
@@ -15,23 +13,19 @@ def me_maine_state_income_withholding(payslip, categories, worked_days, inputs):
state_code = 'ME'
if not _state_applies(payslip, state_code):
_logger.warn('state doesnt apply')
return 0.0, 0.0
# Determine Wage
wage = sit_wage(payslip, categories)
if not wage:
_logger.warn('no wage')
return 0.0, 0.0
filing_status = payslip.contract_id.us_payroll_config_value('me_w4me_sit_filing_status')
if not filing_status:
_logger.warn('exempt file status')
return 0.0, 0.0
exempt = payslip.contract_id.us_payroll_config_value('state_income_tax_exempt')
if exempt:
_logger.warn('generic exemption')
return 0.0, 0.0
pay_periods = payslip.dict.get_pay_periods_in_year()

View File

@@ -6,11 +6,11 @@ from .common import TestUsPayslip
class TestUsSCPayslip(TestUsPayslip):
###
# 2021 Taxes and Rates
# 2020 Taxes and Rates
###
SC_UNEMP_MAX_WAGE = 14000.0
SC_UNEMP = 0.55
# Calculation based on https://dor.sc.gov/forms-site/Forms/WH1603F_2021.pdf
# Calculation based on https://dor.sc.gov/forms-site/Forms/WH1603F_2020.pdf
def _test_sit(self, wage, additional_withholding, exempt, allowances, schedule_pay, date_start, expected_withholding):
employee = self._createEmployee()
@@ -28,9 +28,9 @@ class TestUsSCPayslip(TestUsPayslip):
self._log('Computed period tax: ' + str(expected_withholding))
self.assertPayrollAlmostEqual(cats.get('EE_US_SIT', 0.0), -expected_withholding)
def test_2021_taxes_example(self):
self._test_er_suta('SC', self.SC_UNEMP, date(2021, 1, 1), wage_base=self.SC_UNEMP_MAX_WAGE)
self._test_sit(750.0, 0.0, False, 3.0, 'weekly', date(2021, 1, 1), 28.73)
self._test_sit(800.0, 0.0, True, 0.0, 'weekly', date(2021, 1, 1), 0.00)
self._test_sit(9000.0, 0.0, False, 0.0, 'monthly', date(2021, 1, 1), 594.61)
self._test_sit(5000.0, 10.0, False, 2.0, 'semi-monthly', date(2021, 1, 1), 316.06)
def test_2020_taxes_example(self):
self._test_er_suta('SC', self.SC_UNEMP, date(2020, 1, 1), wage_base=self.SC_UNEMP_MAX_WAGE)
self._test_sit(750.0, 0.0, False, 3.0, 'weekly', date(2020, 1, 1), 28.73)
self._test_sit(800.0, 0.0, True, 0.0, 'weekly', date(2020, 1, 1), 0.00)
self._test_sit(9000.0, 0.0, False, 0.0, 'monthly', date(2020, 1, 1), 594.61)
self._test_sit(5000.0, 10.0, False, 2.0, 'semi-monthly', date(2020, 1, 1), 316.06)

View File

@@ -62,7 +62,7 @@ class TestUsWAPayslip(TestUsPayslip):
self._log('2020 Washington tax first payslip:')
payslip = self._createPayslip(employee, '2020-01-01', '2020-01-31')
hours_in_period = payslip.worked_days_line_ids.filtered(lambda l: l.code == 'WORK100').number_of_hours
self.assertEqual(hours_in_period, 184) # only asserted to test algorithm
self.assertPayrollAlmostEqual(hours_in_period, 184) # only asserted to test algorithm
payslip.compute_sheet()
rules = self._getRules(payslip)

View File

@@ -12,8 +12,8 @@ class TestUsWAPayslip(TestUsPayslip):
WA_UNEMP_RATE = 2.16
WA_FML_MAX_WAGE = 142800.00
WA_FML_RATE = 0.4
WA_FML_RATE_EE = 66.33
WA_FML_RATE_ER = 33.67
WA_FML_RATE_EE = 63.33
WA_FML_RATE_ER = 36.67
def setUp(self):
super(TestUsWAPayslip, self).setUp()