diff --git a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx
index c88650e13..f4a7aa569 100644
--- a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx
+++ b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx
@@ -157,36 +157,36 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
{HasFeatureAccess({ featureName: "export", bodyshop }) &&
ClosingPeriod.treatment === "on" && (
-
-
-
-
-
- )}
+
+
+
+
+
+ )}
{HasFeatureAccess({ featureName: "export", bodyshop }) &&
ADPPayroll.treatment === "on" && (
-
-
-
-
-
- )}
+
+
+
+
+
+ )}
{HasFeatureAccess({ featureName: "export", bodyshop }) &&
ADPPayroll.treatment === "on" && (
-
+
-
-
-
- )}
+
+
+
+ )}
{HasFeatureAccess({ featureName: "export", bodyshop }) && !hasDMSKey && (
<>
@@ -512,6 +512,15 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
>
+ {bodyshop.cdk_dealerid && (
+
+
+
+ )}
{bodyshop.pbs_serialnumber && (
o.id.assigningPartyId === "CURRENT");
+ //Add in contact bypass for Fortellis.
+ if (!JobData.bodyshop.cdk_configuration.disablecontact) {
+ const DMSVehCustomerFromVehicle =
+ DMSVeh?.owners && DMSVeh.owners.find((o) => o.id.assigningPartyId === "CURRENT");
- if (DMSVehCustomerFromVehicle?.id && DMSVehCustomerFromVehicle.id.value) {
- CreateFortellisLogEvent(
- socket,
- "DEBUG",
- `{2.2} Querying the Customer using the ID from DMSVeh: ${DMSVehCustomerFromVehicle.id.value}`
- );
- DMSVehCustomer = await QueryDmsCustomerById({
- socket,
- redisHelpers,
- JobData,
- CustomerId: DMSVehCustomerFromVehicle.id.value
- });
- await setSessionTransactionData(
- socket.id,
- getTransactionType(jobid),
- FortellisCacheEnums.DMSVehCustomer,
- DMSVehCustomer,
- defaultFortellisTTL
- );
+ if (DMSVehCustomerFromVehicle?.id && DMSVehCustomerFromVehicle.id.value) {
+ CreateFortellisLogEvent(
+ socket,
+ "DEBUG",
+ `{2.2} Querying the Customer using the ID from DMSVeh: ${DMSVehCustomerFromVehicle.id.value}`
+ );
+ DMSVehCustomer = await QueryDmsCustomerById({
+ socket,
+ redisHelpers,
+ JobData,
+ CustomerId: DMSVehCustomerFromVehicle.id.value
+ });
+ await setSessionTransactionData(
+ socket.id,
+ getTransactionType(jobid),
+ FortellisCacheEnums.DMSVehCustomer,
+ DMSVehCustomer,
+ defaultFortellisTTL
+ );
+ }
}
}
CreateFortellisLogEvent(socket, "DEBUG", `{2.3} Querying the Customer using the name.`);
+ if (!JobData.bodyshop.cdk_configuration.disablecontact) {
+ //Just go straight to posting.
+ FortellisSelectedCustomer({ socket, redisHelpers, selectedCustomerId: bypassCustomerId, jobid });
+ } else {
+ const DMSCustList = await QueryDmsCustomerByName({ socket, redisHelpers, JobData });
+ await setSessionTransactionData(
+ socket.id,
+ getTransactionType(jobid),
+ FortellisCacheEnums.DMSCustList,
+ DMSCustList,
+ defaultFortellisTTL
+ );
- const DMSCustList = await QueryDmsCustomerByName({ socket, redisHelpers, JobData });
- await setSessionTransactionData(
- socket.id,
- getTransactionType(jobid),
- FortellisCacheEnums.DMSCustList,
- DMSCustList,
- defaultFortellisTTL
- );
-
- socket.emit("fortellis-select-customer", [
- ...(DMSVehCustomer ? [{ ...DMSVehCustomer, vinOwner: true }] : []),
- ...DMSCustList
- ]);
+ socket.emit("fortellis-select-customer", [
+ ...(DMSVehCustomer ? [{ ...DMSVehCustomer, vinOwner: true }] : []),
+ ...DMSCustList
+ ]);
+ }
} catch (error) {
CreateFortellisLogEvent(socket, "ERROR", `Error in FortellisJobExport - ${error} `, {
error: error.message,
@@ -218,36 +225,38 @@ async function FortellisSelectedCustomer({ socket, redisHelpers, selectedCustome
});
return;
}
+ //Bypass only the customer creation. We still need to create the vehicle and update it to post the service history later on.
+ if (!JobData.bodyshop.cdk_configuration.disablecontact) {
+ let DMSCust;
+ if (selectedCustomerId) {
+ CreateFortellisLogEvent(socket, "DEBUG", `{3.1} Querying the Customer using Customer ID: ${selectedCustomerId}`);
- let DMSCust;
- if (selectedCustomerId) {
- CreateFortellisLogEvent(socket, "DEBUG", `{3.1} Querying the Customer using Customer ID: ${selectedCustomerId}`);
-
- //Get cust list from Redis. Return the item
- const DMSCustList =
- (await getSessionTransactionData(socket.id, getTransactionType(jobid), FortellisCacheEnums.DMSCustList)) || [];
- const existingCustomerInDMSCustList = DMSCustList.find((c) => c.customerId === selectedCustomerId);
- DMSCust = existingCustomerInDMSCustList || {
- customerId: selectedCustomerId //This is the fall back in case it is the generic customer.
- };
- await setSessionTransactionData(
- socket.id,
- getTransactionType(jobid),
- FortellisCacheEnums.DMSCust,
- DMSCust,
- defaultFortellisTTL
- );
- } else {
- CreateFortellisLogEvent(socket, "DEBUG", `{3.2} Creating new customer.`);
- const DMSCustomerInsertResponse = await InsertDmsCustomer({ socket, redisHelpers, JobData });
- DMSCust = { customerId: DMSCustomerInsertResponse.data };
- await setSessionTransactionData(
- socket.id,
- getTransactionType(jobid),
- FortellisCacheEnums.DMSCust,
- DMSCust,
- defaultFortellisTTL
- );
+ //Get cust list from Redis. Return the item
+ const DMSCustList =
+ (await getSessionTransactionData(socket.id, getTransactionType(jobid), FortellisCacheEnums.DMSCustList)) || [];
+ const existingCustomerInDMSCustList = DMSCustList.find((c) => c.customerId === selectedCustomerId);
+ DMSCust = existingCustomerInDMSCustList || {
+ customerId: selectedCustomerId //This is the fall back in case it is the generic customer.
+ };
+ await setSessionTransactionData(
+ socket.id,
+ getTransactionType(jobid),
+ FortellisCacheEnums.DMSCust,
+ DMSCust,
+ defaultFortellisTTL
+ );
+ } else {
+ CreateFortellisLogEvent(socket, "DEBUG", `{3.2} Creating new customer.`);
+ const DMSCustomerInsertResponse = await InsertDmsCustomer({ socket, redisHelpers, JobData });
+ DMSCust = { customerId: DMSCustomerInsertResponse.data };
+ await setSessionTransactionData(
+ socket.id,
+ getTransactionType(jobid),
+ FortellisCacheEnums.DMSCust,
+ DMSCust,
+ defaultFortellisTTL
+ );
+ }
}
let DMSVeh;
@@ -258,8 +267,12 @@ async function FortellisSelectedCustomer({ socket, redisHelpers, selectedCustome
DMSVeh = await getSessionTransactionData(socket.id, getTransactionType(jobid), FortellisCacheEnums.DMSVeh);
CreateFortellisLogEvent(socket, "DEBUG", `{4.3} Updating Existing Vehicle to associate to owner.`);
+ //If it's a bypass scenario, skip this all.
//Check to see if the vehicle needs to be updated - i.e. the owner is not the selected customer.
- if (!DMSVeh?.owners.find((o) => o.id.value === DMSCust.customerId && o.id.assigningPartyId === "CURRENT")) {
+ if (
+ selectedCustomerId !== bypassCustomerId &&
+ !DMSVeh?.owners.find((o) => o.id.value === DMSCust.customerId && o.id.assigningPartyId === "CURRENT")
+ ) {
DMSVeh = await UpdateDmsVehicle({
socket,
redisHelpers,
@@ -902,14 +915,17 @@ async function InsertDmsVehicle({ socket, redisHelpers, JobData, txEnvelope, DMS
// "warrantyExpDate": "2015-01-12",
// "wheelbase": ""
},
- owners: [
- {
- id: {
- assigningPartyId: "CURRENT",
- value: DMSCust.customerId
+ // Owners is not required. Exclude it if we are bypassing.
+ ...(selectedCustomerId !== bypassCustomerId && {
+ owners: [
+ {
+ id: {
+ assigningPartyId: "CURRENT",
+ value: DMSCust.customerId
+ }
}
- }
- ]
+ ]
+ })
//"inventoryAccount": "237"
}
});