diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb2d..e65b8cd9e2a 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + added: + - Montana itemized deductions. diff --git a/policyengine_us/parameters/gov/states/mt/tax/income/deductions/itemized/misc_deductions.yaml b/policyengine_us/parameters/gov/states/mt/tax/income/deductions/itemized/misc_deductions.yaml new file mode 100644 index 00000000000..abef40fec85 --- /dev/null +++ b/policyengine_us/parameters/gov/states/mt/tax/income/deductions/itemized/misc_deductions.yaml @@ -0,0 +1,20 @@ +description: Montana counts these sources as miscellaneous deductions. +values: + 2021-01-01: + - mt_child_dependent_care_expense_deduction + - casualty_loss_deduction + + +metadata: + unit: list + label: Montana miscellaneous deductions + period: year + reference: + - title: Montana Individual Income Tax Return (Form 2) 2022 + href: https://mtrevenue.gov/wp-content/uploads/dlm_uploads/2023/05/Montana-Idividiual-Income-Tax-Return-Form-2-2022v6.2.pdf#page=7 + - title: Montana Individual Income Tax Return (Form 2) 2021 + href: https://mtrevenue.gov/wp-content/uploads/mdocs/form%202%202021.pdf#page=7 + - title: Montana Tax From Instructions 2021 + href: https://mtrevenue.gov/wp-content/uploads/dlm_uploads/2022/12/Form-2-2022-Instructions.pdf#page=32 + - title: MT Code § 15-30-2131 (2022) (1)(a)&(c) + href: https://law.justia.com/codes/montana/2022/title-15/chapter-30/part-21/section-15-30-2131/ diff --git a/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_itemized_deductions.yaml b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_itemized_deductions.yaml new file mode 100644 index 00000000000..b832909f6f0 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_itemized_deductions.yaml @@ -0,0 +1,41 @@ +- name: Test case 1 # filing separate + period: 2021 + input: + filing_status: SEPARATE + charitable_deduction: 800 + interest_deduction: 265 + mt_salt_deduction: 5_000 + mt_medical_expense_deduction: 1_000 + casualty_loss_deduction: 400 + mt_child_dependent_care_expense_deduction: 123 + state_code: MT + output: + mt_itemized_deductions: 7_588 + +- name: Test case 2 #salt has a cap of 10000 for single, head of household and joint + period: 2022 + input: + filing_status: HEAD_OF_HOUSEHOLD + charitable_deduction: 0 + interest_deduction: 1_234 + mt_salt_deduction: 10_000 + mt_medical_expense_deduction: 3_000 + casualty_loss_deduction: 0 + mt_child_dependent_care_expense_deduction: 0 + state_code: MT + output: + mt_itemized_deductions: 14_234 + +- name: Test case 3 #sum all terms + period: 2021 + input: + filing_status: SINGLE + charitable_deduction: 1_000 + interest_deduction: 34 + mt_salt_deduction: 1_035 + mt_medical_expense_deduction: 3_000 + casualty_loss_deduction: 745 + mt_child_dependent_care_expense_deduction: 1_004 + state_code: MT + output: + mt_itemized_deductions: 6_818 diff --git a/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_medical_expense_deduction.yaml b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_medical_expense_deduction.yaml new file mode 100644 index 00000000000..a7544807466 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_medical_expense_deduction.yaml @@ -0,0 +1,18 @@ +- name: Test case 1, medical_expense higher than 0.075 of agi. + period: 2021 + input: + medical_expense: 1_000 + mt_agi: 10_000 + state_code: MT + output: + mt_medical_expense_deduction: 250 + +- name: Test case 21, medical_expense less than 0.075 of agi. + period: 2021 + input: + medical_expense: 1_000 + mt_agi: 20_000 + state_code: MT + output: + mt_medical_expense_deduction: 0 + diff --git a/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_salt_deduction.yaml b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_salt_deduction.yaml new file mode 100644 index 00000000000..1e3da2a4f1b --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_salt_deduction.yaml @@ -0,0 +1,37 @@ +- name: Test case 1, filing separate, higher than cap + period: 2021 + input: + filing_status: SEPARATE + real_estate_taxes: 6_000 + state_code: MT + output: + mt_salt_deduction: 5_000 + +- name: Test case 2, filing single, less than cap + period: 2021 + input: + filing_status: SINGLE + real_estate_taxes: 3_000 + state_code: MT + output: + mt_salt_deduction: 3_000 + + +- name: Test case 3, filing jointly, lower than cap + period: 2021 + input: + filing_status: JOINT + real_estate_taxes: 6_000 + state_code: MT + output: + mt_salt_deduction: 6_000 + +- name: Test case 4, filing jointly, higher than cap + period: 2021 + input: + filing_status: JOINT + real_estate_taxes: 11_000 + state_code: MT + output: + mt_salt_deduction: 10_000 + diff --git a/policyengine_us/variables/gov/states/mt/tax/income/deductions/cdcc/mt_child_dependent_care_expense_deduction.py b/policyengine_us/variables/gov/states/mt/tax/income/deductions/cdcc/mt_child_dependent_care_expense_deduction.py new file mode 100644 index 00000000000..de2d27b2f01 --- /dev/null +++ b/policyengine_us/variables/gov/states/mt/tax/income/deductions/cdcc/mt_child_dependent_care_expense_deduction.py @@ -0,0 +1,10 @@ +from policyengine_us.model_api import * + + +class mt_child_dependent_care_expense_deduction(Variable): + value_type = float + entity = TaxUnit + label = "Montana child dependent care expense deduction" + unit = USD + definition_period = YEAR + defined_for = StateCode.MT diff --git a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/mt_itemized_deductions.py b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/mt_itemized_deductions.py new file mode 100644 index 00000000000..e430f6414a6 --- /dev/null +++ b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/mt_itemized_deductions.py @@ -0,0 +1,38 @@ +from policyengine_us.model_api import * + + +class mt_itemized_deductions(Variable): + value_type = float + entity = TaxUnit + label = "Montana itemized deductions" + unit = USD + definition_period = YEAR + reference = ( + "https://mtrevenue.gov/wp-content/uploads/dlm_uploads/2023/05/Montana-Idividiual-Income-Tax-Return-Form-2-2022v6.2.pdf#page=7" + "https://law.justia.com/codes/montana/2022/title-15/chapter-30/part-21/section-15-30-2131/" + # MT Code § 15-30-2131 (2022) (1) + ) + defined_for = StateCode.MT + + def formula(tax_unit, period, parameters): + p = parameters(period).gov.irs.deductions + itm_deds = [ + deduction + for deduction in p.itemized_deductions + if deduction + not in [ + "salt_deduction", + "casualty_loss_deduction", + "medical_expense_deduction", + ] + ] + return add( + tax_unit, + period, + itm_deds + + [ + "mt_misc_deductions", + "mt_medical_expense_deduction", + "mt_salt_deduction", + ], + ) diff --git a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/mt_medical_expense_deduction.py b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/mt_medical_expense_deduction.py new file mode 100644 index 00000000000..0d484ee301e --- /dev/null +++ b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/mt_medical_expense_deduction.py @@ -0,0 +1,23 @@ +from policyengine_us.model_api import * + + +class mt_medical_expense_deduction(Variable): + value_type = float + entity = TaxUnit + definition_period = YEAR + label = "Montana medical expense deduction" + reference = ( + "https://mtrevenue.gov/wp-content/uploads/dlm_uploads/2023/05/Montana-Idividiual-Income-Tax-Return-Form-2-2022v6.2.pdf#page=7", + "https://law.justia.com/codes/montana/2022/title-15/chapter-30/part-21/section-15-30-2131/" + # MT Code § 15-30-2131 (2022) (1)(g)(i) + ) + unit = USD + defined_for = StateCode.MT + + def formula(tax_unit, period, parameters): + expense = add(tax_unit, period, ["medical_expense"]) + medical = parameters(period).gov.irs.deductions.itemized.medical + # Law does not define Montana AGI as the cap. + # Tax form points to page 1, line 14, which is Montana AGI. + medical_floor = medical.floor * tax_unit("mt_agi", period) + return max_(0, expense - medical_floor) diff --git a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/mt_misc_deductions.py b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/mt_misc_deductions.py new file mode 100644 index 00000000000..f5d9bc13692 --- /dev/null +++ b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/mt_misc_deductions.py @@ -0,0 +1,17 @@ +from policyengine_us.model_api import * + + +class mt_misc_deductions(Variable): + value_type = float + entity = TaxUnit + label = "Montana miscellaneous deductions" + unit = USD + definition_period = YEAR + reference = ( + "https://mtrevenue.gov/wp-content/uploads/dlm_uploads/2023/05/Montana-Idividiual-Income-Tax-Return-Form-2-2022v6.2.pdf#page=7" + "https://law.justia.com/codes/montana/2022/title-15/chapter-30/part-21/section-15-30-2131/" + # Montana Code Annotated MT Code § 15-30-2131 (2022) (1)(a)&(c) + ) + defined_for = StateCode.MT + + adds = "gov.states.mt.tax.income.deductions.itemized.misc_deductions" diff --git a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/mt_salt_deduction.py b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/mt_salt_deduction.py new file mode 100644 index 00000000000..215eac33dd7 --- /dev/null +++ b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/mt_salt_deduction.py @@ -0,0 +1,24 @@ +from policyengine_us.model_api import * + + +class mt_salt_deduction(Variable): + value_type = float + entity = TaxUnit + label = "Montana state and local tax deduction" + unit = USD + definition_period = YEAR + reference = ( + "https://mtrevenue.gov/wp-content/uploads/dlm_uploads/2023/05/Montana-Idividiual-Income-Tax-Return-Form-2-2022v6.2.pdf#page=7" + "https://law.justia.com/codes/montana/2022/title-15/chapter-30/part-21/section-15-30-2131/" + # Montana Code Annotated MT Code § 15-30-2131 (2022) (1)(a) + ) + defined_for = StateCode.MT + + def formula(tax_unit, period, parameters): + p = parameters(period).gov.irs.deductions + filing_status = tax_unit("filing_status", period) + real_estate_tax = add(tax_unit, period, ["real_estate_taxes"]) + return min_( + real_estate_tax, + p.itemized.salt_and_real_estate.cap[filing_status], + )