From c50fc91b1ef1e6f9c5c4f2225014b9982ecebaca Mon Sep 17 00:00:00 2001 From: Kristen Marie Kulha Date: Wed, 25 Jul 2018 09:04:18 -0700 Subject: [PATCH] Added `elif` statement to ensure wages are over $0.00, and returning 0 in that case, before checking and assigning a tax rate table. Additionally, also check that wages are greater than 0 for the 'married' filing status. --- l10n_us_ks_hr_payroll/data/rules_2018.xml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/l10n_us_ks_hr_payroll/data/rules_2018.xml b/l10n_us_ks_hr_payroll/data/rules_2018.xml index 29b9110c..ea88f973 100755 --- a/l10n_us_ks_hr_payroll/data/rules_2018.xml +++ b/l10n_us_ks_hr_payroll/data/rules_2018.xml @@ -60,11 +60,14 @@ allowances = contract.ks_k4_allowances additional_withholding = contract.ks_additional_withholding schedule_pay = contract.schedule_pay filing_status = contract.ks_k4_filing_status +tax_rate_table = [] # Tables are found in https://www.ksrevenue.org/pdf/kw1002017.pdf # First check for exemption status (Step 1) if filing_status == 'exempt': result = 0 +elif wages <= 0: + result = 0 else: # Calculate Withholding Allowance Amounts using table (allowance multipliers are from table). @@ -94,7 +97,7 @@ else: (float('inf'), 0.057, 24.09), ] - elif filing_status == 'married': + elif filing_status == 'married' and wages > 0: tax_rate_table = [ (144, 0.0, 0.0), (721, 0.031, 0.0), @@ -112,7 +115,7 @@ else: (float('inf'), 0.057, 48.17), ] - elif filing_status == 'married': + elif filing_status == 'married' and wages > 0: tax_rate_table = [ (288, 0.0, 0.0), (1442, 0.031, 0.0), @@ -130,7 +133,7 @@ else: (float('inf'), 0.057, 52.19), ] - elif filing_status == 'married': + elif filing_status == 'married' and wages > 0: tax_rate_table = [ (313, 0.0, 0.0), (1563, 0.031, 0.0), @@ -148,7 +151,7 @@ else: (float('inf'), 0.057, 104.38), ] - elif filing_status == 'married': + elif filing_status == 'married' and wages > 0: tax_rate_table = [ (625, 0.0, 0.0), (3125, 0.031, 0.0), @@ -166,7 +169,7 @@ else: (float('inf'), 0.057, 313.13), ] - elif filing_status == 'married': + elif filing_status == 'married' and wages > 0: tax_rate_table = [ (1875, 0.0, 0.0), (9375, 0.031, 0.0), @@ -184,7 +187,7 @@ else: (float('inf'), 0.057, 626.25), ] - elif filing_status == 'married': + elif filing_status == 'married' and wages > 0: tax_rate_table = [ (3750, 0.0, 0.0), (18750, 0.031, 0.0), @@ -202,7 +205,7 @@ else: (float('inf'), 0.057, 1252.50), ] - elif filing_status == 'married': + elif filing_status == 'married' and wages > 0: tax_rate_table = [ (7500, 0.0, 0.0), (37500, 0.031, 0.0),