From 707173d6184c9f7dbe663d69e3dd2e2fb4042c79 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Wed, 22 Nov 2023 07:04:33 +0100 Subject: [PATCH 1/2] refs #5890 fix: getTickets --- back/methods/collection/getTickets.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/back/methods/collection/getTickets.js b/back/methods/collection/getTickets.js index f04822697..cfd404beb 100644 --- a/back/methods/collection/getTickets.js +++ b/back/methods/collection/getTickets.js @@ -74,8 +74,8 @@ module.exports = Self => { LEFT JOIN parking p ON p.id = sh.parkingFk LEFT JOIN itemColor ic ON ic.itemFk = s.itemFk LEFT JOIN origin o ON o.id = i.originFk - WHERE tc.collectionFk = ? - GROUP BY ish.id, p.code, p2.code + WHERE tc.collectionFk = ? AND iss.quantity IS NOT NULL + GROUP BY s.id, ish.id, p.code, p2.code ORDER BY pickingOrder;`, [id], myOptions); if (print) From 4735307f5d439d25ac3d4a476a01a77399613c80 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 23 Nov 2023 11:49:00 +0100 Subject: [PATCH 2/2] refs #5890: fix(Collection/getTickets): accepts iss.quantity nulls --- back/methods/collection/getTickets.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/back/methods/collection/getTickets.js b/back/methods/collection/getTickets.js index cfd404beb..50117b954 100644 --- a/back/methods/collection/getTickets.js +++ b/back/methods/collection/getTickets.js @@ -49,7 +49,7 @@ module.exports = Self => { ish.packing, ish.grouping, s.isAdded, - s.originalQuantity, + s.originalQuantity, s.quantity saleQuantity, iss.quantity reservedQuantity, SUM(iss.quantity) OVER (PARTITION BY s.id ORDER BY ish.id) accumulatedQuantity, @@ -74,7 +74,7 @@ module.exports = Self => { LEFT JOIN parking p ON p.id = sh.parkingFk LEFT JOIN itemColor ic ON ic.itemFk = s.itemFk LEFT JOIN origin o ON o.id = i.originFk - WHERE tc.collectionFk = ? AND iss.quantity IS NOT NULL + WHERE tc.collectionFk = ? GROUP BY s.id, ish.id, p.code, p2.code ORDER BY pickingOrder;`, [id], myOptions); @@ -105,7 +105,7 @@ module.exports = Self => { LEFT JOIN vn.buy c ON c.itemFk = s.itemFk LEFT JOIN vn.entry e ON e.id = c.entryFk LEFT JOIN vn.travel tr ON tr.id = e.travelFk - WHERE s.ticketFk = ? + WHERE s.ticketFk = ? AND tr.landed >= util.VN_CURDATE() - INTERVAL 1 YEAR`, [ticketId], myOptions); ticket.sales = [];