From da4c814078e446956f513fbd420ce6f954fff076 Mon Sep 17 00:00:00 2001 From: mgtennant <100305096+mgtennant@users.noreply.github.com> Date: Wed, 9 Oct 2024 16:19:31 -0700 Subject: [PATCH 1/3] Update release_5.4_ddl.sql --- spilo-db/db-scripts/releases/release_5.4_ddl.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spilo-db/db-scripts/releases/release_5.4_ddl.sql b/spilo-db/db-scripts/releases/release_5.4_ddl.sql index 2bf72fd..aa8a0e8 100644 --- a/spilo-db/db-scripts/releases/release_5.4_ddl.sql +++ b/spilo-db/db-scripts/releases/release_5.4_ddl.sql @@ -256,7 +256,7 @@ GRANT SELECT ON TABLE mals_app.mal_dairy_farm_trailer_inspection_vw TO mals_app_ -- VIEW: MAL_PRINT_DAIRY_FARM_TRAILER_INSPECTION_VW -- -CREATE VIEW mals_app.mal_print_dairy_farm_trailer_inspection_vw +CREATE OR REPLACE VIEW mals_app.mal_print_dairy_farm_trailer_inspection_vw AS SELECT lictyp.licence_type, to_char(insp.inspection_date, 'yyyy') inspection_year, @@ -265,6 +265,7 @@ AS lic.irma_number, json_build_object( 'CurrentDate', to_char(CURRENT_DATE::timestamp with time zone, 'fmMonth dd, yyyy'::text), + 'LicenceNumber', lic.licence_number, 'IRMA_Num', lic.irma_number, 'LicenceStatus', licstat.code_name, 'LicenceHolderCompany', lic.company_name, From d995ac2827f2ba9532b2ed05860425f72ad07069 Mon Sep 17 00:00:00 2001 From: mgtennant <100305096+mgtennant@users.noreply.github.com> Date: Wed, 9 Oct 2024 16:28:39 -0700 Subject: [PATCH 2/3] including qol update for inspections report gen --- .../src/features/licences/GenerateDairyTrailerInspection.jsx | 2 +- app/client/src/features/licences/LicenceTrailers.jsx | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/client/src/features/licences/GenerateDairyTrailerInspection.jsx b/app/client/src/features/licences/GenerateDairyTrailerInspection.jsx index e46aca4..ff55905 100644 --- a/app/client/src/features/licences/GenerateDairyTrailerInspection.jsx +++ b/app/client/src/features/licences/GenerateDairyTrailerInspection.jsx @@ -1,6 +1,6 @@ import React, { useEffect } from "react"; import { useSelector, useDispatch } from "react-redux"; -import { Row, Col, Form, Button } from "react-bootstrap"; +import { Row, Col, Button } from "react-bootstrap"; import DocGenDownloadBar from "../../components/DocGenDownloadBar"; diff --git a/app/client/src/features/licences/LicenceTrailers.jsx b/app/client/src/features/licences/LicenceTrailers.jsx index 3f7af85..4565485 100644 --- a/app/client/src/features/licences/LicenceTrailers.jsx +++ b/app/client/src/features/licences/LicenceTrailers.jsx @@ -43,6 +43,7 @@ import ErrorMessageRow from "../../components/ErrorMessageRow"; import { selectCurrentUser } from "../../app/appSlice"; import GenerateDairyTrailerInspection from "./GenerateDairyTrailerInspection"; +import { clearReportsJob } from "../reports/reportsSlice"; function formatResultRow(result) { const url = `${TRAILERS_PATHNAME}/${result.dairyFarmTrailerId}`; @@ -81,6 +82,9 @@ export default function LicenceTrailers({ licence }) { setTrailerParameters({ licenceNumber: licence.data.licenceNumber }) ); dispatch(fetchTrailerResults()); + return () => { + dispatch(clearReportsJob()); + }; }, [dispatch]); const handleFilterTextChange = (e) => { From 1c144680af1c33fb1e1b216b442fa7fb9481c63d Mon Sep 17 00:00:00 2001 From: mgtennant <100305096+mgtennant@users.noreply.github.com> Date: Thu, 10 Oct 2024 10:04:21 -0700 Subject: [PATCH 3/3] trailer inspection procedure update --- spilo-db/db-scripts/releases/release_5.4_ddl.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spilo-db/db-scripts/releases/release_5.4_ddl.sql b/spilo-db/db-scripts/releases/release_5.4_ddl.sql index aa8a0e8..f769ec2 100644 --- a/spilo-db/db-scripts/releases/release_5.4_ddl.sql +++ b/spilo-db/db-scripts/releases/release_5.4_ddl.sql @@ -479,8 +479,8 @@ GRANT SELECT ON TABLE mals_app.mal_print_certificate_vw TO mals_app_role; -- PROCEDURE: PR_GENERATE_PRINT_JSON_DAIRY_FARM_TRAILER_INSPECTION -- -CREATE OR REPLACE PROCEDURE mals_app.pr_generate_print_json_dairy_farm_trailer_inspection( - IN ip_irma_number character varying, +CREATE PROCEDURE mals_app.pr_generate_print_json_dairy_farm_trailer_inspection( + IN ip_licence_number integer, INOUT iop_print_job_id integer) LANGUAGE plpgsql AS $procedure$ @@ -515,7 +515,7 @@ AS $procedure$ 'InspectorName', inspector_id, 'InspectionComments', inspection_comments)) AS trailer_json FROM mal_dairy_farm_trailer_inspection_vw - WHERE irma_number = ip_irma_number + WHERE licence_number = ip_licence_number GROUP BY irma_number, licence_number, company_name)