7199-devToTest_2316 #2287
|
@ -61,6 +61,8 @@ BEGIN
|
||||||
|
|
||||||
w1: WHILE vQuantity >= vPacking DO
|
w1: WHILE vQuantity >= vPacking DO
|
||||||
|
|
||||||
|
SET vQuantity = vQuantity - vPacking;
|
||||||
|
|
||||||
SET vItemShelvingFk = NULL;
|
SET vItemShelvingFk = NULL;
|
||||||
|
|
||||||
SELECT sub.id
|
SELECT sub.id
|
||||||
|
@ -86,7 +88,7 @@ w1: WHILE vQuantity >= vPacking DO
|
||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
|
|
||||||
IF vItemShelvingFk THEN
|
IF vItemShelvingFk THEN
|
||||||
/* INSERT INTO itemShelvingSale
|
INSERT INTO itemShelvingSale
|
||||||
SET itemShelvingFk = vItemShelvingFk,
|
SET itemShelvingFk = vItemShelvingFk,
|
||||||
saleFk = vSaleFk,
|
saleFk = vSaleFk,
|
||||||
quantity = vPacking,
|
quantity = vPacking,
|
||||||
|
@ -94,7 +96,7 @@ w1: WHILE vQuantity >= vPacking DO
|
||||||
isPicked = TRUE;
|
isPicked = TRUE;
|
||||||
|
|
||||||
SET vItemShelvingSaleFk = LAST_INSERT_ID();
|
SET vItemShelvingSaleFk = LAST_INSERT_ID();
|
||||||
*/
|
|
||||||
UPDATE sale SET isPicked = FALSE WHERE id = vSaleFk;
|
UPDATE sale SET isPicked = FALSE WHERE id = vSaleFk;
|
||||||
ELSE
|
ELSE
|
||||||
LEAVE w1;
|
LEAVE w1;
|
||||||
|
@ -188,10 +190,10 @@ w1: WHILE vQuantity >= vPacking DO
|
||||||
WHERE id = vItemShelvingSaleFk;
|
WHERE id = vItemShelvingSaleFk;
|
||||||
|
|
||||||
SET vItemShelvingSaleFk = vItemShelvingSaleFk_old;
|
SET vItemShelvingSaleFk = vItemShelvingSaleFk_old;
|
||||||
/* ELSE
|
ELSE
|
||||||
UPDATE itemShelvingSale
|
UPDATE itemShelvingSale
|
||||||
SET saleFk = vNewSaleFk
|
SET saleFk = vNewSaleFk
|
||||||
WHERE id = vItemShelvingSaleFk; */
|
WHERE id = vItemShelvingSaleFk;
|
||||||
END IF;
|
END IF;
|
||||||
ELSE
|
ELSE
|
||||||
INSERT INTO sale(ticketFk, itemFk, concept, quantity, discount, price)
|
INSERT INTO sale(ticketFk, itemFk, concept, quantity, discount, price)
|
||||||
|
@ -206,8 +208,9 @@ w1: WHILE vQuantity >= vPacking DO
|
||||||
FROM saleComponent
|
FROM saleComponent
|
||||||
WHERE saleFk = vSaleFk;
|
WHERE saleFk = vSaleFk;
|
||||||
|
|
||||||
/* UPDATE itemShelvingSale
|
UPDATE itemShelvingSale
|
||||||
SET saleFk = vNewSaleFk */
|
SET saleFk = vNewSaleFk
|
||||||
|
WHERE id = vItemShelvingSaleFk;
|
||||||
|
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
|
@ -277,6 +280,7 @@ w1: WHILE vQuantity >= vPacking DO
|
||||||
DELETE FROM sale
|
DELETE FROM sale
|
||||||
WHERE quantity = 0
|
WHERE quantity = 0
|
||||||
AND id = vSaleFk;
|
AND id = vSaleFk;
|
||||||
|
|
||||||
END WHILE;
|
END WHILE;
|
||||||
|
|
||||||
END$$
|
END$$
|
||||||
|
|
Loading…
Reference in New Issue