From 37f82a9710cf20e6d0d056893c9da43c70b9e619 Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Mon, 25 Aug 2025 14:39:54 -0500 Subject: [PATCH] refactor(tms intergration): corrected how we added gl coding --- .../notifications/tiFullFlow/tiImport.ts | 28 +++++++++++++------ .../notifications/tiFullFlow/tiXmlPayload.ts | 7 +++-- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/server/services/notifications/controller/notifications/tiFullFlow/tiImport.ts b/server/services/notifications/controller/notifications/tiFullFlow/tiImport.ts index cf440b7..4c36b50 100644 --- a/server/services/notifications/controller/notifications/tiFullFlow/tiImport.ts +++ b/server/services/notifications/controller/notifications/tiFullFlow/tiImport.ts @@ -239,15 +239,16 @@ export const tiImport = async () => { .replaceAll("[customerState]", orderData[0].city.split(",")[1]) .replaceAll("[customerZip]", orderData[0].zipCode) .replaceAll("[customerPO]", orderData[0].Header) - .replaceAll( - "[glCoding]", - `52410-${ - orderData[0].artileType.toLowerCase() === "preform" || - orderData[0].artileType.toLowerCase() === "metalCage" - ? 31 - : plantI[0].greatPlainsPlantCode - }` - ) // {"52410 - " + (artileType.toLowerCase() === "preform" || artileType.toLowerCase() === "metalCage" ? 31: plantInfo[0].greatPlainsPlantCode)} + // .replaceAll( + // "[glCoding]", + // `52410-${ + // orderData[0].artileType.toLowerCase() === "preform" || + // orderData[0].artileType.toLowerCase() === "metalCage" + // ? 31 + // : plantI[0].greatPlainsPlantCode + // }` + // ) // {"52410 - " + (artileType.toLowerCase() === "preform" || artileType.toLowerCase() === "metalCage" ? 31: plantInfo[0].greatPlainsPlantCode)} + .replaceAll("[glCoding]", `52410`) .replaceAll( "[pfc]", `${ @@ -257,6 +258,15 @@ export const tiImport = async () => { : orderData[0].costCenter }` ) + .replaceAll( + "[locCode]", + `${ + orderData[0].artileType.toLowerCase() === "preform" || + orderData[0].artileType.toLowerCase() === "metalCage" + ? 31 + : plantI[0].greatPlainsPlantCode + }` + ) .replaceAll("[priceSheet]", await scacCheck(orderData)); //send over to be processed diff --git a/server/services/notifications/controller/notifications/tiFullFlow/tiXmlPayload.ts b/server/services/notifications/controller/notifications/tiFullFlow/tiXmlPayload.ts index 5ed407b..9b04fbb 100644 --- a/server/services/notifications/controller/notifications/tiFullFlow/tiXmlPayload.ts +++ b/server/services/notifications/controller/notifications/tiFullFlow/tiXmlPayload.ts @@ -110,8 +110,11 @@ export let xmlPayloadTI = ` [shipNumber] [customerPO] [multieReleaseNumber] -[glCoding] -[pfc] + + +[glCoding] +[pfc] +[locCode]