diff --git a/l10n_us_hr_payroll/data/state/nm_new_mexico.xml b/l10n_us_hr_payroll/data/state/nm_new_mexico.xml
index 2c4249a0..970b1f48 100644
--- a/l10n_us_hr_payroll/data/state/nm_new_mexico.xml
+++ b/l10n_us_hr_payroll/data/state/nm_new_mexico.xml
@@ -12,6 +12,12 @@
+
+
+ 27000.0
+
+
+
@@ -21,6 +27,7 @@
+
1.0
@@ -34,7 +41,7 @@
-
+
{
'single': {
@@ -257,6 +264,272 @@
+
+
+
+ {
+ 'single': {
+ 'weekly': (
+ ( 121, 0.00, 0.0),
+ ( 226, 0.00, 1.7),
+ ( 332, 1.80, 3.2),
+ ( 428, 5.18, 4.7),
+ ( 621, 9.70, 4.9),
+ ( 928, 19.13, 4.9),
+ ( 1371, 34.20, 4.9),
+ ( 2525, 55.88, 4.9),
+ ( 4159, 112.41, 4.9),
+ ('inf', 192.51, 5.9),
+ ),
+ 'bi-weekly': (
+ ( 241, 0.00, 0.0),
+ ( 453, 0.00, 1.7),
+ ( 664, 3.60, 3.2),
+ ( 857, 10.37, 4.7),
+ ( 1241, 19.40, 4.9),
+ ( 1857, 38.25, 4.9),
+ ( 2741, 68.40, 4.9),
+ ( 5049, 111.75, 4.9),
+ ( 8318, 224.83, 4.9),
+ ('inf', 385.02, 5.9),
+ ),
+ 'semi-monthly': (
+ ( 261, 0.00, 0.0),
+ ( 491, 0.00, 1.7),
+ ( 720, 3.90, 3.2),
+ ( 928, 11.23, 4.7),
+ ( 1345, 21.02, 4.9),
+ ( 2011, 41.44, 4.9),
+ ( 2970, 74.10, 4.9),
+ ( 2470, 121.06, 4.9),
+ ( 9011, 243.56, 4.9),
+ ('inf', 417.10, 5.9),
+ ),
+ 'monthly': (
+ ( 523, 0.00, 0.0),
+ ( 981, 0.00, 1.7),
+ ( 1440, 7.79, 3.2),
+ ( 1856, 22.46, 4.7),
+ ( 2690, 42.04, 4.9),
+ ( 4023, 82.88, 4.9),
+ ( 5940, 148.21, 4.9),
+ (10940, 242.13, 4.9),
+ (18023, 487.13, 4.9),
+ ('inf', 834.21, 5.9),
+ ),
+ 'quarterly': (
+ ( 1569, 0.00, 0.0),
+ ( 2944, 0.00, 1.7),
+ ( 4319, 23.38, 3.2),
+ ( 5569, 67.38, 4.7),
+ ( 8069, 126.13, 4.9),
+ ( 12069, 248.63, 4.9),
+ ( 17819, 444.63, 4.9),
+ ( 32819, 726.38, 4.9),
+ ( 54069, 1461.38, 4.9),
+ ( 'inf', 2502.63, 5.9),
+ ),
+ 'semi-annual': (
+ ( 3138, 0.00, 0.0),
+ ( 5888, 0.00, 1.7),
+ ( 8638, 46.75, 3.2),
+ ( 11138, 134.75, 4.7),
+ ( 16138, 252.25, 4.9),
+ ( 24138, 497.25, 4.9),
+ ( 35638, 889.25, 4.9),
+ ( 65638, 1452.75, 4.9),
+ (108138, 2922.75, 4.9),
+ ('inf' , 5005.25, 5.9),
+ ),
+ 'annually': (
+ ( 6275, 0.00, 0.0),
+ ( 11775, 0.00, 1.7),
+ ( 17275, 93.50, 3.2),
+ ( 22275, 269.50, 4.7),
+ ( 32275, 504.50, 4.9),
+ ( 48275, 994.50, 4.9),
+ ( 71275, 1778.50, 4.9),
+ (131275, 2905.50, 4.9),
+ (216275, 5845.50, 4.9),
+ ( 'inf', 10010.50, 5.9),
+ ),
+ },
+ 'married': {
+ 'weekly': (
+ ( 241, 0.00, 0.0),
+ ( 395, 0.00, 1.7),
+ ( 549, 2.62, 3.2),
+ ( 703, 7.54, 4.7),
+ ( 1011, 14.77, 4.9),
+ ( 1472, 29.85, 4.9),
+ ( 2164, 52.46, 4.9),
+ ( 4088, 86.38, 4.9),
+ ( 6299, 180.62, 4.9),
+ ('inf', 288.98, 5.9),
+ ),
+ 'bi-weekly': (
+ ( 483, 0.00, 0.0),
+ ( 790, 0.00, 1.7),
+ ( 1089, 5.23, 3.2),
+ ( 1406, 15.08, 4.7),
+ ( 2021, 29.54, 4.9),
+ ( 2944, 59.69, 4.9),
+ ( 4329, 104.92, 4.9),
+ ( 8175, 172.77, 4.9),
+ (12598, 361.23, 4.9),
+ ('inf', 577.96, 5.9),
+ ),
+ 'semi-monthly': (
+ ( 523, 0.00, 0.0),
+ ( 856, 0.00, 1.7),
+ ( 1190, 5.67, 3.2),
+ ( 1523, 16.33, 4.7),
+ ( 2190, 32.00, 4.9),
+ ( 3190, 64.67, 4.9),
+ ( 4690, 113.67, 4.9),
+ ( 8856, 187.17, 4.9),
+ (13648, 391.33, 4.9),
+ ('inf', 626.13, 5.9),
+ ),
+ 'monthly': (
+ ( 1046, 0.00, 0.0),
+ ( 1713, 0.00, 1.7),
+ ( 2379, 11.33, 3.2),
+ ( 3046, 32.67, 4.7),
+ ( 4379, 64.00, 4.9),
+ ( 6379, 129.33, 4.9),
+ ( 9379, 227.33, 4.9),
+ (17713, 374.33, 4.9),
+ (27296, 782.67, 4.9),
+ ('inf', 1252.25, 5.9),
+ ),
+ 'quarterly': (
+ ( 3138, 0.00, 0.0),
+ ( 5138, 0.00, 1.7),
+ ( 7138, 34.00, 3.2),
+ ( 9138, 98.00, 4.7),
+ (13138, 192.00, 4.9),
+ (19138, 388.00, 4.9),
+ (28138, 682.00, 4.9),
+ (53138, 1123.00, 4.9),
+ (81888, 2348.00, 4.9),
+ ('inf', 3756.75, 5.9),
+ ),
+ 'semi-annual': (
+ ( 6275, 0.00, 0.0),
+ ( 10275, 0.00, 1.7),
+ ( 14275, 68.00, 3.2),
+ ( 18275, 196.00, 4.7),
+ ( 26275, 384.00, 4.9),
+ ( 38275, 776.00, 4.9),
+ ( 56275, 1364.00, 4.9),
+ (106275, 2246.00, 4.9),
+ (163775, 4696.00, 4.9),
+ ( 'inf', 7513.50, 5.9),
+ ),
+ 'annually': (
+ ( 12450, 0.00, 0.0),
+ ( 20450, 0.00, 1.7),
+ ( 28450, 136.00, 3.2),
+ ( 36450, 392.00, 4.7),
+ ( 52450, 768.00, 4.9),
+ ( 76450, 1552.00, 4.9),
+ (112450, 2728.00, 4.9),
+ (212550, 4492.00, 4.9),
+ (327550, 9392.00, 4.9),
+ ( 'inf', 15027.00, 5.9),
+ ),
+ },
+ 'married_as_single': {
+ 'weekly': (
+ ( 181, 0.00, 0.0),
+ ( 335, 0.00, 1.7),
+ ( 488, 2.62, 3.2),
+ ( 642, 7.54, 4.7),
+ ( 950, 14.77, 4.9),
+ ( 1412, 29.85, 4.9),
+ ( 2104, 52.46, 4.9),
+ ( 2027, 86.38, 4.9),
+ ( 6238, 180.62, 4.9),
+ ('inf', 288.98, 5.9),
+ ),
+ 'bi-weekly': (
+ ( 362, 0.00, 0.0),
+ ( 669, 0.00, 1.7),
+ ( 977, 5.23, 3.2),
+ ( 1285, 15.08, 4.7),
+ ( 1900, 29.54, 4.9),
+ ( 2823, 59.69, 4.9),
+ ( 4208, 104.92, 4.9),
+ ( 8054, 172.77, 4.9),
+ (12477, 361.23, 4.9),
+ ('inf', 577.96, 5.9),
+ ),
+ 'semi-monthly': (
+ ( 392, 0.00, 0.0),
+ ( 725, 0.00, 1.7),
+ ( 1058, 5.67, 3.2),
+ ( 1392, 16.33, 4.7),
+ ( 2058, 32.00, 4.9),
+ ( 3058, 64.67, 4.9),
+ ( 4558, 113.67, 4.9),
+ ( 8725, 187.17, 4.9),
+ (13517, 391.33, 4.9),
+ ('inf', 626.13, 5.9),
+ ),
+ 'monthly': (
+ ( 783, 0.00, 0.0),
+ ( 1450, 0.00, 1.7),
+ ( 2117, 11.33, 3.2),
+ ( 2783, 32.67, 4.7),
+ ( 4117, 64.00, 4.9),
+ ( 6117, 129.33, 4.9),
+ ( 9117, 227.33, 4.9),
+ (17450, 374.33, 4.9),
+ (27033, 782.67, 4.9),
+ ('inf', 1252.25, 5.9),
+ ),
+ 'quarterly': (
+ ( 2350, 0.00, 0.0),
+ ( 4350, 0.00, 1.7),
+ ( 6350, 34.00, 3.2),
+ ( 8350, 98.00, 4.7),
+ ( 12350, 192.00, 4.9),
+ ( 18350, 388.00, 4.9),
+ ( 27350, 682.00, 4.9),
+ ( 52350, 1123.00, 4.9),
+ ( 81100, 2348.00, 4.9),
+ ( 'inf', 3756.75, 5.9),
+ ),
+ 'semi-annual': (
+ ( 4700, 0.00, 0.0),
+ ( 8700, 0.00, 1.7),
+ ( 12700, 68.00, 3.2),
+ ( 16700, 196.00, 4.7),
+ ( 24700, 384.00, 4.9),
+ ( 36700, 776.00, 4.9),
+ ( 54700, 1364.00, 4.9),
+ (104700, 2246.00, 4.9),
+ (162200, 4696.00, 4.9),
+ ( 'inf', 7513.50, 5.9),
+ ),
+ 'annually': (
+ ( 9400, 0.00, 0.0),
+ ( 17400, 0.00, 1.7),
+ ( 25400, 136.00, 3.2),
+ ( 33400, 392.00, 4.7),
+ ( 49400, 768.00, 4.9),
+ ( 73400, 1552.00, 4.9),
+ (109400, 2728.00, 4.9),
+ (209400, 4492.00, 4.9),
+ (324400, 9392.00, 4.9),
+ ( 'inf', 15027.00, 5.9),
+ ),
+ }
+ }
+
+
+
diff --git a/l10n_us_hr_payroll/tests/test_us_nm_new_mexico_payslip_2021.py b/l10n_us_hr_payroll/tests/test_us_nm_new_mexico_payslip_2021.py
new file mode 100755
index 00000000..317977ba
--- /dev/null
+++ b/l10n_us_hr_payroll/tests/test_us_nm_new_mexico_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 TestUsNMPayslip(TestUsPayslip):
+ ###
+ # 2021 Taxes and Rates
+ ###
+ NM_UNEMP_MAX_WAGE = 27000.0
+ NM_UNEMP = 1.0
+ # Calculation based on section 17. https://s3.amazonaws.com/realFile34821a95-73ca-43e7-b06d-fad20f5183fd/a9bf1098-533b-4a3d-806a-4bf6336af6e4?response-content-disposition=filename%3D%22FYI-104+-+New+Mexico+Withholding+Tax+-+Effective+January+1%2C+2021.pdf%22&response-content-type=application%2Fpdf&AWSAccessKeyId=AKIAJBI25DHBYGD7I7TA&Signature=feu%2F1oJvU6BciRfKcoR0iNxoVZE%3D&Expires=1585159702
+
+ def _test_sit(self, wage, filing_status, additional_withholding, schedule_pay, date_start, expected_withholding):
+ employee = self._createEmployee()
+ contract = self._createContract(employee,
+ wage=wage,
+ state_id=self.get_us_state('NM'),
+ fed_941_fit_w4_filing_status=filing_status,
+ 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('NM', self.NM_UNEMP, date(2021, 1, 1), wage_base=self.NM_UNEMP_MAX_WAGE)
+ self._test_sit(1000.0, 'married', 0.0, 'weekly', date(2021, 1, 1), 29.32)
+ self._test_sit(1000.0, 'married', 10.0, 'weekly', date(2021, 1, 1), 39.32)
+ self._test_sit(25000.0, 'single', 0.0, 'bi-weekly', date(2021, 1, 1), 1369.25)
+ self._test_sit(25000.0, 'married_as_single', 0.0, 'monthly', date(2021, 1, 1), 1152.63)
+ self._test_sit(4400.0, '', 0.0, 'monthly', date(2021, 1, 1), 0.00)