diff --git a/server/data/arms.js b/server/data/arms.js index 0518b139c..1a24c7b0a 100644 --- a/server/data/arms.js +++ b/server/data/arms.js @@ -57,10 +57,10 @@ exports.default = async (req, res) => { TransmitDateTime: moment().format(momentFormat), // Omitted from ARMS docs }, EventInfo: { - // AssignmentEvent: { - // CreateDateTime: - // job.asgn_date && moment(job.asgn_date).format(momentFormat), - // }, + AssignmentEvent: { + CreateDateTime: + job.asgn_date && moment(job.asgn_date).format(momentFormat), + }, // EstimateEvent: { // UploadDateTime: moment().format(momentFormat), // }, @@ -258,9 +258,9 @@ exports.default = async (req, res) => { VINNum: job.v_vin, }, }, - // License: { - // LicensePlateNum: job.plate_no, - // }, + License: { + LicensePlateNum: job.plate_no, + }, VehicleDesc: { //ProductionDate: "2009-10", ModelYear: @@ -845,7 +845,7 @@ exports.default = async (req, res) => { const entegralResponse = await entegralSoapClient.RepairOrderFolderAddRqAsync( - jobsToPush, + [jobsToPush[0]], function (err, result, rawResponse, soapHeader, rawRequest) { fs.writeFileSync(`./logs/arms-request.xml`, rawRequest); fs.writeFileSync(`./logs/arms-response.xml`, rawResponse); @@ -910,10 +910,13 @@ function GetDocumentstatus(job, bodyshop) { function GetRepairStatusCode(job) { return "25"; } + function GetProductionStageCode(job, bodyshop) { - if (bodyshop.md_ro_statuses.post_production_statuses.includes(job.status)) - return "8D"; - return "33"; + const result = (bodyshop.features?.entegral).find( + (k) => k.status === job.status + ); + + return result?.code || "33"; } function isEmpty(obj) { diff --git a/server/graphql-client/queries.js b/server/graphql-client/queries.js index 0aff88b91..7a01b8a85 100644 --- a/server/graphql-client/queries.js +++ b/server/graphql-client/queries.js @@ -1323,6 +1323,7 @@ exports.GET_ENTEGRAL_SHOPS = `query GET_AUTOHOUSE_SHOPS { md_responsibility_centers imexshopid timezone + features } } `;