This commit is contained in:
parent
798bf6d028
commit
8dea9598e8
|
@ -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 ;
|
||||
|
|
Loading…
Reference in New Issue