2024-03-25 07:47:06 +00:00
|
|
|
DELIMITER $$
|
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`entry_checkBooked`(
|
|
|
|
vSelf INT
|
|
|
|
)
|
|
|
|
BEGIN
|
|
|
|
/**
|
|
|
|
* Comprueba si una entrada está contabilizada,
|
|
|
|
* y si lo está retorna un throw.
|
|
|
|
*
|
|
|
|
* @param vSelf Id de entrada
|
|
|
|
*/
|
|
|
|
DECLARE vIsBooked BOOL;
|
|
|
|
|
|
|
|
SELECT isBooked INTO vIsBooked
|
|
|
|
FROM `entry`
|
|
|
|
WHERE id = vSelf;
|
|
|
|
|
2024-04-10 12:01:03 +00:00
|
|
|
IF vIsBooked AND !@isModeInventory THEN
|
2024-03-25 07:47:06 +00:00
|
|
|
CALL util.throw('Entry is already booked');
|
|
|
|
END IF;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|