From 5409b13c39a7fefc7421e9c76295811feb84877d Mon Sep 17 00:00:00 2001 From: Bhoomi Vaishnani Date: Fri, 17 Jan 2020 11:55:08 -0500 Subject: [PATCH] IMP `l10n_us_hr_payroll` Port `l10n_us_nj_hr_payroll` NJ New Jersey including migration --- l10n_us_hr_payroll/__manifest__.py | 1 + .../data/state/nj_newjersey.xml | 458 ++++++++++++++++++ l10n_us_hr_payroll/models/hr_payslip.py | 2 + .../models/state/nj_newjersey.py | 53 ++ .../models/us_payroll_config.py | 17 + l10n_us_hr_payroll/tests/__init__.py | 3 + l10n_us_hr_payroll/tests/common.py | 26 +- .../test_us_nj_newjersey_payslip_2019.py | 128 +++++ .../test_us_nj_newjersey_payslip_2020.py | 48 ++ .../views/us_payroll_config_views.xml | 7 + 10 files changed, 732 insertions(+), 11 deletions(-) create mode 100644 l10n_us_hr_payroll/data/state/nj_newjersey.xml create mode 100644 l10n_us_hr_payroll/models/state/nj_newjersey.py create mode 100755 l10n_us_hr_payroll/tests/test_us_nj_newjersey_payslip_2019.py create mode 100755 l10n_us_hr_payroll/tests/test_us_nj_newjersey_payslip_2020.py diff --git a/l10n_us_hr_payroll/__manifest__.py b/l10n_us_hr_payroll/__manifest__.py index 45a6ae45..3aaa137b 100644 --- a/l10n_us_hr_payroll/__manifest__.py +++ b/l10n_us_hr_payroll/__manifest__.py @@ -30,6 +30,7 @@ United States of America - Payroll Rules. 'data/state/mo_missouri.xml', 'data/state/ms_mississippi.xml', 'data/state/mt_montana.xml', + 'data/state/nj_newjersey.xml', 'data/state/oh_ohio.xml', 'data/state/pa_pennsylvania.xml', 'data/state/tx_texas.xml', diff --git a/l10n_us_hr_payroll/data/state/nj_newjersey.xml b/l10n_us_hr_payroll/data/state/nj_newjersey.xml new file mode 100644 index 00000000..93d87265 --- /dev/null +++ b/l10n_us_hr_payroll/data/state/nj_newjersey.xml @@ -0,0 +1,458 @@ + + + + + US NJ NewJersey SUTA Wage Base + us_nj_suta_wage_base + + + + + 34400.00 + + + + + 35300.00 + + + + + + + + + US NJ New Jersey Employer Unemployment SUTA Rate + us_nj_suta_rate + + + + + 2.6825 + + + + + 2.6825 + + + + + + + US NJ New Jersey Employee Unemployment SUTA Rate + us_nj_suta_ee_rate + + + + + 0.3825 + + + + + 0.3825 + + + + + + + + US NJ New Jersey Employer State Disability Insurance Rate + us_nj_sdi_rate + + + + + 0.5 + + + + + 0.5 + + + + + + + US NJ New Jersey Employee State Disability Insurance Rate + us_nj_sdi_ee_rate + + + + + 0.17 + + + + + 0.26 + + + + + + + + US NJ New Jersey Employer Workforce Development Rate + us_nj_wf_rate + + + + + 0.1175 + + + + + 0.1175 + + + + + + + US NJ New Jersey Employee Workforce Development Rate + us_nj_wf_ee_rate + + + + + 0.0425 + + + + + 0.0425 + + + + + + + + US NJ New Jersey Employer Family Leave Insurance Rate + us_nj_fli_rate + + + + + 0.0 + + + + + 0.0 + + + + + + + US NJ New Jersey Employee Family Leave Insurance Rate + us_nj_fli_ee_rate + + + + + 0.08 + + + + + 0.16 + + + + + + + + US NJ NewJersey SIT Rate Table + us_nj_sit_rate + + + + + { + 'A': { + 'weekly': ((385, 0.0, 1.50), (673, 5.77, 2.00), (769, 11.54, 3.90), (1442, 15.29, 6.10), (9615, 56.34, 7.00), (96154, 628.46, 9.90), ('inf', 9195.77, 11.80)), + 'bi-weekly': ((769, 0.00, 1.50), (1346, 12.00, 2.00), (1538, 23.00, 3.90), (2885, 31.00, 6.10), (19231, 113.00, 7.00), (192308, 1257.00, 9.90), ('inf',18392.00, 11.80)), + 'semi-monthly': ((833, 0.00, 1.50), (1458, 13.00, 2.00), (1667, 25.00, 3.90), (3125, 33.00, 6.10), (20833, 122.00, 7.00), (208333, 1362.00, 9.90), ('inf', 19924.00, 11.80)), + 'monthly': ((1667, 0.00, 1.50), (2917, 25.00, 2.00), (3333, 50.00, 3.90), (6250, 66.00, 6.10), (41667, 244.00, 7.00), (416667, 2723.00, 9.90), ('inf', 39848.00, 11.80)), + 'quarterly': ((5000, 0.00, 1.50), (8750, 75.00, 2.00), (10000, 150.00, 3.90), (18750, 198.75, 6.10), (125000, 732.50, 7.00), (1250000, 8170.00, 9.90), ('inf', 119545.00, 11.80)), + 'semi-annual': ((10000, 0.00, 1.50), (17500, 150.00, 2.00), (20000, 300.00, 3.90), (37500, 397.50, 6.10), (250000, 1465.00, 7.00), (2500000, 16340.00, 9.90), ('inf', 239090.00, 11.80)), + 'annual': ((20000, 0.0, 1.50), (35000, 300.00, 2.00), (40000, 600.00, 3.90), (75000, 795.00, 6.10), (500000, 2930.00, 7.00), (5000000, 32680.00, 9.90), ('inf', 478180.00, 11.80)), + }, + 'B': { + 'weekly': ((385, 0.0, 1.50), (962, 5.77, 2.00), (1346, 17.31, 2.70), (1538, 27.69, 3.9), (2885, 35.19, 6.10), (9615, 117.31, 7.00), (96154, 588.46, 9.90), ('inf', 9155.77, 11.80)), + 'bi-weekly': ((769, 0.0, 1.50), (1923, 12.00, 2.00), (2692, 35.00, 2.70), (3076, 55.00, 3.9), (5769, 70.00, 6.10), (19231, 235.00, 700), (192308, 1177.00, 9.90), ('inf', 18312.00, 11.80)), + 'semi-monthly': ((833, 0.0, 1.50), (2083, 12.50, 2.00), (2917, 37.50, 2.70), (3333, 59.99, 3.9), (6250, 76.25, 6.10), (20833, 254.19, 7.00), (208333, 1275.00, 9.90), ('inf', 19838.00, 11.80)), + 'monthly': ((1667, 0.0, 1.50), (4167, 25.00, 2.00), (5833, 75.00, 2.70), (6667, 120.00, 3.9), (12500, 153.00, 6.10), (41667, 508.00, 7.00), (416667, 2550.00, 9.90), ('inf', 39675.00, 11.80)), + 'quarterly': ((5000, 0.0, 1.50), (12500, 75.00, 2.00), (17500, 225.00, 2.70), (20000, 360.00, 3.9), (37500, 397.50, 6.10), (125000, 1525.00, 7.00), (1250000, 7650.00, 9.90), ('inf', 119025.00, 11.80)), + 'semi-annual': ((10000, 0.0, 1.50), (25000, 150.00, 2.00), (35000, 450.00, 2.70), (40000, 720.00, 3.9), (75000, 915.00, 6.10), (250000, 3050.00, 7.00), (2500000, 15300.00, 9.90), ('inf', 238050.00, 11.80)), + 'annual': ((20000, 0.0, 1.50), (50000, 300.00, 2.00), (70000, 900.00, 2.70), (80000, 1440.00, 3.9), (150000, 1830.00, 6.10), (500000, 6100.00, 7.00), (5000000, 30600.00, 9.90), ('inf', 476100.00, 11.80)), + }, + 'C': { + 'weekly': ((385, 0.0, 1.50), (769, 5.77, 2.30), (962, 14.62, 2.80), (1154, 20.00, 3.50), (2885, 26.73, 5.60), (9615, 123.65, 6.60), (96154, 567.88, 9.90), ('inf', 9135.19, 11.80)), + 'bi-weekly': ((769, 0.0, 1.50), (1538, 11.54, 2.30), (1923, 29.23, 2.80), (2308, 40.00, 3.50), (5769, 53.46, 5.60), (19231, 247.31, 6.60), (192308, 1135.77, 9.90), ('inf', 18270.38, 11.80)), + 'semi-monthly': ((833, 0.0, 1.50), (1667, 12.50, 2.30), (2083, 31.67, 2.80), (2500, 43.33, 3.50), (6250, 57.92, 5.60), (20833, 267.92, 6.60), (208333, 1230.42, 9.90), ('inf', 19792.92, 11.80)), + 'monthly': ((1667, 0.0, 1.50), (3333, 25.00, 2.30), (4167, 63.33, 2.80), (5000, 86.67, 3.50), (12500, 115.83, 5.60), (41667, 535.85, 6.60), (416667, 2460.83, 9.90), ('inf', 39585.83, 11.80)), + 'quarterly': ((5000, 0.0, 1.50), (10000, 75.00, 2.30), (12500, 190.00, 2.80), (15000, 260.00, 3.50), (37500, 347.50, 5.60), (125000, 1607.50, 6.60), (1250000, 7382.50, 9.90), ('inf', 118757.50, 11.80)), + 'semi-annual': ((10000, 0.0, 1.50), (20000, 150.00, 2.30), (25000, 380.00, 2.80), (30000, 520.00, 3.50), (75000, 695.00, 5.60), (250000, 3215.00, 6.60), (2500000, 14765.00, 9.90), ('inf', 237515.00, 11.80)), + 'annual': ((20000, 0.0, 1.50), (40000, 300.00, 2.30), (50000, 760.00, 2.80), (60000, 1040.00, 3.50), (150000, 1390.00, 5.60), (500000, 6430.00, 6.60), (5000000, 29530.00, 9.90), ('inf', 475030.00, 11.80)), + }, + 'D': { + 'weekly': ((385, 0.0, 1.50), (769, 5.77, 2.70), (962, 16.15, 3.40), (1154, 22.69, 4.30), (2885, 30.96, 5.60), (9615, 127.88, 6.50), (96154, 565.38, 9.90), ('inf', 9132.69, 11.80)), + 'bi-weekly': ((769, 0.0, 1.50), (1538, 11.54, 2.70), (1923, 32.31, 3.40), (2308, 45.38, 4.30), (5769, 61.92, 5.60), (19231, 255.77, 6.50), (192308, 1130.77, 9.90), ('inf', 18265.38, 11.80)), + 'semi-monthly': ((833, 0.0, 1.50), (1667, 12.50, 2.70), (2083, 35.00, 3.40), (2500, 49.17, 4.30), (6250, 67.08, 5.60), (20833, 277.08, 6.50), (208333, 1225.00, 9.90), ('inf', 19787.50, 11.80)), + 'monthly': ((1667, 0.0, 1.50), (3333, 25.00, 2.70), (4167, 70.00, 3.40), (5000, 98.33, 4.00), (12500, 134.17, 5.60), (41667, 554.17, 6.50), (416667, 2450.00, 9.90), ('inf', 39575.00, 11.80)), + 'quarterly': ((5000, 0.0, 1.50), (10000, 75.00, 2.07), (12500, 210.00, 3.40), (15000, 295.00, 4.30), (37500, 402.50, 5.60), (125000, 1662.50, 6.50), (1250000, 7350.00, 9.90), ('inf', 118725.00, 11.80)), + 'semi-annual': ((10000, 0.0, 1.50), (20000, 150.00, 2.70), (25000, 420.00, 3.40), (30000, 590.00, 4.30), (75000, 805.00, 5.60), (250000, 3325.00, 6.50), (2500000, 14700.00, 9.90), ('inf', 237450.00, 11.80)), + 'annual': ((20000, 0.0, 1.50), (40000, 300.00, 2.70), (50000, 840.00, 3.40), (60000, 1180.00, 4.30), (150000, 1610.00, 5.60), (250000, 6650.00, 6.50), (2500000, 29400.00, 9.90), ('inf', 474900.00, 11.80)), + }, + 'E': { + 'weekly': ((385, 0.0, 1.50), (673, 5.77, 2.00), (1923, 11.54, 5.80), (9615, 84.04, 6.50), (96154, 584.04, 9.90), ('inf', 9151.35, 11.80)), + 'bi-weekly': ((769, 0.0, 1.50), (1346, 12.00, 2.00), (3846, 23.00, 5.80), (19231, 168.00, 6.50), (192308, 1168.00, 9.90), ('inf', 18303.00, 11.80)), + 'semi-monthly': ((833, 0.0, 1.50), (1458, 13.00, 2.00), (4167, 25.00, 5.80), (20833, 182.00, 6.50), (208333, 1265.00, 9.90), ('inf', 19828.00, 11.80)), + 'monthly': ((1667, 0.0, 1.50), (2916, 25.00, 2.00), (8333, 50.00, 5.80), (41667, 364.00, 6.50), (416667, 2531.00, 9.90), ('inf', 39656, 11.80)), + 'quarterly': ((5000, 0.0, 1.50), (8750, 75.00, 2.00), (25000, 150.00, 5.80), (125000, 1092.50, 6.50), (1250000, 7592.50, 9.90), ('inf', 118967.50, 11.80)), + 'semi-annual': ((10000, 0.0, 1.50), (17500, 150.00, 2.00), (50000, 300.00, 5.80), (250000, 2185.00, 6.50), (2500000, 15185.00, 9.90), ('inf', 237935.00, 11.80)), + 'annual': ((20000, 0.0, 1.50), (35000, 300.00, 2.00), (100000, 600.00, 5.80), (500000, 4370.00, 6.50), (5000000, 30370.00, 9.90), ('inf', 475870.00, 11.80)), + }, + } + + + + + { + 'A': { + 'weekly': ((385, 0.0, 1.50), (673, 5.77, 2.00), (769, 11.54, 3.90), (1442, 15.29, 6.10), (9615, 56.34, 7.00), (96154, 628.46, 9.90), ('inf', 9195.77, 11.80)), + 'bi-weekly': ((769, 0.00, 1.50), (1346, 12.00, 2.00), (1538, 23.00, 3.90), (2885, 31.00, 6.10), (19231, 113.00, 7.00), (192308, 1257.00, 9.90), ('inf',18392.00, 11.80)), + 'semi-monthly': ((833, 0.00, 1.50), (1458, 13.00, 2.00), (1667, 25.00, 3.90), (3125, 33.00, 6.10), (20833, 122.00, 57.00), (208333, 1362.00, 9.90), ('inf', 19924.00, 11.80)), + 'monthly': ((1667, 0.00, 1.50), (2917, 25.00, 2.00), (3333, 50.00, 3.90), (6250, 66.00, 6.10), (41667, 244.00, 57.00), (416667, 2723.00, 9.90), ('inf', 39848.00, 11.80)), + 'quarterly': ((5000, 0.00, 1.50), (8750, 75.00, 2.00), (10000, 150.00, 3.90), (18750, 198.75, 6.10), (125000, 732.50, 57.00), (1250000, 8170.00, 9.90), ('inf', 119545.00, 11.80)), + 'semi-annual': ((10000, 0.00, 1.50), (17500, 150.00, 2.00), (20000, 300.00, 3.90), (37500, 397.50, 6.10), (250000, 1465.00, 57.00), (2500000, 16340.00, 9.90), ('inf', 239090.00, 11.80)), + 'annual': ((20000, 0.0, 1.50), (35000, 300.00, 2.00), (40000, 600.00, 3.90), (75000, 795.00, 6.10), (500000, 2930.00, 57.00), (5000000, 32680.00, 9.90), ('inf', 478180.00, 11.80)), + }, + 'B': { + 'weekly': ((385, 0.0, 1.50), (962, 5.77, 2.00), (1346, 17.31, 2.70), (1538, 27.69, 3.9), (2885, 35.19, 6.10), (9615, 117.31, 7.00), (96154, 588.46, 9.90), ('inf', 9155.77, 11.80)), + 'bi-weekly': ((769, 0.0, 1.50), (1923, 12.00, 2.00), (2692, 35.00, 2.70), (3076, 55.00, 3.9), (5769, 70.00, 6.10), (19231, 235.00, 700), (192308, 1177.00, 9.90), ('inf', 18312.00, 11.80)), + 'semi-monthly': ((833, 0.0, 1.50), (2083, 12.50, 2.00), (2917, 37.50, 2.70), (3333, 59.99, 3.9), (6250, 76.25, 6.10), (20833, 254.19, 7.00), (208333, 1275.00, 9.90), ('inf', 19838.00, 11.80)), + 'monthly': ((1667, 0.0, 1.50), (4167, 25.00, 2.00), (5833, 75.00, 2.70), (6667, 120.00, 3.9), (12500, 153.00, 6.10), (41667, 508.00, 7.00), (416667, 2550.00, 9.90), ('inf', 39675.00, 11.80)), + 'quarterly': ((5000, 0.0, 1.50), (12500, 75.00, 2.00), (17500, 225.00, 2.70), (20000, 360.00, 3.9), (37500, 397.50, 6.10), (125000, 1525.00, 7.00), (1250000, 7650.00, 9.90), ('inf', 119025.00, 11.80)), + 'semi-annual': ((10000, 0.0, 1.50), (25000, 150.00, 2.00), (35000, 450.00, 2.70), (40000, 720.00, 3.9), (75000, 915.00, 6.10), (250000, 3050.00, 7.00), (2500000, 15300.00, 9.90), ('inf', 238050.00, 11.80)), + 'annual': ((20000, 0.0, 1.50), (50000, 300.00, 2.00), (70000, 900.00, 2.70), (80000, 1440.00, 3.9), (150000, 1830.00, 6.10), (500000, 6100.00, 7.00), (5000000, 30600.00, 9.90), ('inf', 476100.00, 11.80)), + }, + 'C': { + 'weekly': ((385, 0.0, 1.50), (769, 5.77, 2.30), (962, 14.62, 2.80), (1154, 20.00, 3.50), (2885, 26.73, 5.60), (9615, 123.65, 6.60), (96154, 567.88, 9.90), ('inf', 9135.19, 11.80)), + 'bi-weekly': ((769, 0.0, 1.50), (1538, 11.54, 2.30), (1923, 29.23, 2.80), (2308, 40.00, 3.50), (5769, 53.46, 5.60), (19231, 247.31, 6.60), (192308, 1135.77, 9.90), ('inf', 18270.38, 11.80)), + 'semi-monthly': ((833, 0.0, 1.50), (1667, 12.50, 2.30), (2083, 31.67, 2.80), (2500, 43.33, 3.50), (6250, 57.92, 5.60), (20833, 267.92, 6.60), (208333, 1230.42, 9.90), ('inf', 19792.92, 11.80)), + 'monthly': ((1667, 0.0, 1.50), (3333, 25.00, 2.30), (4167, 63.33, 2.80), (5000, 86.67, 3.50), (12500, 115.83, 5.60), (41667, 535.85, 6.60), (416667, 2460.83, 9.90), ('inf', 39585.83, 11.80)), + 'quarterly': ((5000, 0.0, 1.50), (10000, 75.00, 2.30), (12500, 190.00, 2.80), (15000, 260.00, 3.50), (37500, 347.50, 5.60), (125000, 1607.50, 6.60), (1250000, 7382.50, 9.90), ('inf', 118757.50, 11.80)), + 'semi-annual': ((10000, 0.0, 1.50), (20000, 150.00, 2.30), (25000, 380.00, 2.80), (30000, 520.00, 3.50), (75000, 695.00, 5.60), (250000, 3215.00, 6.60), (2500000, 14765.00, 9.90), ('inf', 237515.00, 11.80)), + 'annual': ((20000, 0.0, 1.50), (40000, 300.00, 2.30), (50000, 760.00, 2.80), (60000, 1040.00, 3.50), (150000, 1390.00, 5.60), (500000, 6430.00, 6.60), (5000000, 29530.00, 9.90), ('inf', 475030.00, 11.80)), + }, + 'D': { + 'weekly': ((385, 0.0, 1.50), (769, 5.77, 2.70), (962, 16.15, 3.40), (1154, 22.69, 4.30), (2885, 30.96, 5.60), (9615, 127.88, 6.50), (96154, 565.38, 9.90), ('inf', 9132.69, 11.80)), + 'bi-weekly': ((769, 0.0, 1.50), (1538, 11.54, 2.70), (1923, 32.31, 3.40), (2308, 45.38, 4.30), (5769, 61.92, 5.60), (19231, 255.77, 6.50), (192308, 1130.77, 9.90), ('inf', 18265.38, 11.80)), + 'semi-monthly': ((833, 0.0, 1.50), (1667, 12.50, 2.70), (2083, 35.00, 3.40), (2500, 49.17, 4.30), (6250, 67.08, 5.60), (20833, 277.08, 6.50), (208333, 1225.00, 9.90), ('inf', 19787.50, 11.80)), + 'monthly': ((1667, 0.0, 1.50), (3333, 25.00, 2.70), (4167, 70.00, 3.40), (5000, 98.33, 4.00), (12500, 134.17, 5.60), (41667, 554.17, 6.50), (416667, 2450.00, 9.90), ('inf', 39575.00, 11.80)), + 'quarterly': ((5000, 0.0, 1.50), (10000, 75.00, 2.07), (12500, 210.00, 3.40), (15000, 295.00, 4.30), (37500, 402.50, 5.60), (125000, 1662.50, 6.50), (1250000, 7350.00, 9.90), ('inf', 118725.00, 11.80)), + 'semi-annual': ((10000, 0.0, 1.50), (20000, 150.00, 2.70), (25000, 420.00, 3.40), (30000, 590.00, 4.30), (75000, 805.00, 5.60), (250000, 3325.00, 6.50), (2500000, 14700.00, 9.90), ('inf', 237450.00, 11.80)), + 'annual': ((20000, 0.0, 1.50), (40000, 300.00, 2.70), (50000, 840.00, 3.40), (60000, 1180.00, 4.30), (150000, 1610.00, 5.60), (250000, 6650.00, 6.50), (2500000, 29400.00, 9.90), ('inf', 474900.00, 11.80)), + }, + 'E': { + 'weekly': ((385, 0.0, 1.50), (673, 5.77, 2.00), (1923, 11.54, 5.80), (9615, 84.04, 6.50), (96154, 584.04, 9.90), ('inf', 9151.35, 11.80)), + 'bi-weekly': ((769, 0.0, 1.50), (1346, 12.00, 2.00), (3846, 23.00, 5.80), (19231, 168.00, 6.50), (192308, 1168.00, 9.90), ('inf', 18303.00, 11.80)), + 'semi-monthly': ((833, 0.0, 1.50), (1458, 13.00, 2.00), (4167, 25.00, 5.80), (20833, 182.00, 6.50), (208333, 1265.00, 9.90), ('inf', 19828.00, 11.80)), + 'monthly': ((1667, 0.0, 1.50), (2916, 25.00, 2.00), (8333, 50.00, 5.80), (41667, 364.00, 6.50), (416667, 2531.00, 9.90), ('inf', 39656, 11.80)), + 'quarterly': ((5000, 0.0, 1.50), (8750, 75.00, 2.00), (25000, 150.00, 5.80), (125000, 1092.50, 6.50), (1250000, 7592.50, 9.90), ('inf', 118967.50, 11.80)), + 'semi-annual': ((10000, 0.0, 1.50), (17500, 150.00, 2.00), (50000, 300.00, 5.80), (250000, 2185.00, 6.50), (2500000, 15185.00, 9.90), ('inf', 237935.00, 11.80)), + 'annual': ((20000, 0.0, 1.50), (35000, 300.00, 2.00), (100000, 600.00, 5.80), (500000, 4370.00, 6.50), (5000000, 30370.00, 9.90), ('inf', 475870.00, 11.80)), + }, + } + + + + + + + US NJ NewJersey SIT Allowance Rate + us_nj_sit_allowance_rate + + + + + { + 'weekly': 19.20, + 'bi-weekly': 38.40, + 'semi-monthly': 41.60, + 'monthly': 83.30, + 'quarterly': 250.00, + 'semi-annual': 500.00, + 'annual': 1000.00, + 'daily or miscellaneous': 2.70, + } + + + + + { + 'weekly': 19.20, + 'bi-weekly': 38.40, + 'semi-monthly': 41.60, + 'monthly': 83.30, + 'quarterly': 250.00, + 'semi-annual': 500.00, + 'annual': 1000.00, + 'daily or miscellaneous': 2.70, + } + + + + + + + + US New Jersey - Division of Taxation - Unemployment Tax + + + + US New Jersey - Division of Taxation - Income Tax + + + + + + + + + ER: US NJ New Jersey State Unemployment + ER_US_NJ_SUTA + python + result, _ = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_nj_suta_wage_base', rate='us_nj_suta_rate', state_code='NJ') + code + result, result_rate = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_nj_suta_wage_base', rate='us_nj_suta_rate', state_code='NJ') + + + + + + + + + EE: US NJ New Jersey State Unemployment + EE_US_NJ_SUTA + python + result, _ = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_nj_suta_wage_base', rate='us_nj_suta_ee_rate', state_code='NJ') + code + result, result_rate = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_nj_suta_wage_base', rate='us_nj_suta_ee_rate', state_code='NJ') + + + + + + + + + + ER: US NJ New Jersey State Disability Insurance + ER_US_NJ_SDI + python + result, _ = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_nj_suta_wage_base', rate='us_nj_sdi_rate', state_code='NJ') + code + result, result_rate = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_nj_suta_wage_base', rate='us_nj_sdi_rate', state_code='NJ') + + + + + + + + + EE: US NJ New Jersey State Disability Insurance + EE_US_NJ_SDI + python + result, _ = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_nj_suta_wage_base', rate='us_nj_sdi_ee_rate', state_code='NJ') + code + result, result_rate = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_nj_suta_wage_base', rate='us_nj_sdi_ee_rate', state_code='NJ') + + + + + + + + + + ER: US NJ New Jersey Workforce Development + ER_US_NJ_WF + python + result, _ = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_nj_suta_wage_base', rate='us_nj_wf_rate', state_code='NJ') + code + result, result_rate = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_nj_suta_wage_base', rate='us_nj_wf_rate', state_code='NJ') + + + + + + + + + EE: US NJ New Jersey Workforce Development + EE_US_NJ_WF + python + result, _ = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_nj_suta_wage_base', rate='us_nj_wf_ee_rate', state_code='NJ') + code + result, result_rate = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_nj_suta_wage_base', rate='us_nj_wf_ee_rate', state_code='NJ') + + + + + + + + + + ER: US NJ New Jersey Family Leave Insurance + ER_US_NJ_FLI + python + result, _ = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_nj_suta_wage_base', rate='us_nj_fli_rate', state_code='NJ') + code + result, result_rate = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_nj_suta_wage_base', rate='us_nj_fli_rate', state_code='NJ') + + + + + + + + + EE: US NJ New Jersey Family Leave Insurance + EE_US_NJ_FLI + python + result, _ = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_nj_suta_wage_base', rate='us_nj_fli_ee_rate', state_code='NJ') + code + result, result_rate = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_nj_suta_wage_base', rate='us_nj_fli_ee_rate', state_code='NJ') + + + + + + + + + EE: US NJ New Jersey State Income Tax Withholding + EE_US_NJ_SIT + python + result, _ = nj_newjersey_state_income_withholding(payslip, categories, worked_days, inputs) + code + result, result_rate = nj_newjersey_state_income_withholding(payslip, categories, worked_days, inputs) + + + + + \ No newline at end of file diff --git a/l10n_us_hr_payroll/models/hr_payslip.py b/l10n_us_hr_payroll/models/hr_payslip.py index f74cf922..c3dffe34 100644 --- a/l10n_us_hr_payroll/models/hr_payslip.py +++ b/l10n_us_hr_payroll/models/hr_payslip.py @@ -16,6 +16,7 @@ from .state.ga_georgia import ga_georgia_state_income_withholding from .state.mo_missouri import mo_missouri_state_income_withholding from .state.ms_mississippi import ms_mississippi_state_income_withholding from .state.mt_montana import mt_montana_state_income_withholding +from .state.nj_newjersey import nj_newjersey_state_income_withholding from .state.oh_ohio import oh_ohio_state_income_withholding from .state.va_virginia import va_virginia_state_income_withholding from .state.wa_washington import wa_washington_fml_er, \ @@ -55,6 +56,7 @@ class HRPayslip(models.Model): 'mo_missouri_state_income_withholding': mo_missouri_state_income_withholding, 'ms_mississippi_state_income_withholding': ms_mississippi_state_income_withholding, 'mt_montana_state_income_withholding': mt_montana_state_income_withholding, + 'nj_newjersey_state_income_withholding': nj_newjersey_state_income_withholding, 'oh_ohio_state_income_withholding': oh_ohio_state_income_withholding, 'va_virginia_state_income_withholding': va_virginia_state_income_withholding, 'wa_washington_fml_er': wa_washington_fml_er, diff --git a/l10n_us_hr_payroll/models/state/nj_newjersey.py b/l10n_us_hr_payroll/models/state/nj_newjersey.py new file mode 100644 index 00000000..b69ffcef --- /dev/null +++ b/l10n_us_hr_payroll/models/state/nj_newjersey.py @@ -0,0 +1,53 @@ +# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. + +from .general import _state_applies + + +def nj_newjersey_state_income_withholding(payslip, categories, worked_days, inputs): + """ + Returns SIT eligible wage and rate. + WAGE = GROSS + DED_FIT_EXEMPT + + :return: result, result_rate (wage, percent) + """ + state_code = 'NJ' + if not _state_applies(payslip, state_code): + return 0.0, 0.0 + + filing_status = payslip.contract_id.us_payroll_config_value('nj_njw4_sit_filing_status') + if not filing_status: + return 0.0, 0.0 + + # Determine Wage + wage = categories.GROSS + categories.DED_FIT_EXEMPT + + allowances = payslip.contract_id.us_payroll_config_value('nj_njw4_sit_allowances') + sit_rate_table_key = payslip.contract_id.us_payroll_config_value('nj_njw4_sit_rate_table') + if not sit_rate_table_key and filing_status in ('single', 'married_joint'): + sit_rate_table_key = 'A' + elif not sit_rate_table_key: + sit_rate_table_key = 'B' + schedule_pay = payslip.contract_id.schedule_pay + additional = payslip.contract_id.us_payroll_config_value('state_income_tax_additional_withholding') + sit_table = payslip.rule_parameter('us_nj_sit_rate')[sit_rate_table_key].get(schedule_pay) + allowance_value = payslip.rule_parameter('us_nj_sit_allowance_rate')[schedule_pay] + if not allowances: + return 0.0, 0.0 + + if wage == 0.0: + return 0.0, 0.0 + + gross_taxable_income = wage - (allowance_value * allowances) + withholding = 0.0 + prior_wage_base = 0.0 + for row in sit_table: + wage_base, base_amt, rate = row + wage_base = float(wage_base) + rate = rate / 100.0 + if gross_taxable_income <= wage_base: + withholding = base_amt + ((gross_taxable_income - prior_wage_base) * rate) + break + prior_wage_base = wage_base + + withholding += additional + return wage, -((withholding / wage) * 100.0) diff --git a/l10n_us_hr_payroll/models/us_payroll_config.py b/l10n_us_hr_payroll/models/us_payroll_config.py index eea9e916..26aec499 100644 --- a/l10n_us_hr_payroll/models/us_payroll_config.py +++ b/l10n_us_hr_payroll/models/us_payroll_config.py @@ -94,6 +94,23 @@ class HRContractUSPayrollConfig(models.Model): ('montana_for_marriage', 'Montana for Marriage'), ], string='Montana MW-4 Exempt from Withholding', help='MW-4 Section 2') + nj_njw4_sit_filing_status = fields.Selection([ + ('', 'Exempt'), + ('single', 'Single'), + ('married_separate', 'Married/Civil Union partner Separate'), + ('married_joint', 'Married/Civil Union Couple Joint'), + ('widower', 'Widower/Surviving Civil Union Partner'), + ('head_household', 'Head of Household') + ], string='New Jersey NJ-W4 Filing Status', help='NJ-W4 2.') + nj_njw4_sit_allowances = fields.Integer(string='New Jersey NJ-W4 Allowances', help='NJ-W4 4.') + nj_njw4_sit_rate_table = fields.Selection([ + ('A', 'A'), + ('B', 'B'), + ('C', 'C'), + ('D', 'D'), + ('E', 'E') + ], string='New Jersey Wage Chart Letter', help='NJ-W4. 3.') + # Ohio will use generic SIT exempt and additional fields oh_it4_sit_exemptions = fields.Integer(string='Ohio IT-4 Exemptions', help='Line 4') diff --git a/l10n_us_hr_payroll/tests/__init__.py b/l10n_us_hr_payroll/tests/__init__.py index 6275549a..f0e84ff2 100755 --- a/l10n_us_hr_payroll/tests/__init__.py +++ b/l10n_us_hr_payroll/tests/__init__.py @@ -19,6 +19,9 @@ from . import test_us_ms_mississippi_payslip_2020 from . import test_us_mt_montana_payslip_2019 from . import test_us_mt_montana_payslip_2020 +from . import test_us_nj_newjersey_payslip_2019 +from . import test_us_nj_newjersey_payslip_2020 + from . import test_us_oh_ohio_payslip_2019 from . import test_us_oh_ohio_payslip_2020 diff --git a/l10n_us_hr_payroll/tests/common.py b/l10n_us_hr_payroll/tests/common.py index 26c6874b..014d3719 100755 --- a/l10n_us_hr_payroll/tests/common.py +++ b/l10n_us_hr_payroll/tests/common.py @@ -172,7 +172,11 @@ class TestUsPayslip(common.TransactionCase): cache[code] = us_state return us_state - def _test_suta(self, category, state_code, rate, date, wage_base=None, **extra_contract): + def _test_suta(self, category, state_code, rate, date, wage_base=None, relaxed=False, **extra_contract): + if relaxed: + _assert = self.assertPayrollAlmostEqual + else: + _assert = self.assertPayrollEqual if wage_base: # Slightly larger than 1/2 the wage_base wage = round(wage_base / 2.0) + 100.0 @@ -195,18 +199,18 @@ class TestUsPayslip(common.TransactionCase): contract.us_payroll_config_id.fed_940_type = USHRContract.FUTA_TYPE_EXEMPT payslip.compute_sheet() cats = self._getCategories(payslip) - self.assertPayrollEqual(cats.get(category, 0.0), 0.0) + _assert(cats.get(category, 0.0), 0.0) contract.us_payroll_config_id.fed_940_type = USHRContract.FUTA_TYPE_BASIC payslip.compute_sheet() cats = self._getCategories(payslip) - self.assertPayrollEqual(cats.get(category, 0.0), 0.0) + _assert(cats.get(category, 0.0), 0.0) # Test Normal contract.us_payroll_config_id.fed_940_type = USHRContract.FUTA_TYPE_NORMAL payslip.compute_sheet() cats = self._getCategories(payslip) - self.assertPayrollEqual(cats.get(category, 0.0), wage * rate) + _assert(cats.get(category, 0.0), wage * rate) process_payslip(payslip) # Second Payslip @@ -217,7 +221,7 @@ class TestUsPayslip(common.TransactionCase): if wage_base: remaining_unemp_wages = wage_base - wage self.assertTrue((remaining_unemp_wages * rate) <= 0.01) # less than 0.01 because rate is negative - self.assertPayrollEqual(cats.get(category, 0.0), remaining_unemp_wages * rate) + _assert(cats.get(category, 0.0), remaining_unemp_wages * rate) # As if they were paid once already, so the first "two payslips" would remove all of the tax obligation # 1 wage - Payslip (confirmed) @@ -226,12 +230,12 @@ class TestUsPayslip(common.TransactionCase): contract.external_wages = wage payslip.compute_sheet() cats = self._getCategories(payslip) - self.assertPayrollEqual(cats.get(category, 0.0), 0.0) + _assert(cats.get(category, 0.0), 0.0) else: - self.assertPayrollEqual(cats.get(category, 0.0), wage * rate) + _assert(cats.get(category, 0.0), wage * rate) - def _test_er_suta(self, state_code, rate, date, wage_base=None, **extra_contract): - self._test_suta('ER_US_SUTA', state_code, rate, date, wage_base=wage_base, **extra_contract) + def _test_er_suta(self, state_code, rate, date, wage_base=None, relaxed=False, **extra_contract): + self._test_suta('ER_US_SUTA', state_code, rate, date, wage_base=wage_base, relaxed=relaxed, **extra_contract) - def _test_ee_suta(self, state_code, rate, date, wage_base=None, **extra_contract): - self._test_suta('EE_US_SUTA', state_code, rate, date, wage_base=wage_base, **extra_contract) + def _test_ee_suta(self, state_code, rate, date, wage_base=None, relaxed=False, **extra_contract): + self._test_suta('EE_US_SUTA', state_code, rate, date, wage_base=wage_base, relaxed=relaxed, **extra_contract) diff --git a/l10n_us_hr_payroll/tests/test_us_nj_newjersey_payslip_2019.py b/l10n_us_hr_payroll/tests/test_us_nj_newjersey_payslip_2019.py new file mode 100755 index 00000000..c28849b5 --- /dev/null +++ b/l10n_us_hr_payroll/tests/test_us_nj_newjersey_payslip_2019.py @@ -0,0 +1,128 @@ +# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. + +from .common import TestUsPayslip, process_payslip + + +class TestUsNJPayslip(TestUsPayslip): + ### + # 2019 Taxes and Rates + ### + NJ_UNEMP_MAX_WAGE = 34400.0 # Note that this is used for SDI and FLI as well + + ER_NJ_UNEMP = -2.6825 / 100.0 + EE_NJ_UNEMP = -0.3825 / 100.0 + + ER_NJ_SDI = -0.5 / 100.0 + EE_NJ_SDI = -0.17 / 100.0 + + ER_NJ_WF = -0.1175 / 100.0 + EE_NJ_WF = -0.0425 / 100.0 + + ER_NJ_FLI = 0.0 + EE_NJ_FLI = -0.08 / 100.0 + + # Examples found on page 24 of http://www.state.nj.us/treasury/taxation/pdf/current/njwt.pdf + def test_2019_taxes_example1(self): + salary = 300 + + # Tax Percentage Method for Single, taxable under $385 + wh = -4.21 + + employee = self._createEmployee() + contract = self._createContract(employee, + wage=salary, + state_id=self.get_us_state('NJ'), + nj_njw4_sit_filing_status='single', + nj_njw4_sit_allowances=1, + state_income_tax_additional_withholding=0.0, + nj_njw4_sit_rate_table='A', + schedule_pay='weekly') + + self._log('2019 New Jersey tax first payslip:') + payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31') + + payslip.compute_sheet() + + cats = self._getCategories(payslip) + + self.assertPayrollEqual(cats['EE_US_SUTA'], salary * (self.EE_NJ_UNEMP + self.EE_NJ_SDI + self.EE_NJ_WF + self.EE_NJ_FLI)) + self.assertPayrollEqual(cats['ER_US_SUTA'], salary * (self.ER_NJ_UNEMP + self.ER_NJ_SDI + self.ER_NJ_WF + self.ER_NJ_FLI)) + self.assertTrue(all((cats['EE_US_SUTA'], cats['ER_US_SUTA']))) + # self.assertPayrollEqual(cats['EE_US_NJ_SDI_SIT'], cats['EE_US_NJ_SDI_SIT'] * self.EE_NJ_SDI) + # self.assertPayrollEqual(cats['ER_US_NJ_SDI_SUTA'], cats['ER_US_NJ_SDI_SUTA'] * self.ER_NJ_SDI) + # self.assertPayrollEqual(cats['EE_US_NJ_FLI_SIT'], cats['EE_US_NJ_FLI_SIT'] * self.EE_NJ_FLI) + # self.assertPayrollEqual(cats['EE_US_NJ_WF_SIT'], cats['EE_US_NJ_WF_SIT'] * self.EE_NJ_WF) + self.assertPayrollEqual(cats['EE_US_SIT'], wh) + + process_payslip(payslip) + + # # Make a new payslip, this one will have maximums + # + remaining_nj_unemp_wages = self.NJ_UNEMP_MAX_WAGE - salary if (self.NJ_UNEMP_MAX_WAGE - 2 * salary < salary) \ + else salary + + self._log('2019 New Jersey tax second payslip:') + payslip = self._createPayslip(employee, '2019-02-01', '2019-02-28') + + payslip.compute_sheet() + + cats = self._getCategories(payslip) + + # self.assertPayrollEqual(cats['WAGE_US_NJ_UNEMP'], remaining_nj_unemp_wages) + self.assertPayrollEqual(cats['ER_US_SUTA'], remaining_nj_unemp_wages * (self.ER_NJ_UNEMP + self.ER_NJ_SDI + self.ER_NJ_WF + self.ER_NJ_FLI)) + self.assertPayrollEqual(cats['EE_US_SUTA'], remaining_nj_unemp_wages * (self.EE_NJ_UNEMP + self.EE_NJ_SDI + self.EE_NJ_WF + self.EE_NJ_FLI)) + + def test_2019_taxes_example2(self): + salary = 1400.00 + + # Tax Percentage Method for Single, taxable pay over $962, under $1346 + wh = -27.58 + + employee = self._createEmployee() + contract = self._createContract(employee, + wage=salary, + state_id=self.get_us_state('NJ'), + nj_njw4_sit_filing_status='married_separate', + nj_njw4_sit_allowances=3, + state_income_tax_additional_withholding=0.0, + #nj_njw4_sit_rate_table='B', + schedule_pay='weekly') + + self.assertEqual(contract.schedule_pay, 'weekly') + + self._log('2019 New Jersey tax first payslip:') + payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31') + + payslip.compute_sheet() + + cats = self._getCategories(payslip) + + self.assertPayrollEqual(cats['EE_US_SIT'], wh) + + + def test_2019_taxes_to_the_limits(self): + salary = 30000.00 + + # Tax Percentage Method for Single, taxable pay over $18750, under 125000 + wh = -1467.51 + + employee = self._createEmployee() + contract = self._createContract(employee, + wage=salary, + state_id=self.get_us_state('NJ'), + nj_njw4_sit_filing_status='married_joint', + nj_njw4_sit_allowances=3, + state_income_tax_additional_withholding=0.0, + # nj_njw4_sit_rate_table='B', + schedule_pay='quarterly') + + self.assertEqual(contract.schedule_pay, 'quarterly') + + self._log('2019 New Jersey tax first payslip:') + payslip = self._createPayslip(employee, '2019-01-01', '2019-03-31') + + payslip.compute_sheet() + + cats = self._getCategories(payslip) + + self.assertPayrollEqual(cats['EE_US_SIT'], wh) diff --git a/l10n_us_hr_payroll/tests/test_us_nj_newjersey_payslip_2020.py b/l10n_us_hr_payroll/tests/test_us_nj_newjersey_payslip_2020.py new file mode 100755 index 00000000..79e0b861 --- /dev/null +++ b/l10n_us_hr_payroll/tests/test_us_nj_newjersey_payslip_2020.py @@ -0,0 +1,48 @@ +# 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 TestUsNJPayslip(TestUsPayslip): + ### + # 2020 Taxes and Rates + ### + NJ_UNEMP_MAX_WAGE = 35300.0 # Note that this is used for SDI and FLI as well + + ER_NJ_UNEMP = 2.6825 + EE_NJ_UNEMP = 0.3825 + + ER_NJ_SDI = 0.5 + EE_NJ_SDI = 0.26 + + ER_NJ_WF = 0.1175 + EE_NJ_WF = 0.0425 + + ER_NJ_FLI = 0.0 + EE_NJ_FLI = 0.16 + + def _test_sit(self, wage, filing_status, allowances, schedule_pay, date_start, expected_withholding, rate_table=False): + employee = self._createEmployee() + contract = self._createContract(employee, + wage=wage, + state_id=self.get_us_state('NJ'), + nj_njw4_sit_filing_status=filing_status, + nj_njw4_sit_allowances=allowances, + state_income_tax_additional_withholding=0.0, + nj_njw4_sit_rate_table=rate_table, + schedule_pay=schedule_pay) + payslip = self._createPayslip(employee, date_start, date_start + timedelta(days=7)) + payslip.compute_sheet() + cats = self._getCategories(payslip) + self.assertPayrollAlmostEqual(cats.get('EE_US_SIT', 0.0), -expected_withholding if filing_status else 0.0) + + def test_2020_taxes_example1(self): + combined_er_rate = self.ER_NJ_UNEMP + self.ER_NJ_FLI + self.ER_NJ_SDI + self.ER_NJ_WF + self._test_er_suta('NJ', combined_er_rate, date(2020, 1, 1), wage_base=self.NJ_UNEMP_MAX_WAGE) + combined_ee_rate = self.EE_NJ_UNEMP + self.EE_NJ_FLI + self.EE_NJ_SDI + self.EE_NJ_WF + self._test_ee_suta('NJ', combined_ee_rate, date(2020, 1, 1), wage_base=self.NJ_UNEMP_MAX_WAGE, relaxed=True) + # these expected values come from https://www.state.nj.us/treasury/taxation/pdf/current/njwt.pdf + self._test_sit(300.0, 'single', 1, 'weekly', date(2020, 1, 1), 4.21) + self._test_sit(375.0, 'married_separate', 3, 'weekly', date(2020, 1, 1), 4.76) + self._test_sit(1400.0, 'head_household', 3, 'weekly', date(2020, 1, 1), 27.60) diff --git a/l10n_us_hr_payroll/views/us_payroll_config_views.xml b/l10n_us_hr_payroll/views/us_payroll_config_views.xml index f38baedc..a96d5f57 100644 --- a/l10n_us_hr_payroll/views/us_payroll_config_views.xml +++ b/l10n_us_hr_payroll/views/us_payroll_config_views.xml @@ -73,6 +73,13 @@ + +

Form NJ-W4 - State Income Tax

+ + + + +

Form IT-4 - State Income Tax