Fortellis cleanup.
This commit is contained in:
@@ -75,7 +75,6 @@ async function FortellisJobExport({ socket, redisHelpers, txEnvelope, jobid }) {
|
||||
defaultFortellisTTL
|
||||
);
|
||||
|
||||
//TODO: Need to remove unnecessary stuff here to reduce the payload.
|
||||
const JobData = await QueryJobData({ socket, jobid });
|
||||
|
||||
await setSessionTransactionData(
|
||||
@@ -356,7 +355,7 @@ async function CalculateDmsVid({ socket, JobData, redisHelpers }) {
|
||||
vin: JobData.v_vin,
|
||||
jobId: JobData.id
|
||||
});
|
||||
throw error; // Re-throw to maintain existing error handling flow
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,9 +409,6 @@ async function QueryDmsCustomerByName({ socket, redisHelpers, JobData }) {
|
||||
["firstName", JobData.ownr_fn.replace(replaceSpecialRegex, "")],
|
||||
["lastName", JobData.ownr_ln.replace(replaceSpecialRegex, "")]
|
||||
];
|
||||
|
||||
CreateFortellisLogEvent(socket, "DEBUG", `Begin query DMS Customer by Name using ${JSON.stringify(ownerName)} `);
|
||||
|
||||
try {
|
||||
const result = await MakeFortellisCall({
|
||||
...FortellisActions.QueryCustomerByName,
|
||||
@@ -903,7 +899,7 @@ async function UpdateDmsVehicle({ socket, redisHelpers, JobData, DMSVeh, DMSCust
|
||||
...DMSVehToSend,
|
||||
dealer: {
|
||||
...DMSVehToSend.dealer, //TODO: Check why company is blank on a queried record.
|
||||
//company: "77",
|
||||
|
||||
...((txEnvelope.inservicedate || DMSVehToSend.dealer.inServiceDate) && {
|
||||
inServiceDate:
|
||||
txEnvelope.dms_unsold === true
|
||||
@@ -1014,8 +1010,8 @@ async function InsertDmsStartWip({ socket, redisHelpers, JobData }) {
|
||||
srcCo: JobData.bodyshop.cdk_configuration.srcco,
|
||||
srcJrnl: txEnvelope.journal,
|
||||
transID: "",
|
||||
userID: "partprgm" || JobData.bodyshop.cdk_configuration.cashierid,
|
||||
userName: "PROGRAM, PARTNER"
|
||||
userID: JobData.bodyshop.cdk_configuration.cashierid,
|
||||
userName: "IMEX"
|
||||
|
||||
// acctgDate: "2025-07-07",
|
||||
// desc: "DOCUMENT DESC. OPTIONAL REQUIREMENT",
|
||||
@@ -1043,26 +1039,6 @@ async function InsertDmsStartWip({ socket, redisHelpers, JobData }) {
|
||||
}
|
||||
}
|
||||
|
||||
async function InsertDmsBatchWip({ socket, redisHelpers, JobData }) {
|
||||
try {
|
||||
const result = await MakeFortellisCall({
|
||||
...FortellisActions.TranBatchWip,
|
||||
headers: {},
|
||||
redisHelpers,
|
||||
socket,
|
||||
jobid: JobData.id,
|
||||
body: await GenerateTransWips({ socket, redisHelpers, JobData })
|
||||
});
|
||||
return result;
|
||||
} catch (error) {
|
||||
handleFortellisApiError(socket, error, "InsertDmsBatchWip", {
|
||||
jobId: JobData.id,
|
||||
errorStack: error.stack
|
||||
});
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async function GenerateTransWips({ socket, redisHelpers, JobData }) {
|
||||
//3rd prop sets fortellis to true to maintain logging.
|
||||
const allocations = await CalculateAllocations(socket, JobData.id, true);
|
||||
|
||||
Reference in New Issue
Block a user