Wage: US-MI Unemployment
WAGE_US_MI_UNEMP
python
result = (contract.futa_type != contract.FUTA_TYPE_BASIC)
code
rate = payslip.dict.get_rate('US_MI_UNEMP')
year = payslip.dict.date_to.year
ytd = payslip.sum('WAGE_US_MI_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-MI Unemployment
ER_US_MI_UNEMP
python
result = (contract.futa_type != contract.FUTA_TYPE_BASIC)
code
rate = payslip.dict.get_rate('US_MI_UNEMP')
result_rate = -rate.rate
result = categories.WAGE_US_MI_UNEMP
# result_rate of 0 implies 100% due to bug
if result_rate == 0.0:
result = 0.0
EE: US-MI Income Tax Withholding
EE_US_MI_INC_WITHHOLD
python
result = not contract.mi_w4_tax_exempt
code
wages = categories.GROSS
allowances = contract.mi_w4_exemptions
schedule_pay = contract.schedule_pay
annual_exemption_amount = 4400.00 * allowances
allowance_amount = 0.0
pay_period = 0.0
pay_periods = {
'weekly': 52.0,
'bi-weekly': 26.0,
'semi-monthly': 24.0,
'monthly': 12.0
}
if schedule_pay in pay_periods:
pay_period = pay_periods[schedule_pay]
else:
raise Exception('Invalid schedule_pay="' + schedule_pay + '" for MI Income Withholding calculation')
allowance_amount = (annual_exemption_amount / pay_period)
withholding = ((wages - allowance_amount) * 0.04250) + contract.mi_w4_additional_wh
result = - withholding