diff --git a/helpers/licencesDB/getReportData.js b/helpers/licencesDB/getReportData.js index a60f756..03d0d24 100644 --- a/helpers/licencesDB/getReportData.js +++ b/helpers/licencesDB/getReportData.js @@ -77,6 +77,12 @@ export const getReportData = (reportName, reportParameters) => { sqlParameters = report.sqlParameters; break; case "licences-formatted": + let issuedFilter = ""; + if (reportParameters.issued) { + issuedFilter = (reportParameters.issued === "true" + ? " and l.issueDate is not null" + : " and l.issueDate is null"); + } sql = "select l.licenceId as " + licenceId + "," + " c.licenceCategory as " + licenceCategory + "," + " l.licenceNumber as " + licenceNumber + "," + @@ -93,6 +99,7 @@ export const getReportData = (reportName, reportParameters) => { " from Licences l" + " left join LicenceCategories c on l.licenceCategoryKey = c.licenceCategoryKey" + " where l.recordDelete_timeMillis is null" + + issuedFilter + " order by startDate desc, endDate desc, licenceId"; break; case "licenceAdditionalFees-all": diff --git a/helpers/licencesDB/getReportData.ts b/helpers/licencesDB/getReportData.ts index 8b1dec9..71eed26 100644 --- a/helpers/licencesDB/getReportData.ts +++ b/helpers/licencesDB/getReportData.ts @@ -1,3 +1,5 @@ +/* eslint-disable no-case-declarations */ + import sqlite from "better-sqlite3"; import { licencesDB as databasePath } from "../../data/databasePaths.js"; @@ -117,6 +119,14 @@ export const getReportData = (reportName: string, reportParameters?: ReportParam case "licences-formatted": + let issuedFilter = ""; + + if (reportParameters.issued) { + issuedFilter = (reportParameters.issued === "true" + ? " and l.issueDate is not null" + : " and l.issueDate is null"); + } + sql = "select l.licenceId as " + licenceId + "," + " c.licenceCategory as " + licenceCategory + "," + " l.licenceNumber as " + licenceNumber + "," + @@ -133,7 +143,9 @@ export const getReportData = (reportName: string, reportParameters?: ReportParam " from Licences l" + " left join LicenceCategories c on l.licenceCategoryKey = c.licenceCategoryKey" + " where l.recordDelete_timeMillis is null" + + issuedFilter + " order by startDate desc, endDate desc, licenceId"; + break; case "licenceAdditionalFees-all": diff --git a/views/admin-yearEnd.ejs b/views/admin-yearEnd.ejs index 6ea9a3d..fbfb8de 100644 --- a/views/admin-yearEnd.ejs +++ b/views/admin-yearEnd.ejs @@ -22,6 +22,28 @@
+
+ +
+

+ All Unissued <%= configFunctions.getProperty("settings.licenceAliasPlural") %> +

+

After the refresh process, these licences will be deleted.

+
+
+
+ +
+

+ All Issued <%= configFunctions.getProperty("settings.licenceAliasPlural") %> +

+

After the refresh process, these licences will still exists, but will no longer be issued.

+
+