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 Vermont 13.0
This commit is contained in:
@@ -62,6 +62,7 @@ United States of America - Payroll Rules.
|
||||
'data/state/pa_pennsylvania.xml',
|
||||
'data/state/sc_south_carolina.xml',
|
||||
'data/state/tx_texas.xml',
|
||||
'data/state/vt_vermont.xml',
|
||||
'data/state/va_virginia.xml',
|
||||
'data/state/wa_washington.xml',
|
||||
'data/state/wy_wyoming.xml',
|
||||
|
||||
121
l10n_us_hr_payroll/data/state/vt_vermont.xml
Normal file
121
l10n_us_hr_payroll/data/state/vt_vermont.xml
Normal file
@@ -0,0 +1,121 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<!-- Wage Base -->
|
||||
<record id="rule_parameter_us_vt_suta_wage_base" model="hr.rule.parameter">
|
||||
<field name="name">US VT Vermont SUTA Wage Base</field>
|
||||
<field name="code">us_vt_suta_wage_base</field>
|
||||
<field name="country_id" ref="base.us"/>
|
||||
</record>
|
||||
<data noupdate="1">
|
||||
<record id="rule_parameter_us_vt_suta_wage_base_2020" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">16000.0</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_vt_suta_wage_base"/>
|
||||
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
<!-- Rate -->
|
||||
<record id="rule_parameter_us_vt_suta_rate" model="hr.rule.parameter">
|
||||
<field name="name">US VT Vermont SUTA Rate</field>
|
||||
<field name="code">us_vt_suta_rate</field>
|
||||
<field name="country_id" ref="base.us"/>
|
||||
</record>
|
||||
<data noupdate="1">
|
||||
<record id="rule_parameter_us_vt_suta_rate_2020" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">1.0</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_vt_suta_rate"/>
|
||||
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
<record id="rule_parameter_us_vt_sit_allowances_rate" model="hr.rule.parameter">
|
||||
<field name="name">US VT Vermont Allowances Rate</field>
|
||||
<field name="code">us_vt_sit_allowances_rate</field>
|
||||
<field name="country_id" ref="base.us"/>
|
||||
</record>
|
||||
<data noupdate="1">
|
||||
<record id="rule_parameter_us_vt_sit_allowances_rate_2020" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">{
|
||||
'weekly' : 83.65,
|
||||
'bi-weekly' : 167.31,
|
||||
'semi-monthly': 181.25,
|
||||
'monthly' : 362.50,
|
||||
'quarterly' : 1087.50,
|
||||
'annually': 4350.00,
|
||||
}</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_vt_sit_allowances_rate"/>
|
||||
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
<record id="rule_parameter_us_vt_sit_tax_rate" model="hr.rule.parameter">
|
||||
<field name="name">US VT Vermont SIT Tax Rate</field>
|
||||
<field name="code">us_vt_sit_tax_rate</field>
|
||||
<field name="country_id" ref="base.us"/>
|
||||
</record>
|
||||
<data noupdate="1">
|
||||
<record id="rule_parameter_us_vt_sit_tax_rate_2020" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">{
|
||||
'single': {
|
||||
'weekly': ((60, 0.00, 0.00), (836, 0.00, 3.35), (1941, 26.00, 6.60), (3983, 98.93, 7.60), ('inf', 254.12, 8.75)),
|
||||
'bi-weekly': ((120, 0.00, 0.00), (1672, 0.00, 3.35), (3882, 51.99, 6.60), (7966, 197.85, 7.60), ('inf', 508.24, 8.75)),
|
||||
'semi-monthly': ((130, 0.00, 0.00), (1811, 0.00, 3.35), (4205, 56.31, 6.60), (8630, 214.32, 7.60), ('inf', 550.62, 8.75)),
|
||||
'monthly': ((260, 0.00, 0.00), (3623, 0.00, 3.35), (8410, 112.66, 6.60), (17260, 428.60, 7.60), ('inf', 1101.20, 8.75)),
|
||||
'quarterly': ((781, 0.00, 0.00), (10869, 0.00, 3.35), (25231, 337.95, 6.60), (51781, 1285.84, 7.60), ('inf', 3303.64, 8.75)),
|
||||
'annually': ((3125, 0.00, 0.00), (43475, 0.00, 3.35), (100925, 1351.73, 6.60), (207125, 5143.43, 7.60), ('inf', 13214.63, 8.75)),
|
||||
},
|
||||
'married': {
|
||||
'weekly': ((180, 0.00, 0.00), (1477, 0.00, 3.35), (3315, 43.45, 6.60), (4956, 164.76, 7.60), ('inf', 289.47, 8.75)),
|
||||
'bi-weekly': ((361, 0.00, 0.00), (2955, 0.00, 3.35), (6630, 86.90, 6.60), (9913, 329.45, 7.60), ('inf', 578.96, 8.75)),
|
||||
'semi-monthly': ((391, 0.00, 0.00), (3201, 0.00, 3.35), (7182, 94.14, 6.60), (10739, 356.88, 7.60), ('inf', 627.21, 8.75)),
|
||||
'monthly': ((781, 0.00, 0.00), (6402, 0.00, 3.35), (14365, 188.30, 6.60), (21477, 713.86, 7.60), ('inf', 1254.37, 8.75)),
|
||||
'quarterly': ((2344, 0.00, 0.00), (19206, 0.00, 3.35), (43094, 564.88, 6.60), (64431, 2141.49, 7.60), ('inf', 3763.10, 8.75)),
|
||||
'annually': ((9375, 0.00, 0.00), (76825, 0.00, 3.35), (172375, 2259.58, 6.60), (257725, 8565.88, 7.60), ('inf', 15052.48, 8.75)),
|
||||
},
|
||||
}</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_vt_sit_tax_rate"/>
|
||||
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
<!-- Partners and Contribution Registers -->
|
||||
<record id="res_partner_us_vt_dor" model="res.partner">
|
||||
<field name="name">US Vermont - Employment Security Commission - Unemployment Tax</field>
|
||||
</record>
|
||||
|
||||
<record id="res_partner_us_vt_dor_sit" model="res.partner">
|
||||
<field name="name">US Vermont - Tax Commission - Income Tax</field>
|
||||
</record>
|
||||
|
||||
<!-- Categories -->
|
||||
|
||||
<!-- Rules -->
|
||||
<record id="hr_payroll_rule_er_us_vt_suta" model="hr.salary.rule">
|
||||
<field name="sequence" eval="450"/>
|
||||
<field name="struct_id" ref="hr_payroll_structure"/>
|
||||
<field name="category_id" ref="hr_payroll_category_er_us_suta"/>
|
||||
<field name="name">ER: US VT Vermont State Unemployment</field>
|
||||
<field name="code">ER_US_VT_SUTA</field>
|
||||
<field name="condition_select">python</field>
|
||||
<field name="condition_python">result, _ = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_vt_suta_wage_base', rate='us_vt_suta_rate', state_code='VT')</field>
|
||||
<field name="amount_select">code</field>
|
||||
<field name="amount_python_compute">result, result_rate = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_vt_suta_wage_base', rate='us_vt_suta_rate', state_code='VT')</field>
|
||||
<field name="partner_id" ref="res_partner_us_vt_dor"/>
|
||||
<field name="appears_on_payslip" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll_rule_ee_us_vt_sit" model="hr.salary.rule">
|
||||
<field name="sequence" eval="195"/>
|
||||
<field name="struct_id" ref="hr_payroll_structure"/>
|
||||
<field name="category_id" ref="hr_payroll_category_ee_us_sit"/>
|
||||
<field name="name">EE: US VT Vermont State Income Tax Withholding</field>
|
||||
<field name="code">EE_US_VT_SIT</field>
|
||||
<field name="condition_select">python</field>
|
||||
<field name="condition_python">result, _ = vt_vermont_state_income_withholding(payslip, categories, worked_days, inputs)</field>
|
||||
<field name="amount_select">code</field>
|
||||
<field name="amount_python_compute">result, result_rate = vt_vermont_state_income_withholding(payslip, categories, worked_days, inputs)</field>
|
||||
<field name="partner_id" ref="res_partner_us_vt_dor_sit"/>
|
||||
<field name="appears_on_payslip" eval="True"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -43,6 +43,7 @@ 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.vt_vermont import vt_vermont_state_income_withholding
|
||||
from .state.va_virginia import va_virginia_state_income_withholding
|
||||
from .state.wa_washington import wa_washington_fml_er, \
|
||||
wa_washington_fml_ee
|
||||
@@ -108,6 +109,7 @@ class HRPayslip(models.Model):
|
||||
'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,
|
||||
'vt_vermont_state_income_withholding': vt_vermont_state_income_withholding,
|
||||
'va_virginia_state_income_withholding': va_virginia_state_income_withholding,
|
||||
'wa_washington_fml_er': wa_washington_fml_er,
|
||||
'wa_washington_fml_ee': wa_washington_fml_ee,
|
||||
|
||||
46
l10n_us_hr_payroll/models/state/vt_vermont.py
Normal file
46
l10n_us_hr_payroll/models/state/vt_vermont.py
Normal file
@@ -0,0 +1,46 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from .general import _state_applies, sit_wage
|
||||
|
||||
|
||||
def vt_vermont_state_income_withholding(payslip, categories, worked_days, inputs):
|
||||
"""
|
||||
Returns SIT eligible wage and rate.
|
||||
|
||||
:return: result, result_rate (wage, percent)
|
||||
"""
|
||||
state_code = 'VT'
|
||||
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('vt_w4vt_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('vt_w4vt_sit_allowances')
|
||||
allowance_amt = payslip.rule_parameter('us_vt_sit_allowances_rate')[schedule_pay]
|
||||
tax_table = payslip.rule_parameter('us_vt_sit_tax_rate')[filing_status].get(schedule_pay)
|
||||
|
||||
taxable_income = wage - (allowances * allowance_amt)
|
||||
withholding = 0.0
|
||||
last = 0.0
|
||||
for row in tax_table:
|
||||
amt, flat_fee, rate = row
|
||||
if wage <= float(amt):
|
||||
withholding = ((taxable_income - last) * (rate / 100)) + flat_fee
|
||||
break
|
||||
last = amt
|
||||
|
||||
withholding = max(withholding, 0.0)
|
||||
withholding += additional
|
||||
return wage, -((withholding / wage) * 100.0)
|
||||
@@ -244,6 +244,13 @@ class HRContractUSPayrollConfig(models.Model):
|
||||
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.')
|
||||
|
||||
vt_w4vt_sit_filing_status = fields.Selection([
|
||||
('single', 'Single'),
|
||||
('married', 'Married'),
|
||||
('head_household', 'Head of Household')
|
||||
], string='Vermont VT W-4VT Filing Status', help='VT W-4VT')
|
||||
vt_w4vt_sit_allowances = fields.Integer(string='Vermont VT W-4VT Allowances', help='VT W-4VT 1.')
|
||||
|
||||
va_va4_sit_exemptions = fields.Integer(string='Virginia VA-4(P) Personal Exemptions',
|
||||
help='VA-4(P) 1(a)')
|
||||
va_va4_sit_other_exemptions = fields.Integer(string='Virginia VA-4(P) Age & Blindness Exemptions',
|
||||
|
||||
@@ -103,6 +103,8 @@ from . import test_us_sc_south_carolina_payslip_2020
|
||||
from . import test_us_tx_texas_payslip_2019
|
||||
from . import test_us_tx_texas_payslip_2020
|
||||
|
||||
from . import test_us_vt_vermont_payslip_2020
|
||||
|
||||
from . import test_us_va_virginia_payslip_2019
|
||||
from . import test_us_va_virginia_payslip_2020
|
||||
|
||||
|
||||
37
l10n_us_hr_payroll/tests/test_us_vt_vermont_payslip_2020.py
Executable file
37
l10n_us_hr_payroll/tests/test_us_vt_vermont_payslip_2020.py
Executable file
@@ -0,0 +1,37 @@
|
||||
# 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 TestUsVTPayslip(TestUsPayslip):
|
||||
###
|
||||
# 2020 Taxes and Rates
|
||||
###
|
||||
VT_UNEMP_MAX_WAGE = 16000.0
|
||||
VT_UNEMP = 1.0
|
||||
# Calculation based on example https://tax.vermont.gov/sites/tax/files/documents/WithholdingInstructions.pdf
|
||||
|
||||
def _test_sit(self, wage, filing_status, allowances, additional_withholding, exempt, schedule_pay, date_start, expected_withholding):
|
||||
employee = self._createEmployee()
|
||||
contract = self._createContract(employee,
|
||||
wage=wage,
|
||||
state_id=self.get_us_state('VT'),
|
||||
vt_w4vt_sit_filing_status=filing_status,
|
||||
vt_w4vt_sit_allowances=allowances,
|
||||
state_income_tax_additional_withholding=additional_withholding,
|
||||
state_income_tax_exempt=exempt,
|
||||
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.assertPayrollEqual(cats.get('EE_US_SIT', 0.0), -expected_withholding)
|
||||
|
||||
def test_2020_taxes_example(self):
|
||||
self._test_er_suta('VT', self.VT_UNEMP, date(2020, 1, 1), wage_base=self.VT_UNEMP_MAX_WAGE)
|
||||
self._test_sit(1800, 'married', 2, 0, False, 'weekly', date(2020, 1, 1), 53.73)
|
||||
self._test_sit(1800, 'married', 2, 10, False, 'weekly', date(2020, 1, 1), 63.73)
|
||||
self._test_sit(1000, 'single', 1, 0, True, 'weekly', date(2020, 1, 1), 0.00)
|
||||
self._test_sit(8000, 'single', 1, 10, False, 'bi-weekly', date(2020, 1, 1), 506.58)
|
||||
@@ -245,6 +245,13 @@
|
||||
<group name="state_tx_texas" string="TX Texas" attrs="{'invisible':[('state_id', '!=', %(base.state_us_44)s)]}">
|
||||
<p colspan="2"><h3>No additional fields.</h3></p>
|
||||
</group>
|
||||
<group name="state_vt_vermont" string="VT Vermont" attrs="{'invisible':[('state_id', '!=', %(base.state_us_46)s)]}">
|
||||
<p colspan="2"><h3>Form VT W-4VT - State Income Tax</h3></p>
|
||||
<field name="vt_w4vt_sit_filing_status" string="Filing Status"/>
|
||||
<field name="vt_w4vt_sit_allowances" string="Allowances 1."/>
|
||||
<field name="state_income_tax_additional_withholding" string="Additional Withholding 6."/>
|
||||
<field name="state_income_tax_exempt" string="Exempt"/>
|
||||
</group>
|
||||
<group name="state_va_virginia" string="VA Virginia" attrs="{'invisible':[('state_id', '!=', %(base.state_us_47)s)]}">
|
||||
<p colspan="2"><h3>Form VA-4/VA-4P - State Income Tax</h3></p>
|
||||
<field name="va_va4_sit_exemptions" string="Personal Exemptions (Line 1(a))"/>
|
||||
|
||||
Reference in New Issue
Block a user