mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[IMP] l10n_us_hr_payroll: Added additional withholding, changed suta rate for 2020 and Improved test for SC South Carolina 2020.
This commit is contained in:
@@ -31,8 +31,9 @@
|
|||||||
<field name="rule_parameter_id" ref="rule_parameter_us_sc_suta_rate"/>
|
<field name="rule_parameter_id" ref="rule_parameter_us_sc_suta_rate"/>
|
||||||
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
|
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
|
||||||
</record>
|
</record>
|
||||||
|
<!-- Tax rate from https://taxnews.ey.com/news/2019-2183-south-carolina-2020-sui-tax-rates-to-decrease-due-to-elimination-of-the-variable-solvency-surcharge-wage-base-unchanged -->
|
||||||
<record id="rule_parameter_us_sc_suta_rate_2020" model="hr.rule.parameter.value">
|
<record id="rule_parameter_us_sc_suta_rate_2020" model="hr.rule.parameter.value">
|
||||||
<field name="parameter_value">1.09</field>
|
<field name="parameter_value">0.55</field>
|
||||||
<field name="rule_parameter_id" ref="rule_parameter_us_sc_suta_rate"/>
|
<field name="rule_parameter_id" ref="rule_parameter_us_sc_suta_rate"/>
|
||||||
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||||
</record>
|
</record>
|
||||||
@@ -56,6 +57,7 @@
|
|||||||
<field name="rule_parameter_id" ref="rule_parameter_us_sc_sit_tax_rate"/>
|
<field name="rule_parameter_id" ref="rule_parameter_us_sc_sit_tax_rate"/>
|
||||||
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
|
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
|
||||||
</record>
|
</record>
|
||||||
|
<!-- Substraction Method table from https://dor.sc.gov/forms-site/Forms/WH1603F_2020.pdf-->
|
||||||
<record id="rule_parameter_us_sc_sit_tax_rate_2020" model="hr.rule.parameter.value">
|
<record id="rule_parameter_us_sc_sit_tax_rate_2020" model="hr.rule.parameter.value">
|
||||||
<field name="parameter_value">[
|
<field name="parameter_value">[
|
||||||
( 2620, 0.8, 0.0),
|
( 2620, 0.8, 0.0),
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ def sc_south_carolina_state_income_withholding(payslip, categories, worked_days,
|
|||||||
return 0.0, 0.0
|
return 0.0, 0.0
|
||||||
|
|
||||||
pay_periods = payslip.dict.get_pay_periods_in_year()
|
pay_periods = payslip.dict.get_pay_periods_in_year()
|
||||||
|
additional = payslip.contract_id.us_payroll_config_value('state_income_tax_additional_withholding')
|
||||||
allowances = payslip.contract_id.us_payroll_config_value('sc_w4_sit_allowances')
|
allowances = payslip.contract_id.us_payroll_config_value('sc_w4_sit_allowances')
|
||||||
tax_rate = payslip.rule_parameter('us_sc_sit_tax_rate')
|
tax_rate = payslip.rule_parameter('us_sc_sit_tax_rate')
|
||||||
personal_exemption = payslip.rule_parameter('us_sc_sit_personal_exemption_rate')
|
personal_exemption = payslip.rule_parameter('us_sc_sit_personal_exemption_rate')
|
||||||
@@ -45,4 +46,5 @@ def sc_south_carolina_state_income_withholding(payslip, categories, worked_days,
|
|||||||
withholding = (taxable_income * (rate / 100.0) - flat_amt)
|
withholding = (taxable_income * (rate / 100.0) - flat_amt)
|
||||||
break
|
break
|
||||||
withholding /= pay_periods
|
withholding /= pay_periods
|
||||||
|
withholding += additional
|
||||||
return wage, -((withholding / wage) * 100.0)
|
return wage, -((withholding / wage) * 100.0)
|
||||||
|
|||||||
@@ -9,14 +9,15 @@ class TestUsSCPayslip(TestUsPayslip):
|
|||||||
# 2020 Taxes and Rates
|
# 2020 Taxes and Rates
|
||||||
###
|
###
|
||||||
SC_UNEMP_MAX_WAGE = 14000.0
|
SC_UNEMP_MAX_WAGE = 14000.0
|
||||||
SC_UNEMP = 1.09
|
SC_UNEMP = 0.55
|
||||||
# Calculation based on https://dor.sc.gov/forms-site/Forms/WH1603F_2020.pdf
|
# Calculation based on https://dor.sc.gov/forms-site/Forms/WH1603F_2020.pdf
|
||||||
|
|
||||||
def _test_sit(self, wage, exempt, allowances, schedule_pay, date_start, expected_withholding):
|
def _test_sit(self, wage, additional_withholding, exempt, allowances, schedule_pay, date_start, expected_withholding):
|
||||||
employee = self._createEmployee()
|
employee = self._createEmployee()
|
||||||
contract = self._createContract(employee,
|
contract = self._createContract(employee,
|
||||||
wage=wage,
|
wage=wage,
|
||||||
state_id=self.get_us_state('SC'),
|
state_id=self.get_us_state('SC'),
|
||||||
|
state_income_tax_additional_withholding=additional_withholding,
|
||||||
state_income_tax_exempt=exempt,
|
state_income_tax_exempt=exempt,
|
||||||
sc_w4_sit_allowances=allowances,
|
sc_w4_sit_allowances=allowances,
|
||||||
schedule_pay=schedule_pay)
|
schedule_pay=schedule_pay)
|
||||||
@@ -25,10 +26,11 @@ class TestUsSCPayslip(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('SC', self.SC_UNEMP, date(2020, 1, 1), wage_base=self.SC_UNEMP_MAX_WAGE)
|
self._test_er_suta('SC', self.SC_UNEMP, date(2020, 1, 1), wage_base=self.SC_UNEMP_MAX_WAGE)
|
||||||
self._test_sit(750.0, False, 3.0, 'weekly', date(2020, 1, 1), 28.73)
|
self._test_sit(750.0, 0.0, False, 3.0, 'weekly', date(2020, 1, 1), 28.73)
|
||||||
self._test_sit(800.0, True, 0.0, 'weekly', date(2020, 1, 1), 0.00)
|
self._test_sit(800.0, 0.0, True, 0.0, 'weekly', date(2020, 1, 1), 0.00)
|
||||||
self._test_sit(9000.0, False, 0.0, 'monthly', date(2020, 1, 1), 594.61)
|
self._test_sit(9000.0, 0.0, False, 0.0, 'monthly', date(2020, 1, 1), 594.61)
|
||||||
|
self._test_sit(5000.0, 10.0, False, 2.0, 'semi-monthly', date(2020, 1, 1), 316.06)
|
||||||
|
|||||||
@@ -247,6 +247,7 @@
|
|||||||
<group name="state_sc_south_carolina" string="SC South Carolina" attrs="{'invisible':[('state_id', '!=', %(base.state_us_41)s)]}">
|
<group name="state_sc_south_carolina" string="SC South Carolina" attrs="{'invisible':[('state_id', '!=', %(base.state_us_41)s)]}">
|
||||||
<p colspan="2"><h3>Form SC W-4 - State Income Tax</h3></p>
|
<p colspan="2"><h3>Form SC W-4 - State Income Tax</h3></p>
|
||||||
<field name="sc_w4_sit_allowances" string="Allowances 5."/>
|
<field name="sc_w4_sit_allowances" string="Allowances 5."/>
|
||||||
|
<field name="state_income_tax_additional_withholding" string="Additional Withholding 6."/>
|
||||||
<field name="state_income_tax_exempt" string="Exempt 7."/>
|
<field name="state_income_tax_exempt" string="Exempt 7."/>
|
||||||
</group>
|
</group>
|
||||||
<group name="state_sd_south_dakota" string="SD South Dakota" attrs="{'invisible':[('state_id', '!=', %(base.state_us_42)s)]}">
|
<group name="state_sd_south_dakota" string="SD South Dakota" attrs="{'invisible':[('state_id', '!=', %(base.state_us_42)s)]}">
|
||||||
|
|||||||
Reference in New Issue
Block a user