412: from wip_transactions
413: where transaction_date >= l_from_date
414: UNION
415: select distinct organization_id
416: from mtl_onhand_quantities) mtl
417: where mp.organization_id = mtl.organization_id and
418: mp.process_enabled_flag <> 'Y';
419:
420: --testing purpose rjin
2012: REVISION,
2013: LOT_NUMBER,
2014: SUBINVENTORY_CODE,
2015: LOCATOR_ID
2016: FROM mtl_onhand_quantities
2017: WHERE ORGANIZATION_ID=Org_id
2018: GROUP BY INVENTORY_ITEM_ID,COST_GROUP_ID,REVISION,LOT_NUMBER,SUBINVENTORY_CODE,locator_id;
2019:
2020:
2052: -- digupta 07/10/02 -- filtered out certain transactions that do not
2053: -- affect inventory quantity or balance.
2054: SELECT sum(TRANSACTION_QUANTITY)
2055: INTO current_onhand_qty
2056: FROM mtl_onhand_quantities
2057: WHERE INVENTORY_ITEM_ID = l_item_id
2058: AND ORGANIZATION_ID = Org_id
2059: AND SUBINVENTORY_CODE = l_subinventory
2060: AND nvl(REVISION,-999) = nvl(l_revision,-999)