DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `stock`.`buyPick_add`(
	vLotFk INT,
	vOutFk INT,
	vQuantity INT
)
BEGIN
	INSERT INTO buyPick
		SET lotFk = vLotFk,
			outFk = vOutFk,
			quantity = vQuantity
		ON DUPLICATE KEY UPDATE
			quantity = quantity + vQuantity;
END$$
DELIMITER ;
