From 80b338228ebc85d65719d726ac208a25320c55a9 Mon Sep 17 00:00:00 2001 From: pablone Date: Tue, 23 Jul 2024 12:29:08 +0200 Subject: [PATCH 1/2] fix: refs #6403 take observation from ticket --- back/methods/mrw-config/createShipment.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/back/methods/mrw-config/createShipment.js b/back/methods/mrw-config/createShipment.js index 4db0d0c7d..8a0eb58b3 100644 --- a/back/methods/mrw-config/createShipment.js +++ b/back/methods/mrw-config/createShipment.js @@ -53,7 +53,7 @@ module.exports = Self => { CONCAT( e.ticketFk, LPAD(e.counter, mc.counterWidth, '0')) reference, LPAD(IF(mw.serviceType IS NULL, ms.serviceType, mw.serviceType), mc.serviceTypeWidth, '0') serviceType, IF(mw.weekdays, 'S', 'N') weekDays, - oa.description deliveryObservation + ta.description deliveryObservation FROM expedition e JOIN ticket t ON e.ticketFk = t.id JOIN agencyMode am ON am.id = t.agencyModeFk @@ -62,8 +62,8 @@ module.exports = Self => { AND mw.weekDays & (1 << WEEKDAY(t.landed)) JOIN client c ON t.clientFk = c.id JOIN address a ON t.addressFk = a.id - LEFT JOIN addressObservation oa ON oa.addressFk = a.id - AND oa.observationTypeFk IN (SELECT id FROM observationType ot WHERE ot.code = 'delivery') + LEFT JOIN ticketObservation ta ON ta.ticketFk = t.id + AND ta.observationTypeFk IN (SELECT id FROM observationType ot WHERE ot.code = 'delivery') JOIN province p ON a.provinceFk = p.id JOIN country co ON co.id = p.countryFk JOIN mrwConfig mc From bdfaf02c959bfaa95ee4d31994e8f08fc729bf13 Mon Sep 17 00:00:00 2001 From: pablone Date: Tue, 23 Jul 2024 13:36:52 +0200 Subject: [PATCH 2/2] fix: refs #6403 fix delivery observation --- back/methods/mrw-config/createShipment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/back/methods/mrw-config/createShipment.js b/back/methods/mrw-config/createShipment.js index 8a0eb58b3..3b91f4486 100644 --- a/back/methods/mrw-config/createShipment.js +++ b/back/methods/mrw-config/createShipment.js @@ -63,7 +63,7 @@ module.exports = Self => { JOIN client c ON t.clientFk = c.id JOIN address a ON t.addressFk = a.id LEFT JOIN ticketObservation ta ON ta.ticketFk = t.id - AND ta.observationTypeFk IN (SELECT id FROM observationType ot WHERE ot.code = 'delivery') + AND ta.observationTypeFk IN (SELECT id FROM observationType ot WHERE ot.code = 'agency') JOIN province p ON a.provinceFk = p.id JOIN country co ON co.id = p.countryFk JOIN mrwConfig mc