From a0b238c4bb867a5576217d5773253b0f6fc811c4 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 6 Jun 2022 12:20:32 -0700 Subject: [PATCH] IO-1841 Remove special characters on QB Export. --- .../scoreboard-timetickets.stats.component.jsx | 2 +- server/accounting/qbo/qbo-receivables.js | 5 +++-- server/accounting/qbxml/qbxml-utils.js | 12 ++++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/client/src/components/scoreboard-timetickets/scoreboard-timetickets.stats.component.jsx b/client/src/components/scoreboard-timetickets/scoreboard-timetickets.stats.component.jsx index 8b521e990..6d2183a54 100644 --- a/client/src/components/scoreboard-timetickets/scoreboard-timetickets.stats.component.jsx +++ b/client/src/components/scoreboard-timetickets/scoreboard-timetickets.stats.component.jsx @@ -1,4 +1,4 @@ -import { Card, Col, Row, Space, Statistic, Table, Typography } from "antd"; +import { Card, Col, Row, Statistic, Table, Typography } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; diff --git a/server/accounting/qbo/qbo-receivables.js b/server/accounting/qbo/qbo-receivables.js index bab135c25..fec6a15c9 100644 --- a/server/accounting/qbo/qbo-receivables.js +++ b/server/accounting/qbo/qbo-receivables.js @@ -211,7 +211,7 @@ async function QueryInsuranceCo(oauthClient, qbo_realmId, req, job) { qbo_realmId, "query", `select * From Customer where DisplayName = '${StandardizeName( - job.ins_co_nm + job.ins_co_nm.trim() )}'` ), method: "POST", @@ -239,7 +239,7 @@ async function InsertInsuranceCo(oauthClient, qbo_realmId, req, job, bodyshop) { const insCo = bodyshop.md_ins_cos.find((i) => i.name === job.ins_co_nm); const Customer = { - DisplayName: job.ins_co_nm, + DisplayName: job.ins_co_nm.trim(), BillWithParent: true, BillAddr: { City: job.ownr_city, @@ -269,6 +269,7 @@ async function InsertInsuranceCo(oauthClient, qbo_realmId, req, job, bodyshop) { } } exports.InsertInsuranceCo = InsertInsuranceCo; + async function QueryOwner(oauthClient, qbo_realmId, req, job) { const ownerName = generateOwnerTier(job, true, null); const result = await oauthClient.makeApiCall({ diff --git a/server/accounting/qbxml/qbxml-utils.js b/server/accounting/qbxml/qbxml-utils.js index 3cee63ca8..af59b3cf7 100644 --- a/server/accounting/qbxml/qbxml-utils.js +++ b/server/accounting/qbxml/qbxml-utils.js @@ -6,11 +6,11 @@ exports.addQbxmlHeader = addQbxmlHeader = (xml) => { }; exports.generateSourceTier = (jobs_by_pk) => { - return jobs_by_pk.ins_co_nm && jobs_by_pk.ins_co_nm.trim(); + return jobs_by_pk.ins_co_nm && jobs_by_pk.ins_co_nm.trim().replace(":", " "); }; exports.generateJobTier = (jobs_by_pk) => { - return jobs_by_pk.ro_number && jobs_by_pk.ro_number.trim(); + return jobs_by_pk.ro_number && jobs_by_pk.ro_number.trim().replace(":", " "); }; exports.generateOwnerTier = (jobs_by_pk, isThreeTier, twotierpref) => { @@ -24,7 +24,9 @@ exports.generateOwnerTier = (jobs_by_pk, isThreeTier, twotierpref) => { : `${`${jobs_by_pk.ownr_ln || ""} ${ jobs_by_pk.ownr_fn || "" }`.substring(0, 30)} #${jobs_by_pk.owner.accountingid || ""}` - ).trim(); + ) + .trim() + .replace(":", " "); } else { //What's the 2 tier pref? if (twotierpref === "source") { @@ -40,7 +42,9 @@ exports.generateOwnerTier = (jobs_by_pk, isThreeTier, twotierpref) => { : `${`${jobs_by_pk.ownr_ln || ""} ${ jobs_by_pk.ownr_fn || "" }`.substring(0, 30)} #${jobs_by_pk.owner.accountingid || ""}` - ).trim(); + ) + .trim() + .replace(":", " "); } } };