Skip to content

Commit

Permalink
Merge pull request #190 from icefoganalytics/test
Browse files Browse the repository at this point in the history
CSLPT Fixes and letters bugs
  • Loading branch information
datajohnson authored Oct 23, 2023
2 parents 09eebc0 + eb3410a commit 9bdfe7a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 30 deletions.
1 change: 1 addition & 0 deletions src/api/routes/admin/csl-certificate-export-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ cslCertificateExportRouter.get(

await db("sfa.disbursement")
.where({ csl_cert_seq_number: CSL_CERT_SEQ_P })
.whereNull("ecert_sent_date")
.update({ ecert_sent_date: new Date() });

if (results2[0].fileText) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default class YukonExcellenceAwardsApprovalTemplateSerializer {

return {
amountInCents: disbursement.disbursedAmount * 100,
releaseDate: disbursement.issueDate,
releaseDate: disbursement.dueDate,
};
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export default class YukonGrantInstitutionApprovalTemplateSerializer {

return {
amountInCents: disbursement.disbursedAmount * 100,
releaseDate: disbursement.issueDate,
releaseDate: disbursement.dueDate,
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export default class YukonGrantStudentApprovalTemplateSerializer {

return {
amountInCents: disbursement.disbursedAmount * 100,
releaseDate: disbursement.issueDate,
releaseDate: disbursement.dueDate,
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
readonly
hide-details
label="Total"
:value="formatMoney(totalStudyCosts)"
:value="formatMoney(assessment.uncapped_costs_total)"
/>
</v-col>
</v-row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ const getters = {
},

totalStudyCosts(state) {
let total = (state.application?.tuition_estimate_amount ?? 0) + (state.application?.books_supplies_cost ?? 0);
return total;
return (state.assessment?.tuition_estimate ?? 0) + (state.assessment?.books_supplies_cost ?? 0);
},

totalTransportation(state, getters) {
Expand Down Expand Up @@ -114,28 +113,14 @@ const getters = {
},

assessedNeed(state) {
if (state.assessment) {
let mult = state.assessment.study_weeks >= 24 ? 2 : state.assessment.study_weeks > 0 ? 1 : 0;

let reloc = state.assessment.relocation_total || 0;
let disc = Math.min(state.assessment.discretionary_cost, state.assessment.discretionary_cost_actual) || 0;
let tuit = state.assessment.tuition_estimate || 0;
let books = state.assessment.books_supplies_cost || 0;
let rtrans = state.assessment.r_trans_16wk * mult;
let shelter = state.assessment.shelter_month * state.assessment.study_months;
let ptrans = state.assessment.p_trans_month * state.assessment.study_months;
let daycare =
Math.min(state.assessment.day_care_allowable, state.assessment.day_care_actual) * state.assessment.study_months;
let dshelter = state.assessment.depend_food_allowable * state.assessment.study_months;
let dptrans = state.assessment.depend_tran_allowable * state.assessment.study_months;
let totalCosts = reloc + disc + tuit + books + rtrans + shelter + ptrans + daycare + dshelter + dptrans;

let contribution =
(state.assessment.spouse_expected_contribution || 0) + state.assessment.student_expected_contribution;

return totalCosts > contribution ? totalCosts - contribution : 0;
}
return 0;
let tuit = state.assessment?.tuition_estimate;
let books = state.assessment?.books_supplies_cost;
let ptrans = state.assessment?.p_trans_month * state.assessment?.study_months;
let daycare =
Math.min(state.assessment?.day_care_allowable, state.assessment?.day_care_actual) * state.assessment?.study_months;
let totalCosts = tuit + books + ptrans + daycare + dptrans;

return totalCosts > contribution ? totalCosts - contribution : 0;
},

pastThreshold(state, getters) {
Expand All @@ -151,7 +136,11 @@ const getters = {

let requestedAmount = state.baseMaxAllowable;

if (state.fundingRequest?.csl_request_amount && state.fundingRequest?.csl_request_amount > 0)
if (
state.fundingRequest?.csl_request_amount &&
state.fundingRequest?.csl_request_amount > 0 &&
!state.fundingRequest?.is_csl_full_amount
)
requestedAmount = state.fundingRequest?.csl_request_amount;

let need = getters.needRemaining;
Expand Down Expand Up @@ -298,6 +287,7 @@ const actions = {
spouse_province_id: application.spouse_last_jurisdiction_id,
tuition_estimate: application.tuition_estimate_amount,
books_supplies_cost: application.books_supplies_cost,
uncapped_costs_total: (application.tuition_estimate_amount ?? 0) + (application.books_supplies_cost ?? 0),
student_ln150_income: application.student_ln150_income,
spouse_ln150_income: application.spouse_ln150_income,
spouse_expected_contribution: 0,
Expand Down Expand Up @@ -376,6 +366,7 @@ const actions = {
spouse_province_id: application.spouse_last_jurisdiction_id,
tuition_estimate: application.tuition_estimate_amount,
books_supplies_cost: application.books_supplies_cost,
uncapped_costs_total: (application.tuition_estimate_amount ?? 0) + (application.books_supplies_cost ?? 0),
student_ln150_income: application.student_ln150_income,
spouse_ln150_income: application.spouse_ln150_income,
spouse_expected_contribution: 0,
Expand Down Expand Up @@ -467,7 +458,7 @@ const actions = {
async save({ state, dispatch }, disburseClicked = false) {
state.assessment.disbursements = state.disbursements;

console.log("DISBURSE CLCK", disburseClicked)
console.log("DISBURSE CLCK", disburseClicked);

if (state.assessment.id) {
axios
Expand Down

0 comments on commit 9bdfe7a

Please sign in to comment.