diff --git a/l10n_us_hr_payroll/data/state/ms_mississippi.xml b/l10n_us_hr_payroll/data/state/ms_mississippi.xml
index a3868e8d..4c6566b7 100644
--- a/l10n_us_hr_payroll/data/state/ms_mississippi.xml
+++ b/l10n_us_hr_payroll/data/state/ms_mississippi.xml
@@ -7,11 +7,7 @@
-
- 14000.0
-
-
-
+
14000.0
@@ -26,16 +22,18 @@
-
- 1.2
-
-
-
1.2
+
+
+
+ 1.0
+
+
+
@@ -44,15 +42,6 @@
-
- [
- ( 10000.00, 290.0, 0.05),
- ( 5000.00, 90.0, 0.04),
- ( 2000.00, 0.0, 0.03),
- ]
-
-
-
@@ -64,6 +53,17 @@
+
+
+
+ [
+ ( 10000.00, 230.0, 0.05),
+ ( 5000.00, 30.0, 0.04),
+ ( 3000.00, 0.0, 0.03),
+ ]
+
+
+
@@ -72,18 +72,9 @@
-
- {
- 'single': 2300.0,
- 'head_of_household': 3400.0,
- 'married_dual': 2300.0,
- 'married': 4600.0,
- }
-
-
-
+
{
'single': 2300.0,
diff --git a/l10n_us_hr_payroll/tests/test_us_ms_mississippi_payslip_2019.py b/l10n_us_hr_payroll/tests/test_us_ms_mississippi_payslip_2019.py
deleted file mode 100755
index e7ce35d0..00000000
--- a/l10n_us_hr_payroll/tests/test_us_ms_mississippi_payslip_2019.py
+++ /dev/null
@@ -1,94 +0,0 @@
-# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
-
-from .common import TestUsPayslip
-
-
-class TestUsMsPayslip(TestUsPayslip):
- # Calculations from https://www.dor.ms.gov/Documents/Computer%20Payroll%20Accounting%201-2-19.pdf
- MS_UNEMP = -1.2 / 100.0
-
- def test_2019_taxes_one(self):
- salary = 1250.0
- ms_89_350_exemption = 11000.0
-
- employee = self._createEmployee()
- contract = self._createContract(employee,
- wage=salary,
- state_id=self.get_us_state('MS'),
- ms_89_350_sit_filing_status='head_of_household',
- ms_89_350_sit_exemption_value=ms_89_350_exemption,
- state_income_tax_additional_withholding=0.0,
- schedule_pay='semi-monthly')
-
- self._log('2019 Mississippi tax single first payslip:')
- 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.MS_UNEMP)
-
- STDED = 3400.0 # Head of Household
- AGP = salary * 24 # Semi-Monthly
- TI = AGP - (ms_89_350_exemption + STDED)
- self.assertPayrollEqual(TI, 15600.0)
- TAX = ((TI - 10000) * 0.05) + 290 # Over 10,000
- self.assertPayrollEqual(TAX, 570.0)
-
- ms_withhold = round(TAX / 24) # Semi-Monthly
- self.assertPayrollEqual(cats['EE_US_SIT'], -ms_withhold)
-
- def test_2019_taxes_one_exempt(self):
- salary = 1250.0
- ms_89_350_exemption = 11000.0
-
- employee = self._createEmployee()
- contract = self._createContract(employee,
- wage=salary,
- state_id=self.get_us_state('MS'),
- ms_89_350_sit_filing_status='',
- ms_89_350_sit_exemption_value=ms_89_350_exemption,
- state_income_tax_additional_withholding=0.0,
- schedule_pay='semi-monthly')
-
- self._log('2019 Mississippi tax single first payslip:')
- payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31')
-
- payslip.compute_sheet()
-
- cats = self._getCategories(payslip)
- self.assertPayrollEqual(cats.get('EE_US_SIT', 0.0), 0.0)
-
- def test_2019_taxes_additional(self):
- salary = 1250.0
- ms_89_350_exemption = 11000.0
- additional = 40.0
-
- employee = self._createEmployee()
- contract = self._createContract(employee,
- wage=salary,
- state_id=self.get_us_state('MS'),
- ms_89_350_sit_filing_status='head_of_household',
- ms_89_350_sit_exemption_value=ms_89_350_exemption,
- state_income_tax_additional_withholding=additional,
- schedule_pay='semi-monthly')
-
- self._log('2019 Mississippi tax single first payslip:')
- 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.MS_UNEMP)
-
- STDED = 3400.0 # Head of Household
- AGP = salary * 24 # Semi-Monthly
- TI = AGP - (ms_89_350_exemption + STDED)
- self.assertPayrollEqual(TI, 15600.0)
- TAX = ((TI - 10000) * 0.05) + 290 # Over 10,000
- self.assertPayrollEqual(TAX, 570.0)
-
- ms_withhold = round(TAX / 24) # Semi-Monthly
- self.assertPayrollEqual(cats['EE_US_SIT'], -ms_withhold + -additional)
diff --git a/l10n_us_hr_payroll/tests/test_us_ms_mississippi_payslip_2021.py b/l10n_us_hr_payroll/tests/test_us_ms_mississippi_payslip_2021.py
new file mode 100755
index 00000000..d59bded9
--- /dev/null
+++ b/l10n_us_hr_payroll/tests/test_us_ms_mississippi_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 TestUsMsPayslip(TestUsPayslip):
+ # Calculations from https://www.dor.ms.gov/Documents/Computer%20Payroll%20Flowchart.pdf
+ MS_UNEMP = 1.0
+ MS_UNEMP_MAX_WAGE = 14000.0
+
+ def _test_sit(self, wage, filing_status, additional_withholding, exemption, schedule_pay, date_start, expected_withholding):
+ employee = self._createEmployee()
+ contract = self._createContract(employee,
+ wage=wage,
+ state_id=self.get_us_state('MS'),
+ ms_89_350_sit_filing_status=filing_status,
+ state_income_tax_additional_withholding=additional_withholding,
+ ms_89_350_sit_exemption_value=exemption,
+ 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('MS', self.MS_UNEMP, date(2021, 1, 1), wage_base=self.MS_UNEMP_MAX_WAGE)
+ self._test_sit(1250.0, 'head_of_household', 0.0, 11000, 'semi-monthly', date(2021, 1, 1), 21.00)
+ self._test_sit(500.0, '', 5.0, 0, 'bi-weekly', date(2021, 1, 1), 0.00)
+ self._test_sit(12000.0, 'single', 0.0, 11000, 'monthly', date(2021, 1, 1), 522.00)
+ self._test_sit(2500.0, 'married', 5.0, 500, 'bi-weekly', date(2021, 1, 1), 110.00)
+
+