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
Showing only changes of commit df6de7e74c - Show all commits

View File

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