This commit is contained in:
parent
267ce3167c
commit
55df919076
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue