Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: patch
changes:
added:
- Refactor social security taxes for refundable CTC calculation.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
description: The IRS defines social security taxes under the Child Tax Credit to include the following variables.
values:
2018-01-01:
# Person:
- employee_social_security_tax
- employee_medicare_tax
- unreported_payroll_tax
# Tax Unit:
- self_employment_tax_ald
- additional_medicare_tax
metadata:
unit: program
label: Variables added for Social Security taxes in Child Tax Credit calculation
reference:
- title: 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,10 @@
description: The IRS defines social security taxes under the Child Tax Credit to exclude the following variables.
values:
2018-01-01:
- excess_payroll_tax_withheld
metadata:
unit: program
label: Variables subtracted for Social Security taxes in Child Tax Credit calculation
reference:
- title: 26 U.S. Code § 24(d)(2)(B)
href: https://www.law.cornell.edu/uscode/text/26/24#d_2_B
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
- name: No inputs
period: 2018
input:
# SS_ADD_VARIABLES
employee_social_security_tax: 0
employee_medicare_tax: 0
unreported_payroll_tax: 0
self_employment_tax_ald: 0
additional_medicare_tax: 0
# SS_SUBTRACT_VARIABLES
excess_payroll_tax_withheld: 0
output:
ctc_social_security_tax: 0

- name: Social security taxes included variables more than excluded variables
period: 2018
input:
# SS_ADD_VARIABLES
employee_social_security_tax: 100
employee_medicare_tax: 100
unreported_payroll_tax: 0
self_employment_tax_ald: 50
additional_medicare_tax: 25
# SS_SUBTRACT_VARIABLES
excess_payroll_tax_withheld: 200
output:
ctc_social_security_tax: 75

- name: Social security taxes included variables less than excluded variables
period: 2018
input:
# SS_ADD_VARIABLES
employee_social_security_tax: 100
employee_medicare_tax: 100
unreported_payroll_tax: 0
self_employment_tax_ald: 50
additional_medicare_tax: 25
# SS_SUBTRACT_VARIABLES
excess_payroll_tax_withheld: 450
output:
ctc_social_security_tax: -175
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@
co_federal_ctc_maximum: 0
co_ctc_eligible_children_count: 0
tax_unit_earned_income: 0
# SS_ADD_VARIABLES
employee_social_security_tax: 0
employee_medicare_tax: 0
unreported_payroll_tax: 0
self_employment_tax_ald: 0
additional_medicare_tax: 0
# SS_SUBTRACT_VARIABLES
excess_payroll_tax_withheld: 0
ctc_social_security_tax: 0
eitc: 0
output:
co_refundable_ctc: 0
Expand All @@ -26,14 +19,7 @@
co_federal_ctc_maximum: 2_000
co_ctc_eligible_children_count: 3
tax_unit_earned_income: 0
# SS_ADD_VARIABLES
employee_social_security_tax: 0
employee_medicare_tax: 0
unreported_payroll_tax: 0
self_employment_tax_ald: 0
additional_medicare_tax: 0
# SS_SUBTRACT_VARIABLES
excess_payroll_tax_withheld: 0
ctc_social_security_tax: 0
eitc: 0
output:
co_refundable_ctc: 0
Expand All @@ -46,14 +32,7 @@
co_federal_ctc_maximum: 2_000
co_ctc_eligible_children_count: 1
tax_unit_earned_income: 100_000
# SS_ADD_VARIABLES
employee_social_security_tax: 0
employee_medicare_tax: 0
unreported_payroll_tax: 0
self_employment_tax_ald: 0
additional_medicare_tax: 0
# SS_SUBTRACT_VARIABLES
excess_payroll_tax_withheld: 0
ctc_social_security_tax: 0
eitc: 0
output:
co_refundable_ctc: 1_500
Expand All @@ -66,14 +45,7 @@
co_federal_ctc_maximum: 2_000
co_ctc_eligible_children_count: 2
tax_unit_earned_income: 100_000
# SS_ADD_VARIABLES
employee_social_security_tax: 0
employee_medicare_tax: 0
unreported_payroll_tax: 0
self_employment_tax_ald: 0
additional_medicare_tax: 0
# SS_SUBTRACT_VARIABLES
excess_payroll_tax_withheld: 0
ctc_social_security_tax: 0
eitc: 0
output:
co_refundable_ctc: 3_000
Expand All @@ -86,14 +58,7 @@
co_federal_ctc_maximum: 2_000
co_ctc_eligible_children_count: 2
tax_unit_earned_income: 100_000
# SS_ADD_VARIABLES
employee_social_security_tax: 0
employee_medicare_tax: 0
unreported_payroll_tax: 0
self_employment_tax_ald: 0
additional_medicare_tax: 0
# SS_SUBTRACT_VARIABLES
excess_payroll_tax_withheld: 0
ctc_social_security_tax: 0
eitc: 0
output:
co_refundable_ctc: 2_000
Expand All @@ -106,14 +71,7 @@
co_federal_ctc_maximum: 2_000
co_ctc_eligible_children_count: 1
tax_unit_earned_income: 10_000
# SS_ADD_VARIABLES
employee_social_security_tax: 0
employee_medicare_tax: 0
unreported_payroll_tax: 0
self_employment_tax_ald: 0
additional_medicare_tax: 0
# SS_SUBTRACT_VARIABLES
excess_payroll_tax_withheld: 0
ctc_social_security_tax: 0
eitc: 0
output:
co_refundable_ctc: 1_125
Expand All @@ -126,14 +84,7 @@
co_federal_ctc_maximum: 2_000
co_ctc_eligible_children_count: 3
tax_unit_earned_income: 100_000
# SS_ADD_VARIABLES
employee_social_security_tax: 1_000
employee_medicare_tax: 2_000
unreported_payroll_tax: 0
self_employment_tax_ald: 0
additional_medicare_tax: 0
# SS_SUBTRACT_VARIABLES
excess_payroll_tax_withheld: 500
ctc_social_security_tax: 2_500
eitc: 0
output:
co_refundable_ctc: 4_500
Expand All @@ -146,14 +97,7 @@
co_federal_ctc_maximum: 2_000
co_ctc_eligible_children_count: 3
tax_unit_earned_income: 100_000
# SS_ADD_VARIABLES
employee_social_security_tax: 1_000
employee_medicare_tax: 2_000
unreported_payroll_tax: 0
self_employment_tax_ald: 0
additional_medicare_tax: 0
# SS_SUBTRACT_VARIABLES
excess_payroll_tax_withheld: 500
ctc_social_security_tax: 2_500
eitc: 0
output:
co_refundable_ctc: 2_000
Expand All @@ -166,14 +110,7 @@
co_federal_ctc_maximum: 2_000
co_ctc_eligible_children_count: 3
tax_unit_earned_income: 10_000
# SS_ADD_VARIABLES
employee_social_security_tax: 0
employee_medicare_tax: 0
unreported_payroll_tax: 1_000
self_employment_tax_ald: 0
additional_medicare_tax: 3_000
# SS_SUBTRACT_VARIABLES
excess_payroll_tax_withheld: 500
ctc_social_security_tax: 3_500
eitc: 0
output:
co_refundable_ctc: 3_500
Expand All @@ -186,14 +123,7 @@
co_federal_ctc_maximum: 2_000
co_ctc_eligible_children_count: 7
tax_unit_earned_income: 8_000
# SS_ADD_VARIABLES
employee_social_security_tax: 1_000
employee_medicare_tax: 10_000
unreported_payroll_tax: 0
self_employment_tax_ald: 0
additional_medicare_tax: 0
# SS_SUBTRACT_VARIABLES
excess_payroll_tax_withheld: 500
ctc_social_security_tax: 10_500
eitc: 1_000
output:
co_refundable_ctc: 9_500
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from policyengine_us.model_api import *


