Skip to content
Closed
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:
fixed:
- Include partnership/S-corp losses in business loss above-the-line deduction.
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
- name: Case 1, S-Corp loss only.
period: 2024
input:
people:
person1:
partnership_s_corp_income: -50_000
tax_units:
tax_unit:
members: [person1]
output:
loss_ald: 50_000

- name: Case 2, S-Corp loss combined with SE loss.
period: 2024
input:
people:
person1:
partnership_s_corp_income: -30_000
self_employment_income: -20_000
tax_units:
tax_unit:
members: [person1]
output:
loss_ald: 50_000

- name: Case 3, losses exceeding section 461(l) cap for single filer.
period: 2024
input:
people:
person1:
partnership_s_corp_income: -200_000
self_employment_income: -200_000
tax_units:
tax_unit:
members: [person1]
filing_status: SINGLE
output:
loss_ald: 305_000

- name: Case 4, positive S-Corp income does not affect loss_ald.
period: 2024
input:
people:
person1:
partnership_s_corp_income: 100_000
tax_units:
tax_unit:
members: [person1]
output:
loss_ald: 0

- name: Case 5, no losses.
period: 2024
input:
people:
person1:
employment_income: 50_000
tax_units:
tax_unit:
members: [person1]
output:
loss_ald: 0

- name: Case 6, joint filing with losses exceeding joint cap.
period: 2024
input:
people:
person1:
partnership_s_corp_income: -400_000
person2:
self_employment_income: -300_000
tax_units:
tax_unit:
members: [person1, person2]
filing_status: JOINT
output:
# Total losses = 400K + 300K = 700K, joint cap = 610K
loss_ald: 610_000

- name: Case 7, mixed positive and negative across people.
period: 2024
input:
people:
person1:
partnership_s_corp_income: 200_000
person2:
partnership_s_corp_income: -100_000
tax_units:
tax_unit:
members: [person1, person2]
filing_status: JOINT
output:
# The positive partnership income is still included in AGI separately,
# so the full 100K loss remains deductible.
loss_ald: 100_000

- name: Case 8, capital loss combined with partnership loss.
period: 2024
input:
people:
person1:
partnership_s_corp_income: -50_000
short_term_capital_gains: -10_000
tax_units:
tax_unit:
members: [person1]
filing_status: SINGLE
output:
# limited_capital_loss = min(3_000, 10_000) = 3_000
# partnership loss = 50_000
# total = 50_000 + 3_000 = 53_000, below cap
loss_ald: 53_000

- name: Case 9, business gains expand the allowed section 461(l) deduction.
period: 2024
input:
people:
person1:
partnership_s_corp_income: 400_000
person2:
partnership_s_corp_income: -1_100_000
tax_units:
tax_unit:
members: [person1, person2]
filing_status: JOINT
output:
# Net business loss is 700K, so the 610K joint threshold still allows
# 400K of gain plus 610K of loss deductions in AGI.
loss_ald: 1_010_000

- name: Case 10, capital losses sit outside the section 461(l) cap.
period: 2024
input:
people:
person1:
partnership_s_corp_income: -1_100_000
short_term_capital_gains: -10_000
person2:
partnership_s_corp_income: 400_000
tax_units:
tax_unit:
members: [person1, person2]
filing_status: JOINT
output:
# 1,010,000 of business loss is deductible under section 461(l), plus
# the separate 3,000 capital-loss deduction.
loss_ald: 1_013_000
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@
state_code: DC
output:
# limited_capital_loss = min(3_000, 5_000) = 3_000
# loss_ald = min(305_000, 25_000_000 + 3_000) = 305_000
# SE portion of loss_ald: 305_000 - 3_000 = 302_000
# DC addition: max(0, 302_000 - 12_000) = 290_000
dc_self_employment_loss_addition: 290_000
# loss_ald = 305_000 of allowed business loss + 3_000 of capital loss
# SE portion of loss_ald: 308_000 - 3_000 = 305_000
# DC addition: max(0, 305_000 - 12_000) = 293_000
dc_self_employment_loss_addition: 293_000

- name: Case 7, SE loss exactly at DC threshold.
absolute_error_margin: 0.01
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,7 @@
members: [person1, person2]
state_fips: 54
output:
adjusted_gross_income: -3_000
# Partnership/S-corp losses are capped at the 610K joint section 461(l)
# threshold, with the separate 3K capital-loss deduction still allowed.
adjusted_gross_income: -613_000
wv_homestead_excess_property_tax_credit: 0
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,29 @@ class loss_ald(Variable):
entity = TaxUnit
label = "Business loss ALD"
unit = USD
documentation = (
"Above-the-line deduction from gross income for business losses."
)
documentation = "Above-the-line deduction from gross income for business losses."
definition_period = YEAR
reference = "https://www.law.cornell.edu/uscode/text/26/165"
reference = (
"https://www.law.cornell.edu/uscode/text/26/461#l",
"https://www.law.cornell.edu/uscode/text/26/461#l_4",
)

def formula(tax_unit, period, parameters):
filing_status = tax_unit("filing_status", period)
max_loss = parameters(period).gov.irs.ald.loss.max[filing_status]
person = tax_unit.members
indiv_se_loss = max_(0, -person("self_employment_income", period))
self_employment_loss = tax_unit.sum(indiv_se_loss)
indiv_se_gain = max_(0, person("self_employment_income", period))
self_employment_gain = tax_unit.sum(indiv_se_gain)
indiv_ps_loss = max_(0, -person("partnership_s_corp_income", period))
partnership_s_corp_loss = tax_unit.sum(indiv_ps_loss)
indiv_ps_gain = max_(0, person("partnership_s_corp_income", period))
partnership_s_corp_gain = tax_unit.sum(indiv_ps_gain)
business_loss = self_employment_loss + partnership_s_corp_loss
business_gain = self_employment_gain + partnership_s_corp_gain
allowed_business_loss = min_(business_loss, business_gain + max_loss)
limited_capital_loss = tax_unit("limited_capital_loss", period)
return min_(max_loss, self_employment_loss + limited_capital_loss)
# Capital losses are deductible in AGI, but excluded from the
# section 461(l) excess business loss limitation.
return allowed_business_loss + limited_capital_loss
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@ def formula(person, period, parameters):
loss_person = max_(0, -person("self_employment_income", period))
loss_taxunit = person.tax_unit.sum(loss_person)
# Cap at SE loss actually deducted in federal AGI via loss_ald.
# loss_ald includes both SE and capital losses; isolate SE portion.
# loss_ald includes SE, partnership/S-corp, and capital losses;
# isolate SE portion.
loss_ald = person.tax_unit("loss_ald", period)
limited_capital_loss = person.tax_unit("limited_capital_loss", period)
se_loss_in_ald = max_(0, loss_ald - limited_capital_loss)
ps_loss = max_(0, -person("partnership_s_corp_income", period))
ps_loss_taxunit = person.tax_unit.sum(ps_loss)
se_loss_in_ald = max_(
0, loss_ald - limited_capital_loss - ps_loss_taxunit
)
effective_loss = min_(loss_taxunit, se_loss_in_ald)
p = parameters(period).gov.states.dc.tax.income.additions
addition_taxunit = max_(
Expand Down