IO-2259 Trim Company Name before seeing if ""

This commit is contained in:
Allan Carr
2023-05-24 11:15:55 -07:00
parent 8f91416623
commit c2ec476324

View File

@@ -224,7 +224,7 @@ async function CdkSelectedCustomer(socket, selectedCustomerId) {
} finally {
//Ensure we always insert logEvents
//GQL to insert logevents.
CdkBase.createLogEvent(
socket,
"DEBUG",
@@ -432,7 +432,7 @@ async function QueryDmsCustomerById(socket, JobData, CustomerId) {
async function QueryDmsCustomerByName(socket, JobData) {
const ownerName = (
JobData.ownr_co_nm && JobData.ownr_co_nm !== ""
JobData.ownr_co_nm && JobData.ownr_co_nm.trim() !== ""
? JobData.ownr_co_nm
: `${JobData.ownr_ln},${JobData.ownr_fn}`
).replace(replaceSpecialRegex, "");
@@ -642,7 +642,8 @@ async function InsertDmsCustomer(socket, newCustomerNumber) {
.toUpperCase(),
middleName: null,
nameType:
socket.JobData.ownr_co_nm && socket.JobData.ownr_co_nm
socket.JobData.ownr_co_nm &&
String(socket.JobData.ownr_co_nm).trim() !== ""
? "Business"
: "Person",
suffix: null,