mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
Merge branch 'mig/12.0/l10n_us_hr_payroll__2020' into '12.0-test'
mig/12.0/l10n_us_hr_payroll__2020 into 12.0-test See merge request hibou-io/hibou-odoo/suite!275
This commit is contained in:
@@ -20,25 +20,89 @@
|
||||
<field name="parent_id" ref="hr_payroll.DED"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Tax Exempt Benefits/Wage -->
|
||||
<!-- IRS Publication 15-B Lists several categories of benefits, limits and classifications -->
|
||||
<!-- If your rule is intended to add to gross wages or be pre-gross, use the ALW_ Categories -->
|
||||
<record id="hr_payroll_category_alw_fit_exempt" model="hr.salary.rule.category">
|
||||
<field name="name">Wage: US FIT Exempt</field>
|
||||
<field name="code">ALW_FIT_EXEMPT</field>
|
||||
<field name="parent_id" ref="hr_payroll.ALW"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll_category_alw_fit_fica_exempt" model="hr.salary.rule.category">
|
||||
<field name="name">Wage: US FIT & FICA Exempt</field>
|
||||
<field name="code">ALW_FIT_FICA_EXEMPT</field>
|
||||
<field name="parent_id" ref="hr_payroll.ALW"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll_category_alw_fit_futa_exempt" model="hr.salary.rule.category">
|
||||
<field name="name">Wage: US FIT & FUTA Exempt</field>
|
||||
<field name="code">ALW_FIT_FUTA_EXEMPT</field>
|
||||
<field name="parent_id" ref="hr_payroll.ALW"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll_category_alw_fit_fica_futa_exempt" model="hr.salary.rule.category">
|
||||
<field name="name">Wage: US FIT & FICA & FUTA Exempt</field>
|
||||
<field name="code">ALW_FIT_FICA_FUTA_EXEMPT</field>
|
||||
<field name="parent_id" ref="hr_payroll.ALW"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll_category_alw_fica_exempt" model="hr.salary.rule.category">
|
||||
<field name="name">Wage: US FICA Exempt</field>
|
||||
<field name="code">ALW_FICA_EXEMPT</field>
|
||||
<field name="parent_id" ref="hr_payroll.ALW"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll_category_alw_fica_futa_exempt" model="hr.salary.rule.category">
|
||||
<field name="name">Wage: US FICA & FUTA Exempt</field>
|
||||
<field name="code">ALW_FICA_FUTA_EXEMPT</field>
|
||||
<field name="parent_id" ref="hr_payroll.ALW"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll_category_alw_futa_exempt" model="hr.salary.rule.category">
|
||||
<field name="name">Wage: US FUTA Exempt</field>
|
||||
<field name="code">ALW_FUTA_EXEMPT</field>
|
||||
<field name="parent_id" ref="hr_payroll.ALW"/>
|
||||
</record>
|
||||
|
||||
<!-- Tax Exempt Deductions -->
|
||||
|
||||
<!-- Deductions that reduce the wage for Federal Income Tax (e.g. 401k) -->
|
||||
<!-- If your rule is intended to withhold from gross, use the DED_ Categories -->
|
||||
<record id="hr_payroll_category_ded_fit_exempt" model="hr.salary.rule.category">
|
||||
<field name="name">Deduction: US Federal Income Tax Exempt</field>
|
||||
<field name="name">Deduction: US FIT Exempt</field>
|
||||
<field name="code">DED_FIT_EXEMPT</field>
|
||||
<field name="parent_id" ref="hr_payroll.DED"/>
|
||||
</record>
|
||||
|
||||
<!-- Generally speaking, deductions to FICA and FUTA should probably reduce GROSS itself, there may be special or rare cases -->
|
||||
<!-- Deductions that reduce the wage for FICA -->
|
||||
|
||||
<record id="hr_payroll_category_ded_fit_fica_exempt" model="hr.salary.rule.category">
|
||||
<field name="name">Deduction: US FIT & FICA Exempt</field>
|
||||
<field name="code">DED_FIT_FICA_EXEMPT</field>
|
||||
<field name="parent_id" ref="hr_payroll.DED"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll_category_ded_fit_futa_exempt" model="hr.salary.rule.category">
|
||||
<field name="name">Deduction: US FIT & FUTA Exempt</field>
|
||||
<field name="code">DED_FIT_FUTA_EXEMPT</field>
|
||||
<field name="parent_id" ref="hr_payroll.DED"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll_category_ded_fit_fica_futa_exempt" model="hr.salary.rule.category">
|
||||
<field name="name">Deduction: US FIT & FICA & FUTA Exempt</field>
|
||||
<field name="code">DED_FIT_FICA_FUTA_EXEMPT</field>
|
||||
<field name="parent_id" ref="hr_payroll.DED"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll_category_ded_fica_exempt" model="hr.salary.rule.category">
|
||||
<field name="name">Deduction: US FICA Exempt</field>
|
||||
<field name="code">DED_FICA_EXEMPT</field>
|
||||
<field name="parent_id" ref="hr_payroll.DED"/>
|
||||
</record>
|
||||
|
||||
<!-- Deductions that reduce the wage for Unemployment Insurance/Tax -->
|
||||
|
||||
<record id="hr_payroll_category_ded_fica_futa_exempt" model="hr.salary.rule.category">
|
||||
<field name="name">Deduction: US FICA & FUTA Exempt</field>
|
||||
<field name="code">DED_FICA_FUTA_EXEMPT</field>
|
||||
<field name="parent_id" ref="hr_payroll.DED"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll_category_ded_futa_exempt" model="hr.salary.rule.category">
|
||||
<field name="name">Deduction: US FUTA Exempt</field>
|
||||
<field name="code">DED_FUTA_EXEMPT</field>
|
||||
|
||||
@@ -1,9 +1,53 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
|
||||
def futa_wage(payslip, categories):
|
||||
"""
|
||||
Returns FUTA eligible wage for current Payslip (no wage_base, just by categories)
|
||||
WAGE = GROSS - ALW_FUTA_EXEMPT + DED_FUTA_EXEMPT
|
||||
:return: wage
|
||||
"""
|
||||
wage = categories.GROSS
|
||||
|
||||
wage -= categories.ALW_FUTA_EXEMPT + \
|
||||
categories.ALW_FIT_FUTA_EXEMPT + \
|
||||
categories.ALW_FIT_FICA_FUTA_EXEMPT + \
|
||||
categories.ALW_FICA_FUTA_EXEMPT
|
||||
|
||||
wage += categories.DED_FUTA_EXEMPT + \
|
||||
categories.DED_FIT_FUTA_EXEMPT + \
|
||||
categories.DED_FIT_FICA_FUTA_EXEMPT + \
|
||||
categories.DED_FICA_FUTA_EXEMPT
|
||||
|
||||
return wage
|
||||
|
||||
|
||||
def futa_wage_ytd(payslip, categories):
|
||||
"""
|
||||
Returns Year to Date FUTA eligible wages
|
||||
WAGE = GROSS - ALW_FUTA_EXEMPT + DED_FUTA_EXEMPT
|
||||
:return: wage
|
||||
"""
|
||||
year = payslip.dict.get_year()
|
||||
ytd_wage = payslip.sum_category('GROSS', str(year) + '-01-01', str(year+1) + '-01-01')
|
||||
|
||||
ytd_wage -= payslip.sum_category('ALW_FUTA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01') + \
|
||||
payslip.sum_category('ALW_FIT_FUTA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01') + \
|
||||
payslip.sum_category('ALW_FIT_FICA_FUTA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01') + \
|
||||
payslip.sum_category('ALW_FICA_FUTA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01')
|
||||
|
||||
ytd_wage += payslip.sum_category('DED_FUTA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01') + \
|
||||
payslip.sum_category('DED_FIT_FUTA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01') + \
|
||||
payslip.sum_category('DED_FIT_FICA_FUTA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01') + \
|
||||
payslip.sum_category('DED_FICA_FUTA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01')
|
||||
|
||||
ytd_wage += payslip.dict.contract_id.external_wages
|
||||
return ytd_wage
|
||||
|
||||
|
||||
def er_us_940_futa(payslip, categories, worked_days, inputs):
|
||||
"""
|
||||
Returns FUTA eligible wage and rate.
|
||||
WAGE = GROSS + DED_FUTA_EXEMPT
|
||||
:return: result, result_rate (wage, percent)
|
||||
"""
|
||||
|
||||
@@ -17,16 +61,14 @@ def er_us_940_futa(payslip, categories, worked_days, inputs):
|
||||
result_rate = -payslip.dict.rule_parameter('fed_940_futa_rate_normal')
|
||||
|
||||
# Determine Wage
|
||||
year = payslip.dict.get_year()
|
||||
ytd_wage = payslip.sum_category('GROSS', str(year) + '-01-01', str(year+1) + '-01-01')
|
||||
ytd_wage += payslip.sum_category('DED_FUTA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01')
|
||||
ytd_wage += payslip.dict.contract_id.external_wages
|
||||
wage = futa_wage(payslip, categories)
|
||||
if not wage:
|
||||
return 0.0, 0.0
|
||||
|
||||
ytd_wage = futa_wage_ytd(payslip, categories)
|
||||
wage_base = payslip.dict.rule_parameter('fed_940_futa_wage_base')
|
||||
remaining = wage_base - ytd_wage
|
||||
|
||||
wage = categories.GROSS + categories.DED_FUTA_EXEMPT
|
||||
|
||||
if remaining < 0.0:
|
||||
result = 0.0
|
||||
elif remaining < wage:
|
||||
|
||||
@@ -4,10 +4,53 @@
|
||||
# _logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def fica_wage(payslip, categories):
|
||||
"""
|
||||
Returns FICA eligible wage for current Payslip (no wage_base, just by categories)
|
||||
WAGE = GROSS - ALW_FICA_EXEMPT + DED_FICA_EXEMPT
|
||||
:return: wage
|
||||
"""
|
||||
wage = categories.GROSS
|
||||
|
||||
wage -= categories.ALW_FICA_EXEMPT + \
|
||||
categories.ALW_FIT_FICA_EXEMPT + \
|
||||
categories.ALW_FIT_FICA_FUTA_EXEMPT + \
|
||||
categories.ALW_FICA_FUTA_EXEMPT
|
||||
|
||||
wage += categories.DED_FICA_EXEMPT + \
|
||||
categories.DED_FIT_FICA_EXEMPT + \
|
||||
categories.DED_FIT_FICA_FUTA_EXEMPT + \
|
||||
categories.DED_FICA_FUTA_EXEMPT
|
||||
|
||||
return wage
|
||||
|
||||
|
||||
def fica_wage_ytd(payslip, categories):
|
||||
"""
|
||||
Returns Year to Date FICA eligible wages
|
||||
WAGE = GROSS - ALW_FICA_EXEMPT + DED_FICA_EXEMPT
|
||||
:return: wage
|
||||
"""
|
||||
year = payslip.dict.get_year()
|
||||
ytd_wage = payslip.sum_category('GROSS', str(year) + '-01-01', str(year+1) + '-01-01')
|
||||
|
||||
ytd_wage -= payslip.sum_category('ALW_FICA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01') + \
|
||||
payslip.sum_category('ALW_FIT_FICA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01') + \
|
||||
payslip.sum_category('ALW_FIT_FICA_FUTA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01') + \
|
||||
payslip.sum_category('ALW_FICA_FUTA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01')
|
||||
|
||||
ytd_wage += payslip.sum_category('DED_FICA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01') + \
|
||||
payslip.sum_category('DED_FIT_FICA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01') + \
|
||||
payslip.sum_category('DED_FIT_FICA_FUTA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01') + \
|
||||
payslip.sum_category('DED_FICA_FUTA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01')
|
||||
|
||||
ytd_wage += payslip.dict.contract_id.external_wages
|
||||
return ytd_wage
|
||||
|
||||
|
||||
def ee_us_941_fica_ss(payslip, categories, worked_days, inputs):
|
||||
"""
|
||||
Returns FICA Social Security eligible wage and rate.
|
||||
WAGE = GROSS + DED_FICA_EXEMPT
|
||||
:return: result, result_rate (wage, percent)
|
||||
"""
|
||||
exempt = payslip.dict.contract_id.us_payroll_config_value('fed_941_fica_exempt')
|
||||
@@ -18,16 +61,14 @@ def ee_us_941_fica_ss(payslip, categories, worked_days, inputs):
|
||||
result_rate = -payslip.dict.rule_parameter('fed_941_fica_ss_rate')
|
||||
|
||||
# Determine Wage
|
||||
year = payslip.dict.get_year()
|
||||
ytd_wage = payslip.sum_category('GROSS', str(year) + '-01-01', str(year+1) + '-01-01')
|
||||
ytd_wage += payslip.sum_category('DED_FICA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01')
|
||||
ytd_wage += payslip.dict.contract_id.external_wages
|
||||
wage = fica_wage(payslip, categories)
|
||||
if not wage:
|
||||
return 0.0, 0.0
|
||||
|
||||
ytd_wage = fica_wage_ytd(payslip, categories)
|
||||
wage_base = payslip.dict.rule_parameter('fed_941_fica_ss_wage_base')
|
||||
remaining = wage_base - ytd_wage
|
||||
|
||||
wage = categories.GROSS + categories.DED_FICA_EXEMPT
|
||||
|
||||
if remaining < 0.0:
|
||||
result = 0.0
|
||||
elif remaining < wage:
|
||||
@@ -44,7 +85,6 @@ er_us_941_fica_ss = ee_us_941_fica_ss
|
||||
def ee_us_941_fica_m(payslip, categories, worked_days, inputs):
|
||||
"""
|
||||
Returns FICA Medicare eligible wage and rate.
|
||||
WAGE = GROSS + DED_FICA_EXEMPT
|
||||
:return: result, result_rate (wage, percent)
|
||||
"""
|
||||
exempt = payslip.dict.contract_id.us_payroll_config_value('fed_941_fica_exempt')
|
||||
@@ -55,16 +95,14 @@ def ee_us_941_fica_m(payslip, categories, worked_days, inputs):
|
||||
result_rate = -payslip.dict.rule_parameter('fed_941_fica_m_rate')
|
||||
|
||||
# Determine Wage
|
||||
year = payslip.dict.get_year()
|
||||
ytd_wage = payslip.sum_category('GROSS', str(year) + '-01-01', str(year+1) + '-01-01')
|
||||
ytd_wage += payslip.sum_category('DED_FICA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01')
|
||||
ytd_wage += payslip.dict.contract_id.external_wages
|
||||
wage = fica_wage(payslip, categories)
|
||||
if not wage:
|
||||
return 0.0, 0.0
|
||||
|
||||
ytd_wage = fica_wage_ytd(payslip, categories)
|
||||
wage_base = float(payslip.dict.rule_parameter('fed_941_fica_m_wage_base')) # inf
|
||||
remaining = wage_base - ytd_wage
|
||||
|
||||
wage = categories.GROSS + categories.DED_FICA_EXEMPT
|
||||
|
||||
if remaining < 0.0:
|
||||
result = 0.0
|
||||
elif remaining < wage:
|
||||
@@ -81,8 +119,6 @@ er_us_941_fica_m = ee_us_941_fica_m
|
||||
def ee_us_941_fica_m_add(payslip, categories, worked_days, inputs):
|
||||
"""
|
||||
Returns FICA Medicare Additional eligible wage and rate.
|
||||
Note that this wage is not capped like the above rules.
|
||||
WAGE = GROSS - WAGE_FICA_EXEMPT
|
||||
:return: result, result_rate (wage, percent)
|
||||
"""
|
||||
exempt = payslip.dict.contract_id.us_payroll_config_value('fed_941_fica_exempt')
|
||||
@@ -93,16 +129,14 @@ def ee_us_941_fica_m_add(payslip, categories, worked_days, inputs):
|
||||
result_rate = -payslip.dict.rule_parameter('fed_941_fica_m_add_rate')
|
||||
|
||||
# Determine Wage
|
||||
year = payslip.dict.get_year()
|
||||
ytd_wage = payslip.sum_category('GROSS', str(year) + '-01-01', str(year+1) + '-01-01')
|
||||
ytd_wage += payslip.sum_category('DED_FICA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01')
|
||||
ytd_wage += payslip.dict.contract_id.external_wages
|
||||
wage = fica_wage(payslip, categories)
|
||||
if not wage:
|
||||
return 0.0, 0.0
|
||||
|
||||
ytd_wage = fica_wage_ytd(payslip, categories)
|
||||
wage_start = payslip.dict.rule_parameter('fed_941_fica_m_add_wage_start')
|
||||
existing_wage = ytd_wage - wage_start
|
||||
|
||||
wage = categories.GROSS + categories.DED_FICA_EXEMPT
|
||||
|
||||
if existing_wage >= 0.0:
|
||||
result = wage
|
||||
elif wage + existing_wage > 0.0:
|
||||
@@ -113,11 +147,54 @@ def ee_us_941_fica_m_add(payslip, categories, worked_days, inputs):
|
||||
return result, result_rate
|
||||
|
||||
|
||||
def fit_wage(payslip, categories):
|
||||
"""
|
||||
Returns FIT eligible wage for current Payslip (no wage_base, just by categories)
|
||||
WAGE = GROSS - ALW_FIT_EXEMPT + DED_FIT_EXEMPT
|
||||
:return: wage
|
||||
"""
|
||||
wage = categories.GROSS
|
||||
|
||||
wage -= categories.ALW_FIT_EXEMPT + \
|
||||
categories.ALW_FIT_FICA_EXEMPT + \
|
||||
categories.ALW_FIT_FICA_FUTA_EXEMPT + \
|
||||
categories.ALW_FIT_FUTA_EXEMPT
|
||||
|
||||
wage += categories.DED_FIT_EXEMPT + \
|
||||
categories.DED_FIT_FICA_EXEMPT + \
|
||||
categories.DED_FIT_FICA_FUTA_EXEMPT + \
|
||||
categories.DED_FIT_FUTA_EXEMPT
|
||||
|
||||
return wage
|
||||
|
||||
|
||||
def fit_wage_ytd(payslip, categories):
|
||||
"""
|
||||
Returns Year to Date FIT eligible wages
|
||||
WAGE = GROSS - ALW_FIT_EXEMPT + DED_FIT_EXEMPT
|
||||
:return: wage
|
||||
"""
|
||||
year = payslip.dict.get_year()
|
||||
ytd_wage = payslip.sum_category('GROSS', str(year) + '-01-01', str(year+1) + '-01-01')
|
||||
|
||||
ytd_wage -= payslip.sum_category('ALW_FIT_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01') + \
|
||||
payslip.sum_category('ALW_FIT_FICA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01') + \
|
||||
payslip.sum_category('ALW_FIT_FICA_FUTA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01') + \
|
||||
payslip.sum_category('ALW_FIT_FUTA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01')
|
||||
|
||||
ytd_wage += payslip.sum_category('DED_FIT_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01') + \
|
||||
payslip.sum_category('DED_FIT_FICA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01') + \
|
||||
payslip.sum_category('DED_FIT_FICA_FUTA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01') + \
|
||||
payslip.sum_category('DED_FIT_FUTA_EXEMPT', str(year) + '-01-01', str(year+1) + '-01-01')
|
||||
|
||||
ytd_wage += payslip.dict.contract_id.external_wages
|
||||
return ytd_wage
|
||||
|
||||
|
||||
# Federal Income Tax
|
||||
def ee_us_941_fit(payslip, categories, worked_days, inputs):
|
||||
"""
|
||||
Returns Wage and rate that is computed given the amount to withhold.
|
||||
WAGE = GROSS + DED_FIT_EXEMPT
|
||||
:return: result, result_rate (wage, percent)
|
||||
"""
|
||||
filing_status = payslip.dict.contract_id.us_payroll_config_value('fed_941_fit_w4_filing_status')
|
||||
@@ -125,7 +202,8 @@ def ee_us_941_fit(payslip, categories, worked_days, inputs):
|
||||
return 0.0, 0.0
|
||||
|
||||
schedule_pay = payslip.dict.contract_id.schedule_pay
|
||||
wage = categories.GROSS + categories.DED_FIT_EXEMPT
|
||||
wage = fit_wage(payslip, categories)
|
||||
|
||||
#_logger.warn('initial gross wage: ' + str(wage))
|
||||
year = payslip.dict.get_year()
|
||||
if year >= 2020:
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from .general import _state_applies
|
||||
from .general import _state_applies, sit_wage
|
||||
|
||||
|
||||
def ga_georgia_state_income_withholding(payslip, categories, worked_days, inputs):
|
||||
"""
|
||||
Returns SIT eligible wage and rate.
|
||||
WAGE = GROSS + DED_FIT_EXEMPT
|
||||
|
||||
:return: result, result_rate (wage, percent)
|
||||
"""
|
||||
@@ -18,7 +17,10 @@ def ga_georgia_state_income_withholding(payslip, categories, worked_days, inputs
|
||||
return 0.0, 0.0
|
||||
|
||||
# Determine Wage
|
||||
wage = categories.GROSS + categories.DED_FIT_EXEMPT
|
||||
wage = sit_wage(payslip, categories)
|
||||
if not wage:
|
||||
return 0.0, 0.0
|
||||
|
||||
schedule_pay = payslip.dict.contract_id.schedule_pay
|
||||
additional = payslip.dict.contract_id.us_payroll_config_value('state_income_tax_additional_withholding')
|
||||
dependent_allowances = payslip.dict.contract_id.us_payroll_config_value('ga_g4_sit_dependent_allowances')
|
||||
@@ -27,10 +29,7 @@ def ga_georgia_state_income_withholding(payslip, categories, worked_days, inputs
|
||||
personal_allowance = payslip.dict.rule_parameter('us_ga_sit_personal_allowance').get(ga_filing_status, {}).get(schedule_pay)
|
||||
deduction = payslip.dict.rule_parameter('us_ga_sit_deduction').get(ga_filing_status, {}).get(schedule_pay)
|
||||
withholding_rate = payslip.dict.rule_parameter('us_ga_sit_rate').get(ga_filing_status, {}).get(schedule_pay)
|
||||
if not all((dependent_allowance_rate, personal_allowance, deduction, withholding_rate)) or wage == 0.0:
|
||||
return 0.0, 0.0
|
||||
|
||||
if wage == 0.0:
|
||||
if not all((dependent_allowance_rate, personal_allowance, deduction, withholding_rate)):
|
||||
return 0.0, 0.0
|
||||
|
||||
after_standard_deduction = wage - deduction
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
from odoo.exceptions import UserError
|
||||
from ..federal.fed_940 import futa_wage, futa_wage_ytd
|
||||
from ..federal.fed_941 import fit_wage, fit_wage_ytd
|
||||
|
||||
# import logging
|
||||
# _logger = logging.getLogger(__name__)
|
||||
|
||||
suta_wage = futa_wage
|
||||
suta_wage_ytd = futa_wage_ytd
|
||||
sit_wage = fit_wage
|
||||
sit_wage_ytd = fit_wage_ytd
|
||||
|
||||
|
||||
def _state_applies(payslip, state_code):
|
||||
return state_code == payslip.dict.contract_id.us_payroll_config_value('state_code')
|
||||
@@ -89,12 +96,12 @@ def general_state_unemployment(payslip, categories, worked_days, inputs, wage_ba
|
||||
return 0.0, 0.0
|
||||
|
||||
# Determine Wage
|
||||
year = payslip.dict.get_year()
|
||||
ytd_wage = payslip.sum_category('GROSS', str(year) + '-01-01', str(year + 1) + '-01-01')
|
||||
ytd_wage += payslip.sum_category('DED_FUTA_EXEMPT', str(year) + '-01-01', str(year + 1) + '-01-01')
|
||||
ytd_wage += payslip.dict.contract_id.external_wages
|
||||
wage = suta_wage(payslip, categories)
|
||||
if not wage:
|
||||
return 0.0, 0.0
|
||||
|
||||
ytd_wage = suta_wage_ytd(payslip, categories)
|
||||
|
||||
wage = categories.GROSS + categories.DED_FUTA_EXEMPT
|
||||
return _general_rate(payslip, wage, ytd_wage, wage_base=wage_base, wage_start=wage_start, rate=rate)
|
||||
|
||||
|
||||
@@ -112,12 +119,8 @@ def general_state_income_withholding(payslip, categories, worked_days, inputs, w
|
||||
return 0.0, 0.0
|
||||
|
||||
# Determine Wage
|
||||
year = payslip.dict.get_year()
|
||||
ytd_wage = payslip.sum_category('GROSS', str(year) + '-01-01', str(year + 1) + '-01-01')
|
||||
ytd_wage += payslip.sum_category('DED_FIT_EXEMPT', str(year) + '-01-01', str(year + 1) + '-01-01')
|
||||
ytd_wage += payslip.dict.contract_id.external_wages
|
||||
|
||||
wage = categories.GROSS + categories.DED_FIT_EXEMPT
|
||||
ytd_wage = sit_wage_ytd(payslip, categories)
|
||||
wage = sit_wage(payslip, categories)
|
||||
result, result_rate = _general_rate(payslip, wage, ytd_wage, wage_base=wage_base, wage_start=wage_start, rate=rate)
|
||||
additional = payslip.dict.contract_id.us_payroll_config_value('state_income_tax_additional_withholding')
|
||||
if additional:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from .general import _state_applies
|
||||
from .general import _state_applies, sit_wage
|
||||
|
||||
|
||||
def mi_michigan_state_income_withholding(payslip, categories, worked_days, inputs):
|
||||
@@ -18,15 +18,15 @@ def mi_michigan_state_income_withholding(payslip, categories, worked_days, input
|
||||
return 0.0, 0.0
|
||||
|
||||
# Determine Wage
|
||||
wage = categories.GROSS + categories.DED_FIT_EXEMPT
|
||||
wage = sit_wage(payslip, categories)
|
||||
if not wage:
|
||||
return 0.0, 0.0
|
||||
|
||||
pay_periods = payslip.dict.get_pay_periods_in_year()
|
||||
additional = payslip.dict.contract_id.us_payroll_config_value('state_income_tax_additional_withholding')
|
||||
exemption_rate = payslip.dict.rule_parameter('us_mi_sit_exemption_rate')
|
||||
exemption = payslip.dict.contract_id.us_payroll_config_value('mi_w4_sit_exemptions')
|
||||
|
||||
if wage == 0.0:
|
||||
return 0.0, 0.0
|
||||
|
||||
annual_exemption = (exemption * exemption_rate) / pay_periods
|
||||
withholding = ((wage - annual_exemption) * 0.0425)
|
||||
if withholding < 0.0:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from .general import _state_applies
|
||||
from .general import _state_applies, sit_wage
|
||||
|
||||
|
||||
def mn_minnesota_state_income_withholding(payslip, categories, worked_days, inputs):
|
||||
@@ -19,14 +19,15 @@ def mn_minnesota_state_income_withholding(payslip, categories, worked_days, inpu
|
||||
return 0.0, 0.0
|
||||
|
||||
# Determine Wage
|
||||
wage = categories.GROSS + categories.DED_FIT_EXEMPT
|
||||
wage = sit_wage(payslip, categories)
|
||||
if not wage:
|
||||
return 0.0, 0.0
|
||||
|
||||
pay_periods = payslip.dict.get_pay_periods_in_year()
|
||||
additional = payslip.dict.contract_id.us_payroll_config_value('state_income_tax_additional_withholding')
|
||||
sit_tax_rate = payslip.dict.rule_parameter('us_mn_sit_tax_rate')[filing_status]
|
||||
allowances_rate = payslip.dict.rule_parameter('us_mn_sit_allowances_rate')
|
||||
allowances = payslip.dict.contract_id.us_payroll_config_value('mn_w4mn_sit_allowances')
|
||||
if wage == 0.0:
|
||||
return 0.0, 0.0
|
||||
|
||||
taxable_income = (wage * pay_periods) - (allowances * allowances_rate)
|
||||
withholding = 0.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from .general import _state_applies
|
||||
from .general import _state_applies, sit_wage
|
||||
|
||||
|
||||
def mo_missouri_state_income_withholding(payslip, categories, worked_days, inputs):
|
||||
@@ -19,8 +19,11 @@ def mo_missouri_state_income_withholding(payslip, categories, worked_days, input
|
||||
return 0.0, 0.0
|
||||
|
||||
# Determine Wage
|
||||
wage = categories.GROSS + categories.DED_FIT_EXEMPT
|
||||
reduced_withholding = payslip.dict.contract_id.us_payroll_config_value('mo_mow4_sit_withholding')
|
||||
wage = sit_wage(payslip, categories)
|
||||
if not wage:
|
||||
return 0.0, 0.0
|
||||
|
||||
reduced_withholding = payslip.contract_id.us_payroll_config_value('mo_mow4_sit_withholding')
|
||||
if reduced_withholding:
|
||||
return wage, -((reduced_withholding / wage) * 100.0)
|
||||
|
||||
@@ -28,8 +31,6 @@ def mo_missouri_state_income_withholding(payslip, categories, worked_days, input
|
||||
additional = payslip.dict.contract_id.us_payroll_config_value('state_income_tax_additional_withholding')
|
||||
sit_table = payslip.dict.rule_parameter('us_mo_sit_rate')
|
||||
deduction = payslip.dict.rule_parameter('us_mo_sit_deduction')[filing_status]
|
||||
if wage == 0.0:
|
||||
return 0.0, 0.0
|
||||
|
||||
gross_taxable_income = wage * pay_periods
|
||||
gross_taxable_income -= deduction
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from .general import _state_applies
|
||||
from .general import _state_applies, sit_wage
|
||||
|
||||
|
||||
def ms_mississippi_state_income_withholding(payslip, categories, worked_days, inputs):
|
||||
@@ -19,8 +19,8 @@ def ms_mississippi_state_income_withholding(payslip, categories, worked_days, in
|
||||
return 0.0, 0.0
|
||||
|
||||
# Determine Wage
|
||||
wage = categories.GROSS + categories.DED_FIT_EXEMPT
|
||||
if wage == 0.0:
|
||||
wage = sit_wage(payslip, categories)
|
||||
if not wage:
|
||||
return 0.0, 0.0
|
||||
|
||||
pay_periods = payslip.dict.get_pay_periods_in_year()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from .general import _state_applies
|
||||
from .general import _state_applies, sit_wage
|
||||
|
||||
|
||||
def mt_montana_state_income_withholding(payslip, categories, worked_days, inputs):
|
||||
@@ -18,13 +18,16 @@ def mt_montana_state_income_withholding(payslip, categories, worked_days, inputs
|
||||
return 0.0, 0.0
|
||||
|
||||
# Determine Wage
|
||||
wage = categories.GROSS + categories.DED_FIT_EXEMPT
|
||||
wage = sit_wage(payslip, categories)
|
||||
if not wage:
|
||||
return 0.0, 0.0
|
||||
|
||||
schedule_pay = payslip.dict.contract_id.schedule_pay
|
||||
additional = payslip.dict.contract_id.us_payroll_config_value('state_income_tax_additional_withholding')
|
||||
exemptions = payslip.dict.contract_id.us_payroll_config_value('mt_mw4_sit_exemptions')
|
||||
exemption_rate = payslip.dict.rule_parameter('us_mt_sit_exemption_rate').get(schedule_pay)
|
||||
withholding_rate = payslip.dict.rule_parameter('us_mt_sit_rate').get(schedule_pay)
|
||||
if not exemption_rate or not withholding_rate or wage == 0.0:
|
||||
if not exemption_rate or not withholding_rate:
|
||||
return 0.0, 0.0
|
||||
|
||||
adjusted_wage = wage - (exemption_rate * (exemptions or 0))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from .general import _state_applies
|
||||
from .general import _state_applies, sit_wage
|
||||
|
||||
|
||||
def nc_northcarolina_state_income_withholding(payslip, categories, worked_days, inputs):
|
||||
@@ -19,15 +19,16 @@ def nc_northcarolina_state_income_withholding(payslip, categories, worked_days,
|
||||
return 0.0, 0.0
|
||||
|
||||
# Determine Wage
|
||||
wage = categories.GROSS + categories.DED_FIT_EXEMPT
|
||||
wage = sit_wage(payslip, categories)
|
||||
if not wage:
|
||||
return 0.0, 0.0
|
||||
|
||||
schedule_pay = payslip.dict.contract_id.schedule_pay
|
||||
additional = payslip.dict.contract_id.us_payroll_config_value('state_income_tax_additional_withholding')
|
||||
allowances = payslip.dict.contract_id.us_payroll_config_value('nc_nc4_sit_allowances')
|
||||
allowances_rate = payslip.dict.rule_parameter('us_nc_sit_allowance_rate').get(schedule_pay)['allowance']
|
||||
deduction = payslip.dict.rule_parameter('us_nc_sit_allowance_rate').get(schedule_pay)['standard_deduction'] if filing_status != 'head_household' else payslip.dict.rule_parameter('us_nc_sit_allowance_rate').get(schedule_pay)['standard_deduction_hh']
|
||||
|
||||
if wage == 0.0:
|
||||
return 0.0, 0.0
|
||||
taxable_wage = round((wage - (deduction + (allowances * allowances_rate))) * 0.0535)
|
||||
withholding = 0.0
|
||||
if taxable_wage < 0.0:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from .general import _state_applies
|
||||
from .general import _state_applies, sit_wage
|
||||
|
||||
|
||||
def nj_newjersey_state_income_withholding(payslip, categories, worked_days, inputs):
|
||||
@@ -19,7 +19,9 @@ def nj_newjersey_state_income_withholding(payslip, categories, worked_days, inpu
|
||||
return 0.0, 0.0
|
||||
|
||||
# Determine Wage
|
||||
wage = categories.GROSS + categories.DED_FIT_EXEMPT
|
||||
wage = sit_wage(payslip, categories)
|
||||
if not wage:
|
||||
return 0.0, 0.0
|
||||
|
||||
allowances = payslip.dict.contract_id.us_payroll_config_value('nj_njw4_sit_allowances')
|
||||
sit_rate_table_key = payslip.dict.contract_id.us_payroll_config_value('nj_njw4_sit_rate_table')
|
||||
@@ -34,9 +36,6 @@ def nj_newjersey_state_income_withholding(payslip, categories, worked_days, inpu
|
||||
if not allowances:
|
||||
return 0.0, 0.0
|
||||
|
||||
if wage == 0.0:
|
||||
return 0.0, 0.0
|
||||
|
||||
gross_taxable_income = wage - (allowance_value * allowances)
|
||||
withholding = 0.0
|
||||
prior_wage_base = 0.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from .general import _state_applies
|
||||
from .general import _state_applies, sit_wage
|
||||
|
||||
|
||||
def oh_ohio_state_income_withholding(payslip, categories, worked_days, inputs):
|
||||
@@ -18,15 +18,16 @@ def oh_ohio_state_income_withholding(payslip, categories, worked_days, inputs):
|
||||
return 0.0, 0.0
|
||||
|
||||
# Determine Wage
|
||||
wage = categories.GROSS + categories.DED_FIT_EXEMPT
|
||||
wage = sit_wage(payslip, categories)
|
||||
if not wage:
|
||||
return 0.0, 0.0
|
||||
|
||||
pay_periods = payslip.dict.get_pay_periods_in_year()
|
||||
additional = payslip.dict.contract_id.us_payroll_config_value('state_income_tax_additional_withholding')
|
||||
exemptions = payslip.dict.contract_id.us_payroll_config_value('oh_it4_sit_exemptions')
|
||||
exemption_rate = payslip.dict.rule_parameter('us_oh_sit_exemption_rate')
|
||||
withholding_rate = payslip.dict.rule_parameter('us_oh_sit_rate')
|
||||
multiplier_rate = payslip.dict.rule_parameter('us_oh_sit_multiplier')
|
||||
if wage == 0.0:
|
||||
return 0.0, 0.0
|
||||
|
||||
taxable_wage = (wage * pay_periods) - (exemption_rate * (exemptions or 0))
|
||||
withholding = 0.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from .general import _state_applies
|
||||
from .general import _state_applies, sit_wage
|
||||
|
||||
|
||||
def va_virginia_state_income_withholding(payslip, categories, worked_days, inputs):
|
||||
@@ -18,7 +18,10 @@ def va_virginia_state_income_withholding(payslip, categories, worked_days, input
|
||||
return 0.0, 0.0
|
||||
|
||||
# Determine Wage
|
||||
wage = categories.GROSS + categories.DED_FIT_EXEMPT
|
||||
wage = sit_wage(payslip, categories)
|
||||
if not wage:
|
||||
return 0.0, 0.0
|
||||
|
||||
pay_periods = payslip.dict.get_pay_periods_in_year()
|
||||
additional = payslip.dict.contract_id.us_payroll_config_value('state_income_tax_additional_withholding')
|
||||
personal_exemptions = payslip.dict.contract_id.us_payroll_config_value('va_va4_sit_exemptions')
|
||||
@@ -27,8 +30,6 @@ def va_virginia_state_income_withholding(payslip, categories, worked_days, input
|
||||
other_exemption_rate = payslip.dict.rule_parameter('us_va_sit_other_exemption_rate')
|
||||
deduction = payslip.dict.rule_parameter('us_va_sit_deduction')
|
||||
withholding_rate = payslip.dict.rule_parameter('us_va_sit_rate')
|
||||
if wage == 0.0:
|
||||
return 0.0, 0.0
|
||||
|
||||
taxable_wage = (wage * pay_periods) - (deduction + (personal_exemptions * personal_exemption_rate) + (other_exemptions * other_exemption_rate))
|
||||
withholding = 0.0
|
||||
|
||||
Reference in New Issue
Block a user