This commit is contained in:
Jared Self
2021-01-21 10:09:47 -07:00
parent a2970d9b67
commit 7da4d616f5
3 changed files with 43 additions and 268 deletions

View File

@@ -7,16 +7,16 @@
<field name="country_id" ref="base.us"/>
</record>
<data noupdate="1">
<record id="rule_parameter_us_id_suta_wage_base_2019" model="hr.rule.parameter.value">
<field name="parameter_value">40000.0</field>
<field name="rule_parameter_id" ref="rule_parameter_us_id_suta_wage_base"/>
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
</record>
<record id="rule_parameter_us_id_suta_wage_base_2020" model="hr.rule.parameter.value">
<field name="parameter_value">41600.0</field>
<field name="rule_parameter_id" ref="rule_parameter_us_id_suta_wage_base"/>
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
</record>
<record id="rule_parameter_us_id_suta_wage_base_2021" model="hr.rule.parameter.value">
<field name="parameter_value">43000.0</field>
<field name="rule_parameter_id" ref="rule_parameter_us_id_suta_wage_base"/>
<field name="date_from" eval="datetime(2021, 1, 1).date()"/>
</record>
</data>
<!-- Rate -->
@@ -26,11 +26,7 @@
<field name="country_id" ref="base.us"/>
</record>
<data noupdate="1">
<record id="rule_parameter_us_id_suta_rate_2019" model="hr.rule.parameter.value">
<field name="parameter_value">1.0</field>
<field name="rule_parameter_id" ref="rule_parameter_us_id_suta_rate"/>
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
</record>
<!-- Unchanged in 2021 https://www.labor.idaho.gov/dnn/Businesses/Unemployment-Tax-Rates-->
<record id="rule_parameter_us_id_suta_rate_2020" model="hr.rule.parameter.value">
<field name="parameter_value">1.0</field>
<field name="rule_parameter_id" ref="rule_parameter_us_id_suta_rate"/>
@@ -44,170 +40,9 @@
<field name="country_id" ref="base.us"/>
</record>
<data noupdate="1">
<record id="rule_parameter_us_id_sit_tax_rate_2019" model="hr.rule.parameter.value">
<field name="parameter_value">{
'single': {
'weekly': (
( 235, 0.00, 0.000),
( 264, 0.00, 1.125),
( 294, 0.00, 3.125),
( 324, 1.00, 3.625),
( 353, 2.00, 4.625),
( 383, 4.00, 5.625),
( 457, 5.00, 6.625),
('inf', 10.00, 6.925),
),
'bi-weekly': (
( 469, 0.00, 0.000),
( 529, 0.00, 1.125),
( 588, 1.00, 3.125),
( 647, 3.00, 3.625),
( 706, 5.00, 4.625),
( 766, 7.00, 5.625),
( 914, 11.00, 6.625),
('inf', 21.00, 6.925),
),
'semi-monthly': (
( 508, 0.00, 0.000),
( 573, 0.00, 1.125),
( 637, 1.00, 3.125),
( 701, 3.00, 3.625),
( 765, 5.00, 4.625),
( 829, 8.00, 5.625),
( 990, 12.00, 6.625),
('inf', 22.00, 6.925),
),
'monthly': (
( 1017, 0.00, 0.000),
( 1145, 0.00, 1.125),
( 1273, 1.00, 3.125),
( 1402, 5.00, 3.625),
( 1530, 10.00, 4.625),
( 1659, 16.00, 5.625),
( 1980, 23.00, 6.625),
('inf', 45.00, 6.925),
),
'annually': (
(12200, 0.00, 0.000),
(13741, 0.00, 1.125),
(15281, 17.00, 3.125),
(16822, 65.00, 3.625),
(18362, 121.00, 4.625),
(19903, 192.00, 5.625),
(23754, 279.00, 6.625),
('inf', 534.00, 6.925),
),
},
'married': {
'weekly': (
( 469, 0.00, 0.000),
( 529, 0.00, 1.125),
( 588, 0.00, 3.125),
( 647, 1.00, 3.625),
( 706, 2.00, 4.625),
( 766, 4.00, 5.625),
( 914, 5.00, 6.625),
('inf', 10.00, 6.925),
),
'bi-weekly': (
( 938, 0.00, 0.000),
( 1057, 0.00, 1.125),
( 1175, 1.00, 3.125),
( 1294, 5.00, 3.625),
( 1412, 9.00, 4.625),
( 1531, 15.00, 5.625),
( 1827, 21.00, 6.625),
('inf', 41.00, 6.925),
),
'semi-monthly': (
( 1017, 0.00, 0.000),
( 1145, 0.00, 1.125),
( 1273, 1.00, 3.125),
( 1402, 5.00, 3.625),
( 1530, 10.00, 4.625),
( 1659, 16.00, 5.625),
( 1980, 23.00, 6.625),
('inf', 45.00, 6.925),
),
'monthly': (
( 2033, 0.00, 0.000),
( 2290, 0.00, 1.125),
( 2547, 3.00, 3.125),
( 2804, 11.00, 3.625),
( 3060, 20.00, 4.625),
( 3317, 32.00, 5.625),
( 3959, 47.00, 6.625),
('inf', 89.00, 6.925),
),
'annually': (
(24400, 0.00, 0.000),
(27482, 0.00, 1.125),
(30562, 35.00, 3.125),
(33644, 131.00, 3.625),
(36724, 243.00, 4.625),
(39806, 385.00, 5.625),
(47508, 558.00, 6.625),
('inf', 1068.00, 6.925),
),
},
'head of household': {
'weekly': (
( 235, 0.00, 0.000),
( 264, 0.00, 1.125),
( 294, 0.00, 3.125),
( 324, 1.00, 3.625),
( 353, 2.00, 4.625),
( 383, 4.00, 5.625),
( 457, 5.00, 6.625),
('inf', 10.00, 6.925),
),
'bi-weekly': (
( 469, 0.00, 0.000),
( 529, 0.00, 1.125),
( 588, 1.00, 3.125),
( 647, 3.00, 3.625),
( 706, 5.00, 4.625),
( 766, 7.00, 5.625),
( 914, 11.00, 6.625),
('inf', 21.00, 6.925),
),
'semi-monthly': (
( 508, 0.00, 0.000),
( 573, 0.00, 1.125),
( 637, 1.00, 3.125),
( 701, 3.00, 3.625),
( 765, 5.00, 4.625),
( 829, 8.00, 5.625),
( 990, 12.00, 6.625),
('inf', 22.00, 6.925),
),
'monthly': (
( 1017, 0.00, 0.000),
( 1145, 0.00, 1.125),
( 1273, 1.00, 3.125),
( 1402, 5.00, 3.625),
( 1530, 10.00, 4.625),
( 1659, 16.00, 5.625),
( 1980, 23.00, 6.625),
('inf', 45.00, 6.925),
),
'annually': (
(12200, 0.00, 0.000),
(13741, 0.00, 1.125),
(15281, 17.00, 3.125),
(16822, 65.00, 3.625),
(18362, 121.00, 4.625),
(19903, 192.00, 5.625),
(23754, 279.00, 6.625),
('inf', 534.00, 6.925),
),
},
}</field>
<field name="rule_parameter_id" ref="rule_parameter_us_id_sit_tax_rate"/>
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
</record>
<!-- https://tax.idaho.gov/pubs/EPB00744_06-16-2020.pdf -->
<!-- Page 1 to 3 -->
<!-- Unchanged in 2021 -->
<record id="rule_parameter_us_id_sit_tax_rate_2020" model="hr.rule.parameter.value">
<field name="parameter_value">{
'single': {
@@ -378,19 +213,9 @@
<field name="country_id" ref="base.us"/>
</record>
<data noupdate="1">
<record id="rule_parameter_us_id_sit_ictcat_rate_2019" model="hr.rule.parameter.value">
<field name="parameter_value">{
'weekly': 56.92,
'bi-weekly': 113.85,
'semi-monthly': 123.33,
'monthly': 246.67,
'annually': 2960.00,
}</field>
<field name="rule_parameter_id" ref="rule_parameter_us_id_sit_ictcat_rate"/>
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
</record>
<!-- https://tax.idaho.gov/i-1026.cfm?seg=compute -->
<!-- Idaho Child Tax Credit Allowances Table -->
<!-- Unchanged in 2021 -->
<record id="rule_parameter_us_id_sit_ictcat_rate_2020" model="hr.rule.parameter.value">
<field name="parameter_value">{
'weekly': 56.92,

View File

@@ -1,85 +0,0 @@
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
from .common import TestUsPayslip, process_payslip
class TestUsIDPayslip(TestUsPayslip):
# TAXES AND RATES
ID_UNEMP_MAX_WAGE = 40000.00
ID_UNEMP = -(1.00 / 100.0)
def test_taxes_single_biweekly(self):
salary = 1212.00
schedule_pay = 'bi-weekly'
filing_status = 'single'
allowances = 4
# SEE https://tax.idaho.gov/i-1026.cfm?seg=compute for example calculations
wh_to_check = -10.00
employee = self._createEmployee()
contract = self._createContract(employee,
wage=salary,
state_id=self.get_us_state('ID'),
id_w4_sit_filing_status=filing_status,
id_w4_sit_allowances=allowances,
schedule_pay=schedule_pay)
self._log('2019 Idaho tax first payslip single:')
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.ID_UNEMP)
self.assertPayrollEqual(cats['EE_US_SIT'], wh_to_check)
process_payslip(payslip)
remaining_id_unemp_wages = self.ID_UNEMP_MAX_WAGE - salary if (self.ID_UNEMP_MAX_WAGE - 2*salary < salary) \
else salary
self._log('2019 Idaho tax second payslip single:')
payslip = self._createPayslip(employee, '2019-02-01', '2019-02-28')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['ER_US_SUTA'], remaining_id_unemp_wages * self.ID_UNEMP)
def test_taxes_married_monthly(self):
salary = 5000.00
schedule_pay = 'monthly'
filing_status = 'married'
allowances = 2
# ICTCAT says monthly allowances are 246.67
# we have 2 so 246.67 * 2 = 493.34
# 5000.00 - 493.34 = 4506.66
# Wh is 89$ plus 6.925% over 3959,00
# 126.92545499999999 - > 127.0
wh_to_check = -127.0
employee = self._createEmployee()
contract = self._createContract(employee,
wage=salary,
state_id=self.get_us_state('ID'),
id_w4_sit_filing_status=filing_status,
id_w4_sit_allowances=allowances,
schedule_pay=schedule_pay)
self._log('2019 Idaho tax first payslip monthly:')
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.ID_UNEMP)
self.assertPayrollEqual(cats['EE_US_SIT'], wh_to_check)
process_payslip(payslip)
remaining_id_unemp_wages = self.ID_UNEMP_MAX_WAGE - salary if (self.ID_UNEMP_MAX_WAGE - 2*salary < salary) \
else salary
self._log('2019 Idaho tax second payslip monthly:')
payslip = self._createPayslip(employee, '2019-02-01', '2019-02-28')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats['ER_US_SUTA'], remaining_id_unemp_wages * self.ID_UNEMP)

