salix/db/routines/stock/triggers/inbound_beforeInsert.sql

16 lines
318 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `stock`.`inbound_beforeInsert`
BEFORE INSERT ON `inbound`
FOR EACH ROW
BEGIN
SET NEW.isPicked = NEW.isPicked OR NEW.dated < util.VN_CURDATE();
CALL visible_log(
NEW.isPicked,
NEW.warehouseFk,
NEW.itemFk,
NEW.quantity
);
END$$
DELIMITER ;