refs #7191 check isBooked in entry_BeforeUpdate #2329
|
@ -15,8 +15,8 @@ BEGIN
|
||||||
SELECT COUNT(*) INTO vTotalBuy
|
SELECT COUNT(*) INTO vTotalBuy
|
||||||
ivanm marked this conversation as resolved
Outdated
|
|||||||
FROM buy
|
FROM buy
|
||||||
WHERE entryFk = NEW.id;
|
WHERE entryFk = NEW.id;
|
||||||
IF vTotalBuy = 0 THEN
|
IF NOT vTotalBuy THEN
|
||||||
ivanm marked this conversation as resolved
Outdated
guillermo
commented
IF NOT vTotalBuy THEN IF NOT vTotalBuy THEN
|
|||||||
CALL util.throw('The entry cannot be marked as booked if it does not have lines');
|
CALL util.throw('Entry must have lines to be marked booked');
|
||||||
ivanm marked this conversation as resolved
Outdated
guillermo
commented
Acortar msg del throw, lo máximo que permite el procedimiento son 55 carácteres Acortar msg del throw, lo máximo que permite el procedimiento son 55 carácteres
|
|||||||
END IF;
|
END IF;
|
||||||
END IF;
|
END IF;
|
||||||
END IF;
|
END IF;
|
||||||
|
@ -26,7 +26,7 @@ BEGIN
|
||||||
IF NOT (NEW.travelFk <=> OLD.travelFk) THEN
|
IF NOT (NEW.travelFk <=> OLD.travelFk) THEN
|
||||||
|
|
||||||
IF NEW.travelFk IS NOT NULL AND NOT travel_hasUniqueAwb(NEW.travelFk) THEN
|
IF NEW.travelFk IS NOT NULL AND NOT travel_hasUniqueAwb(NEW.travelFk) THEN
|
||||||
CALL util.throw('The travel is incorrect, there is a different AWB in the associated entries');
|
CALL util.throw('The travel is incorrect, there is a different AWB in the associated entries');
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
SELECT COUNT(*) > 0 INTO vIsVirtual
|
SELECT COUNT(*) > 0 INTO vIsVirtual
|
||||||
|
|
Loading…
Reference in New Issue
No es te que mirar sempre que siga TRUE, es deu de mirar sempre que cambie de valor y el nou siga TRUE