dbChanges
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Javi Gallego 2021-08-13 09:19:58 +02:00
parent 249ea918dd
commit f2a81974d0
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,33 @@
DROP TRIGGER IF EXISTS vn.ticket_afterUpdate;
DELIMITER $$
$$
CREATE DEFINER=`root`@`%` TRIGGER vn.`ticket_afterUpdate`
AFTER UPDATE ON `ticket`
FOR EACH ROW
BEGIN
IF !(NEW.id <=> OLD.id)
OR !(NEW.warehouseFk <=> OLD.warehouseFk)
OR !(NEW.shipped <=> OLD.shipped) THEN
CALL stock.log_add('ticket', NEW.id, OLD.id);
END IF;
IF !(NEW.clientFk <=> OLD.clientFk)
OR !(NEW.addressFk <=> OLD.addressFk)
OR !(NEW.companyFk <=> OLD.companyFk) THEN
CALL ticket_requestRecalc(NEW.id);
END IF;
IF NEW.clientFk = 2067 AND !(NEW.clientFk <=> OLD.clientFk) THEN
-- Fallo que se insertan no se sabe como tickets en este cliente
INSERT INTO vn.mail SET
`sender` = 'jgallego@verdnatura.es',
`replyTo` = 'jgallego@verdnatura.es',
`subject` = 'Modificado ticket al cliente 2067',
`body` = CONCAT(account.myUserGetName(), ' ha modificado el ticket ',
NEW.id);
END IF;
END$$
DELIMITER ;

View File

@ -1 +0,0 @@
Delete me!