2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`buy_updatePacking`(vWarehouseFk INT, vItemFk INT, vPacking INT)
|
2024-01-15 11:31:03 +00:00
|
|
|
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 ;
|