Migrate l10n_us_nc_hr_payroll for 2019 and to use hr.payroll.rate instead of company field.

This commit is contained in:
Jared Kipe
2019-01-07 08:43:51 -08:00
parent 309fc90d1d
commit 832f0d5ca5
12 changed files with 610 additions and 236 deletions

View File

@@ -1 +1 @@
from . import hr_payroll
from . import models

View File

@@ -18,9 +18,10 @@ USA::North Carolina Payroll Rules.
'auto_install': False,
'website': 'https://hibou.io/',
'data': [
'hr_payroll_view.xml',
'views/hr_payroll_views.xml',
'data/base.xml',
'data/rules_2018.xml',
'data/rates.xml',
'data/rules.xml',
'data/final.xml',
],
'installable': True

View File

@@ -26,19 +26,19 @@
<!-- HR SALARY RULE CATEGORIES-->
<record id="hr_payroll_nc_unemp_wages" model="hr.salary.rule.category">
<field name="name">North Carolina Unemployment - Wages</field>
<field name="code">NC_UNEMP_WAGES</field>
<field name="name">Wage: US-NC Unemployment</field>
<field name="code">WAGE_US_NC_UNEMP</field>
</record>
<record id="hr_payroll_nc_unemp" model="hr.salary.rule.category">
<field name="name">North Carolina Unemployment</field>
<field name="code">NC_UNEMP</field>
<field name="name">ER: US-NC Unemployment</field>
<field name="code">ER_US_NC_UNEMP</field>
<field name="parent_id" ref="hr_payroll.COMP"/>
</record>
<record id="hr_payroll_nc_income_withhold" model="hr.salary.rule.category">
<field name="name">North Carolina Income Withholding</field>
<field name="code">NC_INC_WITHHOLD</field>
<field name="name">EE: US-NC Income Tax Withholding</field>
<field name="code">EE_US_NC_INC_WITHHOLD</field>
<field name="parent_id" ref="hr_payroll.DED"/>
</record>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="hr_payroll_rates_nc_unemp_2018" model="hr.payroll.rate">
<field name="name">US NC Unemployment</field>
<field name="code">US_NC_UNEMP</field>
<field name="rate">0.6</field>
<field name="date_from">2018-01-01</field>
<field name="wage_limit_year" eval="23500.0"/>
</record>
<record id="hr_payroll_rates_nc_unemp_2019" model="hr.payroll.rate">
<field name="name">US NC Unemployment</field>
<field name="code">US_NC_UNEMP</field>
<field name="rate">1.0</field>
<field name="date_from">2019-01-01</field>
<field name="wage_limit_year" eval="24300.0"/>
</record>
</data>
</odoo>

View File

@@ -0,0 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- HR SALARY RULES-->
<record id="hr_payroll_rules_nc_unemp_wages_2018" model="hr.salary.rule">
<field name="sequence" eval="423"/>
<field name="category_id" ref="hr_payroll_nc_unemp_wages"/>
<field name="name">Wage: US-NC Unemployment</field>
<field name="code">WAGE_US_NC_UNEMP</field>
<field name="condition_select">python</field>
<field name="condition_python">result = (contract.futa_type != contract.FUTA_TYPE_BASIC)</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
rate = payslip.dict.get_rate('US_NC_UNEMP')
year = int(payslip.dict.date_from[:4])
ytd = payslip.sum('NC_UNEMP_WAGES_2018', str(year) + '-01-01', str(year+1) + '-01-01')
ytd += contract.external_wages
remaining = rate.wage_limit_year - ytd
if remaining &lt;= 0.0:
result = 0
elif remaining &lt; categories.BASIC:
result = remaining
else:
result = categories.BASIC
</field>
<field name="appears_on_payslip" eval="False"/>
</record>
<record id="hr_payroll_rules_nc_unemp_2018" model="hr.salary.rule">
<field name="sequence" eval="443"/>
<field name="category_id" ref="hr_payroll_nc_unemp"/>
<field name="name">ER: US-NC Unemployment</field>
<field name="code">ER_US_NC_UNEMP</field>
<field name="condition_select">python</field>
<field name="condition_python">result = (contract.futa_type != contract.FUTA_TYPE_BASIC)</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
rate = payslip.dict.get_rate('US_NC_UNEMP')
result_rate = -rate.rate
result = categories.WAGE_US_NC_UNEMP
# result_rate of 0 implies 100% due to bug
if result_rate == 0.0:
result = 0.0
</field>
<field name="register_id" ref="contrib_register_ncdor_unemp"/>
<field name="appears_on_payslip" eval="False"/>
</record>
<record id="hr_payroll_rules_nc_inc_withhold_2018" model="hr.salary.rule">
<field name="sequence" eval="155"/>
<field name="category_id" ref="hr_payroll_nc_income_withhold"/>
<field name="name">EE: US-NC Income Tax Withholding</field>
<field name="code">EE_US_NC_INC_WITHHOLD</field>
<field name="condition_select">python</field>
<field name="condition_python">result = True</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
wages = categories.GROSS
allowances = contract.nc_nc4_allowances
schedule_pay = contract.schedule_pay
val = 0.00
# PST -> Portion of standard deduction
if year == 2018:
PST = 0.0
allowance_multiplier = 0.0
if 'weekly' == schedule_pay:
allowance_multiplier = 48.08
if contract.nc_nc4_filing_status == 'head_household':
PST = 269.23
else:
PST = 168.27
elif 'bi-weekly' == schedule_pay:
allowance_multiplier = 96.15
if contract.nc_nc4_filing_status == 'head_household':
PST = 538.46
else:
PST = 336.54
elif 'semi-monthly' == schedule_pay:
allowance_multiplier = 104.17
if contract.nc_nc4_filing_status == 'head_household':
PST = 583.33
else:
PST = 364.58
elif 'monthly' == schedule_pay:
allowance_multiplier = 208.33
if contract.nc_nc4_filing_status == 'head_household':
PST = 1166.67
else:
PST = 729.17
else:
raise Exception('Invalid schedule_pay="' + schedule_pay + '" for NC Income Withholding calculation')
# Algorithm derived from percentage method in https://files.nc.gov/ncdor/documents/files/nc-30_book_web.pdf
if contract.nc_nc4_filing_status == 'exempt':
result = 0
else:
withholding = round(((wages - (PST + (allowance_multiplier * allowances))) * 0.05599) + contract.nc_nc4_additional_wh)
if withholding > 0.0:
result = - withholding
else:
result = 0
else:
PST = 0.0
allowance_multiplier = 0.0
if 'weekly' == schedule_pay:
allowance_multiplier = 48.08
if contract.nc_nc4_filing_status == 'head_household':
PST = 288.46
else:
PST = 192.31
elif 'bi-weekly' == schedule_pay:
allowance_multiplier = 96.15
if contract.nc_nc4_filing_status == 'head_household':
PST = 576.92
else:
PST = 384.62
elif 'semi-monthly' == schedule_pay:
allowance_multiplier = 104.17
if contract.nc_nc4_filing_status == 'head_household':
PST = 625.00
else:
PST = 416.67
elif 'monthly' == schedule_pay:
allowance_multiplier = 208.33
if contract.nc_nc4_filing_status == 'head_household':
PST = 1250.00
else:
PST = 833.33
else:
raise Exception('Invalid schedule_pay="' + schedule_pay + '" for NC Income Withholding calculation')
# Algorithm derived from percentage method in https://files.nc.gov/ncdor/documents/files/nc-30_book_web.pdf
if contract.nc_nc4_filing_status == 'exempt':
result = 0
else:
withholding = round(((wages - (PST + (allowance_multiplier * allowances))) * 0.0535) + contract.nc_nc4_additional_wh)
if withholding > 0.0:
result = - withholding
else:
result = 0
</field>
<field name="register_id" ref="contrib_register_ncdor_withhold"/>
</record>
</data>
</odoo>

