This commit is contained in:
parent
e2f50d63f6
commit
7cff014988
|
@ -14,14 +14,14 @@ BEGIN
|
|||
DECLARE vPickingOrderTo INT;
|
||||
|
||||
SELECT p.sectorFk, p.pickingOrder INTO vSectorFk, vPickingOrderFrom
|
||||
FROM vn.parking p
|
||||
FROM parking p
|
||||
WHERE p.code = vParkingFromFk COLLATE 'utf8mb3_general_ci';
|
||||
|
||||
SELECT p.pickingOrder INTO vPickingOrderTo
|
||||
FROM vn.parking p
|
||||
FROM parking p
|
||||
WHERE p.code = vParkingToFk COLLATE 'utf8mb3_general_ci';
|
||||
|
||||
CALL vn.visible_getMisfit(vSectorFk);
|
||||
CALL visible_getMisfit(vSectorFk);
|
||||
|
||||
SELECT ish.id,
|
||||
p.pickingOrder,
|
||||
|
@ -39,19 +39,19 @@ BEGIN
|
|||
WHEN sm.visible > sm.parked THEN 1
|
||||
ELSE 2
|
||||
END priority
|
||||
FROM vn.itemShelving ish
|
||||
JOIN vn.item i ON i.id = ish.itemFk
|
||||
JOIN vn.itemType it ON it.id = i.typeFk
|
||||
FROM itemShelving ish
|
||||
JOIN item i ON i.id = ish.itemFk
|
||||
JOIN itemType it ON it.id = i.typeFk
|
||||
JOIN tmp.stockMisfit sm ON sm.itemFk = ish.itemFk
|
||||
JOIN vn.shelving sh ON sh.code = ish.shelvingFk
|
||||
JOIN vn.parking p ON p.id = sh.parkingFk
|
||||
JOIN shelving sh ON sh.code = ish.shelvingFk
|
||||
JOIN parking p ON p.id = sh.parkingFk
|
||||
JOIN (SELECT s.itemFk, sum(s.quantity) notPrepared
|
||||
FROM vn.sale s
|
||||
JOIN vn.ticket t ON t.id = s.ticketFk
|
||||
JOIN vn.warehouse w ON w.id = t.warehouseFk
|
||||
JOIN vn.config c ON c.mainWarehouseFk = w.id
|
||||
FROM sale s
|
||||
JOIN ticket t ON t.id = s.ticketFk
|
||||
JOIN warehouse w ON w.id = t.warehouseFk
|
||||
JOIN config c ON c.mainWarehouseFk = w.id
|
||||
WHERE t.shipped BETWEEN util.VN_CURDATE()
|
||||
AND util.VN_CURDATE() + INTERVAL 23 HOUR
|
||||
AND util.dayEnd(util.VN_CURDATE())
|
||||
AND s.isPicked = FALSE
|
||||
GROUP BY s.itemFk) s ON s.itemFk = i.id
|
||||
JOIN hedera.imageConfig ic
|
||||
|
|
Loading…
Reference in New Issue