Hotfix ticketStateUpdate to ticket_setState

This commit is contained in:
Carlos Andrés 2024-06-25 19:33:54 +02:00
parent 82118ae933
commit 5bcdc57978
1 changed files with 7 additions and 7 deletions

View File

@ -18,7 +18,7 @@ proc:BEGIN
WHERE ticketFk = vTicketFk;
SELECT count(*) INTO vTotalLines
FROM vn.sale s
FROM sale s
WHERE s.ticketFk = vTicketFk;
SET vHasFullProblem = (vTotalLines = vProblemLines);
@ -26,7 +26,7 @@ proc:BEGIN
-- Ticket completo
IF vHasFullProblem THEN
UPDATE vn.ticket
UPDATE ticket
SET landed = vDated + INTERVAL 1 DAY,
shipped = vDated,
nickname = CONCAT('(',DAY(util.VN_CURDATE()),') ', nickname )
@ -40,7 +40,7 @@ proc:BEGIN
-- Ticket a futuro existe
IF vTicketFutureFk THEN
UPDATE vn.sale s
UPDATE sale s
JOIN tmp.salesToSplit ss ON s.id = ss.saleFk
SET s.ticketFk = vTicketFutureFk,
s.concept = CONCAT('(s) ', s.concept)
@ -52,10 +52,10 @@ proc:BEGIN
END IF;
-- Ticket nuevo
CALL vn.ticket_Clone(vTicketFk, vTicketFutureFk);
CALL ticket_Clone(vTicketFk, vTicketFutureFk);
UPDATE vn.ticket t
JOIN vn.productionConfig pc
UPDATE ticket t
JOIN productionConfig pc
SET t.routeFk = IF(t.shipped = vDated , t.routeFk, NULL),
t.landed = vDated + INTERVAL 1 DAY,
t.shipped = vDated,
@ -63,7 +63,7 @@ proc:BEGIN
t.zoneFk = pc.defaultZone
WHERE t.id = vTicketFutureFk;
UPDATE vn.sale s
UPDATE sale s
JOIN tmp.salesToSplit sts ON sts.saleFk = s.id
SET s.ticketFk = vTicketFutureFk,
s.concept = CONCAT('(s) ', s.concept)