diff --git a/changelog.d/fix-mt-casualty-loss-misc-deduction.fixed.md b/changelog.d/fix-mt-casualty-loss-misc-deduction.fixed.md new file mode 100644 index 00000000000..565e7885805 --- /dev/null +++ b/changelog.d/fix-mt-casualty-loss-misc-deduction.fixed.md @@ -0,0 +1 @@ +Count Montana casualty losses once per joint return and allocate separate-return losses to the owning spouse, after the $100 reduction and 10% Montana AGI floor. diff --git a/policyengine_us/parameters/gov/states/mt/tax/income/deductions/itemized/casualty_loss/applies.yaml b/policyengine_us/parameters/gov/states/mt/tax/income/deductions/itemized/casualty_loss/applies.yaml new file mode 100644 index 00000000000..ecdbb50d759 --- /dev/null +++ b/policyengine_us/parameters/gov/states/mt/tax/income/deductions/itemized/casualty_loss/applies.yaml @@ -0,0 +1,28 @@ +description: Montana allows an itemized casualty and theft loss deduction, if this is true. +metadata: + label: Montana casualty and theft loss deduction applies + period: year + unit: bool + reference: + - title: 2015 Montana Form 2 Instructions, Schedule III line 20 + # PDF pages 27, 30 + href: https://revenue.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2015_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=30 + - title: 2017 Montana Form 2 Instructions, Schedule III line 20 + # PDF pages 27, 30 + href: https://revenue.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2017_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=30 + - title: MCA § 15-30-2131(1)(a) (2021), itemized deductions by reference to 26 U.S.C. 161 and 211 (repealed effective 2024) + href: https://mca.legmt.gov/bills/2022/mca/title_0150/chapter_0300/part_0210/section_0310/0150-0300-0210-0310.html + - title: 2021 Montana Form 2 Instructions, Itemized Deductions Schedule, line 15 + href: https://revenue.mt.gov/files/forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2021_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=34 + - title: 2022 Montana Form 2 Instructions, Itemized Deductions Schedule, line 15 + href: https://revenue.mt.gov/files/forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2022_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=35 + - title: 2023 Montana Form 2 Instructions, Itemized Deductions Schedule, line 15 + href: https://revenue.mt.gov/files/forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2023_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=39 + # From 2024, Montana taxable income starts from federal taxable income and + # the Itemized Deductions Schedule is discontinued (SB 399). + - title: 2024 Montana Form 2 Instructions, Discontinued Worksheets and Schedules + href: https://revenue.mt.gov/files/forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2024_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=8 + +values: + 2015-01-01: true + 2024-01-01: false 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 index 61287813a0b..ca302f7fb44 100644 --- 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 @@ -5,7 +5,6 @@ description: Montana counts these sources as miscellaneous deductions. # differs between a joint return and separate columns (Form 2441-M line 3). values: 2017-01-01: - - casualty_loss_deduction # Gambling losses, up to gambling winnings (2023 Form 2 instructions). - mt_wagering_losses_deduction # Form 2 itemized deductions line 18 follows federal Schedule A line 16. @@ -35,5 +34,5 @@ metadata: href: https://revenue.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2/2021_Montana_Individual_Income_Tax_Return_Form_2.pdf#page=7 - title: Montana Tax From Instructions 2021 href: https://revenuefiles.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2022_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=35 - - 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/ + - title: MCA § 15-30-2131(1)(a) and (c) (2021) + href: https://mca.legmt.gov/bills/2022/mca/title_0150/chapter_0300/part_0210/section_0310/0150-0300-0210-0310.html diff --git a/policyengine_us/tests/code_health/test_no_group_variables_in_person_adds.py b/policyengine_us/tests/code_health/test_no_group_variables_in_person_adds.py index c3a5dfdbde3..8941a685ef2 100644 --- a/policyengine_us/tests/code_health/test_no_group_variables_in_person_adds.py +++ b/policyengine_us/tests/code_health/test_no_group_variables_in_person_adds.py @@ -110,10 +110,7 @@ # (person variable, attribute, group variable): each member gets the whole # group amount. Each was confirmed as a bug on 2026-10-06. -KNOWN_VIOLATIONS = { - # PolicyEngine/policyengine-us#9888. - ("mt_misc_deductions", "adds", "casualty_loss_deduction"), -} +KNOWN_VIOLATIONS = set() def listed_names(variable, attribute: str, parameters) -> dict[str, list[str]]: diff --git a/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/casualty_loss/mt_casualty_loss_deduction_indiv.yaml b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/casualty_loss/mt_casualty_loss_deduction_indiv.yaml new file mode 100644 index 00000000000..806f5fb5577 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/casualty_loss/mt_casualty_loss_deduction_indiv.yaml @@ -0,0 +1,229 @@ +# Montana Form 2 instructions (2022), line 15, PDF pages 35-36: +# Taxpayers calculate casualty losses using Montana AGI on Form 4684. +# Spouses filing separately calculate their own losses (also PDF page 11). +# Form 4684 lines 11-12 and 17-18 apply the $100 reduction and 10% AGI floor. +# Publication 547 (2022), PDF page 10, assigns separately owned losses to the +# owner and applies one reduction per casualty event. +# The model lacks a disaster-specific input and retains the federal casualty +# activation flag. Cases from 2021 onward enable that flag when testing +# the calculation. Earlier cases use the ordinary-loss baseline. + +- name: Only the spouse who had the loss deducts it, above 10% of their own Montana AGI + period: 2022 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + casualty_loss: 30_000 + mt_agi_indiv: 60_000 + person2: + age: 40 + mt_agi_indiv: 40_000 + tax_units: + tax_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: MT + output: + # (30,000 - 100) - 10% x 60,000; the spouse has no loss. + mt_casualty_loss_deduction_indiv: [23_900, 0] + +- name: Each spouse's loss is floored at 10% of that spouse's Montana AGI + period: 2022 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + casualty_loss: 30_000 + mt_agi_indiv: 60_000 + person2: + age: 40 + casualty_loss: 5_000 + mt_agi_indiv: 40_000 + tax_units: + tax_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: MT + output: + # (30,000 - 100) - 6,000 and (5,000 - 100) - 4,000: each spouse reduces + # their own loss by $100. + mt_casualty_loss_deduction_indiv: [23_900, 900] + +- name: A dependent's loss stays off the parents' columns, like the dependent's income + period: 2022 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + employment_income: 60_000 + casualty_loss: 30_000 + person2: + age: 40 + employment_income: 40_000 + person3: + age: 17 + is_tax_unit_dependent: true + employment_income: 5_000 + casualty_loss: 10_000 + tax_units: + tax_unit: + members: [person1, person2, person3] + households: + household: + members: [person1, person2, person3] + state_code: MT + output: + # The dependent's wages are not in the head's Montana AGI (60,000), and the + # dependent's loss belongs on the dependent's own return: + # (30,000 - 100) - 10% x 60,000 for the head. + mt_casualty_loss_deduction_indiv: [23_900, 0, 0] + +- name: Spouses filing separately on one form in 2024 have no Montana casualty line + period: 2024 + input: + # Allowing filing status 2a in 2024 (as a reform would) reaches the + # separate path; the discontinued schedule still gives no deduction. + gov.states.mt.tax.income.married_filing_separately_on_same_return_allowed: true + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + casualty_loss: 30_000 + mt_agi_indiv: 60_000 + person2: + age: 40 + mt_agi_indiv: 40_000 + tax_units: + tax_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: MT + output: + mt_casualty_loss_deduction_indiv: [0, 0] + +- name: No loss is deductible while the federal casualty deduction is suspended + period: 2022 + input: + people: + person1: + age: 40 + casualty_loss: 30_000 + mt_agi_indiv: 60_000 + person2: + age: 40 + mt_agi_indiv: 40_000 + tax_units: + tax_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: MT + output: + mt_casualty_loss_deduction_indiv: [0, 0] + +- name: In 2023, only the spouse who had the loss deducts it, above 10% of their own Montana AGI + period: 2023 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + casualty_loss: 30_000 + mt_agi_indiv: 60_000 + person2: + age: 40 + mt_agi_indiv: 40_000 + tax_units: + tax_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: MT + output: + # (30,000 - 100) - 10% x 60,000; the spouse has no loss. + mt_casualty_loss_deduction_indiv: [23_900, 0] + + +- name: The spouse owns the entire casualty loss + period: 2022 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + head: + age: 40 + employment_income: 90_000 + spouse: + age: 40 + employment_income: 20_000 + casualty_loss: 12_000 + tax_units: + tax_unit: + members: [head, spouse] + households: + household: + members: [head, spouse] + state_code: MT + output: + mt_casualty_loss_deduction_indiv: [0, 9_900] + +# In 2015 and 2017, Montana taxpayers use Montana AGI on Form 4684. +# Spouses filing separately calculate their own ordinary losses. +# Schedule III line 20 appears on PDF page 30; owner allocation appears on page 27. +# https://revenue.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2015_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=30 +# https://revenue.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2017_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=30 + +- name: Each spouse deducts only their own ordinary casualty loss in 2015 + period: 2015 + input: + people: + person1: + age: 40 + casualty_loss: 30_000 + mt_agi_indiv: 60_000 + person2: + age: 40 + mt_agi_indiv: 40_000 + tax_units: + tax_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: MT + output: + # (30,000 - 100) - 10% x 60,000; the spouse has no loss. + mt_casualty_loss_deduction_indiv: [23_900, 0] + +- name: Each spouse deducts only their own ordinary casualty loss in 2017 + period: 2017 + input: + people: + person1: + age: 40 + casualty_loss: 30_000 + mt_agi_indiv: 60_000 + person2: + age: 40 + mt_agi_indiv: 40_000 + tax_units: + tax_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: MT + output: + # (30,000 - 100) - 10% x 60,000; the spouse has no loss. + mt_casualty_loss_deduction_indiv: [23_900, 0] diff --git a/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/casualty_loss/mt_casualty_loss_deduction_joint.yaml b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/casualty_loss/mt_casualty_loss_deduction_joint.yaml new file mode 100644 index 00000000000..9711e1feddf --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/casualty_loss/mt_casualty_loss_deduction_joint.yaml @@ -0,0 +1,292 @@ +# Montana Form 2 instructions (2022), line 15, PDF pages 35-36: +# Taxpayers calculate casualty losses using Montana AGI on Form 4684. +# Spouses filing separately calculate their own losses (also PDF page 11). +# Form 4684 lines 11-12 and 17-18 apply the $100 reduction and 10% AGI floor. +# Publication 547 (2022), PDF page 10, assigns separately owned losses to the +# owner and applies one reduction per casualty event. +# The model lacks a disaster-specific input and retains the federal casualty +# activation flag. Cases from 2021 onward enable that flag when testing +# the calculation. Earlier cases use the ordinary-loss baseline. + +- name: A joint return deducts the couple's loss once, above 10% of Montana AGI + period: 2022 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + casualty_loss: 30_000 + person2: + age: 40 + tax_units: + tax_unit: + members: [person1, person2] + mt_agi_joint: 100_000 + households: + household: + members: [person1, person2] + state_code: MT + output: + # (30,000 - 100) - 10% x 100,000 + mt_casualty_loss_deduction_joint: 19_900 + +- name: Both spouses' losses are pooled on a joint return + period: 2022 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + casualty_loss: 30_000 + person2: + age: 40 + casualty_loss: 5_000 + tax_units: + tax_unit: + members: [person1, person2] + mt_agi_joint: 100_000 + households: + household: + members: [person1, person2] + state_code: MT + output: + # (35,000 - 100) - 10% x 100,000; the joint return reduces by $100 once. + mt_casualty_loss_deduction_joint: 24_900 + +- name: A dependent's loss is left to the dependent's own return + period: 2022 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + employment_income: 60_000 + casualty_loss: 30_000 + person2: + age: 40 + employment_income: 40_000 + person3: + age: 17 + is_tax_unit_dependent: true + employment_income: 5_000 + casualty_loss: 10_000 + tax_units: + tax_unit: + members: [person1, person2, person3] + households: + household: + members: [person1, person2, person3] + state_code: MT + output: + # Montana AGI is the spouses' 100,000 (the dependent's wages are on the + # dependent's own return), and so is the dependent's loss: + # (30,000 - 100) - 10% x 100,000. + mt_casualty_loss_deduction_joint: 19_900 + +- name: The 10% floor uses Montana AGI, not federal AGI + period: 2022 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + employment_income: 100_000 + casualty_loss: 30_000 + tax_units: + tax_unit: + members: [person1] + mt_agi_joint: 80_000 + households: + household: + members: [person1] + state_code: MT + output: + # (30,000 - 100) - 10% x 80,000. A federal AGI floor would give 19,900. + mt_casualty_loss_deduction_joint: 21_900 + +- name: A loss whose excess over $100 equals 10% of Montana AGI is not deductible + period: 2022 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + casualty_loss: 10_100 + tax_units: + tax_unit: + members: [person1] + mt_agi_joint: 100_000 + households: + household: + members: [person1] + state_code: MT + output: + mt_casualty_loss_deduction_joint: 0 + +- name: One dollar above the floor is deductible + period: 2022 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + casualty_loss: 10_101 + tax_units: + tax_unit: + members: [person1] + mt_agi_joint: 100_000 + households: + household: + members: [person1] + state_code: MT + output: + mt_casualty_loss_deduction_joint: 1 + +- name: A loss under $100 is not deductible even with no Montana AGI + period: 2022 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + casualty_loss: 80 + tax_units: + tax_unit: + members: [person1] + mt_agi_joint: 0 + households: + household: + members: [person1] + state_code: MT + output: + mt_casualty_loss_deduction_joint: 0 + +- name: No loss is deductible while the federal casualty deduction is suspended + period: 2022 + input: + people: + person1: + age: 40 + casualty_loss: 30_000 + tax_units: + tax_unit: + members: [person1] + mt_agi_joint: 100_000 + households: + household: + members: [person1] + state_code: MT + output: + mt_casualty_loss_deduction_joint: 0 + +- name: Montana discontinued its Itemized Deductions Schedule in 2024 + period: 2024 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + casualty_loss: 30_000 + tax_units: + tax_unit: + members: [person1] + mt_agi_joint: 100_000 + households: + household: + members: [person1] + state_code: MT + output: + mt_casualty_loss_deduction_joint: 0 + +- name: In 2023, a joint return deducts the couple's loss once, above 10% of Montana AGI + period: 2023 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + casualty_loss: 30_000 + person2: + age: 40 + tax_units: + tax_unit: + members: [person1, person2] + mt_agi_joint: 100_000 + households: + household: + members: [person1, person2] + state_code: MT + output: + # (30,000 - 100) - 10% x 100,000 + mt_casualty_loss_deduction_joint: 19_900 + + +- name: The spouse owns the entire casualty loss + period: 2022 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + head: + age: 40 + employment_income: 90_000 + spouse: + age: 40 + employment_income: 20_000 + casualty_loss: 12_000 + tax_units: + tax_unit: + members: [head, spouse] + households: + household: + members: [head, spouse] + state_code: MT + output: + mt_casualty_loss_deduction_joint: 900 + +# In 2015 and 2017, Montana taxpayers use Montana AGI on Form 4684. +# Spouses filing separately calculate their own ordinary losses. +# Schedule III line 20 appears on PDF page 30; owner allocation appears on page 27. +# https://revenue.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2015_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=30 +# https://revenue.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2017_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=30 + +- name: A joint return deducts an ordinary casualty loss in 2015 + period: 2015 + input: + people: + person1: + age: 40 + casualty_loss: 30_000 + person2: + age: 40 + tax_units: + tax_unit: + members: [person1, person2] + mt_agi_joint: 100_000 + households: + household: + members: [person1, person2] + state_code: MT + output: + # (30,000 - 100) - 10% x 100,000 + mt_casualty_loss_deduction_joint: 19_900 + +- name: A joint return deducts an ordinary casualty loss in 2017 + period: 2017 + input: + people: + person1: + age: 40 + casualty_loss: 30_000 + person2: + age: 40 + tax_units: + tax_unit: + members: [person1, person2] + mt_agi_joint: 100_000 + households: + household: + members: [person1, person2] + state_code: MT + output: + # (30,000 - 100) - 10% x 100,000 + mt_casualty_loss_deduction_joint: 19_900 diff --git a/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/federal_itemization/mt_itemized_deductions_for_federal_itemization_indiv.yaml b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/federal_itemization/mt_itemized_deductions_for_federal_itemization_indiv.yaml index 64ff39f3bf7..f2573e8cb57 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/federal_itemization/mt_itemized_deductions_for_federal_itemization_indiv.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/federal_itemization/mt_itemized_deductions_for_federal_itemization_indiv.yaml @@ -5,7 +5,7 @@ investment_interest_expense: 265 mt_salt_deduction: 5_000 mt_medical_expense_deduction_indiv: 1_000 - casualty_loss_deduction: 400 + mt_casualty_loss_deduction_indiv: 400 mt_child_dependent_care_expense_deduction: 123 mt_federal_income_tax_deduction_for_federal_itemization_indiv: 2_000 state_code: MT @@ -19,7 +19,7 @@ investment_interest_expense: 1_234 mt_salt_deduction: 10_000 mt_medical_expense_deduction_indiv: 3_000 - casualty_loss_deduction: 0 + mt_casualty_loss_deduction_indiv: 0 mt_child_dependent_care_expense_deduction: 0 mt_federal_income_tax_deduction_for_federal_itemization_indiv: 2_000 state_code: MT @@ -33,7 +33,7 @@ deductible_mortgage_interest: 34 mt_salt_deduction: 1_035 mt_medical_expense_deduction_indiv: 3_000 - casualty_loss_deduction: 745 + mt_casualty_loss_deduction_indiv: 745 mt_child_dependent_care_expense_deduction: 1_004 mt_federal_income_tax_deduction_for_federal_itemization_indiv: 2_000 state_code: MT @@ -404,3 +404,37 @@ # AGI the first $1,000 phase-out increment reduces $2,000 by 10%. deductible_mortgage_insurance_premiums: 1_800 mt_itemized_deductions_for_federal_itemization_indiv: [540, 1_260] + +# 2022 Form 2 instructions, Itemized Deductions Schedule, line 15 (PDF pp. 35-36): +# complete federal Form 4684 using Montana AGI in place of federal AGI; spouses +# filing separately each complete their own Form 4684. Each spouse deducts only +# their own loss, on their own Montana AGI; the tax unit's loss must not be +# given to every member. + +- name: Only the spouse who had the casualty loss deducts it when filing separately + period: 2022 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + employment_income: 60_000 + casualty_loss: 30_000 + mt_salt_deduction: 0 + mt_federal_income_tax_deduction_for_federal_itemization_indiv: 0 + person2: + age: 40 + employment_income: 40_000 + mt_salt_deduction: 0 + mt_federal_income_tax_deduction_for_federal_itemization_indiv: 0 + tax_units: + tax_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: MT + output: + # (30,000 - 100) - 10% x 60,000 Montana AGI in the head's column; none for + # the spouse. + mt_itemized_deductions_for_federal_itemization_indiv: [23_900, 0] diff --git a/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/federal_itemization/mt_itemized_deductions_for_federal_itemization_joint.yaml b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/federal_itemization/mt_itemized_deductions_for_federal_itemization_joint.yaml index a84d12ac6cb..6616f535cf9 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/federal_itemization/mt_itemized_deductions_for_federal_itemization_joint.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/federal_itemization/mt_itemized_deductions_for_federal_itemization_joint.yaml @@ -6,7 +6,7 @@ investment_interest_expense: 265 mt_salt_deduction: 5_000 mt_medical_expense_deduction_joint: 1_000 - casualty_loss_deduction: 400 + mt_casualty_loss_deduction_joint: 400 mt_child_dependent_care_expense_deduction_joint: 123 mt_federal_income_tax_deduction_for_federal_itemization: 2_000 state_code: MT @@ -21,7 +21,7 @@ deductible_mortgage_interest: 1_234 mt_salt_deduction: 10_000 mt_medical_expense_deduction_joint: 3_000 - casualty_loss_deduction: 0 + mt_casualty_loss_deduction_joint: 0 mt_child_dependent_care_expense_deduction_joint: 0 mt_federal_income_tax_deduction_for_federal_itemization: 2_000 state_code: MT @@ -36,7 +36,7 @@ deductible_mortgage_interest: 34 mt_salt_deduction: 1_035 mt_medical_expense_deduction_joint: 3_000 - casualty_loss_deduction: 745 + mt_casualty_loss_deduction_joint: 745 mt_child_dependent_care_expense_deduction_joint: 1_004 mt_federal_income_tax_deduction_for_federal_itemization: 2_000 state_code: MT @@ -340,3 +340,63 @@ mt_federal_income_tax_deduction_for_federal_itemization: 0 output: mt_itemized_deductions_for_federal_itemization_joint: 0 + +# 2022 Form 2 instructions, Itemized Deductions Schedule, line 15 (PDF pp. 35-36): +# complete federal Form 4684 using Montana AGI in place of federal AGI; spouses +# filing separately each complete their own Form 4684. A joint return pools the +# tax unit's losses, so they must be counted once, not once per member. + +- name: A couple's casualty loss counts once on a joint return + period: 2022 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + employment_income: 60_000 + casualty_loss: 30_000 + mt_salt_deduction: 0 + person2: + age: 40 + employment_income: 40_000 + mt_salt_deduction: 0 + tax_units: + tax_unit: + members: [person1, person2] + mt_federal_income_tax_deduction_for_federal_itemization: 0 + households: + household: + members: [person1, person2] + state_code: MT + output: + # (30,000 - 100) - 10% x 100,000 Montana AGI, counted once. + mt_itemized_deductions_for_federal_itemization_joint: [19_900, 0] + +- name: A dependent in the tax unit does not repeat the joint casualty loss + period: 2022 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + employment_income: 60_000 + casualty_loss: 30_000 + mt_salt_deduction: 0 + person2: + age: 40 + employment_income: 40_000 + mt_salt_deduction: 0 + person3: + age: 10 + is_tax_unit_dependent: true + mt_salt_deduction: 0 + tax_units: + tax_unit: + members: [person1, person2, person3] + mt_federal_income_tax_deduction_for_federal_itemization: 0 + households: + household: + members: [person1, person2, person3] + state_code: MT + output: + mt_itemized_deductions_for_federal_itemization_joint: [19_900, 0, 0] diff --git a/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_claim_of_right_deduction.yaml b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_claim_of_right_deduction.yaml index b5846be698e..5abeedb11a6 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_claim_of_right_deduction.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_claim_of_right_deduction.yaml @@ -162,14 +162,15 @@ deductible_mortgage_interest: 0 mt_medical_expense_deduction_joint: 0 mt_salt_deduction: 0 - casualty_loss_deduction: 400 + mt_casualty_loss_deduction_joint: 400 mt_child_dependent_care_expense_deduction_joint: 0 mt_federal_income_tax_deduction_unit: 0 mt_federal_income_tax_deduction_for_federal_itemization: 0 output: # 2,000 + 1,000 + 300 - 2% * 40,000 = 2,500; federal misc is unused. mt_misc_deductions_subject_to_floor_joint: 2_500 - mt_misc_deductions: 400 + mt_misc_deductions: 0 + mt_casualty_loss_deduction_joint: 400 mt_itemized_deductions_joint: 12_900 mt_itemized_deductions_for_federal_itemization_joint: 12_900 @@ -227,7 +228,6 @@ tax_units: unit: members: [head, spouse] - casualty_loss_deduction: 0 mt_agi_joint: 60_000 charitable_deduction: 10_000 # Preserve the federal aggregate approximation while testing the @@ -571,7 +571,6 @@ tax_units: unit: members: [head, spouse] - casualty_loss_deduction: 0 claim_of_right_deduction: 7_000 mt_agi_joint: 60_000 households: diff --git a/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_itemized_deductions_indiv.yaml b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_itemized_deductions_indiv.yaml index 822905cf764..419366a9e9c 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_itemized_deductions_indiv.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_itemized_deductions_indiv.yaml @@ -5,7 +5,7 @@ investment_interest_expense: 265 mt_salt_deduction: 5_000 mt_medical_expense_deduction_indiv: 1_000 - casualty_loss_deduction: 400 + mt_casualty_loss_deduction_indiv: 400 mt_child_dependent_care_expense_deduction: 123 mt_federal_income_tax_deduction_indiv: 2_000 state_code: MT @@ -19,7 +19,7 @@ investment_interest_expense: 1_234 mt_salt_deduction: 10_000 mt_medical_expense_deduction_indiv: 3_000 - casualty_loss_deduction: 0 + mt_casualty_loss_deduction_indiv: 0 mt_child_dependent_care_expense_deduction: 0 mt_federal_income_tax_deduction_indiv: 2_000 state_code: MT @@ -33,7 +33,7 @@ deductible_mortgage_interest: 34 mt_salt_deduction: 1_035 mt_medical_expense_deduction_indiv: 3_000 - casualty_loss_deduction: 745 + mt_casualty_loss_deduction_indiv: 745 mt_child_dependent_care_expense_deduction: 1_004 mt_federal_income_tax_deduction_indiv: 2_000 state_code: MT @@ -185,3 +185,74 @@ # AGI the first $1,000 phase-out increment reduces $2,000 by 10%. deductible_mortgage_insurance_premiums: 1_800 mt_itemized_deductions_indiv: [540, 1_260] + +# 2022 Form 2 instructions, Itemized Deductions Schedule, line 15 (PDF pp. 35-36): +# complete federal Form 4684 using Montana AGI in place of federal AGI; spouses +# filing separately each complete their own Form 4684. Each spouse deducts only +# their own loss, on their own Montana AGI; the tax unit's loss must not be +# given to every member. + +- name: Only the spouse who had the casualty loss deducts it when filing separately + period: 2022 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + employment_income: 60_000 + casualty_loss: 30_000 + mt_salt_deduction: 0 + mt_federal_income_tax_deduction_indiv: 0 + person2: + age: 40 + employment_income: 40_000 + mt_salt_deduction: 0 + mt_federal_income_tax_deduction_indiv: 0 + tax_units: + tax_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: MT + output: + # (30,000 - 100) - 10% x 60,000 Montana AGI in the head's column; none for + # the spouse. + mt_itemized_deductions_indiv: [23_900, 0] + +# 2017 Form 2 instructions, Schedule III, line 20 (PDF p. 30): spouses filing +# separately each complete their own Form 4684 using their own Montana AGI. +# gov.irs.deductions.itemized.casualty.active is true through 2017, so this +# case sets no reform input. +# https://revenue.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2017_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=30 + +- name: Only the spouse who had an ordinary casualty loss deducts it when filing separately in 2017 + period: 2017 + input: + people: + person1: + age: 40 + employment_income: 60_000 + casualty_loss: 30_000 + mt_salt_deduction: 0 + mt_federal_income_tax_deduction_indiv: 0 + person2: + age: 40 + employment_income: 40_000 + mt_salt_deduction: 0 + mt_federal_income_tax_deduction_indiv: 0 + tax_units: + tax_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: MT + output: + # Form 4684 lines 11 and 17 with the head's Montana AGI: + # (30,000 - 100) - 10% x 60,000 = 23,900; none for the spouse. + # Adding the federal deduction of 30,000 - 10% x 100,000 = 20,000 to + # each column would give [43,900, 20,000]. + mt_itemized_deductions_indiv: [23_900, 0] + # Each spouse's own wages, with no Montana additions or subtractions. + mt_agi_indiv: [60_000, 40_000] diff --git a/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_itemized_deductions_joint.yaml b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_itemized_deductions_joint.yaml index d71674cb460..bf84b151222 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_itemized_deductions_joint.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_itemized_deductions_joint.yaml @@ -6,7 +6,7 @@ investment_interest_expense: 265 mt_salt_deduction: 5_000 mt_medical_expense_deduction_joint: 1_000 - casualty_loss_deduction: 400 + mt_casualty_loss_deduction_joint: 400 mt_child_dependent_care_expense_deduction_joint: 123 mt_federal_income_tax_deduction_unit: 2_000 state_code: MT @@ -21,7 +21,7 @@ deductible_mortgage_interest: 1_234 mt_salt_deduction: 10_000 mt_medical_expense_deduction_joint: 3_000 - casualty_loss_deduction: 0 + mt_casualty_loss_deduction_joint: 0 mt_child_dependent_care_expense_deduction_joint: 0 mt_federal_income_tax_deduction_unit: 2_000 state_code: MT @@ -36,7 +36,7 @@ deductible_mortgage_interest: 34 mt_salt_deduction: 1_035 mt_medical_expense_deduction_joint: 3_000 - casualty_loss_deduction: 745 + mt_casualty_loss_deduction_joint: 745 mt_child_dependent_care_expense_deduction_joint: 1_004 mt_federal_income_tax_deduction_unit: 2_000 state_code: MT @@ -374,3 +374,99 @@ mt_federal_income_tax_deduction_unit: 0 output: mt_itemized_deductions_joint: 0 + +# 2022 Form 2 instructions, Itemized Deductions Schedule, line 15 (PDF pp. 35-36): +# complete federal Form 4684 using Montana AGI in place of federal AGI; spouses +# filing separately each complete their own Form 4684. A joint return pools the +# tax unit's losses, so they must be counted once, not once per member. + +- name: A couple's casualty loss counts once on a joint return + period: 2022 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + employment_income: 60_000 + casualty_loss: 30_000 + mt_salt_deduction: 0 + person2: + age: 40 + employment_income: 40_000 + mt_salt_deduction: 0 + tax_units: + tax_unit: + members: [person1, person2] + mt_federal_income_tax_deduction_unit: 0 + households: + household: + members: [person1, person2] + state_code: MT + output: + # (30,000 - 100) - 10% x 100,000 Montana AGI, counted once. + mt_itemized_deductions_joint: [19_900, 0] + +- name: A dependent in the tax unit does not repeat the joint casualty loss + period: 2022 + input: + gov.irs.deductions.itemized.casualty.active: true + people: + person1: + age: 40 + employment_income: 60_000 + casualty_loss: 30_000 + mt_salt_deduction: 0 + person2: + age: 40 + employment_income: 40_000 + mt_salt_deduction: 0 + person3: + age: 10 + is_tax_unit_dependent: true + mt_salt_deduction: 0 + tax_units: + tax_unit: + members: [person1, person2, person3] + mt_federal_income_tax_deduction_unit: 0 + households: + household: + members: [person1, person2, person3] + state_code: MT + output: + mt_itemized_deductions_joint: [19_900, 0, 0] + +# 2017 Form 2 instructions, Schedule III, line 20 (PDF p. 30): complete federal +# Form 4684 using Montana AGI in place of federal AGI. +# gov.irs.deductions.itemized.casualty.active is true through 2017, so this +# case sets no reform input. +# https://revenue.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2017_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=30 + +- name: A couple's ordinary casualty loss counts once on a 2017 joint return + period: 2017 + input: + people: + person1: + age: 40 + employment_income: 60_000 + casualty_loss: 30_000 + mt_salt_deduction: 0 + person2: + age: 40 + employment_income: 40_000 + mt_salt_deduction: 0 + tax_units: + tax_unit: + members: [person1, person2] + mt_federal_income_tax_deduction_unit: 0 + households: + household: + members: [person1, person2] + state_code: MT + output: + # Form 4684 lines 11 and 17 with Montana AGI: + # (30,000 - 100) - 10% x 100,000 = 19,900, counted once. + # Adding the federal deduction of 30,000 - 10% x 100,000 = 20,000 for + # each spouse would give 19,900 + 2 x 20,000 = 59,900. + mt_itemized_deductions_joint: [19_900, 0] + # Wages of 60,000 + 40,000, with no Montana additions or subtractions. + mt_agi_joint: 100_000 diff --git a/policyengine_us/tests/unit/test_mt_casualty_loss_deduction_properties.py b/policyengine_us/tests/unit/test_mt_casualty_loss_deduction_properties.py new file mode 100644 index 00000000000..4a72b2df1c9 --- /dev/null +++ b/policyengine_us/tests/unit/test_mt_casualty_loss_deduction_properties.py @@ -0,0 +1,197 @@ +"""Properties of Montana casualty deductions in 2015, 2017 and 2021-2024. + +Montana taxpayers use federal Form 4684 with Montana AGI and calculate +separate spouse losses. They report losses on Schedule III line 20 in 2015 +and 2017, and Itemized Deductions Schedule line 15 in 2021-2023. Each test +checks every point of an input grid in one vectorized +simulation: + +- both variants match a closed-form reference of Form 4684 lines 11-12 and + 17-18: the loss less $100, above 10% of Montana AGI; +- a joint return counts the spouses' losses once, however many members the + tax unit has, and Montana's joint itemized deductions add it once; +- filing separately, each spouse deducts only their own loss, floored at their + own Montana AGI; +- a dependent's loss is left to the dependent's own return on both paths; +- the deductions are non-negative, never exceed the loss less $100, rise with + the loss and fall with Montana AGI; +- for a single filer the joint and separate variants agree; +- the deduction ends in 2024, when Montana discontinued its Itemized + Deductions Schedule. + +The model has no input that distinguishes federally declared disaster losses, +so, like the federal deduction, it allows no personal casualty loss from 2018 +unless gov.irs.deductions.itemized.casualty.active is on; a reform switches it +on so the properties are not vacuous. These properties cover ordinary +losses under the model's one-event convention. They do not cover qualified +disaster losses or casualty-gain netting. +""" + +import itertools + +import numpy as np +import pytest +from policyengine_core.reforms import Reform + +from policyengine_us import Simulation + +REDUCTION = 100 # Form 4684 line 11 +FLOOR = 0.1 # Form 4684 line 17 + +HEAD_LOSSES = [0, 80, 100, 101, 5_000, 30_000] +SPOUSE_LOSSES = [0, 100, 5_000] +HEAD_AGIS = [0, 40_000, 300_000] +SPOUSE_AGIS = [0, 60_000] +# (number of dependents, the first dependent's loss) +DEPENDENTS = [(0, 0), (1, 0), (1, 2_000), (2, 0)] +COUPLE_GRID = list( + itertools.product(HEAD_LOSSES, SPOUSE_LOSSES, HEAD_AGIS, SPOUSE_AGIS, DEPENDENTS) +) +SINGLE_GRID = list(itertools.product(HEAD_LOSSES, HEAD_AGIS)) +YEARS = [2015, 2017, 2021, 2022, 2023, 2024] + +ACTIVE = Reform.from_dict( + {"gov.irs.deductions.itemized.casualty.active": {"2010-01-01.2100-12-31": True}}, + country_id="us", +) + + +def reference(loss, agi): + return np.maximum(np.maximum(loss - REDUCTION, 0) - FLOOR * agi, 0) + + +def every_year(value): + return {year: value for year in YEARS} + + +@pytest.fixture(scope="module") +def grid(): + """One simulation holding every couple and single-filer grid point.""" + people, tax_units, households = {}, {}, {} + roles = [] # (unit index, role) for each person, in order + for i, (l1, l2, a1, a2, (n_deps, dep_loss)) in enumerate(COUPLE_GRID): + members = [f"c{i}_head", f"c{i}_spouse"] + people[members[0]] = { + "age": every_year(40), + "casualty_loss": every_year(l1), + "mt_agi_indiv": every_year(a1), + } + people[members[1]] = { + "age": every_year(40), + "casualty_loss": every_year(l2), + "mt_agi_indiv": every_year(a2), + } + roles += [(i, "head"), (i, "spouse")] + for d in range(n_deps): + name = f"c{i}_dep{d}" + people[name] = { + "age": every_year(10), + "is_tax_unit_dependent": every_year(True), + "casualty_loss": every_year(dep_loss if d == 0 else 0), + "mt_agi_indiv": every_year(0), + } + members.append(name) + roles.append((i, "dependent")) + tax_units[f"c{i}"] = {"members": members, "mt_agi_joint": every_year(a1 + a2)} + households[f"c{i}"] = {"members": members, "state_code": every_year("MT")} + for j, (loss, agi) in enumerate(SINGLE_GRID): + name = f"s{j}" + people[name] = { + "age": every_year(40), + "casualty_loss": every_year(loss), + "mt_agi_indiv": every_year(agi), + } + roles.append((len(COUPLE_GRID) + j, "single")) + tax_units[name] = {"members": [name], "mt_agi_joint": every_year(agi)} + households[name] = {"members": [name], "state_code": every_year("MT")} + # Zero the other itemized deductions so the aggregators show the casualty + # loss alone; the grid has no medical, care, charitable or interest items. + for person in people.values(): + person["mt_misc_deductions"] = every_year(0) + person["mt_salt_deduction"] = every_year(0) + person["mt_federal_income_tax_deduction_indiv"] = every_year(0) + for unit in tax_units.values(): + unit["mt_federal_income_tax_deduction_unit"] = every_year(0) + sim = Simulation( + situation={"people": people, "tax_units": tax_units, "households": households}, + reform=ACTIVE, + ) + unit = np.array([r[0] for r in roles]) + role = np.array([r[1] for r in roles]) + return sim, unit, role + + +def couple_arrays(): + columns = np.array( + [(l1, l2, a1, a2, n, d) for l1, l2, a1, a2, (n, d) in COUPLE_GRID], + dtype=float, + ).T + return columns # head loss, spouse loss, head AGI, spouse AGI, deps, dep loss + + +@pytest.mark.parametrize("year", [2015, 2017, 2021, 2022, 2023]) +def test_joint_return_counts_the_unit_loss_once(grid, year): + sim, unit, role = grid + l1, l2, a1, a2, _, _ = couple_arrays() + n = len(COUPLE_GRID) + joint = sim.calculate("mt_casualty_loss_deduction_joint", year)[:n] + # A dependent's loss is left to the dependent's own return. + np.testing.assert_allclose(joint, reference(l1 + l2, a1 + a2)) + # Montana's joint itemized deductions add it once, at the head, however + # many members the tax unit has. + itemized = sim.calculate("mt_itemized_deductions_joint", year) + per_unit = np.bincount(unit, weights=itemized)[:n] + np.testing.assert_allclose(per_unit, joint) + assert np.all(itemized[(role != "head") & (role != "single")] == 0) + assert np.all(joint >= 0) + assert np.all(joint <= np.maximum(l1 + l2 - REDUCTION, 0)) + # Guard against a vacuous pass. + assert joint.max() > 0 + + +@pytest.mark.parametrize("year", [2015, 2017, 2021, 2022, 2023]) +def test_separate_filers_deduct_only_their_own_loss(grid, year): + sim, unit, role = grid + l1, l2, a1, a2, _, _ = couple_arrays() + indiv = sim.calculate("mt_casualty_loss_deduction_indiv", year) + itemized = sim.calculate("mt_itemized_deductions_indiv", year) + head = indiv[role == "head"] + spouse = indiv[role == "spouse"] + # Each spouse's own Form 4684, on their own Montana AGI; a dependent's + # loss is in neither column. + np.testing.assert_allclose(head, reference(l1, a1)) + np.testing.assert_allclose(spouse, reference(l2, a2)) + assert np.all(indiv[role == "dependent"] == 0) + # A spouse without a loss deducts nothing, whatever the other spouse lost. + assert np.all(spouse[l2 == 0] == 0) + assert np.all(head[l1 == 0] == 0) + # The separate itemized deductions carry each spouse's own amount. + np.testing.assert_allclose(itemized[role == "head"], head) + np.testing.assert_allclose(itemized[role == "spouse"], spouse) + assert np.all(itemized[role == "dependent"] == 0) + assert np.all(indiv >= 0) + assert head.max() > 0 and spouse.max() > 0 + + +@pytest.mark.parametrize("year", [2015, 2017, 2021, 2022, 2023]) +def test_single_filer_variants_agree_and_are_monotone(grid, year): + sim, unit, role = grid + single = role == "single" + single_units = unit[single] + loss = np.array([g[0] for g in SINGLE_GRID], dtype=float) + agi = np.array([g[1] for g in SINGLE_GRID], dtype=float) + indiv = sim.calculate("mt_casualty_loss_deduction_indiv", year)[single] + joint = sim.calculate("mt_casualty_loss_deduction_joint", year)[single_units] + np.testing.assert_allclose(joint, reference(loss, agi)) + np.testing.assert_allclose(indiv, joint) + table = joint.reshape(len(HEAD_LOSSES), len(HEAD_AGIS)) + assert np.all(np.diff(table, axis=0) >= 0), "falls as the loss rises" + assert np.all(np.diff(table, axis=1) <= 0), "rises as Montana AGI rises" + + +def test_deduction_ends_with_the_2024_schedule(grid): + sim, _, _ = grid + assert np.all(sim.calculate("mt_casualty_loss_deduction_joint", 2024) == 0) + assert np.all(sim.calculate("mt_casualty_loss_deduction_indiv", 2024) == 0) + # The same inputs are deductible in 2023. + assert sim.calculate("mt_casualty_loss_deduction_joint", 2023).max() > 0 diff --git a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/casualty_loss/mt_casualty_loss_deduction_indiv.py b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/casualty_loss/mt_casualty_loss_deduction_indiv.py new file mode 100644 index 00000000000..1955660cac1 --- /dev/null +++ b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/casualty_loss/mt_casualty_loss_deduction_indiv.py @@ -0,0 +1,58 @@ +from policyengine_us.model_api import * + + +class mt_casualty_loss_deduction_indiv(Variable): + value_type = float + entity = Person + label = ( + "Montana casualty and theft loss deduction when married couples file separately" + ) + unit = USD + definition_period = YEAR + documentation = """ + PolicyEngine treats each spouse's reported loss amount as one casualty and applies one per-casualty reduction to that spouse's loss. + Taxpayers apply separate reductions to distinct events, which the + available inputs cannot represent. The model has no input identifying + disaster losses and retains the federal casualty activation flag. + """ + reference = ( + # MCA § 15-30-2131(1)(a) (2021) + "https://mca.legmt.gov/bills/2022/mca/title_0150/chapter_0300/part_0210/section_0310/0150-0300-0210-0310.html", + # 2015 Form 2, Schedule III line 20; PDF pages 27, 30 + "https://revenue.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2015_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=30", + # 2017 Form 2, Schedule III line 20; PDF pages 27, 30 + "https://revenue.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2017_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=30", + # PDF pages 11, 35-36 + "https://revenue.mt.gov/files/forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2022_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=11", + # 2022 Form 4684, lines 10-12 and 17; IRS Publication 547, $100 Rule + "https://www.irs.gov/pub/irs-prior/f4684--2022.pdf#page=1", + "https://www.irs.gov/pub/irs-prior/p547--2022.pdf#page=10", + ) + defined_for = "mt_married_filing_separately_on_same_return_eligible" + + def formula(person, period, parameters): + p = parameters(period).gov.states.mt.tax.income.deductions.itemized + if not p.casualty_loss.applies: + return 0 + # Spouses filing separately each complete a separate federal Form 4684 + # for their own loss, using their own Montana adjusted gross income in + # place of federal adjusted gross income. A deduction attributable to + # only one spouse must be claimed by that spouse. + # From 2018 to 2023, Montana taxpayers may deduct only federally declared + # disaster losses. The Department of Revenue states this at line 15 of + # its Form 2 instructions: PDF page 29 for 2018, 34 for 2019, 31 for + # 2020, 34 for 2021, 35 for 2022 and 39 for 2023. The model cannot + # distinguish disaster losses, so it retains the federal activation + # flag. No personal casualty loss is deductible while + # gov.irs.deductions.itemized.casualty.active is false (from 2018). + p_casualty = parameters(period).gov.irs.deductions.itemized.casualty + # Only the owner of the property claims the loss. A dependent's loss + # belongs on the dependent's own return, as the dependent's income does: + # adjusted_gross_income_person, and so Montana AGI, leaves it out. + head_or_spouse = person("is_tax_unit_head_or_spouse", period) + loss = head_or_spouse * person("casualty_loss", period) + # Spouses filing separately each reduce their own loss by $100 + # (Form 4684 line 11), treating each column's losses as one casualty. + reduced_loss = max_(loss - p_casualty.per_casualty_reduction, 0) + agi = person("mt_agi_indiv", period) + return p_casualty.active * max_(reduced_loss - agi * p_casualty.floor, 0) diff --git a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/casualty_loss/mt_casualty_loss_deduction_joint.py b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/casualty_loss/mt_casualty_loss_deduction_joint.py new file mode 100644 index 00000000000..fbe1f8c7a39 --- /dev/null +++ b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/casualty_loss/mt_casualty_loss_deduction_joint.py @@ -0,0 +1,56 @@ +from policyengine_us.model_api import * + + +class mt_casualty_loss_deduction_joint(Variable): + value_type = float + entity = TaxUnit + label = "Montana casualty and theft loss deduction on a joint return" + unit = USD + definition_period = YEAR + documentation = """ + PolicyEngine treats the head's and spouse's combined reported losses as one casualty and applies one per-casualty reduction. + Taxpayers apply separate reductions to distinct events, which the + available inputs cannot represent. The model has no input identifying + disaster losses and retains the federal casualty activation flag. + """ + reference = ( + # MCA § 15-30-2131(1)(a) (2021) + "https://mca.legmt.gov/bills/2022/mca/title_0150/chapter_0300/part_0210/section_0310/0150-0300-0210-0310.html", + # 2015 Form 2, Schedule III line 20; PDF pages 27, 30 + "https://revenue.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2015_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=30", + # 2017 Form 2, Schedule III line 20; PDF pages 27, 30 + "https://revenue.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2017_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=30", + # PDF pages 35-36 + "https://revenue.mt.gov/files/forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2022_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=35", + # 2022 Form 4684, lines 10-12 and 17; IRS Publication 547, $100 Rule + "https://www.irs.gov/pub/irs-prior/f4684--2022.pdf#page=1", + "https://www.irs.gov/pub/irs-prior/p547--2022.pdf#page=10", + ) + defined_for = StateCode.MT + + def formula(tax_unit, period, parameters): + p = parameters(period).gov.states.mt.tax.income.deductions.itemized + if not p.casualty_loss.applies: + return 0 + # The return figures its loss as on federal Form 4684 (lines 10-18), + # using its Montana adjusted gross income in place of federal adjusted + # gross income. + # From 2018 to 2023, Montana taxpayers may deduct only federally declared + # disaster losses. The Department of Revenue states this at line 15 of + # its Form 2 instructions: PDF page 29 for 2018, 34 for 2019, 31 for + # 2020, 34 for 2021, 35 for 2022 and 39 for 2023. The model cannot + # distinguish disaster losses, so it retains the federal activation + # flag. No personal casualty loss is deductible while + # gov.irs.deductions.itemized.casualty.active is false (from 2018). + p_casualty = parameters(period).gov.irs.deductions.itemized.casualty + # A joint return is one individual for the $100 rule. The model records + # one loss amount per person, not separate casualty events, so the + # return's losses are treated as one casualty and the $100 reduction + # (Form 4684 line 11) applies once. + # Only the owner of the property claims the loss. A dependent's loss + # belongs on the dependent's own return, as the dependent's income does: + # adjusted_gross_income_person, and so Montana AGI, leaves it out. + loss = tax_unit_non_dep_add(tax_unit, period, ["casualty_loss"]) + reduced_loss = max_(loss - p_casualty.per_casualty_reduction, 0) + agi = tax_unit("mt_agi_joint", period) + return p_casualty.active * max_(reduced_loss - agi * p_casualty.floor, 0) diff --git a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/federal_itemization/mt_itemized_deductions_for_federal_itemization_indiv.py b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/federal_itemization/mt_itemized_deductions_for_federal_itemization_indiv.py index 1c1a049fbba..a23ef9a2984 100644 --- a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/federal_itemization/mt_itemized_deductions_for_federal_itemization_indiv.py +++ b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/federal_itemization/mt_itemized_deductions_for_federal_itemization_indiv.py @@ -12,8 +12,8 @@ class mt_itemized_deductions_for_federal_itemization_indiv(Variable): # 2021 Form 2 line 9 includes qualified mortgage insurance premiums # allowed on the federal return, after the federal AGI phase-out. "https://revenuefiles.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2/2022_Montana_Individual_Income_Tax_Return_Form_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) + "https://mca.legmt.gov/bills/2022/mca/title_0150/chapter_0300/part_0210/section_0310/0150-0300-0210-0310.html", + # MCA § 15-30-2131(1) (2021) "https://mca.legmt.gov/bills/2019/mca/title_0150/chapter_0300/part_0210/section_0010/0150-0300-0210-0010.html", # MCA 15-30-2101: "Internal Revenue Code" means the IRC as amended "https://revenuefiles.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2023_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=38", @@ -48,6 +48,7 @@ def formula(person, period, parameters): period, [ "mt_misc_deductions", + "mt_casualty_loss_deduction_indiv", "mt_misc_deductions_subject_to_floor_indiv", "mt_child_dependent_care_expense_deduction", "mt_medical_expense_deduction_indiv", diff --git a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/federal_itemization/mt_itemized_deductions_for_federal_itemization_joint.py b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/federal_itemization/mt_itemized_deductions_for_federal_itemization_joint.py index 17125439820..13b486d4128 100644 --- a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/federal_itemization/mt_itemized_deductions_for_federal_itemization_joint.py +++ b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/federal_itemization/mt_itemized_deductions_for_federal_itemization_joint.py @@ -12,8 +12,8 @@ class mt_itemized_deductions_for_federal_itemization_joint(Variable): # 2021 Form 2 line 9 includes qualified mortgage insurance premiums # allowed on the federal return, after the federal AGI phase-out. "https://revenuefiles.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2/2022_Montana_Individual_Income_Tax_Return_Form_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) + "https://mca.legmt.gov/bills/2022/mca/title_0150/chapter_0300/part_0210/section_0310/0150-0300-0210-0310.html", + # MCA § 15-30-2131(1) (2021) "https://mca.legmt.gov/bills/2019/mca/title_0150/chapter_0300/part_0210/section_0010/0150-0300-0210-0010.html", # MCA 15-30-2101: "Internal Revenue Code" means the IRC as amended "https://revenuefiles.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2023_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=38", @@ -48,6 +48,7 @@ def formula(person, period, parameters): period, [ "mt_misc_deductions", + "mt_casualty_loss_deduction_joint", "mt_misc_deductions_subject_to_floor_joint", "mt_child_dependent_care_expense_deduction_joint", "mt_medical_expense_deduction_joint", diff --git a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/general/mt_itemized_deductions_joint.py b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/general/mt_itemized_deductions_joint.py index 526246e927a..858607cdd4e 100644 --- a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/general/mt_itemized_deductions_joint.py +++ b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/general/mt_itemized_deductions_joint.py @@ -12,8 +12,8 @@ class mt_itemized_deductions_joint(Variable): # 2021 Form 2 line 9 includes qualified mortgage insurance premiums # allowed on the federal return, after the federal AGI phase-out. "https://revenuefiles.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2/2022_Montana_Individual_Income_Tax_Return_Form_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) + "https://mca.legmt.gov/bills/2022/mca/title_0150/chapter_0300/part_0210/section_0310/0150-0300-0210-0310.html", + # MCA § 15-30-2131(1) (2021) "https://mca.legmt.gov/bills/2019/mca/title_0150/chapter_0300/part_0210/section_0010/0150-0300-0210-0010.html", # MCA 15-30-2101: "Internal Revenue Code" means the IRC as amended "https://revenuefiles.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2023_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=38", @@ -48,6 +48,7 @@ def formula(person, period, parameters): period, [ "mt_misc_deductions", + "mt_casualty_loss_deduction_joint", "mt_misc_deductions_subject_to_floor_joint", "mt_child_dependent_care_expense_deduction_joint", "mt_medical_expense_deduction_joint", diff --git a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/general/mt_non_medical_itemized_deductions_indiv.py b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/general/mt_non_medical_itemized_deductions_indiv.py index 508f4b7310f..61e19471b4f 100644 --- a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/general/mt_non_medical_itemized_deductions_indiv.py +++ b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/general/mt_non_medical_itemized_deductions_indiv.py @@ -12,8 +12,8 @@ class mt_non_medical_itemized_deductions_indiv(Variable): # 2021 Form 2 line 9 includes qualified mortgage insurance premiums # allowed on the federal return, after the federal AGI phase-out. "https://revenuefiles.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2/2022_Montana_Individual_Income_Tax_Return_Form_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) + "https://mca.legmt.gov/bills/2022/mca/title_0150/chapter_0300/part_0210/section_0310/0150-0300-0210-0310.html", + # MCA § 15-30-2131(1) (2021) "https://mca.legmt.gov/bills/2019/mca/title_0150/chapter_0300/part_0210/section_0010/0150-0300-0210-0010.html", # MCA 15-30-2101: "Internal Revenue Code" means the IRC as amended "https://revenuefiles.mt.gov/files/Forms/Montana-Individual-Income-Tax-Return-Form-2-Instructions/2023_Montana_Individual_Income_Tax_Return_Form_2_Instructions.pdf#page=38", @@ -48,6 +48,7 @@ def formula(person, period, parameters): period, [ "mt_misc_deductions", + "mt_casualty_loss_deduction_indiv", "mt_misc_deductions_subject_to_floor_indiv", "mt_child_dependent_care_expense_deduction", "mt_salt_deduction",