2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `stock`.`inbound_removePick`(
|
|
|
|
vSelf INT,
|
2024-04-08 07:11:40 +00:00
|
|
|
vOutboundFk INT,
|
|
|
|
vQuantity INT,
|
|
|
|
vTotalQuantity INT
|
2024-01-15 11:31:03 +00:00
|
|
|
)
|
|
|
|
BEGIN
|
|
|
|
IF vQuantity < vTotalQuantity THEN
|
|
|
|
UPDATE inboundPick
|
|
|
|
SET quantity = quantity - vQuantity
|
|
|
|
WHERE inboundFk = vSelf
|
|
|
|
AND outboundFk = vOutboundFk;
|
|
|
|
ELSE
|
|
|
|
DELETE FROM inboundPick
|
|
|
|
WHERE inboundFk = vSelf
|
|
|
|
AND outboundFk = vOutboundFk;
|
|
|
|
END IF;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|