fixes: refs #7760 collection problems #2888
|
@ -165,7 +165,7 @@ BEGIN
|
|||
OR (NOT pb.H AND pb.V > 0 AND vItemPackingTypeFk = 'H')
|
||||
OR (NOT pb.V AND vItemPackingTypeFk = 'V')
|
||||
OR (pc.isPreviousPreparationRequired AND pb.previousWithoutParking)
|
||||
OR LENGTH(pb.problem) > 0
|
||||
OR LENGTH(pb.problem)
|
||||
OR pb.lines > vLinesLimit
|
||||
OR pb.m3 > vVolumeLimit
|
||||
OR sub.maxSize > vSizeLimit;
|
||||
|
|
|
@ -26,7 +26,7 @@ BEGIN
|
|||
LEAVE myLoop;
|
||||
END IF;
|
||||
|
||||
CALL vn.ticket_mergeSales(vTicketFk);
|
||||
CALL ticket_mergeSales(vTicketFk);
|
||||
|
||||
END LOOP;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ BEGIN
|
|||
|
||||
DECLARE vItemPackingTypes CURSOR FOR
|
||||
SELECT DISTINCT itemPackingTypeFk
|
||||
FROM tmp.salesToMove;
|
||||
FROM tSalesToMove;
|
||||
|
||||
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');
|
||||
END IF;
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.salesToMove (
|
||||
CREATE OR REPLACE TEMPORARY TABLE tSalesToMove (
|
||||
ticketFk INT,
|
||||
saleFk INT,
|
||||
itemPackingTypeFk INT
|
||||
) ENGINE=MEMORY;
|
||||
|
||||
INSERT INTO tmp.salesToMove (saleFk, itemPackingTypeFk)
|
||||
INSERT INTO tSalesToMove (saleFk, itemPackingTypeFk)
|
||||
SELECT s.id, i.itemPackingTypeFk
|
||||
FROM ticket t
|
||||
JOIN sale s ON s.ticketFk = t.id
|
||||
|
@ -59,7 +59,7 @@ BEGIN
|
|||
|
||||
CALL ticket_Clone(vSelf, vNewTicketFk);
|
||||
|
||||
UPDATE tmp.salesToMove
|
||||
UPDATE tSalesToMove
|
||||
SET ticketFk = vNewTicketFk
|
||||
WHERE itemPackingTypeFk = vItemPackingTypeFk;
|
||||
|
||||
|
@ -68,10 +68,10 @@ BEGIN
|
|||
CLOSE vItemPackingTypes;
|
||||
|
||||
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
|
||||
WHERE stm.ticketFk;
|
||||
|
||||
DROP TEMPORARY TABLE tmp.salesToMove;
|
||||
DROP TEMPORARY TABLE tSalesToMove;
|
||||
END$$
|
||||
DELIMITER ;
|
Loading…
Reference in New Issue