From 7556b1cff44d74310924d79f45eb2fb1760a8cff Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 23:15:21 +0000 Subject: [PATCH 1/2] Count Missouri's self-employment tax deduction net of the federal AGI deduction RSMo 143.141(4)(c) allows the self-employment tax as a Missouri itemized deduction only to the extent it was not deducted in computing federal AGI, and the 2017 MO-A Part 2 line 7 instructions take Form 1040 line 57 minus line 27. The itemized source list added the full tax, so filers with self-employment income got the deductible half twice. Add mo_self_employment_tax_addback (tax less self_employment_tax_ald, floored at zero) and use it in the list for every year it covers. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LwQq6HbXwfKTi295BXtxZU --- changelog.d/mo-se-tax-addback.fixed.md | 1 + .../mo/tax/income/deductions/itemized.yaml | 3 +- .../deductions/mo_itemized_deductions.yaml | 32 +++++++++ .../mo_self_employment_tax_addback.yaml | 65 +++++++++++++++++++ .../mo_self_employment_tax_addback.py | 26 ++++++++ 5 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 changelog.d/mo-se-tax-addback.fixed.md create mode 100644 policyengine_us/tests/policy/baseline/gov/states/mo/tax/income/deductions/mo_self_employment_tax_addback.yaml create mode 100644 policyengine_us/variables/gov/states/mo/tax/income/deductions/mo_self_employment_tax_addback.py diff --git a/changelog.d/mo-se-tax-addback.fixed.md b/changelog.d/mo-se-tax-addback.fixed.md new file mode 100644 index 00000000000..63bcf3efa7c --- /dev/null +++ b/changelog.d/mo-se-tax-addback.fixed.md @@ -0,0 +1 @@ +Count Missouri's self-employment tax itemized deduction net of the part already deducted in federal adjusted gross income (RSMo 143.141(4)(c)). diff --git a/policyengine_us/parameters/gov/states/mo/tax/income/deductions/itemized.yaml b/policyengine_us/parameters/gov/states/mo/tax/income/deductions/itemized.yaml index 3697722ac65..d9d65a9a38d 100644 --- a/policyengine_us/parameters/gov/states/mo/tax/income/deductions/itemized.yaml +++ b/policyengine_us/parameters/gov/states/mo/tax/income/deductions/itemized.yaml @@ -7,7 +7,8 @@ values: - employee_social_security_tax - employee_medicare_tax - additional_medicare_tax - - self_employment_tax + # RSMo 143.141(4)(c): only the part not deducted in federal AGI. + - mo_self_employment_tax_addback metadata: unit: list label: Missouri itemized deduction sources diff --git a/policyengine_us/tests/policy/baseline/gov/states/mo/tax/income/deductions/mo_itemized_deductions.yaml b/policyengine_us/tests/policy/baseline/gov/states/mo/tax/income/deductions/mo_itemized_deductions.yaml index b6d54f54e1c..e6868c30715 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/mo/tax/income/deductions/mo_itemized_deductions.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/mo/tax/income/deductions/mo_itemized_deductions.yaml @@ -113,3 +113,35 @@ state_code: MO output: mo_itemized_deductions: 10_000 + +# Single filer, $100,000 of self-employment income and $20,000 of cash +# charity. Self-employment tax 14,129.55, of which 7,064.77 is deducted in +# federal AGI, so RSMo 143.141(4)(c) adds back only 7,064.77. Before the fix +# the full tax was added: 34,129.55. +- name: 2017 self-employment tax counted net of the federal AGI deduction + period: 2017 + absolute_error_margin: 0.01 + input: + people: + head: {age: 40, self_employment_income: 100_000, charitable_cash_donations: 20_000} + tax_units: {tax_unit: {members: [head]}} + households: {household: {members: [head], state_code: MO}} + output: + self_employment_tax: 14_129.55 + self_employment_tax_ald: 7_064.77 + mo_self_employment_tax_addback: 7_064.77 + mo_itemized_deductions: 27_064.78 + +- name: 2024 self-employment tax counted net of the federal AGI deduction + period: 2024 + absolute_error_margin: 0.01 + input: + people: + head: {age: 40, self_employment_income: 100_000, charitable_cash_donations: 20_000} + tax_units: {tax_unit: {members: [head]}} + households: {household: {members: [head], state_code: MO}} + output: + self_employment_tax: 14_129.55 + self_employment_tax_ald: 7_064.77 + mo_self_employment_tax_addback: 7_064.77 + mo_itemized_deductions: 27_064.78 diff --git a/policyengine_us/tests/policy/baseline/gov/states/mo/tax/income/deductions/mo_self_employment_tax_addback.yaml b/policyengine_us/tests/policy/baseline/gov/states/mo/tax/income/deductions/mo_self_employment_tax_addback.yaml new file mode 100644 index 00000000000..70bd43147b7 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/states/mo/tax/income/deductions/mo_self_employment_tax_addback.yaml @@ -0,0 +1,65 @@ +# RSMo 143.141(4)(c) and the 2017 MO-1040 instructions (Form MO-A Part 2 +# line 7: federal Form 1040 line 57 minus line 27) allow the self-employment +# tax only net of the deductible part taken in federal AGI. +- name: Half of the tax was deducted in federal AGI, so half is added + period: 2024 + input: + self_employment_tax: 1_000 + self_employment_tax_ald: 500 + state_code: MO + output: + mo_self_employment_tax_addback: 500 + +- name: Nothing deducted in federal AGI, so the addback equals the tax and no more + period: 2024 + input: + self_employment_tax: 1_000 + self_employment_tax_ald: 0 + state_code: MO + output: + mo_self_employment_tax_addback: 1_000 + +- name: Deduction above the tax leaves the addback at zero, not negative + period: 2024 + input: + self_employment_tax: 1_000 + self_employment_tax_ald: 1_200 + state_code: MO + output: + mo_self_employment_tax_addback: 0 + +- name: No self-employment tax + period: 2017 + input: + self_employment_tax: 0 + self_employment_tax_ald: 0 + state_code: MO + output: + mo_self_employment_tax_addback: 0 + +- name: Bounded between zero and the tax for several households at once + period: 2024 + input: + people: + a: {self_employment_tax: 2_000} + b: {self_employment_tax: 2_000} + c: {self_employment_tax: 0} + tax_units: + ta: {members: [a], self_employment_tax_ald: 1_000} + tb: {members: [b], self_employment_tax_ald: 3_000} + tc: {members: [c], self_employment_tax_ald: 0} + households: + ha: {members: [a], state_code: MO} + hb: {members: [b], state_code: MO} + hc: {members: [c], state_code: MO} + output: + mo_self_employment_tax_addback: [1_000, 0, 0] + +- name: Outside Missouri the addback is zero + period: 2024 + input: + self_employment_tax: 1_000 + self_employment_tax_ald: 500 + state_code: KS + output: + mo_self_employment_tax_addback: 0 diff --git a/policyengine_us/variables/gov/states/mo/tax/income/deductions/mo_self_employment_tax_addback.py b/policyengine_us/variables/gov/states/mo/tax/income/deductions/mo_self_employment_tax_addback.py new file mode 100644 index 00000000000..2896f25ffb0 --- /dev/null +++ b/policyengine_us/variables/gov/states/mo/tax/income/deductions/mo_self_employment_tax_addback.py @@ -0,0 +1,26 @@ +from policyengine_us.model_api import * + + +class mo_self_employment_tax_addback(Variable): + value_type = float + entity = TaxUnit + label = "Missouri itemized deduction for self-employment tax" + unit = USD + documentation = ( + "Self-employment tax added to Missouri itemized deductions, net of the " + "part already deducted in computing federal adjusted gross income." + ) + definition_period = YEAR + reference = ( + "https://revisor.mo.gov/main/OneSection.aspx?section=143.141", + # PDF page 42: Form MO-A Part 2 line 7. + "https://dor.mo.gov/forms/MO-1040%20Instructions_2017.pdf#page=42", + ) + defined_for = StateCode.MO + + def formula(tax_unit, period, parameters): + # RSMo 143.141 allows the tax only to the extent it was not + # deducted in computing federal AGI (Schedule 1 deductible part). + self_employment_tax = add(tax_unit, period, ["self_employment_tax"]) + deducted = tax_unit("self_employment_tax_ald", period) + return max_(0, self_employment_tax - deducted) From b73aed16c46229d732af23930570bc73e3c4b65b Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Mon, 2 Nov 2026 23:31:16 -0500 Subject: [PATCH 2/2] Fix the Missouri self-employment tax witness comment's half cent The tax is 14,129.55, so the deductible half and the remaining half are 7,064.775 each, and itemized deductions come to 27,064.775 with the $20,000 of charity. The test's 0.01 margin accepts either rounding. Also name the actor in the other comments and the changelog. Co-Authored-By: Claude Opus 5.5 --- changelog.d/mo-se-tax-addback.fixed.md | 2 +- .../mo/tax/income/deductions/mo_itemized_deductions.yaml | 8 +++++--- .../income/deductions/mo_self_employment_tax_addback.yaml | 7 ++++--- .../income/deductions/mo_self_employment_tax_addback.py | 4 ++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/changelog.d/mo-se-tax-addback.fixed.md b/changelog.d/mo-se-tax-addback.fixed.md index 63bcf3efa7c..ce3a8e4534b 100644 --- a/changelog.d/mo-se-tax-addback.fixed.md +++ b/changelog.d/mo-se-tax-addback.fixed.md @@ -1 +1 @@ -Count Missouri's self-employment tax itemized deduction net of the part already deducted in federal adjusted gross income (RSMo 143.141(4)(c)). +Limit Missouri's itemized deduction for self-employment tax to the part the filer didn't deduct in computing federal adjusted gross income (RSMo 143.141(4)(c)). diff --git a/policyengine_us/tests/policy/baseline/gov/states/mo/tax/income/deductions/mo_itemized_deductions.yaml b/policyengine_us/tests/policy/baseline/gov/states/mo/tax/income/deductions/mo_itemized_deductions.yaml index e6868c30715..27eec9d47e8 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/mo/tax/income/deductions/mo_itemized_deductions.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/mo/tax/income/deductions/mo_itemized_deductions.yaml @@ -115,9 +115,11 @@ mo_itemized_deductions: 10_000 # Single filer, $100,000 of self-employment income and $20,000 of cash -# charity. Self-employment tax 14,129.55, of which 7,064.77 is deducted in -# federal AGI, so RSMo 143.141(4)(c) adds back only 7,064.77. Before the fix -# the full tax was added: 34,129.55. +# charity. The filer owes 14,129.55 of self-employment tax and deducts half +# (7,064.775) in computing federal AGI, so Missouri allows the other half as +# an itemized deduction (RSMo 143.141(4)(c)). With the charity, itemized +# deductions total 27,064.775, and the 0.01 margin covers either rounding of +# the half cent. If the model counted the full tax, they would total 34,129.55. - name: 2017 self-employment tax counted net of the federal AGI deduction period: 2017 absolute_error_margin: 0.01 diff --git a/policyengine_us/tests/policy/baseline/gov/states/mo/tax/income/deductions/mo_self_employment_tax_addback.yaml b/policyengine_us/tests/policy/baseline/gov/states/mo/tax/income/deductions/mo_self_employment_tax_addback.yaml index 70bd43147b7..19457054775 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/mo/tax/income/deductions/mo_self_employment_tax_addback.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/mo/tax/income/deductions/mo_self_employment_tax_addback.yaml @@ -1,6 +1,7 @@ -# RSMo 143.141(4)(c) and the 2017 MO-1040 instructions (Form MO-A Part 2 -# line 7: federal Form 1040 line 57 minus line 27) allow the self-employment -# tax only net of the deductible part taken in federal AGI. +# Missouri allows the self-employment tax as an itemized deduction only to the +# extent the filer didn't deduct it in computing federal AGI (RSMo +# 143.141(4)(c)). For 2017, filers include federal Form 1040 line 57 less +# line 27 on Form MO-A Part 2 line 7 (MO-1040 instructions, page 42). - name: Half of the tax was deducted in federal AGI, so half is added period: 2024 input: diff --git a/policyengine_us/variables/gov/states/mo/tax/income/deductions/mo_self_employment_tax_addback.py b/policyengine_us/variables/gov/states/mo/tax/income/deductions/mo_self_employment_tax_addback.py index 2896f25ffb0..89cfc92520b 100644 --- a/policyengine_us/variables/gov/states/mo/tax/income/deductions/mo_self_employment_tax_addback.py +++ b/policyengine_us/variables/gov/states/mo/tax/income/deductions/mo_self_employment_tax_addback.py @@ -19,8 +19,8 @@ class mo_self_employment_tax_addback(Variable): defined_for = StateCode.MO def formula(tax_unit, period, parameters): - # RSMo 143.141 allows the tax only to the extent it was not - # deducted in computing federal AGI (Schedule 1 deductible part). + # RSMo 143.141(4)(c): Missouri allows the tax only to the extent the + # filer didn't deduct it in computing federal AGI. self_employment_tax = add(tax_unit, period, ["self_employment_tax"]) deducted = tax_unit("self_employment_tax_ald", period) return max_(0, self_employment_tax - deducted)