fix: refs #194195 item_getAtp #2591
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue