diff --git a/changelog.d/nm-mfs-capital-gains-split.fixed.md b/changelog.d/nm-mfs-capital-gains-split.fixed.md new file mode 100644 index 00000000000..c025671f12a --- /dev/null +++ b/changelog.d/nm-mfs-capital-gains-split.fixed.md @@ -0,0 +1 @@ +New Mexico net capital gains deduction now gives each married-filing-separately spouse half of the deduction computed on the couple's combined net capital gain, per NMSA 7-2-34(B). diff --git a/policyengine_us/parameters/gov/states/nm/tax/income/deductions/net_capital_gains/separate_filer_share.yaml b/policyengine_us/parameters/gov/states/nm/tax/income/deductions/net_capital_gains/separate_filer_share.yaml new file mode 100644 index 00000000000..7999b9cc022 --- /dev/null +++ b/policyengine_us/parameters/gov/states/nm/tax/income/deductions/net_capital_gains/separate_filer_share.yaml @@ -0,0 +1,18 @@ +description: New Mexico provides this share of the joint-return net capital gains deduction to each separate filer. +values: + 2019-01-01: 0.5 +metadata: + unit: /1 + period: year + label: New Mexico net capital gains deduction separate filer share + reference: + - title: 2019 HB6, Section 14(B), amending NMSA 7-2-34(B) + href: https://www.nmlegis.gov/Sessions/19%20Regular/final/HB0006.pdf#page=41 + - title: 2024 HB252, Section 8(B), amending NMSA 7-2-34(B) + href: https://www.nmlegis.gov/Sessions/24%20Regular/final/HB0252.pdf#page=30 + - title: 2023 New Mexico PIT-ADJ Instructions, Line 16, Net capital gains deduction + href: https://klvg4oyd4j.execute-api.us-west-2.amazonaws.com/prod/PublicFiles/34821a9573ca43e7b06dfad20f5183fd/90560f4e-0ef0-4e52-a003-878b84f858bb/PITbook2023.pdf#page=53 + - title: 2024 New Mexico PIT-ADJ Instructions, Line 16, Net capital gains deduction + href: https://klvg4oyd4j.execute-api.us-west-2.amazonaws.com/prod/PublicFiles/34821a9573ca43e7b06dfad20f5183fd/97f27f33-5e23-4a25-ad68-0980a22b802d/PITbook2024.pdf#page=53 + - title: 2025 New Mexico PIT-ADJ Instructions, Line 16, Net capital gains deduction + href: https://klvg4oyd4j.execute-api.us-west-2.amazonaws.com/prod/PublicFiles/34821a9573ca43e7b06dfad20f5183fd/0558a902-6362-47ca-8e3b-7cca3bc69b9d/2025%20PIT%20Packet_Final.pdf#page=50 diff --git a/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_net_capital_gains_deduction.yaml b/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_net_capital_gains_deduction.yaml index 2ab1cd66842..1ce9ec4ce03 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_net_capital_gains_deduction.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_net_capital_gains_deduction.yaml @@ -278,3 +278,253 @@ # 852(b)(3)(B), so net capital gains = 5,000. # max(40% x 5,000, min(5,000, 1,000)) = max(2,000, 1,000) = 2,000. nm_net_capital_gains_deduction: 2_000 + +# Married filing separately: NMSA 7-2-34(B) (2019 HB6, section 14(B), p.41; +# 2024 HB252, section 8(B), p.30) lets each spouse claim one-half of the +# deduction that would have been allowed on the joint return. The PIT-ADJ line +# 16 instructions (2023 PIT instruction book, p.53) say the same. Each spouse +# heads a separate tax unit, so the deduction is computed on the couple's +# combined gains and losses (reached through the marital unit) and halved. + +- name: Separate couple, gains only on one spouse, each spouse gets half of the joint deduction + period: 2023 + input: + people: + person1: + long_term_capital_gains: 10_000 + person2: + long_term_capital_gains: 0 + tax_units: + tax_unit1: + members: [person1] + filing_status: SEPARATE + tax_unit2: + members: [person2] + filing_status: SEPARATE + marital_units: + marital_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: NM + output: + # Combined net capital gains = 10,000 + 0 = 10,000. + # Joint deduction = max(40% x 10,000, min(10,000, 1,000)) = 4,000. + # Each spouse: 0.5 x 4,000 = 2,000 (before: 2,000 and 0). + nm_net_capital_gains_deduction: [2_000, 2_000] + +- name: Separate couple, gains split between spouses + period: 2023 + input: + people: + person1: + long_term_capital_gains: 2_000 + person2: + long_term_capital_gains: 2_000 + tax_units: + tax_unit1: + members: [person1] + filing_status: SEPARATE + tax_unit2: + members: [person2] + filing_status: SEPARATE + marital_units: + marital_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: NM + output: + # Combined net capital gains = 2,000 + 2,000 = 4,000. + # Joint deduction = max(40% x 4,000, min(4,000, 1,000)) + # = max(1,600, 1,000) = 1,600. + # Each spouse: 0.5 x 1,600 = 800 (before: max(800, 1,000) / 2 = 500 each). + nm_net_capital_gains_deduction: [800, 800] + +- name: Separate couple, one spouse's long-term loss offsets the other's long-term gain + period: 2023 + input: + people: + person1: + long_term_capital_gains: 20_000 + person2: + long_term_capital_gains: -15_000 + tax_units: + tax_unit1: + members: [person1] + filing_status: SEPARATE + tax_unit2: + members: [person2] + filing_status: SEPARATE + marital_units: + marital_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: NM + output: + # Combined net long-term gain = 20,000 - 15,000 = 5,000. + # Joint deduction = max(40% x 5,000, min(5,000, 1,000)) + # = max(2,000, 1,000) = 2,000. + # Each spouse: 0.5 x 2,000 = 1,000 (before: 8,000 / 2 = 4,000 and 0). + nm_net_capital_gains_deduction: [1_000, 1_000] + +- name: Separate couple, one spouse's short-term loss offsets the other's long-term gain + period: 2023 + input: + people: + person1: + long_term_capital_gains: 20_000 + person2: + short_term_capital_gains: -5_000 + tax_units: + tax_unit1: + members: [person1] + filing_status: SEPARATE + tax_unit2: + members: [person2] + filing_status: SEPARATE + marital_units: + marital_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: NM + output: + # Combined net short-term loss = 5,000. + # Combined net capital gains = 20,000 - 5,000 = 15,000. + # Joint deduction = max(40% x 15,000, min(15,000, 1,000)) = 6,000. + # Each spouse: 0.5 x 6,000 = 3,000. + nm_net_capital_gains_deduction: [3_000, 3_000] + +- name: Separate couple, combined gains at the joint $1,000 cap in 2023 + period: 2023 + input: + people: + person1: + long_term_capital_gains: 1_200 + person2: + long_term_capital_gains: 800 + tax_units: + tax_unit1: + members: [person1] + filing_status: SEPARATE + tax_unit2: + members: [person2] + filing_status: SEPARATE + marital_units: + marital_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: NM + output: + # Combined net capital gains = 1,200 + 800 = 2,000. + # Joint deduction = max(40% x 2,000, min(2,000, 1,000)) + # = max(800, 1,000) = 1,000. + # Each spouse: 0.5 x 1,000 = 500 (before: max(480, 1,000) / 2 = 500 and + # max(320, 800) / 2 = 400). + nm_net_capital_gains_deduction: [500, 500] + +- name: Separate couple, combined gains above the joint $2,500 cap in 2025 + period: 2025 + input: + people: + person1: + long_term_capital_gains: 3_000 + person2: + long_term_capital_gains: 1_000 + tax_units: + tax_unit1: + members: [person1] + filing_status: SEPARATE + tax_unit2: + members: [person2] + filing_status: SEPARATE + marital_units: + marital_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: NM + output: + # Combined net capital gains = 3,000 + 1,000 = 4,000. + # Joint deduction = min(4,000, 2,500) = 2,500 (the 40% element is zero). + # Each spouse: 0.5 x 2,500 = 1,250 (before: min(3,000, 2,500) / 2 = 1,250 + # and min(1,000, 2,500) / 2 = 500). + nm_net_capital_gains_deduction: [1_250, 1_250] + +- name: Separate couple with a dependent in one spouse's unit, explicit marital units + period: 2023 + input: + people: + person1: + age: 40 + long_term_capital_gains: 2_000 + person2: + age: 40 + long_term_capital_gains: 2_000 + child: + age: 10 + is_tax_unit_dependent: true + tax_units: + tax_unit1: + members: [person1, child] + filing_status: SEPARATE + tax_unit2: + members: [person2] + filing_status: SEPARATE + marital_units: + marital_unit1: + members: [person1, person2] + marital_unit2: + members: [child] + households: + household: + members: [person1, person2, child] + state_code: NM + output: + # Combined net capital gains = 2,000 + 2,000 = 4,000. + # Joint deduction = max(40% x 4,000, min(4,000, 1,000)) = 1,600. + # Each spouse: 0.5 x 1,600 = 800. + nm_net_capital_gains_deduction: [800, 800] + +- name: Joint couple regression, full deduction on combined gains + period: 2023 + input: + people: + person1: + long_term_capital_gains: 2_000 + person2: + long_term_capital_gains: 2_000 + tax_units: + tax_unit: + members: [person1, person2] + filing_status: JOINT + marital_units: + marital_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: NM + output: + # Net capital gains = 2,000 + 2,000 = 4,000. + # max(40% x 4,000, min(4,000, 1,000)) = 1,600, not halved. + nm_net_capital_gains_deduction: 1_600 + +- name: Single filer regression, full deduction on own gains + period: 2023 + input: + filing_status: SINGLE + long_term_capital_gains: 2_000 + state_code: NM + output: + # max(40% x 2,000, min(2,000, 1,000)) = max(800, 1,000) = 1,000. + nm_net_capital_gains_deduction: 1_000 diff --git a/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_net_capital_gains_deduction.py b/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_net_capital_gains_deduction.py index 7a67fc05a63..6afda064c70 100644 --- a/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_net_capital_gains_deduction.py +++ b/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_net_capital_gains_deduction.py @@ -9,13 +9,18 @@ class nm_net_capital_gains_deduction(Variable): definition_period = YEAR reference = ( "https://nmonesource.com/nmos/nmsa/en/item/4340/index.do#!fragment/zoupio-_Toc140503882/BQCwhgziBcwMYgK4DsDWszIQewE4BUBTADwBdoAvbRABwEtsBaAfX2zgEYAWABgFYeAZgAcwgEwBKADTJspQhACKiQrgCe0AOSapEQmFwJlqjdt37DIAMp5SAIQ0AlAKIAZZwDUAggDkAws5SpGAARtCk7BISQA", - # 2019 HB6, section 14: NMSA 7-2-34(D) adopts IRC 1222(11). + # 2019 HB6, section 14: NMSA 7-2-34(B) gives each spouse filing + # separately one-half of the joint-return deduction, and 7-2-34(D) + # adopts IRC 1222(11). "https://www.nmlegis.gov/Sessions/19%20Regular/final/HB0006.pdf#page=41", # 2019 HB6, section 59(A): section 14 applies from tax year 2019. "https://www.nmlegis.gov/Sessions/19%20Regular/final/HB0006.pdf#page=105", - # 2024 HB252, section 8: from 2025 (section 42(B)) the same definition - # is in NMSA 7-2-34(C). + # 2024 HB252, section 8: from 2025 (section 42(B)) subsection (B) keeps + # the separate-return rule and the same definition is in NMSA + # 7-2-34(C). "https://www.nmlegis.gov/Sessions/24%20Regular/final/HB0252.pdf#page=30", + # 2023 PIT-ADJ instructions, line 16. + "https://klvg4oyd4j.execute-api.us-west-2.amazonaws.com/prod/PublicFiles/34821a9573ca43e7b06dfad20f5183fd/90560f4e-0ef0-4e52-a003-878b84f858bb/PITbook2023.pdf#page=53", "https://www.law.cornell.edu/uscode/text/26/1222#11", # Capital gain distributions are long-term capital gains. "https://www.law.cornell.edu/uscode/text/26/852#b_3_B", @@ -26,10 +31,36 @@ def formula(tax_unit, period, parameters): p = parameters(period).gov.states.nm.tax.income.deductions.net_capital_gains # Capital gain distributions reported without Schedule D are # long-term capital gains under IRC 852(b)(3)(B). - long_term_gain = add( + unit_long_term_gain = add( tax_unit, period, ["long_term_capital_gains", "non_sch_d_capital_gains"] ) - short_term_gain = add(tax_unit, period, ["short_term_capital_gains"]) + unit_short_term_gain = add(tax_unit, period, ["short_term_capital_gains"]) + filing_status = tax_unit("filing_status", period) + separate = filing_status == filing_status.possible_values.SEPARATE + # NMSA 7-2-34(B) (2019 HB6, section 14(B); 2024 HB252, section 8(B)) + # gives each spouse filing separately one-half of the deduction that + # would have been allowed on the joint return, so the deduction is + # computed on the couple's combined gains and losses. Each spouse + # filing separately heads their own tax unit; reach the other spouse's + # unit through the marital unit only when it holds exactly two people + # who both head a separate-filing unit: without explicit marital + # units, everyone shares one default unit. + person = tax_unit.members + separate_head = person("is_tax_unit_head", period) & tax_unit.project(separate) + couple = (person.marital_unit.nb_persons() == 2) & ( + person.marital_unit.sum(separate_head) == 2 + ) + # Only the head of a separate-filing unit can be in such a couple, so + # each tax unit sums at most one couple member's combined amount. + pooled = tax_unit.any(couple) + couple_long_term_gain = tax_unit.sum( + couple * person.marital_unit.sum(tax_unit.project(unit_long_term_gain)) + ) + couple_short_term_gain = tax_unit.sum( + couple * person.marital_unit.sum(tax_unit.project(unit_short_term_gain)) + ) + long_term_gain = where(pooled, couple_long_term_gain, unit_long_term_gain) + short_term_gain = where(pooled, couple_short_term_gain, unit_short_term_gain) # NMSA 7-2-34 defines "net capital gain" by IRC Section 1222(11): net # long-term capital gain less any net short-term capital loss, so # short-term gains are excluded. The definition is in subsection (D) @@ -38,13 +69,7 @@ def formula(tax_unit, period, parameters): net_short_term_loss = max_(0, -short_term_gain) net_capital_gains = max_(0, long_term_gain - net_short_term_loss) uncapped_element = p.uncapped_element_percent * net_capital_gains - filing_status = tax_unit("filing_status", period) - separate = filing_status == filing_status.possible_values.SEPARATE - # Halve the deduction if filing separately. Limitation: the law - # (2019 HB6, section 14(B)) halves the deduction allowed on the joint - # return, which requires the couple's combined gains; each separate - # unit here uses only its own gains. - denominator = where(separate, 2, 1) capped_element = p.capped_element.calc(net_capital_gains) - numerator = max_(uncapped_element, capped_element) - return numerator / denominator + joint_return_deduction = max_(uncapped_element, capped_element) + share = where(separate, p.separate_filer_share, 1) + return share * joint_return_deduction