View File

@@ -1,109 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- HR SALARY RULES-->
<record id="hr_payroll_rules_nc_unemp_wages_2018" model="hr.salary.rule">
<field name="sequence" eval="423"/>
<field name="category_id" ref="hr_payroll_nc_unemp_wages"/>
<field name="name">North Carolina Unemployment - Wages (2018)</field>
<field name="code">NC_UNEMP_WAGES_2018</field>
<field name="condition_select">python</field>
<field name="condition_python">result = (payslip.date_to[:4] == '2018')</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
ytd = payslip.sum('NC_UNEMP_WAGES_2018', '2018-01-01', '2019-01-01')
ytd += contract.external_wages
remaining = 7000.0 - ytd
if remaining &lt;= 0.0:
result = 0
elif remaining &lt; categories.BASIC:
result = remaining
else:
result = categories.BASIC
</field>
<field name="appears_on_payslip" eval="False"/>
</record>
<record id="hr_payroll_rules_nc_unemp_2018" model="hr.salary.rule">
<field name="sequence" eval="443"/>
<field name="category_id" ref="hr_payroll_nc_unemp"/>
<field name="name">North Carolina Unemployment (2018)</field>
<field name="code">NC_UNEMP_2018</field>
<field name="condition_select">python</field>
<field name="condition_python">result = (payslip.date_to[:4] == '2018')</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
result_rate = -contract.nc_unemp_rate(2018)
result = categories.NC_UNEMP_WAGES
# result_rate of 0 implies 100% due to bug
if result_rate == 0.0:
result = 0.0
</field>
<field name="register_id" ref="contrib_register_ncdor_unemp"/>
<field name="appears_on_payslip" eval="False"/>
</record>
<record id="hr_payroll_rules_nc_inc_withhold_2018" model="hr.salary.rule">
<field name="sequence" eval="145"/>
<field name="category_id" ref="hr_payroll_nc_income_withhold"/>
<field name="name">North Carolina Income Withholding</field>
<field name="code">NC_INC_WITHHOLD_2018</field>
<field name="condition_select">python</field>
<field name="condition_python">result = (payslip.date_to[:4] == '2018')</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
wages = categories.GROSS
allowances = contract.nc_nc4_allowances
schedule_pay = contract.schedule_pay
val = 0.00
# PST -> Portion of standard deduction
PST = 0.0
allowance_multiplier = 0.0
if 'weekly' == schedule_pay:
allowance_multiplier = 48.08
if contract.nc_nc4_filing_status == 'head_household':
PST = 269.23
else:
PST = 168.27
elif 'bi-weekly' == schedule_pay:
allowance_multiplier = 96.15
if contract.nc_nc4_filing_status == 'head_household':
PST = 538.46
else:
PST = 336.54
elif 'semi-monthly' == schedule_pay:
allowance_multiplier = 104.17
if contract.nc_nc4_filing_status == 'head_household':
PST = 583.33
else:
PST = 364.58
elif 'monthly' == schedule_pay:
allowance_multiplier = 208.33
if contract.nc_nc4_filing_status == 'head_household':
PST = 1166.67
else:
PST = 729.17
else:
raise Exception('Invalid schedule_pay="' + schedule_pay + '" for NC Income Withholding calculation')
# Algorithm derived from percentage method in https://files.nc.gov/ncdor/documents/files/nc-30_book_web.pdf
if contract.nc_nc4_filing_status == 'exempt':
result = 0
else:
withholding = round(((wages - (PST + (allowance_multiplier * allowances))) * 0.05599) + contract.nc_nc4_additional_wh)
if withholding > 0.0:
result = - withholding
else:
result = 0
</field>
<field name="register_id" ref="contrib_register_ncdor_withhold"/>
</record>
</data>
</odoo>

