diff --git a/changelog.d/nj-claim-of-right.added.md b/changelog.d/nj-claim-of-right.added.md new file mode 100644 index 00000000000..cdd3bc78cca --- /dev/null +++ b/changelog.d/nj-claim-of-right.added.md @@ -0,0 +1 @@ +Offset New Jersey claim of right repayments against income of the same category in the year of repayment (N.J.S.A. 54A:5-2, TAM 2011-7), including in the pension exclusion's base and Worksheet D's earnings test. diff --git a/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_exempt_sources/interest.yaml b/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_exempt_sources/interest.yaml new file mode 100644 index 00000000000..bd7d0645103 --- /dev/null +++ b/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_exempt_sources/interest.yaml @@ -0,0 +1,15 @@ +description: New Jersey leaves these amounts out of the interest a claim of right repayment of interest can offset, because New Jersey does not tax them; it subtracts them from gross income separately. +values: + 2021-01-01: + - us_govt_interest_person # Interest on U.S. obligations, exempt in New Jersey +metadata: + unit: list + period: year + label: New Jersey claim of right repayment offset, category (e) exempt interest + reference: + - title: N.J.S.A. 54A:5-1(e) + href: https://law.justia.com/codes/new-jersey/title-54a/section-54a-5-1/ + - title: N.J.S.A. 54A:5-2 + href: https://lis.njleg.state.nj.us/nxt/gateway.dll/statutes/1/53569/53634 + - title: 2025 NJ-1040 instructions, income New Jersey does not tax (direct federal obligations) + href: https://www.nj.gov/treasury/taxation/pdf/current/1040i.pdf#page=10 diff --git a/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_sources/alimony.yaml b/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_sources/alimony.yaml new file mode 100644 index 00000000000..6f6875d9953 --- /dev/null +++ b/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_sources/alimony.yaml @@ -0,0 +1,17 @@ +description: New Jersey offsets a claim of right repayment of category (n) income against these sources of the same category in the year of repayment. +values: + 2021-01-01: + - alimony_income # Line 25 +metadata: + unit: list + period: year + label: New Jersey claim of right repayment offset, category (n) sources + reference: + - title: N.J.S.A. 54A:5-1(n) + href: https://law.justia.com/codes/new-jersey/title-54a/section-54a-5-1/ + - title: N.J.S.A. 54A:5-2 + href: https://lis.njleg.state.nj.us/nxt/gateway.dll/statutes/1/53569/53634 + - title: New Jersey Division of Taxation, TAM 2011-7, Claim of Right Repayment Refunds (IRC 1341) + href: https://www.nj.gov/treasury/taxation/pdf/pubs/tams/tam7.pdf + - title: 2025 NJ-1040, Line 25 + href: https://www.nj.gov/treasury/taxation/pdf/current/1040.pdf#page=2 diff --git a/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_sources/dividends.yaml b/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_sources/dividends.yaml new file mode 100644 index 00000000000..8dd60eaefbb --- /dev/null +++ b/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_sources/dividends.yaml @@ -0,0 +1,17 @@ +description: New Jersey offsets a claim of right repayment of category (f) income against these sources of the same category in the year of repayment. +values: + 2021-01-01: + - dividend_income # Line 17 +metadata: + unit: list + period: year + label: New Jersey claim of right repayment offset, category (f) sources + reference: + - title: N.J.S.A. 54A:5-1(f) + href: https://law.justia.com/codes/new-jersey/title-54a/section-54a-5-1/ + - title: N.J.S.A. 54A:5-2 + href: https://lis.njleg.state.nj.us/nxt/gateway.dll/statutes/1/53569/53634 + - title: New Jersey Division of Taxation, TAM 2011-7, Claim of Right Repayment Refunds (IRC 1341) + href: https://www.nj.gov/treasury/taxation/pdf/pubs/tams/tam7.pdf + - title: 2025 NJ-1040, Line 17 + href: https://www.nj.gov/treasury/taxation/pdf/current/1040.pdf#page=2 diff --git a/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_sources/gambling_winnings.yaml b/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_sources/gambling_winnings.yaml new file mode 100644 index 00000000000..234f2564aee --- /dev/null +++ b/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_sources/gambling_winnings.yaml @@ -0,0 +1,17 @@ +description: New Jersey offsets a claim of right repayment of category (g) income against these sources of the same category in the year of repayment. +values: + 2021-01-01: + - gambling_winnings # Line 24 +metadata: + unit: list + period: year + label: New Jersey claim of right repayment offset, category (g) sources + reference: + - title: N.J.S.A. 54A:5-1(g) + href: https://law.justia.com/codes/new-jersey/title-54a/section-54a-5-1/ + - title: N.J.S.A. 54A:5-2 + href: https://lis.njleg.state.nj.us/nxt/gateway.dll/statutes/1/53569/53634 + - title: New Jersey Division of Taxation, TAM 2011-7, Claim of Right Repayment Refunds (IRC 1341) + href: https://www.nj.gov/treasury/taxation/pdf/pubs/tams/tam7.pdf + - title: 2025 NJ-1040, Line 24 + href: https://www.nj.gov/treasury/taxation/pdf/current/1040.pdf#page=2 diff --git a/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_sources/interest.yaml b/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_sources/interest.yaml new file mode 100644 index 00000000000..12fda4ffd5c --- /dev/null +++ b/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_sources/interest.yaml @@ -0,0 +1,17 @@ +description: New Jersey offsets a claim of right repayment of category (e) income against these sources of the same category in the year of repayment. +values: + 2021-01-01: + - taxable_interest_income # Line 16a +metadata: + unit: list + period: year + label: New Jersey claim of right repayment offset, category (e) sources + reference: + - title: N.J.S.A. 54A:5-1(e) + href: https://law.justia.com/codes/new-jersey/title-54a/section-54a-5-1/ + - title: N.J.S.A. 54A:5-2 + href: https://lis.njleg.state.nj.us/nxt/gateway.dll/statutes/1/53569/53634 + - title: New Jersey Division of Taxation, TAM 2011-7, Claim of Right Repayment Refunds (IRC 1341) + href: https://www.nj.gov/treasury/taxation/pdf/pubs/tams/tam7.pdf + - title: 2025 NJ-1040, Line 16a + href: https://www.nj.gov/treasury/taxation/pdf/current/1040.pdf#page=2 diff --git a/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_sources/pensions_and_annuities.yaml b/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_sources/pensions_and_annuities.yaml new file mode 100644 index 00000000000..6a3dc8f9b32 --- /dev/null +++ b/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_sources/pensions_and_annuities.yaml @@ -0,0 +1,23 @@ +description: New Jersey offsets a claim of right repayment of category (j) income against these sources of the same category in the year of repayment. +values: + 2021-01-01: + - taxable_pension_income # Line 20a + - taxable_ira_distributions + - taxable_roth_conversions + - taxable_401k_distributions + - taxable_403b_distributions + - taxable_sep_distributions + - keogh_distributions +metadata: + unit: list + period: year + label: New Jersey claim of right repayment offset, category (j) sources + reference: + - title: N.J.S.A. 54A:5-1(j) + href: https://law.justia.com/codes/new-jersey/title-54a/section-54a-5-1/ + - title: N.J.S.A. 54A:5-2 + href: https://lis.njleg.state.nj.us/nxt/gateway.dll/statutes/1/53569/53634 + - title: New Jersey Division of Taxation, TAM 2011-7, Claim of Right Repayment Refunds (IRC 1341) + href: https://www.nj.gov/treasury/taxation/pdf/pubs/tams/tam7.pdf + - title: 2025 NJ-1040, Line 20a + href: https://www.nj.gov/treasury/taxation/pdf/current/1040.pdf#page=2 diff --git a/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_sources/wages.yaml b/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_sources/wages.yaml new file mode 100644 index 00000000000..755e97d56c5 --- /dev/null +++ b/policyengine_us/parameters/gov/states/nj/tax/income/gross_income/claim_of_right_category_sources/wages.yaml @@ -0,0 +1,17 @@ +description: New Jersey offsets a claim of right repayment of category (a) income against these sources of the same category in the year of repayment. +values: + 2021-01-01: + - employment_income # Line 15 +metadata: + unit: list + period: year + label: New Jersey claim of right repayment offset, category (a) sources + reference: + - title: N.J.S.A. 54A:5-1(a) + href: https://law.justia.com/codes/new-jersey/title-54a/section-54a-5-1/ + - title: N.J.S.A. 54A:5-2 + href: https://lis.njleg.state.nj.us/nxt/gateway.dll/statutes/1/53569/53634 + - title: New Jersey Division of Taxation, TAM 2011-7, Claim of Right Repayment Refunds (IRC 1341) + href: https://www.nj.gov/treasury/taxation/pdf/pubs/tams/tam7.pdf + - title: 2025 NJ-1040, Line 15 + href: https://www.nj.gov/treasury/taxation/pdf/current/1040.pdf#page=2 diff --git a/policyengine_us/tests/policy/baseline/gov/states/nj/tax/income/adjusted_gross_income/nj_claim_of_right_offset.yaml b/policyengine_us/tests/policy/baseline/gov/states/nj/tax/income/adjusted_gross_income/nj_claim_of_right_offset.yaml new file mode 100644 index 00000000000..b01656d6dbd --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/states/nj/tax/income/adjusted_gross_income/nj_claim_of_right_offset.yaml @@ -0,0 +1,414 @@ +# N.J.S.A. 54A:5-2 and TAM 2011-7: "any repayment or deduction may be applied +# against other income earned in the same category and in the same tax year as +# the repayment ... If the offset results in a net loss or negative amount, the +# taxpayer must report zero income in that category." + +- name: Case 1, a wage repayment like TAM 2011-7's example reduces this year's wages. + period: 2025 + input: + people: + head: + age: 40 + employment_income: 50_000 + claim_of_right_repayment: 8_000 + tax_units: + tax_unit: + members: [head] + households: + household: + members: [head] + state_code: NJ + output: + nj_claim_of_right_offset: 8_000 + nj_gross_income: 42_000 + nj_agi: 42_000 + +- name: Case 2, wages are reported as zero, and other categories are untouched, when the repayment exceeds them. + period: 2025 + input: + people: + head: + age: 40 + employment_income: 5_000 + taxable_interest_income: 1_000 + claim_of_right_repayment: 8_000 + tax_units: + tax_unit: + members: [head] + households: + household: + members: [head] + state_code: NJ + output: + nj_claim_of_right_offset: 5_000 + nj_gross_income: 1_000 + +- name: Case 3, a repaid pension offsets pensions, not wages. + period: 2025 + input: + people: + head: + age: 70 + employment_income: 10_000 + taxable_pension_income: 2_000 + claim_of_right_repayment: 3_000 + nj_claim_of_right_repayment_category: PENSIONS_AND_ANNUITIES + tax_units: + tax_unit: + members: [head] + households: + household: + members: [head] + state_code: NJ + output: + nj_claim_of_right_offset: 2_000 + nj_claim_of_right_pension_offset: 2_000 + nj_gross_income: 10_000 + # Line 20a is zero after the offset, so the pension exclusion is zero. + nj_eligible_pension_income: 0 + nj_agi: 10_000 + +- name: Case 4, repaid income New Jersey never taxed, such as unemployment compensation, offsets nothing. + period: 2025 + input: + people: + head: + age: 40 + employment_income: 30_000 + claim_of_right_repayment: 4_000 + nj_claim_of_right_repayment_category: NOT_TAXED + tax_units: + tax_unit: + members: [head] + households: + household: + members: [head] + state_code: NJ + output: + nj_claim_of_right_offset: 0 + nj_gross_income: 30_000 + +# Joint return: line 15 combines both spouses' wages ($2,000 + $40,000 = +# $42,000), so the head's $6,000 wage repayment is offset in full. It offsets +# the head's own $2,000 of wages first and the other $4,000 against the +# spouse's. The dependent's repayment belongs on the dependent's own return. +- name: Case 5, a joint return offsets the repayer's wages first and the excess against the spouse's. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + head: + age: 40 + employment_income: 2_000 + claim_of_right_repayment: 6_000 + spouse: + age: 40 + employment_income: 40_000 + child: + age: 17 + employment_income: 3_000 + claim_of_right_repayment: 3_000 + tax_units: + tax_unit: + members: [head, spouse, child] + households: + household: + members: [head, spouse, child] + state_code: NJ + output: + nj_claim_of_right_offset: [2_000, 4_000, 0] + nj_gross_income: [0, 36_000, 3_000] + +- name: Case 6, the federal credit method does not change the offset. + period: 2025 + input: + people: + head: + age: 40 + employment_income: 50_000 + claim_of_right_repayment: 8_000 + tax_units: + tax_unit: + members: [head] + claim_of_right_credit_applies: true + households: + household: + members: [head] + state_code: NJ + output: + nj_claim_of_right_offset: 8_000 + +- name: Case 7, outside New Jersey. + period: 2025 + input: + people: + head: + age: 40 + employment_income: 50_000 + claim_of_right_repayment: 8_000 + tax_units: + tax_unit: + members: [head] + households: + household: + members: [head] + state_code: NY + output: + nj_claim_of_right_offset: 0 + +- name: Case 8, a repayment of another category is not offset. + period: 2025 + input: + people: + head: + age: 40 + employment_income: 30_000 + claim_of_right_repayment: 5_000 + nj_claim_of_right_repayment_category: OTHER + tax_units: + tax_unit: + members: [head] + households: + household: + members: [head] + state_code: NJ + output: + nj_claim_of_right_offset: 0 + nj_gross_income: 30_000 + +# Age 70, wages $30,000, pensions $50,000, repays $8,000 of pension income. +# Line 20a = $42,000 and line 27 = $72,000. Line 28a = the lesser of $42,000 +# and the maximum exclusion ($75,000 single at total income of $100,000 or +# less), so $42,000. Worksheet D does not apply: line 15 is over $3,000. +# Line 29 = $72,000 - $42,000 = $30,000. +- name: Case 9, a pension repayment also reduces the pension exclusion's base, line 20a. + period: 2025 + input: + people: + head: + age: 70 + employment_income: 30_000 + taxable_pension_income: 50_000 + claim_of_right_repayment: 8_000 + nj_claim_of_right_repayment_category: PENSIONS_AND_ANNUITIES + tax_units: + tax_unit: + members: [head] + households: + household: + members: [head] + state_code: NJ + output: + nj_total_income: 72_000 + nj_eligible_pension_income: 42_000 + nj_pension_retirement_exclusion: 42_000 + nj_agi: 30_000 + +# Age 65, wages $10,000 of which $8,000 is repaid, interest $20,000. Worksheet +# D line 4 is line 15, $2,000, so lines 4-7 total $3,000 or less and the +# unused exclusion applies: total income $22,000, all of it excludable +# ($22,000 is under both the income limit and the $75,000 maximum), less the +# $0 pension exclusion = $22,000. Line 29 = $22,000 - $22,000 = $0. +- name: Case 10, Worksheet D's $3,000 earnings test uses wages after a wage repayment. + period: 2025 + input: + people: + head: + age: 65 + employment_income: 10_000 + taxable_interest_income: 20_000 + claim_of_right_repayment: 8_000 + tax_units: + tax_unit: + members: [head] + households: + household: + members: [head] + state_code: NJ + output: + nj_claim_of_right_wage_offset: 8_000 + nj_total_income: 22_000 + nj_other_retirement_income_exclusion: 22_000 + nj_agi: 0 + +# Wages $30,000, $5,000 of interest, all of it on U.S. Treasury obligations, +# which New Jersey does not tax and subtracts from gross income separately. A +# repaid $8,000 of interest has no New Jersey-taxable interest to offset, so +# total income stays $30,000. +- name: Case 11, a repayment of interest does not offset interest New Jersey exempts. + period: 2025 + input: + people: + head: + age: 40 + employment_income: 30_000 + taxable_interest_income: 5_000 + us_govt_interest_person: 5_000 + claim_of_right_repayment: 8_000 + nj_claim_of_right_repayment_category: INTEREST + tax_units: + tax_unit: + members: [head] + households: + household: + members: [head] + state_code: NJ + output: + nj_claim_of_right_offset: 0 + nj_total_income: 30_000 + +# Joint return: head aged 70 with wages $30,000 and a $20,000 pension; spouse +# aged 40 with a $20,000 pension. Line 27 is $70,000 - $8,000 = $62,000 either +# way. Only the head is old enough for the pension exclusion, so line 28a is +# the head's own pension (Line A, joint filers): $20,000 when the spouse repaid +# $8,000 of the spouse's pension (line 29 $42,000), $12,000 when the head +# repaid it (line 29 $50,000). Wages exceed $3,000, so no Worksheet D. +- name: Case 12, a pension repayment by the younger spouse leaves the older spouse's exclusion whole. + period: 2025 + input: + people: + head: + age: 70 + employment_income: 30_000 + taxable_pension_income: 20_000 + spouse: + age: 40 + taxable_pension_income: 20_000 + claim_of_right_repayment: 8_000 + nj_claim_of_right_repayment_category: PENSIONS_AND_ANNUITIES + tax_units: + tax_unit: + members: [head, spouse] + households: + household: + members: [head, spouse] + state_code: NJ + output: + nj_claim_of_right_pension_offset: [0, 8_000] + nj_eligible_pension_income: [20_000, 0] + nj_agi: 42_000 + +- name: Case 13, a pension repayment by the older spouse reduces that spouse's exclusion. + period: 2025 + input: + people: + head: + age: 70 + employment_income: 30_000 + taxable_pension_income: 20_000 + claim_of_right_repayment: 8_000 + nj_claim_of_right_repayment_category: PENSIONS_AND_ANNUITIES + spouse: + age: 40 + taxable_pension_income: 20_000 + tax_units: + tax_unit: + members: [head, spouse] + households: + household: + members: [head, spouse] + state_code: NJ + output: + nj_claim_of_right_pension_offset: [8_000, 0] + nj_eligible_pension_income: [12_000, 0] + nj_agi: 50_000 + +# Wages $30,000 and $10,000 of interest, $5,000 of it on U.S. Treasury +# obligations. A repaid $8,000 of interest offsets only the $5,000 of interest +# New Jersey taxes: gross income $30,000 + $10,000 - $5,000 = $35,000, and the +# separate subtraction of the $5,000 of Treasury interest leaves total income of +# $30,000. +- name: Case 14, a repayment of interest offsets the interest New Jersey taxes. + period: 2025 + input: + people: + head: + age: 40 + employment_income: 30_000 + taxable_interest_income: 10_000 + us_govt_interest_person: 5_000 + claim_of_right_repayment: 8_000 + nj_claim_of_right_repayment_category: INTEREST + tax_units: + tax_unit: + members: [head] + households: + household: + members: [head] + state_code: NJ + output: + nj_claim_of_right_offset: 5_000 + nj_gross_income: 35_000 + nj_total_income: 30_000 + +# The different dividend and gambling amounts distinguish categories (f) and +# (g): line 17 is $5,000 - $4,500 = $500, line 24 stays $4,000, and gross +# income is $30,000 + $500 + $4,000 = $34,500. +- name: Case 15, a dividend repayment offsets dividends and leaves gambling winnings untouched. + period: 2025 + input: + people: + head: + age: 40 + employment_income: 30_000 + dividend_income: 5_000 + gambling_winnings: 4_000 + claim_of_right_repayment: 4_500 + nj_claim_of_right_repayment_category: DIVIDENDS + tax_units: + tax_unit: + members: [head] + households: + household: + members: [head] + state_code: NJ + output: + nj_claim_of_right_offset: 4_500 + nj_gross_income: 34_500 + +# Line 24 cannot go below zero: min($4,500, $4,000) = $4,000. Line 17 stays +# $5,000, so gross income is $30,000 + $5,000 = $35,000. +- name: Case 16, a gambling repayment is capped at gambling winnings and leaves dividends untouched. + period: 2025 + input: + people: + head: + age: 40 + employment_income: 30_000 + dividend_income: 5_000 + gambling_winnings: 4_000 + claim_of_right_repayment: 4_500 + nj_claim_of_right_repayment_category: GAMBLING_WINNINGS + tax_units: + tax_unit: + members: [head] + households: + household: + members: [head] + state_code: NJ + output: + nj_claim_of_right_offset: 4_000 + nj_gross_income: 35_000 + +# Line 25 is floored at zero: min($2,000, $1,500) = $1,500. Wages stay +# $30,000; mapping this repayment to wages would incorrectly offset $2,000. +- name: Case 17, an alimony repayment is capped at alimony and leaves wages untouched. + period: 2025 + input: + people: + head: + age: 40 + employment_income: 30_000 + alimony_income: 1_500 + claim_of_right_repayment: 2_000 + nj_claim_of_right_repayment_category: ALIMONY + tax_units: + tax_unit: + members: [head] + households: + household: + members: [head] + state_code: NJ + output: + nj_claim_of_right_offset: 1_500 + nj_gross_income: 30_000 diff --git a/policyengine_us/tests/unit/test_claim_of_right_section_1341_properties.py b/policyengine_us/tests/unit/test_claim_of_right_section_1341_properties.py index 022de486265..c693c2a1ac8 100644 --- a/policyengine_us/tests/unit/test_claim_of_right_section_1341_properties.py +++ b/policyengine_us/tests/unit/test_claim_of_right_section_1341_properties.py @@ -40,10 +40,12 @@ its payment is the prior-year increase when the credit method applies and zero otherwise. -Last, one itemizing household per state: the credit method reduces the federal -tax deductible in Alabama, Missouri and Oregon, so their state taxes can rise. -Other states' taxes stay unchanged for this household (no state input is -supplied). The deduction method leaves Arizona's and Kansas's taxes unchanged. +Last, one itemizing household per state: with the credit method fixed, the +repayment reduces the federal tax deductible in Alabama, Missouri and Oregon, so +their state taxes can rise; it lowers the tax of each state listed in +STATES_WITH_RELIEF_UNDER_THE_CREDIT whose rule is in the model; and it leaves +every other state's income tax unchanged (section 1341(b)(3)). With the +deduction method fixed it leaves Arizona's and Kansas's taxes unchanged. """ import gc @@ -89,6 +91,28 @@ # deduction: A.R.S. 43-1021(9) and K.S.A. 79-32,120(a). # California carries the federal deduction in Schedule CA column A. STATES_WITHOUT_THE_DEDUCTION = ["AZ", "KS"] +# States whose own claim of right relief applies when federal tax is computed +# with the section 1341 credit, and the variable that carries it. Under the +# credit method these lower the household's state tax. A listed state whose +# variable is not in the model yet must not change. +STATES_WITH_RELIEF_UNDER_THE_CREDIT = { + # Ark. Code 26-51-457: a deduction whichever federal method applies. + "AR": "ar_claim_of_right_deduction", + # Act 56, SLH 2023: section 1341 computed on Hawaii tax, independently. + "HI": "hi_claim_of_right_credit", + # 35 ILCS 5/203(a)(2)(P): the deduction used to compute the federal credit. + "IL": "il_claim_of_right_subtraction", + # IC 6-3-1-3.5(a)(22). + "IN": "in_claim_of_right_deduction", + # M.G.L. c. 62, s. 3(B)(a)(14). + "MA": "ma_claim_of_right_deduction", + # N.J.S.A. 54A:5-2 and TAM 2011-7: an offset within the income category. + "NJ": "nj_claim_of_right_offset", + # R.C. 5747.01(A)(12). + "OH": "oh_claim_of_right_deduction", + # IT-140 Schedule M, IRC 1341 Repayments. + "WV": "wv_claim_of_right_subtraction", +} BRANCHES = [ "income_tax_if_claiming_claim_of_right_deduction", "income_tax_if_claiming_claim_of_right_credit", @@ -304,8 +328,8 @@ def test_north_carolina_follows_the_federal_method(results, year): ) -def state_income_tax(year, repayment, method=None): - """State income tax of an itemizing single filer in each state.""" +def state_simulation(year, repayment, method=None): + """An itemizing single filer in each state.""" situation = {"people": {}, "tax_units": {}, "households": {}} for i, state in enumerate(STATES): situation["people"][f"p{i}"] = { @@ -326,20 +350,32 @@ def state_income_tax(year, repayment, method=None): "members": [f"p{i}"], "state_code": {year: state}, } - simulation = Simulation(situation=situation) + return Simulation(situation=situation) + + +def state_income_tax(simulation, year): return np.asarray(simulation.calculate("state_income_tax", year)) def test_states_under_each_federal_method(): # One year: each of these three simulations computes every state's tax. year = YEARS[0] - without_repayment = state_income_tax(year, 0) - with_credit = state_income_tax(year, 10_000, method=True) + without_repayment = state_income_tax(state_simulation(year, 0), year) + credit = state_simulation(year, 10_000, method=True) + with_credit = state_income_tax(credit, year) + variables = credit.tax_benefit_system.variables + relief = np.isin( + STATES, + [ + state + for state, variable in STATES_WITH_RELIEF_UNDER_THE_CREDIT.items() + if variable in variables + ], + ) federal_tax_deduction_states = np.isin(STATES, ["AL", "MO", "OR"]) + unchanged = ~relief & ~federal_tax_deduction_states np.testing.assert_allclose( - with_credit[~federal_tax_deduction_states], - without_repayment[~federal_tax_deduction_states], - atol=TOLERANCE, + with_credit[unchanged], without_repayment[unchanged], atol=TOLERANCE ) assert np.all( with_credit[federal_tax_deduction_states] @@ -349,7 +385,12 @@ def test_states_under_each_federal_method(): with_credit[federal_tax_deduction_states] > without_repayment[federal_tax_deduction_states] + TOLERANCE ) - with_deduction = state_income_tax(year, 10_000, method=False) + assert np.all(with_credit[relief] < without_repayment[relief] - 1), ( + "each listed state's own rule should lower its tax under the credit method" + ) + with_deduction = state_income_tax( + state_simulation(year, 10_000, method=False), year + ) assert np.any(np.abs(with_deduction - without_repayment) > 1), ( "the deduction should reach the states that follow federal itemized deductions" ) diff --git a/policyengine_us/tests/unit/test_nj_claim_of_right_properties.py b/policyengine_us/tests/unit/test_nj_claim_of_right_properties.py new file mode 100644 index 00000000000..e2a8c63d8c5 --- /dev/null +++ b/policyengine_us/tests/unit/test_nj_claim_of_right_properties.py @@ -0,0 +1,218 @@ +"""Properties of New Jersey's claim of right repayment offset. + +N.J.S.A. 54A:5-2 and TAM 2011-7: a repayment is applied against income of the +same category in the year of repayment, and a category left negative is +reported as zero. New Jersey has no counterpart to the section 1341 credit. +The policy cases are in YAML. These tests check what YAML cannot, over a grid +of single returns and joint returns with a spouse of the same age (with wages) +or the other age (with a pension): + +- a repayment acts on New Jersey AGI and taxable income exactly as a + simulation with no repayment and that much less income in the repaid + category, taken from the repayer first and then the spouse; this reaches the + pension exclusion (line 20a) and Worksheet D's earnings test (line 15); +- no filer's offset exceeds their own income in the category; +- on this grid, which has no federal child and dependent care credit, New + Jersey tax does not depend on the federal method, never rises with a + repayment, and never rises as it grows; +- the category source lists cover the gross income sources and match the + pension exclusion's sources. +""" + +import gc +import itertools + +import numpy as np +import pytest + +from policyengine_us import Simulation +from policyengine_us.system import system + +YEAR = 2025 +CATEGORIES = ["WAGES", "PENSIONS_AND_ANNUITIES", "NOT_TAXED", "OTHER"] +REPAYMENTS = [0, 1_000, 8_000, 60_000] +HEAD_WAGES = [0, 2_000, 50_000] +HEAD_PENSIONS = [0, 20_000] +AGES = [40, 70] +# A single return, or a joint return with a spouse of the head's age who has +# wages, or of the other age who has a pension. +SPOUSES = ["none", "same_age_wages", "other_age_pension"] +AXES = [CATEGORIES, REPAYMENTS, HEAD_WAGES, HEAD_PENSIONS, AGES, SPOUSES] +GRID = list(itertools.product(*AXES)) +SHAPE = tuple(len(axis) for axis in AXES) +CATEGORY = np.array([point[0] for point in GRID]) +REPAYMENT, WAGE, PENSION, AGE = ( + np.array([point[i] for point in GRID], dtype=float) for i in range(1, 5) +) +SPOUSE = np.array([point[5] for point in GRID]) +JOINT = SPOUSE != "none" +SPOUSE_WAGE = np.where(SPOUSE == "same_age_wages", 30_000.0, 0.0) +SPOUSE_PENSION = np.where(SPOUSE == "other_age_pension", 20_000.0, 0.0) +# The other age: 70 for a 40-year-old head and 40 for a 70-year-old one. +SPOUSE_AGE = np.where(SPOUSE == "other_age_pension", 110 - AGE, AGE) +ZEROS = np.zeros_like(REPAYMENT) +TOLERANCE = 0.01 + + +def category_cuts(): + """The income each filer gives up in the reference: the return's offset, + min(repayment, the filers' income in the repaid category), taken from the + repayer (the head) first and the rest from the spouse.""" + wages = CATEGORY == "WAGES" + pensions = CATEGORY == "PENSIONS_AND_ANNUITIES" + head_income = np.where(wages, WAGE, np.where(pensions, PENSION, 0)) + spouse_income = np.where(wages, SPOUSE_WAGE, np.where(pensions, SPOUSE_PENSION, 0)) + offset = np.minimum(REPAYMENT, head_income + spouse_income) + head_cut = np.minimum(offset, head_income) + return offset, head_cut, offset - head_cut + + +OFFSET, HEAD_CUT, SPOUSE_CUT = category_cuts() + + +def cut_of(kind, i, cut): + """How much of a filer's wages or pension the reference removes.""" + return cut[i] if CATEGORY[i] == kind else 0 + + +def grid_simulation(repayment, cut=False, tax_unit_inputs=None): + """One New Jersey return per grid point; the head repays. With cut=True, + no repayment and each filer's repaid-category income lowered instead.""" + head_cut = HEAD_CUT if cut else ZEROS + spouse_cut = SPOUSE_CUT if cut else ZEROS + situation = {"people": {}, "tax_units": {}, "marital_units": {}, "households": {}} + for i in range(len(GRID)): + head = f"h{i}" + members = [head] + situation["people"][head] = { + "age": {YEAR: AGE[i]}, + "employment_income": {YEAR: WAGE[i] - cut_of("WAGES", i, head_cut)}, + "taxable_pension_income": { + YEAR: PENSION[i] - cut_of("PENSIONS_AND_ANNUITIES", i, head_cut) + }, + "taxable_interest_income": {YEAR: 1_000}, + "claim_of_right_repayment": {YEAR: 0 if cut else float(repayment[i])}, + "nj_claim_of_right_repayment_category": {YEAR: CATEGORY[i]}, + } + if JOINT[i]: + spouse = f"s{i}" + members.append(spouse) + situation["people"][spouse] = { + "age": {YEAR: SPOUSE_AGE[i]}, + "employment_income": { + YEAR: SPOUSE_WAGE[i] - cut_of("WAGES", i, spouse_cut) + }, + "taxable_pension_income": { + YEAR: SPOUSE_PENSION[i] + - cut_of("PENSIONS_AND_ANNUITIES", i, spouse_cut) + }, + } + # Lowering wages in the reference can qualify a couple over 65 for a + # Medicare Savings Program, which pays their Part B premiums and so + # removes New Jersey's medical expense deduction; the repayment itself + # does not. Pin the deduction so the comparison isolates the offset. + tax_unit = {"members": members, "nj_medical_expense_deduction": {YEAR: 0}} + for name, value in (tax_unit_inputs or {}).items(): + tax_unit[name] = {YEAR: value} + situation["tax_units"][f"t{i}"] = tax_unit + situation["marital_units"][f"m{i}"] = {"members": members} + situation["households"][f"hh{i}"] = { + "members": members, + "state_code": {YEAR: "NJ"}, + } + return Simulation(situation=situation) + + +def by_tax_unit(simulation, variable): + return np.asarray(simulation.calculate(variable, YEAR, map_to="tax_unit")) + + +@pytest.fixture(scope="module") +def results(): + model = grid_simulation(REPAYMENT) + out = { + "offset": by_tax_unit(model, "nj_claim_of_right_offset"), + "nj_agi": by_tax_unit(model, "nj_agi"), + "nj_taxable_income": by_tax_unit(model, "nj_taxable_income"), + "tax": by_tax_unit(model, "nj_income_tax"), + "person_offset": np.asarray(model.calculate("nj_claim_of_right_offset", YEAR)), + } + reference = grid_simulation(ZEROS, cut=True) + out["reference_nj_agi"] = by_tax_unit(reference, "nj_agi") + out["reference_nj_taxable_income"] = by_tax_unit(reference, "nj_taxable_income") + out["tax_none"] = by_tax_unit(grid_simulation(ZEROS), "nj_income_tax") + out["tax_federal_credit"] = by_tax_unit( + grid_simulation( + REPAYMENT, tax_unit_inputs={"claim_of_right_credit_applies": True} + ), + "nj_income_tax", + ) + yield out + gc.collect() + + +def test_a_repayment_acts_as_less_income_in_its_category(results): + np.testing.assert_allclose(results["offset"], OFFSET, atol=TOLERANCE) + np.testing.assert_allclose( + results["nj_agi"], results["reference_nj_agi"], atol=TOLERANCE + ) + np.testing.assert_allclose( + results["nj_taxable_income"], + results["reference_nj_taxable_income"], + atol=TOLERANCE, + ) + assert np.any((OFFSET > 0) & (OFFSET < REPAYMENT)), "the cap should bind" + assert np.any(SPOUSE_CUT > 0), "some repayment should reach the spouse" + + +def test_no_filer_offsets_more_than_their_own_category_income(results): + # In the simulation's person order: each head, then its spouse. + bound = [] + for i in range(len(GRID)): + head = {"WAGES": WAGE[i], "PENSIONS_AND_ANNUITIES": PENSION[i]} + bound.append(head.get(CATEGORY[i], 0)) + if JOINT[i]: + spouse = { + "WAGES": SPOUSE_WAGE[i], + "PENSIONS_AND_ANNUITIES": SPOUSE_PENSION[i], + } + bound.append(spouse.get(CATEGORY[i], 0)) + offset = results["person_offset"] + assert np.all(offset >= -TOLERANCE) + assert np.all(offset <= np.array(bound) + TOLERANCE) + + +def test_tax_ignores_the_federal_method_and_never_rises(results): + np.testing.assert_allclose( + results["tax_federal_credit"], results["tax"], atol=TOLERANCE + ) + assert np.all(results["tax"] <= results["tax_none"] + TOLERANCE) + assert np.any(results["tax"] < results["tax_none"] - 1) + table = results["tax"].reshape(SHAPE) + assert np.all(np.diff(table, axis=1) <= TOLERANCE), "rises with the repayment" + + +def test_category_sources_match_the_gross_income_lists(): + """The offset's category lists cover every non-negative gross income + source but line 26's other income, without overlap, and the pension + category is exactly the pension exclusion's sources, in every year block.""" + income = system.parameters.gov.states.nj.tax.income + names = [ + "wages", + "interest", + "dividends", + "gambling_winnings", + "pensions_and_annuities", + "alimony", + ] + for instant in ["2021-01-01", "2025-01-01", "2026-01-01"]: + categories = income.gross_income.claim_of_right_category_sources + lists = [list(getattr(categories, name)(instant)) for name in names] + flat = [source for sources in lists for source in sources] + assert len(flat) == len(set(flat)), "a source is in two categories" + expected = set(income.gross_income.non_negative_sources(instant)) - { + "miscellaneous_income" + } + assert set(flat) == expected, (instant, set(flat) ^ expected) + pensions = set(categories.pensions_and_annuities(instant)) + assert pensions == set(income.exclusions.retirement.sources(instant)) diff --git a/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/claim_of_right/nj_claim_of_right_offset.py b/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/claim_of_right/nj_claim_of_right_offset.py new file mode 100644 index 00000000000..c498cdb6cbf --- /dev/null +++ b/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/claim_of_right/nj_claim_of_right_offset.py @@ -0,0 +1,38 @@ +from policyengine_us.model_api import * +from policyengine_us.variables.gov.states.nj.tax.income.adjusted_gross_income.claim_of_right.nj_claim_of_right_repayment_category import ( + CATEGORY_SOURCES, + nj_claim_of_right_category_offset, +) + + +class nj_claim_of_right_offset(Variable): + value_type = float + entity = Person + label = "New Jersey claim of right repayment offset" + unit = USD + documentation = ( + "Reduction in a person's New Jersey gross income for a claim of " + "right repayment. New Jersey applies a repayment against income of " + "the same category in the year of repayment, and a category with a " + "net negative amount is reported as zero. A repayment offsets the " + "repayer's own taxable income in the category first; on a joint " + "return any excess offsets the other spouse's. New Jersey has no " + "counterpart to the section 1341 credit, so the federal method does " + "not matter." + ) + definition_period = YEAR + reference = ( + # N.J.S.A. 54A:5-2 + "https://lis.njleg.state.nj.us/nxt/gateway.dll/statutes/1/53569/53634", + # TAM 2011-7, Claim of Right Repayment Refunds (IRC 1341) + "https://www.nj.gov/treasury/taxation/pdf/pubs/tams/tam7.pdf", + ) + defined_for = StateCode.NJ + + def formula(person, period, parameters): + offset = 0 + for category in CATEGORY_SOURCES: + offset = offset + nj_claim_of_right_category_offset( + person, period, parameters, category + ) + return offset diff --git a/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/claim_of_right/nj_claim_of_right_pension_offset.py b/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/claim_of_right/nj_claim_of_right_pension_offset.py new file mode 100644 index 00000000000..ef6b4f13539 --- /dev/null +++ b/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/claim_of_right/nj_claim_of_right_pension_offset.py @@ -0,0 +1,34 @@ +from policyengine_us.model_api import * +from policyengine_us.variables.gov.states.nj.tax.income.adjusted_gross_income.claim_of_right.nj_claim_of_right_repayment_category import ( + NJClaimOfRightRepaymentCategory, + nj_claim_of_right_category_offset, +) + + +class nj_claim_of_right_pension_offset(Variable): + value_type = float + entity = Person + label = "New Jersey claim of right offset against pensions and annuities" + unit = USD + documentation = ( + "The part of nj_claim_of_right_offset that reduces the person's " + "pensions, annuities and IRA withdrawals (NJ-1040 line 20a), the " + "base of the pension exclusion." + ) + definition_period = YEAR + reference = ( + # N.J.S.A. 54A:5-2 + "https://lis.njleg.state.nj.us/nxt/gateway.dll/statutes/1/53569/53634", + "https://www.nj.gov/treasury/taxation/pdf/pubs/tams/tam7.pdf", + # 2025 NJ-1040 instructions, line 28a, Line A + "https://www.nj.gov/treasury/taxation/pdf/current/1040i.pdf#page=22", + ) + defined_for = StateCode.NJ + + def formula(person, period, parameters): + return nj_claim_of_right_category_offset( + person, + period, + parameters, + NJClaimOfRightRepaymentCategory.PENSIONS_AND_ANNUITIES, + ) diff --git a/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/claim_of_right/nj_claim_of_right_repayment_category.py b/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/claim_of_right/nj_claim_of_right_repayment_category.py new file mode 100644 index 00000000000..c0137d90919 --- /dev/null +++ b/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/claim_of_right/nj_claim_of_right_repayment_category.py @@ -0,0 +1,104 @@ +from policyengine_us.model_api import * + + +class NJClaimOfRightRepaymentCategory(Enum): + WAGES = "Salaries, wages and other remuneration (category a)" + INTEREST = "Interest (category e)" + DIVIDENDS = "Dividends (category f)" + GAMBLING_WINNINGS = "Gambling winnings (category g)" + PENSIONS_AND_ANNUITIES = "Pensions, annuities and IRA withdrawals (category j)" + ALIMONY = "Alimony and separate maintenance (category n)" + OTHER = "Another category of New Jersey gross income (not offset in the model)" + NOT_TAXED = "Income New Jersey did not tax when received" + + +# The parameter list of income sources for each category the model offsets. +CATEGORY_SOURCES = { + NJClaimOfRightRepaymentCategory.WAGES: "wages", + NJClaimOfRightRepaymentCategory.INTEREST: "interest", + NJClaimOfRightRepaymentCategory.DIVIDENDS: "dividends", + NJClaimOfRightRepaymentCategory.GAMBLING_WINNINGS: "gambling_winnings", + NJClaimOfRightRepaymentCategory.PENSIONS_AND_ANNUITIES: "pensions_and_annuities", + NJClaimOfRightRepaymentCategory.ALIMONY: "alimony", +} + + +# Amounts in a category's sources that New Jersey does not tax and subtracts +# from gross income separately, so a repayment cannot offset them. +CATEGORY_EXEMPT_SOURCES = { + NJClaimOfRightRepaymentCategory.INTEREST: "interest", +} + + +def nj_claim_of_right_category_offset(person, period, parameters, category): + """A person's share of the return's claim of right offset in one category. + + New Jersey applies a repayment against income of the same category in the + year of repayment, and reports a category left negative as zero (N.J.S.A. + 54A:5-2; TAM 2011-7). A repayment first offsets the repayer's own taxable + income in the category; on a joint return, whose category line combines + both spouses, any excess offsets the other spouse's income in it. So the + return's offset is the smaller of the filers' repayments of the category + and their income in it, and no one's income in the category falls below + zero. Dependents' repayments and income belong on their own returns. + """ + gross_income = parameters(period).gov.states.nj.tax.income.gross_income + head_or_spouse = person("is_tax_unit_head_or_spouse", period) + repaid_category = person("nj_claim_of_right_repayment_category", period) + repayment = ( + person("claim_of_right_repayment", period) + * head_or_spouse + * (repaid_category == category) + ) + sources = getattr( + gross_income.claim_of_right_category_sources, CATEGORY_SOURCES[category] + ) + income = add(person, period, sources) + if category in CATEGORY_EXEMPT_SOURCES: + exempt = getattr( + gross_income.claim_of_right_category_exempt_sources, + CATEGORY_EXEMPT_SOURCES[category], + ) + income = income - add(person, period, exempt) + income = max_(income, 0) * head_or_spouse + own_offset = min_(repayment, income) + # The tax unit sums below are repeated for each member. + excess = person.tax_unit.sum(repayment - own_offset) + remaining_income = income - own_offset + return_remaining_income = person.tax_unit.sum(remaining_income) + excess_offset = min_(excess, return_remaining_income) + share = np.divide( + remaining_income, + return_remaining_income, + out=np.zeros_like(remaining_income), + where=return_remaining_income > 0, + ) + return own_offset + share * excess_offset + + +class nj_claim_of_right_repayment_category(Variable): + value_type = Enum + possible_values = NJClaimOfRightRepaymentCategory + default_value = NJClaimOfRightRepaymentCategory.WAGES + entity = Person + label = "New Jersey gross income category of a claim of right repayment" + documentation = ( + "The New Jersey gross income category (N.J.S.A. 54A:5-1) of the " + "income repaid in claim_of_right_repayment. New Jersey offsets the " + "repayment only against income of the same category in the year of " + "repayment. NOT_TAXED is income New Jersey did not tax when " + "received, such as unemployment compensation or Social Security " + "benefits. OTHER is a category the model does not offset, such as " + "prizes and awards or income from estates and trusts. Defaults to " + "wages, the category of TAM 2011-7's example. A person's entire " + "claim_of_right_repayment takes one category; repayments in multiple " + "categories for the same person in one year cannot be modeled." + ) + definition_period = YEAR + reference = ( + "https://law.justia.com/codes/new-jersey/title-54a/section-54a-5-1/", + # N.J.S.A. 54A:5-2 + "https://lis.njleg.state.nj.us/nxt/gateway.dll/statutes/1/53569/53634", + "https://www.nj.gov/treasury/taxation/pdf/pubs/tams/tam7.pdf", + ) + defined_for = StateCode.NJ diff --git a/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/claim_of_right/nj_claim_of_right_wage_offset.py b/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/claim_of_right/nj_claim_of_right_wage_offset.py new file mode 100644 index 00000000000..6b8920461d0 --- /dev/null +++ b/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/claim_of_right/nj_claim_of_right_wage_offset.py @@ -0,0 +1,31 @@ +from policyengine_us.model_api import * +from policyengine_us.variables.gov.states.nj.tax.income.adjusted_gross_income.claim_of_right.nj_claim_of_right_repayment_category import ( + NJClaimOfRightRepaymentCategory, + nj_claim_of_right_category_offset, +) + + +class nj_claim_of_right_wage_offset(Variable): + value_type = float + entity = Person + label = "New Jersey claim of right offset against wages" + unit = USD + documentation = ( + "The part of nj_claim_of_right_offset that reduces the person's " + "wages (NJ-1040 line 15), which Worksheet D's earned income test " + "reads." + ) + definition_period = YEAR + reference = ( + # N.J.S.A. 54A:5-2 + "https://lis.njleg.state.nj.us/nxt/gateway.dll/statutes/1/53569/53634", + "https://www.nj.gov/treasury/taxation/pdf/pubs/tams/tam7.pdf", + # 2025 NJ-1040 instructions, Worksheet D line 4 + "https://www.nj.gov/treasury/taxation/pdf/current/1040i.pdf#page=23", + ) + defined_for = StateCode.NJ + + def formula(person, period, parameters): + return nj_claim_of_right_category_offset( + person, period, parameters, NJClaimOfRightRepaymentCategory.WAGES + ) diff --git a/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/nj_gross_income.py b/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/nj_gross_income.py index bad7256143f..2432cdb5979 100644 --- a/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/nj_gross_income.py +++ b/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/nj_gross_income.py @@ -10,6 +10,8 @@ class nj_gross_income(Variable): reference = ( "https://law.justia.com/codes/new-jersey/title-54a/section-54a-5-1/", "https://www.nj.gov/treasury/taxation/pdf/current/1040.pdf", + # N.J.S.A. 54A:5-2 + "https://lis.njleg.state.nj.us/nxt/gateway.dll/statutes/1/53569/53634", ) defined_for = StateCode.NJ @@ -24,4 +26,6 @@ def formula(person, period, parameters): total = total + max_(add(person, period, cats.category_d), 0) total = total + max_(add(person, period, cats.category_h), 0) total = total + max_(add(person, period, cats.category_k_p), 0) - return total + # A claim of right repayment offsets income of its own category, + # not below zero (N.J.S.A. 54A:5-2). + return total - person("nj_claim_of_right_offset", period) diff --git a/policyengine_us/variables/gov/states/nj/tax/income/exclusions/nj_eligible_pension_income.py b/policyengine_us/variables/gov/states/nj/tax/income/exclusions/nj_eligible_pension_income.py index d3b1701e2c3..7d3746966d7 100644 --- a/policyengine_us/variables/gov/states/nj/tax/income/exclusions/nj_eligible_pension_income.py +++ b/policyengine_us/variables/gov/states/nj/tax/income/exclusions/nj_eligible_pension_income.py @@ -8,7 +8,7 @@ class nj_eligible_pension_income(Variable): unit = USD definition_period = YEAR reference = ( - "https://www.state.nj.us/treasury/taxation/pdf/current/1040i.pdf#page=21", + "https://www.state.nj.us/treasury/taxation/pdf/current/1040i.pdf#page=22", "https://law.justia.com/codes/new-jersey/2022/title-54a/section-54a-6-10/", ) defined_for = StateCode.NJ @@ -26,4 +26,11 @@ def formula(person, period, parameters): role_eligible = is_head | is_spouse eligible = demographic_eligible & role_eligible - return eligible * add(person, period, p.sources) + # Line A is line 20a, which a claim of right repayment of pension + # income reduces (N.J.S.A. 54A:5-2; TAM 2011-7). + pension_income = max_( + add(person, period, p.sources) + - person("nj_claim_of_right_pension_offset", period), + 0, + ) + return eligible * pension_income diff --git a/policyengine_us/variables/gov/states/nj/tax/income/exclusions/nj_other_retirement_income_exclusion.py b/policyengine_us/variables/gov/states/nj/tax/income/exclusions/nj_other_retirement_income_exclusion.py index 2823b9cf65a..d004f10c7b6 100644 --- a/policyengine_us/variables/gov/states/nj/tax/income/exclusions/nj_other_retirement_income_exclusion.py +++ b/policyengine_us/variables/gov/states/nj/tax/income/exclusions/nj_other_retirement_income_exclusion.py @@ -43,8 +43,12 @@ def formula(tax_unit, period, parameters): unused_exclusion = max_(0, maximum_exclusion - used) # calculate earnings eligibility on the filers' own earnings - # (Worksheet D lines 4-8), leaving out a dependent's - earnings = tax_unit_non_dep_add(tax_unit, period, ["earned_income"]) + # (Worksheet D lines 4-8), leaving out a dependent's. Line 4 is + # NJ-1040 line 15, wages net of any claim of right repayment of + # wages (N.J.S.A. 54A:5-2; TAM 2011-7). + earnings = tax_unit_non_dep_add( + tax_unit, period, ["earned_income"] + ) - tax_unit_non_dep_add(tax_unit, period, ["nj_claim_of_right_wage_offset"]) limit = p.other_retirement_income.earned_income_threshold earnings_eligible = earnings <= limit diff --git a/source_conflicts/candidates.yaml b/source_conflicts/candidates.yaml index 528def1524c..53a70a368c2 100644 --- a/source_conflicts/candidates.yaml +++ b/source_conflicts/candidates.yaml @@ -6965,13 +6965,14 @@ candidates: guidance. pe_us: follows: gap-fill - code: [] + code: + - policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/claim_of_right/nj_claim_of_right_offset.py + - policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/claim_of_right/nj_claim_of_right_repayment_category.py prs: - https://github.com/PolicyEngine/policyengine-us/pull/10198 - state: unreviewed - note: 'Retain as a disputable gap-fill; verify whether repayments are statutory losses and separate this issue - from unsupported spouse attribution. Code not yet on main: policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/claim_of_right/nj_claim_of_right_repayment_category.py, - gov/states/nj/tax/income/adjusted_gross_income/nj_claim_of_right_offset.yaml, nj_claim_of_right_offset, nj_claim_of_right_repayment_category.' + state: ruled + note: Ruled in November 2026 as a gap-fill under TAM 2011-7. Whether repayments count as statutory losses remains + unverified, and the sources leave spouse attribution open. - id: us-nj:eitc-married-separate-filer program: income-tax years: