diff --git a/server/services/notifications/controller/notifications/tiIntergration.ts b/server/services/notifications/controller/notifications/tiIntergration.ts index d281312..efa7ae9 100644 --- a/server/services/notifications/controller/notifications/tiIntergration.ts +++ b/server/services/notifications/controller/notifications/tiIntergration.ts @@ -49,7 +49,7 @@ const tiImport = async () => { // parsing posting window const plantI = plantInfo!; - const postTime = JSON.parse(plantI[0]?.tiPostTime!); + //const postTime = JSON.parse(plantI[0]?.tiPostTime!); // order notifications const { data: notificationSet, error: notificationSettingsErr } = @@ -149,6 +149,16 @@ const tiImport = async () => { ); webHeader = webHeader.replaceAll("[requestUser]", requestUser); + // update the special instructions section + const otherSettings = plantI[0]?.otherSettings as { + specialInstructions: string; + active: boolean; + }[]; + + const specialInfo = otherSettings[0].specialInstructions.replaceAll( + "[header]", + records[0].Header + ); // this part will link into the let itemGroups = ""; @@ -304,14 +314,13 @@ const tiImport = async () => { ? 40 : records[0].costCenter }` - ) - - // special instructions - .replaceAll( - "[specialInstructions]", - `This is a FTL load. The driver will need 2 adjustable load locks to secure the load. The driver will not be loaded without them. Please reference ALPLA pickup ${records[0].Header}` ); + // special instructions + if (otherSettings[0].specialInstructions.length != 0) { + payload = payload.replaceAll("[specialInstructions]", specialInfo); + } + // update the carrier info if any is needed. // check the address has a real carrier on it and change to true and put the sacs code in