Skip to content

Commit

Permalink
Merge pull request #227 from icefoganalytics/test
Browse files Browse the repository at this point in the history
NARS fixes
  • Loading branch information
datajohnson authored Jan 8, 2024
2 parents b49bcff + fb5b398 commit a5cb1d9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/api/controllers/admin/reporting-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ export default class ReportingController extends BaseController {
if (this.format == "html") {
this.response.send(reportData);
} else if (this.format == "csv") {
this.response.setHeader("Content-disposition", `attachment; filename="PPYT.CSLS.PT_NARS_2223.001.csv"`);
this.response.setHeader("Content-disposition", `attachment; filename="PPYT.CSLS.PDEXPAND_2223.${moment().format("YYYY-MM-DD")}.csv"`);
this.response.setHeader("Content-type", "text/csv");
this.response.send(reportData);
} else if (this.format == "json") {
this.response.json(reportData);
} else {
this.response.setHeader("Content-disposition", `attachment; filename="PPYT.CSLS.PT_NARS_2223.001.txt"`);
this.response.setHeader("Content-disposition", `attachment; filename="PPYT.CSLS.PDEXPAND_2223.${moment().format("YYYY-MM-DD")}.txt"`);
this.response.setHeader("Content-type", "text/plain");
this.response.send(reportData);
}
Expand All @@ -175,13 +175,13 @@ export default class ReportingController extends BaseController {
if (this.format == "html") {
this.response.send(reportData);
} else if (this.format == "csv") {
this.response.setHeader("Content-disposition", `attachment; filename="PPYT.CSLS.PT_NARS_2223.001.csv"`);
this.response.setHeader("Content-disposition", `attachment; filename="PPYT.CSLS.PDReducedCourseLoad_2223.${moment().format("YYYY-MM-DD")}.csv"`);
this.response.setHeader("Content-type", "text/csv");
this.response.send(reportData);
} else if (this.format == "json") {
this.response.json(reportData);
} else {
this.response.setHeader("Content-disposition", `attachment; filename="PPYT.CSLS.PT_NARS_2223.001.txt"`);
this.response.setHeader("Content-disposition", `attachment; filename="PPYT.CSLS.PDReducedCourseLoad_2223.${moment().format("YYYY-MM-DD")}.txt"`);
this.response.setHeader("Content-type", "text/plain");
this.response.send(reportData);
}
Expand Down
1 change: 1 addition & 0 deletions src/api/services/admin/nars-dis-reporting-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class NarsDisabilityReportingService {
INNER JOIN sfa.institution ON (institution.id = institution_campus.institution_id)
INNER JOIN (SELECT SUM(COALESCE(disbursed_amount, 0)) disbursed, max(issue_date) issue_date, funding_request_id, assessment_id
FROM sfa.disbursement GROUP BY assessment_id, funding_request_id) d ON (funding_request.id = d.funding_request_id and assessment.id = d.assessment_id)
INNER JOIN (SELECT funding_request_id, MAX(id) last_id FROM sfa.assessment GROUP BY funding_request_id) maxid ON assessment.id = maxid.last_id
where
funding_request.request_type_id IN (4,5) AND application.academic_year_id = ${this.year} AND
(application.is_perm_disabled = 1 OR application.permanent_disability = 1 OR application.pers_or_prolong_disability = 1 OR application.is_persist_disabled = 1)`);
Expand Down
3 changes: 2 additions & 1 deletion src/api/services/admin/nars-disft-reporting-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export class NarsDisabilityRCLReportingService {
INNER JOIN sfa.field_program ON (application.program_id = field_program.program_id AND study_field.id = field_program.study_field_id)
INNER JOIN (SELECT SUM(COALESCE(disbursed_amount, 0)) disbursed, max(issue_date) issue_date, funding_request_id, assessment_id
FROM sfa.disbursement GROUP BY assessment_id, funding_request_id) d ON (funding_request.id = d.funding_request_id and assessment.id = d.assessment_id)
where
INNER JOIN (SELECT funding_request_id, MAX(id) last_id FROM sfa.assessment GROUP BY funding_request_id) maxid ON assessment.id = maxid.last_id
WHERE
funding_request.request_type_id IN (4,5) AND application.academic_year_id = ${this.year} AND
(application.is_perm_disabled = 1 OR application.permanent_disability = 1 OR application.pers_or_prolong_disability = 1 OR application.is_persist_disabled = 1)
ORDER BY sin`);
Expand Down

0 comments on commit a5cb1d9

Please sign in to comment.