2024-05-02 15:05:10 +00:00
|
|
|
DELIMITER $$
|
2024-05-02 16:13:12 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
2024-05-03 12:03:26 +00:00
|
|
|
PROCEDURE `vn`.`ticket_setTaxDataCheckedProblemAll`()
|
2024-05-02 15:05:10 +00:00
|
|
|
proc: BEGIN
|
|
|
|
/**
|
2024-05-02 16:13:12 +00:00
|
|
|
* Update the problem of all tickets, depending on whether
|
|
|
|
* the client taxDataCheched is verified or not
|
2024-05-02 15:05:10 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
|
|
|
|
(INDEX(ticketFk))
|
|
|
|
ENGINE = MEMORY
|
|
|
|
SELECT t.id ticketFk, FALSE hasProblem
|
|
|
|
FROM ticket t
|
|
|
|
JOIN client c ON c.id = t.clientFk
|
|
|
|
WHERE t.shipped >= util.midnight();
|
|
|
|
|
|
|
|
CALL ticket_getTaxDataCheckedProblem();
|
|
|
|
|
|
|
|
DROP TEMPORARY TABLE tmp.ticket;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|