fix: refs #194195 item_getAtp #2591

Merged
robert merged 2 commits from 194195-hotFixRadarNegativos into master 2024-06-14 12:59:44 +00:00
1 changed files with 6 additions and 5 deletions

View File

@ -20,12 +20,11 @@ BEGIN
SELECT itemFk, warehouseFk, vDated, 0
FROM (SELECT DISTINCT itemFk, warehouseFk FROM tmp.itemCalc) t2
) t1
GROUP BY itemFk, warehouseFk, dated
ORDER BY itemFk, warehouseFk, dated;
GROUP BY itemFk, warehouseFk, dated;
SET @lastItemFk := 0;
SET @lastWareHouseFk := 0;
SET @lastQuantity := 0;
SET @lastItemFk = 0;
SET @lastWareHouseFk = 0;
SET @lastQuantity = 0;
CREATE OR REPLACE TEMPORARY TABLE tmp.itemAtp
(INDEX (itemFk, wareHouseFk))
@ -40,6 +39,8 @@ BEGIN
@lastItemFk := itemFk,
@lastWareHouseFk := wareHouseFk
FROM tItemOrdered
ORDER BY itemFk, warehouseFk, dated
LIMIT 10000000000000000000
)sub
GROUP BY itemFk, wareHouseFk;