refs #7191 SQL conventions mod
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Ivan Mas 2024-04-29 19:40:43 +02:00
parent f03a431ea2
commit 30f6a9324d
1 changed files with 3 additions and 2 deletions

View File

@ -11,9 +11,10 @@ BEGIN
IF NEW.isBooked = OLD.isBooked THEN
CALL entry_checkBooked(OLD.id);
ELSE
IF NEW.isBooked = 1 THEN
IF NEW.isBooked THEN
SELECT COUNT(*) INTO vTotalBuy
FROM buy WHERE entryFk = NEW.id;
FROM buy
WHERE entryFk = NEW.id;
IF vTotalBuy = 0 THEN
CALL util.throw('The entry cannot be marked as booked if it does not have lines');
END IF;