[IMP] l10n_us_hr_payroll: Refactored Tax table and Improved test case for NE Nebraska 2020.

This commit is contained in:
Bhoomi Vaishnani
2020-08-18 17:19:27 -04:00
parent c53ce9ead7
commit f11bbe49f7
2 changed files with 130 additions and 17 deletions

View File

@@ -27,7 +27,7 @@
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
</record>
</data>
<!-- Table based on Percentage method from https://revenue.nebraska.gov/sites/revenue.nebraska.gov/files/doc/business/2017cir-en_whole.pdf -->
<record id="rule_parameter_us_ne_sit_tax_rate" model="hr.rule.parameter">
<field name="name">US NE Nebraska SIT Tax Rate</field>
<field name="code">us_ne_sit_tax_rate</field>
@@ -37,22 +37,134 @@
<record id="rule_parameter_us_ne_sit_tax_rate_2020" model="hr.rule.parameter.value">
<field name="parameter_value">{
'single': {
'weekly': ((57, 0.00, 0.0), (105, 0.00, 2.26), (342, 1.08, 3.22), (496, 8.71, 4.91), (629, 16.27, 6.20), (1182, 24.52, 6.59), ('inf', 60.96, 6.95)),
'bi-weekly': ((114, 0.00, 0.0), (211, 0.00, 2.26), (684, 2.19, 3.22), (992, 17.42, 4.91), (1259, 32.54, 6.20), (2364, 49.09, 6.59), ('inf', 121.91, 6.95)),
'semi-monthly': ((124, 0.00, 0.0), (228, 0.00, 2.26), (741, 2.35, 3.22), (1074, 18.87, 4.91), (1364, 35.22, 6.20), (2561, 53.20, 6.59), ('inf', 132.08, 6.95)),
'monthly': ((248, 0.00, 0.0), (457, 0.00, 2.26), (1483, 4.72, 3.22), (2148, 37.76, 4.91), (2728, 70.41, 6.20), (5123, 106.37, 6.59), ('inf', 264.20, 6.95)),
'quarterly': ((744, 0.00, 0.0), (1370, 0.00, 2.26), (4448, 14.15, 3.22), (6445, 113.26, 4.91), (8183, 211.31, 6.20), (15368, 319.07, 6.59), ('inf', 792.56, 6.95)),
'semi-annual': ((1488, 0.00, 0.0), (2740, 0.00, 2.26), (8895, 28.30, 3.22), (12890, 226.49, 4.91), (16365, 422.64, 6.20), (30735, 638.09, 6.59), ('inf', 1585.07, 6.95)),
'annually': ((2975, 0.00, 0.0), (5480, 0.00, 2.26), (17790, 56.61, 3.22), (25780, 452.99, 4.91), (32730, 845.30, 6.20), (61470, 1276.20, 6.59), ('inf', 3170.17, 6.95)),
'weekly': (
( 57, 0.00, 0.00),
( 105, 0.00, 2.26),
( 342, 1.08, 3.22),
( 496, 8.71, 4.91),
( 629, 16.27, 6.20),
( 1182, 24.52, 6.59),
('inf', 60.96, 6.95),
),
'bi-weekly': (
( 114, 0.00, 0.00),
( 211, 0.00, 2.26),
( 684, 2.19, 3.22),
( 992, 17.42, 4.91),
( 1259, 32.54, 6.20),
( 2364, 49.09, 6.59),
('inf', 121.91, 6.95),
),
'semi-monthly': (
( 124, 0.00, 0.00),
( 228, 0.00, 2.26),
( 741, 2.35, 3.22),
( 1074, 18.87, 4.91),
( 1364, 35.22, 6.20),
( 2561, 53.20, 6.59),
('inf', 132.08, 6.95),
),
'monthly': (
( 248, 0.00, 0.00),
( 457, 0.00, 2.26),
( 1483, 4.72, 3.22),
( 2148, 37.76, 4.91),
( 2728, 70.41, 6.20),
( 5123, 106.37, 6.59),
('inf', 264.20, 6.95),
),
'quarterly': (
( 744, 0.00, 0.00),
( 1370, 0.00, 2.26),
( 4448, 14.15, 3.22),
( 6445, 113.26, 4.91),
( 8183, 211.31, 6.20),
( 15368, 319.07, 6.59),
( 'inf', 792.56, 6.95),
),
'semi-annual': (
( 1488, 0.00, 0.00),
( 2740, 0.00, 2.26),
( 8895, 28.30, 3.22),
( 12890, 226.49, 4.91),
( 16365, 422.64, 6.20),
( 30735, 638.09, 6.59),
( 'inf', 1585.07, 6.95),
),
'annually': (
( 2975, 0.00, 0.00),
( 5480, 0.00, 2.26),
( 17790, 56.61, 3.22),
( 25780, 452.99, 4.91),
( 32730, 845.30, 6.20),
( 61470, 1276.20, 6.59),
( 'inf', 3170.17, 6.95),
),
},
'married': {
'weekly': ((137, 0.00, 0.0), (204, 0.00, 2.26), (508, 1.51, 3.22), (790, 11.30, 4.91), (981, 25.15, 6.20), (1300, 36.99, 6.59), ('inf', 58.01, 6.95)),
'bi-weekly': ((273, 0.00, 0.0), (408, 0.00, 2.26), (1016, 3.05, 3.22), (1581, 22.63, 4.91), (1961, 50.37, 6.20), (2601, 73.93, 6.59), ('inf', 116.11, 6.95)),
'semi-monthly': ((296, 0.00, 0.0), (442, 0.00, 2.26), (1101, 3.30, 3.22), (1713, 24.52, 4.91), (2125, 54.57, 6.20), (2818, 80.11, 6.59), ('inf', 125.78, 6.95)),
'monthly': ((592, 0.00, 0.0), (884, 0.00, 2.26), (2202, 6.60, 3.22), (3425, 49.04, 4.91), (4249, 109.09, 6.20), (5635, 160.18, 6.59), ('inf', 251.52, 6.95)),
'quarterly': ((1775, 0.00, 0.0), (2653, 0.00, 2.26), (6605, 19.84, 3.22), (10275, 147.09, 4.91), (12748, 327.29, 6.20), (16905, 480.62, 6.59), ('inf', 754.57, 6.95)),
'semi-annual': ((3550, 0.00, 0.0), (5305, 0.00, 2.26), (13210, 39.66, 3.22), (20550, 294.20, 4.91), (25495, 654.59, 6.20), (33810, 961.18, 6.59), ('inf', 1509.14, 6.95)),
'annually': ((7100, 0.00, 0.0), (10610, 0.00, 2.26), (26420, 79.33, 3.22), (41100, 588.41, 4.91), (50990, 1309.20, 6.20), (67620, 1992.38, 6.59), ('inf', 3018.30, 6.95)),
'weekly': (
( 137, 0.00, 0.00),
( 204, 0.00, 2.26),
( 508, 1.51, 3.22),
( 790, 11.30, 4.91),
( 981, 25.15, 6.20),
( 1300, 36.99, 6.59),
('inf', 58.01, 6.95),
),
'bi-weekly': (
( 273, 0.00, 0.00),
( 408, 0.00, 2.26),
( 1016, 3.05, 3.22),
( 1581, 22.63, 4.91),
( 1961, 50.37, 6.20),
( 2601, 73.93, 6.59),
('inf', 116.11, 6.95),
),
'semi-monthly': (
( 296, 0.00, 0.00),
( 442, 0.00, 2.26),
( 1101, 3.30, 3.22),
( 1713, 24.52, 4.91),
( 2125, 54.57, 6.20),
( 2818, 80.11, 6.59),
('inf', 125.78, 6.95),
),
'monthly': (
( 592, 0.00, 0.00),
( 884, 0.00, 2.26),
( 2202, 6.60, 3.22),
( 3425, 49.04, 4.91),
( 4249, 109.09, 6.20),
( 5635, 160.18, 6.59),
('inf', 251.52, 6.95),
),
'quarterly': (
( 1775, 0.00, 0.00),
( 2653, 0.00, 2.26),
( 6605, 19.84, 3.22),
( 10275, 147.09, 4.91),
( 12748, 327.29, 6.20),
( 16905, 480.62, 6.59),
( 'inf', 754.57, 6.95),
),
'semi-annual': (
( 3550, 0.00, 0.00),
( 5305, 0.00, 2.26),
( 13210, 39.66, 3.22),
( 20550, 294.20, 4.91),
( 25495, 654.59, 6.20),
( 33810, 961.18, 6.59),
( 'inf', 1509.14, 6.95),
),
'annually': (
( 7100, 0.00, 0.00),
( 10610, 0.00, 2.26),
( 26420, 79.33, 3.22),
( 41100, 588.41, 4.91),
( 50990, 1309.20, 6.20),
( 67620, 1992.38, 6.59),
( 'inf', 3018.30, 6.95),
),
},
}</field>
<field name="rule_parameter_id" ref="rule_parameter_us_ne_sit_tax_rate"/>

