2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`travel_checkWarehouseIsFeedStock`(vWarehouseFk INT)
|
2024-01-15 11:31:03 +00:00
|
|
|
proc: BEGIN
|
|
|
|
/*
|
|
|
|
* Check that the warehouse is not Feed Stock
|
|
|
|
*
|
|
|
|
* @vWarehouseFk param warehouse id
|
|
|
|
*/
|
|
|
|
IF vWarehouseFk IS NULL THEN
|
|
|
|
LEAVE proc;
|
|
|
|
END IF;
|
|
|
|
|
|
|
|
IF (SELECT isFeedStock FROM warehouse WHERE id = vWarehouseFk) THEN
|
|
|
|
CALL util.throw('Cannot create a travel with a source warehouse marked isFeedStock');
|
|
|
|
END IF;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|