Wage: US-SC Unemployment
WAGE_US_SC_UNEMP
python
result = (contract.futa_type != contract.FUTA_TYPE_BASIC)
code
rate = payslip.dict.get_rate('US_SC_UNEMP')
year = int(payslip.dict.date_to[:4])
ytd = payslip.sum('WAGE_US_SC_UNEMP', str(year) + '-01-01', str(year+1) + '-01-01')
ytd += contract.external_wages
remaining = rate.wage_limit_year - ytd
if remaining <= 0.0:
result = 0
elif remaining < categories.BASIC:
result = remaining
else:
result = categories.BASIC
ER: US-SC Unemployment
ER_US_SC_UNEMP
python
result = (contract.futa_type != contract.FUTA_TYPE_BASIC)
code
rate = payslip.dict.get_rate('US_SC_UNEMP')
result_rate = -rate.rate
result = categories.WAGE_US_SC_UNEMP
# result_rate of 0 implies 100% due to bug
if result_rate == 0.0:
result = 0.0
EE: US-SC Income Tax Withholding
EE_US_SC_INC_WITHHOLD
python
result = True
code
wages = categories.GROSS # Must make sure sequence is after the GROSS sequence.
# Step 1 - Convert wages to annual amount
pay_period = 0.0
pay_periods = {
'weekly': 52.0,
'bi-weekly': 26.0,
'semi-monthly': 24.0,
'monthly': 12.0
}
schedule_pay = contract.schedule_pay
pay_period = pay_periods[schedule_pay]
annual_wages = wages * pay_period
# Step 2 - Deduct the personal exemption amount and standard deduction from the annual wages.
sc_exemption_amount = 2510.00
personal_exemption_amt = contract.w4_allowances * sc_exemption_amount
standard_deduction = 0.00
if contract.w4_allowances > 0:
if (annual_wages * .1) > 3470.00:
standard_deduction = 3470.00
else:
standard_deduction = (10.0 / 100.0) * annual_wages
taxable_income = annual_wages - personal_exemption_amt - standard_deduction
# Step 3 - Use the balance (taxable_income) in the tables listed on the state pdf:
# https://dor.sc.gov/forms-site/Forms/WH1603F_2019.pdf
# to calculate the tax.
tax_table = [
(2450, 1.1, 0.0),
(4900, 3.0, 26.95),
(7350, 4.0, 100.45),
(9800, 5.0, 198.45),
(12250, 6.0, 320.95),
(float('inf'), 7.0, 467.95)
]
last = 0.0
for cap, rate, flat_amt in tax_table:
if cap > taxable_income:
result = ((taxable_income - last) * (rate / 100.0)) + flat_amt
break
last = cap
# Step 4 - Divide the result by the number of pay periods to get withholding amount per pay period
result = (result / pay_period)
result = -result