fix: collection_new
gitea/salix/pipeline/pr-master This commit looks good Details

This commit is contained in:
Carlos Andrés 2024-09-18 10:30:16 +02:00
parent d5f18b9187
commit 4f9b6030e8
1 changed files with 8 additions and 8 deletions

View File

@ -200,14 +200,6 @@ BEGIN
OR pb.hasPlantTray; OR pb.hasPlantTray;
END IF; END IF;
-- Hay que excluir aquellos que no tengan la misma hora de preparacion, si procede
IF vHasUniqueCollectionTime THEN
DELETE pb
FROM tmp.productionBuffer pb
JOIN tmp.productionBuffer pb2 ON pb2.ticketFk = vFirstTicketFk
AND (pb.HH <> pb2.HH OR pb.mm <> pb2.mm);
END IF;
SELECT ticketFk INTO vFirstTicketFk SELECT ticketFk INTO vFirstTicketFk
FROM tmp.productionBuffer FROM tmp.productionBuffer
ORDER BY HH, ORDER BY HH,
@ -220,6 +212,14 @@ BEGIN
ticketFk ticketFk
LIMIT 1; LIMIT 1;
-- Hay que excluir aquellos que no tengan la misma hora de preparacion, si procede
IF vHasUniqueCollectionTime THEN
DELETE pb
FROM tmp.productionBuffer pb
JOIN tmp.productionBuffer pb2 ON pb2.ticketFk = vFirstTicketFk
AND (pb.HH <> pb2.HH OR pb.mm <> pb2.mm);
END IF;
SET vTicketFk = vFirstTicketFk; SET vTicketFk = vFirstTicketFk;
SET @lines = 0; SET @lines = 0;
SET @volume = 0; SET @volume = 0;