2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`buy_updatePacking`(vWarehouseFk INT, vItemFk INT, vPacking INT)
|
|
|
|
BEGIN
|
|
|
|
/**
|
|
|
|
* Actualiza packing
|
|
|
|
*
|
|
|
|
* @param vWarehouseFk warehouse del item
|
|
|
|
* @param vItemFk id del item
|
|
|
|
* @param vPacking packing a actualizar
|
|
|
|
*/
|
2024-07-16 16:44:24 +00:00
|
|
|
CALL buy_getUltimate(vItemFk, vWarehouseFk, util.VN_CURDATE());
|
2024-01-15 11:31:03 +00:00
|
|
|
|
|
|
|
UPDATE buy b
|
|
|
|
JOIN tmp.buyUltimate bu ON b.id = bu.buyFk
|
|
|
|
SET b.packing = vPacking
|
|
|
|
WHERE bu.warehouseFk = vWarehouseFk
|
|
|
|
AND bu.itemFk = vItemFk;
|
|
|
|
|
|
|
|
DROP TEMPORARY TABLE tmp.buyUltimate;
|
|
|
|
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|