feat: refs #7740 Ticket before update added restriction #2770
|
@ -8,13 +8,16 @@ BEGIN
|
|||
SET NEW.editorFk = account.myUser_getId();
|
||||
|
||||
IF NOT (NEW.routeFk <=> OLD.routeFk) THEN
|
||||
INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`)
|
||||
SELECT r.id
|
||||
FROM vn.route r
|
||||
WHERE r.isOk = FALSE
|
||||
AND r.id IN (OLD.routeFk,NEW.routeFk)
|
||||
AND r.created >= util.VN_CURDATE()
|
||||
GROUP BY r.id;
|
||||
IF NEW.isSigned THEN
|
||||
CALL util.throw('A signed ticket cannot be rerouted');
|
||||
END IF;
|
||||
INSERT IGNORE INTO routeRecalc(routeFk)
|
||||
SELECT id
|
||||
FROM `route`
|
||||
WHERE NOT isOk
|
||||
AND id IN (OLD.routeFk, NEW.routeFk)
|
||||
AND created >= util.VN_CURDATE()
|
||||
GROUP BY id;
|
||||
END IF;
|
||||
|
||||
IF NOT (DATE(NEW.shipped) <=> DATE(OLD.shipped)) THEN
|
||||
|
|
Loading…
Reference in New Issue