mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
MI Michigan
This commit is contained in:
@@ -7,16 +7,17 @@
|
||||
<field name="country_id" ref="base.us"/>
|
||||
</record>
|
||||
<data noupdate="1">
|
||||
<record id="rule_parameter_us_mi_suta_wage_base_2019" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">9500.0</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_mi_suta_wage_base"/>
|
||||
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
|
||||
</record>
|
||||
<record id="rule_parameter_us_mi_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_mi_suta_wage_base"/>
|
||||
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||
</record>
|
||||
<!-- https://taxnews.ey.com/news/2020-2141-michigan-sui-taxable-wage-base-expected-to-increase-for-2021-due-to-covid-19s-depletion-of-ui-trust-fund#:~:text=Michigan%20employers%20should%20expect%20to,be%20used%20by%20delinquent%20employers. -->
|
||||
<record id="rule_parameter_us_mi_suta_wage_base_2021" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">9500.0</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_mi_suta_wage_base"/>
|
||||
<field name="date_from" eval="datetime(2021, 1, 1).date()"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
<!-- Rate -->
|
||||
@@ -26,11 +27,7 @@
|
||||
<field name="country_id" ref="base.us"/>
|
||||
</record>
|
||||
<data noupdate="1">
|
||||
<record id="rule_parameter_us_mi_suta_rate_2019" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">2.7</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_mi_suta_rate"/>
|
||||
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
|
||||
</record>
|
||||
<!-- same for 2021 https://www.michigan.gov/leo/0,5863,7-336-94422_97241_89981_90255-502287- -,00.html -->
|
||||
<record id="rule_parameter_us_mi_suta_rate_2020" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">2.7</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_mi_suta_rate"/>
|
||||
@@ -44,18 +41,21 @@
|
||||
<field name="country_id" ref="base.us"/>
|
||||
</record>
|
||||
<data noupdate="1">
|
||||
<record id="rule_parameter_us_mi_sit_exemption_rate_2019" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">4400.0</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_mi_sit_exemption_rate"/>
|
||||
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
|
||||
</record>
|
||||
<record id="rule_parameter_us_mi_sit_exemption_rate_2020" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">4750.0</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_mi_sit_exemption_rate"/>
|
||||
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
|
||||
</record>
|
||||
<!-- https://www.michigan.gov/documents/taxes/446_711611_7.pdf -->
|
||||
<record id="rule_parameter_us_mi_sit_exemption_rate_2021" model="hr.rule.parameter.value">
|
||||
<field name="parameter_value">4900.0</field>
|
||||
<field name="rule_parameter_id" ref="rule_parameter_us_mi_sit_exemption_rate"/>
|
||||
<field name="date_from" eval="datetime(2021, 1, 1).date()"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
<!-- todo: income tax rate https://www.michigan.gov/taxes/0,4676,7-238-43519_43531- - -,00.html -->
|
||||
|
||||
<!-- Partners and Contribution Registers -->
|
||||
<record id="res_partner_us_mi_dor" model="res.partner">
|
||||
<field name="name">US Michigan - Unemployment Insurance Agency - Unemployment Tax</field>
|
||||
|
||||
@@ -1,194 +0,0 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from .common import TestUsPayslip, process_payslip
|
||||
|
||||
|
||||
class TestUsMIPayslip(TestUsPayslip):
|
||||
# Taxes and Rates
|
||||
MI_UNEMP_MAX_WAGE = 9500.0
|
||||
MI_UNEMP = - 2.7 / 100.0
|
||||
MI_INC_TAX = - 4.25 / 100.0
|
||||
ANNUAL_EXEMPTION_AMOUNT = 4400.00
|
||||
PAY_PERIOD_DIVISOR = {
|
||||
'weekly': 52.0,
|
||||
'bi-weekly': 26.0,
|
||||
'semi-monthly': 24.0,
|
||||
'monthly': 12.0
|
||||
}
|
||||
|
||||
def test_2019_taxes_weekly(self):
|
||||
salary = 5000.0
|
||||
schedule_pay = 'weekly'
|
||||
exemptions = 1
|
||||
|
||||
employee = self._createEmployee()
|
||||
contract = self._createContract(employee,
|
||||
wage=salary,
|
||||
state_id=self.get_us_state('MI'),
|
||||
state_income_tax_additional_withholding=0.0,
|
||||
mi_w4_sit_exemptions=1.0,
|
||||
schedule_pay='weekly')
|
||||
|
||||
allowance_amount = self.ANNUAL_EXEMPTION_AMOUNT / self.PAY_PERIOD_DIVISOR[schedule_pay]
|
||||
wh = -((salary - (allowance_amount * exemptions)) * -self.MI_INC_TAX)
|
||||
|
||||
self._log('2019 Michigan 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.MI_UNEMP)
|
||||
self.assertPayrollAlmostEqual(cats['EE_US_SIT'], wh)
|
||||
#
|
||||
process_payslip(payslip)
|
||||
|
||||
# Make a new payslip, this one will have maximums
|
||||
remaining_MI_UNEMP_wages = self.MI_UNEMP_MAX_WAGE - salary if (self.MI_UNEMP_MAX_WAGE - 2*salary < salary) \
|
||||
else salary
|
||||
|
||||
self._log('2019 Michigan 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_MI_UNEMP_wages * self.MI_UNEMP)
|
||||
|
||||
def test_2019_taxes_biweekly(self):
|
||||
salary = 5000.0
|
||||
schedule_pay = 'bi-weekly'
|
||||
allowance_amount = self.ANNUAL_EXEMPTION_AMOUNT / self.PAY_PERIOD_DIVISOR[schedule_pay]
|
||||
exemption = 2
|
||||
|
||||
wh = -((salary - (allowance_amount * exemption)) * -self.MI_INC_TAX)
|
||||
|
||||
employee = self._createEmployee()
|
||||
contract = self._createContract(employee,
|
||||
wage=salary,
|
||||
state_id=self.get_us_state('MI'),
|
||||
state_income_tax_additional_withholding=0.0,
|
||||
mi_w4_sit_exemptions=2.0,
|
||||
schedule_pay='bi-weekly')
|
||||
|
||||
self._log('2019 Michigan 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.MI_UNEMP)
|
||||
self.assertPayrollEqual(cats['EE_US_SIT'], wh)
|
||||
|
||||
process_payslip(payslip)
|
||||
|
||||
# Make a new payslip, this one will have maximums
|
||||
remaining_MI_UNEMP_wages = self.MI_UNEMP_MAX_WAGE - salary if (self.MI_UNEMP_MAX_WAGE - 2*salary < salary) \
|
||||
else salary
|
||||
|
||||
self._log('2019 Michigan 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_MI_UNEMP_wages * self.MI_UNEMP)
|
||||
|
||||
def test_2019_taxes_semimonthly(self):
|
||||
salary = 5000.0
|
||||
schedule_pay = 'semi-monthly'
|
||||
allowance_amount = self.ANNUAL_EXEMPTION_AMOUNT / self.PAY_PERIOD_DIVISOR[schedule_pay]
|
||||
exemption = 1
|
||||
|
||||
wh = -((salary - (allowance_amount * exemption)) * -self.MI_INC_TAX)
|
||||
|
||||
employee = self._createEmployee()
|
||||
contract = self._createContract(employee,
|
||||
wage=salary,
|
||||
state_id=self.get_us_state('MI'),
|
||||
state_income_tax_additional_withholding=0.0,
|
||||
mi_w4_sit_exemptions=1.0,
|
||||
schedule_pay='semi-monthly')
|
||||
|
||||
self._log('2019 Michigan tax first payslip semi-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.MI_UNEMP)
|
||||
self.assertPayrollEqual(cats['EE_US_SIT'], wh)
|
||||
|
||||
process_payslip(payslip)
|
||||
|
||||
# Make a new payslip, this one will have maximums
|
||||
remaining_MI_UNEMP_wages = self.MI_UNEMP_MAX_WAGE - salary if (self.MI_UNEMP_MAX_WAGE - 2 * salary < salary) \
|
||||
else salary
|
||||
|
||||
self._log('2019 Michigan tax second payslip semi-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_MI_UNEMP_wages * self.MI_UNEMP)
|
||||
|
||||
def test_2019_taxes_monthly(self):
|
||||
salary = 5000.0
|
||||
schedule_pay = 'monthly'
|
||||
allowance_amount = self.ANNUAL_EXEMPTION_AMOUNT / self.PAY_PERIOD_DIVISOR[schedule_pay]
|
||||
exemption = 1
|
||||
|
||||
wh = -((salary - (allowance_amount * exemption)) * -self.MI_INC_TAX)
|
||||
|
||||
employee = self._createEmployee()
|
||||
contract = self._createContract(employee,
|
||||
wage=salary,
|
||||
state_id=self.get_us_state('MI'),
|
||||
state_income_tax_additional_withholding=0.0,
|
||||
mi_w4_sit_exemptions=1.0,
|
||||
schedule_pay='monthly')
|
||||
|
||||
self._log('2019 Michigan 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.MI_UNEMP)
|
||||
self.assertPayrollEqual(cats['EE_US_SIT'], wh)
|
||||
|
||||
process_payslip(payslip)
|
||||
|
||||
# Make a new payslip, this one will have maximums
|
||||
remaining_MI_UNEMP_wages = self.MI_UNEMP_MAX_WAGE - salary if (
|
||||
self.MI_UNEMP_MAX_WAGE - (2 * salary) < salary) \
|
||||
else salary
|
||||
|
||||
self._log('2019 Michigan 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_MI_UNEMP_wages * self.MI_UNEMP)
|
||||
|
||||
def test_additional_withholding(self):
|
||||
salary = 5000.0
|
||||
schedule_pay = 'weekly'
|
||||
allowance_amount = 0.0
|
||||
allowance_amount = self.ANNUAL_EXEMPTION_AMOUNT / self.PAY_PERIOD_DIVISOR[schedule_pay]
|
||||
additional_wh = 40.0
|
||||
exemption = 1
|
||||
|
||||
wh = -(((salary - (allowance_amount * exemption)) * -self.MI_INC_TAX) + additional_wh)
|
||||
|
||||
employee = self._createEmployee()
|
||||
contract = self._createContract(employee,
|
||||
wage=salary,
|
||||
state_id=self.get_us_state('MI'),
|
||||
state_income_tax_additional_withholding=40.0,
|
||||
mi_w4_sit_exemptions=1.0,
|
||||
schedule_pay='weekly')
|
||||
|
||||
self._log('2019 Michigan tax first payslip with additional withholding:')
|
||||
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.MI_UNEMP)
|
||||
self.assertPayrollAlmostEqual(cats['EE_US_SIT'], wh)
|
||||
|
||||
process_payslip(payslip)
|
||||
35
l10n_us_hr_payroll/tests/test_us_mi_michigan_payslip_2021.py
Executable file
35
l10n_us_hr_payroll/tests/test_us_mi_michigan_payslip_2021.py
Executable 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 TestUsMIPayslip(TestUsPayslip):
|
||||
# Taxes and Rates
|
||||
MI_UNEMP_MAX_WAGE = 9500.0
|
||||
MI_UNEMP = 2.7
|
||||
|
||||
def _test_sit(self, wage, exemptions, additional_withholding, schedule_pay, date_start, expected_withholding):
|
||||
|
||||
employee = self._createEmployee()
|
||||
contract = self._createContract(employee,
|
||||
wage=wage,
|
||||
state_id=self.get_us_state('MI'),
|
||||
mi_w4_sit_exemptions=exemptions,
|
||||
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)
|
||||
|
||||
def test_2021_taxes_example(self):
|
||||
self._test_er_suta('MI', self.MI_UNEMP, date(2021, 1, 1), wage_base=self.MI_UNEMP_MAX_WAGE)
|
||||
self._test_sit(750.0, 1, 100.0, 'weekly', date(2021, 1, 1), 127.87)
|
||||
self._test_sit(1750.0, 1, 0.0, 'bi-weekly', date(2021, 1, 1), 66.37)
|
||||
self._test_sit(5000.0, 1, 5.0, 'semi-monthly', date(2021, 1, 1), 208.83)
|
||||
self._test_sit(8000.0, 1, 5.0, 'monthly', date(2021, 1, 1), 327.65)
|
||||
self._test_sit(5000.0, 2, 0.0, 'monthly', date(2021, 1, 1), 177.79)
|
||||
|
||||
Reference in New Issue
Block a user