Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
52ffe10
Align Montana separate-filing allocations and the elderly credit with…
MaxGhenis Oct 6, 2026
304d880
Update the 2021 Montana rebate case for per-spouse federal tax deduct…
MaxGhenis Oct 6, 2026
6eefe27
Address review: no care deduction on a separate form; name the 2023 s…
MaxGhenis Oct 6, 2026
95d94db
Count a Montana casualty loss once per joint return and per owning sp…
MaxGhenis Oct 6, 2026
9220847
Apply the Form 4684 $100 reduction and add Montana casualty loss prop…
MaxGhenis Oct 6, 2026
9e7c5d1
Merge remote-tracking branch 'upstream/fix-mt-separate-filing-allocat…
MaxGhenis Oct 6, 2026
e352ed0
Leave dependents' casualty losses to their own returns; address review
MaxGhenis Oct 6, 2026
6aad4a1
Merge main into Montana casualty loss branch
MaxGhenis Nov 13, 2026
4945231
Document Montana casualty assumptions and cover review cases
MaxGhenis Nov 13, 2026
99560b7
Cover historical Montana casualty deductions
MaxGhenis Nov 13, 2026
c527ba3
Retarget Montana casualty component in repayment test
MaxGhenis Nov 13, 2026
1e25dfd
Merge main into the Montana casualty loss branch
MaxGhenis Nov 14, 2026
06eb060
Test Montana's 2017 casualty loss from wages on joint and separate re…
MaxGhenis Nov 14, 2026
e425a8e
Date Montana's casualty parameter from 2015 and remove unread test in…
MaxGhenis Nov 14, 2026
f631d44
Date Montana's disaster-only casualty limit from 2018; cite official MCA
MaxGhenis Nov 14, 2026
c58defd
Cite Montana's Department of Revenue for the disaster-only casualty l…
MaxGhenis Nov 14, 2026
e8c5298
Merge main into the Montana casualty loss branch
MaxGhenis Nov 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fix-mt-casualty-loss-misc-deduction.fixed.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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]]:
Expand Down
Original file line number Diff line number Diff line change
@@ -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]
Loading
Loading