Merge pull request 'fix: TRIGGER incorrecto en travel refs #7148' (!2223) from 7148-TRIGGER-en-travel-incorrectos into master
gitea/salix/pipeline/head This commit looks good Details
gitea/salix/pipeline/pr-test This commit looks good Details

Reviewed-on: #2223
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
Carlos Andrés 2024-03-27 17:59:51 +00:00
commit 30e1acedf3
2 changed files with 4 additions and 4 deletions

View File

@ -23,9 +23,5 @@ BEGIN
CALL buy_checkItem(); CALL buy_checkItem();
END IF; END IF;
END IF; END IF;
IF (NOT(NEW.awbFk <=> OLD.awbFk)) AND NEW.awbFk IS NOT NULL AND NOT travel_hasUniqueAwb(NEW.id) THEN
CALL util.throw('The AWB is incorrect, there is a different AWB in the associated entries');
END IF;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -32,5 +32,9 @@ BEGIN
CALL util.throw('The travel has entries with booked invoices'); CALL util.throw('The travel has entries with booked invoices');
END IF; END IF;
END IF; END IF;
IF (NOT(NEW.awbFk <=> OLD.awbFk)) AND NEW.awbFk IS NOT NULL AND NOT travel_hasUniqueAwb(NEW.id) THEN
CALL util.throw('The AWB is incorrect, there is a different AWB in the associated entries');
END IF;
END$$ END$$
DELIMITER ; DELIMITER ;