Skip to content

Commit d2dccae

Browse files
authored
Merge pull request #345 from icefoganalytics/test
more nars
2 parents e5bd5f1 + 6aca1a8 commit d2dccae

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/api/services/admin/nars-v17-2-reporting-service.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ export class NarsV17_2ReportingService {
163163
let csg_dse = 0;
164164

165165
let provGrants = 0;
166+
let otherExpenses = 0;
166167

167168
let stud_sp_cost_living_allow = 0;
168169
let stud_sp_cost_computers = 0;
@@ -199,6 +200,13 @@ export class NarsV17_2ReportingService {
199200
let compExp = expenses.find((e) => e.category_id == 14);
200201
if (compExp) stud_sp_cost_computers = Math.round(Math.min(300, Math.ceil(compExp.amount))); // $300 is the max for computers
201202

203+
const otherExpenseTypes = [1, 2, 4, 5, 6, 7, 8, 9];
204+
205+
otherExpenses = expenses
206+
.filter((e) => otherExpenseTypes.includes(e.category_id))
207+
.map((e) => e.amount)
208+
.reduce((a, f) => a + f, 0);
209+
202210
let incomes = await db("sfa.income").where({ application_id: applicationId });
203211
let scholarshipIncome = incomes.filter((e) => e.income_type_id == 16); // Scholarships - Merit Based
204212

@@ -229,7 +237,9 @@ export class NarsV17_2ReportingService {
229237
stud_sp_cost_living_allow = app.shelter_month * app.study_months + app.p_trans_month * app.study_months;
230238

231239
stud_sp_cost_other =
232-
(app.depend_food_allowable + app.depend_tran_allowable) * app.study_months + app.discretionary_cost_actual;
240+
(app.depend_food_allowable + app.depend_tran_allowable) * app.study_months +
241+
app.discretionary_cost_actual +
242+
otherExpenses;
233243

234244
totalCosts += stud_sp_cost_living_allow;
235245
totalCosts += app.tuition_estimate;
@@ -376,7 +386,7 @@ export class NarsV17_2ReportingService {
376386
row.push(new Column("ass_psl_bef_overa", "0", "0", 6)); // always 0
377387
row.push(new Column("csl_over_award_recovered", "0", "0", 6)); // this is complicated by the over award change reason, 0 for now
378388
row.push(new Column("psl_over_award_recovered", "0", "0", 6)); // always 0
379-
row.push(new Column("auth_csl_amt", cleanMoney((Math.min(52, app.study_weeks) ?? 1) * 300), "0", 6));
389+
row.push(new Column("auth_csl_amt", cleanMoney(csl_ft || 0), "0", 6));
380390
row.push(new Column("auth_psl_amt", "0", "0", 6)); // always 0
381391

382392
row.push(new Column("csg_ft", cleanMoney(csg_ft), "0", 6));

0 commit comments

Comments
 (0)