diff --git a/db/routines/vn/procedures/itemPlacementSupplyStockGetTargetList.sql b/db/routines/vn/procedures/itemPlacementSupplyStockGetTargetList.sql index e77d88b70..bdc13ae9d 100644 --- a/db/routines/vn/procedures/itemPlacementSupplyStockGetTargetList.sql +++ b/db/routines/vn/procedures/itemPlacementSupplyStockGetTargetList.sql @@ -10,7 +10,7 @@ BEGIN */ SELECT ish.shelvingFk shelving, p.code parking, - SUM(ish.visible) as stockTotal, + SUM(ish.visible) stockTotal, ish.created, p.pickingOrder FROM vn.itemShelving ish @@ -18,10 +18,12 @@ BEGIN JOIN vn.parking p ON p.id = sh.parkingFk JOIN vn.sector sc ON sc.id = p.sectorFk JOIN vn.warehouse w ON w.id = sc.warehouseFk - WHERE sc.id = vSectorFk - AND ish.visible > 0 - AND ish.itemFk = vItemFk + WHERE sc.id = vSectorFk + AND ish.visible > 0 + AND ish.itemFk = vItemFk GROUP BY ish.id - ORDER BY sh.priority DESC, ish.created, p.pickingOrder; + ORDER BY sh.priority DESC, + ish.created, + p.pickingOrder; END$$ DELIMITER ; \ No newline at end of file diff --git a/db/versions/10857-navyArborvitae/00-firstScript.sql b/db/versions/10857-navyArborvitae/00-firstScript.sql index f379f54cd..78b0f8c8c 100644 --- a/db/versions/10857-navyArborvitae/00-firstScript.sql +++ b/db/versions/10857-navyArborvitae/00-firstScript.sql @@ -3,4 +3,4 @@ ALTER TABLE vn.agency CHANGE warehouseAliasFk warehouseAliasFk__ smallint(5) uns ALTER TABLE vn.warehouse CHANGE aliasFk aliasFk__ smallint(5) unsigned DEFAULT NULL NULL COMMENT 'Refs #5167 Deprecated 2024-01-23'; RENAME TABLE vn.warehouseAlias TO vn.warehouseAlias__; -ALTER TABLE vn.warehouseAlias__ COMMENT='Refs #5167 Deprecated 2024-01-23'; \ No newline at end of file +ALTER TABLE vn.warehouseAlias__ COMMENT='@Deprecated 2024-01-23 Refs #5167'; \ No newline at end of file