The following lines contain the word 'select', 'insert', 'update' or 'delete':
ELSIF inv_mwb_globals.g_tree_event = 'TREE_NODE_SELECTED' THEN
-- If all material locations are unchecked and the view by is LPN
-- Using ONHAND but it does not query onhand material location.
IF inv_mwb_globals.g_chk_onhand = 0
AND inv_mwb_globals.g_chk_receiving = 0
AND inv_mwb_globals.g_chk_inbound = 0 THEN
make_common_query_lpn;
SELECT meaning
BULK COLLECT INTO mtl_loc_type
FROM mfg_lookups
WHERE lookup_type = 'MTL_LOCATION_TYPES'
ORDER BY lookup_code;
inv_mwb_globals.print_msg( g_pkg_name, l_procedure_name, 'Selected all the document types' );
ELSIF inv_mwb_globals.g_tree_event = 'TREE_NODE_SELECTED' THEN
-- If all material locations are unchecked and the view by is LPN
-- Using ONHAND but it does not query onhand material location.
IF inv_mwb_globals.g_chk_onhand = 0
AND inv_mwb_globals.g_chk_receiving = 0
AND inv_mwb_globals.g_chk_inbound = 0
AND inv_mwb_globals.g_view_by = 'LPN' THEN
make_common_query_lpn;
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'wlpn.subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'wlpn.locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'wlpn.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'wlc.cost_group_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'msn.current_subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'msn.current_locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'msn.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'moqd.subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'moqd.locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'moqd.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'moqd.cost_group_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'msn.current_subinventory_code';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'msn.current_locator_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LPN_ID).column_value :=
'msn.lpn_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'rs.to_subinventory';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'rs.to_locator_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LPN_ID).column_value :=
'rs.lpn_id';
END IF; -- Node selected
ELSIF inv_mwb_globals.g_tree_event = 'TREE_NODE_SELECTED' THEN
-- If all material locations are unchecked and the view by is LPN
-- Using ONHAND but it does not query onhand material location.
IF inv_mwb_globals.g_chk_onhand = 0
AND inv_mwb_globals.g_chk_receiving = 0
AND inv_mwb_globals.g_chk_inbound = 0
AND inv_mwb_globals.g_view_by = 'LPN' THEN
make_common_query_lpn;
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'wlpn.subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'wlpn.locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'wlpn.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'wlc.cost_group_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'msn.current_subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'msn.current_locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'msn.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'msn.cost_group_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'moqd.subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'moqd.locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'moqd.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'moqd.cost_group_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'msn.current_subinventory_code';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'msn.current_locator_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LPN_ID).column_value :=
'msn.lpn_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'rs.to_subinventory';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'rs.to_locator_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LPN_ID).column_value :=
'rs.lpn_id';
END IF; --Tree node selected
ELSIF inv_mwb_globals.g_tree_event = 'TREE_NODE_SELECTED' THEN
-- If all material locations are unchecked and the view by is LPN
-- Using ONHAND but it does not query onhand material location.
IF inv_mwb_globals.g_chk_onhand = 0
AND inv_mwb_globals.g_chk_receiving = 0
AND inv_mwb_globals.g_chk_inbound = 0
AND inv_mwb_globals.g_view_by = 'LPN' THEN
inv_mwb_query_manager.make_nested_lpn_onhand_query;
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'wlpn.subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'wlpn.locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'wlpn.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'wlc.cost_group_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'msn.current_subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'msn.current_locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'msn.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'msn.cost_group_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'moqd.subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'moqd.locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'moqd.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'moqd.cost_group_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'msn.current_subinventory_code';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'msn.current_locator_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LPN_ID).column_value :=
'msn.lpn_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'rs.to_subinventory';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'rs.to_locator_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LPN_ID).column_value :=
'rs.lpn_id';
END IF; -- Node selected
ELSIF inv_mwb_globals.g_tree_event = 'TREE_NODE_SELECTED' THEN
SELECT revision_qty_control_code,
lot_control_code,
serial_number_control_code
INTO l_rev_control,
l_lot_control,
l_serial_control
FROM mtl_system_items
WHERE inventory_item_id = inv_mwb_globals.g_tree_item_id
AND organization_id = inv_mwb_globals.g_organization_id;
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'wlpn.subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'wlpn.locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'wlpn.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'wlc.cost_group_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.REVISION).column_value :=
'wlc.revision';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOT).column_value :=
'wlc.lot_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SERIAL).column_value :=
'msn.serial_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.STATUS_ID).column_value :=
l_status_id;
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'msn.current_subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'msn.current_locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'msn.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'msn.cost_group_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.REVISION).column_value :=
'msn.revision';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOT).column_value :=
'msn.lot_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SERIAL).column_value :=
'msn.serial_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'moqd.subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'moqd.locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'moqd.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'moqd.cost_group_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.STATUS_ID).column_value :=
'moqd.status_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.REVISION).column_value :=
'moqd.revision';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOT).column_value :=
'moqd.lot_number';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'msn.current_subinventory_code';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'msn.current_locator_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LPN_ID).column_value :=
'msn.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.REVISION).column_value :=
'msn.revision';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOT).column_value :=
'msn.lot_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SERIAL).column_value :=
'msn.serial_number';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'rs.to_subinventory';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'rs.to_locator_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LPN_ID).column_value :=
'rs.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.REVISION).column_value :=
'rs.item_revision';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOT).column_value :=
'rls.lot_num';
ELSIF inv_mwb_globals.g_tree_event = 'TREE_NODE_SELECTED' THEN
SELECT lot_control_code,
serial_number_control_code
INTO l_lot_control,
l_serial_control
FROM mtl_system_items
WHERE inventory_item_id = inv_mwb_globals.g_tree_item_id
AND organization_id = inv_mwb_globals.g_organization_id;
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'wlpn.subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'wlpn.locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'wlpn.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'wlc.cost_group_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.REVISION).column_value :=
'wlc.revision';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOT).column_value :=
'wlc.lot_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SERIAL).column_value :=
'msn.serial_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.STATUS_ID).column_value :=
l_status_id;
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'msn.current_subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'msn.current_locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'msn.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'msn.cost_group_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.REVISION).column_value :=
'msn.revision';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOT).column_value :=
'msn.lot_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SERIAL).column_value :=
'msn.serial_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'moqd.subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'moqd.locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'moqd.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'moqd.cost_group_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.REVISION).column_value :=
'moqd.revision';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOT).column_value :=
'moqd.lot_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.STATUS_ID).column_value :=
'moqd.status_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'msn.current_subinventory_code';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'msn.current_locator_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LPN_ID).column_value :=
'msn.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.REVISION).column_value :=
'msn.revision';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOT).column_value :=
'msn.lot_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SERIAL).column_value :=
'msn.serial_number';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'rs.to_subinventory';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'rs.to_locator_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LPN_ID).column_value :=
'rs.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.REVISION).column_value :=
'rs.item_revision';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOT).column_value :=
'rls.lot_num';
ELSIF inv_mwb_globals.g_tree_event = 'TREE_NODE_SELECTED' THEN
SELECT serial_number_control_code
INTO l_serial_control
FROM mtl_system_items
WHERE inventory_item_id = inv_mwb_globals.g_tree_item_id
AND organization_id = inv_mwb_globals.g_organization_id;
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'wlpn.subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'wlpn.locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'wlpn.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'wlc.cost_group_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.REVISION).column_value :=
'wlc.revision';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOT).column_value :=
'wlc.lot_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SERIAL).column_value :=
'msn.serial_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.STATUS_ID).column_value :=
l_status_id;
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'msn.current_subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'msn.current_locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'msn.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'msn.cost_group_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.REVISION).column_value :=
'msn.revision';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOT).column_value :=
'msn.lot_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SERIAL).column_value :=
'msn.serial_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'moqd.subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'moqd.locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'moqd.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'moqd.cost_group_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.REVISION).column_value :=
'moqd.revision';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOT).column_value :=
'moqd.lot_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.STATUS_ID).column_value :=
'moqd.status_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'msn.current_subinventory_code';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'msn.current_locator_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LPN_ID).column_value :=
'msn.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.REVISION).column_value :=
'msn.revision';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOT).column_value :=
'msn.lot_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SERIAL).column_value :=
'msn.serial_number';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'rs.to_subinventory';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'rs.to_locator_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LPN_ID).column_value :=
'rs.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.REVISION).column_value :=
'rs.item_revision';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOT).column_value :=
'rls.lot_num';
IF inv_mwb_globals.g_tree_event = 'TREE_NODE_SELECTED' THEN
IF inv_mwb_globals.g_chk_onhand = 0
AND inv_mwb_globals.g_chk_receiving = 0
AND inv_mwb_globals.g_chk_inbound = 0
AND inv_mwb_globals.g_view_by = 'LPN' THEN
make_common_query_lpn;
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'wlpn.subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'wlpn.locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'wlpn.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'wlc.cost_group_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.REVISION).column_value :=
'wlc.revision';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOT).column_value :=
'wlc.lot_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SERIAL).column_value :=
'msn.serial_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'msn.current_subinventory_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'msn.current_locator_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LPN_ID).column_value :=
'msn.lpn_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.CG_ID).column_value :=
'msn.cost_group_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.REVISION).column_value :=
'msn.revision';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.LOT).column_value :=
'msn.lot_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SERIAL).column_value :=
'msn.serial_number';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.SUBINVENTORY_CODE).column_value :=
'msn.current_subinventory_code';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LOCATOR_ID).column_value :=
'msn.current_locator_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LPN_ID).column_value :=
'msn.lpn_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.CG_ID).column_value :=
'msn.cost_group_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.REVISION).column_value :=
'msn.revision';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.LOT).column_value :=
'msn.lot_number';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.SERIAL).column_value :=
'msn.serial_number';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.ITEM_ID).column_value :=
'msn.inventory_item_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.ORG_ID).column_value :=
'msn.current_organization_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.PRIMARY_UOM_CODE).column_value :=
'''Ea''';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.ONHAND).column_value := 1;
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.PACKED).column_value := 1;
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.UNPACKED).column_value := 0;
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SECONDARY_UOM_CODE).column_value :=
'NULL';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SECONDARY_PACKED).column_value :=
'NULL';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SECONDARY_UNPACKED).column_value :=
'NULL';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.ITEM_ID).column_value :=
'moqd.inventory_item_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.ORG_ID).column_value :=
'moqd.organization_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.ONHAND).column_value :=
'SUM(moqd.primary_transaction_quantity)';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.PACKED).column_value :=
'SUM(moqd.primary_transaction_quantity)';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.UNPACKED).column_value := 0;
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SECONDARY_UOM_CODE).column_value :=
'moqd.secondary_uom_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SECONDARY_ONHAND).column_value :=
'SUM(moqd.secondary_transaction_quantity)';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SECONDARY_PACKED).column_value :=
'SUM(moqd.secondary_transaction_quantity)';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SECONDARY_UNPACKED).column_value := 0;
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.ONHAND).column_value :=
'count(1)';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.PACKED).column_value :=
'count(1)';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.UNPACKED).column_value := 0;
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.ORG_ID).column_value :=
'rs.to_organization_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.ITEM_ID).column_value :=
'rs.item_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.RECEIVING).column_value :=
'SUM(rs.to_org_primary_quantity)';
IF inv_mwb_globals.g_multiple_loc_selected = 'FALSE'
OR inv_mwb_globals.g_tree_node_type <> 'APPTREE_OBJECT_TRUNK' THEN
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.UNPACKED).column_value := 0;
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.PACKED).column_value :=
'SUM(rs.to_org_primary_quantity)';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.ORG_ID).column_value :=
'wlpn.organization_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.ITEM_ID).column_value :=
'wlc.inventory_item_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.PRIMARY_UOM_CODE).column_value :=
'wlc.uom_code';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.RECEIVING).column_value :=
'SUM(wlc.primary_quantity)';--bug 4761399
IF inv_mwb_globals.g_multiple_loc_selected = 'FALSE'
OR inv_mwb_globals.g_tree_node_type <> 'APPTREE_OBJECT_TRUNK' THEN
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.SECONDARY_UOM_CODE).column_value :=
'wlc.secondary_uom_code';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.ITEM_ID).column_value :=
'msn.inventory_item_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.ORG_ID).column_value :=
'msn.current_organization_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.PRIMARY_UOM_CODE).column_value :=
'''Ea''';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.receiving).column_value := 1;
IF inv_mwb_globals.g_multiple_loc_selected = 'FALSE'
OR inv_mwb_globals.g_tree_node_type <> 'APPTREE_OBJECT_TRUNK' THEN
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.PACKED).column_value := 1;
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.UNPACKED).column_value := 0;
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.ITEM_ID).column_value :=
'msn.inventory_item_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.ORG_ID).column_value :=
'msn.current_organization_id';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.PRIMARY_UOM_CODE).column_value :=
'''Ea''';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.receiving).column_value :=
'count(1)';
IF inv_mwb_globals.g_multiple_loc_selected = 'FALSE'
OR inv_mwb_globals.g_tree_node_type <> 'APPTREE_OBJECT_TRUNK' THEN
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.PACKED).column_value :=
'count(1)';
inv_mwb_query_manager.g_receiving_select(inv_mwb_query_manager.UNPACKED).column_value := 0;
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.ORG_ID).column_value :=
'wlpn.organization_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.ITEM_ID).column_value :=
'wlc.inventory_item_id';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.PRIMARY_UOM_CODE).column_value :=
'wlc.uom_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.SECONDARY_UOM_CODE).column_value :=
'wlc.secondary_uom_code';
inv_mwb_query_manager.g_onhand_select(inv_mwb_query_manager.ONHAND).column_value :=
'SUM(wlc.primary_quantity)'; --bug 4761399
OR inv_mwb_globals.g_tree_event = 'TREE_NODE_SELECTED' THEN
CASE inv_mwb_globals.g_tree_node_type
WHEN 'APPTREE_OBJECT_TRUNK' THEN
root_node_event (
x_node_value
, x_node_tbl
, x_tbl_index
);