View File

@@ -26,7 +26,7 @@ class TestUsNEPayslip(TestUsPayslip):
cats = self._getCategories(payslip)
self._log('Computed period tax: ' + str(expected_withholding))
self.assertPayrollEqual(cats.get('EE_US_SIT', 0.0), -expected_withholding)
self.assertPayrollAlmostEqual(cats.get('EE_US_SIT', 0.0), -expected_withholding)
def test_2020_taxes_example(self):
self._test_er_suta('NE', self.NE_UNEMP, date(2020, 1, 1), wage_base=self.NE_UNEMP_MAX_WAGE)
@@ -34,4 +34,5 @@ class TestUsNEPayslip(TestUsPayslip):
self._test_sit(9500.0, 'single', False, 0.0, 1, 'bi-weekly', date(2020, 1, 1), 612.63)
self._test_sit(10500.0, 'married', False, 0.0, 1, 'bi-weekly', date(2020, 1, 1), 659.85)
self._test_sit(9500.0, 'single', True, 0.0, 1, 'bi-weekly', date(2020, 1, 1), 0.0)
self._test_sit(10500.0, 'single', False, 10.0, 2, 'monthly', date(2020, 1, 1), 625.2)
self._test_sit(10500.0, 'single', False, 10.0, 2, 'monthly', date(2020, 1, 1), 625.2)
self._test_sit(4000.0, 'single', False, 0.0, 1, 'monthly', date(2020, 1, 1), 179.44)