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

8 lines
305 B
MySQL
Raw Normal View History

2024-02-12 06:44:40 +00:00
DELIMITER $$
CREATE OR REPLACE DEFINER=`vn-admin`@`localhost` TRIGGER `vn`.`saleLabel_afterUpdate`
2024-02-21 13:07:52 +00:00
AFTER UPDATE ON `vn`.`saleLabel`
2024-02-12 06:44:40 +00:00
FOR EACH ROW
IF NEW.stem >= (SELECT s.quantity FROM sale s WHERE s.id = NEW.saleFk) THEN
2024-02-14 10:01:37 +00:00
UPDATE sale s SET s.isPicked = TRUE WHERE s.id = NEW.saleFk;
2024-02-12 06:44:40 +00:00
END IF$$
DELIMITER ;