[IMP] l10n_us_hr_payroll: Improved test and restructured table for WI Wisconsin 2020.

This commit is contained in:
Bhoomi Vaishnani
2020-08-17 11:38:40 -04:00
parent c4368cadbb
commit a02766da6c
2 changed files with 26 additions and 6 deletions

View File

@@ -15,6 +15,7 @@
</data>
<!-- Rate -->
<!-- Rate based on this file https://dwd.wisconsin.gov/ui/employers/taxrates.htm -->
<record id="rule_parameter_us_wi_suta_rate" model="hr.rule.parameter">
<field name="name">US WI Wisconsin SUTA Rate</field>
<field name="code">us_wi_suta_rate</field>
@@ -41,6 +42,7 @@
</record>
</data>
<!-- Table based on https://www.revenue.wi.gov/DOR%20Publications/pb166.pdf page 25. -->
<record id="rule_parameter_us_wi_sit_tax_rate" model="hr.rule.parameter">
<field name="name">US WI Wisconsin SIT Tax Rate</field>
<field name="code">us_wi_sit_tax_rate</field>
@@ -49,8 +51,24 @@
<data noupdate="1">
<record id="rule_parameter_us_wi_sit_tax_rate_2020" model="hr.rule.parameter.value">
<field name="parameter_value">{
'single': ((5730, 0.0000, 0.0), (15200, 4.0000, 0.0), (16486, 4.4800, 378.80), (26227, 6.5408, 436.41), (62950, 7.0224, 1073.55), (240190, 6.2700, 3652.39), ('inf', 7.6500, 14765.34)),
'married': ((7870, 0.0000, 0.0), (18780, 4.0000, 0.0), (21400, 5.8400, 436.40), (28308, 7.0080, 589.41), (60750, 7.5240, 1073.52), (240190, 6.2700, 3514.46), ('inf', 7.6500, 14765.35)),
'single': (
( 5730, 0.0000, 0.00),
( 15200, 4.0000, 0.00),
( 16486, 4.4800, 378.80),
( 26227, 6.5408, 436.41),
( 62950, 7.0224, 1073.55),
(240190, 6.2700, 3652.39),
( 'inf', 7.6500, 14765.34),
),
'married': (
( 7870, 0.0000, 0.00),
( 18780, 4.0000, 0.00),
( 21400, 5.8400, 436.40),
( 28308, 7.0080, 589.41),
( 60750, 7.5240, 1073.52),
(240190, 6.2700, 3514.46),
( 'inf', 7.6500, 14765.35),
),
}</field>
<field name="rule_parameter_id" ref="rule_parameter_us_wi_sit_tax_rate"/>
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>

View File

@@ -27,11 +27,13 @@ class TestUsWIPayslip(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('WI', self.WI_UNEMP, date(2020, 1, 1), wage_base=self.WI_UNEMP_MAX_WAGE)
self._test_sit(300, 'single', 1, 0, False,'weekly', date(2020, 1, 1), 7.21)
self._test_sit(300, 'single', 1, 0, False, 'weekly', date(2020, 1, 1), 7.21)
self._test_sit(700, 'married', 3, 0, False, 'bi-weekly', date(2020, 1, 1), 13.35)
self._test_sit(1300, 'single', 1, 10, True, 'bi-weekly', date(2020, 1, 1), 0.00)
self._test_sit(700, 'married', 3, 10, False, 'bi-weekly', date(2020, 1, 1), 23.35)
self._test_sit(7000, 'single', 1, 10, True, 'bi-weekly', date(2020, 1, 1), 0.00)
self._test_sit(10000, 'married', 3, 10, False, 'bi-weekly', date(2020, 1, 1), 633.65)
# ((48000 - 26227) * (7.0224 /100) + 1073.55 - 44) / 12
self._test_sit(4000, 'single', 2, 0, False, 'monthly', date(2020, 1, 1), 213.21)