fix: refs #194195 item_getAtp #2589

Merged
robert merged 1 commits from 194195-hotFixRadarNegativos into master 2024-06-14 12:03:46 +00:00
1 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`item_getAtp`(vDated DATE) CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`item_getAtp`(vDated DATE)
BEGIN BEGIN
/** /**
* Calcula el valor mínimo acumulado para cada artículo ordenado por fecha y * Calcula el valor mínimo acumulado para cada artículo ordenado por fecha y
@ -33,7 +33,7 @@ BEGIN
FROM ( FROM (
SELECT SELECT
itemFk, itemFk,
IF(itemFk <> @lastItemFk OR wareHouseFk <> @lastWareHouseFk, IF(itemFk <> @lastItemFk OR wareHouseFk <> @lastWareHouseFk OR wareHouseFk IS NULL,
@lastQuantity := quantity, @lastQuantity := quantity,
@lastQuantity := @lastQuantity + quantity) quantityAccumulated, @lastQuantity := @lastQuantity + quantity) quantityAccumulated,
wareHouseFk, wareHouseFk,
@ -44,5 +44,5 @@ BEGIN
GROUP BY itemFk, wareHouseFk; GROUP BY itemFk, wareHouseFk;
DROP TEMPORARY TABLE tItemOrdered; DROP TEMPORARY TABLE tItemOrdered;
END$$ END$$
DELIMITER ; DELIMITER ;