Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mzx-4real committed Nov 4, 2023
1 parent 5b2cc16 commit 486d461
Showing 1 changed file with 69 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,52 +10,54 @@ class basic_standard_deduction(Variable):
documentation = "The Basic standard deduction under the tax foundation growth and opportunity plan"
definition_period = YEAR

def formula(tax_unit, period, parameters):
std = parameters(period).gov.irs.deductions.standard
filing_status = tax_unit("filing_status", period)
statuses = filing_status.possible_values
separate_filer_itemizes = tax_unit("separate_filer_itemizes", period)
claimed_as_dependent_elsewhere = tax_unit(
"tax_unit_dependent_elsewhere", period
)
standard_deduction = select(
[
filing_status == statuses.SINGLE,
filing_status == statuses.SEPARATE,
filing_status == statuses.JOINT,
filing_status == statuses.WIDOW,
filing_status == statuses.HEAD_OF_HOUSEHOLD,
],
[
std.amount[filing_status],
std.amount[filing_status],
std.amount[filing_status],
std.amount[filing_status],
13850, # this should be single amount, use fix amount as temp
],
)
def formula(tax_unit, period, parameters):
std = parameters(period).gov.irs.deductions.standard
filing_status = tax_unit("filing_status", period)
statuses = filing_status.possible_values
separate_filer_itemizes = tax_unit(
"separate_filer_itemizes", period
)
claimed_as_dependent_elsewhere = tax_unit(
"tax_unit_dependent_elsewhere", period
)
standard_deduction = select(
[
filing_status == statuses.SINGLE,
filing_status == statuses.SEPARATE,
filing_status == statuses.JOINT,
filing_status == statuses.WIDOW,
filing_status == statuses.HEAD_OF_HOUSEHOLD,
],
[
std.amount[filing_status],
std.amount[filing_status],
std.amount[filing_status],
std.amount[filing_status],
13850, # this should be single amount, use fix amount as temp
],
)

standard_deduction_if_dependent = min_(
standard_deduction,
max_(
std.dependent.additional_earned_income
+ tax_unit("tax_unit_earned_income", period),
std.dependent.amount,
),
)
return standard_deduction
# return select(
# [
# separate_filer_itemizes,
# claimed_as_dependent_elsewhere,
# True,
# ],
# [
# 0,
# standard_deduction_if_dependent,
# standard_deduction,
# ],
# )
standard_deduction_if_dependent = min_(
standard_deduction,
max_(
std.dependent.additional_earned_income
+ tax_unit("tax_unit_earned_income", period),
std.dependent.amount,
),
)

return select(
[
separate_filer_itemizes,
claimed_as_dependent_elsewhere,
True,
],
[
0,
standard_deduction_if_dependent,
standard_deduction,
],
)

class additional_standard_deduction(Variable):
value_type = float
Expand All @@ -65,28 +67,28 @@ class additional_standard_deduction(Variable):
documentation = "The additional standard deduction under the tax foundation growth and opportunity plan"
definition_period = YEAR

def formula(tax_unit, period, parameters):
std = parameters(period).gov.irs.deductions.standard
filing_status = tax_unit("filing_status", period)
statuses = filing_status.possible_values
aged_blind_count = tax_unit("aged_blind_count", period)
additional_standard_deduction_per_count = select(
[
filing_status == statuses.SINGLE,
filing_status == statuses.SEPARATE,
filing_status == statuses.JOINT,
filing_status == statuses.WIDOW,
filing_status == statuses.HEAD_OF_HOUSEHOLD,
],
[
std.aged_or_blind.amount[filing_status],
std.aged_or_blind.amount[filing_status],
std.aged_or_blind.amount[filing_status],
std.aged_or_blind.amount[filing_status],
1850, # this should be single amount, use fix amount as temp
],
)
return aged_blind_count * additional_standard_deduction_per_count
def formula(tax_unit, period, parameters):
std = parameters(period).gov.irs.deductions.standard
filing_status = tax_unit("filing_status", period)
statuses = filing_status.possible_values
aged_blind_count = tax_unit("aged_blind_count", period)
additional_standard_deduction_per_count = select(
[
filing_status == statuses.SINGLE,
filing_status == statuses.SEPARATE,
filing_status == statuses.JOINT,
filing_status == statuses.WIDOW,
filing_status == statuses.HEAD_OF_HOUSEHOLD,
],
[
std.aged_or_blind.amount[filing_status],
std.aged_or_blind.amount[filing_status],
std.aged_or_blind.amount[filing_status],
std.aged_or_blind.amount[filing_status],
1850, # this should be single amount, use fix amount as temp
],
)
return aged_blind_count * additional_standard_deduction_per_count

class reform(Reform):
def apply(self):
Expand Down

0 comments on commit 486d461

Please sign in to comment.