feat itemShelvingLog refs #7168
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Sergio De la torre 2024-06-25 13:41:10 +02:00
parent acf308fd16
commit e55af8d36f
1 changed files with 26 additions and 28 deletions

View File

@ -1,37 +1,35 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingLog_get`( CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingLog_get`(vShelvingFk VARCHAR(10) )
vShelvingFk VARCHAR(10),
vRecords INT
)
BEGIN BEGIN
/** /**
* Devuelve el log de los item en cada carro * Devuelve el log de los item en cada carro
* *
* @param vShelvingFk Matrícula del carro * @param vShelvingFk Matrícula del carro
* @param vRecords Límite de registros retornados
* *
*/ */
DECLARE vQuery TEXT;
SET vQuery = ' SELECT isl.itemShelvingFk,
SELECT isl.itemFk, isl.created,
i.longName,
isl.shelvingFk,
w.code,
isl.accion, isl.accion,
isl.itemFk,
isl.shelvingFk,
isl.quantity, isl.quantity,
isl.created isl.visible,
FROM item i isl.available,
JOIN itemShelvingLog isl ON i.id = isl.itemFk isl.grouping,
JOIN worker w ON isl.workerFk = w.id isl.packing,
WHERE shelvingFk = ? isl.stars,
OR isl.itemFk = ? item.longName,
ORDER BY isl.created DESC'; item.size,
item.subName,
worker.code,
isl.accion
FROM item
JOIN itemShelvingLog isl ON item.id = isl.itemFk
JOIN worker ON isl.workerFk = worker.id
WHERE shelvingFk = vShelvingFk OR isl.itemFk = vShelvingFk
ORDER BY isl.created DESC;
IF vRecords IS NOT NULL THEN
SET vQuery = CONCAT(vQuery, '\nLIMIT ', vRecords);
END IF;
EXECUTE IMMEDIATE vQuery
USING vShelvingFk, vShelvingFk;
END$$ END$$
DELIMITER ; DELIMITER ;