[IMP] l10n_us_hr_payroll: Refactored Tax table, changed filing status string and Improved test case for KS Kansas 2020.

This commit is contained in:
Bhoomi Vaishnani
2020-08-19 14:42:35 -04:00
parent 9a54cbcd76
commit aafc5c9f3b
4 changed files with 92 additions and 31 deletions

View File

@@ -48,7 +48,7 @@
<field name="date_from" eval="datetime(2020, 1, 1).date()"/> <field name="date_from" eval="datetime(2020, 1, 1).date()"/>
</record> </record>
</data> </data>
<!-- Table from percentage table from https://www.ksrevenue.org/pdf/kw100.pdf -->
<record id="rule_parameter_us_ks_sit_tax_rate" model="hr.rule.parameter"> <record id="rule_parameter_us_ks_sit_tax_rate" model="hr.rule.parameter">
<field name="name">US KS Kansas SIT Tax Rate</field> <field name="name">US KS Kansas SIT Tax Rate</field>
<field name="code">us_ks_sit_tax_rate</field> <field name="code">us_ks_sit_tax_rate</field>
@@ -58,31 +58,92 @@
<record id="rule_parameter_us_ks_sit_tax_rate_2020" model="hr.rule.parameter.value"> <record id="rule_parameter_us_ks_sit_tax_rate_2020" model="hr.rule.parameter.value">
<field name="parameter_value">{ <field name="parameter_value">{
'single': { 'single': {
'weekly': ((58, 0.00, 0.00), (346, 3.10, 0.00), (635, 5.25, 8.94), ('inf', 5.70, 24.09)), 'weekly': (
'bi-weekly': ((115, 0.00, 0.00), (692, 3.10, 0.00), (1269, 5.25, 17.88), ('inf', 5.70, 48.17)), ( 58, 0.00, 0.00),
'semi-monthly': ((125, 0.00, 0.00), (750, 3.10, 0.00), (1375, 5.25, 19.38), ('inf', 5.70, 52.19)), ( 346, 3.10, 0.00),
'monthly': ((250, 0.00, 0.00), (1500, 3.10, 0.00), (2750, 5.25, 38.75), ('inf', 5.70, 104.38)), ( 635, 5.25, 8.94),
'quarterly': ((750, 0.00, 0.00), (4500, 3.10, 0.00), (8250, 5.25, 116.25), ('inf', 5.70, 313.13)), ('inf', 5.70, 24.09),
'semi-annual': ((1500, 0.00, 0.00), (9000, 3.10, 0.00), (16500, 5.25, 232.50), ('inf', 5.70, 626.25)), ),
'annually': ((3000, 0.00, 0.00), (18000, 3.10, 0.00), (33000, 5.25, 465.00), ('inf', 5.70, 1252.50)), 'bi-weekly': (
( 115, 0.00, 0.00),
( 692, 3.10, 0.00),
( 1269, 5.25, 17.88),
('inf', 5.70, 48.17),
),
'semi-monthly': (
( 125, 0.00, 0.00),
( 750, 3.10, 0.00),
( 1375, 5.25, 19.38),
('inf', 5.70, 52.19),
),
'monthly': (
( 250, 0.00, 0.00),
( 1500, 3.10, 0.00),
( 2750, 5.25, 38.75),
('inf', 5.70, 104.38),
),
'quarterly': (
( 750, 0.00, 0.00),
( 4500, 3.10, 0.00),
(8250, 5.25, 116.25),
('inf', 5.70, 313.13),
),
'semi-annual': (
( 1500, 0.00, 0.00),
( 9000, 3.10, 0.00),
(16500, 5.25, 232.50),
('inf', 5.70, 626.25),
),
'annually': (
( 3000, 0.00, 0.00),
(18000, 3.10, 0.00),
(33000, 5.25, 465.00),
('inf', 5.70, 1252.50),
),
}, },
'married': { 'married': {
'weekly': ((144, 0.00, 0.00), (721, 3.10, 0.00), (1298, 5.25, 17.88), ('inf', 5.70, 48.17)), 'weekly': (
'bi-weekly': ((288, 0.00, 0.00), (1442, 3.10, 0.00), (2596, 5.25, 35.77), ('inf', 5.70, 96.35)), ( 144, 0.00, 0.00),
'semi-monthly': ((313, 0.00, 0.00), (1563, 3.10, 0.00), (2813, 5.25, 38.75), ('inf', 5.70, 104.38)), ( 721, 3.10, 0.00),
'monthly': ((625, 0.00, 0.00), (3125, 3.10, 0.00), (5625, 5.25, 77.50), ('inf', 5.70, 208.75)), (1298, 5.25, 17.88),
'quarterly': ((1875, 0.00, 0.00), (9375, 3.10, 0.00), (16875, 5.25, 232.50), ('inf', 5.70, 626.25)), ('inf', 5.70, 48.17),
'semi-annual': ((3750, 0.00, 0.00), (18750, 3.10, 0.00), (33750, 5.25, 465.00), ('inf', 5.70, 1252.50)), ),
'annually': ((7500, 0.00, 0.00), (37500, 3.10, 0.00), (67500, 5.25, 930.00), ('inf', 5.70, 2505.00)), 'bi-weekly': (
}, ( 288, 0.00, 0.00),
'head_household': { ( 1442, 3.10, 0.00),
'weekly': ((58, 0.00, 0.00), (346, 3.10, 0.00), (635, 5.25, 8.94), ('inf', 5.70, 24.09)), ( 2596, 5.25, 35.77),
'bi-weekly': ((115, 0.00, 0.00), (692, 3.10, 0.00), (1269, 5.25, 17.88), ('inf', 5.70, 48.17)), ('inf', 5.70, 96.35),
'semi-monthly': ((125, 0.00, 0.00), (750, 3.10, 0.00), (1375, 5.25, 19.38), ('inf', 5.70, 52.19)), ),
'monthly': ((250, 0.00, 0.00), (1500, 3.10, 0.00), (2750, 5.25, 38.75), ('inf', 5.70, 104.38)), 'semi-monthly': (
'quarterly': ((750, 0.00, 0.00), (4500, 3.10, 0.00), (8250, 5.25, 116.25), ('inf', 5.70, 313.13)), ( 313, 0.00, 0.00),
'semi-annual': ((1500, 0.00, 0.00), (9000, 3.10, 0.00), (16500, 5.25, 232.50), ('inf', 5.70, 626.25)), ( 1563, 3.10, 0.00),
'annually': ((3000, 0.00, 0.00), (18000, 3.10, 0.00), (33000, 5.25, 465.00), ('inf', 5.70, 1252.50)), ( 2813, 5.25, 38.75),
('inf', 5.70, 104.38),
),
'monthly': (
( 625, 0.00, 0.00),
( 3125, 3.10, 0.00),
( 5625, 5.25, 77.50),
('inf', 5.70, 208.75),
),
'quarterly': (
( 1875, 0.00, 0.00),
( 9375, 3.10, 0.00),
(16875, 5.25, 232.50),
('inf', 5.70, 626.25),
),
'semi-annual': (
( 3750, 0.00, 0.00),
(18750, 3.10, 0.00),
(33750, 5.25, 465.00),
('inf', 5.70, 1252.50),
),
'annually': (
( 7500, 0.00, 0.00),
(37500, 3.10, 0.00),
(67500, 5.25, 930.00),
('inf', 5.70, 2505.00),
),
}, },
}</field> }</field>
<field name="rule_parameter_id" ref="rule_parameter_us_ks_sit_tax_rate"/> <field name="rule_parameter_id" ref="rule_parameter_us_ks_sit_tax_rate"/>

