This commit is contained in:
parent
7a557be09a
commit
c8e7706652
|
@ -13,7 +13,7 @@ BEGIN
|
||||||
DECLARE vWarehouseFk SMALLINT;
|
DECLARE vWarehouseFk SMALLINT;
|
||||||
DECLARE vDate DATE;
|
DECLARE vDate DATE;
|
||||||
DECLARE vGrouping INT;
|
DECLARE vGrouping INT;
|
||||||
DECLARE vGroupingModeFk VARCHAR(255);
|
DECLARE vGroupingMode VARCHAR(255);
|
||||||
DECLARE vPacking INT;
|
DECLARE vPacking INT;
|
||||||
DECLARE vRoundQuantity INT DEFAULT 1;
|
DECLARE vRoundQuantity INT DEFAULT 1;
|
||||||
DECLARE vLanded DATE;
|
DECLARE vLanded DATE;
|
||||||
|
@ -56,15 +56,15 @@ BEGIN
|
||||||
CALL buyUltimate(vWarehouseFk, vDate);
|
CALL buyUltimate(vWarehouseFk, vDate);
|
||||||
|
|
||||||
SELECT `grouping`, groupingMode, packing
|
SELECT `grouping`, groupingMode, packing
|
||||||
INTO vGrouping,vGroupingModeFk,vPacking
|
INTO vGrouping,vGroupingMode,vPacking
|
||||||
FROM buy b
|
FROM buy b
|
||||||
JOIN tmp.buyUltimate tmp ON b.id = tmp.buyFk
|
JOIN tmp.buyUltimate tmp ON b.id = tmp.buyFk
|
||||||
WHERE tmp.itemFk = vNewItemFk AND tmp.WarehouseFk = vWarehouseFk;
|
WHERE tmp.itemFk = vNewItemFk AND tmp.WarehouseFk = vWarehouseFk;
|
||||||
|
|
||||||
IF vGroupingModeFk = 'packing' AND vPacking > 0 THEN
|
IF vGroupingMode = 'packing' AND vPacking > 0 THEN
|
||||||
SET vRoundQuantity = vPacking;
|
SET vRoundQuantity = vPacking;
|
||||||
END IF;
|
END IF;
|
||||||
IF vGroupingModeFk = 'grouping' AND vGrouping > 0 THEN
|
IF vGroupingMode = 'grouping' AND vGrouping > 0 THEN
|
||||||
SET vRoundQuantity = vGrouping;
|
SET vRoundQuantity = vGrouping;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue