IO-1727 Skip posting contact and vehicle for PBS..

This commit is contained in:
Patrick Fic
2022-02-09 16:46:32 -08:00
parent f8695972a3
commit bd9c2cd0af
7 changed files with 64 additions and 20 deletions

View File

@@ -103,28 +103,38 @@ exports.PbsSelectedCustomer = async function PbsSelectedCustomer(
selectedCustomerId
) {
try {
CdkBase.createLogEvent(
socket,
"DEBUG",
`User selected customer ${selectedCustomerId || "NEW"}`
);
if (
socket.JobData.bodyshop.pbs_configuration.disablecontactvehicle === false
) {
CdkBase.createLogEvent(
socket,
"DEBUG",
`User selected customer ${selectedCustomerId || "NEW"}`
);
//Upsert the contact information as per Wafaa's Email.
CdkBase.createLogEvent(
socket,
"DEBUG",
`Upserting contact information to DMS for ${
socket.JobData.ownr_fn || ""
} ${socket.JobData.ownr_ln || ""} ${socket.JobData.ownr_co_nm || ""}`
);
const ownerRef = await UpsertContactData(socket, selectedCustomerId);
//Upsert the contact information as per Wafaa's Email.
CdkBase.createLogEvent(
socket,
"DEBUG",
`Upserting contact information to DMS for ${
socket.JobData.ownr_fn || ""
} ${socket.JobData.ownr_ln || ""} ${socket.JobData.ownr_co_nm || ""}`
);
const ownerRef = await UpsertContactData(socket, selectedCustomerId);
CdkBase.createLogEvent(
socket,
"DEBUG",
`Upserting vehicle information to DMS for ${socket.JobData.v_vin}`
);
await UpsertVehicleData(socket, ownerRef.ReferenceId);
CdkBase.createLogEvent(
socket,
"DEBUG",
`Upserting vehicle information to DMS for ${socket.JobData.v_vin}`
);
await UpsertVehicleData(socket, ownerRef.ReferenceId);
} else {
CdkBase.createLogEvent(
socket,
"DEBUG",
`Contact and Vehicle updates disabled. Skipping to accounting data insert.`
);
}
CdkBase.createLogEvent(socket, "DEBUG", `Inserting account data.`);
CdkBase.createLogEvent(
socket,