7863-devToTest_2434 #2852

Merged
alexm merged 129 commits from 7863-devToTest_2434 into test 2024-08-13 06:50:25 +00:00
1 changed files with 0 additions and 33 deletions
Showing only changes of commit d0dfb95718 - Show all commits

View File

@ -18,9 +18,6 @@ BEGIN
DECLARE vSalesPersonFK INT;
DECLARE vItemPicker INT;
DECLARE vTicketfailed INT;
DECLARE vSubjectsTicketfailed VARCHAR(50);
DECLARE vMessagesTicketfailed TEXT;
DECLARE rsTicket CURSOR FOR
SELECT tt.ticketFk,
@ -221,36 +218,6 @@ BEGIN
END LOOP;
CLOSE rsTicket;
WITH tOrigin AS (
SELECT tt.ticketFk,
t.clientFk,
t.warehouseFk,
t.companyFk,
t.addressFk,
tt.agencyModeFk,
ti.dated
FROM ticketWeekly tt
JOIN ticket t ON tt.ticketFk = t.id
JOIN tmp.time ti
WHERE WEEKDAY(ti.dated) = tt.weekDay
),total AS(
SELECT tor.ticketFk, tc.id
FROM tOrigin tor
JOIN sale so ON tor.ticketFk = so.ticketFk
LEFT JOIN ticket tc ON tc.id = tor.ticketFk
AND DATE(tc.shipped) = tor.dated
LEFT JOIN sale sc ON sc.ticketFk = tc.id
WHERE sc.id IS NULL
GROUP BY tor.ticketFk, tc.id
)SELECT COUNT(DISTINCT ticketFk) INTO vTicketfailed
FROM total;
IF vTicketfailed THEN
SET vSubjectsTicketfailed = 'Turnos - Tickets que no se han clonado ';
SET vMessagesTicketfailed = 'No se ha podido clonar tickets revisar que tickets han sido y mirar por que no se han clonado';
CALL mail_insert('nocontestar@verdnatura.es', NULL, vSubjectsTicketfailed, vMessagesTicketfailed);
END IF;
DROP TEMPORARY TABLE IF EXISTS tmp.time, tmp.zoneGetLanded;
END$$
DELIMITER ;