From 2db0ec3b3c05b29d8b1968c4f98004f3b832bafe Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Sun, 9 Dec 2018 11:51:01 -0800 Subject: [PATCH] Refactor to mitigate the fact that eligible 401(k) contributions reduce taxable wage (gross) but not FICA/FUTA etc. This refactor bases all/most 'wage' categories off of BASIC instead of GROSS to allow all 'Income Tax' rules to continue to be based on GROSS. --- l10n_us_mo_hr_payroll/data/rules_2018.xml | 4 ++-- l10n_us_mo_hr_payroll/tests/test_us_mo_payslip_2018.py | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/l10n_us_mo_hr_payroll/data/rules_2018.xml b/l10n_us_mo_hr_payroll/data/rules_2018.xml index f51b6e24..5ad1ae1a 100755 --- a/l10n_us_mo_hr_payroll/data/rules_2018.xml +++ b/l10n_us_mo_hr_payroll/data/rules_2018.xml @@ -18,10 +18,10 @@ ytd += contract.external_wages remaining = 12500.0 - ytd if remaining <= 0.0: result = 0 -elif remaining < categories.GROSS: +elif remaining < categories.BASIC: result = remaining else: - result = categories.GROSS + result = categories.BASIC diff --git a/l10n_us_mo_hr_payroll/tests/test_us_mo_payslip_2018.py b/l10n_us_mo_hr_payroll/tests/test_us_mo_payslip_2018.py index e6239f7a..b2186f37 100755 --- a/l10n_us_mo_hr_payroll/tests/test_us_mo_payslip_2018.py +++ b/l10n_us_mo_hr_payroll/tests/test_us_mo_payslip_2018.py @@ -45,7 +45,7 @@ class TestUsMoPayslip(TestUsPayslip): # tax rates mo_unemp = contract.mo_unemp_rate(2018) / -100.0 - self._log('2018 Missouri tax first payslip:') + self._log('2018 Missouri tax single first payslip:') payslip = self._createPayslip(employee, '2018-01-01', '2018-01-31') payslip.compute_sheet() @@ -62,11 +62,12 @@ class TestUsMoPayslip(TestUsPayslip): # 5000 for single and married with spouse working, 10000 for married spouse not working us_withholding = min(5000, us_withholding) - + # 5000 + self._log(us_withholding) mo_taxable_income = gross_salary - standard_deduction - mo_allowance_calculated - us_withholding - # 48306.14 - self._log(mo_taxable_income) + # 44000.0 + self._log('%s = %s - %s - %s - %s' % (mo_taxable_income, gross_salary, standard_deduction, mo_allowance_calculated, us_withholding)) remaining_taxable_income = mo_taxable_income tax = 0.0