salix/db/routines/stock/procedures/inbound_addPick.sql

17 lines
334 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `stock`.`inbound_addPick`(
vSelf INT,
vOutboundFk INT,
vQuantity INT
)
BEGIN
INSERT INTO inboundPick
SET
inboundFk = vSelf,
outboundFk = vOutboundFk,
quantity = vQuantity
ON DUPLICATE KEY UPDATE
quantity = quantity + vQuantity;
END$$
DELIMITER ;