View File

@@ -0,0 +1 @@
from . import hr_payroll

View File

@@ -15,21 +15,3 @@ class USNCHrContract(models.Model):
nc_nc4_additional_wh = fields.Float(string="Additional Witholding", default=0.0,
help="If you are filling out NC-4 NRA, this would be box 4; " \
"otherwise box 2.")
@api.multi
def nc_unemp_rate(self, year):
self.ensure_one()
if self.futa_type == self.FUTA_TYPE_BASIC:
return 0.0
if hasattr(self.employee_id.company_id, 'nc_unemp_rate_' + str(year)):
return self.employee_id.company_id['nc_unemp_rate_' + str(year)]
raise NotImplemented('Year (' + str(year) + ') Not implemented for US North Carolina.')
class NCCompany(models.Model):
_inherit = 'res.company'
# Unemployment rate provided by Katherine
nc_unemp_rate_2018 = fields.Float(string="North Carolina Unemployment Rate 2018", default=0.06)

View File

@@ -1 +1,2 @@
from . import test_us_nc_payslip_2018
from . import test_us_nc_payslip_2019

View File

@@ -6,7 +6,8 @@ class TestUsNCPayslip(TestUsPayslip):
###
# Taxes and Rates
###
NC_UNEMP_MAX_WAGE = 7000.0
NC_UNEMP_MAX_WAGE = 23500.0
NC_UNEMP = -0.6 / 100.0
def test_2018_taxes_weekly(self):
@@ -22,17 +23,12 @@ class TestUsNCPayslip(TestUsPayslip):
wh = -round((salary - (PST + (allowance_multiplier * exemption))) * 0.05599)
employee = self._createEmployee()
employee.company_id.nc_unemp_rate_2018 = 0.06
contract = self._createContract(employee, salary, struct_id=self.ref('l10n_us_nc_hr_payroll.hr_payroll_salary_structure_us_nc_employee'), schedule_pay=schedule_pay)
contract.nc_nc4_allowances = exemption
self.assertEqual(contract.schedule_pay, 'weekly')
# tax rates
nc_unemp = contract.nc_unemp_rate(2018) / -100.0
self._log('2018 North Carolina tax first payslip weekly:')
payslip = self._createPayslip(employee, '2018-01-01', '2018-01-31')
@@ -40,15 +36,15 @@ class TestUsNCPayslip(TestUsPayslip):
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['NC_UNEMP_WAGES'], salary)
self.assertPayrollEqual(cats['NC_UNEMP'], cats['NC_UNEMP_WAGES'] * nc_unemp)
self.assertPayrollEqual(cats['NC_INC_WITHHOLD'], wh)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], salary)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], cats['WAGE_US_NC_UNEMP'] * self.NC_UNEMP)
self.assertPayrollEqual(cats['EE_US_NC_INC_WITHHOLD'], wh)
process_payslip(payslip)
# Make a new payslip, this one will have maximums
remaining_nc_unemp_wages = self.NC_UNEMP_MAX_WAGE - salary if (self.NC_UNEMP_MAX_WAGE - 2*salary < salary) \
remaining_NC_UNEMP_wages = self.NC_UNEMP_MAX_WAGE - salary if (self.NC_UNEMP_MAX_WAGE - 2*salary < salary) \
else salary
self._log('2018 North Carolina tax second payslip weekly:')
@@ -58,24 +54,20 @@ class TestUsNCPayslip(TestUsPayslip):
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['NC_UNEMP_WAGES'], remaining_nc_unemp_wages)
self.assertPayrollEqual(cats['NC_UNEMP'], remaining_nc_unemp_wages * nc_unemp)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], remaining_NC_UNEMP_wages)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], remaining_NC_UNEMP_wages * self.NC_UNEMP)
def test_2018_taxes_with_external_weekly(self):
salary = 5000.0
external_wages = 7000.0
external_wages = 30000.0
schedule_pay = 'weekly'
employee = self._createEmployee()
employee.company_id.nc_unemp_rate_2018 = 0.06
contract = self._createContract(employee, salary, external_wages=external_wages,
struct_id=self.ref('l10n_us_nc_hr_payroll.hr_payroll_salary_structure_us_nc_employee'), schedule_pay=schedule_pay)
# tax rates
nc_unemp = contract.nc_unemp_rate(2018) / -100.0
self._log('2018 NorthCarolina_external tax first payslip weekly:')
payslip = self._createPayslip(employee, '2018-01-01', '2018-01-31')
@@ -83,25 +75,19 @@ class TestUsNCPayslip(TestUsPayslip):
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['NC_UNEMP_WAGES'], self.NC_UNEMP_MAX_WAGE - external_wages)
self.assertPayrollEqual(cats['NC_UNEMP'], cats['NC_UNEMP_WAGES'] * nc_unemp)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], max(self.NC_UNEMP_MAX_WAGE - external_wages, 0.0))
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], cats['WAGE_US_NC_UNEMP'] * self.NC_UNEMP)
def test_2018_taxes_with_state_exempt_weekly(self):
salary = 5000.0
external_wages = 6000.0
external_wages = 10000.0
schedule_pay = 'weekly'
employee = self._createEmployee()
employee.company_id.nc_unemp_rate_2018 = 0.06
contract = self._createContract(employee, salary, external_wages=external_wages, struct_id=self.ref(
'l10n_us_nc_hr_payroll.hr_payroll_salary_structure_us_nc_employee'), futa_type=USHrContract.FUTA_TYPE_BASIC, schedule_pay=schedule_pay)
# tax rates
nc_unemp = contract.nc_unemp_rate(2018) / -100.0
self.assertPayrollEqual(nc_unemp, 0.0)
self._log('2018 North Carolina exempt tax first payslip weekly:')
payslip = self._createPayslip(employee, '2018-01-01', '2018-01-31')
@@ -109,8 +95,8 @@ class TestUsNCPayslip(TestUsPayslip):
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['NC_UNEMP_WAGES'], self.NC_UNEMP_MAX_WAGE - external_wages)
self.assertPayrollEqual(cats['NC_UNEMP'], cats['NC_UNEMP_WAGES'] * nc_unemp)
self.assertPayrollEqual(cats.get('WAGE_US_NC_UNEMP', 0.0), 0.0)
self.assertPayrollEqual(cats.get('ER_US_NC_UNEMP', 0.0), cats.get('WAGE_US_NC_UNEMP', 0.0) * self.NC_UNEMP)
def test_2018_taxes_biweekly(self):
salary = 5000.0
@@ -125,17 +111,12 @@ class TestUsNCPayslip(TestUsPayslip):
wh = -round((salary - (PST + (allowance_multiplier * allowances))) * 0.05599)
employee = self._createEmployee()
employee.company_id.nc_unemp_rate_2018 = 0.06
contract = self._createContract(employee, salary, struct_id=self.ref('l10n_us_nc_hr_payroll.hr_payroll_salary_structure_us_nc_employee'), schedule_pay=schedule_pay)
contract.nc_nc4_allowances = allowances
self.assertEqual(contract.schedule_pay, 'bi-weekly')
# tax rates
nc_unemp = contract.nc_unemp_rate(2018) / -100.0
self._log('2018 North Carolina tax first payslip bi-weekly:')
payslip = self._createPayslip(employee, '2018-01-01', '2018-01-31')
@@ -143,15 +124,15 @@ class TestUsNCPayslip(TestUsPayslip):
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['NC_UNEMP_WAGES'], salary)
self.assertPayrollEqual(cats['NC_UNEMP'], cats['NC_UNEMP_WAGES'] * nc_unemp)
self.assertPayrollEqual(cats['NC_INC_WITHHOLD'], wh)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], salary)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], cats['WAGE_US_NC_UNEMP'] * self.NC_UNEMP)
self.assertPayrollEqual(cats['EE_US_NC_INC_WITHHOLD'], wh)
process_payslip(payslip)
# Make a new payslip, this one will have maximums
remaining_nc_unemp_wages = self.NC_UNEMP_MAX_WAGE - salary if (self.NC_UNEMP_MAX_WAGE - 2*salary < salary) \
remaining_NC_UNEMP_wages = self.NC_UNEMP_MAX_WAGE - salary if (self.NC_UNEMP_MAX_WAGE - 2*salary < salary) \
else salary
self._log('2018 North Carolina tax second payslip bi-weekly:')
@@ -161,8 +142,8 @@ class TestUsNCPayslip(TestUsPayslip):
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['NC_UNEMP_WAGES'], remaining_nc_unemp_wages)
self.assertPayrollEqual(cats['NC_UNEMP'], remaining_nc_unemp_wages * nc_unemp)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], remaining_NC_UNEMP_wages)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], remaining_NC_UNEMP_wages * self.NC_UNEMP)
def test_2018_taxes_semimonthly(self):
salary = 4000.0
@@ -178,7 +159,6 @@ class TestUsNCPayslip(TestUsPayslip):
wh = -round((salary - (PST + (allowance_multiplier * allowances))) * 0.05599)
employee = self._createEmployee()
employee.company_id.nc_unemp_rate_2018 = 0.06
contract = self._createContract(employee, salary, struct_id=self.ref(
'l10n_us_nc_hr_payroll.hr_payroll_salary_structure_us_nc_employee'), schedule_pay=schedule_pay)
@@ -187,9 +167,6 @@ class TestUsNCPayslip(TestUsPayslip):
self.assertEqual(contract.schedule_pay, 'semi-monthly')
# tax rates
nc_unemp = contract.nc_unemp_rate(2018) / -100.0
self._log('2018 North Carolina tax first payslip:')
payslip = self._createPayslip(employee, '2018-01-01', '2018-01-31')
@@ -197,15 +174,15 @@ class TestUsNCPayslip(TestUsPayslip):
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['NC_UNEMP_WAGES'], salary)
self.assertPayrollEqual(cats['NC_UNEMP'], cats['NC_UNEMP_WAGES'] * nc_unemp)
self.assertPayrollEqual(cats['NC_INC_WITHHOLD'], wh)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], salary)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], cats['WAGE_US_NC_UNEMP'] * self.NC_UNEMP)
self.assertPayrollEqual(cats['EE_US_NC_INC_WITHHOLD'], wh)
process_payslip(payslip)
# Make a new payslip, this one will have maximums
remaining_nc_unemp_wages = self.NC_UNEMP_MAX_WAGE - salary if (self.NC_UNEMP_MAX_WAGE - 2 * salary < salary) \
remaining_NC_UNEMP_wages = self.NC_UNEMP_MAX_WAGE - salary if (self.NC_UNEMP_MAX_WAGE - 2 * salary < salary) \
else salary
self._log('2018 North Carolina tax second payslip:')
@@ -215,8 +192,8 @@ class TestUsNCPayslip(TestUsPayslip):
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['NC_UNEMP_WAGES'], remaining_nc_unemp_wages)
self.assertPayrollEqual(cats['NC_UNEMP'], remaining_nc_unemp_wages * nc_unemp)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], remaining_NC_UNEMP_wages)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], remaining_NC_UNEMP_wages * self.NC_UNEMP)
def test_2018_taxes_monthly(self):
salary = 4000.0
@@ -231,7 +208,6 @@ class TestUsNCPayslip(TestUsPayslip):
wh = -round((salary - (PST + (allowance_multiplier * allowances))) * 0.05599)
employee = self._createEmployee()
employee.company_id.nc_unemp_rate_2018 = 0.06
contract = self._createContract(employee, salary, struct_id=self.ref(
'l10n_us_nc_hr_payroll.hr_payroll_salary_structure_us_nc_employee'), schedule_pay=schedule_pay)
@@ -239,9 +215,6 @@ class TestUsNCPayslip(TestUsPayslip):
self.assertEqual(contract.schedule_pay, 'monthly')
# tax rates
nc_unemp = contract.nc_unemp_rate(2018) / -100.0
self._log('2018 North Carolina tax first payslip:')
payslip = self._createPayslip(employee, '2018-01-01', '2018-01-31')
@@ -249,15 +222,15 @@ class TestUsNCPayslip(TestUsPayslip):
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['NC_UNEMP_WAGES'], salary)
self.assertPayrollEqual(cats['NC_UNEMP'], cats['NC_UNEMP_WAGES'] * nc_unemp)
self.assertPayrollEqual(cats['NC_INC_WITHHOLD'], wh)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], salary)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], cats['WAGE_US_NC_UNEMP'] * self.NC_UNEMP)
self.assertPayrollEqual(cats['EE_US_NC_INC_WITHHOLD'], wh)
process_payslip(payslip)
# Make a new payslip, this one will have maximums
remaining_nc_unemp_wages = self.NC_UNEMP_MAX_WAGE - salary if (
remaining_NC_UNEMP_wages = self.NC_UNEMP_MAX_WAGE - salary if (
self.NC_UNEMP_MAX_WAGE - 2 * salary < salary) \
else salary
@@ -268,8 +241,8 @@ class TestUsNCPayslip(TestUsPayslip):
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['NC_UNEMP_WAGES'], remaining_nc_unemp_wages)
self.assertPayrollEqual(cats['NC_UNEMP'], remaining_nc_unemp_wages * nc_unemp)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], remaining_NC_UNEMP_wages)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], remaining_NC_UNEMP_wages * self.NC_UNEMP)
def test_tax_exempt(self):
salary = 4000.0
@@ -278,7 +251,6 @@ class TestUsNCPayslip(TestUsPayslip):
excemptions = 1
employee = self._createEmployee()
employee.company_id.nc_unemp_rate_2018 = 0.06
contract = self._createContract(employee, salary, struct_id=self.ref(
'l10n_us_nc_hr_payroll.hr_payroll_salary_structure_us_nc_employee'), schedule_pay=schedule_pay)
@@ -287,10 +259,6 @@ class TestUsNCPayslip(TestUsPayslip):
self.assertEqual(contract.schedule_pay, 'weekly')
# tax rates
nc_unemp = contract.nc_unemp_rate(2018) / -100.0
self._log('2018 North Carolina tax first payslip:')
payslip = self._createPayslip(employee, '2018-01-01', '2018-01-31')
@@ -298,15 +266,15 @@ class TestUsNCPayslip(TestUsPayslip):
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['NC_UNEMP_WAGES'], salary)
self.assertPayrollEqual(cats['NC_UNEMP'], cats['NC_UNEMP_WAGES'] * nc_unemp)
self.assertPayrollEqual(cats['NC_INC_WITHHOLD'], wh)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], salary)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], cats['WAGE_US_NC_UNEMP'] * self.NC_UNEMP)
self.assertPayrollEqual(cats['EE_US_NC_INC_WITHHOLD'], wh)
process_payslip(payslip)
# Make a new payslip, this one will have maximums
remaining_nc_unemp_wages = self.NC_UNEMP_MAX_WAGE - salary if (
remaining_NC_UNEMP_wages = self.NC_UNEMP_MAX_WAGE - salary if (
self.NC_UNEMP_MAX_WAGE - 2 * salary < salary) \
else salary
@@ -317,8 +285,8 @@ class TestUsNCPayslip(TestUsPayslip):
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['NC_UNEMP_WAGES'], remaining_nc_unemp_wages)
self.assertPayrollEqual(cats['NC_UNEMP'], remaining_nc_unemp_wages * nc_unemp)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], remaining_NC_UNEMP_wages)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], remaining_NC_UNEMP_wages * self.NC_UNEMP)
def test_additional_withholding(self):
salary = 4000.0
@@ -336,7 +304,6 @@ class TestUsNCPayslip(TestUsPayslip):
wh = -round(((salary - (PST + (allowance_multiplier * allowances))) * 0.05599) + additional_wh)
employee = self._createEmployee()
employee.company_id.nc_unemp_rate_2018 = 0.06
contract = self._createContract(employee,
salary,
@@ -349,9 +316,6 @@ class TestUsNCPayslip(TestUsPayslip):
self.assertEqual(contract.schedule_pay, 'weekly')
self.assertEqual(contract.w4_is_nonresident_alien, True)
# tax rates
nc_unemp = contract.nc_unemp_rate(2018) / -100.0
self._log('2018 North Carolina tax first payslip weekly:')
payslip = self._createPayslip(employee, '2018-01-01', '2018-01-31')
@@ -359,15 +323,15 @@ class TestUsNCPayslip(TestUsPayslip):
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['NC_UNEMP_WAGES'], salary)
self.assertPayrollEqual(cats['NC_UNEMP'], cats['NC_UNEMP_WAGES'] * nc_unemp)
self.assertPayrollEqual(cats['NC_INC_WITHHOLD'], wh)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], salary)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], cats['WAGE_US_NC_UNEMP'] * self.NC_UNEMP)
self.assertPayrollEqual(cats['EE_US_NC_INC_WITHHOLD'], wh)
process_payslip(payslip)
# Make a new payslip, this one will have maximums
remaining_nc_unemp_wages = self.NC_UNEMP_MAX_WAGE - salary if (self.NC_UNEMP_MAX_WAGE - 2 * salary < salary) \
remaining_NC_UNEMP_wages = self.NC_UNEMP_MAX_WAGE - salary if (self.NC_UNEMP_MAX_WAGE - 2 * salary < salary) \
else salary
self._log('2018 North Carolina tax second payslip weekly:')
@@ -377,8 +341,8 @@ class TestUsNCPayslip(TestUsPayslip):
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['NC_UNEMP_WAGES'], remaining_nc_unemp_wages)
self.assertPayrollEqual(cats['NC_UNEMP'], remaining_nc_unemp_wages * nc_unemp)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], remaining_NC_UNEMP_wages)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], remaining_NC_UNEMP_wages * self.NC_UNEMP)
def test_underflow(self):
salary = 150.0
@@ -393,7 +357,6 @@ class TestUsNCPayslip(TestUsPayslip):
wh = 0.0
employee = self._createEmployee()
employee.company_id.nc_unemp_rate_2018 = 0.06
contract = self._createContract(employee, salary, struct_id=self.ref(
'l10n_us_nc_hr_payroll.hr_payroll_salary_structure_us_nc_employee'), schedule_pay=schedule_pay)
@@ -401,9 +364,6 @@ class TestUsNCPayslip(TestUsPayslip):
self.assertEqual(contract.schedule_pay, 'weekly')
# tax rates
nc_unemp = contract.nc_unemp_rate(2018) / -100.0
self._log('2018 North Carolina tax first payslip weekly:')
payslip = self._createPayslip(employee, '2018-01-01', '2018-01-31')
@@ -411,8 +371,8 @@ class TestUsNCPayslip(TestUsPayslip):
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['NC_UNEMP_WAGES'], salary)
self.assertPayrollEqual(cats['NC_UNEMP'], cats['NC_UNEMP_WAGES'] * nc_unemp)
self.assertPayrollEqual(cats['NC_INC_WITHHOLD'], wh)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], salary)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], cats['WAGE_US_NC_UNEMP'] * self.NC_UNEMP)
self.assertPayrollEqual(cats['EE_US_NC_INC_WITHHOLD'], wh)
process_payslip(payslip)

