From 338906e28896124a6909c6f4ebed69d5661641be Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 5 Nov 2024 11:53:42 -0800 Subject: [PATCH] IO-3018 QBO Standardize name Trim StandardizeName Signed-off-by: Allan Carr --- server/accounting/qbo/qbo-payables.js | 2 +- server/accounting/qbo/qbo.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/accounting/qbo/qbo-payables.js b/server/accounting/qbo/qbo-payables.js index 196520de0..04b0c7e08 100644 --- a/server/accounting/qbo/qbo-payables.js +++ b/server/accounting/qbo/qbo-payables.js @@ -167,7 +167,7 @@ async function QueryVendorRecord(oauthClient, qbo_realmId, req, bill) { async function InsertVendorRecord(oauthClient, qbo_realmId, req, bill) { const Vendor = { - DisplayName: bill.vendor.name + DisplayName: StandardizeName(bill.vendor.name) }; try { const result = await oauthClient.makeApiCall({ diff --git a/server/accounting/qbo/qbo.js b/server/accounting/qbo/qbo.js index 74cc3c742..5c7e9d874 100644 --- a/server/accounting/qbo/qbo.js +++ b/server/accounting/qbo/qbo.js @@ -10,7 +10,7 @@ function urlBuilder(realmId, object, query = null) { } function StandardizeName(str) { - return str.replace(new RegExp(/'/g), "\\'"); + return str.replace(new RegExp(/'/g), "\\'").trim(); } exports.urlBuilder = urlBuilder;