fix: refs #7760 collection_new
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-09-17 09:37:25 +02:00
parent 267ce3167c
commit 55df919076
1 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ BEGIN
FROM sale s
JOIN item i ON i.id = s.itemFk
JOIN itemType it ON it.id = i.typeFk
WHERE s.ticketFk = vTicketFk
WHERE s.ticketFk = vSelf
AND it.isMergeable
GROUP BY s.itemFk, s.price, s.discount;
@ -25,14 +25,14 @@ BEGIN
UPDATE sale s
JOIN tSalesToPreserve stp ON stp.id = s.id
SET s.quantity = newQuantity
WHERE s.ticketFk = vTicketFk;
WHERE s.ticketFk = vSelf;
DELETE s.*
FROM sale s
LEFT JOIN tSalesToPreserve stp ON stp.id = s.id
JOIN item i ON i.id = s.itemFk
JOIN itemType it ON it.id = i.typeFk
WHERE s.ticketFk = vTicketFk
WHERE s.ticketFk = vSelf
AND stp.id IS NULL
AND it.isMergeable;