This commit is contained in:
parent
02bcfd9be3
commit
61a746c2d8
|
@ -56,8 +56,8 @@ BEGIN
|
|||
CALL util.throw ('ORDER_ROW_UNAVAILABLE');
|
||||
END IF;
|
||||
|
||||
SELECT quantity
|
||||
FROM vn.itemMinimalQuantity
|
||||
SELECT quantity INTO vMinQuantity
|
||||
FROM vn.itemMinimumQuantity
|
||||
WHERE itemFk = vItem
|
||||
AND (
|
||||
util.VN_CURDATE() BETWEEN `started` AND `ended`
|
||||
|
|
|
@ -103,7 +103,7 @@ module.exports = Self => {
|
|||
stmt = new ParameterizedSQL(`
|
||||
WITH minQuantity AS (
|
||||
SELECT itemFk, quantity, warehouseFk
|
||||
FROM vn.itemMinimalQuantity
|
||||
FROM vn.itemMinimumQuantity
|
||||
WHERE (util.VN_CURDATE() BETWEEN started AND ended
|
||||
OR (util.VN_CURDATE() >= started AND ended IS NULL))
|
||||
GROUP BY itemFk, warehouseFk
|
||||
|
|
Loading…
Reference in New Issue