Skip to content

Commit

Permalink
Chapter 7 bankruptcy means test
Browse files Browse the repository at this point in the history
Fixes PolicyEngine#5109

Co-authored-by: Pinyan <[email protected]>
  • Loading branch information
hua7450 and pxu12 authored Nov 19, 2024
1 parent f17b3a8 commit 497b3ad
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# line 1-4
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
#Line 25 ok
#Line 26 not sure
#Line 27,28,29,30 skip?
#Line 31 not sure
#Line 32 sum
from policyengine_us.model_api import *


class additonal_expenses_deductions(Variable):
value_type = bool
entity = SPMUnit
label = "Additional expenses deductions"
definition_period = MONTH
reference = "https://www.cacb.uscourts.gov/sites/cacb/files/documents/forms/122A2.pdf#page=6"
defined_for = StateCode.CA

def formula(spm_unit, period, parameters):
health_insurance_expense = add(spm_unit, period,["health_insurance_premiums"])
health_savings_account_expense = add(spm_unit, period,["health_savings_account_payroll_contributions"])
# disability_insurance ??
care_expense = add(spm_unit, period, ["care_expeses"])
home_energy_costs = spm_unit.household("current_home_energy_use", period)
education_expense = add(spm_unit, period, ["k12_tuition_and_fees"]) ## no more than $189.58
charitable_contributions = add(
spm_unit,
period,
["charitable_cash_donations", "charitable_non_cash_donations"],
)
total = health_insurance_expense + health_savings_account_expense + care_expense + home_energy_costs + education_expense + charitable_contributions
return total/MONTHS_IN_YEAR
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
# Line 33,34,35,36 ???
# Line 37 sum
from policyengine_us.model_api import *


class debt_payment_deductions(Variable):
value_type = bool
entity = SPMUnit
label = "Debt payment deduction"
definition_period = MONTH
reference = "https://www.cacb.uscourts.gov/sites/cacb/files/documents/forms/122A2.pdf#page=7"
defined_for = StateCode.CA

def formula(spm_unit, period, parameters):
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
#Line 16 ok
#Line 17, 18, 19 skip??
#Line 20,21,22 ok
#Line 23 skip?
#Line 24 sum
from policyengine_us.model_api import *


class other_necessary_expenses_deductions(Variable):
value_type = bool
entity = SPMUnit
label = "Other necessary expenses deduction"
definition_period = MONTH
reference = "https://www.cacb.uscourts.gov/sites/cacb/files/documents/forms/122A2.pdf#page=5"
defined_for = StateCode.CA

def formula(spm_unit, period, parameters):
taxes = add(spm_unit, period, ["income_tax"])
## retirement_contribution
child_support_expense = add(spm_unit, period, ["child_support_expense"])
childcare_expenses = spm_unit("childcare_expenses", period)
## ???
line_7 = spm_unit("line_7",period)
out_of_pocket_healthcare_expense = add(spm_unit, period,["medical_out_of_pocket_expenses"])
line_22 = out_of_pocket_healthcare_expense - line_7
##
total = taxes + child_support_expense + childcare_expenses + line_22
return total/MONTHS_IN_YEAR

0 comments on commit 497b3ad

Please sign in to comment.