Merged in hotfix/2026-02-19 (pull request #3020)

Hotfix/2026 02 19
This commit is contained in:
Allan Carr
2026-02-19 20:07:21 +00:00

View File

@@ -285,7 +285,7 @@ async function FortellisSelectedCustomer({ socket, redisHelpers, selectedCustome
//something
CreateFortellisLogEvent(socket, "DEBUG", `{6} Successfully posted transaction to DMS.`);
await MarkJobExported({ socket, jobid: JobData.id, JobData });
await MarkJobExported({ socket, jobid: JobData.id, JobData, redisHelpers });
try {
CreateFortellisLogEvent(socket, "DEBUG", `{7} Updating Service Vehicle History.`);
@@ -427,8 +427,8 @@ async function QueryDmsCustomerByName({ socket, redisHelpers, JobData }) {
? //? [["firstName", JobData.ownr_co_nm.replace(replaceSpecialRegex, "").toUpperCase()]] // Commented out until we receive direction.
[["phone", JobData.ownr_ph1?.replace(replaceSpecialRegex, "")]]
: [
["firstName", JobData.ownr_fn?.replace(/[^a-zA-Z-]/g, "").toUpperCase()],
["lastName", JobData.ownr_ln?.replace(/[^a-zA-Z-]/g, "").toUpperCase()]
["firstName", JobData.ownr_fn?.replace(/[^a-zA-Z0-9-]/g, "").toUpperCase()],
["lastName", JobData.ownr_ln?.replace(/[^a-zA-Z0-9-]/g, "").toUpperCase()]
];
try {
const result = await MakeFortellisCall({
@@ -471,9 +471,9 @@ async function InsertDmsCustomer({ socket, redisHelpers, JobData }) {
: {
customerName: {
//"suffix": "Mr.",
firstName: JobData.ownr_fn && JobData.ownr_fn.replace(/[^a-zA-Z-]/g, "").toUpperCase(),
firstName: JobData.ownr_fn && JobData.ownr_fn.replace(/[^a-zA-Z0-9-]/g, "").toUpperCase(),
//"middleName": "",
lastName: JobData.ownr_ln && JobData.ownr_ln.replace(/[^a-zA-Z-]/g, "").toUpperCase()
lastName: JobData.ownr_ln && JobData.ownr_ln.replace(/[^a-zA-Z0-9-]/g, "").toUpperCase()
//"title": "",
//"nickName": ""
}
@@ -1295,8 +1295,14 @@ async function DeleteDmsWip({ socket, redisHelpers, JobData }) {
}
}
async function MarkJobExported({ socket, jobid, JobData }) {
async function MarkJobExported({ socket, jobid, JobData, redisHelpers }) {
CreateFortellisLogEvent(socket, "DEBUG", `Marking job as exported for id ${jobid}`);
const transwips = await redisHelpers.getSessionTransactionData(
socket.id,
getTransactionType(JobData.id),
FortellisCacheEnums.transWips
);
const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {});
const currentToken =
@@ -1315,7 +1321,7 @@ async function MarkJobExported({ socket, jobid, JobData }) {
jobid: jobid,
successful: true,
useremail: socket.user.email,
metadata: socket.transWips
metadata: transwips
},
bill: {
exported: true,