[IMP] l10n_us_hr_payroll: Migrating States for 2021

This commit is contained in:
Jared Kipe
2020-12-31 09:05:56 -08:00
parent 2748a832c3
commit ec89ac312c
2 changed files with 38 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ from . import test_us_ca_california_payslip_2019
from . import test_us_ca_california_payslip_2020
from . import test_us_co_colorado_payslip_2020
from . import test_us_co_colorado_payslip_2021
from . import test_us_ct_connecticut_payslip_2019
from . import test_us_ct_connecticut_payslip_2020

View File

@@ -0,0 +1,37 @@
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
from datetime import date, timedelta
from .common import TestUsPayslip
class TestUsCOPayslip(TestUsPayslip):
###
# 2021 Taxes and Rates
###
CO_UNEMP_MAX_WAGE = 13600.0
CO_UNEMP = 1.7
def _test_sit(self, wage, filing_status, additional_withholding, schedule_pay, date_start, expected_withholding, state_income_tax_exempt=False):
employee = self._createEmployee()
contract = self._createContract(employee,
wage=wage,
state_id=self.get_us_state('CO'),
fed_941_fit_w4_filing_status=filing_status,
state_income_tax_additional_withholding=additional_withholding,
state_income_tax_exempt=state_income_tax_exempt,
schedule_pay=schedule_pay)
payslip = self._createPayslip(employee, date_start, date_start + timedelta(days=7))
payslip.compute_sheet()
cats = self._getCategories(payslip)
self._log('Computed period tax: ' + str(expected_withholding))
self.assertPayrollEqual(cats.get('EE_US_SIT', 0.0), -expected_withholding)
def test_2021_taxes_example(self):
self._test_er_suta('CO', self.CO_UNEMP, date(2021, 1, 1), wage_base=self.CO_UNEMP_MAX_WAGE)
self._test_sit(5000.0, 'married', 0.0, 'semi-monthly', date(2021, 1, 1), 216.07)
self._test_sit(800.0, 'single', 0.0, 'weekly', date(2021, 1, 1), 33.48)
self._test_sit(20000.0, 'married', 0.0, 'quarterly', date(2021, 1, 1), 833.4)
self._test_sit(20000.0, 'married', 10.0, 'quarterly', date(2021, 1, 1), 843.4)
self._test_sit(20000.0, 'married', 0.0, 'quarterly', date(2021, 1, 1), 0.0, True)
self._test_sit(800.0, '', 0.0, 'weekly', date(2021, 1, 1), 0.00)