mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
SC South Carolina
This commit is contained in:
@@ -7,11 +7,7 @@
|
||||
<field name="country_id" ref="base.us"/>
|
||||
</record>
|
||||
<data noupdate="1">
|
||||
<record id="rule_parameter_us_sc_suta_wage_base_2019" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">14000.0</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_sc_suta_wage_base"/>
|
||||
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
|
||||
</record>
|
||||
<!-- Unchanged in 2021 https://dew.sc.gov/employers/unemployment-insurance-tax-programs/tax-rate -->
|
||||
<record id="rule_parameter_us_sc_suta_wage_base_2020" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">14000.0</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_sc_suta_wage_base"/>
|
||||
@@ -26,12 +22,8 @@
|
||||
<field name="country_id" ref="base.us"/>
|
||||
</record>
|
||||
<data noupdate="1">
|
||||
<record id="rule_parameter_us_sc_suta_rate_2019" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">1.09</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_sc_suta_rate"/>
|
||||
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
|
||||
</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 -->
|
||||
<!-- Unchanged in 2021 https://dew.sc.gov/employers/unemployment-insurance-tax-programs/tax-rate -->
|
||||
<record id="rule_parameter_us_sc_suta_rate_2020" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">0.55</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_sc_suta_rate"/>
|
||||
@@ -70,6 +62,19 @@
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_sc_sit_tax_rate"/>
|
||||
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||
</record>
|
||||
<!-- Substraction Method table from https://dor.sc.gov/forms-site/Forms/WH1603F_2021.pdf -->
|
||||
<record id="rule_parameter_us_sc_sit_tax_rate_2021" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">[
|
||||
( 2800, 0.5, 0.0),
|
||||
( 5610, 3.0, 70.00),
|
||||
( 8410, 4.0, 126.10),
|
||||
(11220, 5.0, 210.20),
|
||||
(14030, 6.0, 322.40),
|
||||
('inf', 7.0, 462.70),
|
||||
]</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_sc_sit_tax_rate"/>
|
||||
<field name="date_from" eval="datetime(2021, 1, 1).date()"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
<record id="rule_parameter_us_sc_sit_personal_exemption_rate" model="hr.rule.parameter">
|
||||
@@ -78,16 +83,17 @@
|
||||
<field name="country_id" ref="base.us"/>
|
||||
</record>
|
||||
<data noupdate="1">
|
||||
<record id="rule_parameter_us_sc_sit_personal_exemption_rate_2019" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">2510</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_sc_sit_personal_exemption_rate"/>
|
||||
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
|
||||
</record>
|
||||
<record id="rule_parameter_us_sc_sit_personal_exemption_rate_2020" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">2590</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_sc_sit_personal_exemption_rate"/>
|
||||
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||
</record>
|
||||
<!-- https://dor.sc.gov/forms-site/Forms/WH1603F_2021.pdf -->
|
||||
<record id="rule_parameter_us_sc_sit_personal_exemption_rate_2021" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">2670</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_sc_sit_personal_exemption_rate"/>
|
||||
<field name="date_from" eval="datetime(2021, 1, 1).date()"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
<record id="rule_parameter_us_sc_sit_standard_deduction_rate" model="hr.rule.parameter">
|
||||
@@ -96,16 +102,16 @@
|
||||
<field name="country_id" ref="base.us"/>
|
||||
</record>
|
||||
<data noupdate="1">
|
||||
<record id="rule_parameter_us_sc_sit_standard_deduction_rate_2019" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">3470.0</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_sc_sit_standard_deduction_rate"/>
|
||||
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
|
||||
</record>
|
||||
<record id="rule_parameter_us_sc_sit_standard_deduction_rate_2020" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">3820.0</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_sc_sit_standard_deduction_rate"/>
|
||||
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||
</record>
|
||||
<record id="rule_parameter_us_sc_sit_standard_deduction_rate_2021" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">4200</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_sc_sit_standard_deduction_rate"/>
|
||||
<field name="date_from" eval="datetime(2021, 1, 1).date()"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
<!-- Partners and Contribution Registers -->
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from .common import TestUsPayslip, process_payslip
|
||||
|
||||
|
||||
class TestUsSCPayslip(TestUsPayslip):
|
||||
|
||||
# Taxes and Rates
|
||||
SC_UNEMP_MAX_WAGE = 14000.0
|
||||
US_SC_UNEMP = -1.09 / 100
|
||||
US_SC_exemption_amount = 2510.00
|
||||
|
||||
def test_2019_taxes_weekly(self):
|
||||
# We will hand calculate the amount to test for state withholding.
|
||||
schedule_pay = 'weekly'
|
||||
salary = 50000.00 # Employee is paid 50000 per week to be in top tax bracket
|
||||
allowances = 2
|
||||
# Calculate annual wages
|
||||
annual = 50000 * 52.0
|
||||
# From our annual we deduct personal exemption amounts.
|
||||
# We deduct 2510.00 per exemption. Since we have two exemptions:
|
||||
personal_exemption = self.US_SC_exemption_amount * allowances # 5020.0
|
||||
# From annual, we will also deduct a standard_deduction of 3470.00 or .1 of salary, which ever
|
||||
# is small -> if 1 or more exemptions, else 0
|
||||
standard_deduction = 3470.00
|
||||
taxable_income = annual - personal_exemption - standard_deduction # 2591510.0
|
||||
# We then calculate the amounts off the SC tax pdf tables.
|
||||
# 2591478.0 is in the highest bracket
|
||||
test_amt = (taxable_income * (7.0 / 100.0)) - 467.95
|
||||
test_amt = 180935.51
|
||||
# Make it per period then negative
|
||||
test_amt = (test_amt / 52.0) # Divided by 52 since it is weekly.
|
||||
# test_amt = 3479.52
|
||||
test_amt = -test_amt
|
||||
|
||||
employee = self._createEmployee()
|
||||
contract = self._createContract(employee,
|
||||
wage=salary,
|
||||
state_id=self.get_us_state('SC'),
|
||||
state_income_tax_exempt=False,
|
||||
sc_w4_sit_allowances=allowances,
|
||||
schedule_pay=schedule_pay)
|
||||
|
||||
self._log('2019 South Carolina tax first payslip:')
|
||||
payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31')
|
||||
payslip.compute_sheet()
|
||||
cats = self._getCategories(payslip)
|
||||
|
||||
self.assertPayrollAlmostEqual(cats['ER_US_SUTA'], self.SC_UNEMP_MAX_WAGE * self.US_SC_UNEMP)
|
||||
self.assertPayrollAlmostEqual(cats['EE_US_SIT'], test_amt)
|
||||
|
||||
process_payslip(payslip)
|
||||
|
||||
remaining_SC_UNEMP_wages = self.SC_UNEMP_MAX_WAGE - annual if (annual < self.SC_UNEMP_MAX_WAGE) \
|
||||
else 0.00
|
||||
|
||||
self._log('2019 South Carolina tax second payslip:')
|
||||
|
||||
payslip = self._createPayslip(employee, '2019-02-01', '2019-02-28')
|
||||
payslip.compute_sheet()
|
||||
cats = self._getCategories(payslip)
|
||||
|
||||
self.assertEqual(0.0, remaining_SC_UNEMP_wages)
|
||||
self.assertPayrollEqual(cats['ER_US_SUTA'], remaining_SC_UNEMP_wages * self.US_SC_UNEMP)
|
||||
|
||||
def test_2019_taxes_filing_status(self):
|
||||
salary = 20000.00 # Wages per pay period
|
||||
schedule_pay = 'monthly'
|
||||
annual = salary * 12
|
||||
allowances = 1
|
||||
# Hand Calculations
|
||||
personal_exemption = 2510.00
|
||||
standard_deduction = min(3470.00, .1 * annual) # 3470.0 but min is shown for the process
|
||||
taxable = annual - personal_exemption - standard_deduction
|
||||
# taxable = 234020
|
||||
test_amt = ((taxable) * (7.0 / 100.0)) - 467.95 # 15991.850000000002
|
||||
test_amt = test_amt / 12.0 # Put it into monthly -> 1332.654166666667
|
||||
# Make it negative
|
||||
test_amt = -test_amt
|
||||
|
||||
employee = self._createEmployee()
|
||||
contract = self._createContract(employee,
|
||||
wage=salary,
|
||||
state_id=self.get_us_state('SC'),
|
||||
state_income_tax_exempt=False,
|
||||
sc_w4_sit_allowances=allowances,
|
||||
schedule_pay=schedule_pay)
|
||||
|
||||
self._log('2019 South Carolina tax first payslip: ')
|
||||
payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31')
|
||||
payslip.compute_sheet()
|
||||
cats = self._getCategories(payslip)
|
||||
|
||||
self.assertPayrollEqual(cats['ER_US_SUTA'], self.SC_UNEMP_MAX_WAGE * self.US_SC_UNEMP)
|
||||
self.assertPayrollAlmostEqual(cats['EE_US_SIT'], test_amt)
|
||||
|
||||
process_payslip(payslip)
|
||||
@@ -6,11 +6,11 @@ from .common import TestUsPayslip
|
||||
|
||||
class TestUsSCPayslip(TestUsPayslip):
|
||||
###
|
||||
# 2020 Taxes and Rates
|
||||
# 2021 Taxes and Rates
|
||||
###
|
||||
SC_UNEMP_MAX_WAGE = 14000.0
|
||||
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_2021.pdf
|
||||
|
||||
def _test_sit(self, wage, additional_withholding, exempt, allowances, schedule_pay, date_start, expected_withholding):
|
||||
employee = self._createEmployee()
|
||||
@@ -28,9 +28,9 @@ class TestUsSCPayslip(TestUsPayslip):
|
||||
self._log('Computed period tax: ' + str(expected_withholding))
|
||||
self.assertPayrollAlmostEqual(cats.get('EE_US_SIT', 0.0), -expected_withholding)
|
||||
|
||||
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_sit(750.0, 0.0, False, 3.0, 'weekly', date(2020, 1, 1), 28.73)
|
||||
self._test_sit(800.0, 0.0, True, 0.0, 'weekly', date(2020, 1, 1), 0.00)
|
||||
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)
|
||||
def test_2021_taxes_example(self):
|
||||
self._test_er_suta('SC', self.SC_UNEMP, date(2021, 1, 1), wage_base=self.SC_UNEMP_MAX_WAGE)
|
||||
self._test_sit(750.0, 0.0, False, 3.0, 'weekly', date(2021, 1, 1), 28.73)
|
||||
self._test_sit(800.0, 0.0, True, 0.0, 'weekly', date(2021, 1, 1), 0.00)
|
||||
self._test_sit(9000.0, 0.0, False, 0.0, 'monthly', date(2021, 1, 1), 594.61)
|
||||
self._test_sit(5000.0, 10.0, False, 2.0, 'semi-monthly', date(2021, 1, 1), 316.06)
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from datetime import date, timedelta
|
||||
from .common import TestUsPayslip
|
||||
|
||||
|
||||
class TestUsSCPayslip(TestUsPayslip):
|
||||
###
|
||||
# 2021 Taxes and Rates
|
||||
###
|
||||
SC_UNEMP_MAX_WAGE = 14000.0
|
||||
SC_UNEMP = 0.55
|
||||
# Calculation based on https://dor.sc.gov/forms-site/Forms/WH1603F_2021.pdf
|
||||
|
||||
def _test_sit(self, wage, additional_withholding, exempt, allowances, schedule_pay, date_start, expected_withholding):
|
||||
employee = self._createEmployee()
|
||||
contract = self._createContract(employee,
|
||||
wage=wage,
|
||||
state_id=self.get_us_state('SC'),
|
||||
state_income_tax_additional_withholding=additional_withholding,
|
||||
state_income_tax_exempt=exempt,
|
||||
sc_w4_sit_allowances=allowances,
|
||||
schedule_pay=schedule_pay)
|
||||
payslip = self._createPayslip(employee, date_start, date_start + timedelta(days=7))
|
||||
payslip.compute_sheet()
|
||||
cats = self._getCategories(payslip)
|
||||
|
||||
self._log('Computed period tax: ' + str(expected_withholding))
|
||||
self.assertPayrollAlmostEqual(cats.get('EE_US_SIT', 0.0), -expected_withholding)
|
||||
|
||||
def test_2021_taxes_example(self):
|
||||
self._test_er_suta('SC', self.SC_UNEMP, date(2021, 1, 1), wage_base=self.SC_UNEMP_MAX_WAGE)
|
||||
self._test_sit(750.0, 0.0, False, 3.0, 'weekly', date(2021, 1, 1), 27.57)
|
||||
self._test_sit(800.0, 0.0, True, 0.0, 'weekly', date(2021, 1, 1), 0.00)
|
||||
self._test_sit(9000.0, 0.0, False, 0.0, 'monthly', date(2021, 1, 1), 591.44)
|
||||
self._test_sit(5000.0, 10.0, False, 2.0, 'semi-monthly', date(2021, 1, 1), 312.90)
|
||||
Reference in New Issue
Block a user