From 8dea9598e885b3327f6e51c855ef029568dc3f23 Mon Sep 17 00:00:00 2001 From: robert Date: Fri, 14 Jun 2024 13:54:43 +0200 Subject: [PATCH] fix: refs #194195 item_getAtp --- db/routines/vn/procedures/item_getAtp.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/db/routines/vn/procedures/item_getAtp.sql b/db/routines/vn/procedures/item_getAtp.sql index bbf13d396..8266e58da 100644 --- a/db/routines/vn/procedures/item_getAtp.sql +++ b/db/routines/vn/procedures/item_getAtp.sql @@ -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 ; -- 2.40.1