Merge branch '7836-futureEntries' of https://gitea.verdnatura.es/verdnatura/salix into 7836-futureEntries
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Pako Natek 2024-08-08 08:27:52 +02:00
commit a01794f9cd
1 changed files with 7 additions and 1 deletions

View File

@ -8,7 +8,13 @@ BEGIN
SET NEW.editorFk = account.myUser_getId(); SET NEW.editorFk = account.myUser_getId();
IF NOT (NEW.routeFk <=> OLD.routeFk) THEN IF NOT (NEW.routeFk <=> OLD.routeFk) THEN
IF NEW.isSigned THEN IF NEW.isSigned AND NOT (
SELECT (COUNT(s.id) = COUNT(cb.saleFk)
AND SUM(s.quantity) = SUM(cb.quantity))
FROM sale s
LEFT JOIN claimBeginning cb ON cb.saleFk = s.id
WHERE s.ticketFk = NEW.id
) THEN
CALL util.throw('A signed ticket cannot be rerouted'); CALL util.throw('A signed ticket cannot be rerouted');
END IF; END IF;
INSERT IGNORE INTO routeRecalc(routeFk) INSERT IGNORE INTO routeRecalc(routeFk)