class ctc_social_security_tax(Variable):
value_type = float
entity = TaxUnit
label = "Refundable Child Tax Credit Social Security Tax"
unit = USD
documentation = (
"Social Security taxes considered in the Child Tax Credit calculation"
)
definition_period = YEAR
reference = "https://www.law.cornell.edu/uscode/text/26/24#d_2"

adds = "gov.irs.credits.ctc.refundable.ss.add"
subtracts = "gov.irs.credits.ctc.refundable.ss.subtract"
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,7 @@ def formula(tax_unit, period, parameters):
relevant_earnings = (
earnings_over_threshold * ctc.refundable.phase_in.rate
)

# Compute "Social Security taxes" as defined in the US Code for the ACTC.
# This includes OASDI and Medicare payroll taxes, as well as half
# of self-employment taxes.
SS_ADD_VARIABLES = [
# Person:
"employee_social_security_tax",
"employee_medicare_tax",
"unreported_payroll_tax",
# Tax unit:
"self_employment_tax_ald",
"additional_medicare_tax",
]
SS_SUBTRACT_VARIABLES = ["excess_payroll_tax_withheld"]
social_security_tax = add(tax_unit, period, SS_ADD_VARIABLES) - add(
tax_unit, period, SS_SUBTRACT_VARIABLES
)
social_security_tax = tax_unit("ctc_social_security_tax", period)
eitc = tax_unit("eitc", period)
social_security_excess = max_(0, social_security_tax - eitc)
qualifying_children = tax_unit("ctc_qualifying_children", period)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,8 @@ def formula(tax_unit, period, parameters):
relevant_earnings = (
earnings_over_threshold * p.refundable.phase_in.rate
) # Line 13
SS_ADD_VARIABLES = [
# Person:
"employee_social_security_tax",
"employee_medicare_tax",
"unreported_payroll_tax",
# Tax unit:
"self_employment_tax_ald",
"additional_medicare_tax",
]
SS_SUBTRACT_VARIABLES = ["excess_payroll_tax_withheld"]
social_security_tax = add(tax_unit, period, SS_ADD_VARIABLES) - add(
tax_unit, period, SS_SUBTRACT_VARIABLES
social_security_tax = tax_unit(
"ctc_social_security_tax", period
) # Line 14 - 16
federal_eitc = tax_unit("eitc", period) # Line 17a
social_security_excess = max_(
Expand Down