diff --git a/server/data/autohouse.js b/server/data/autohouse.js index 64a7bf6cd..bed1e2a1f 100644 --- a/server/data/autohouse.js +++ b/server/data/autohouse.js @@ -125,9 +125,9 @@ const CreateRepairOrderTag = (job, errorCallback) => { const ret = { RepairOrderInformation: { ShopInternalName: job.bodyshop.autohouseid, - ID: job.id, + ID: parseInt(job.ro_number.match(/\d/g).join(""), 10), RO: job.ro_number, - Est: job.id, //We no longer use estimate id. + Est: parseInt(job.ro_number.match(/\d/g).join(""), 10), //We no longer use estimate id. GUID: job.id, TransType: StatusMapping(job.status, job.bodyshop.md_ro_statuses), ShopName: job.bodyshop.shopname, @@ -136,8 +136,12 @@ const CreateRepairOrderTag = (job, errorCallback) => { ShopState: job.bodyshop.state, ShopZip: job.bodyshop.zip_post, ShopPhone: job.bodyshop.phone, - EstimatorID: `${job.est_ct_fn || ""} ${job.est_ct_ln || ""}`, - EstimatorName: `${job.est_ct_fn || ""} ${job.est_ct_ln || ""}`, + EstimatorID: `${job.est_ct_ln ? job.est_ct_ln : ""}${ + job.est_ct_ln ? ", " : "" + }${job.est_ct_fn ? job.est_ct_fn : ""}`, + EstimatorName: `${job.est_ct_ln ? job.est_ct_ln : ""}${ + job.est_ct_ln ? ", " : "" + }${job.est_ct_fn ? job.est_ct_fn : ""}`, }, CustomerInformation: { FirstName: job.ownr_fn, diff --git a/server/graphql-client/queries.js b/server/graphql-client/queries.js index 62a7eb4d9..d9d66aeca 100644 --- a/server/graphql-client/queries.js +++ b/server/graphql-client/queries.js @@ -358,7 +358,7 @@ exports.QUERY_EMPLOYEE_PIN = `query QUERY_EMPLOYEE_PIN($shopId: uuid!, $employee }`; exports.AUTOHOUSE_QUERY = `query AUTOHOUSE_EXPORT($start: timestamptz, $bodyshopid: uuid!) { - jobs(where: {_and: [{updated_at: {_gt: $start}}, {shopid: {_eq: $bodyshopid}}]}) { + jobs(where: {_and: [{converted :{_eq: true}},{updated_at: {_gt: $start}}, {shopid: {_eq: $bodyshopid}}]}) { id ro_number status