From 21ebee50893a240f8dfd659837b72e8ca8ab5aac Mon Sep 17 00:00:00 2001 From: Jared Self Date: Wed, 13 Jan 2021 15:02:07 -0700 Subject: [PATCH] RI Rhode Island --- .../data/state/ri_rhode_island.xml | 59 +++++++++++++++++++ .../test_us_ri_rhode_island_payslip_2021.py | 37 ++++++++++++ 2 files changed, 96 insertions(+) create mode 100755 l10n_us_hr_payroll/tests/test_us_ri_rhode_island_payslip_2021.py diff --git a/l10n_us_hr_payroll/data/state/ri_rhode_island.xml b/l10n_us_hr_payroll/data/state/ri_rhode_island.xml index 155a2c86..5c9e05c8 100644 --- a/l10n_us_hr_payroll/data/state/ri_rhode_island.xml +++ b/l10n_us_hr_payroll/data/state/ri_rhode_island.xml @@ -7,6 +7,7 @@ + 24000.0 @@ -21,12 +22,14 @@ + 1.06 + US RI Rhode Island Exemption Rate @@ -47,6 +50,20 @@ + + + { + 'weekly' : (( 0.00, 19.23), ( 4514.42, 0.00)), + 'bi-weekly' : (( 0.00, 38.46), ( 9028.85, 0.00)), + 'semi-monthly': (( 0.00, 41.67), ( 9781.25, 0.00)), + 'monthly' : (( 0.00, 83.33), ( 19562.50, 0.00)), + 'quarterly' : (( 0.00, 250.00), ( 58687.50, 0.00)), + 'semi-annually': (( 0.00, 500.00), ( 117375.00, 0.00)), + 'annually': (( 0.00, 1000.0), ( 234750.00, 0.00)), + } + + + @@ -96,6 +113,48 @@ + + + { + 'weekly': ( + ( 1273, 0.00, 3.75), + ( 2895, 47.74, 4.75), + ('inf', 124.79, 5.99), + ), + 'bi-weekly': ( + ( 2546, 0.00, 3.75), + ( 5790, 95.48, 4.75), + ('inf', 249.57, 5.99), + ), + 'semi-monthly': ( + ( 2758, 0.00, 3.75), + ( 6273, 103.43, 4.75), + ('inf', 270.39, 5.99), + ), + 'monthly': ( + ( 5517, 0.00, 3.75), + (12546, 206.89, 4.75), + ('inf', 540.77, 5.99), + ), + 'quarterly': ( + (16550, 0.00, 3.75), + (37638, 620.63, 4.75), + ('inf', 1622.31, 5.99), + ), + 'semi-annually': ( + (33100, 0.00, 3.75), + (75275, 1241.25, 4.75), + ('inf', 3244.56, 5.99), + ), + 'annually': ( + ( 66200, 0.00, 3.75), + (150550, 2482.50, 4.75), + ( 'inf', 6489.13, 5.99), + ), + } + + + diff --git a/l10n_us_hr_payroll/tests/test_us_ri_rhode_island_payslip_2021.py b/l10n_us_hr_payroll/tests/test_us_ri_rhode_island_payslip_2021.py new file mode 100755 index 00000000..3fe9a189 --- /dev/null +++ b/l10n_us_hr_payroll/tests/test_us_ri_rhode_island_payslip_2021.py @@ -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 TestUsRIPayslip(TestUsPayslip): + ### + # 2021 Taxes and Rates + ### + RI_UNEMP_MAX_WAGE = 24000.0 + RI_UNEMP = 1.06 + # Calculation based on example http://www.tax.ri.gov/forms/2021/Withholding/2021%20Withhholding%20Tax%20Booklet.pdf + + def _test_sit(self, wage, allowances, additional_withholding, exempt, schedule_pay, date_start, expected_withholding): + employee = self._createEmployee() + contract = self._createContract(employee, + wage=wage, + state_id=self.get_us_state('RI'), + ri_w4_sit_allowances=allowances, + state_income_tax_additional_withholding=additional_withholding, + state_income_tax_exempt=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('RI', self.RI_UNEMP, date(2021, 1, 1), wage_base=self.RI_UNEMP_MAX_WAGE) + self._test_sit(2195, 1, 0, False, 'weekly', date(2021, 1, 1), 90.62) + self._test_sit(1800, 2, 10, True, 'weekly', date(2021, 1, 1), 0.00) + self._test_sit(10000, 1, 0, False, 'bi-weekly', date(2021, 1, 1), 501.75) + self._test_sit(18000, 2, 0, False, 'monthly', date(2021, 1, 1), 857.48) + self._test_sit(18000, 2, 10, False, 'monthly', date(2021, 1, 1), 867.47)