2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`travel_beforeInsert`
|
|
|
|
BEFORE INSERT ON `travel`
|
|
|
|
FOR EACH ROW
|
|
|
|
BEGIN
|
|
|
|
SET NEW.editorFk = account.myUser_getId();
|
|
|
|
|
|
|
|
CALL travel_checkDates(NEW.shipped, NEW.landed);
|
|
|
|
|
2024-01-25 16:33:54 +00:00
|
|
|
CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk);
|
2024-03-01 13:26:36 +00:00
|
|
|
|
|
|
|
IF NEW.awbFk IS NOT NULL AND NOT travel_hasUniqueAwb(NEW.id) THEN
|
|
|
|
CALL util.throw('El AWB no es correcto, en las entradas asociadas existe un AWB distinto');
|
|
|
|
END IF;
|
2024-01-15 11:31:03 +00:00
|
|
|
END$$
|
|
|
|
DELIMITER ;
|