[IMP] l10n_us_hr_payroll: Reformat Tax table, changed field string and improved test case for OK Oklahoma 2020

This commit is contained in:
Bhoomi Vaishnani
2020-08-19 10:23:12 -04:00
parent d95efc2b8c
commit 9a54cbcd76
3 changed files with 194 additions and 25 deletions

View File

@@ -27,7 +27,7 @@
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
</record>
</data>
<!-- table from https://www.ok.gov/tax/documents/2020WHTables.pdf -->
<record id="rule_parameter_us_ok_sit_allowances_rate" model="hr.rule.parameter">
<field name="name">US OK Oklahoma Allowances Rate</field>
<field name="code">us_ok_sit_allowances_rate</field>
@@ -48,7 +48,7 @@
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
</record>
</data>
<!-- table from https://www.ok.gov/tax/documents/2020WHTables.pdf -->
<record id="rule_parameter_us_ok_sit_tax_rate" model="hr.rule.parameter">
<field name="name">US OK Oklahoma SIT Tax Rate</field>
<field name="code">us_ok_sit_tax_rate</field>
@@ -58,31 +58,199 @@
<record id="rule_parameter_us_ok_sit_tax_rate_2020" model="hr.rule.parameter.value">
<field name="parameter_value">{
'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),
),
},
}</field>
<field name="rule_parameter_id" ref="rule_parameter_us_ok_sit_tax_rate"/>

View File

@@ -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.')

View File

@@ -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)