#7897 - masterTest_24_36 #2909

Merged
jsegarra merged 132 commits from 7897_masterTest_24_36 into master 2024-09-03 06:37:54 +00:00
1 changed files with 11 additions and 4 deletions
Showing only changes of commit 2cee9c9c01 - Show all commits

View File

@ -14,10 +14,17 @@ BEGIN
DECLARE vTicketFk INT;
DECLARE cTickets CURSOR FOR
SELECT id FROM ticket
WHERE refFk IS NULL
AND ((vScope = 'client' AND clientFk = vId)
OR (vScope = 'address' AND addressFk = vId));
SELECT DISTINCT t.id
FROM ticket t
JOIN sale s ON s.ticketFk = t.id
JOIN itemTaxCountry itc ON itc.itemFk = s.itemFk
WHERE t.refFk IS NULL
AND DATE(t.shipped) > util.VN_CURDATE()
AND (
(vScope = 'client' AND t.clientFk = vId)
OR (vScope = 'address' AND t.addressFk = vId)
OR (vScope = 'item' AND itc.itemFk = vId)
);
DECLARE CONTINUE HANDLER FOR NOT FOUND
SET vDone = TRUE;