2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`travel_beforeInsert`
|
2024-01-15 11:31:03 +00:00
|
|
|
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-11-19 12:40:12 +00:00
|
|
|
|
|
|
|
IF NEW.isRaid IS NOT NULL OR NEW.daysInForward IS NOT NULL THEN
|
|
|
|
CALL travel_checkRaid(NEW.isRaid, NEW.daysInForward);
|
|
|
|
END IF;
|
|
|
|
|
2024-05-16 13:34:45 +00:00
|
|
|
IF NEW.awbFk IS NOT NULL THEN
|
2024-05-17 06:16:50 +00:00
|
|
|
CALL travel_throwAwb(NEW.id);
|
2024-03-01 13:26:36 +00:00
|
|
|
END IF;
|
2024-01-15 11:31:03 +00:00
|
|
|
END$$
|
|
|
|
DELIMITER ;
|