View File

@@ -129,8 +129,7 @@ class HRContractUSPayrollConfig(models.Model):
ks_k4_sit_filing_status = fields.Selection([ ks_k4_sit_filing_status = fields.Selection([
('single', 'Single'), ('single', 'Single'),
('married', 'Married'), ('married', 'Joint'),
('head of household', 'Head of Household'),
], string='Kansas K-4 Filing Status', help='KS K-4 3.') ], string='Kansas K-4 Filing Status', help='KS K-4 3.')
ks_k4_sit_allowances = fields.Integer(string='Kansas KS K-4 Number of Allowances', help='KS K-4 Step 4.') ks_k4_sit_allowances = fields.Integer(string='Kansas KS K-4 Number of Allowances', help='KS K-4 Step 4.')

View File

@@ -26,10 +26,11 @@ class TestUsKSPayslip(TestUsPayslip):
cats = self._getCategories(payslip) cats = self._getCategories(payslip)
self._log('Computed period tax: ' + str(expected_withholding)) 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): def test_2020_taxes_example(self):
self._test_er_suta('KS', self.KS_UNEMP, date(2020, 1, 1), wage_base=self.KS_UNEMP_MAX_WAGE) self._test_er_suta('KS', self.KS_UNEMP, date(2020, 1, 1), wage_base=self.KS_UNEMP_MAX_WAGE)
self._test_sit(625, 'married', 2, 0, 'semi-monthly', date(2020, 1, 1), 4.00) self._test_sit(6250, 'married', 2, 0, 'semi-monthly', date(2020, 1, 1), 290.00)
# self._test_sit(1500, 'single', 0, 0, 'bi-weekly', date(2020, 1, 1), 69.90) self._test_sit(5000, 'single', 1, 0, 'monthly', date(2020, 1, 1), 222.00)
# self._test_sit(1500, 'single', 0, 0, 'bi-weekly', date(2020, 1, 1), 79.90) self._test_sit(1500, 'married', 0, 0, 'bi-weekly', date(2020, 1, 1), 39.00)
self._test_sit(750, 'single', 2, 10, 'weekly', date(2020, 1, 1), 36.00)

View File

@@ -127,7 +127,7 @@
</group> </group>
<group name="state_ks_kansas" string="KS Kansas" attrs="{'invisible':[('state_id', '!=', %(base.state_us_17)s)]}"> <group name="state_ks_kansas" string="KS Kansas" attrs="{'invisible':[('state_id', '!=', %(base.state_us_17)s)]}">
<p colspan="2"><h3>Form KS K-4 - State Income Tax</h3></p> <p colspan="2"><h3>Form KS K-4 - State Income Tax</h3></p>
<field name="ks_k4_sit_filing_status" string="Filing Status 3."/> <field name="ks_k4_sit_filing_status" string="Allowance Rate 3."/>
<field name="ks_k4_sit_allowances" string="Allowances 4."/> <field name="ks_k4_sit_allowances" string="Allowances 4."/>
<field name="state_income_tax_additional_withholding" string="Additional Withholding 5."/> <field name="state_income_tax_additional_withholding" string="Additional Withholding 5."/>
<field name="state_income_tax_exempt" string="Exempt 6."/> <field name="state_income_tax_exempt" string="Exempt 6."/>