feat: refs #7740 Ticket before update added restriction
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-07-22 12:09:24 +02:00
parent 5567359d73
commit 24c85608eb
1 changed files with 10 additions and 7 deletions

View File

@ -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