From f771db603483317c30182753f53d5ca55b5e4ec4 Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Wed, 2 Apr 2025 21:26:15 -0500 Subject: [PATCH] fix(ocp): delivery changes to happen after bookin is done --- server/services/ocp/controller/labeling/bookIn.ts | 1 + .../services/ocp/controller/labeling/labelProcess.ts | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/server/services/ocp/controller/labeling/bookIn.ts b/server/services/ocp/controller/labeling/bookIn.ts index 31dfc41..571bed1 100644 --- a/server/services/ocp/controller/labeling/bookIn.ts +++ b/server/services/ocp/controller/labeling/bookIn.ts @@ -69,6 +69,7 @@ export const bookInLabel = async (data: any) => { message: `${parseInt( data.SSCC.slice(10, -1) )}, was just booked in`, + data: { SSCC: data.SSCC }, }; } catch (error) { createLog( diff --git a/server/services/ocp/controller/labeling/labelProcess.ts b/server/services/ocp/controller/labeling/labelProcess.ts index 4313bea..f6a076f 100644 --- a/server/services/ocp/controller/labeling/labelProcess.ts +++ b/server/services/ocp/controller/labeling/labelProcess.ts @@ -59,11 +59,11 @@ export const labelingProcess = async ({ "error", "labeling", "ocp", - `There is not a lot assigned to ${macId[0].Name}.` + `There is not a lot assigned to ${macId[0]?.Name}.` ); return { success: false, - message: `There is not a lot assigned to ${macId[0].Name}.`, + message: `There is not a lot assigned to ${macId[0]?.Name}.`, }; } } @@ -217,9 +217,9 @@ export const labelingProcess = async ({ // send over to be booked in if we can do it. const bookin = settingData.filter((s) => s.name === "bookin"); - + let book: any = []; if (bookin[0].value === "1") { - const book = await bookInLabel(label.data); + book = await bookInLabel(label.data); } else { createLog("info", "labeling", "ocp", "Bookin is turned off."); @@ -231,7 +231,8 @@ export const labelingProcess = async ({ (s) => s.name === "inhouseDelivery" ); if (inhouseDelivery[0].value === "1") { - const deliverPallet = await delieryInhouse(label); + const deliverPallet = await delieryInhouse(book.data); + // console.log(deliverPallet); } return {