From 52a9c2f497cc6e2dcff82c776e9dce8f6f9ef8e8 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Mon, 5 Aug 2024 13:18:23 -0700 Subject: [PATCH 1/3] Vendor PDF Province fix --- src/api/routes/admin/student-router.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/api/routes/admin/student-router.ts b/src/api/routes/admin/student-router.ts index e5873a67..d5938bc3 100644 --- a/src/api/routes/admin/student-router.ts +++ b/src/api/routes/admin/student-router.ts @@ -1118,8 +1118,7 @@ studentRouter.get( const update = await db("sfa.vendor_update") .where({ "vendor_update.id": id, student_id }) .leftOuterJoin("sfa.city", "city.id", "vendor_update.city_id") - .leftOuterJoin("sfa.province", "province.id", "vendor_update.city_id") - + .leftOuterJoin("sfa.province", "province.id", "vendor_update.province_id") .select("vendor_update.*", "city.description as city", "province.description as province") .first(); const student = await db("sfa.student") From ccfe0e5734ebede10f3bb03b469968eb5cdd26df Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Mon, 5 Aug 2024 14:56:55 -0700 Subject: [PATCH 2/3] Removing comments and default 0 for childcare & allowance --- .../assessment-cslft-repository-v2.ts | 33 +++++-------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/src/api/repositories/assessment/assessment-cslft-repository-v2.ts b/src/api/repositories/assessment/assessment-cslft-repository-v2.ts index 1e74a101..9c6b9be8 100644 --- a/src/api/repositories/assessment/assessment-cslft-repository-v2.ts +++ b/src/api/repositories/assessment/assessment-cslft-repository-v2.ts @@ -617,6 +617,14 @@ export class AssessmentCslftRepositoryV2 { student_category_id: this.application.category_id, }) .first(); + console.log("Using empty childcareCeiling"); + this.childcareCeiling = { max_amount: 0 }; + } + + if (!this.livingAllowance) { + console.log("Using empty livingAllowance"); + this.livingAllowance = { shelter_amount: 0, food_amount: 0, misc_amount: 0, public_tranport_amount: 0 }; + } } async calculateBase(): Promise { @@ -730,22 +738,7 @@ export class AssessmentCslftRepositoryV2 { assess.shelter_month = this.livingAllowance.shelter_amount + this.livingAllowance.food_amount + this.livingAllowance.misc_amount; - /* costsCapped.push({ - name: "shelter", - allowable: cleanDollars( - this.livingAllowance.shelter_amount + this.livingAllowance.food_amount + this.livingAllowance.misc_amount - ), - actual: 0, - total: assess.shelter_total, - }); */ - assess.p_trans_month = this.application.study_bus ? this.livingAllowance.public_tranport_amount : 0; - /* costsCapped.push({ - name: "publicTrans", - allowable: cleanDollars(this.application.study_bus ? this.livingAllowance.public_tranport_amount : 0), - actual: 0, - total: assess.p_trans_total, - }); */ let extTransTot = 0; @@ -791,16 +784,6 @@ export class AssessmentCslftRepositoryV2 { depPTrans = assess.dependent_count * (this.application.study_bus ? this.dependentAllowance.public_tranport_amount : 0); - - /* this.assessment.depend_food_allowable = - ( - this.livingAllowance.shel - - await this.studentLivingAllowanceRepo.getShelterFoodMisc( - this.application.academic_year_id, - study_prov, - studyCodes.DEP - )) * assess.dependent_count; */ } assess.day_care_allowable = dayCareAllowable; From 8c77702fb7b54e7496d837609d3b2438c4bf9642 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Mon, 5 Aug 2024 15:43:03 -0700 Subject: [PATCH 3/3] Showing uncapped expense list in UI --- .../assessment/assessment-cslft-repository-v2.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/api/repositories/assessment/assessment-cslft-repository-v2.ts b/src/api/repositories/assessment/assessment-cslft-repository-v2.ts index 9c6b9be8..6ea4f8b2 100644 --- a/src/api/repositories/assessment/assessment-cslft-repository-v2.ts +++ b/src/api/repositories/assessment/assessment-cslft-repository-v2.ts @@ -210,6 +210,8 @@ export class AssessmentCslftRepositoryV2 { return { category: u.categoryName, description: u.description, amount: u.amount }; }); + input.uncapped_expenses = uncapped_expenses; + input.total_costs = input.cslft_scholastic_total + input.shelter_total + @@ -617,6 +619,8 @@ export class AssessmentCslftRepositoryV2 { student_category_id: this.application.category_id, }) .first(); + + if (!this.childcareCeiling) { console.log("Using empty childcareCeiling"); this.childcareCeiling = { max_amount: 0 }; } @@ -1402,7 +1406,7 @@ interface CSLFTAssessmentFull extends CSLFTAssessmentBase { depend_food_total: number; depend_tran_total: number; discretionary_cost_total: number; - uncapped_expenses: number; + uncapped_expenses: any[]; total_costs: number; parent_msol: number; parent_discretionary_income: number;