Merge pull request 'fix: refs #194195 item_getAtp' (!2589) from 194195-hotFixRadarNegativos into master
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #2589
Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
This commit is contained in:
Robert Ferrús 2024-06-14 12:03:43 +00:00
commit a54db91e74
1 changed files with 5 additions and 5 deletions

View File

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