Merged in feature/IO-3722-disable-contact-fortellis (pull request #3282)
Feature/IO-3722 disable contact fortellis
This commit is contained in:
@@ -135,7 +135,7 @@ async function FortellisJobExport({ socket, redisHelpers, txEnvelope, jobid }) {
|
||||
}
|
||||
}
|
||||
CreateFortellisLogEvent(socket, "DEBUG", `{2.3} Querying the Customer using the name.`);
|
||||
if (!JobData.bodyshop.cdk_configuration.disablecontact) {
|
||||
if (JobData.bodyshop.cdk_configuration.disablecontact) {
|
||||
//Just go straight to posting.
|
||||
await FortellisSelectedCustomer({ socket, redisHelpers, selectedCustomerId: bypassCustomerId, jobid });
|
||||
} else {
|
||||
@@ -226,8 +226,8 @@ 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.
|
||||
let DMSCust;
|
||||
if (!JobData.bodyshop.cdk_configuration.disablecontact) {
|
||||
let DMSCust;
|
||||
if (selectedCustomerId) {
|
||||
CreateFortellisLogEvent(socket, "DEBUG", `{3.1} Querying the Customer using Customer ID: ${selectedCustomerId}`);
|
||||
|
||||
@@ -257,6 +257,8 @@ async function FortellisSelectedCustomer({ socket, redisHelpers, selectedCustome
|
||||
defaultFortellisTTL
|
||||
);
|
||||
}
|
||||
}else{
|
||||
DMSCust = { customerId: bypassCustomerId };
|
||||
}
|
||||
|
||||
let DMSVeh;
|
||||
@@ -916,7 +918,7 @@ async function InsertDmsVehicle({ socket, redisHelpers, JobData, txEnvelope, DMS
|
||||
// "wheelbase": ""
|
||||
},
|
||||
// Owners is not required. Exclude it if we are bypassing.
|
||||
...(selectedCustomerId !== bypassCustomerId && {
|
||||
...(DMSCust?.customerId !== bypassCustomerId && {
|
||||
owners: [
|
||||
{
|
||||
id: {
|
||||
|
||||
Reference in New Issue
Block a user