feat: refs #7704 Major changes #2717
|
@ -59,8 +59,8 @@ BEGIN
|
|||
SELECT quantity INTO vMinQuantity
|
||||
FROM vn.itemMinimumQuantity
|
||||
WHERE itemFk = vItem
|
||||
AND (util.VN_CURDATE() >= `started`
|
||||
AND (util.VN_CURDATE() <= `ended` OR `ended` IS NULL))
|
||||
AND `started` <= util.VN_CURDATE()
|
||||
guillermo marked this conversation as resolved
Outdated
|
||||
AND (`ended` >= util.VN_CURDATE() OR `ended` IS NULL)
|
||||
AND (warehouseFk = vWarehouse OR warehouseFk IS NULL)
|
||||
LIMIT 1;
|
||||
|
||||
|
|
|
@ -104,8 +104,8 @@ module.exports = Self => {
|
|||
WITH minQuantity AS (
|
||||
SELECT itemFk, quantity, warehouseFk
|
||||
FROM vn.itemMinimumQuantity
|
||||
WHERE (util.VN_CURDATE() BETWEEN started AND ended
|
||||
OR (util.VN_CURDATE() >= started AND ended IS NULL))
|
||||
WHERE started <= util.VN_CURDATE()
|
||||
AND (ended >= util.VN_CURDATE() OR ended IS NULL)
|
||||
GROUP BY itemFk, warehouseFk
|
||||
ORDER BY warehouseFk DESC
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
açò no serà per a hui sera per al dia del pedido, es a dir, si hui fan un pedido per a campanya ha d'agafar si hi ha un min en el futur vShipment