Skip to content

Puerto Rico CTC #5707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 15 commits into from
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: minor
changes:
added:
- Puerto Rico implementation of CTC and ACTC
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
description: Puerto Rico allows this amount of credit per child for the ACTC.
values:
2023-01-01: 1_700
metadata:
unit: currency-USD
period: year
label: Puerto Rico ACTC amount
reference:
- title: 2024 Form 1040-SS
href: https://www.irs.gov/pub/irs-pdf/f1040ss.pdf#page=2
- title: U.S.C 26 U.S. Code § 24(k)(2)
href: https://www.law.cornell.edu/uscode/text/26/24#k_2

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: Puerto Rico takes this fraction of self-employment taxes in the ACTC calculation.
values:
2023-01-01: 0.5
metadata:
unit: float
period: year
label: Puerto Rico ACTC fraction for self-employment tax
reference:
- title: 2024 Form 1040-SS
href: https://www.irs.gov/pub/irs-pdf/f1040ss.pdf#page=2
- title: U.S.C 26 U.S. Code § 24(d)(2)(A)
href: https://www.law.cornell.edu/uscode/text/26/24#d_2_A
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: Puerto Rico phases out the ACTC to joint filers with income above the limit.
values:
2023-01-01: 400_000
metadata:
unit: currency-USD
period: year
label: Puerto Rico ACTC income limit joint
reference:
- title: 2024 Form 1040-SS
href: https://www.irs.gov/pub/irs-pdf/f1040ss.pdf#page=2
- title: U.S.C 26 U.S. Code § 24(b)(2)
href: https://www.law.cornell.edu/uscode/text/26/24#b_2
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
description: Puerto Rico phases out the ACTC to all filers other than joint with income above the limit.
values:
2023-01-01: 200_000
metadata:
unit: currency-USD
period: year
label: Puerto Rico ACTC income limit all other filing statuses
reference:
- title: 2024 Form 1040-SS
href: https://www.irs.gov/pub/irs-pdf/f1040ss.pdf#page=2
- title: U.S.C 26 U.S. Code § 24(b)(2)
href: https://www.law.cornell.edu/uscode/text/26/24#b_2

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: Puerto Rico computes a fraction of the income by rounding income to a multiple of this number.
values:
2023-01-01: 1_000
metadata:
unit: currency-USD
period: year
label: Puerto Rico ACTC income multiple
reference:
- title: 2024 Form 1040-SS
href: https://www.irs.gov/pub/irs-pdf/f1040ss.pdf#page=2
- title: U.S.C 26 U.S. Code § 24(k)(2)
href: https://www.law.cornell.edu/uscode/text/26/24#k_2
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: Puerto Rico computes a fraction of income by multiplying income by this rate.
values:
2023-01-01: 0.05
metadata:
unit: /1
period: year
label: Puerto Rico ACTC income rate
reference:
- title: 2024 Form 1040-SS
href: https://www.irs.gov/pub/irs-pdf/f1040ss.pdf#page=2
- title: U.S.C 26 U.S. Code § 24(k)(2)
href: https://www.law.cornell.edu/uscode/text/26/24#k_2
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
- name: integration test 1, a single parent with 2 dependents
period: 2024
input:
people:
person1:
age: 40
is_tax_unit_head_or_spouse: true
self_employment_tax: 100
person2:
age: 16
is_tax_unit_spouse: false
person3:
age: 5
is_tax_unit_spouse: false
tax_units:
tax_unit:
members: [person1, person2, person3]
filing_status: SINGLE
pr_modified_agi: 10_000
households:
household:
members: [person1, person2, person3]
state_code: PR
output:
pr_actc_eligibility: true
pr_actc_modified_income_excess_applies: false
pr_actc_modified_income_fraction: 0
pr_actc_sum_taxes_paid: 50
pr_actc: 50
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
- name: Modified AGI higher than threshold, earned income calculation lower
period: 2024
input:
ctc_qualifying_children: 2
pr_actc_modified_income_fraction: 200
pr_ctc: 3_000
pr_actc_sum_taxes_paid: 3_000
pr_additional_medicare_tax_withheld: 100
pr_excess_social_security_withheld: 100
output:
pr_actc: 2_800

- name: Modified AGI lower than threshold, earned income calculation lower
period: 2024
input:
ctc_qualifying_children: 1
pr_actc_modified_income_fraction: 0
pr_ctc: 2_000
pr_actc_sum_taxes_paid: 3_000
pr_additional_medicare_tax_withheld: 100
pr_excess_social_security_withheld: 100
output:
pr_actc: 1_700

- name: Modified AGI lower than threshold, ss medicare calculation lower
period: 2024
input:
ctc_qualifying_children: 4
pr_actc_modified_income_fraction: 0
pr_ctc: 8_500
pr_actc_sum_taxes_paid: 1_000
pr_additional_medicare_tax_withheld: 100
pr_excess_social_security_withheld: 100
output:
pr_actc: 800
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
- name: No children, not eligible
period: 2024
input:
ctc_qualifying_children: 0
pr_ctc: 1_000
pr_actc_modified_income_fraction: 900
pr_excess_social_security_withheld: 100
pr_actc_sum_taxes_paid: 200
output:
pr_actc_eligibility: false

- name: Modified income greater than CTC amount, not eligible
period: 2024
input:
ctc_qualifying_children: 2
pr_ctc: 4_500
pr_actc_modified_income_fraction: 4_500
pr_excess_social_security_withheld: 100
pr_actc_sum_taxes_paid: 200
output:
pr_actc_eligibility: false

