2024-04-04 13:04:23 +00:00
|
|
|
DELIMITER $$
|
2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`invoiceIn_checkBooked`(
|
2024-04-04 13:04:23 +00:00
|
|
|
vSelf INT
|
|
|
|
)
|
|
|
|
BEGIN
|
|
|
|
/**
|
|
|
|
* Comprueba si una factura recibida está contabilizada,
|
|
|
|
* y si lo está retorna un throw.
|
|
|
|
*
|
|
|
|
* @param vSelf Id invoiceIn
|
|
|
|
*/
|
|
|
|
DECLARE vIsBooked BOOL;
|
|
|
|
|
|
|
|
SELECT isBooked INTO vIsBooked
|
|
|
|
FROM invoiceIn
|
|
|
|
WHERE id = vSelf;
|
|
|
|
|
|
|
|
IF vIsBooked THEN
|
|
|
|
CALL util.throw('InvoiceIn is already booked');
|
|
|
|
END IF;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|