2024-02-12 06:44:40 +00:00
|
|
|
DELIMITER $$
|
2024-07-22 09:52:42 +00:00
|
|
|
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 ;
|