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

8 lines
299 B
MySQL
Raw Permalink Normal View History

2024-02-12 06:44:40 +00:00
DELIMITER $$
2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`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 ;