diff --git a/l10n_us_hr_payroll/data/state/id_idaho.xml b/l10n_us_hr_payroll/data/state/id_idaho.xml index 46dcce9d..80995fcc 100644 --- a/l10n_us_hr_payroll/data/state/id_idaho.xml +++ b/l10n_us_hr_payroll/data/state/id_idaho.xml @@ -7,16 +7,16 @@ - - 40000.0 - - - 41600.0 + + 43000.0 + + + @@ -26,11 +26,7 @@ - - 1.0 - - - + 1.0 @@ -44,170 +40,9 @@ - - { - 'single': { - 'weekly': ( - ( 235, 0.00, 0.000), - ( 264, 0.00, 1.125), - ( 294, 0.00, 3.125), - ( 324, 1.00, 3.625), - ( 353, 2.00, 4.625), - ( 383, 4.00, 5.625), - ( 457, 5.00, 6.625), - ('inf', 10.00, 6.925), - ), - 'bi-weekly': ( - ( 469, 0.00, 0.000), - ( 529, 0.00, 1.125), - ( 588, 1.00, 3.125), - ( 647, 3.00, 3.625), - ( 706, 5.00, 4.625), - ( 766, 7.00, 5.625), - ( 914, 11.00, 6.625), - ('inf', 21.00, 6.925), - ), - 'semi-monthly': ( - ( 508, 0.00, 0.000), - ( 573, 0.00, 1.125), - ( 637, 1.00, 3.125), - ( 701, 3.00, 3.625), - ( 765, 5.00, 4.625), - ( 829, 8.00, 5.625), - ( 990, 12.00, 6.625), - ('inf', 22.00, 6.925), - ), - 'monthly': ( - ( 1017, 0.00, 0.000), - ( 1145, 0.00, 1.125), - ( 1273, 1.00, 3.125), - ( 1402, 5.00, 3.625), - ( 1530, 10.00, 4.625), - ( 1659, 16.00, 5.625), - ( 1980, 23.00, 6.625), - ('inf', 45.00, 6.925), - ), - 'annually': ( - (12200, 0.00, 0.000), - (13741, 0.00, 1.125), - (15281, 17.00, 3.125), - (16822, 65.00, 3.625), - (18362, 121.00, 4.625), - (19903, 192.00, 5.625), - (23754, 279.00, 6.625), - ('inf', 534.00, 6.925), - ), - }, - 'married': { - 'weekly': ( - ( 469, 0.00, 0.000), - ( 529, 0.00, 1.125), - ( 588, 0.00, 3.125), - ( 647, 1.00, 3.625), - ( 706, 2.00, 4.625), - ( 766, 4.00, 5.625), - ( 914, 5.00, 6.625), - ('inf', 10.00, 6.925), - ), - 'bi-weekly': ( - ( 938, 0.00, 0.000), - ( 1057, 0.00, 1.125), - ( 1175, 1.00, 3.125), - ( 1294, 5.00, 3.625), - ( 1412, 9.00, 4.625), - ( 1531, 15.00, 5.625), - ( 1827, 21.00, 6.625), - ('inf', 41.00, 6.925), - ), - 'semi-monthly': ( - ( 1017, 0.00, 0.000), - ( 1145, 0.00, 1.125), - ( 1273, 1.00, 3.125), - ( 1402, 5.00, 3.625), - ( 1530, 10.00, 4.625), - ( 1659, 16.00, 5.625), - ( 1980, 23.00, 6.625), - ('inf', 45.00, 6.925), - ), - 'monthly': ( - ( 2033, 0.00, 0.000), - ( 2290, 0.00, 1.125), - ( 2547, 3.00, 3.125), - ( 2804, 11.00, 3.625), - ( 3060, 20.00, 4.625), - ( 3317, 32.00, 5.625), - ( 3959, 47.00, 6.625), - ('inf', 89.00, 6.925), - ), - 'annually': ( - (24400, 0.00, 0.000), - (27482, 0.00, 1.125), - (30562, 35.00, 3.125), - (33644, 131.00, 3.625), - (36724, 243.00, 4.625), - (39806, 385.00, 5.625), - (47508, 558.00, 6.625), - ('inf', 1068.00, 6.925), - ), - }, - 'head of household': { - 'weekly': ( - ( 235, 0.00, 0.000), - ( 264, 0.00, 1.125), - ( 294, 0.00, 3.125), - ( 324, 1.00, 3.625), - ( 353, 2.00, 4.625), - ( 383, 4.00, 5.625), - ( 457, 5.00, 6.625), - ('inf', 10.00, 6.925), - ), - 'bi-weekly': ( - ( 469, 0.00, 0.000), - ( 529, 0.00, 1.125), - ( 588, 1.00, 3.125), - ( 647, 3.00, 3.625), - ( 706, 5.00, 4.625), - ( 766, 7.00, 5.625), - ( 914, 11.00, 6.625), - ('inf', 21.00, 6.925), - ), - 'semi-monthly': ( - ( 508, 0.00, 0.000), - ( 573, 0.00, 1.125), - ( 637, 1.00, 3.125), - ( 701, 3.00, 3.625), - ( 765, 5.00, 4.625), - ( 829, 8.00, 5.625), - ( 990, 12.00, 6.625), - ('inf', 22.00, 6.925), - ), - 'monthly': ( - ( 1017, 0.00, 0.000), - ( 1145, 0.00, 1.125), - ( 1273, 1.00, 3.125), - ( 1402, 5.00, 3.625), - ( 1530, 10.00, 4.625), - ( 1659, 16.00, 5.625), - ( 1980, 23.00, 6.625), - ('inf', 45.00, 6.925), - ), - 'annually': ( - (12200, 0.00, 0.000), - (13741, 0.00, 1.125), - (15281, 17.00, 3.125), - (16822, 65.00, 3.625), - (18362, 121.00, 4.625), - (19903, 192.00, 5.625), - (23754, 279.00, 6.625), - ('inf', 534.00, 6.925), - ), - }, - } - - - + { 'single': { @@ -378,19 +213,9 @@ - - { - 'weekly': 56.92, - 'bi-weekly': 113.85, - 'semi-monthly': 123.33, - 'monthly': 246.67, - 'annually': 2960.00, - } - - - + { 'weekly': 56.92, diff --git a/l10n_us_hr_payroll/tests/test_us_id_idaho_payslip_2019.py b/l10n_us_hr_payroll/tests/test_us_id_idaho_payslip_2019.py deleted file mode 100644 index 8e3576d6..00000000 --- a/l10n_us_hr_payroll/tests/test_us_id_idaho_payslip_2019.py +++ /dev/null @@ -1,85 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from .common import TestUsPayslip, process_payslip - - -class TestUsIDPayslip(TestUsPayslip): - - # TAXES AND RATES - ID_UNEMP_MAX_WAGE = 40000.00 - ID_UNEMP = -(1.00 / 100.0) - - def test_taxes_single_biweekly(self): - salary = 1212.00 - schedule_pay = 'bi-weekly' - filing_status = 'single' - allowances = 4 - # SEE https://tax.idaho.gov/i-1026.cfm?seg=compute for example calculations - wh_to_check = -10.00 - employee = self._createEmployee() - contract = self._createContract(employee, - wage=salary, - state_id=self.get_us_state('ID'), - id_w4_sit_filing_status=filing_status, - id_w4_sit_allowances=allowances, - schedule_pay=schedule_pay) - - self._log('2019 Idaho tax first payslip single:') - payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31') - payslip.compute_sheet() - cats = self._getCategories(payslip) - - self.assertPayrollEqual(cats['ER_US_SUTA'], salary * self.ID_UNEMP) - self.assertPayrollEqual(cats['EE_US_SIT'], wh_to_check) - - process_payslip(payslip) - - remaining_id_unemp_wages = self.ID_UNEMP_MAX_WAGE - salary if (self.ID_UNEMP_MAX_WAGE - 2*salary < salary) \ - else salary - - self._log('2019 Idaho tax second payslip single:') - payslip = self._createPayslip(employee, '2019-02-01', '2019-02-28') - payslip.compute_sheet() - cats = self._getCategories(payslip) - - self.assertPayrollEqual(cats['ER_US_SUTA'], remaining_id_unemp_wages * self.ID_UNEMP) - - def test_taxes_married_monthly(self): - salary = 5000.00 - schedule_pay = 'monthly' - filing_status = 'married' - allowances = 2 - - # ICTCAT says monthly allowances are 246.67 - # we have 2 so 246.67 * 2 = 493.34 - # 5000.00 - 493.34 = 4506.66 - # Wh is 89$ plus 6.925% over 3959,00 - # 126.92545499999999 - > 127.0 - wh_to_check = -127.0 - employee = self._createEmployee() - contract = self._createContract(employee, - wage=salary, - state_id=self.get_us_state('ID'), - id_w4_sit_filing_status=filing_status, - id_w4_sit_allowances=allowances, - schedule_pay=schedule_pay) - - self._log('2019 Idaho tax first payslip monthly:') - payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31') - payslip.compute_sheet() - cats = self._getCategories(payslip) - - self.assertPayrollEqual(cats['ER_US_SUTA'], salary * self.ID_UNEMP) - self.assertPayrollEqual(cats['EE_US_SIT'], wh_to_check) - - process_payslip(payslip) - - remaining_id_unemp_wages = self.ID_UNEMP_MAX_WAGE - salary if (self.ID_UNEMP_MAX_WAGE - 2*salary < salary) \ - else salary - - self._log('2019 Idaho tax second payslip monthly:') - payslip = self._createPayslip(employee, '2019-02-01', '2019-02-28') - payslip.compute_sheet() - cats = self._getCategories(payslip) - - self.assertPayrollEqual(cats['ER_US_SUTA'], remaining_id_unemp_wages * self.ID_UNEMP) diff --git a/l10n_us_hr_payroll/tests/test_us_id_idaho_payslip_2021.py b/l10n_us_hr_payroll/tests/test_us_id_idaho_payslip_2021.py new file mode 100755 index 00000000..c6149719 --- /dev/null +++ b/l10n_us_hr_payroll/tests/test_us_id_idaho_payslip_2021.py @@ -0,0 +1,35 @@ +# 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 TestUsIDPayslip(TestUsPayslip): + ### + # 2021 Taxes and Rates + ### + ID_UNEMP_MAX_WAGE = 43000.00 + ID_UNEMP = 1.0 + + def _test_sit(self, wage, filing_status, allowances, schedule_pay, date_start, expected_withholding): + employee = self._createEmployee() + contract = self._createContract(employee, + wage=wage, + state_id=self.get_us_state('ID'), + id_w4_sit_filing_status=filing_status, + id_w4_sit_allowances=allowances, + 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('ID', self.ID_UNEMP, date(2021, 1, 1), wage_base=self.ID_UNEMP_MAX_WAGE) + self._test_sit(1212.0, 'single', 4.0, 'bi-weekly', date(2021, 1, 1), 10.0) + self._test_sit(10000.0, 'married', 1.0, 'annually', date(2021, 1, 1), 0.0) + self._test_sit(52000.0, 'married', 4.0, 'monthly', date(2021, 1, 1), 3345.0) + self._test_sit(5000.0, 'head of household', 0.0, 'semi-monthly', date(2021, 1, 1), 300.0) + self._test_sit(5900.0, 'single', 5.0, 'weekly', date(2021, 1, 1), 367.0)