diff --git a/db/routines/vn/procedures/itemShelvingLog_get.sql b/db/routines/vn/procedures/itemShelvingLog_get.sql index 14d5101ee..f72a31a9b 100644 --- a/db/routines/vn/procedures/itemShelvingLog_get.sql +++ b/db/routines/vn/procedures/itemShelvingLog_get.sql @@ -13,25 +13,16 @@ BEGIN */ DECLARE vQuery TEXT; SET vQuery = ' - SELECT isl.itemShelvingFk, - isl.created, - isl.accion, - isl.itemFk, + SELECT isl.itemFk, + i.longName, isl.shelvingFk, + w.code, + isl.accion, 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 + isl.created + FROM item i + JOIN itemShelvingLog isl ON i.id = isl.itemFk + JOIN worker w ON isl.workerFk = w.id WHERE shelvingFk = ? OR isl.itemFk = ? ORDER BY isl.created DESC';