Skip to content

Commit

Permalink
Fix Delaware itemized deductions logic
Browse files Browse the repository at this point in the history
Fixes #4362
  • Loading branch information
PavelMakarchuk committed Apr 10, 2024
1 parent db2a86c commit d062435
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,68 @@
state_fips: 10 # DE
output: # expected results from patched TAXSIM35 2024-04-04 version
de_income_tax: 2429.20

- name: Tax unit with taxsimid 6600 in k21.its.csv and k21.ots.csv
absolute_error_margin: 0.01
period: 2021
input:
people:
person1:
age: 73
employment_income: 20010
qualified_dividend_income: 1005.0
taxable_interest_income: 5505.0
short_term_capital_gains: 2005.0
long_term_capital_gains: 4005.0
rental_income: 505.0
taxable_private_pension_income: 3000.0
social_security_retirement: 6000.0
real_estate_taxes: 1000
mortgage_interest: 31000
self_employment_income: 137010
business_is_qualified: true
business_is_sstb: false
w2_wages_from_qualified_business: 100e6
ssi: 0 # not in TAXSIM35
state_supplement: 0 # not in TAXSIM35
wic: 0 # not in TAXSIM35
ma_covid_19_essential_employee_premium_pay_program: 0 # not in TAXSIM35
person2:
age: 73
employment_income: 12010
qualified_dividend_income: 1005.0
taxable_interest_income: 5505.0
short_term_capital_gains: 2005.0
long_term_capital_gains: 4005.0
rental_income: 505.0
taxable_private_pension_income: 3000.0
social_security_retirement: 6000.0
ssi: 0 # not in TAXSIM35
state_supplement: 0 # not in TAXSIM35
wic: 0 # not in TAXSIM35
ma_covid_19_essential_employee_premium_pay_program: 0 # not in TAXSIM35
tax_units:
tax_unit:
members: [person1, person2]
local_income_tax: 0 # not in TAXSIM35
state_sales_tax: 0 # not in TAXSIM35
ca_use_tax: 0 # not in TAXSIM35
il_use_tax: 0 # not in TAXSIM35
nm_2021_income_rebate: 0 # not in TAXSIM35
nm_additional_2021_income_rebate: 0 # not in TAXSIM35
nm_supplemental_2021_income_rebate: 0 # not in TAXSIM35
ny_supplemental_eitc: 0 # not in TAXSIM35
ok_use_tax: 0 # not in TAXSIM35
pa_use_tax: 0 # not in TAXSIM35
vt_renter_credit: 0 # not in TAXSIM35
spm_units:
spm_unit:
members: [person1, person2]
snap: 0 # not in TAXSIM35
tanf: 0 # not in TAXSIM35
households:
household:
members: [person1, person2]
state_fips: 10 # DE
output: # expected results from patched TAXSIM35 2024-04-09 version
de_income_tax: 7429.24
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class de_deduction_indv(Variable):
defined_for = StateCode.DE

def formula(person, period, parameters):
itemizes = person.tax_unit("de_tax_unit_itemizes", period)
itemized = person("de_itemized_deductions_indv", period)
standard = person("de_standard_deduction_indv", period)
return max_(itemized, standard)
return where(itemizes, itemized, standard)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from policyengine_us.model_api import *


class de_tax_unit_itemizes(Variable):
value_type = bool
entity = TaxUnit
label = "Whether the tax unit in Delaware itemizes the deductions when married filing separately"
definition_period = YEAR
defined_for = StateCode.MT

def formula(tax_unit, period, parameters):
itemized_ded = add(tax_unit, period, ["de_itemized_deductions_indiv"])
standard_ded = add(tax_unit, period, ["de_standard_deduction_indiv"])
return itemized_ded > standard_ded

0 comments on commit d062435

Please sign in to comment.