7199-devToTest_2316 #2287
|
@ -59,6 +59,8 @@ BEGIN
|
||||||
WHERE saleFk = vSaleFk;
|
WHERE saleFk = vSaleFk;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
|
SELECT vQuantity , vPacking;
|
||||||
|
|
||||||
w1: WHILE vQuantity >= vPacking DO
|
w1: WHILE vQuantity >= vPacking DO
|
||||||
|
|
||||||
SET vItemShelvingFk = NULL;
|
SET vItemShelvingFk = NULL;
|
||||||
|
@ -86,13 +88,13 @@ 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,
|
||||||
userFk = vUserFk,
|
userFk = vUserFk,
|
||||||
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;
|
||||||
|
@ -188,10 +190,12 @@ 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,9 +210,11 @@ 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;
|
WHERE id = vItemShelvingSaleFk;
|
||||||
|
*/
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
INSERT IGNORE INTO saleTracking(saleFk, isChecked, workerFk, stateFk)
|
INSERT IGNORE INTO saleTracking(saleFk, isChecked, workerFk, stateFk)
|
||||||
|
@ -231,7 +237,8 @@ w1: WHILE vQuantity >= vPacking DO
|
||||||
packingSiteFk,
|
packingSiteFk,
|
||||||
monitorId,
|
monitorId,
|
||||||
started,
|
started,
|
||||||
ended
|
ended,
|
||||||
|
counter
|
||||||
)
|
)
|
||||||
SELECT vAgencyModeFk,
|
SELECT vAgencyModeFk,
|
||||||
vNewTicketFk,
|
vNewTicketFk,
|
||||||
|
@ -243,7 +250,8 @@ w1: WHILE vQuantity >= vPacking DO
|
||||||
vPackingSiteFk,
|
vPackingSiteFk,
|
||||||
ps.monitorId,
|
ps.monitorId,
|
||||||
IFNULL(vLastExpeditionTimeStamp, NOW()),
|
IFNULL(vLastExpeditionTimeStamp, NOW()),
|
||||||
NOW()
|
NOW(),
|
||||||
|
0
|
||||||
FROM packingSite ps
|
FROM packingSite ps
|
||||||
JOIN host h ON h.id = ps.hostFk
|
JOIN host h ON h.id = ps.hostFk
|
||||||
JOIN item i ON i.name = 'Shipping cost'
|
JOIN item i ON i.name = 'Shipping cost'
|
||||||
|
|
|
@ -86,7 +86,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 +94,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 +188,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,9 +206,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;
|
||||||
|
|
||||||
INSERT IGNORE INTO saleTracking(saleFk, isChecked, workerFk, stateFk)
|
INSERT IGNORE INTO saleTracking(saleFk, isChecked, workerFk, stateFk)
|
||||||
|
|
Loading…
Reference in New Issue