7953-devToTest_2438 #2942
|
@ -165,7 +165,7 @@ BEGIN
|
||||||
OR (NOT pb.H AND pb.V > 0 AND vItemPackingTypeFk = 'H')
|
OR (NOT pb.H AND pb.V > 0 AND vItemPackingTypeFk = 'H')
|
||||||
OR (NOT pb.V AND vItemPackingTypeFk = 'V')
|
OR (NOT pb.V AND vItemPackingTypeFk = 'V')
|
||||||
OR (pc.isPreviousPreparationRequired AND pb.previousWithoutParking)
|
OR (pc.isPreviousPreparationRequired AND pb.previousWithoutParking)
|
||||||
OR LENGTH(pb.problem) > 0
|
OR LENGTH(pb.problem)
|
||||||
OR pb.lines > vLinesLimit
|
OR pb.lines > vLinesLimit
|
||||||
OR pb.m3 > vVolumeLimit
|
OR pb.m3 > vVolumeLimit
|
||||||
OR sub.maxSize > vSizeLimit;
|
OR sub.maxSize > vSizeLimit;
|
||||||
|
|
|
@ -26,7 +26,7 @@ BEGIN
|
||||||
LEAVE myLoop;
|
LEAVE myLoop;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
CALL vn.ticket_mergeSales(vTicketFk);
|
CALL ticket_mergeSales(vTicketFk);
|
||||||
|
|
||||||
END LOOP;
|
END LOOP;
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ BEGIN
|
||||||
|
|
||||||
DECLARE vItemPackingTypes CURSOR FOR
|
DECLARE vItemPackingTypes CURSOR FOR
|
||||||
SELECT DISTINCT itemPackingTypeFk
|
SELECT DISTINCT itemPackingTypeFk
|
||||||
FROM tmp.salesToMove;
|
FROM tSalesToMove;
|
||||||
|
|
||||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||||
|
|
||||||
|
@ -33,13 +33,13 @@ BEGIN
|
||||||
CALL util.throw('The ticket has not sales with the itemPackingType');
|
CALL util.throw('The ticket has not sales with the itemPackingType');
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tmp.salesToMove (
|
CREATE OR REPLACE TEMPORARY TABLE tSalesToMove (
|
||||||
ticketFk INT,
|
ticketFk INT,
|
||||||
saleFk INT,
|
saleFk INT,
|
||||||
itemPackingTypeFk INT
|
itemPackingTypeFk INT
|
||||||
) ENGINE=MEMORY;
|
) ENGINE=MEMORY;
|
||||||
|
|
||||||
INSERT INTO tmp.salesToMove (saleFk, itemPackingTypeFk)
|
INSERT INTO tSalesToMove (saleFk, itemPackingTypeFk)
|
||||||
SELECT s.id, i.itemPackingTypeFk
|
SELECT s.id, i.itemPackingTypeFk
|
||||||
FROM ticket t
|
FROM ticket t
|
||||||
JOIN sale s ON s.ticketFk = t.id
|
JOIN sale s ON s.ticketFk = t.id
|
||||||
|
@ -59,7 +59,7 @@ BEGIN
|
||||||
|
|
||||||
CALL ticket_Clone(vSelf, vNewTicketFk);
|
CALL ticket_Clone(vSelf, vNewTicketFk);
|
||||||
|
|
||||||
UPDATE tmp.salesToMove
|
UPDATE tSalesToMove
|
||||||
SET ticketFk = vNewTicketFk
|
SET ticketFk = vNewTicketFk
|
||||||
WHERE itemPackingTypeFk = vItemPackingTypeFk;
|
WHERE itemPackingTypeFk = vItemPackingTypeFk;
|
||||||
|
|
||||||
|
@ -68,10 +68,10 @@ BEGIN
|
||||||
CLOSE vItemPackingTypes;
|
CLOSE vItemPackingTypes;
|
||||||
|
|
||||||
UPDATE sale s
|
UPDATE sale s
|
||||||
JOIN tmp.salesToMove stm ON stm.saleFk = s.id
|
JOIN tSalesToMove stm ON stm.saleFk = s.id
|
||||||
SET s.ticketFk = stm.ticketFk
|
SET s.ticketFk = stm.ticketFk
|
||||||
WHERE stm.ticketFk;
|
WHERE stm.ticketFk;
|
||||||
|
|
||||||
DROP TEMPORARY TABLE tmp.salesToMove;
|
DROP TEMPORARY TABLE tSalesToMove;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
Loading…
Reference in New Issue