From 2a355813326880632d6aa07d924bd43bf0e697b9 Mon Sep 17 00:00:00 2001 From: mitchellpound Date: Mon, 23 Oct 2023 20:31:11 -0600 Subject: [PATCH] Fixed tests --- .../mo_net_state_income_taxes.yaml | 8 +++--- .../tax/income/additions/co_state_addback.py | 26 ++++++++++++++----- .../mo_net_state_income_taxes.py | 4 ++- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/fiscalsim_us/tests/policy/baseline/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.yaml b/fiscalsim_us/tests/policy/baseline/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.yaml index e8707e5d5..2d14e7f93 100644 --- a/fiscalsim_us/tests/policy/baseline/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.yaml +++ b/fiscalsim_us/tests/policy/baseline/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.yaml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/fiscalsim_us/variables/gov/states/co/tax/income/additions/co_state_addback.py b/fiscalsim_us/variables/gov/states/co/tax/income/additions/co_state_addback.py index 45156587a..efcb3b96b 100644 --- a/fiscalsim_us/variables/gov/states/co/tax/income/additions/co_state_addback.py +++ b/fiscalsim_us/variables/gov/states/co/tax/income/additions/co_state_addback.py @@ -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) diff --git a/fiscalsim_us/variables/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.py b/fiscalsim_us/variables/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.py index 2c613661f..63da281de 100644 --- a/fiscalsim_us/variables/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.py +++ b/fiscalsim_us/variables/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.py @@ -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