From 6de06e084bdab7383e0d51bbcac519652a8a036a Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 23 Jun 2023 08:53:14 -0700 Subject: [PATCH] IO-2342 QBD Owner Name with just LN Trim Removes extra space if there is just a OWNR_LN before the ACCT # --- server/accounting/qbxml/qbxml-receivables.js | 12 ++++++------ server/accounting/qbxml/qbxml-utils.js | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/server/accounting/qbxml/qbxml-receivables.js b/server/accounting/qbxml/qbxml-receivables.js index e697e0985..629bb4dca 100644 --- a/server/accounting/qbxml/qbxml-receivables.js +++ b/server/accounting/qbxml/qbxml-receivables.js @@ -263,9 +263,9 @@ const generateInvoiceQbxml = ( BillAddress: { Addr1: jobs_by_pk.ownr_co_nm ? jobs_by_pk.ownr_co_nm.substring(0, 30) - : `${`${jobs_by_pk.ownr_ln || ""} ${ - jobs_by_pk.ownr_fn || "" - }`.substring(0, 30)}`, + : `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}` + .substring(0, 30) + .trim()}`, Addr2: jobs_by_pk.ownr_addr1, Addr3: jobs_by_pk.ownr_addr2, City: jobs_by_pk.ownr_city, @@ -275,9 +275,9 @@ const generateInvoiceQbxml = ( ShipAddress: { Addr1: jobs_by_pk.ownr_co_nm ? jobs_by_pk.ownr_co_nm.substring(0, 30) - : `${`${jobs_by_pk.ownr_ln || ""} ${ - jobs_by_pk.ownr_fn || "" - }`.substring(0, 30)}`, + : `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}` + .substring(0, 30) + .trim()}`, Addr2: jobs_by_pk.ownr_addr1, Addr3: jobs_by_pk.ownr_addr2, City: jobs_by_pk.ownr_city, diff --git a/server/accounting/qbxml/qbxml-utils.js b/server/accounting/qbxml/qbxml-utils.js index af59b3cf7..8909cbb2a 100644 --- a/server/accounting/qbxml/qbxml-utils.js +++ b/server/accounting/qbxml/qbxml-utils.js @@ -21,9 +21,9 @@ exports.generateOwnerTier = (jobs_by_pk, isThreeTier, twotierpref) => { ? `${jobs_by_pk.ownr_co_nm.substring(0, 30)} #${ jobs_by_pk.owner.accountingid || "" }` - : `${`${jobs_by_pk.ownr_ln || ""} ${ - jobs_by_pk.ownr_fn || "" - }`.substring(0, 30)} #${jobs_by_pk.owner.accountingid || ""}` + : `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}` + .substring(0, 30) + .trim()} #${jobs_by_pk.owner.accountingid || ""}` ) .trim() .replace(":", " "); @@ -39,9 +39,9 @@ exports.generateOwnerTier = (jobs_by_pk, isThreeTier, twotierpref) => { ? `${jobs_by_pk.ownr_co_nm.substring(0, 30)} #${ jobs_by_pk.owner.accountingid || "" }` - : `${`${jobs_by_pk.ownr_ln || ""} ${ - jobs_by_pk.ownr_fn || "" - }`.substring(0, 30)} #${jobs_by_pk.owner.accountingid || ""}` + : `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}` + .substring(0, 30) + .trim()} #${jobs_by_pk.owner.accountingid || ""}` ) .trim() .replace(":", " ");