From c0a7d06c4bc0294cc709003332b3f5155eb528e1 Mon Sep 17 00:00:00 2001 From: Jared Self Date: Mon, 11 Jan 2021 10:06:37 -0700 Subject: [PATCH] KY Kentucky --- l10n_us_hr_payroll/data/state/ks_kansas.xml | 4 +++ l10n_us_hr_payroll/data/state/ky_kentucky.xml | 15 ++++++++ .../tests/test_us_ks_kansas_payslip_2021.py | 36 +++++++++++++++++++ .../tests/test_us_ky_kentucky_payslip_2021.py | 36 +++++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100755 l10n_us_hr_payroll/tests/test_us_ks_kansas_payslip_2021.py create mode 100755 l10n_us_hr_payroll/tests/test_us_ky_kentucky_payslip_2021.py diff --git a/l10n_us_hr_payroll/data/state/ks_kansas.xml b/l10n_us_hr_payroll/data/state/ks_kansas.xml index 5b59d2b7..d69b6d37 100644 --- a/l10n_us_hr_payroll/data/state/ks_kansas.xml +++ b/l10n_us_hr_payroll/data/state/ks_kansas.xml @@ -7,6 +7,7 @@ + 14000.0 @@ -21,6 +22,7 @@ + 2.7 @@ -34,6 +36,7 @@ + { 'weekly' : 43.27, @@ -55,6 +58,7 @@ + { 'single': { diff --git a/l10n_us_hr_payroll/data/state/ky_kentucky.xml b/l10n_us_hr_payroll/data/state/ky_kentucky.xml index bcdd2274..d9e9b346 100644 --- a/l10n_us_hr_payroll/data/state/ky_kentucky.xml +++ b/l10n_us_hr_payroll/data/state/ky_kentucky.xml @@ -12,6 +12,12 @@ + + + 11100.0 + + + @@ -21,6 +27,7 @@ + 2.7 @@ -40,6 +47,12 @@ + + + 2690 + + + @@ -49,6 +62,8 @@ + + 5.0 diff --git a/l10n_us_hr_payroll/tests/test_us_ks_kansas_payslip_2021.py b/l10n_us_hr_payroll/tests/test_us_ks_kansas_payslip_2021.py new file mode 100755 index 00000000..fba4c2f5 --- /dev/null +++ b/l10n_us_hr_payroll/tests/test_us_ks_kansas_payslip_2021.py @@ -0,0 +1,36 @@ +# 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 TestUsKSPayslip(TestUsPayslip): + ### + # 2021 Taxes and Rates + ### + KS_UNEMP_MAX_WAGE = 14000.0 + KS_UNEMP = 2.7 + # Calculation based on example https://revenue.ky.gov/Forms/42A003(T)%20(12-2019)%202120%20Tax%20Tables.pdf + + def _test_sit(self, wage, filing_status, allowances, additional_withholding, schedule_pay, date_start, expected_withholding): + employee = self._createEmployee() + contract = self._createContract(employee, + wage=wage, + state_id=self.get_us_state('KS'), + ks_k4_sit_filing_status=filing_status, + ks_k4_sit_allowances=allowances, + state_income_tax_additional_withholding=additional_withholding, + 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.assertPayrollAlmostEqual(cats.get('EE_US_SIT', 0.0), -expected_withholding) + + def test_2021_taxes_example(self): + self._test_er_suta('KS', self.KS_UNEMP, date(2021, 1, 1), wage_base=self.KS_UNEMP_MAX_WAGE) + self._test_sit(6250, 'married', 2, 0, 'semi-monthly', date(2021, 1, 1), 290.00) + self._test_sit(5000, 'single', 1, 0, 'monthly', date(2021, 1, 1), 222.00) + self._test_sit(1500, 'married', 0, 0, 'bi-weekly', date(2021, 1, 1), 39.00) + self._test_sit(750, 'single', 2, 10, 'weekly', date(2021, 1, 1), 36.00) diff --git a/l10n_us_hr_payroll/tests/test_us_ky_kentucky_payslip_2021.py b/l10n_us_hr_payroll/tests/test_us_ky_kentucky_payslip_2021.py new file mode 100755 index 00000000..d05add23 --- /dev/null +++ b/l10n_us_hr_payroll/tests/test_us_ky_kentucky_payslip_2021.py @@ -0,0 +1,36 @@ +# 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 TestUsKYPayslip(TestUsPayslip): + ### + # 2021 Taxes and Rates + ### + KY_UNEMP_MAX_WAGE = 11100.0 + KY_UNEMP = 2.7 + # Calculation based on example https://revenue.ky.gov/Forms/42A003(T)%20(12-2019)%202120%20Tax%20Tables.pdf + + def _test_sit(self, wage, additional_withholding, schedule_pay, date_start, expected_withholding): + employee = self._createEmployee() + contract = self._createContract(employee, + wage=wage, + state_id=self.get_us_state('KY'), + state_income_tax_additional_withholding=additional_withholding, + 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('KY', self.KY_UNEMP, date(2021, 1, 1), wage_base=self.KY_UNEMP_MAX_WAGE) + # page 8 of https://revenue.ky.gov/Software-Developer/Software%20Development%20Documents/2021%20Withholding%20Tax%20Tables%20-%20Computer%20Formual%2042A003(T)(12-20)(10-15-20%20DRAFT).pdf + self._test_sit(3020, 0.0, 'monthly', date(2021, 1, 1), 139.79) + self._test_sit(1500, 0.0, 'bi-weekly', date(2021, 1, 1), 69.83) + self._test_sit(1500, 10.0, 'bi-weekly', date(2021, 1, 1), 79.83) + self._test_sit(750, 00.0, 'weekly', date(2021, 1, 1), 34.91) + self._test_sit(7000, 0.0, 'semi-monthly', date(2021, 1, 1), 344.39)