feat: refs #7704 Minor changes
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-07-11 11:28:00 +02:00
parent 2e48263636
commit 90802bd330
2 changed files with 4 additions and 4 deletions

View File

@ -59,8 +59,8 @@ BEGIN
SELECT quantity INTO vMinQuantity SELECT quantity INTO vMinQuantity
FROM vn.itemMinimumQuantity FROM vn.itemMinimumQuantity
WHERE itemFk = vItem WHERE itemFk = vItem
AND (util.VN_CURDATE() >= `started` AND `started` <= util.VN_CURDATE()
AND (util.VN_CURDATE() <= `ended` OR `ended` IS NULL)) AND (`ended` >= util.VN_CURDATE() OR `ended` IS NULL)
AND (warehouseFk = vWarehouse OR warehouseFk IS NULL) AND (warehouseFk = vWarehouse OR warehouseFk IS NULL)
LIMIT 1; LIMIT 1;

View File

@ -104,8 +104,8 @@ module.exports = Self => {
WITH minQuantity AS ( WITH minQuantity AS (
SELECT itemFk, quantity, warehouseFk SELECT itemFk, quantity, warehouseFk
FROM vn.itemMinimumQuantity FROM vn.itemMinimumQuantity
WHERE (util.VN_CURDATE() BETWEEN started AND ended WHERE started <= util.VN_CURDATE()
OR (util.VN_CURDATE() >= started AND ended IS NULL)) AND (ended >= util.VN_CURDATE() OR ended IS NULL)
GROUP BY itemFk, warehouseFk GROUP BY itemFk, warehouseFk
ORDER BY warehouseFk DESC ORDER BY warehouseFk DESC
) )