From e866f89b2b08b3a96bd9c8f3c29dcc6cea9ba958 Mon Sep 17 00:00:00 2001 From: Jared Self Date: Tue, 12 Jan 2021 10:50:57 -0700 Subject: [PATCH] ME Maine --- l10n_us_hr_payroll/data/state/me_maine.xml | 44 +++++++++++++++++++ .../tests/test_us_me_maine_payslip_2021.py | 39 ++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 l10n_us_hr_payroll/tests/test_us_me_maine_payslip_2021.py diff --git a/l10n_us_hr_payroll/data/state/me_maine.xml b/l10n_us_hr_payroll/data/state/me_maine.xml index 2c1aaf71..925629b5 100644 --- a/l10n_us_hr_payroll/data/state/me_maine.xml +++ b/l10n_us_hr_payroll/data/state/me_maine.xml @@ -7,6 +7,8 @@ + + 12000.0 @@ -26,6 +28,13 @@ + + + + 2.31 + + + @@ -50,6 +59,23 @@ + + + { + 'single': ( + ( 22400, 0, 5.80), + ( 53150, 1302, 6.75), + ( 'inf', 3374, 7.15), + ), + 'married': ( + ( 44950, 0, 5.80), + ( 106350, 2607, 6.75), + ( 'inf', 6752, 7.15), + ), + } + + + @@ -72,6 +98,22 @@ + + + { + 'single': { + ( 83850, 9700), + (158850, 75000), + }, + 'married': { + (167700, 25100), + (317700, 150000), + }, + } + + + + @@ -80,6 +122,8 @@ + + 4300 diff --git a/l10n_us_hr_payroll/tests/test_us_me_maine_payslip_2021.py b/l10n_us_hr_payroll/tests/test_us_me_maine_payslip_2021.py new file mode 100644 index 00000000..165455ce --- /dev/null +++ b/l10n_us_hr_payroll/tests/test_us_me_maine_payslip_2021.py @@ -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 TestUsMEPayslip(TestUsPayslip): + ### + # 2020 Taxes and Rates + ### + ME_UNEMP_MAX_WAGE = 12000.0 + ME_UNEMP = 1.92 + # Calculation based on this file page.6 and 7 https://www.maine.gov/revenue/forms/with/2020/20_WH_Tab&Instructions.pdf + + def _test_sit(self, wage, filing_status, additional_withholding, exempt, allowances, schedule_pay, date_start, expected_withholding): + employee = self._createEmployee() + contract = self._createContract(employee, + wage=wage, + state_id=self.get_us_state('ME'), + me_w4me_sit_filing_status=filing_status, + state_income_tax_additional_withholding=additional_withholding, + state_income_tax_exempt=exempt, + me_w4me_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.assertPayrollAlmostEqual(cats.get('EE_US_SIT', 0.0), -expected_withholding) + + def test_2020_taxes_example(self): + self._test_er_suta('ME', self.ME_UNEMP, date(2020, 1, 1), wage_base=self.ME_UNEMP_MAX_WAGE) + self._test_sit(300.0, 'single', 0.0, False, 2, 'weekly', date(2020, 1, 1), 0.0) + self._test_sit(800.0, 'single', 0.0, False, 2, 'bi-weekly', date(2020, 1, 1), 6.00) + self._test_sit(4500.0, 'married', 0.0, True, 0, 'weekly', date(2020, 1, 1), 0.00) + self._test_sit(4500.0, 'married', 0.0, False, 2, 'monthly', date(2020, 1, 1), 113.00) + self._test_sit(4500.0, 'married', 10.0, False, 2, 'weekly', date(2020, 1, 1), 287.00) + self._test_sit(7000.0, '', 10.0, False, 2, 'weekly', date(2020, 1, 1), 0.00)