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 Nebraska 13.0
This commit is contained in:
@@ -47,6 +47,7 @@ United States of America - Payroll Rules.
|
|||||||
'data/state/ms_mississippi.xml',
|
'data/state/ms_mississippi.xml',
|
||||||
'data/state/mt_montana.xml',
|
'data/state/mt_montana.xml',
|
||||||
'data/state/nc_northcarolina.xml',
|
'data/state/nc_northcarolina.xml',
|
||||||
|
'data/state/ne_nebraska.xml',
|
||||||
'data/state/nh_new_hampshire.xml',
|
'data/state/nh_new_hampshire.xml',
|
||||||
'data/state/nj_newjersey.xml',
|
'data/state/nj_newjersey.xml',
|
||||||
'data/state/nm_new_mexico.xml',
|
'data/state/nm_new_mexico.xml',
|
||||||
|
|||||||
125
l10n_us_hr_payroll/data/state/ne_nebraska.xml
Normal file
125
l10n_us_hr_payroll/data/state/ne_nebraska.xml
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<odoo>
|
||||||
|
<!-- Wage Base -->
|
||||||
|
<record id="rule_parameter_us_ne_suta_wage_base" model="hr.rule.parameter">
|
||||||
|
<field name="name">US NE Nebraska SUTA Wage Base</field>
|
||||||
|
<field name="code">us_ne_suta_wage_base</field>
|
||||||
|
<field name="country_id" ref="base.us"/>
|
||||||
|
</record>
|
||||||
|
<data noupdate="1">
|
||||||
|
<record id="rule_parameter_us_ne_suta_wage_base_2020" model="hr.rule.parameter.value">
|
||||||
|
<field name="parameter_value">9000.0</field>
|
||||||
|
<field name="rule_parameter_id" ref="rule_parameter_us_ne_suta_wage_base"/>
|
||||||
|
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<!-- Rate -->
|
||||||
|
<record id="rule_parameter_us_ne_suta_rate" model="hr.rule.parameter">
|
||||||
|
<field name="name">US NE Nebraska SUTA Rate</field>
|
||||||
|
<field name="code">us_ne_suta_rate</field>
|
||||||
|
<field name="country_id" ref="base.us"/>
|
||||||
|
</record>
|
||||||
|
<data noupdate="1">
|
||||||
|
<record id="rule_parameter_us_ne_suta_rate_2020" model="hr.rule.parameter.value">
|
||||||
|
<field name="parameter_value">1.25</field>
|
||||||
|
<field name="rule_parameter_id" ref="rule_parameter_us_ne_suta_rate"/>
|
||||||
|
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<record id="rule_parameter_us_ne_sit_tax_rate" model="hr.rule.parameter">
|
||||||
|
<field name="name">US NE Nebraska SIT Tax Rate</field>
|
||||||
|
<field name="code">us_ne_sit_tax_rate</field>
|
||||||
|
<field name="country_id" ref="base.us"/>
|
||||||
|
</record>
|
||||||
|
<data noupdate="1">
|
||||||
|
<record id="rule_parameter_us_ne_sit_tax_rate_2020" model="hr.rule.parameter.value">
|
||||||
|
<field name="parameter_value">{
|
||||||
|
'single': {
|
||||||
|
'weekly': ((57, 0.00, 0.0), (105, 0.00, 2.26), (342, 1.08, 3.22), (496, 8.71, 4.91), (629, 16.27, 6.20), (1182, 24.52, 6.59), ('inf', 60.96, 6.95)),
|
||||||
|
'bi-weekly': ((114, 0.00, 0.0), (211, 0.00, 2.26), (684, 2.19, 3.22), (992, 17.42, 4.91), (1259, 32.54, 6.20), (2364, 49.09, 6.59), ('inf', 121.91, 6.95)),
|
||||||
|
'semi-monthly': ((124, 0.00, 0.0), (228, 0.00, 2.26), (741, 2.35, 3.22), (1074, 18.87, 4.91), (1364, 35.22, 6.20), (2561, 53.20, 6.59), ('inf', 132.08, 6.95)),
|
||||||
|
'monthly': ((248, 0.00, 0.0), (457, 0.00, 2.26), (1483, 4.72, 3.22), (2148, 37.76, 4.91), (2728, 70.41, 6.20), (5123, 106.37, 6.59), ('inf', 264.20, 6.95)),
|
||||||
|
'quarterly': ((744, 0.00, 0.0), (1370, 0.00, 2.26), (4448, 14.15, 3.22), (6445, 113.26, 4.91), (8183, 211.31, 6.20), (15368, 319.07, 6.59), ('inf', 792.56, 6.95)),
|
||||||
|
'semi-annual': ((1488, 0.00, 0.0), (2740, 0.00, 2.26), (8895, 28.30, 3.22), (12890, 226.49, 4.91), (16365, 422.64, 6.20), (30735, 638.09, 6.59), ('inf', 1585.07, 6.95)),
|
||||||
|
'annually': ((2975, 0.00, 0.0), (5480, 0.00, 2.26), (17790, 56.61, 3.22), (25780, 452.99, 4.91), (32730, 845.30, 6.20), (61470, 1276.20, 6.59), ('inf', 3170.17, 6.95)),
|
||||||
|
},
|
||||||
|
'married': {
|
||||||
|
'weekly': ((137, 0.00, 0.0), (204, 0.00, 2.26), (508, 1.51, 3.22), (790, 11.30, 4.91), (981, 25.15, 6.20), (1300, 36.99, 6.59), ('inf', 58.01, 6.95)),
|
||||||
|
'bi-weekly': ((273, 0.00, 0.0), (408, 0.00, 2.26), (1016, 3.05, 3.22), (1581, 22.63, 4.91), (1961, 50.37, 6.20), (2601, 73.93, 6.59), ('inf', 116.11, 6.95)),
|
||||||
|
'semi-monthly': ((296, 0.00, 0.0), (442, 0.00, 2.26), (1101, 3.30, 3.22), (1713, 24.52, 4.91), (2125, 54.57, 6.20), (2818, 80.11, 6.59), ('inf', 125.78, 6.95)),
|
||||||
|
'monthly': ((592, 0.00, 0.0), (884, 0.00, 2.26), (2202, 6.60, 3.22), (3425, 49.04, 4.91), (4249, 109.09, 6.20), (5635, 160.18, 6.59), ('inf', 251.52, 6.95)),
|
||||||
|
'quarterly': ((1775, 0.00, 0.0), (2653, 0.00, 2.26), (6605, 19.84, 3.22), (10275, 147.09, 4.91), (12748, 327.29, 6.20), (16905, 480.62, 6.59), ('inf', 754.57, 6.95)),
|
||||||
|
'semi-annual': ((3550, 0.00, 0.0), (5305, 0.00, 2.26), (13210, 39.66, 3.22), (20550, 294.20, 4.91), (25495, 654.59, 6.20), (33810, 961.18, 6.59), ('inf', 1509.14, 6.95)),
|
||||||
|
'annually': ((7100, 0.00, 0.0), (10610, 0.00, 2.26), (26420, 79.33, 3.22), (41100, 588.41, 4.91), (50990, 1309.20, 6.20), (67620, 1992.38, 6.59), ('inf', 3018.30, 6.95)),
|
||||||
|
},
|
||||||
|
}</field>
|
||||||
|
<field name="rule_parameter_id" ref="rule_parameter_us_ne_sit_tax_rate"/>
|
||||||
|
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<record id="rule_parameter_us_ne_sit_allowances_rate" model="hr.rule.parameter">
|
||||||
|
<field name="name">US NE Nebraska Allowances Rate</field>
|
||||||
|
<field name="code">us_ne_sit_allowances_rate</field>
|
||||||
|
<field name="country_id" ref="base.us"/>
|
||||||
|
</record>
|
||||||
|
<data noupdate="1">
|
||||||
|
<record id="rule_parameter_us_ne_sit_allowances_rate_2020" model="hr.rule.parameter.value">
|
||||||
|
<field name="parameter_value">{
|
||||||
|
'weekly' : 37.69,
|
||||||
|
'bi-weekly' : 75.38,
|
||||||
|
'semi-monthly': 81.67,
|
||||||
|
'monthly' : 163.33,
|
||||||
|
'quarterly' : 490.00,
|
||||||
|
'semi-annual': 980.00,
|
||||||
|
'annually': 1960.00,
|
||||||
|
}</field>
|
||||||
|
<field name="rule_parameter_id" ref="rule_parameter_us_ne_sit_allowances_rate"/>
|
||||||
|
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Partners and Contribution Registers -->
|
||||||
|
<record id="res_partner_us_ne_dor" model="res.partner">
|
||||||
|
<field name="name">US Nebraska - Nebraska Department of Labor - Unemployment Tax</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="res_partner_us_ne_dor_sit" model="res.partner">
|
||||||
|
<field name="name">US Nebraska - Nebraska Department of Revenue - Income Tax</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- Categories -->
|
||||||
|
|
||||||
|
<!-- Rules -->
|
||||||
|
<record id="hr_payroll_rule_er_us_ne_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 NE Nebraska State Unemployment</field>
|
||||||
|
<field name="code">ER_US_NE_SUTA</field>
|
||||||
|
<field name="condition_select">python</field>
|
||||||
|
<field name="condition_python">result, _ = general_state_unemployment(payslip, categories, worked_days, inputs, wage_base='us_ne_suta_wage_base', rate='us_ne_suta_rate', state_code='NE')</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_ne_suta_wage_base', rate='us_ne_suta_rate', state_code='NE')</field>
|
||||||
|
<field name="partner_id" ref="res_partner_us_ne_dor"/>
|
||||||
|
<field name="appears_on_payslip" eval="False"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="hr_payroll_rule_ee_us_ne_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 NE Nebraska State Income Tax Withholding</field>
|
||||||
|
<field name="code">EE_US_NE_SIT</field>
|
||||||
|
<field name="condition_select">python</field>
|
||||||
|
<field name="condition_python">result, _ = ne_nebraska_state_income_withholding(payslip, categories, worked_days, inputs)</field>
|
||||||
|
<field name="amount_select">code</field>
|
||||||
|
<field name="amount_python_compute">result, result_rate = ne_nebraska_state_income_withholding(payslip, categories, worked_days, inputs)</field>
|
||||||
|
<field name="partner_id" ref="res_partner_us_ne_dor_sit"/>
|
||||||
|
<field name="appears_on_payslip" eval="True"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
@@ -32,6 +32,7 @@ from .state.mo_missouri import mo_missouri_state_income_withholding
|
|||||||
from .state.ms_mississippi import ms_mississippi_state_income_withholding
|
from .state.ms_mississippi import ms_mississippi_state_income_withholding
|
||||||
from .state.mt_montana import mt_montana_state_income_withholding
|
from .state.mt_montana import mt_montana_state_income_withholding
|
||||||
from .state.nc_northcarolina import nc_northcarolina_state_income_withholding
|
from .state.nc_northcarolina import nc_northcarolina_state_income_withholding
|
||||||
|
from .state.ne_nebraska import ne_nebraska_state_income_withholding
|
||||||
from .state.nj_newjersey import nj_newjersey_state_income_withholding
|
from .state.nj_newjersey import nj_newjersey_state_income_withholding
|
||||||
from .state.nm_new_mexico import nm_new_mexico_state_income_withholding
|
from .state.nm_new_mexico import nm_new_mexico_state_income_withholding
|
||||||
from .state.oh_ohio import oh_ohio_state_income_withholding
|
from .state.oh_ohio import oh_ohio_state_income_withholding
|
||||||
@@ -90,6 +91,7 @@ class HRPayslip(models.Model):
|
|||||||
'ms_mississippi_state_income_withholding': ms_mississippi_state_income_withholding,
|
'ms_mississippi_state_income_withholding': ms_mississippi_state_income_withholding,
|
||||||
'mt_montana_state_income_withholding': mt_montana_state_income_withholding,
|
'mt_montana_state_income_withholding': mt_montana_state_income_withholding,
|
||||||
'nc_northcarolina_state_income_withholding': nc_northcarolina_state_income_withholding,
|
'nc_northcarolina_state_income_withholding': nc_northcarolina_state_income_withholding,
|
||||||
|
'ne_nebraska_state_income_withholding': ne_nebraska_state_income_withholding,
|
||||||
'nj_newjersey_state_income_withholding': nj_newjersey_state_income_withholding,
|
'nj_newjersey_state_income_withholding': nj_newjersey_state_income_withholding,
|
||||||
'nm_new_mexico_state_income_withholding': nm_new_mexico_state_income_withholding,
|
'nm_new_mexico_state_income_withholding': nm_new_mexico_state_income_withholding,
|
||||||
'oh_ohio_state_income_withholding': oh_ohio_state_income_withholding,
|
'oh_ohio_state_income_withholding': oh_ohio_state_income_withholding,
|
||||||
|
|||||||
49
l10n_us_hr_payroll/models/state/ne_nebraska.py
Normal file
49
l10n_us_hr_payroll/models/state/ne_nebraska.py
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||||
|
|
||||||
|
from .general import _state_applies, sit_wage
|
||||||
|
|
||||||
|
|
||||||
|
def ne_nebraska_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)
|
||||||
|
"""
|
||||||
|
state_code = 'NE'
|
||||||
|
if not _state_applies(payslip, state_code):
|
||||||
|
return 0.0, 0.0
|
||||||
|
|
||||||
|
personal_exempt = payslip.contract_id.us_payroll_config_value('state_income_tax_exempt')
|
||||||
|
if personal_exempt:
|
||||||
|
return 0.0, 0.0
|
||||||
|
|
||||||
|
# Determine Wage
|
||||||
|
wage = sit_wage(payslip, categories)
|
||||||
|
if not wage:
|
||||||
|
return 0.0, 0.0
|
||||||
|
|
||||||
|
filing_status = payslip.contract_id.us_payroll_config_value('ne_w4n_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('ne_w4n_sit_allowances')
|
||||||
|
tax_rate = payslip.rule_parameter('us_ne_sit_tax_rate')[filing_status].get(schedule_pay)
|
||||||
|
sit_allowance = payslip.rule_parameter('us_ne_sit_allowances_rate')[schedule_pay]
|
||||||
|
|
||||||
|
allowance_amt = allowances * sit_allowance
|
||||||
|
taxable_income = wage - allowance_amt
|
||||||
|
withholding = 0.0
|
||||||
|
last = 0.0
|
||||||
|
for row in tax_rate:
|
||||||
|
amt, flat_fee, rate = row
|
||||||
|
if taxable_income < 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)
|
||||||
@@ -182,6 +182,12 @@ class HRContractUSPayrollConfig(models.Model):
|
|||||||
], string='North Carolina NC-4 Filing Status', help='NC-4')
|
], string='North Carolina NC-4 Filing Status', help='NC-4')
|
||||||
nc_nc4_sit_allowances = fields.Integer(string='North Carolina NC-4 Allowances', help='NC-4 1.')
|
nc_nc4_sit_allowances = fields.Integer(string='North Carolina NC-4 Allowances', help='NC-4 1.')
|
||||||
|
|
||||||
|
ne_w4n_sit_filing_status = fields.Selection([
|
||||||
|
('single', 'Single'),
|
||||||
|
('married', 'Married'),
|
||||||
|
], string='Nebraska NE W-4N Filing Status', help='NE W-4N')
|
||||||
|
ne_w4n_sit_allowances = fields.Integer(string='Nebraska NE W-4N Allowances', help='NE W-4N 1.')
|
||||||
|
|
||||||
nj_njw4_sit_filing_status = fields.Selection([
|
nj_njw4_sit_filing_status = fields.Selection([
|
||||||
('', 'Exempt'),
|
('', 'Exempt'),
|
||||||
('single', 'Single'),
|
('single', 'Single'),
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ from . import test_us_mt_montana_payslip_2020
|
|||||||
from . import test_us_nc_northcarolina_payslip_2019
|
from . import test_us_nc_northcarolina_payslip_2019
|
||||||
from . import test_us_nc_northcarolina_payslip_2020
|
from . import test_us_nc_northcarolina_payslip_2020
|
||||||
|
|
||||||
|
from . import test_us_ne_nebraska_payslip_2020
|
||||||
|
|
||||||
from . import test_us_nh_new_hampshire_payslip_2020
|
from . import test_us_nh_new_hampshire_payslip_2020
|
||||||
|
|
||||||
from . import test_us_nj_newjersey_payslip_2019
|
from . import test_us_nj_newjersey_payslip_2019
|
||||||
|
|||||||
37
l10n_us_hr_payroll/tests/test_us_ne_nebraska_payslip_2020.py
Normal file
37
l10n_us_hr_payroll/tests/test_us_ne_nebraska_payslip_2020.py
Normal 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 TestUsNEPayslip(TestUsPayslip):
|
||||||
|
###
|
||||||
|
# 2020 Taxes and Rates
|
||||||
|
###
|
||||||
|
NE_UNEMP_MAX_WAGE = 9000.0
|
||||||
|
NE_UNEMP = 1.25
|
||||||
|
|
||||||
|
def _test_sit(self, wage, filing_status, exempt, additional_withholding, allowances, schedule_pay, date_start, expected_withholding):
|
||||||
|
employee = self._createEmployee()
|
||||||
|
contract = self._createContract(employee,
|
||||||
|
wage=wage,
|
||||||
|
state_id=self.get_us_state('NE'),
|
||||||
|
ne_w4n_sit_filing_status=filing_status,
|
||||||
|
state_income_tax_exempt=exempt,
|
||||||
|
state_income_tax_additional_withholding=additional_withholding,
|
||||||
|
ne_w4n_sit_allowances=allowances,
|
||||||
|
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('NE', self.NE_UNEMP, date(2020, 1, 1), wage_base=self.NE_UNEMP_MAX_WAGE)
|
||||||
|
self._test_sit(750.0, 'single', False, 0.0, 2, 'weekly', date(2020, 1, 1), 27.53)
|
||||||
|
self._test_sit(9500.0, 'single', False, 0.0, 1, 'bi-weekly', date(2020, 1, 1), 612.63)
|
||||||
|
self._test_sit(10500.0, 'married', False, 0.0, 1, 'bi-weekly', date(2020, 1, 1), 659.85)
|
||||||
|
self._test_sit(9500.0, 'single', True, 0.0, 1, 'bi-weekly', date(2020, 1, 1), 0.0)
|
||||||
|
self._test_sit(10500.0, 'single', False, 10.0, 2, 'monthly', date(2020, 1, 1), 625.2)
|
||||||
@@ -167,6 +167,13 @@
|
|||||||
<field name="nc_nc4_sit_allowances" string="Allowances 1."/>
|
<field name="nc_nc4_sit_allowances" string="Allowances 1."/>
|
||||||
<field name="state_income_tax_additional_withholding" string="Additional Withholding 2."/>
|
<field name="state_income_tax_additional_withholding" string="Additional Withholding 2."/>
|
||||||
</group>
|
</group>
|
||||||
|
<group name="state_ne_nebraska" string="NE Nebraska" attrs="{'invisible':[('state_id', '!=', %(base.state_us_22)s)]}">
|
||||||
|
<p colspan="2"><h3>Form NC-4 - State Income Tax</h3></p>
|
||||||
|
<field name="ne_w4n_sit_filing_status" string="Filing Status"/>
|
||||||
|
<field name="ne_w4n_sit_allowances" string="Allowances 1."/>
|
||||||
|
<field name="state_income_tax_additional_withholding" string="Additional Withholding 2."/>
|
||||||
|
<field name="state_income_tax_exempt" string="Exempt 3."/>
|
||||||
|
</group>
|
||||||
<group name="state_nh_new_hampshire" string="NH New Hampshire" attrs="{'invisible':[('state_id', '!=', %(base.state_us_24)s)]}">
|
<group name="state_nh_new_hampshire" string="NH New Hampshire" attrs="{'invisible':[('state_id', '!=', %(base.state_us_24)s)]}">
|
||||||
<p colspan="2"><h3>No additional fields.</h3></p>
|
<p colspan="2"><h3>No additional fields.</h3></p>
|
||||||
</group>
|
</group>
|
||||||
|
|||||||
Reference in New Issue
Block a user