forked from PolicyEngine/policyengine-us
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes PolicyEngine#5109 Co-authored-by: Pinyan <[email protected]>
- Loading branch information
Showing
4 changed files
with
61 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# line 1-4 |
30 changes: 25 additions & 5 deletions
30
policyengine_us/variables/gov/bankruptcy/deductions/additional_expense_deductions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
14 changes: 12 additions & 2 deletions
14
policyengine_us/variables/gov/bankruptcy/deductions/debt_payment_deductions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
28 changes: 23 additions & 5 deletions
28
policyengine_us/variables/gov/bankruptcy/deductions/other_necessary_expenses_deductions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |