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: For Oklahoma 13.0
This commit is contained in:
@@ -41,6 +41,7 @@ from .state.nj_newjersey import nj_newjersey_state_income_withholding
|
||||
from .state.nm_new_mexico import nm_new_mexico_state_income_withholding
|
||||
from .state.ny_new_york import ny_new_york_state_income_withholding
|
||||
from .state.oh_ohio import oh_ohio_state_income_withholding
|
||||
from .state.ok_oklahoma import ok_oklahoma_state_income_withholding
|
||||
from .state.sc_south_carolina import sc_south_carolina_state_income_withholding
|
||||
from .state.va_virginia import va_virginia_state_income_withholding
|
||||
from .state.wa_washington import wa_washington_fml_er, \
|
||||
@@ -105,6 +106,7 @@ class HRPayslip(models.Model):
|
||||
'nm_new_mexico_state_income_withholding': nm_new_mexico_state_income_withholding,
|
||||
'ny_new_york_state_income_withholding': ny_new_york_state_income_withholding,
|
||||
'oh_ohio_state_income_withholding': oh_ohio_state_income_withholding,
|
||||
'ok_oklahoma_state_income_withholding': ok_oklahoma_state_income_withholding,
|
||||
'sc_south_carolina_state_income_withholding': sc_south_carolina_state_income_withholding,
|
||||
'va_virginia_state_income_withholding': va_virginia_state_income_withholding,
|
||||
'wa_washington_fml_er': wa_washington_fml_er,
|
||||
|
||||
47
l10n_us_hr_payroll/models/state/ok_oklahoma.py
Normal file
47
l10n_us_hr_payroll/models/state/ok_oklahoma.py
Normal file
@@ -0,0 +1,47 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from .general import _state_applies, sit_wage
|
||||
|
||||
|
||||
def ok_oklahoma_state_income_withholding(payslip, categories, worked_days, inputs):
|
||||
"""
|
||||
Returns SIT eligible wage and rate.
|
||||
|
||||
:return: result, result_rate (wage, percent)
|
||||
"""
|
||||
state_code = 'OK'
|
||||
if not _state_applies(payslip, state_code):
|
||||
return 0.0, 0.0
|
||||
|
||||
# Determine Wage
|
||||
wage = sit_wage(payslip, categories)
|
||||
if not wage:
|
||||
return 0.0, 0.0
|
||||
|
||||
if payslip.contract_id.us_payroll_config_value('state_income_tax_exempt'):
|
||||
return 0.0, 0.0
|
||||
|
||||
filing_status = payslip.contract_id.us_payroll_config_value('ok_w4_sit_filing_status')
|
||||
if not filing_status:
|
||||
return 0.0, 0.0
|
||||
|
||||
schedule_pay = payslip.contract_id.schedule_pay
|
||||
additional = payslip.contract_id.us_payroll_config_value('state_income_tax_additional_withholding')
|
||||
allowances = payslip.contract_id.us_payroll_config_value('ok_w4_sit_allowances')
|
||||
allowances_amt = payslip.rule_parameter('us_ok_sit_allowances_rate')[schedule_pay]
|
||||
tax_table = payslip.rule_parameter('us_ok_sit_tax_rate')[filing_status].get(schedule_pay)
|
||||
|
||||
taxable_income = wage - (allowances * allowances_amt)
|
||||
withholding = 0.0
|
||||
last = 0.0
|
||||
for row in tax_table:
|
||||
amt, rate, flat_fee = row
|
||||
if wage <= float(amt):
|
||||
withholding = ((taxable_income - last) * (rate / 100)) + flat_fee
|
||||
break
|
||||
last = amt
|
||||
|
||||
withholding = max(withholding, 0.0)
|
||||
withholding += additional
|
||||
withholding = round(withholding)
|
||||
return wage, -((withholding / wage) * 100.0)
|
||||
@@ -235,6 +235,13 @@ class HRContractUSPayrollConfig(models.Model):
|
||||
# Ohio will use generic SIT exempt and additional fields
|
||||
oh_it4_sit_exemptions = fields.Integer(string='Ohio IT-4 Exemptions',
|
||||
help='Line 4')
|
||||
|
||||
ok_w4_sit_filing_status = fields.Selection([
|
||||
('single', 'Single'),
|
||||
('married', 'Married'),
|
||||
('head_household', 'Head of Household')
|
||||
], string='Oklahoma OK-W-4 Filing Status', help='OK-W-4')
|
||||
ok_w4_sit_allowances = fields.Integer(string='Oklahoma OK-W-4 Allowances', help='OK-W-4 1.2.3.')
|
||||
sc_w4_sit_allowances = fields.Integer(string='South Carolina SC W-4 Allowances', help='SC W-4 5.')
|
||||
|
||||
va_va4_sit_exemptions = fields.Integer(string='Virginia VA-4(P) Personal Exemptions',
|
||||
|
||||
Reference in New Issue
Block a user