Repository: PolicyEngine/policyengine-us (language: python)

Issue:
Kansas Child and Dependent Care Credit 2024 (25% -> 50%)
[Reference](https://www.ksrevenue.gov/taxnotices/notice24-09.pdf)

https://github.com/PolicyEngine/policyengine-us/blob/0051378a5e815ee5559d358fba803a89ef6b717e/policyengine_us/parameters/gov/states/ks/tax/income/credits/cdcc_fraction.yaml#L1-L7



Discussion / hints:

Fix patch:
diff --git a/changelog_entry.yaml b/changelog_entry.yaml
index e69de29bb2d..4a825a5fc4d 100644
--- a/changelog_entry.yaml
+++ b/changelog_entry.yaml
@@ -0,0 +1,4 @@
+- bump: minor
+  changes:
+    added:
+    - 2024 tax rate, CDCC match, standard deduction and personal exemption amount in Kansas..
diff --git a/policyengine_us/parameters/gov/states/ks/tax/income/agi/subtractions/oasdi/agi_limit.yaml b/policyengine_us/parameters/gov/states/ks/tax/income/agi/subtractions/oasdi/agi_limit.yaml
index 3140a35496d..a4c896655e9 100644
--- a/policyengine_us/parameters/gov/states/ks/tax/income/agi/subtractions/oasdi/agi_limit.yaml
+++ b/policyengine_us/parameters/gov/states/ks/tax/income/agi/subtractions/oasdi/agi_limit.yaml
@@ -1,6 +1,7 @@
 description: Kansas limits its taxable OASDI subtraction to filers with AGI at or below this amount.
 values:
   2021-01-01: 75_000
+  2024-01-01: .inf
 
 metadata:
   period: year
@@ -14,5 +15,6 @@ metadata:
   - title: 2023 Form K-40 instructions
     href: https://www.ksrevenue.gov/pdf/ip23.pdf#page=11
   - title: Kansas 2022 Statute | Article 32 | §79-32,271(c)(xviii)
-    href: http://www.kslegislature.org/li/b2023_24/statute/079_000_0000_chapter/079_032_0000_article/079_032_0117_section/079_032_0117_k/
-
+    href: https://casetext.com/statute/kansas-statutes/chapter-79-taxation/article-32-income-tax/section-79-32117-kansas-adjusted-gross-income-of-an-individual-addition-and-subtraction-modifications
+  - title: Kansas Notice 24-08 Changes to individual income tax
+    href: https://www.ksrevenue.gov/taxnotices/notice24-08.pdf#page=2
diff --git a/policyengine_us/parameters/gov/states/ks/tax/income/credits/cdcc_fraction.yaml b/policyengine_us/parameters/gov/states/ks/tax/income/credits/cdcc_fraction.yaml
index 3344bcdfc2a..25a25023a91 100644
--- a/policyengine_us/parameters/gov/states/ks/tax/income/credits/cdcc_fraction.yaml
+++ b/policyengine_us/parameters/gov/states/ks/tax/income/credits/cdcc_fraction.yaml
@@ -3,6 +3,7 @@ values:
   2018-01-01: 0.125
   2019-01-01: 0.1875
   2020-01-01: 0.25
+  2024-01-01: 0.5
 
 metadata:
   period: year
@@ -17,4 +18,5 @@ metadata:
     href: https://www.ksrevenue.gov/pdf/ip23.pdf#page=8
   - title: Kansas 2022 Statute | Article 32 | §79-32,111c.
     href: http://www.kslegislature.org/li/b2023_24/statute/079_000_0000_chapter/079_032_0000_article/079_032_0111c_section/079_032_0111c_k/
-    
+  - title: Kansas Notice 24-09 Child and dependent care expenses credit
+    href: https://www.ksrevenue.gov/taxnotices/notice24-09.pdf
diff --git a/policyengine_us/parameters/gov/states/ks/tax/income/deductions/standard/base_amount.yaml b/policyengine_us/parameters/gov/states/ks/tax/income/deductions/standard/base_amount.yaml
index 5be582586b9..8ec751e178e 100644
--- a/policyengine_us/parameters/gov/states/ks/tax/income/deductions/standard/base_amount.yaml
+++ b/policyengine_us/parameters/gov/states/ks/tax/income/deductions/standard/base_amount.yaml
@@ -12,21 +12,28 @@ metadata:
     href: https://www.ksrevenue.gov/pdf/ip23.pdf#page=6
   - title: Kansas 2022 Statute Article 32 §79-32,119(c)
     href: http://www.kslegislature.org/li/b2023_24/statute/079_000_0000_chapter/079_032_0000_article/079_032_0119_section/079_032_0119_k/
+  - title: Kansas Notice 24-08 Changes to individual income tax
+    href: https://www.ksrevenue.gov/taxnotices/notice24-08.pdf#page=2
     
 JOINT:
   2013-01-01: 7_500
   2021-01-01: 8_000
+  2024-01-01: 8_240
 HEAD_OF_HOUSEHOLD:
   2013-01-01: 5_500
   2021-01-01: 6_000
+  2024-01-01: 6_180
 SURVIVING_SPOUSE:
   2013-01-01: 7_500
   2021-01-01: 8_000
+  2024-01-01: 8_240
 SINGLE:
   2013-01-01: 3_000
   2021-01-01: 3_500
+  2024-01-01: 3_605
 SEPARATE:
   # The legal code doesn't specify the value for separate, but
   # recent tax forms show that it is half the joint value.
   2013-01-01: 3_750
   2021-01-01: 4_000
+  2024-01-01: 4_120
diff --git a/policyengine_us/parameters/gov/states/ks/tax/income/exemptions/by_filing_status/amount.yaml b/policyengine_us/parameters/gov/states/ks/tax/income/exemptions/by_filing_status/amount.yaml
new file mode 100644
index 00000000000..be8bc577203
--- /dev/null
+++ b/policyengine_us/parameters/gov/states/ks/tax/income/exemptions/by_filing_status/amount.yaml
@@ -0,0 +1,32 @@
+description: Kansas provides this personal exemption amount, based on filing status, post 2024.
+
+
+JOINT:
+  2021-01-01: 2_250
+  2024-01-01: 18_320
+HEAD_OF_HOUSEHOLD:
+  2021-01-01: 2_250
+  2024-01-01: 9_160
+SURVIVING_SPOUSE:
+  2021-01-01: 2_250
+  2024-01-01: 9_160
+SINGLE:
+  2021-01-01: 2_250
+  2024-01-01: 9_160
+SEPARATE:
+  2021-01-01: 2_250
+  2024-01-01: 9_160
+
+
+metadata:
+  period: year
+  unit: currency-USD
+  label: Kansas personal exemption by filing status amount
+  reference:
+    - title: 2023 Form K-40 instructions
+      href: https://www.ksrevenue.gov/pdf/ip23.pdf#page=2
+    # Structure is applied in 2024
+    - title: Kansas Notice 24-08 Changes to individual income tax
+      href: https://www.ksrevenue.gov/taxnotices/notice24-08.pdf#page=2
+    - title: Kan. Stat. § 79-32,121 (a) 
+      href: https://casetext.com/statute/kansas-statutes/chapter-79-taxation/article-32-income-tax/section-79-32121-kansas-exemption-for-an-individual
diff --git a/policyengine_us/parameters/gov/states/ks/tax/income/exemptions/by_filing_status/dependent.yaml b/policyengine_us/parameters/gov/states/ks/tax/income/exemptions/by_filing_status/dependent.yaml
new file mode 100644
index 00000000000..b7304b140eb
--- /dev/null
+++ b/policyengine_us/parameters/gov/states/ks/tax/income/exemptions/by_filing_status/dependent.yaml
@@ -0,0 +1,16 @@
+description: Kansas provides this exemption amount for each dependent in a filing unit post 2024.
+values:
+  2021-01-01: 2_320
+
+metadata:
+  period: year
+  unit: currency-USD
+  label: Kansas personal exemption by filing status dependent amount
+  reference:
+    - title: 2023 Form K-40 instructions
+      href: https://www.ksrevenue.gov/pdf/ip23.pdf#page=2
+    # Structure is applied in 2024
+    - title: Kansas Notice 24-08 Changes to individual income tax
+      href: https://www.ksrevenue.gov/taxnotices/notice24-08.pdf#page=2
+    - title: Kan. Stat. § 79-32,121 (a) 
+      href: https://casetext.com/statute/kansas-statutes/chapter-79-taxation/article-32-income-tax/section-79-32121-kansas-exemption-for-an-individual
diff --git a/policyengine_us/parameters/gov/states/ks/tax/income/exemptions/by_filing_status/in_effect.yaml b/policyengine_us/parameters/gov/states/ks/tax/income/exemptions/by_filing_status/in_effect.yaml
new file mode 100644
index 00000000000..58951351852
--- /dev/null
+++ b/policyengine_us/parameters/gov/states/ks/tax/income/exemptions/by_filing_status/in_effect.yaml
@@ -0,0 +1,16 @@
+description: Kansas provides an updated personal exemption structure by filing status as well as a separate dependent exemption amount if this is true.
+values:
+  0000-01-01: false
+  2024-01-01: true
+metadata:
+  period: year
+  unit: bool
+  label: Kansas person exemptions by filing status in effect
+  reference:
+    - title: 2023 Form K-40 instructions
+      href: https://www.ksrevenue.gov/pdf/ip23.pdf#page=2
+    # Structure changed in 2024 - this parameter is discontinued
+    - title: Kansas Notice 24-08 Changes to individual income tax
+      href: https://www.ksrevenue.gov/taxnotices/notice24-08.pdf#page=2
+    - title: Kan. Stat. § 79-32,121 (a) 
+      href: https://casetext.com/statute/kansas-statutes/chapter-79-taxation/article-32-income-tax/section-79-32121-kansas-exemption-for-an-individual
diff --git a/policyengine_us/parameters/gov/states/ks/tax/income/exemptions/consolidated/amount.yaml b/policyengine_us/parameters/gov/states/ks/tax/income/exemptions/consolidated/amount.yaml
new file mode 100644
index 00000000000..bdfbacd5864
--- /dev/null
+++ b/policyengine_us/parameters/gov/states/ks/tax/income/exemptions/consolidated/amount.yaml
@@ -0,0 +1,22 @@
+description: Kansas provides this exemption for each person in a filing unit, pre 2024.
+values:
+  2021-01-01: 2_250
+
+metadata:
+  period: year
+  unit: currency-USD
+  label: Kansas personal exemption consolidated amount
+  reference:
+  
+  - title: 2021 Form K-40 instructions
+    href: https://www.ksrevenue.gov/pdf/ip21.pdf
+  - title: 2022 Form K-40 instructions
+    href: https://www.ksrevenue.gov/pdf/ip22.pdf
+  - title: 2023 Form K-40 instructions
+    href: https://www.ksrevenue.gov/pdf/ip23.pdf#page=2
+  # Structure changed in 2024 - this parameter is discontinued
+  - title: Kansas Notice 24-08 Changes to individual income tax
+    href: https://www.ksrevenue.gov/taxnotices/notice24-08.pdf#page=2
+  # Legal code represents post 2024 structure
+  - title: Kan. Stat. § 79-32,121 (a) 
+    href: https://casetext.com/statute/kansas-statutes/chapter-79-taxation/article-32-income-tax/section-79-32121-kansas-exemption-for-an-individual
diff --git a/policyengine_us/parameters/gov/states/ks/tax/income/rates/joint.yaml b/policyengine_us/parameters/gov/states/ks/tax/income/rates/joint.yaml
index 23e8aa3f621..9d2da51008d 100644
--- a/policyengine_us/parameters/gov/states/ks/tax/income/rates/joint.yaml
+++ b/policyengine_us/parameters/gov/states/ks/tax/income/rates/joint.yaml
@@ -4,14 +4,19 @@ brackets:
       2018-01-01: 0
     rate:
       2018-01-01: 0.031
+      2024-01-01: 0.052
   - threshold:
       2018-01-01: 30_000
+      2024-01-01: 46_000
     rate:
       2018-01-01: 0.0525
+      2024-01-01: 0.058
   - threshold:
       2018-01-01: 60_000
+      2024-01-01: .inf
     rate:
       2018-01-01: 0.057
+      2024-01-01: 0.058
 
 metadata:
   threshold_unit: currency_USD
@@ -26,3 +31,5 @@ metadata:
     href: https://www.ksrevenue.gov/pdf/ip23.pdf#page=32
   - title: Kansas 2022 Statute Article 32 §79-32,110_k
     href: http://www.kslegislature.org/li/b2023_24/statute/079_000_0000_chapter/079_032_0000_article/079_032_0110_section/079_032_0110_k/
+  - title: Kansas Notice 24-08 Changes to individual income tax
+    href: https://www.ksrevenue.gov/taxnotices/notice24-08.pdf#page=2
diff --git a/policyengine_us/parameters/gov/states/ks/tax/income/rates/other.yaml b/policyengine_us/parameters/gov/states/ks/tax/income/rates/other.yaml
index 95736f13490..3435754ac5f 100644
--- a/policyengine_us/parameters/gov/states/ks/tax/income/rates/other.yaml
+++ b/policyengine_us/parameters/gov/states/ks/tax/income/rates/other.yaml
@@ -4,14 +4,19 @@ brackets:
       2018-01-01: 0
     rate:
       2018-01-01: 0.031
+      2024-01-01: 0.052
   - threshold:
       2018-01-01: 15_000
+      2024-01-01: 24_000
     rate:
       2018-01-01: 0.0525
+      2024-01-01: 0.058
   - threshold:
       2018-01-01: 30_000
+      2024-01-01: .inf
     rate:
       2018-01-01: 0.057
+      2024-01-01: 0.058
 
 metadata:
   threshold_unit: currency_USD
@@ -26,3 +31,5 @@ metadata:
     href: https://www.ksrevenue.gov/pdf/ip23.pdf#page=32
   - title: Kansas 2022 Statute Article 32 §79-32,110_k
     href: http://www.kslegislature.org/li/b2023_24/statute/079_000_0000_chapter/079_032_0000_article/079_032_0110_section/079_032_0110_k/
+  - title: Kansas Notice 24-08 Changes to individual income tax
+    href: https://www.ksrevenue.gov/taxnotices/notice24-08.pdf#page=2
diff --git a/policyengine_us/variables/gov/states/ks/tax/income/exemptions/ks_exemptions.py b/policyengine_us/variables/gov/states/ks/tax/income/exemptions/ks_exemptions.py
index 25484208a0f..aca4b369d7e 100644
--- a/policyengine_us/variables/gov/states/ks/tax/income/exemptions/ks_exemptions.py
+++ b/policyengine_us/variables/gov/states/ks/tax/income/exemptions/ks_exemptions.py
@@ -12,15 +12,21 @@ class ks_exemptions(Variable):
 
     def formula(tax_unit, period, parameters):
         p = parameters(period).gov.states.ks.tax.income.exemptions
-        exemptions_count = tax_unit("ks_count_exemptions", period)
-        base_exemptions = exemptions_count * p.base
         veteran_exemptions_count = add(
             tax_unit,
             period,
             ["ks_disabled_veteran_exemptions_eligible_person"],
         )
-        additional_exemptions = (
+        vetrans_exemption_amount = (
             veteran_exemptions_count * p.disabled_veteran.base
         )
-
-        return base_exemptions + additional_exemptions
+        if p.by_filing_status.in_effect:
+            filing_status = tax_unit("filing_status", period)
+            base_amount = p.by_filing_status.amount[filing_status]
+            dependents = tax_unit("tax_unit_dependents", period)
+            dependent_amount = p.by_filing_status.dependent * dependents
+            return base_amount + dependent_amount + vetrans_exemption_amount
+        exemptions_count = tax_unit("ks_count_exemptions", period)
+        return (
+            exemptions_count * p.consolidated.amount + vetrans_exemption_amount
+        )


Test patch:
diff --git a/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_exemptions.yaml b/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_exemptions.yaml
new file mode 100644
index 00000000000..eac3331050a
--- /dev/null
+++ b/policyengine_us/tests/policy/baseline/gov/states/ks/tax/income/ks_exemptions.yaml
@@ -0,0 +1,33 @@
+- name: Four exemptions in 2021
+  period: 2021
+  input:
+    ks_count_exemptions: 4
+    state_code: KS
+  output:
+    ks_exemptions: 2_250 * 4
+
+- name: Two exemptions in 2022
+  period: 2022
+  input:
+    ks_count_exemptions: 2
+    state_code: KS
+  output:
+    ks_exemptions: 2_250 * 2
+
+- name: Post 2024, the exemption amount is dependent on filing sttaus and number of dependents
+  period: 2024
+  input:
+    filing_status: JOINT
+    tax_unit_dependents: 2
+    state_code: KS
+  output:
+    ks_exemptions: 22_960
+
+- name: Post 2024, single no dependents
+  period: 2024
+  input:
+    filing_status: SINGLE
+    tax_unit_dependents: 0
+    state_code: KS
+  output:
+    ks_exemptions: 9_160