salix/db/routines/vn/triggers/itemShelvingSale_afterInser...

12 lines
342 B
MySQL
Raw Normal View History

2024-05-27 09:33:04 +00:00
DELIMITER $$
2024-05-27 09:55:42 +00:00
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`itemShelvingSale_afterInsert`
AFTER INSERT ON `itemShelvingSale`
2024-05-27 09:33:04 +00:00
FOR EACH ROW
BEGIN
UPDATE sale s
JOIN operator o ON o.workerFk = account.myUser_getId()
SET s.isPicked = IF(o.isOnReservationMode, s.isPicked, TRUE)
WHERE id = NEW.saleFk;
2024-05-27 09:33:04 +00:00
END$$
DELIMITER ;