solve_merge_problems #2986

Merged
carlosap merged 11 commits from solve_merge_problems into master 2024-09-20 07:07:23 +00:00
1 changed files with 13 additions and 15 deletions
Showing only changes of commit ba6b6572c3 - Show all commits

View File

@ -173,26 +173,24 @@ BEGIN
-- Hay que excluir aquellos que no tengan la misma hora de preparacion, si procede
IF vHasUniqueCollectionTime THEN
SELECT ticketFk INTO vFirstTicketFk
FROM tmp.productionBuffer
ORDER BY HH,
mm,
productionOrder DESC,
m3 DESC,
agency,
zona,
routeFk,
ticketFk
LIMIT 1;
DELETE pb
FROM tmp.productionBuffer pb
JOIN tmp.productionBuffer pb2 ON pb2.ticketFk = vFirstTicketFk
AND (pb.HH <> pb2.HH OR pb.mm <> pb2.mm);
AND (pb.HH <> pb2.HH OR pb.mm <> pb2.mm);
END IF;
SELECT ticketFk INTO vFirstTicketFk
FROM tmp.productionBuffer
ORDER BY HH,
mm,
productionOrder DESC,
m3 DESC,
agency,
zona,
routeFk,
ticketFk
LIMIT 1;
OPEN vTickets;
l: LOOP
SET vDone = FALSE;