From 0f17c082a317bb66341d4194966ee0a19f592ef5 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Fri, 18 Nov 2022 12:07:33 +0100 Subject: [PATCH] refs #4557 @1h left join note only delivery --- modules/route/back/methods/route/getTickets.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/route/back/methods/route/getTickets.js b/modules/route/back/methods/route/getTickets.js index 72df91158..81b4c5781 100644 --- a/modules/route/back/methods/route/getTickets.js +++ b/modules/route/back/methods/route/getTickets.js @@ -32,7 +32,7 @@ module.exports = Self => { Object.assign(myOptions, options); const stmt = new ParameterizedSQL( - `SELECT DISTINCT + `SELECT t.id, t.packages, t.warehouseFk, @@ -56,7 +56,7 @@ module.exports = Self => { LEFT JOIN ticketState ts ON ts.ticketFk = t.id LEFT JOIN state st ON st.id = ts.stateFk LEFT JOIN warehouse wh ON wh.id = t.warehouseFk - LEFT JOIN ticketObservation tob ON tob.ticketFk = t.id + LEFT JOIN ticketObservation tob ON tob.ticketFk = t.id AND tob.observationTypeFk = 3 LEFT JOIN observationType ot ON tob.observationTypeFk = ot.id AND ot.code = 'delivery' LEFT JOIN address a ON a.id = t.addressFk