salix/db/routines/vn/triggers/movementLabel_afterUpdate.sql

8 lines
306 B
MySQL
Raw Normal View History

2024-02-12 06:44:40 +00:00
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`movementLabel_afterUpdate`
AFTER UPDATE ON `vn`.`movementLabel`
FOR EACH ROW
IF NEW.stem >= (SELECT s.quantity FROM sale s WHERE s.id = NEW.saleFk) THEN
UPDATE sale s SET s.isPicked = 1 WHERE s.id = NEW.saleFk;
END IF$$
DELIMITER ;