2024-07-22 09:52:42 +00:00
|
|
|
DELIMITER $$
|
2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`receipt_afterUpdate`
|
2024-07-22 09:52:42 +00:00
|
|
|
AFTER UPDATE ON `receipt`
|
|
|
|
FOR EACH ROW
|
2024-01-15 11:31:03 +00:00
|
|
|
BEGIN
|
|
|
|
IF NEW.isConciliate = FALSE AND NEW.payed > OLD.payed THEN
|
|
|
|
CALL mail_insert(
|
|
|
|
'finanzas@verdnatura.es',
|
|
|
|
NULL,
|
|
|
|
CONCAT('Cambios de recibos del cliente: ', NEW.clientFk),
|
|
|
|
CONCAT('Se ha cambiado el recibo: ', NEW.Id, ' de ', OLD.payed, ' a ', NEW.payed)
|
|
|
|
);
|
|
|
|
END IF;
|
2024-07-22 09:52:42 +00:00
|
|
|
END$$
|
|
|
|
DELIMITER ;
|