refs #7191 check isBooked in entry_BeforeUpdate #2329
|
@ -6,9 +6,19 @@ BEGIN
|
|||
DECLARE vIsVirtual BOOL;
|
||||
DECLARE vPrintedCount INT;
|
||||
DECLARE vHasDistinctWarehouses BOOL;
|
||||
DECLARE vTotalBuy INT;
|
||||
|
||||
IF NEW.isBooked = OLD.isBooked THEN
|
||||
CALL entry_checkBooked(OLD.id);
|
||||
ELSE
|
||||
IF NEW.isBooked THEN
|
||||
SELECT COUNT(*) INTO vTotalBuy
|
||||
FROM buy
|
||||
WHERE entryFk = NEW.id;
|
||||
IF NOT vTotalBuy THEN
|
||||
CALL util.throw('Entry must have lines to be marked booked');
|
||||
END IF;
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
|
|
Loading…
Reference in New Issue