2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `stock`.`visible_log`(
|
|
|
|
vIsPicked BOOL,
|
2024-04-08 07:11:40 +00:00
|
|
|
vWarehouseFk INT,
|
|
|
|
vItemFk INT,
|
|
|
|
vQuantity INT
|
2024-01-15 11:31:03 +00:00
|
|
|
)
|
|
|
|
proc: BEGIN
|
|
|
|
IF !vIsPicked THEN
|
|
|
|
LEAVE proc;
|
|
|
|
END IF;
|
|
|
|
|
2024-04-08 07:11:40 +00:00
|
|
|
INSERT INTO visible
|
2024-01-15 11:31:03 +00:00
|
|
|
SET itemFk = vItemFk,
|
|
|
|
warehouseFk = vWarehouseFk,
|
|
|
|
quantity = vQuantity
|
|
|
|
ON DUPLICATE KEY UPDATE
|
|
|
|
quantity = quantity + VALUES(quantity);
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|