View File

@@ -0,0 +1,379 @@
from odoo.addons.l10n_us_hr_payroll.tests.test_us_payslip import TestUsPayslip, process_payslip
from odoo.addons.l10n_us_hr_payroll.models.l10n_us_hr_payroll import USHrContract
class TestUsNCPayslip(TestUsPayslip):
###
# Taxes and Rates
###
NC_UNEMP_MAX_WAGE = 24300.0
NC_UNEMP = -1.0 / 100.0
NC_INC_TAX = -0.0535
def test_2019_taxes_weekly(self):
salary = 5000.0
schedule_pay = 'weekly'
# allowance_multiplier and Portion of Standard Deduction for weekly
allowance_multiplier = 48.08
PST = 192.31
exemption = 1
# Algorithm derived from percentage method in https://files.nc.gov/ncdor/documents/files/nc-30_book_web.pdf
wh = -round((salary - (PST + (allowance_multiplier * exemption))) * -self.NC_INC_TAX)
employee = self._createEmployee()
contract = self._createContract(employee, salary, struct_id=self.ref('l10n_us_nc_hr_payroll.hr_payroll_salary_structure_us_nc_employee'), schedule_pay=schedule_pay)
contract.nc_nc4_allowances = exemption
self.assertEqual(contract.schedule_pay, 'weekly')
self._log('2019 North Carolina tax first payslip weekly:')
payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], salary)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], cats['WAGE_US_NC_UNEMP'] * self.NC_UNEMP)
self.assertPayrollEqual(cats['EE_US_NC_INC_WITHHOLD'], wh)
process_payslip(payslip)
# Make a new payslip, this one will have maximums
remaining_NC_UNEMP_wages = self.NC_UNEMP_MAX_WAGE - salary if (self.NC_UNEMP_MAX_WAGE - 2*salary < salary) \
else salary
self._log('2019 North Carolina tax second payslip weekly:')
payslip = self._createPayslip(employee, '2019-02-01', '2019-02-28')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], remaining_NC_UNEMP_wages)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], remaining_NC_UNEMP_wages * self.NC_UNEMP)
def test_2019_taxes_with_external_weekly(self):
salary = 5000.0
external_wages = 30000.0
schedule_pay = 'weekly'
employee = self._createEmployee()
contract = self._createContract(employee, salary, external_wages=external_wages,
struct_id=self.ref('l10n_us_nc_hr_payroll.hr_payroll_salary_structure_us_nc_employee'), schedule_pay=schedule_pay)
self._log('2019 NorthCarolina_external tax first payslip weekly:')
payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], max(self.NC_UNEMP_MAX_WAGE - external_wages, 0.0))
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], cats['WAGE_US_NC_UNEMP'] * self.NC_UNEMP)
def test_2019_taxes_with_state_exempt_weekly(self):
salary = 5000.0
external_wages = 10000.0
schedule_pay = 'weekly'
employee = self._createEmployee()
contract = self._createContract(employee, salary, external_wages=external_wages, struct_id=self.ref(
'l10n_us_nc_hr_payroll.hr_payroll_salary_structure_us_nc_employee'), futa_type=USHrContract.FUTA_TYPE_BASIC, schedule_pay=schedule_pay)
self._log('2019 North Carolina exempt tax first payslip weekly:')
payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats.get('WAGE_US_NC_UNEMP', 0.0), 0.0)
self.assertPayrollEqual(cats.get('ER_US_NC_UNEMP', 0.0), cats.get('WAGE_US_NC_UNEMP', 0.0) * self.NC_UNEMP)
def test_2019_taxes_biweekly(self):
salary = 5000.0
schedule_pay = 'bi-weekly'
# allowance_multiplier and Portion of Standard Deduction for weekly
allowance_multiplier = 96.15
PST = 384.62
allowances = 2
# Algorithm derived from percentage method in https://files.nc.gov/ncdor/documents/files/nc-30_book_web.pdf
wh = -round((salary - (PST + (allowance_multiplier * allowances))) * -self.NC_INC_TAX)
employee = self._createEmployee()
contract = self._createContract(employee, salary, struct_id=self.ref('l10n_us_nc_hr_payroll.hr_payroll_salary_structure_us_nc_employee'), schedule_pay=schedule_pay)
contract.nc_nc4_allowances = allowances
self.assertEqual(contract.schedule_pay, 'bi-weekly')
self._log('2019 North Carolina tax first payslip bi-weekly:')
payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], salary)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], cats['WAGE_US_NC_UNEMP'] * self.NC_UNEMP)
self.assertPayrollEqual(cats['EE_US_NC_INC_WITHHOLD'], wh)
process_payslip(payslip)
# Make a new payslip, this one will have maximums
remaining_NC_UNEMP_wages = self.NC_UNEMP_MAX_WAGE - salary if (self.NC_UNEMP_MAX_WAGE - 2*salary < salary) \
else salary
self._log('2019 North Carolina tax second payslip bi-weekly:')
payslip = self._createPayslip(employee, '2019-02-01', '2019-02-28')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], remaining_NC_UNEMP_wages)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], remaining_NC_UNEMP_wages * self.NC_UNEMP)
def test_2019_taxes_semimonthly(self):
salary = 4000.0
schedule_pay = 'semi-monthly'
nc_nc4_filing_status = 'head_household'
# allowance_multiplier and Portion of Standard Deduction for weekly
allowance_multiplier = 104.17
PST = 625.00
allowances = 1
# Algorithm derived from percentage method in https://files.nc.gov/ncdor/documents/files/nc-30_book_web.pdf
wh = -round((salary - (PST + (allowance_multiplier * allowances))) * -self.NC_INC_TAX)
employee = self._createEmployee()
contract = self._createContract(employee, salary, struct_id=self.ref(
'l10n_us_nc_hr_payroll.hr_payroll_salary_structure_us_nc_employee'), schedule_pay=schedule_pay)
contract.nc_nc4_allowances = allowances
contract.nc_nc4_filing_status = nc_nc4_filing_status
self.assertEqual(contract.schedule_pay, 'semi-monthly')
self._log('2019 North Carolina tax first payslip:')
payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], salary)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], cats['WAGE_US_NC_UNEMP'] * self.NC_UNEMP)
self.assertPayrollEqual(cats['EE_US_NC_INC_WITHHOLD'], wh)
process_payslip(payslip)
# Make a new payslip, this one will have maximums
remaining_NC_UNEMP_wages = self.NC_UNEMP_MAX_WAGE - salary if (self.NC_UNEMP_MAX_WAGE - 2 * salary < salary) \
else salary
self._log('2019 North Carolina tax second payslip:')
payslip = self._createPayslip(employee, '2019-02-01', '2019-02-28')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], remaining_NC_UNEMP_wages)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], remaining_NC_UNEMP_wages * self.NC_UNEMP)
def test_2019_taxes_monthly(self):
salary = 4000.0
schedule_pay = 'monthly'
# allowance_multiplier and Portion of Standard Deduction for weekly
allowance_multiplier = 208.33
PST = 833.33
allowances = 1
# Algorithm derived from percentage method in https://files.nc.gov/ncdor/documents/files/nc-30_book_web.pdf
wh = -round((salary - (PST + (allowance_multiplier * allowances))) * -self.NC_INC_TAX)
employee = self._createEmployee()
contract = self._createContract(employee, salary, struct_id=self.ref(
'l10n_us_nc_hr_payroll.hr_payroll_salary_structure_us_nc_employee'), schedule_pay=schedule_pay)
contract.nc_nc4_allowances = allowances
self.assertEqual(contract.schedule_pay, 'monthly')
self._log('2019 North Carolina tax first payslip:')
payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], salary)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], cats['WAGE_US_NC_UNEMP'] * self.NC_UNEMP)
self.assertPayrollEqual(cats['EE_US_NC_INC_WITHHOLD'], wh)
process_payslip(payslip)
# Make a new payslip, this one will have maximums
remaining_NC_UNEMP_wages = self.NC_UNEMP_MAX_WAGE - salary if (
self.NC_UNEMP_MAX_WAGE - 2 * salary < salary) \
else salary
self._log('2019 North Carolina tax second payslip:')
payslip = self._createPayslip(employee, '2019-02-01', '2019-02-28')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], remaining_NC_UNEMP_wages)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], remaining_NC_UNEMP_wages * self.NC_UNEMP)
def test_tax_exempt(self):
salary = 4000.0
wh = 0
schedule_pay = 'weekly'
excemptions = 1
employee = self._createEmployee()
contract = self._createContract(employee, salary, struct_id=self.ref(
'l10n_us_nc_hr_payroll.hr_payroll_salary_structure_us_nc_employee'), schedule_pay=schedule_pay)
contract.nc_nc4_allowances = excemptions
contract.nc_nc4_filing_status = 'exempt'
self.assertEqual(contract.schedule_pay, 'weekly')
self._log('2019 North Carolina tax first payslip:')
payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], salary)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], cats['WAGE_US_NC_UNEMP'] * self.NC_UNEMP)
self.assertPayrollEqual(cats['EE_US_NC_INC_WITHHOLD'], wh)
process_payslip(payslip)
# Make a new payslip, this one will have maximums
remaining_NC_UNEMP_wages = self.NC_UNEMP_MAX_WAGE - salary if (
self.NC_UNEMP_MAX_WAGE - 2 * salary < salary) \
else salary
self._log('2019 North Carolina tax second payslip:')
payslip = self._createPayslip(employee, '2019-02-01', '2019-02-28')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], remaining_NC_UNEMP_wages)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], remaining_NC_UNEMP_wages * self.NC_UNEMP)
def test_additional_withholding(self):
salary = 4000.0
schedule_pay = 'weekly'
# allowance_multiplier and Portion of Standard Deduction for weekly
allowance_multiplier = 48.08
PST = 192.31
additional_wh = 40.0
#4000 - (168.27 + (48.08 * 1)
allowances = 1
# Algorithm derived from percentage method in https://files.nc.gov/ncdor/documents/files/nc-30_book_web.pdf
wh = -round(((salary - (PST + (allowance_multiplier * allowances))) * -self.NC_INC_TAX) + additional_wh)
employee = self._createEmployee()
contract = self._createContract(employee,
salary,
struct_id=self.ref('l10n_us_nc_hr_payroll.hr_payroll_salary_structure_us_nc_employee'),
schedule_pay=schedule_pay)
contract.w4_is_nonresident_alien = True
contract.nc_nc4_additional_wh = additional_wh
contract.nc_nc4_allowances = allowances
self.assertEqual(contract.schedule_pay, 'weekly')
self.assertEqual(contract.w4_is_nonresident_alien, True)
self._log('2019 North Carolina tax first payslip weekly:')
payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], salary)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], cats['WAGE_US_NC_UNEMP'] * self.NC_UNEMP)
self.assertPayrollEqual(cats['EE_US_NC_INC_WITHHOLD'], wh)
process_payslip(payslip)
# Make a new payslip, this one will have maximums
remaining_NC_UNEMP_wages = self.NC_UNEMP_MAX_WAGE - salary if (self.NC_UNEMP_MAX_WAGE - 2 * salary < salary) \
else salary
self._log('2019 North Carolina tax second payslip weekly:')
payslip = self._createPayslip(employee, '2019-02-01', '2019-02-28')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], remaining_NC_UNEMP_wages)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], remaining_NC_UNEMP_wages * self.NC_UNEMP)
def test_underflow(self):
salary = 150.0
schedule_pay = 'weekly'
# allowance_multiplier and Portion of Standard Deduction for weekly
allowance_multiplier = 48.08
PST = 192.31
exemption = 1
# Withholding should be 0, since pay is so low it's less than PST.
wh = 0.0
employee = self._createEmployee()
contract = self._createContract(employee, salary, struct_id=self.ref(
'l10n_us_nc_hr_payroll.hr_payroll_salary_structure_us_nc_employee'), schedule_pay=schedule_pay)
contract.nc_nc4_allowances = exemption
self.assertEqual(contract.schedule_pay, 'weekly')
self._log('2019 North Carolina tax first payslip weekly:')
payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['WAGE_US_NC_UNEMP'], salary)
self.assertPayrollEqual(cats['ER_US_NC_UNEMP'], cats['WAGE_US_NC_UNEMP'] * self.NC_UNEMP)
self.assertPayrollEqual(cats['EE_US_NC_INC_WITHHOLD'], wh)
process_payslip(payslip)

View File

@@ -1,19 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="us_nc_view_company_form" model="ir.ui.view">
<field name="name">res.company.form</field>
<field name="model">res.company</field>
<field name="priority">64</field>
<field name="inherit_id" ref="base.view_company_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='currency_id']" position="after">
<field name="nc_unemp_rate_2018"/>
</xpath>
</data>
</field>
</record>
<record id="hr_contract_form_l10n_us_nc_inherit" model="ir.ui.view">
<field name="name">hr.contract.form.inherit</field>
<field name="model">hr.contract</field>