View File

@@ -0,0 +1,35 @@
# 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 TestUsIDPayslip(TestUsPayslip):
###
# 2021 Taxes and Rates
###
ID_UNEMP_MAX_WAGE = 43000.00
ID_UNEMP = 1.0
def _test_sit(self, wage, filing_status, allowances, schedule_pay, date_start, expected_withholding):
employee = self._createEmployee()
contract = self._createContract(employee,
wage=wage,
state_id=self.get_us_state('ID'),
id_w4_sit_filing_status=filing_status,
id_w4_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_2021_taxes_example(self):
self._test_er_suta('ID', self.ID_UNEMP, date(2021, 1, 1), wage_base=self.ID_UNEMP_MAX_WAGE)
self._test_sit(1212.0, 'single', 4.0, 'bi-weekly', date(2021, 1, 1), 10.0)
self._test_sit(10000.0, 'married', 1.0, 'annually', date(2021, 1, 1), 0.0)
self._test_sit(52000.0, 'married', 4.0, 'monthly', date(2021, 1, 1), 3345.0)
self._test_sit(5000.0, 'head of household', 0.0, 'semi-monthly', date(2021, 1, 1), 300.0)
self._test_sit(5900.0, 'single', 5.0, 'weekly', date(2021, 1, 1), 367.0)