diff --git a/db/routines/vn/triggers/claim_beforeInsert.sql b/db/routines/vn/triggers/claim_beforeInsert.sql index dc3ef8c7a2..25d103c4cf 100644 --- a/db/routines/vn/triggers/claim_beforeInsert.sql +++ b/db/routines/vn/triggers/claim_beforeInsert.sql @@ -4,5 +4,9 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`claim_beforeInsert` FOR EACH ROW BEGIN SET NEW.editorFk = account.myUser_getId(); + + IF (SELECT shipped FROM ticket WHERE id = NEW.ticketFk) > util.VN_NOW() THEN + CALL util.throw('Future ticket date not allowed'); + END IF; END$$ DELIMITER ;