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