MT Montana

This commit is contained in:
Jared Self
2021-01-07 10:40:26 -07:00
parent 55babb7b3f
commit ac222b587c
3 changed files with 43 additions and 149 deletions

View File

@@ -1,22 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- Wage Base -->
<!--2021 change: http://dli.mt.gov/news/225#:~:text=The%20Montana%20Department%20of%20Labor,MCA%2039%2D51%2D1108. -->
<record id="rule_parameter_us_mt_suta_wage_base" model="hr.rule.parameter">
<field name="name">US MT Montana SUTA Wage Base</field>
<field name="code">us_mt_suta_wage_base</field>
<field name="country_id" ref="base.us"/>
</record>
<data noupdate="1">
<record id="rule_parameter_us_mt_suta_wage_base_2019" model="hr.rule.parameter.value">
<field name="parameter_value">33000.00</field>
<field name="rule_parameter_id" ref="rule_parameter_us_mt_suta_wage_base"/>
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
</record>
<record id="rule_parameter_us_mt_suta_wage_base_2020" model="hr.rule.parameter.value">
<field name="parameter_value">34100.00</field>
<field name="rule_parameter_id" ref="rule_parameter_us_mt_suta_wage_base"/>
<field name="date_from" eval="datetime(2020, 1, 1).date()"/>
</record>
<record id="rule_parameter_us_mt_suta_wage_base_2021" model="hr.rule.parameter.value">
<field name="parameter_value">35300.00</field>
<field name="rule_parameter_id" ref="rule_parameter_us_mt_suta_wage_base"/>
<field name="date_from" eval="datetime(2021, 1, 1).date()"/>
</record>
</data>
<!-- Rate -->
@@ -26,11 +27,6 @@
<field name="country_id" ref="base.us"/>
</record>
<data noupdate="1">
<record id="rule_parameter_us_mt_suta_rate_2019" model="hr.rule.parameter.value">
<field name="parameter_value">1.18</field>
<field name="rule_parameter_id" ref="rule_parameter_us_mt_suta_rate"/>
<field name="date_from" eval="datetime(2019, 1, 1).date()"/>
</record>
<record id="rule_parameter_us_mt_suta_rate_2020" model="hr.rule.parameter.value">
<field name="parameter_value">1.18</field>
<field name="rule_parameter_id" ref="rule_parameter_us_mt_suta_rate"/>

View File

