From 5bdcdcae0306606a42f087711a804b9de072237b Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 11:40:13 -0400 Subject: [PATCH 1/4] Limit Kansas itemized deductions to the four K.S.A. 79-32,120(a) categories Kansas allows charitable contributions (100%), medical care, qualified residence interest and real and personal property taxes (50% in 2015-2017 without medical, 50% in 2018, 75% in 2019, 100% from 2020). Main summed every federal non-SALT itemized deduction, including investment interest, casualty losses, pre-2018 miscellaneous deductions and the 2020-2021 non-itemizer charitable deduction, at 100% in all years. Before 2021, (a)(1)(A) lets only federal itemizers itemize in Kansas. Co-Authored-By: Claude Opus 5.5 --- ...s-itemized-deductions-closed-list.fixed.md | 1 + .../federal_itemization_required.yaml | 13 ++++ .../rate/charitable_contributions.yaml | 14 ++++ .../itemized/rate/medical_expenses.yaml | 19 +++++ .../itemized/rate/property_taxes.yaml | 18 +++++ .../rate/qualified_residence_interest.yaml | 18 +++++ .../ks/tax/income/ks_itemized_deductions.yaml | 75 ++++++++++++++++++- .../ks/tax/income/ks_taxable_income.yaml | 38 ++++++++++ .../deductions/ks_itemized_deductions.py | 35 +++++---- .../states/ks/tax/income/ks_taxable_income.py | 9 ++- 10 files changed, 223 insertions(+), 17 deletions(-) create mode 100644 changelog.d/ks-itemized-deductions-closed-list.fixed.md create mode 100644 policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/federal_itemization_required.yaml create mode 100644 policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/charitable_contributions.yaml create mode 100644 policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/medical_expenses.yaml create mode 100644 policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/property_taxes.yaml create mode 100644 policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/qualified_residence_interest.yaml diff --git a/changelog.d/ks-itemized-deductions-closed-list.fixed.md b/changelog.d/ks-itemized-deductions-closed-list.fixed.md new file mode 100644 index 00000000000..9fc3e9221df --- /dev/null +++ b/changelog.d/ks-itemized-deductions-closed-list.fixed.md @@ -0,0 +1 @@ +Limit Kansas itemized deductions to charitable contributions, medical care, qualified residence interest and property taxes at the K.S.A. 79-32,120(a) shares for each year, and require federal itemizing before 2021. diff --git a/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/federal_itemization_required.yaml b/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/federal_itemization_required.yaml new file mode 100644 index 00000000000..7f703f9cc34 --- /dev/null +++ b/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/federal_itemization_required.yaml @@ -0,0 +1,13 @@ +description: Kansas allows the Kansas itemized deduction only to filers who itemize on their federal return, if this is true. +values: + 2015-01-01: true + 2021-01-01: false +metadata: + unit: bool + period: year + label: Kansas itemized deduction requires federal itemization + reference: + - title: K.S.A. 79-32,120(a)(1) + href: https://www.ksrevisor.gov/statutes/chapters/ch79/079_032_0120.html + - title: 2018 Form K-40 instructions, itemized deductions + href: https://www.ksrevenue.gov/pdf/ip18.pdf#page=2 diff --git a/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/charitable_contributions.yaml b/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/charitable_contributions.yaml new file mode 100644 index 00000000000..303f4796749 --- /dev/null +++ b/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/charitable_contributions.yaml @@ -0,0 +1,14 @@ +description: Kansas allows this share of charitable contributions deductible under section 170 of the Internal Revenue Code as an itemized deduction. +values: + 2015-01-01: 1 +metadata: + unit: /1 + period: year + label: Kansas itemized deduction share of charitable contributions + reference: + - title: K.S.A. 79-32,120(a) + href: https://www.ksrevisor.gov/statutes/chapters/ch79/079_032_0120.html + - title: 2017 Form K-40 instructions, Schedule S Part C, line C4 + href: https://www.ksrevenue.gov/pdf/ip17.pdf#page=14 + - title: 2025 Form K-40 instructions, Kansas Schedule A + href: https://www.ksrevenue.gov/pdf/ip25.pdf#page=14 diff --git a/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/medical_expenses.yaml b/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/medical_expenses.yaml new file mode 100644 index 00000000000..4513fbe69de --- /dev/null +++ b/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/medical_expenses.yaml @@ -0,0 +1,19 @@ +description: Kansas allows this share of medical expenses deductible under section 213 of the Internal Revenue Code as an itemized deduction. +values: + 2015-01-01: 0 + 2018-01-01: 0.5 + 2019-01-01: 0.75 + 2020-01-01: 1 +metadata: + unit: /1 + period: year + label: Kansas itemized deduction share of medical expenses + reference: + - title: K.S.A. 79-32,120(a) + href: https://www.ksrevisor.gov/statutes/chapters/ch79/079_032_0120.html + - title: 2018 Form K-40 instructions, itemized deductions + href: https://www.ksrevenue.gov/pdf/ip18.pdf#page=2 + - title: 2019 Form K-40 instructions, itemized deductions + href: https://www.ksrevenue.gov/pdf/ip19.pdf#page=2 + - title: 2025 Form K-40 instructions, Kansas Schedule A, lines 1 to 4 + href: https://www.ksrevenue.gov/pdf/ip25.pdf#page=14 diff --git a/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/property_taxes.yaml b/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/property_taxes.yaml new file mode 100644 index 00000000000..f9e7a9f4993 --- /dev/null +++ b/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/property_taxes.yaml @@ -0,0 +1,18 @@ +description: Kansas allows this share of taxes on real and personal property under section 164(a) of the Internal Revenue Code as an itemized deduction. +values: + 2015-01-01: 0.5 + 2019-01-01: 0.75 + 2020-01-01: 1 +metadata: + unit: /1 + period: year + label: Kansas itemized deduction share of real and personal property taxes + reference: + - title: K.S.A. 79-32,120(a) + href: https://www.ksrevisor.gov/statutes/chapters/ch79/079_032_0120.html + - title: 2017 Form K-40 instructions, Schedule S Part C, lines C1 and C2 + href: https://www.ksrevenue.gov/pdf/ip17.pdf#page=14 + - title: 2018 Form K-40 instructions, itemized deductions + href: https://www.ksrevenue.gov/pdf/ip18.pdf#page=2 + - title: 2019 Form K-40 instructions, itemized deductions + href: https://www.ksrevenue.gov/pdf/ip19.pdf#page=2 diff --git a/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/qualified_residence_interest.yaml b/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/qualified_residence_interest.yaml new file mode 100644 index 00000000000..a1168914900 --- /dev/null +++ b/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/qualified_residence_interest.yaml @@ -0,0 +1,18 @@ +description: Kansas allows this share of qualified residence interest under section 163(h) of the Internal Revenue Code as an itemized deduction. +values: + 2015-01-01: 0.5 + 2019-01-01: 0.75 + 2020-01-01: 1 +metadata: + unit: /1 + period: year + label: Kansas itemized deduction share of qualified residence interest + reference: + - title: K.S.A. 79-32,120(a) + href: https://www.ksrevisor.gov/statutes/chapters/ch79/079_032_0120.html + - title: 2017 Form K-40 instructions, Schedule S Part C, lines C3 + href: https://www.ksrevenue.gov/pdf/ip17.pdf#page=14 + - title: 2018 Form K-40 instructions, itemized deductions + href: https://www.ksrevenue.gov/pdf/ip18.pdf#page=2 + - title: 2019 Form K-40 instructions, itemized deductions + href: https://www.ksrevenue.gov/pdf/ip19.pdf#page=2 diff --git a/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_itemized_deductions.yaml b/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_itemized_deductions.yaml index 63a6603f62b..c8f977b3367 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_itemized_deductions.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_itemized_deductions.yaml @@ -3,7 +3,7 @@ input: real_estate_taxes: 8 salt_deduction: 10 - interest_deduction: 9 + deductible_mortgage_interest_tax_unit: 9 medical_expense_deduction: 2 state_code: KS output: @@ -14,8 +14,79 @@ input: real_estate_taxes: 12 salt_deduction: 10 - interest_deduction: 9 + deductible_mortgage_interest_tax_unit: 9 medical_expense_deduction: 2 state_code: KS output: ks_itemized_deductions: 12 + 9 + 2 + +# K.S.A. 79-32,120(a)(5): from 2020, 100% of charitable contributions, medical +# care, qualified residence interest and real and personal property taxes. +# Investment interest and casualty losses are not Kansas itemized deductions. +- name: Case 3, 2025 only the four Kansas categories count. + period: 2025 + input: + state_code: KS + charitable_deduction: 3_000 + medical_expense_deduction: 2_000 + deductible_mortgage_interest_tax_unit: 9_000 + interest_deduction: 13_000 + casualty_loss_deduction: 1_000 + real_estate_taxes: 5_000 + output: + # 3,000 + 2,000 + 9,000 + 5,000; not the 4,000 of investment interest in + # interest_deduction or the 1,000 casualty loss. + ks_itemized_deductions: 19_000 + +# K.S.A. 79-32,120(a)(4): 2019 allows 100% of charity and 75% of the other +# three categories. +- name: Case 4, 2019 shares. + period: 2019 + input: + state_code: KS + charitable_deduction: 1_000 + medical_expense_deduction: 2_000 + deductible_mortgage_interest_tax_unit: 8_000 + real_estate_taxes: 4_000 + output: + # 1,000 + 0.75 * (2,000 + 8,000 + 4,000) + ks_itemized_deductions: 11_500 + +# K.S.A. 79-32,120(a)(3): 2018 allows 100% of charity and 50% of the other +# three categories. +- name: Case 5, 2018 shares. + period: 2018 + input: + state_code: KS + charitable_deduction: 1_000 + medical_expense_deduction: 2_000 + deductible_mortgage_interest_tax_unit: 8_000 + real_estate_taxes: 4_000 + output: + # 1,000 + 0.5 * (2,000 + 8,000 + 4,000) + ks_itemized_deductions: 8_000 + +# K.S.A. 79-32,120(a)(2): 2015 to 2017 allow 100% of charity, 50% of qualified +# residence interest and property taxes, and no medical care (2017 Schedule S, +# Part C). +- name: Case 6, 2017 shares, no medical expenses. + period: 2017 + input: + state_code: KS + charitable_deduction: 1_000 + medical_expense_deduction: 2_000 + deductible_mortgage_interest_tax_unit: 8_000 + real_estate_taxes: 4_000 + output: + # 1,000 + 0.5 * (8,000 + 4,000) + ks_itemized_deductions: 7_000 + +- name: Case 7, 2021 federal deduction for non-itemizers' charitable gifts is not a Kansas itemized deduction. + period: 2021 + input: + state_code: KS + charitable_deduction: 2_000 + charitable_deduction_for_non_itemizers: 300 + real_estate_taxes: 4_000 + output: + ks_itemized_deductions: 6_000 diff --git a/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_taxable_income.yaml b/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_taxable_income.yaml index 80de06563bb..66d2d2060cc 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_taxable_income.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_taxable_income.yaml @@ -30,3 +30,41 @@ state_code: KS output: ks_taxable_income: 0 + +# K.S.A. 79-32,120(a)(1)(A): before 2021, only federal itemizers may take the +# Kansas itemized deduction; (a)(1)(B) removes that condition from 2021. +- name: Case 4, 2019 non-itemizer federally takes the Kansas standard deduction. + period: 2019 + input: + ks_agi: 50_000 + ks_standard_deduction: 3_000 + ks_itemized_deductions: 9_000 + ks_exemptions: 2_250 + tax_unit_itemizes: false + state_code: KS + output: + ks_taxable_income: 50_000 - 3_000 - 2_250 + +- name: Case 5, 2019 federal itemizer takes the larger Kansas itemized deduction. + period: 2019 + input: + ks_agi: 50_000 + ks_standard_deduction: 3_000 + ks_itemized_deductions: 9_000 + ks_exemptions: 2_250 + tax_unit_itemizes: true + state_code: KS + output: + ks_taxable_income: 50_000 - 9_000 - 2_250 + +- name: Case 6, 2021 Kansas itemizing no longer requires federal itemizing. + period: 2021 + input: + ks_agi: 50_000 + ks_standard_deduction: 3_500 + ks_itemized_deductions: 9_000 + ks_exemptions: 2_250 + tax_unit_itemizes: false + state_code: KS + output: + ks_taxable_income: 50_000 - 9_000 - 2_250 diff --git a/policyengine_us/variables/gov/states/ks/tax/income/deductions/ks_itemized_deductions.py b/policyengine_us/variables/gov/states/ks/tax/income/deductions/ks_itemized_deductions.py index fd0b8dee13f..ce52850b5fc 100644 --- a/policyengine_us/variables/gov/states/ks/tax/income/deductions/ks_itemized_deductions.py +++ b/policyengine_us/variables/gov/states/ks/tax/income/deductions/ks_itemized_deductions.py @@ -8,21 +8,28 @@ class ks_itemized_deductions(Variable): unit = USD definition_period = YEAR reference = ( - "https://www.ksrevenue.gov/pdf/ip21.pdf", - "https://www.ksrevenue.gov/pdf/ip22.pdf", + "https://www.ksrevisor.gov/statutes/chapters/ch79/079_032_0120.html", + "https://www.ksrevenue.gov/pdf/ip17.pdf#page=14", + "https://www.ksrevenue.gov/pdf/ip25.pdf#page=14", ) defined_for = StateCode.KS def formula(tax_unit, period, parameters): - # 2021 Form K-40 instructions say this: - # LINE 4 (Standard deduction or itemized deductions): - # If you did not itemize your deductions on your federal return, - # you may choose to itemize your deductions or claim the - # standard deduction on your Kansas return whichever is to your - # advantage. If you itemized on your federal return, you may - # either itemize or take the standard deduction on your Kansas - # return, whichever is to your advantage. - # compute itemized deduction maximum - itm_deds_less_salt = tax_unit("itemized_deductions_less_salt", period) - uncapped_property_taxes = add(tax_unit, period, ["real_estate_taxes"]) - return itm_deds_less_salt + uncapped_property_taxes + # K.S.A. 79-32,120(a) limits the Kansas itemized deduction to four + # federal categories, each at a year-specific share. Other federal + # itemized deductions (investment interest, casualty and theft losses, + # miscellaneous deductions) do not count. Property taxes are not limited + # by the federal cap on state and local taxes. + p = parameters(period).gov.states.ks.tax.income.deductions.itemized.rate + charitable = tax_unit("charitable_deduction", period) + medical = tax_unit("medical_expense_deduction", period) + qualified_residence_interest = tax_unit( + "deductible_mortgage_interest_tax_unit", period + ) + property_taxes = add(tax_unit, period, ["real_estate_taxes"]) + return ( + p.charitable_contributions * charitable + + p.medical_expenses * medical + + p.qualified_residence_interest * qualified_residence_interest + + p.property_taxes * property_taxes + ) diff --git a/policyengine_us/variables/gov/states/ks/tax/income/ks_taxable_income.py b/policyengine_us/variables/gov/states/ks/tax/income/ks_taxable_income.py index 79dba7f7981..f690bf4a6c3 100644 --- a/policyengine_us/variables/gov/states/ks/tax/income/ks_taxable_income.py +++ b/policyengine_us/variables/gov/states/ks/tax/income/ks_taxable_income.py @@ -10,12 +10,19 @@ class ks_taxable_income(Variable): reference = ( "https://www.ksrevenue.gov/pdf/ip21.pdf", "https://www.ksrevenue.gov/pdf/ip22.pdf", + "https://www.ksrevisor.gov/statutes/chapters/ch79/079_032_0120.html", ) defined_for = StateCode.KS def formula(tax_unit, period, parameters): + p = parameters(period).gov.states.ks.tax.income.deductions.itemized std_ded = tax_unit("ks_standard_deduction", period) itm_ded = tax_unit("ks_itemized_deductions", period) - deductions = where(itm_ded > std_ded, itm_ded, std_ded) + # K.S.A. 79-32,120(a)(1): before 2021, only federal itemizers may + # itemize on the Kansas return. + may_itemize = True + if p.federal_itemization_required: + may_itemize = tax_unit("tax_unit_itemizes", period) + deductions = where(may_itemize & (itm_ded > std_ded), itm_ded, std_ded) exemptions = tax_unit("ks_exemptions", period) return max_(0, tax_unit("ks_agi", period) - deductions - exemptions) From 644db58a8544cb666b16c2591b732cacc95a5a35 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 21:21:15 +0000 Subject: [PATCH 2/4] Drop the Kansas itemized deduction file from KNOWN_UNMARKED This PR replaces the comment that quoted the 2021 K-40 instructions, so the file no longer has a conflict-sounding comment and the ratchet in test_source_conflicts.py requires its line to go. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LwQq6Fmi4DmuA9GyXnRKdV --- policyengine_us/tests/code_health/test_source_conflicts.py | 1 - 1 file changed, 1 deletion(-) diff --git a/policyengine_us/tests/code_health/test_source_conflicts.py b/policyengine_us/tests/code_health/test_source_conflicts.py index 4a9b7f803db..f4c1066e9cd 100644 --- a/policyengine_us/tests/code_health/test_source_conflicts.py +++ b/policyengine_us/tests/code_health/test_source_conflicts.py @@ -166,7 +166,6 @@ "policyengine_us/variables/gov/states/fl/commerce/liheap/fl_liheap.py": 1, "policyengine_us/variables/gov/states/hi/tax/income/credits/cdcc/hi_cdcc_qualifying_individuals.py": 1, "policyengine_us/variables/gov/states/hi/tax/income/subtractions/hi_student_loan_interest_adjustment.py": 1, - "policyengine_us/variables/gov/states/ks/tax/income/deductions/ks_itemized_deductions.py": 1, "policyengine_us/variables/gov/states/ky/dcbs/liheap/ky_liheap.py": 1, "policyengine_us/variables/gov/states/mn/dcyf/mfip/income/earned/mn_mfip_dependent_care_deduction.py": 1, "policyengine_us/variables/gov/states/mn/tax/income/deductions/mn_itemized_deductions.py": 1, From a3606f3a2ee52fec442c1fcb246b258bf32d78d9 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 13:32:49 +0000 Subject: [PATCH 3/4] Count mortgage insurance premiums as Kansas qualified residence interest K.S.A. 79-32,120(a) counts qualified residence interest "as provided in section 163(h)", and 26 U.S.C. 163(h)(3)(E) treats deductible mortgage insurance premiums as such interest. Reading deductible_mortgage_interest (person level) also lets a direct input of it reach Kansas, as it did on main through interest_deduction. Adds 2019, 2021, 2025 and 2026 cases and fixes the "lines C3" reference title. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LwQq6FTrmW4gEEVCH3jdrF --- .../rate/qualified_residence_interest.yaml | 2 +- .../ks/tax/income/ks_itemized_deductions.yaml | 48 +++++++++++++++++++ .../deductions/ks_itemized_deductions.py | 8 +++- 3 files changed, 55 insertions(+), 3 deletions(-) diff --git a/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/qualified_residence_interest.yaml b/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/qualified_residence_interest.yaml index a1168914900..effd355c58b 100644 --- a/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/qualified_residence_interest.yaml +++ b/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/qualified_residence_interest.yaml @@ -10,7 +10,7 @@ metadata: reference: - title: K.S.A. 79-32,120(a) href: https://www.ksrevisor.gov/statutes/chapters/ch79/079_032_0120.html - - title: 2017 Form K-40 instructions, Schedule S Part C, lines C3 + - title: 2017 Form K-40 instructions, Schedule S Part C, line C3 href: https://www.ksrevenue.gov/pdf/ip17.pdf#page=14 - title: 2018 Form K-40 instructions, itemized deductions href: https://www.ksrevenue.gov/pdf/ip18.pdf#page=2 diff --git a/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_itemized_deductions.yaml b/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_itemized_deductions.yaml index c8f977b3367..3ffe3ab2e7c 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_itemized_deductions.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_itemized_deductions.yaml @@ -90,3 +90,51 @@ real_estate_taxes: 4_000 output: ks_itemized_deductions: 6_000 + +# K.S.A. 79-32,120(a)(4) counts qualified residence interest under section +# 163(h), and 163(h)(3)(E) treats mortgage insurance premiums as such interest +# (2019 Schedule S, line C4). +- name: Case 8, 2019 mortgage insurance premiums count at the 75% share. + period: 2019 + input: + state_code: KS + employment_income: 40_000 + home_mortgage_interest: 8_000 + mortgage_insurance_premiums: 1_000 + output: + # AGI of 40,000 is below the 100,000 premium phase-out start. + # 0.75 * (8,000 + 1,000) + ks_itemized_deductions: 6_750 + +- name: Case 9, 2025 a direct deductible mortgage interest input counts. + period: 2025 + input: + state_code: KS + deductible_mortgage_interest: 9_000 + output: + # 1 * 9,000 + ks_itemized_deductions: 9_000 + +# K.S.A. 79-32,120(a)(5) and 163(h)(3)(E): P.L. 119-21 sec. 70108 restores the +# federal premium deduction from 2026, and Kansas counts it at 100%. +- name: Case 10, 2026 mortgage insurance premiums count at 100%. + period: 2026 + input: + state_code: KS + home_mortgage_interest: 8_000 + mortgage_insurance_premiums: 1_000 + output: + # AGI of 0 is below the premium phase-out start. + # 1 * (8,000 + 1,000) + ks_itemized_deductions: 9_000 + +# 163(h)(3)(E)(iv) allows premiums through 2021, so premiums alone count. +- name: Case 11, 2021 mortgage insurance premiums alone count. + period: 2021 + input: + state_code: KS + mortgage_insurance_premiums: 1_000 + output: + # AGI of 0 is below the premium phase-out start. + # 1 * 1,000 + ks_itemized_deductions: 1_000 diff --git a/policyengine_us/variables/gov/states/ks/tax/income/deductions/ks_itemized_deductions.py b/policyengine_us/variables/gov/states/ks/tax/income/deductions/ks_itemized_deductions.py index ce52850b5fc..da0bdb7158b 100644 --- a/policyengine_us/variables/gov/states/ks/tax/income/deductions/ks_itemized_deductions.py +++ b/policyengine_us/variables/gov/states/ks/tax/income/deductions/ks_itemized_deductions.py @@ -23,8 +23,12 @@ def formula(tax_unit, period, parameters): p = parameters(period).gov.states.ks.tax.income.deductions.itemized.rate charitable = tax_unit("charitable_deduction", period) medical = tax_unit("medical_expense_deduction", period) - qualified_residence_interest = tax_unit( - "deductible_mortgage_interest_tax_unit", period + # 26 U.S.C. 163(h)(3)(E) treats deductible mortgage insurance premiums + # as qualified residence interest. + qualified_residence_interest = add( + tax_unit, + period, + ["deductible_mortgage_interest", "deductible_mortgage_insurance_premiums"], ) property_taxes = add(tax_unit, period, ["real_estate_taxes"]) return ( From 9a2ccc77053577d8fd2e71160b4bab889c8d425a Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 9 Nov 2026 15:00:49 +0000 Subject: [PATCH 4/4] Point the 2025 charity reference at page 15 and pin the deductible premiums The 2025 K-40 booklet gives the Kansas Schedule A medical and tax rules on page 14 and the qualified residence interest and charitable rules on page 15. The charitable share's reference now opens page 15 and names lines 10 to 13. The variable's Schedule A reference spans both pages, so it gets a "PDF pages 14-15" comment. No case told the deductible mortgage insurance premiums apart from the raw premium input. Case 12 (2025, when 163(h)(3)(E)(iv) bars premiums) and Case 13 (2019, AGI 4,500 above the phase-out start) now do. Case 7 gets its arithmetic. Co-Authored-By: Claude Opus 5.5 --- .../rate/charitable_contributions.yaml | 4 +-- .../ks/tax/income/ks_itemized_deductions.yaml | 29 +++++++++++++++++++ .../deductions/ks_itemized_deductions.py | 1 + 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/charitable_contributions.yaml b/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/charitable_contributions.yaml index 303f4796749..a83f861da7f 100644 --- a/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/charitable_contributions.yaml +++ b/policyengine_us/parameters/gov/states/ks/tax/income/deductions/itemized/rate/charitable_contributions.yaml @@ -10,5 +10,5 @@ metadata: href: https://www.ksrevisor.gov/statutes/chapters/ch79/079_032_0120.html - title: 2017 Form K-40 instructions, Schedule S Part C, line C4 href: https://www.ksrevenue.gov/pdf/ip17.pdf#page=14 - - title: 2025 Form K-40 instructions, Kansas Schedule A - href: https://www.ksrevenue.gov/pdf/ip25.pdf#page=14 + - title: 2025 Form K-40 instructions, Kansas Schedule A, lines 10 to 13 + href: https://www.ksrevenue.gov/pdf/ip25.pdf#page=15 diff --git a/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_itemized_deductions.yaml b/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_itemized_deductions.yaml index fc94e6762cb..d890c39797f 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_itemized_deductions.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_itemized_deductions.yaml @@ -89,6 +89,7 @@ charitable_deduction_for_non_itemizers: 300 real_estate_taxes: 4_000 output: + # 2,000 + 4,000; the 300 non-itemizer deduction does not count. ks_itemized_deductions: 6_000 # K.S.A. 79-32,120(a)(4) counts qualified residence interest under section @@ -139,6 +140,34 @@ # 1 * 1,000 ks_itemized_deductions: 1_000 +# 163(h)(3)(E)(iv) ends the premium deduction after 2021, and P.L. 119-21 +# sec. 70108 restores it only from 2026 (2025 Kansas Schedule A line 8d is +# reserved). +- name: Case 12, 2025 mortgage insurance premiums do not count. + period: 2025 + input: + state_code: KS + home_mortgage_interest: 8_000 + mortgage_insurance_premiums: 1_000 + output: + # 1 * 8,000 + ks_itemized_deductions: 8_000 + +# 163(h)(3)(E)(ii) cuts premiums by 10% for each $1,000, or fraction of one, +# of AGI above $100,000. +- name: Case 13, 2019 premiums after the AGI phase-out count at the 75% share. + period: 2019 + input: + state_code: KS + employment_income: 104_500 + home_mortgage_interest: 8_000 + mortgage_insurance_premiums: 1_000 + output: + # AGI exceeds 100,000 by 4,500: 5 steps, so premiums fall 50% to 500. + deductible_mortgage_insurance_premiums: 500 + # 0.75 * (8,000 + 500) + ks_itemized_deductions: 6_375 + - name: KS itemized deductions leave out the federal claim of right repayment deduction # K.S.A. 79-32,120(a) lists charitable contributions, medical care, # qualified residence interest and property taxes only. diff --git a/policyengine_us/variables/gov/states/ks/tax/income/deductions/ks_itemized_deductions.py b/policyengine_us/variables/gov/states/ks/tax/income/deductions/ks_itemized_deductions.py index da0bdb7158b..6c87171e4de 100644 --- a/policyengine_us/variables/gov/states/ks/tax/income/deductions/ks_itemized_deductions.py +++ b/policyengine_us/variables/gov/states/ks/tax/income/deductions/ks_itemized_deductions.py @@ -10,6 +10,7 @@ class ks_itemized_deductions(Variable): reference = ( "https://www.ksrevisor.gov/statutes/chapters/ch79/079_032_0120.html", "https://www.ksrevenue.gov/pdf/ip17.pdf#page=14", + # PDF pages 14-15 "https://www.ksrevenue.gov/pdf/ip25.pdf#page=14", ) defined_for = StateCode.KS