mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
nc north carolina
This commit is contained in:
@@ -1,41 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<!-- Wage Base -->
|
||||
<!-- https://des.nc.gov/employers/tax-rate-information-->
|
||||
<record id="rule_parameter_us_nc_suta_wage_base" model="hr.rule.parameter">
|
||||
<field name="name">US NC North Carolina SUTA Wage Base</field>
|
||||
<field name="code">us_nc_suta_wage_base</field>
|
||||
<field name="country_id" ref="base.us"/>
|
||||
</record>
|
||||
<data noupdate="1">
|
||||
<record id="rule_parameter_us_nc_suta_wage_base_2019" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">24300.0</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_nc_suta_wage_base"/>
|
||||
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
|
||||
</record>
|
||||
<record id="rule_parameter_us_nc_suta_wage_base_2020" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">25200.0</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_nc_suta_wage_base"/>
|
||||
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||
</record>
|
||||
<record id="rule_parameter_us_nc_suta_wage_base_2021" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">26000.0</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_nc_suta_wage_base"/>
|
||||
<field name="date_from" eval="datetime(2021, 1, 1).date()"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
<!-- Rate -->
|
||||
<!-- https://des.nc.gov/employers/tax-rate-information-->
|
||||
<record id="rule_parameter_us_nc_suta_rate" model="hr.rule.parameter">
|
||||
<field name="name">US NC North Carolina SUTA Rate</field>
|
||||
<field name="code">us_nc_suta_rate</field>
|
||||
<field name="country_id" ref="base.us"/>
|
||||
</record>
|
||||
<data noupdate="1">
|
||||
<record id="rule_parameter_us_nc_suta_rate_2019" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">1.0</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_nc_suta_rate"/>
|
||||
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
|
||||
</record>
|
||||
<record id="rule_parameter_us_nc_suta_rate_2020" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">1.0</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_nc_suta_rate"/>
|
||||
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||
</record>
|
||||
<record id="rule_parameter_us_nc_suta_rate_2021" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">1.0</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_nc_suta_rate"/>
|
||||
<field name="date_from" eval="datetime(2021, 1, 1).date()"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
<record id="rule_parameter_us_nc_sit_allowance_rate" model="hr.rule.parameter">
|
||||
@@ -44,18 +46,6 @@
|
||||
<field name="country_id" ref="base.us"/>
|
||||
</record>
|
||||
<data noupdate="1">
|
||||
<!-- https://files.nc.gov/ncdor/documents/files/NC-30_book_Web_1-16-19_v4_Final.pdf -->
|
||||
<!-- Allowance Table Page 19. + SD For single or married + SD for Head of household (SD Page. 16-18)-->
|
||||
<record id="rule_parameter_us_nc_sit_allowance_rate_2019" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">{
|
||||
'weekly': {'allowance': 48.08, 'standard_deduction': 192.31, 'standard_deduction_hh': 288.46},
|
||||
'bi-weekly': {'allowance': 96.15, 'standard_deduction': 384.62, 'standard_deduction_hh': 576.92},
|
||||
'semi-monthly': {'allowance': 104.17, 'standard_deduction': 416.67, 'standard_deduction_hh': 625.00},
|
||||
'monthly': {'allowance': 208.33, 'standard_deduction': 833.33, 'standard_deduction_hh': 1250.00},
|
||||
}</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_nc_sit_allowance_rate"/>
|
||||
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
|
||||
</record>
|
||||
<!-- https://files.nc.gov/ncdor/documents/files/2020-NC-30_Final.pdf -->
|
||||
<!-- Allowance Table Page 19. + SD For single or married + SD for Head of household (SD Page. 16-18)-->
|
||||
<record id="rule_parameter_us_nc_sit_allowance_rate_2020" model="hr.rule.parameter.value">
|
||||
@@ -68,6 +58,20 @@
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_nc_sit_allowance_rate"/>
|
||||
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||
</record>
|
||||
<!-- https://files.nc.gov/ncdor/documents/files/2021-NC-30-Final.pdf -->
|
||||
<!-- 'allowance': Get from Withholding Allowance Chart Page 19. -->
|
||||
<!-- 'standard_deduction': Get from 'Percentage Method - Formula Tables' line 2 SD For single or married (Page. 16-18)-->
|
||||
<!-- 'standard_deduction_hh': Also get from 'Percentage Method - Formula Tables' line 2 (SD Page. 16-18)-->
|
||||
<record id="rule_parameter_us_nc_sit_allowance_rate_2021" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">{
|
||||
'weekly': {'allowance': 48.08, 'standard_deduction': 206.73, 'standard_deduction_hh': 310.10},
|
||||
'bi-weekly': {'allowance': 96.15, 'standard_deduction': 413.46, 'standard_deduction_hh': 620.19},
|
||||
'semi-monthly': {'allowance': 104.17, 'standard_deduction': 447.92, 'standard_deduction_hh': 671.88},
|
||||
'monthly': {'allowance': 208.33, 'standard_deduction': 895.83, 'standard_deduction_hh': 1343.75},
|
||||
}</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_nc_sit_allowance_rate"/>
|
||||
<field name="date_from" eval="datetime(2021, 1, 1).date()"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
<!-- Partners and Contribution Registers -->
|
||||
|
||||
@@ -1,270 +0,0 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from .common import TestUsPayslip, process_payslip
|
||||
|
||||
|
||||
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 = 20000.0
|
||||
# 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,
|
||||
wage=salary,
|
||||
state_id=self.get_us_state('NC'),
|
||||
nc_nc4_sit_filing_status='married',
|
||||
state_income_tax_additional_withholding=0.0,
|
||||
nc_nc4_sit_allowances=1.0,
|
||||
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['EE_US_SIT'], 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['ER_US_SUTA'], remaining_NC_UNEMP_wages * self.NC_UNEMP)
|
||||
|
||||
def test_2019_taxes_with_external_weekly(self):
|
||||
salary = 5000.0
|
||||
schedule_pay = 'weekly'
|
||||
|
||||
employee = self._createEmployee()
|
||||
|
||||
contract = self._createContract(employee,
|
||||
wage=salary,
|
||||
state_id=self.get_us_state('NC'),
|
||||
nc_nc4_sit_filing_status='married',
|
||||
state_income_tax_additional_withholding=0.0,
|
||||
nc_nc4_sit_allowances=1.0,
|
||||
schedule_pay='weekly')
|
||||
|
||||
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['ER_US_SUTA'], salary * 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,
|
||||
wage=salary,
|
||||
state_id=self.get_us_state('NC'),
|
||||
nc_nc4_sit_filing_status='married',
|
||||
state_income_tax_additional_withholding=0.0,
|
||||
nc_nc4_sit_allowances=2.0,
|
||||
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['ER_US_SUTA'], salary * self.NC_UNEMP)
|
||||
self.assertPayrollEqual(cats['EE_US_SIT'], 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['ER_US_SUTA'], remaining_NC_UNEMP_wages * self.NC_UNEMP)
|
||||
|
||||
def test_2019_taxes_semimonthly(self):
|
||||
salary = 4000.0
|
||||
# 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,
|
||||
wage=salary,
|
||||
state_id=self.get_us_state('NC'),
|
||||
nc_nc4_sit_filing_status='head_household',
|
||||
state_income_tax_additional_withholding=0.0,
|
||||
nc_nc4_sit_allowances=1.0,
|
||||
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['ER_US_SUTA'], salary * self.NC_UNEMP)
|
||||
self.assertPayrollEqual(cats['EE_US_SIT'], 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['ER_US_SUTA'], 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,
|
||||
wage=salary,
|
||||
state_id=self.get_us_state('NC'),
|
||||
nc_nc4_sit_filing_status='single',
|
||||
state_income_tax_additional_withholding=0.0,
|
||||
nc_nc4_sit_allowances=1.0,
|
||||
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['ER_US_SUTA'], salary * self.NC_UNEMP)
|
||||
self.assertPayrollEqual(cats['EE_US_SIT'], 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['ER_US_SUTA'], remaining_NC_UNEMP_wages * self.NC_UNEMP)
|
||||
|
||||
def test_additional_withholding(self):
|
||||
salary = 4000.0
|
||||
# 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,
|
||||
wage=salary,
|
||||
state_id=self.get_us_state('NC'),
|
||||
nc_nc4_sit_filing_status='married',
|
||||
state_income_tax_additional_withholding=40.0,
|
||||
nc_nc4_sit_allowances=1.0,
|
||||
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['EE_US_SIT'], 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['ER_US_SUTA'], remaining_NC_UNEMP_wages * self.NC_UNEMP)
|
||||
39
l10n_us_hr_payroll/tests/test_us_nc_northcarolina_payslip_2021.py
Executable file
39
l10n_us_hr_payroll/tests/test_us_nc_northcarolina_payslip_2021.py
Executable file
@@ -0,0 +1,39 @@
|
||||
# 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 TestUsNCPayslip(TestUsPayslip):
|
||||
###
|
||||
# 2021 Taxes and Rates
|
||||
###
|
||||
# Example based on https://files.nc.gov/ncdor/documents/files/2021-NC-30-Final.pdf page 19
|
||||
NC_UNEMP_MAX_WAGE = 26000.0
|
||||
NC_UNEMP = 1.0
|
||||
# get NC_INC_TAX from 'Annualized Tax" line 8 in the example on page 19
|
||||
NC_INC_TAX = 0.0535
|
||||
|
||||
def _test_sit(self, wage, filing_status, allowances, additional_withholding, schedule_pay, date_start, expected_withholding):
|
||||
|
||||
employee = self._createEmployee()
|
||||
contract = self._createContract(employee,
|
||||
wage=wage,
|
||||
state_id=self.get_us_state('NC'),
|
||||
nc_nc4_sit_filing_status=filing_status,
|
||||
nc_nc4_sit_allowances=allowances,
|
||||
state_income_tax_additional_withholding=additional_withholding,
|
||||
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 if filing_status else 0.0)
|
||||
|
||||
def test_2021_taxes_example(self):
|
||||
self._test_er_suta('NC', self.NC_UNEMP, date(2021, 1, 1), wage_base=self.NC_UNEMP_MAX_WAGE)
|
||||
self._test_sit(20000.0, 'single', 1, 100.0, 'weekly', date(2021, 1, 1), 1156.0)
|
||||
self._test_sit(5000.0, 'married', 1, 0.0, 'weekly', date(2021, 1, 1), 254.0)
|
||||
self._test_sit(4000.0, 'head_household', 1, 5.0, 'semi-monthly', date(2021, 1, 1), 177.0)
|
||||
self._test_sit(7000.0, '', 1, 5.0, 'monthly', date(2021, 1, 1), 0.0)
|
||||
Reference in New Issue
Block a user