From 8e97119d40dd19a9725888c82d3977667cad965b Mon Sep 17 00:00:00 2001 From: Jared Self Date: Thu, 14 Jan 2021 13:09:03 -0700 Subject: [PATCH] LA Louisiana --- .../data/state/la_louisiana.xml | 63 ++++++------- .../test_us_la_louisiana_payslip_2019.py | 91 ------------------- .../test_us_la_louisiana_payslip_2021.py | 36 ++++++++ 3 files changed, 63 insertions(+), 127 deletions(-) delete mode 100644 l10n_us_hr_payroll/tests/test_us_la_louisiana_payslip_2019.py create mode 100755 l10n_us_hr_payroll/tests/test_us_la_louisiana_payslip_2021.py diff --git a/l10n_us_hr_payroll/data/state/la_louisiana.xml b/l10n_us_hr_payroll/data/state/la_louisiana.xml index 7e4f5fe2..9ac40aae 100644 --- a/l10n_us_hr_payroll/data/state/la_louisiana.xml +++ b/l10n_us_hr_payroll/data/state/la_louisiana.xml @@ -7,11 +7,7 @@ - - 7700.0 - - - + 7700.0 @@ -26,16 +22,18 @@ - - 1.14 - - - 1.14 + + + + 1.0 + + + @@ -44,22 +42,6 @@ - - { - 'single': ( - (12500.00, 2.10), - (50000.00, 1.60), - ( 'inf', 1.35), - ), - 'married': ( - ( 25000.00, 2.10), - (100000.00, 1.65), - ( 'inf', 1.35), - ), - } - - - { 'single': ( @@ -76,6 +58,23 @@ + + + { + 'single': ( + (12500.00, 2.00), + (50000.00, 4.00), + ( 'inf', 6.00) + ), + 'married': ( + ( 25000.00, 2.00), + (100000.00, 4.00), + ( 'inf', 6.00) + ), + } + + + @@ -84,11 +83,7 @@ - - 4500 - - - + 4500 @@ -102,11 +97,7 @@ - - 1000.0 - - - + 1000.0 diff --git a/l10n_us_hr_payroll/tests/test_us_la_louisiana_payslip_2019.py b/l10n_us_hr_payroll/tests/test_us_la_louisiana_payslip_2019.py deleted file mode 100644 index 1d01c618..00000000 --- a/l10n_us_hr_payroll/tests/test_us_la_louisiana_payslip_2019.py +++ /dev/null @@ -1,91 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from .common import TestUsPayslip, process_payslip - - -class TestUsLAPayslip(TestUsPayslip): - - # TAXES AND RATES - LA_UNEMP_MAX_WAGE = 7700.00 - LA_UNEMP = -(1.14 / 100.0) - - def test_taxes_single_weekly(self): - salary = 700.00 - schedule_pay = 'weekly' - filing_status = 'single' - exemptions = 1 - dependents = 2 - additional_withholding = 0 - # SEE http://revenue.louisiana.gov/TaxForms/1306(1_12)TF.pdf for example calculations - # wh_to test is 19.42 - # Our algorithm correctly rounds whereas theirs does it prematurely. - wh_to_check = -19.43 - employee = self._createEmployee() - contract = self._createContract(employee, - wage=salary, - state_id=self.get_us_state('LA'), - la_l4_sit_filing_status=filing_status, - state_income_tax_additional_withholding=additional_withholding, - la_l4_sit_exemptions=exemptions, - la_l4_sit_dependents=dependents, - schedule_pay=schedule_pay) - - self._log('2019 Louisiana 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.LA_UNEMP) - self.assertPayrollEqual(cats['EE_US_SIT'], wh_to_check) - - process_payslip(payslip) - - remaining_la_unemp_wages = self.LA_UNEMP_MAX_WAGE - salary if (self.LA_UNEMP_MAX_WAGE - 2*salary < salary) \ - else salary - - self._log('2019 Louisiana 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_la_unemp_wages * self.LA_UNEMP) - - def test_taxes_married_biweekly(self): - salary = 4600.00 - schedule_pay = 'bi-weekly' - filing_status = 'married' - exemptions = 2 - dependents = 3 - additional_withholding = 0 - # SEE http://revenue.louisiana.gov/TaxForms/1306(1_12)TF.pdf for example calculations - # wh_to test is 157.12 - wh_to_check = -157.12 - employee = self._createEmployee() - contract = self._createContract(employee, - wage=salary, - state_id=self.get_us_state('LA'), - la_l4_sit_filing_status=filing_status, - state_income_tax_additional_withholding=additional_withholding, - la_l4_sit_exemptions=exemptions, - la_l4_sit_dependents=dependents, - schedule_pay=schedule_pay) - - self._log('2019 Louisiana 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.LA_UNEMP) - self.assertPayrollEqual(cats['EE_US_SIT'], wh_to_check) - - process_payslip(payslip) - - remaining_la_unemp_wages = self.LA_UNEMP_MAX_WAGE - salary if (self.LA_UNEMP_MAX_WAGE - 2*salary < salary) \ - else salary - - self._log('2019 Louisiana 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_la_unemp_wages * self.LA_UNEMP) diff --git a/l10n_us_hr_payroll/tests/test_us_la_louisiana_payslip_2021.py b/l10n_us_hr_payroll/tests/test_us_la_louisiana_payslip_2021.py new file mode 100755 index 00000000..d23c3ab3 --- /dev/null +++ b/l10n_us_hr_payroll/tests/test_us_la_louisiana_payslip_2021.py @@ -0,0 +1,36 @@ +# 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 TestUsLAPayslip(TestUsPayslip): + ### + # 2020 Taxes and Rates + ### + LA_UNEMP_MAX_WAGE = 7700.0 + LA_UNEMP = 1.14 + # Calculation based on http://revenue.louisiana.gov/TaxForms/1306(1_12)TF.pdf + + def _test_sit(self, wage, filing_status, additional_withholding, exemptions, dependents, schedule_pay, date_start, expected_withholding): + employee = self._createEmployee() + contract = self._createContract(employee, + wage=wage, + state_id=self.get_us_state('LA'), + la_l4_sit_filing_status=filing_status, + state_income_tax_additional_withholding=additional_withholding, + la_l4_sit_exemptions=exemptions, + la_l4_sit_dependents=dependents, + 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('LA', self.LA_UNEMP, date(2020, 1, 1), wage_base=self.LA_UNEMP_MAX_WAGE) + self._test_sit(700.0, 'single', 0.0, 1.0, 2.0, 'weekly', date(2020, 1, 1), 19.43) + self._test_sit(4600.0, 'married', 0.0, 2.0, 3.0, 'bi-weekly', date(2020, 1, 1), 157.12) + self._test_sit(6000.0, 'single', 10.0, 2.0, 3.0, 'monthly', date(2020, 1, 1), 219.08)