7691-testToMaster #2703
|
@ -37,12 +37,12 @@ proc: BEGIN
|
||||||
IF(pc.orderMode = 'Location', p.pickingOrder, ish.created);
|
IF(pc.orderMode = 'Location', p.pickingOrder, ish.created);
|
||||||
|
|
||||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||||
/* DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||||
BEGIN
|
BEGIN
|
||||||
ROLLBACK;
|
ROLLBACK;
|
||||||
RESIGNAL;
|
RESIGNAL;
|
||||||
END;
|
END;
|
||||||
*/
|
|
||||||
SELECT MAX(p.pickingOrder), s.quantity - SUM(IFNULL(iss.quantity, 0))
|
SELECT MAX(p.pickingOrder), s.quantity - SUM(IFNULL(iss.quantity, 0))
|
||||||
INTO vLastPickingOrder, vOutStanding
|
INTO vLastPickingOrder, vOutStanding
|
||||||
FROM sale s
|
FROM sale s
|
||||||
|
@ -67,6 +67,8 @@ proc: BEGIN
|
||||||
LEAVE l;
|
LEAVE l;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
|
START TRANSACTION;
|
||||||
|
|
||||||
SELECT id INTO vItemShelvingFk
|
SELECT id INTO vItemShelvingFk
|
||||||
FROM itemShelving
|
FROM itemShelving
|
||||||
WHERE id = vItemShelvingFk
|
WHERE id = vItemShelvingFk
|
||||||
|
@ -76,7 +78,6 @@ proc: BEGIN
|
||||||
SET vOutStanding = vOutStanding - vReservedQuantity;
|
SET vOutStanding = vOutStanding - vReservedQuantity;
|
||||||
|
|
||||||
IF vReservedQuantity > 0 THEN
|
IF vReservedQuantity > 0 THEN
|
||||||
-- START TRANSACTION;
|
|
||||||
|
|
||||||
INSERT INTO itemShelvingSale(
|
INSERT INTO itemShelvingSale(
|
||||||
itemShelvingFk,
|
itemShelvingFk,
|
||||||
|
@ -92,8 +93,9 @@ proc: BEGIN
|
||||||
SET available = available - vReservedQuantity
|
SET available = available - vReservedQuantity
|
||||||
WHERE id = vItemShelvingFk;
|
WHERE id = vItemShelvingFk;
|
||||||
|
|
||||||
-- COMMIT;
|
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
END LOOP;
|
END LOOP;
|
||||||
CLOSE vItemShelvingAvailable;
|
CLOSE vItemShelvingAvailable;
|
||||||
END$$
|
END$$
|
||||||
|
|
Loading…
Reference in New Issue