diff --git a/back/methods/mrw-config/createShipment.js b/back/methods/mrw-config/createShipment.js index 4db0d0c7d..3b91f4486 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 = 'agency') JOIN province p ON a.provinceFk = p.id JOIN country co ON co.id = p.countryFk JOIN mrwConfig mc