- name: Excess social security greater than taxes paid
input:
ctc_qualifying_children: 2
pr_ctc: 4_500
pr_actc_modified_income_fraction: 3_000
pr_excess_social_security_withheld: 200
pr_actc_sum_taxes_paid: 100
output:
pr_actc_eligibility: false

- name: Eligible for ACTC
input:
ctc_qualifying_children: 2
pr_ctc: 4_500
pr_actc_modified_income_fraction: 3_000
pr_excess_social_security_withheld: 100
pr_actc_sum_taxes_paid: 200
output:
pr_actc_eligibility: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- name: Income over threshold, joint
period: 2024
input:
pr_modified_agi: 401_000
filing_status: JOINT
output:
pr_actc_modified_income_excess_applies: true

- name: Income below threshold, single
period: 2024
input:
pr_modified_agi: 200_000
filing_status: SINGLE
output:
pr_actc_modified_income_excess_applies: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
- name: Income under threshold, joint
period: 2024
input:
pr_modified_agi: 10_000
filing_status: JOINT
output:
pr_actc_modified_income_fraction: 0

- name: Income over threshold, married filing separately
period: 2024
input:
pr_modified_agi: 253_020
filing_status: SEPARATE
output:
pr_actc_modified_income_fraction: 2700

- name: Income over threshold, single
period: 2024
input:
pr_modified_agi: 201_000
filing_status: SINGLE
output:
pr_actc_modified_income_fraction: 50
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- name: Basic test
period: 2024
input:
self_employment_tax: 36
additional_medicare_tax: 100
pr_federal_taxes: 500
output:
pr_actc_sum_taxes_paid: 568
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- name: Max minus reduction is negative
period: 2024
input:
ctc_maximum_with_arpa_addition: 100
pr_ctc_phase_out: 200
output:
pr_ctc: 0

- name: Max minus reduction is positive
period: 2024
input:
ctc_maximum_with_arpa_addition: 200
pr_ctc_phase_out: 100
output:
pr_ctc: 100
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- name: Income over threshold, joint
period: 2024
input:
adjusted_gross_income: 150_000
pr_gross_income: 7_000
ctc_phase_out_threshold: 150_000
output:
pr_ctc_phase_out: 350

- name: Income under threshold, single
period: 2024
input:
adjusted_gross_income: 74_000
pr_gross_income: 1_000
ctc_phase_out_threshold: 75_000
output:
pr_ctc_phase_out: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
from policyengine_us.model_api import *


class pr_actc(Variable):
value_type = float
entity = TaxUnit
label = "Puerto Rico ACTC amount"
definition_period = YEAR
reference = "https://www.irs.gov/pub/irs-pdf/f1040ss.pdf#page=2"
defined_for = "pr_actc_eligibility"

def formula(tax_unit, period, parameters):
p = parameters(period).gov.territories.pr.tax.income.credits.actc
num_children = tax_unit("ctc_qualifying_children", period)

# line 2
base_actc_amount = num_children * p.amount
# line 6
inc_fraction = tax_unit("pr_actc_modified_income_fraction", period)
# CTC + ODC amount, line 9
ctc_amount = tax_unit("pr_ctc", period)

# earned income method to calculate credit amount
# if modified agi > threshold -> minimum of the two amounts, lines 10 and 11 (credit_amt_alt)
# if modified agi < threshold -> original credit amount, line 5 (credit_amt)
credit_amt_alt = min(base_actc_amount, ctc_amount - inc_fraction)
earned_inc_credit_amt = select(
[
inc_fraction == 0,
inc_fraction != 0,
],
[
base_actc_amount,
credit_amt_alt,
],
)

# another calculation of the credit through taxes
# lines 12a-14
taxes_paid = tax_unit("pr_actc_sum_taxes_paid", period)
# like a credit
taxes_paid = taxes_paid - tax_unit(
"pr_additional_medicare_tax_withheld", period
)

# line 15
excess_ss_tax = tax_unit("pr_excess_social_security_withheld", period)

# line 18
ss_medicare_credit_amt = taxes_paid - excess_ss_tax

# line 19
return min_(earned_inc_credit_amt, ss_medicare_credit_amt)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from policyengine_us.model_api import *


class pr_actc_eligibility(Variable):
value_type = bool
entity = TaxUnit
label = "Puerto Rico ACTC eligiblity"
definition_period = YEAR
reference = "https://www.irs.gov/pub/irs-pdf/f1040ss.pdf#page=2"

def formula(tax_unit, period, parameters):
num_children = tax_unit("ctc_qualifying_children", period)
ctc_amount = tax_unit("pr_ctc", period)
excess_ss_tax = tax_unit("pr_excess_social_security_withheld", period)
taxes_paid = tax_unit("pr_actc_sum_taxes_paid", period)

# eligibility: at least one child under age of 17, line 1
num_children_eligible = num_children >= 1
# must not have too high of an income, line 10
# if modified agi < threshold, modified income calculation = 0, then this will be true
income_eligible = (
tax_unit("pr_actc_modified_income_fraction", period) < ctc_amount
)
# taxes paid must be greater than excess social security tax withheld, line 18
taxes_paid_eligible = taxes_paid > excess_ss_tax

return num_children_eligible & income_eligible & taxes_paid_eligible
Loading