@@ -1,139 +0,0 @@
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
from .common import TestUsPayslip, process_payslip
class TestUsMtPayslip(TestUsPayslip):
# Calculations from https://app.mt.gov/myrevenue/Endpoint/DownloadPdf?yearId=705
MT_UNEMP = -1.18 / 100.0
MT_UNEMP_AFT = -0.13 / 100.0
def test_2019_taxes_one(self):
# Payroll Period Semi-Monthly example
salary = 550
mt_mw4_exemptions = 5
employee = self._createEmployee()
contract = self._createContract(employee,
wage=salary,
state_id=self.get_us_state('MT'),
mt_mw4_sit_exemptions=mt_mw4_exemptions,
schedule_pay='semi-monthly')
self._log('2019 Montana tax single 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.MT_UNEMP + self.MT_UNEMP_AFT)) # New non-combined...
mt_taxable_income = salary - (79.0 * mt_mw4_exemptions)
mt_withhold = round(0 + (0.018 * (mt_taxable_income - 0)))
self.assertPayrollEqual(mt_taxable_income, 155.0)
self.assertPayrollEqual(mt_withhold, 3.0)
self.assertPayrollEqual(cats['EE_US_SIT'], -mt_withhold)
def test_2019_taxes_two(self):
# Payroll Period Bi-Weekly example
salary = 2950
mt_mw4_exemptions = 2
employee = self._createEmployee()
contract = self._createContract(employee,
wage=salary,
state_id=self.get_us_state('MT'),
mt_mw4_sit_exemptions=mt_mw4_exemptions,
schedule_pay='bi-weekly')
self._log('2019 Montana tax single 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'], round(salary * (self.MT_UNEMP + self.MT_UNEMP_AFT), 2))
# Note!!
# The example calculation uses A = 16 but the actual table describes this as A = 18
mt_taxable_income = salary - (73.0 * mt_mw4_exemptions)
mt_withhold = round(18 + (0.06 * (mt_taxable_income - 577)))
self.assertPayrollEqual(mt_taxable_income, 2804.0)
self.assertPayrollEqual(mt_withhold, 152.0)
self.assertPayrollEqual(cats['EE_US_SIT'], -mt_withhold)
def test_2019_taxes_three(self):
# Payroll Period Weekly example
salary = 135
mt_mw4_exemptions = 1
employee = self._createEmployee()
contract = self._createContract(employee,
wage=salary,
state_id=self.get_us_state('MT'),
mt_mw4_sit_exemptions=mt_mw4_exemptions,
schedule_pay='weekly')
self._log('2019 Montana tax single 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'], round(salary * (self.MT_UNEMP + self.MT_UNEMP_AFT), 2))
mt_taxable_income = salary - (37.0 * mt_mw4_exemptions)
mt_withhold = round(0 + (0.018 * (mt_taxable_income - 0)))
self.assertPayrollEqual(mt_taxable_income, 98.0)
self.assertPayrollEqual(mt_withhold, 2.0)
self.assertPayrollEqual(cats['EE_US_SIT'], -mt_withhold)
def test_2019_taxes_three_exempt(self):
# Payroll Period Weekly example
salary = 135
mt_mw4_exemptions = 1
employee = self._createEmployee()
contract = self._createContract(employee,
wage=salary,
state_id=self.get_us_state('MT'),
mt_mw4_sit_exemptions=mt_mw4_exemptions,
mt_mw4_sit_exempt='reserve',
schedule_pay='weekly')
self._log('2019 Montana tax single first payslip:')
payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31')
payslip.compute_sheet()
cats = self._getCategories(payslip)
self.assertPayrollEqual(cats.get('EE_US_SIT', 0.0), 0.0)
def test_2019_taxes_three_additional(self):
# Payroll Period Weekly example
salary = 135
mt_mw4_exemptions = 1
mt_mw4_additional_withholding = 20.0
employee = self._createEmployee()
contract = self._createContract(employee,
wage=salary,
state_id=self.get_us_state('MT'),
mt_mw4_sit_exemptions=mt_mw4_exemptions,
state_income_tax_additional_withholding=mt_mw4_additional_withholding,
schedule_pay='weekly')
self._log('2019 Montana tax single first payslip:')
payslip = self._createPayslip(employee, '2019-01-01', '2019-01-31')
payslip.compute_sheet()
cats = self._getCategories(payslip)
mt_taxable_income = salary - (37.0 * mt_mw4_exemptions)
mt_withhold = round(0 + (0.018 * (mt_taxable_income - 0)))
self.assertPayrollEqual(mt_taxable_income, 98.0)
self.assertPayrollEqual(mt_withhold, 2.0)
self.assertPayrollEqual(cats['EE_US_SIT'], -mt_withhold + -mt_mw4_additional_withholding)

View 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 TestUsMtPayslip(TestUsPayslip):
###
# 2021 Taxes and Rates
###
MT_UNEMP_WAGE_MAX = 35300.0
MT_UNEMP = 1.18
MT_UNEMP_AFT = 0.13
# Calculations from https://app.mt.gov/myrevenue/Endpoint/DownloadPdf?yearId=705
def _test_sit(self, wage, additional_withholding, exemptions, schedule_pay, date_start, expected_withholding):
employee = self._createEmployee()
contract = self._createContract(employee,
wage=wage,
state_id=self.get_us_state('MT'),
state_income_tax_additional_withholding=additional_withholding,
mt_mw4_sit_exemptions=exemptions,
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_one(self):
combined_rate = self.MT_UNEMP + self.MT_UNEMP_AFT # Combined for test as they both go to the same category and have the same cap
self._test_er_suta('MT', combined_rate + .0001, date(2021, 1, 1), wage_base=self.MT_UNEMP_WAGE_MAX, relaxed=True)
self._test_sit(550.0, 0.0, 5.0, 'semi-monthly', date(2021, 1, 1), 3.0)
self._test_sit(2950.0, 10.0, 2.0, 'bi-weekly', date(2021, 1, 1), 162.0)
self._test_sit(5000.0, 0.0, 1.0, 'monthly', date(2021, 1, 1), 256.0)
self._test_sit(750.0, 0.0, 1.0, 'weekly', date(2021, 1, 1), 34.0)