From 9a54cbcd7633eb26c2782349a4d0e9c39d1c572e Mon Sep 17 00:00:00 2001 From: Bhoomi Vaishnani Date: Wed, 19 Aug 2020 10:23:12 -0400 Subject: [PATCH] [IMP] l10n_us_hr_payroll: Reformat Tax table, changed field string and improved test case for OK Oklahoma 2020 --- l10n_us_hr_payroll/data/state/ok_oklahoma.xml | 214 ++++++++++++++++-- .../models/us_payroll_config.py | 4 +- .../tests/test_us_ok_oklahoma_payslip_2020.py | 1 + 3 files changed, 194 insertions(+), 25 deletions(-) diff --git a/l10n_us_hr_payroll/data/state/ok_oklahoma.xml b/l10n_us_hr_payroll/data/state/ok_oklahoma.xml index f4ec8269..04aa8380 100644 --- a/l10n_us_hr_payroll/data/state/ok_oklahoma.xml +++ b/l10n_us_hr_payroll/data/state/ok_oklahoma.xml @@ -27,7 +27,7 @@ - + US OK Oklahoma Allowances Rate us_ok_sit_allowances_rate @@ -48,7 +48,7 @@ - + US OK Oklahoma SIT Tax Rate us_ok_sit_tax_rate @@ -58,31 +58,199 @@ { 'single': { - 'weekly': ((122, 0.00, 0.00), (141, 0.50, 0.00), (170, 1.00, 0.10), (194, 2.00, 0.38), (216, 3.00, 0.87), (261, 4.00, 1.53), ('inf', 5.00, 3.30)), - 'bi-weekly': ((244, 0.00, 0.00), (283, 0.50, 0.00), (340, 1.00, 0.19), (388, 2.00, 0.77), (433, 3.00, 1.73), (521, 4.00, 3.06), ('inf', 5.00, 6.60)), - 'semi-monthly': ((265, 0.00, 0.00), (306, 0.50, 0.00), (369, 1.00, 0.21), (421, 2.00, 0.83), (469, 3.00, 1.88), (565, 4.00, 3.31), ('inf', 5.00, 7.15)), - 'monthly': ((529, 0.00, 0.00), (613, 0.50, 0.00), (738, 1.00, 0.42), (842, 2.00, 1.67), (938, 3.00, 3.75), (1129, 4.00, 6.63), ('inf', 5.00, 14.29)), - 'quarterly': ((1588, 0.00, 0.00), (1838, 0.50, 0.00), (2213, 1.00, 1.25), (2525, 2.00, 5.00), (2813, 3.00, 11.25), (3388, 4.00, 19.88), ('inf', 5.00, 42.88)), - 'semi-annual': ((3175, 0.00, 0.00), (3675, 0.50, 0.00), (4425, 1.00, 2.50), (5050, 2.00, 10.00), (5625, 3.00, 22.50), (6775, 4.00, 39.75), ('inf', 5.00, 85.75)), - 'annually': ((6350, 0.00, 0.00), (7350, 0.50, 0.00), (8850, 1.00, 5.00), (10100, 2.00, 20.00), (11250, 3.00, 45.00), (13550, 4.00, 79.50), ('inf', 5.00, 171.50)), + 'weekly': ( + ( 122, 0.00, 0.00), + ( 141, 0.50, 0.00), + ( 170, 1.00, 0.10), + ( 194, 2.00, 0.38), + ( 216, 3.00, 0.87), + ( 261, 4.00, 1.53), + ('inf', 5.00, 3.30), + ), + 'bi-weekly': ( + ( 244, 0.00, 0.00), + ( 283, 0.50, 0.00), + ( 340, 1.00, 0.19), + ( 388, 2.00, 0.77), + ( 433, 3.00, 1.73), + ( 521, 4.00, 3.06), + ('inf', 5.00, 6.60), + ), + 'semi-monthly': ( + ( 265, 0.00, 0.00), + ( 306, 0.50, 0.00), + ( 369, 1.00, 0.21), + ( 421, 2.00, 0.83), + ( 469, 3.00, 1.88), + ( 565, 4.00, 3.31), + ('inf', 5.00, 7.15), + ), + 'monthly': ( + ( 529, 0.00, 0.00), + ( 613, 0.50, 0.00), + ( 738, 1.00, 0.42), + ( 842, 2.00, 1.67), + ( 938, 3.00, 3.75), + (1129, 4.00, 6.63), + ('inf', 5.00, 14.29), + ), + 'quarterly': ( + ( 1588, 0.00, 0.00), + ( 1838, 0.50, 0.00), + ( 2213, 1.00, 1.25), + ( 2525, 2.00, 5.00), + ( 2813, 3.00, 11.25), + ( 3388, 4.00, 19.88), + ('inf', 5.00, 42.88), + ), + 'semi-annual': ( + ( 3175, 0.00, 0.00), + ( 3675, 0.50, 0.00), + ( 4425, 1.00, 2.50), + ( 5050, 2.00, 10.00), + (5625, 3.00, 22.50), + ( 6775, 4.00, 39.75), + ('inf', 5.00, 85.75), + ), + 'annually': ( + ( 6350, 0.00, 0.00), + ( 7350, 0.50, 0.00), + ( 8850, 1.00, 5.00), + (10100, 2.00, 20.00), + (11250, 3.00, 45.00), + (13550, 4.00, 79.50), + ('inf', 5.00, 171.50), + ), }, 'married': { - 'weekly': ((244, 0.00, 0.00), (283, 0.50, 0.00), (340, 1.00, 0.19), (388, 2.00, 0.77), (433, 3.00, 1.73), (479, 4.00, 3.06), ('inf', 5.00, 4.90)), - 'bi-weekly': ((488, 0.00, 0.00), (565, 0.50, 0.00), (681, 1.00, 0.38), (777, 2.00, 1.54), (865, 3.00, 3.46), (958, 4.00, 6.12), ('inf', 5.00, 9.81)), - 'semi-monthly': ((529, 0.00, 0.00), (613, 0.50, 0.00), (738, 1.00, 0.42), (842, 2.00, 1.67), (938, 3.00, 3.75), (1038, 4.00, 6.63), ('inf', 5.00, 10.63)), - 'monthly': ((1058, 0.00, 0.00), (1225, 0.50, 0.00), (1475, 1.00, 0.83), (1683, 2.00, 3.33), (1875, 3.00, 7.50), (2075, 4.00, 13.25), ('inf', 5.00, 21.25)), - 'quarterly': ((3175, 0.00, 0.00), (3675, 0.50, 0.00), (4425, 1.00, 2.50), (5050, 2.00, 10.00), (5625, 3.00, 22.50), (6225, 4.00, 39.75), ('inf', 5.00, 63.75)), - 'semi-annual': ((6350, 0.00, 0.00), (7350, 0.50, 0.00), (8850, 1.00, 5.00), (10100, 2.00, 20.00), (11250, 3.00, 45.00), (12450, 4.00, 79.50), ('inf', 5.00, 127.50)), - 'annually': ((12700, 0.00, 0.00), (14700, 0.50, 0.00), (17700, 1.00, 10.00), (20200, 2.00, 40.00), (22500, 3.00, 90.00), (24900, 4.00, 159.00), ('inf', 5.00, 255.00)), + 'weekly': ( + ( 244, 0.00, 0.00), + ( 283, 0.50, 0.00), + ( 340, 1.00, 0.19), + ( 388, 2.00, 0.77), + ( 433, 3.00, 1.73), + ( 479, 4.00, 3.06), + ('inf', 5.00, 4.90), + ), + 'bi-weekly': ( + ( 488, 0.00, 0.00), + ( 565, 0.50, 0.00), + ( 681, 1.00, 0.38), + ( 777, 2.00, 1.54), + ( 865, 3.00, 3.46), + ( 958, 4.00, 6.12), + ('inf', 5.00, 9.81), + ), + 'semi-monthly': ( + ( 529, 0.00, 0.00), + ( 613, 0.50, 0.00), + ( 738, 1.00, 0.42), + ( 842, 2.00, 1.67), + ( 938, 3.00, 3.75), + ( 1038, 4.00, 6.63), + ('inf', 5.00, 10.63), + ), + 'monthly': ( + ( 1058, 0.00, 0.00), + ( 1225, 0.50, 0.00), + ( 1475, 1.00, 0.83), + ( 1683, 2.00, 3.33), + ( 1875, 3.00, 7.50), + ( 2075, 4.00, 13.25), + ('inf', 5.00, 21.25), + ), + 'quarterly': ( + ( 3175, 0.00, 0.00), + ( 3675, 0.50, 0.00), + ( 4425, 1.00, 2.50), + ( 5050, 2.00, 10.00), + ( 5625, 3.00, 22.50), + ( 6225, 4.00, 39.75), + ('inf', 5.00, 63.75), + ), + 'semi-annual': ( + ( 6350, 0.00, 0.00), + ( 7350, 0.50, 0.00), + ( 8850, 1.00, 5.00), + ( 10100, 2.00, 20.00), + ( 11250, 3.00, 45.00), + ( 12450, 4.00, 79.50), + ( 'inf', 5.00, 127.50), + ), + 'annually': ( + ( 12700, 0.00, 0.00), + ( 14700, 0.50, 0.00), + ( 17700, 1.00, 10.00), + ( 20200, 2.00, 40.00), + ( 22500, 3.00, 90.00), + ( 24900, 4.00, 159.00), + ( 'inf', 5.00, 255.00), + ), }, 'head_household': { - 'weekly': ((122, 0.00, 0.00), (141, 0.50, 0.00), (170, 1.00, 0.10), (194, 2.00, 0.38), (216, 3.00, 0.87), (261, 4.00, 1.53), ('inf', 5.00, 3.30)), - 'bi-weekly': ((244, 0.00, 0.00), (283, 0.50, 0.00), (340, 1.00, 0.19), (388, 2.00, 0.77), (433, 3.00, 1.73), (521, 4.00, 3.06), ('inf', 5.00, 6.60)), - 'semi-monthly': ((265, 0.00, 0.00), (306, 0.50, 0.00), (369, 1.00, 0.21), (421, 2.00, 0.83), (469, 3.00, 1.88), (565, 4.00, 3.31), ('inf', 5.00, 7.15)), - 'monthly': ((529, 0.00, 0.00), (613, 0.50, 0.00), (738, 1.00, 0.42), (842, 2.00, 1.67), (938, 3.00, 3.75), (1129, 4.00, 6.63), ('inf', 5.00, 14.29)), - 'quarterly': ((1588, 0.00, 0.00), (1838, 0.50, 0.00), (2213, 1.00, 1.25), (2525, 2.00, 5.00), (2813, 3.00, 11.25), (3388, 4.00, 19.88), ('inf', 5.00, 42.88)), - 'semi-annual': ((3175, 0.00, 0.00), (3675, 0.50, 0.00), (4425, 1.00, 2.50), (5050, 2.00, 10.00), (5625, 3.00, 22.50), (6775, 4.00, 39.75), ('inf', 5.00, 85.75)), - 'annually': ((6350, 0.00, 0.00), (7350, 0.50, 0.00), (8850, 1.00, 5.00), (10100, 2.00, 20.00), (11250, 3.00, 45.00), (13550, 4.00, 79.50), ('inf', 5.00, 171.50)), + 'weekly': ( + ( 122, 0.00, 0.00), + ( 141, 0.50, 0.00), + ( 170, 1.00, 0.10), + ( 194, 2.00, 0.38), + ( 216, 3.00, 0.87), + ( 261, 4.00, 1.53), + ('inf', 5.00, 3.30), + ), + 'bi-weekly': ( + ( 244, 0.00, 0.00), + ( 283, 0.50, 0.00), + ( 340, 1.00, 0.19), + ( 388, 2.00, 0.77), + ( 433, 3.00, 1.73), + ( 521, 4.00, 3.06), + ('inf', 5.00, 6.60), + ), + 'semi-monthly': ( + ( 265, 0.00, 0.00), + ( 306, 0.50, 0.00), + ( 369, 1.00, 0.21), + ( 421, 2.00, 0.83), + ( 469, 3.00, 1.88), + ( 565, 4.00, 3.31), + ('inf', 5.00, 7.15), + ), + 'monthly': ( + ( 529, 0.00, 0.00), + ( 613, 0.50, 0.00), + ( 738, 1.00, 0.42), + ( 842, 2.00, 1.67), + ( 938, 3.00, 3.75), + ( 1129, 4.00, 6.63), + ('inf', 5.00, 14.29), + ), + 'quarterly': ( + ( 1588, 0.00, 0.00), + ( 1838, 0.50, 0.00), + ( 2213, 1.00, 1.25), + ( 2525, 2.00, 5.00), + ( 2813, 3.00, 11.25), + ( 3388, 4.00, 19.88), + ('inf', 5.00, 42.88), + ), + 'semi-annual': ( + ( 3175, 0.00, 0.00), + ( 3675, 0.50, 0.00), + ( 4425, 1.00, 2.50), + ( 5050, 2.00, 10.00), + ( 5625, 3.00, 22.50), + ( 6775, 4.00, 39.75), + ('inf', 5.00, 85.75), + ), + 'annually': ( + ( 6350, 0.00, 0.00), + ( 7350, 0.50, 0.00), + ( 8850, 1.00, 5.00), + (10100, 2.00, 20.00), + (11250, 3.00, 45.00), + (13550, 4.00, 79.50), + ('inf', 5.00, 171.50), + ), }, } diff --git a/l10n_us_hr_payroll/models/us_payroll_config.py b/l10n_us_hr_payroll/models/us_payroll_config.py index eb84ce65..8741d81d 100644 --- a/l10n_us_hr_payroll/models/us_payroll_config.py +++ b/l10n_us_hr_payroll/models/us_payroll_config.py @@ -241,9 +241,9 @@ class HRContractUSPayrollConfig(models.Model): ok_w4_sit_filing_status = fields.Selection([ ('single', 'Single'), ('married', 'Married'), - ('head_household', 'Head of Household') + ('head_household', 'Married, but withhold at higher Single rate') ], string='Oklahoma OK-W-4 Filing Status', help='OK-W-4') - ok_w4_sit_allowances = fields.Integer(string='Oklahoma OK-W-4 Allowances', help='OK-W-4 1.2.3.') + ok_w4_sit_allowances = fields.Integer(string='Oklahoma OK-W-4 Allowances', help='OK-W-4 5.') ri_w4_sit_allowances = fields.Integer(string='Rhode Island RI W-4 Allowances', help='RI W-4 1.') diff --git a/l10n_us_hr_payroll/tests/test_us_ok_oklahoma_payslip_2020.py b/l10n_us_hr_payroll/tests/test_us_ok_oklahoma_payslip_2020.py index 03297065..cacdcc16 100755 --- a/l10n_us_hr_payroll/tests/test_us_ok_oklahoma_payslip_2020.py +++ b/l10n_us_hr_payroll/tests/test_us_ok_oklahoma_payslip_2020.py @@ -35,3 +35,4 @@ class TestUsOKPayslip(TestUsPayslip): self._test_sit(1825, 'married', 2, 0, True, 'monthly', date(2020, 1, 1), 0.00) self._test_sit(1000, 'single', 1, 0, False, 'weekly', date(2020, 1, 1), 39.00) self._test_sit(1000, 'single', 1, 10, False, 'weekly', date(2020, 1, 1), 49.00) + self._test_sit(5000, 'head_household', 2, 10, False, 'monthly', date(2020, 1, 1), 210.00)