7336_devToTest #2414

Merged
alexm merged 220 commits from 7336_devToTest into test 2024-05-07 06:26:53 +00:00
1 changed files with 8 additions and 8 deletions
Showing only changes of commit 0284b138d7 - Show all commits

View File

@ -6,17 +6,17 @@ BEGIN
DECLARE vIsVirtual BOOL;
DECLARE vPrintedCount INT;
DECLARE vHasDistinctWarehouses BOOL;
DECLARE vEntryFkCount INT;
DECLARE vTotalBuy INT;
IF NEW.isBooked = OLD.isBooked THEN
CALL entry_checkBooked(OLD.id);
END IF;
IF NEW.isBooked = 1 THEN
SELECT COUNT(*) INTO vEntryFkCount
FROM buy WHERE entryFk = NEW.id;
IF vEntryFkCount = 0 THEN
CALL util.throw('The entry cannot be marked as booked if it does not have lines');
ELSE
IF NEW.isBooked = 1 THEN
SELECT COUNT(*) INTO vTotalBuy
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;
END IF;
END IF;