7691-testToMaster #2703

Merged
alexm merged 268 commits from 7691-testToMaster into master 2024-07-09 05:38:28 +00:00
1 changed files with 37 additions and 26 deletions
Showing only changes of commit b1e8cdfd86 - Show all commits

View File

@ -1,35 +1,46 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingLog_get`(vShelvingFk VARCHAR(10) )
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingLog_get`(
vShelvingFk VARCHAR(10),
vRecords INT
)
BEGIN
/**
* 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
*
*/
SELECT isl.itemShelvingFk,
isl.created,
isl.accion,
isl.itemFk,
isl.shelvingFk,
isl.quantity,
isl.visible,
isl.available,
isl.grouping,
isl.packing,
isl.stars,
item.longName,
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;
DECLARE vQuery TEXT;
SET vQuery = '
SELECT isl.itemShelvingFk,
isl.created,
isl.accion,
isl.itemFk,
isl.shelvingFk,
isl.quantity,
isl.visible,
isl.available,
isl.`grouping`,
isl.packing,
isl.stars,
item.longName,
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 = ?
OR isl.itemFk = ?
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$$
DELIMITER ;