From d51c9fc12061bd612fd48697fe22ad4decfaf108 Mon Sep 17 00:00:00 2001 From: pablone Date: Mon, 20 May 2024 12:14:59 +0200 Subject: [PATCH] fix: refs #6404 fix cancel shipment --- back/methods/mrw-config/cancelShipment.js | 4 ++-- back/methods/mrw-config/createShipment.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/back/methods/mrw-config/cancelShipment.js b/back/methods/mrw-config/cancelShipment.js index 218b6a96b..dd33694ea 100644 --- a/back/methods/mrw-config/cancelShipment.js +++ b/back/methods/mrw-config/cancelShipment.js @@ -39,8 +39,8 @@ module.exports = Self => { const xmlString = response.data; const parser = new DOMParser(); const xmlDoc = parser.parseFromString(xmlString, 'text/xml'); - const [resultElement] = xmlDoc.getElementsByTagName('Mensaje'); + const resultElement = xmlDoc.getElementsByTagName('Mensaje')[0].textContent; - return resultElement.textContent; + return resultElement; }; }; diff --git a/back/methods/mrw-config/createShipment.js b/back/methods/mrw-config/createShipment.js index 12263de03..7d226a5bc 100644 --- a/back/methods/mrw-config/createShipment.js +++ b/back/methods/mrw-config/createShipment.js @@ -42,7 +42,8 @@ module.exports = Self => { throw new UserError(`Some mrwConfig parameters are not set`); const query = - `SELECT CASE co.code + `SELECT + CASE co.code WHEN 'ES' THEN a.postalCode WHEN 'PT' THEN LEFT(a.postalCode, 4) WHEN 'AD' THEN REPLACE(a.postalCode, 'AD', '00')