From a0a8a22ab0e6c5550bf9b8c9758644336335c37a Mon Sep 17 00:00:00 2001 From: sergiodt Date: Mon, 30 Sep 2024 11:13:12 +0200 Subject: [PATCH] fix: refs #5320 withoutHaving --- db/routines/vn/procedures/collectionPlacement_get.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db/routines/vn/procedures/collectionPlacement_get.sql b/db/routines/vn/procedures/collectionPlacement_get.sql index e302f8d3c..239dbd3a2 100644 --- a/db/routines/vn/procedures/collectionPlacement_get.sql +++ b/db/routines/vn/procedures/collectionPlacement_get.sql @@ -80,7 +80,8 @@ BEGIN FROM saleTracking st JOIN state s ON s.id = st.stateFk WHERE st.isChecked - AND s.semaphore = 1) st ON st.saleFk = ts.saleFk + AND s.semaphore = 1 + GROUP BY st.saleFk) st ON st.saleFk = ts.saleFk JOIN itemShelving ish ON ish.itemFk = ts.itemFk JOIN shelving sh ON sh.code = ish.shelvingFk JOIN parking p ON p.id = sh.parkingFk @@ -96,8 +97,7 @@ BEGIN LEFT JOIN parking p2 ON p2.id = sg.parkingFk WHERE w.id = vWarehouseFk AND NOT sc.isHideForPickers - AND ((iss.id AND st.saleFk) OR st.saleFk IS NULL) - GROUP BY st.saleFk, created; + AND ((iss.id AND st.saleFk) OR st.saleFk IS NULL); CREATE OR REPLACE TEMPORARY TABLE tSalePlacementList2 (INDEX(saleFk), INDEX(olderPriority))