2019-03-04 07:35:39 +00:00
|
|
|
/* Añadir a producción cuando se suba salix */
|
|
|
|
|
2019-02-28 07:55:34 +00:00
|
|
|
DROP TRIGGER IF EXISTS vn2008.ConsignatariosBeforeInsert;
|
|
|
|
USE vn2008;
|
|
|
|
|
|
|
|
DELIMITER $$
|
|
|
|
$$
|
|
|
|
CREATE DEFINER=`root`@`%` TRIGGER `vn2008`.`ConsignatariosBeforeInsert`
|
|
|
|
BEFORE INSERT ON `vn2008`.`Consignatarios`
|
|
|
|
FOR EACH ROW
|
|
|
|
BEGIN
|
|
|
|
DECLARE vIsEqualizated BOOLEAN;
|
|
|
|
|
|
|
|
CALL pbx.phoneIsValid (NEW.telefono);
|
|
|
|
CALL pbx.phoneIsValid (NEW.movil);
|
|
|
|
|
|
|
|
IF NEW.isEqualizated IS NULL THEN
|
|
|
|
SELECT RE
|
|
|
|
INTO vIsEqualizated
|
|
|
|
FROM Clientes
|
|
|
|
WHERE Id_Cliente = NEW.Id_Cliente;
|
|
|
|
|
|
|
|
SET NEW.isEqualizated = vIsEqualizated;
|
|
|
|
END IF;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|
|
|
|
USE vn;
|