Differences
This shows you the differences between two versions of the page.
control_sql_-_adjust_reserved_inventory_levels_to_match_orders [2019/01/27 11:28] 127.0.0.1 external edit |
control_sql_-_adjust_reserved_inventory_levels_to_match_orders [2019/05/23 18:01] (current) dsummers [Answer] |
||
---|---|---|---|
Line 62: | Line 62: | ||
LEFT JOIN Warehouse W WITH(NOLOCK) ON W.ID = TP.WarehouseID | LEFT JOIN Warehouse W WITH(NOLOCK) ON W.ID = TP.WarehouseID | ||
WHERE TP.ID > 0 | WHERE TP.ID > 0 | ||
- | AND ISNULL(P.TrackInventory, | + | AND ISNULL(P.TrackInventory, |
AND ISNULL(TH.StatusID, | AND ISNULL(TH.StatusID, | ||
AND ((TP.EstimatedValue - TP.ActualValue) >= 0) | AND ((TP.EstimatedValue - TP.ActualValue) >= 0) | ||
Line 85: | Line 85: | ||
| | ||
FROM InventoryLog IL WITH(NOLOCK) JOIN Journal J WITH(NOLOCK) ON J.ID = IL.ID | FROM InventoryLog IL WITH(NOLOCK) JOIN Journal J WITH(NOLOCK) ON J.ID = IL.ID | ||
- | WHERE IL.QuantityReserved | + | WHERE IL.QuantityReserved |
; | ; | ||
DECLARE @Adjustments TABLE(TransPartID INT, | DECLARE @Adjustments TABLE(TransPartID INT, |