2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-08-05 10:26:16 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`expeditionScan_Put`(
|
|
|
|
vPalletFk INT,
|
|
|
|
vExpeditionFk INT
|
|
|
|
)
|
2024-01-15 11:31:03 +00:00
|
|
|
BEGIN
|
2024-08-06 10:51:55 +00:00
|
|
|
IF NOT (SELECT TRUE FROM expedition WHERE id = vExpeditionFk LIMIT 1) THEN
|
2024-08-06 05:27:36 +00:00
|
|
|
CALL util.throw('Expedition not exists');
|
|
|
|
END IF;
|
2024-08-05 10:26:16 +00:00
|
|
|
|
2024-08-06 10:51:55 +00:00
|
|
|
IF NOT (SELECT TRUE FROM expeditionPallet WHERE id = vPalletFk LIMIT 1) THEN
|
2024-08-06 05:27:36 +00:00
|
|
|
CALL util.throw('Pallet not exists');
|
2024-08-05 10:26:16 +00:00
|
|
|
END IF;
|
2024-08-06 05:27:36 +00:00
|
|
|
|
|
|
|
REPLACE expeditionScan(expeditionFk, palletFk)
|
|
|
|
VALUES(vExpeditionFk, vPalletFk);
|
2024-01-15 11:31:03 +00:00
|
|
|
END$$
|
|
|
|
DELIMITER ;
|