Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellpound committed Oct 24, 2023
1 parent 5ca626a commit 2a35581
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
absolute_error_margin: 0
input:
filing_status: SINGLE
state_income_tax: 0
prior_year_state_income_tax_paid: 0
state_code: MO
output:
mo_net_state_income_taxes: 0.0
Expand All @@ -13,7 +13,7 @@
absolute_error_margin: 0.01
input:
filing_status: SINGLE
state_income_tax: 23_000
prior_year_state_income_tax_paid: 23_000
state_code: MO
output:
mo_net_state_income_taxes: 10_000
Expand All @@ -24,7 +24,7 @@
input:
filing_status: SINGLE
real_estate_taxes: 4_000
state_income_tax: 3_000
prior_year_state_income_tax_paid: 3_000
state_code: MO
output:
mo_net_state_income_taxes: 3_000
Expand All @@ -35,7 +35,7 @@
input:
filing_status: JOINT
real_estate_taxes: 4_000
state_income_tax: 8_000
prior_year_state_income_tax_paid: 8_000
state_code: MO
output:
mo_net_state_income_taxes: 6_666.67 # = 10_000 * 2/3
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,27 @@ class co_state_addback(Variable):
unit = USD
definition_period = YEAR
reference = (
"https://tax.colorado.gov/sites/tax/files/documents/DR_104_Book_2021.pdf#page=5"
"https://tax.colorado.gov/sites/tax/files/documents/DR_104_Book_2022.pdf#page=5"
"https://tax.colorado.gov/sites/tax/files/documents/DR_104_Book_2021.pdf#page=5",
"https://tax.colorado.gov/sites/tax/files/documents/DR_104_Book_2022.pdf#page=5",
"https://tax.colorado.gov/sites/tax/files/documents/ITT_State_Income_Tax_Addback_Jan_2023.pdf",
)
defined_for = StateCode.CO

def formula(tax_unit, period, parameters):
federal_itemizer = tax_unit("tax_unit_itemizes", period)
# Colorado only requires taxpayers to add back state income tax from
# Federal Schedule A (line 5a). It does not require taxpayers to
# add back state real estate or property tax from Schedule A
state_inctax = max_(0, tax_unit("statelocal_sales_or_prior_inctax", period))
return federal_itemizer * state_inctax

salt_deduct = tax_unit("salt_deduction", period)
local_taxes = add(
tax_unit, period, ["prior_year_local_income_tax_paid"]
)
property_taxes = add(tax_unit, period, ["real_estate_taxes"])
state_addback = max_(0, salt_deduct - local_taxes - property_taxes)

# return the max between the "extra" itemized deductions above the std
# and the state taxes included in the SALT deduction
p = parameters(period).gov.irs.deductions
item_deducts = add(tax_unit, period, p.itemized_deductions)
std_deducts = tax_unit("standard_deduction", period)
alt_addback = max_(0, item_deducts - std_deducts)

return federal_itemizer * min_(state_addback, alt_addback)
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ def formula(tax_unit, period, parameters):
p = parameters(period).gov.irs.deductions.itemized
salt_cap = p.salt_and_real_estate.cap[filing_status]

uncapped_itax = max_(0, add(tax_unit, period, ["statelocal_sales_or_prior_inctax"]))
uncapped_itax = max_(
0, add(tax_unit, period, ["prior_year_state_income_tax_paid"])
)
uncapped_ptax = add(tax_unit, period, ["real_estate_taxes"])
uncapped_salt = uncapped_itax + uncapped_ptax

Expand Down

0 comments on commit 2a35581

Please sign in to comment.