157: fetch mtl_org_csr into mtl_org_rec ;
158: close mtl_org_csr ;
159:
160: gmi_reservation_util.println('Get Avail: rows back '
161: ||WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl.COUNT);
162: gmi_reservation_util.println('Get Avail: inserting the data into the temp');
163: --FOR ALL i IN 1..WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl.COUNT
164:
165: FOR i IN 1..WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl.COUNT
159:
160: gmi_reservation_util.println('Get Avail: rows back '
161: ||WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl.COUNT);
162: gmi_reservation_util.println('Get Avail: inserting the data into the temp');
163: --FOR ALL i IN 1..WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl.COUNT
164:
165: FOR i IN 1..WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl.COUNT
166: LOOP
167: -- Fix for Bug#8910862.Check if suggestion already exists
161: ||WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl.COUNT);
162: gmi_reservation_util.println('Get Avail: inserting the data into the temp');
163: --FOR ALL i IN 1..WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl.COUNT
164:
165: FOR i IN 1..WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl.COUNT
166: LOOP
167: -- Fix for Bug#8910862.Check if suggestion already exists
168: BEGIN
169:
169:
170: select 1
171: into l_found
172: from mtl_available_inventory_temp
173: where (revision = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).revision or
174: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).revision is null )
175: and (lot_number = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number or
176: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number is null)
177: and (subinventory_code = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code or
170: select 1
171: into l_found
172: from mtl_available_inventory_temp
173: where (revision = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).revision or
174: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).revision is null )
175: and (lot_number = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number or
176: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number is null)
177: and (subinventory_code = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code or
178: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code is null )
171: into l_found
172: from mtl_available_inventory_temp
173: where (revision = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).revision or
174: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).revision is null )
175: and (lot_number = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number or
176: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number is null)
177: and (subinventory_code = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code or
178: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code is null )
179: and (locator_id = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id or
172: from mtl_available_inventory_temp
173: where (revision = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).revision or
174: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).revision is null )
175: and (lot_number = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number or
176: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number is null)
177: and (subinventory_code = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code or
178: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code is null )
179: and (locator_id = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id or
180: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id is null )
173: where (revision = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).revision or
174: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).revision is null )
175: and (lot_number = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number or
176: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number is null)
177: and (subinventory_code = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code or
178: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code is null )
179: and (locator_id = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id or
180: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id is null )
181: and (lpn_id = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id or
174: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).revision is null )
175: and (lot_number = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number or
176: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number is null)
177: and (subinventory_code = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code or
178: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code is null )
179: and (locator_id = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id or
180: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id is null )
181: and (lpn_id = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id or
182: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id is null )
175: and (lot_number = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number or
176: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number is null)
177: and (subinventory_code = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code or
178: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code is null )
179: and (locator_id = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id or
180: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id is null )
181: and (lpn_id = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id or
182: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id is null )
183: and (serial_number = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number or
176: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number is null)
177: and (subinventory_code = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code or
178: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code is null )
179: and (locator_id = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id or
180: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id is null )
181: and (lpn_id = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id or
182: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id is null )
183: and (serial_number = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number or
184: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number is null )
177: and (subinventory_code = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code or
178: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code is null )
179: and (locator_id = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id or
180: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id is null )
181: and (lpn_id = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id or
182: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id is null )
183: and (serial_number = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number or
184: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number is null )
185: and (grade_code = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code or
178: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code is null )
179: and (locator_id = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id or
180: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id is null )
181: and (lpn_id = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id or
182: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id is null )
183: and (serial_number = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number or
184: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number is null )
185: and (grade_code = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code or
186: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code is null) ;
179: and (locator_id = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id or
180: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id is null )
181: and (lpn_id = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id or
182: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id is null )
183: and (serial_number = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number or
184: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number is null )
185: and (grade_code = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code or
186: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code is null) ;
187:
180: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id is null )
181: and (lpn_id = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id or
182: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id is null )
183: and (serial_number = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number or
184: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number is null )
185: and (grade_code = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code or
186: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code is null) ;
187:
188: gmi_reservation_util.println(' Suggestion already exists') ;
181: and (lpn_id = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id or
182: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id is null )
183: and (serial_number = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number or
184: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number is null )
185: and (grade_code = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code or
186: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code is null) ;
187:
188: gmi_reservation_util.println(' Suggestion already exists') ;
189:
182: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id is null )
183: and (serial_number = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number or
184: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number is null )
185: and (grade_code = WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code or
186: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code is null) ;
187:
188: gmi_reservation_util.println(' Suggestion already exists') ;
189:
190: EXCEPTION
193: gmi_reservation_util.println(' New Suggestion ') ;
194: gmi_reservation_util.println(' Transaction type id ' || mtl_org_rec.transaction_type_id ) ;
195: gmi_reservation_util.println(' Organization_id ' || mtl_org_rec.organization_id ) ;
196: gmi_reservation_util.println(' Inventory Item Id ' || mtl_org_rec.inventory_item_id ) ;
197: gmi_reservation_util.println(' Subinventory code ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code ) ;
198: gmi_reservation_util.println(' Locator id ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id ) ;
199: gmi_reservation_util.println(' Lot Number ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number ) ;
200: gmi_reservation_util.println(' LPN Id ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id ) ;
201:
194: gmi_reservation_util.println(' Transaction type id ' || mtl_org_rec.transaction_type_id ) ;
195: gmi_reservation_util.println(' Organization_id ' || mtl_org_rec.organization_id ) ;
196: gmi_reservation_util.println(' Inventory Item Id ' || mtl_org_rec.inventory_item_id ) ;
197: gmi_reservation_util.println(' Subinventory code ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code ) ;
198: gmi_reservation_util.println(' Locator id ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id ) ;
199: gmi_reservation_util.println(' Lot Number ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number ) ;
200: gmi_reservation_util.println(' LPN Id ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id ) ;
201:
202: gmi_reservation_util.println('fetch the rows, Secondary qty '
195: gmi_reservation_util.println(' Organization_id ' || mtl_org_rec.organization_id ) ;
196: gmi_reservation_util.println(' Inventory Item Id ' || mtl_org_rec.inventory_item_id ) ;
197: gmi_reservation_util.println(' Subinventory code ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code ) ;
198: gmi_reservation_util.println(' Locator id ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id ) ;
199: gmi_reservation_util.println(' Lot Number ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number ) ;
200: gmi_reservation_util.println(' LPN Id ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id ) ;
201:
202: gmi_reservation_util.println('fetch the rows, Secondary qty '
203: ||WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).secondary_onhand_qty);
196: gmi_reservation_util.println(' Inventory Item Id ' || mtl_org_rec.inventory_item_id ) ;
197: gmi_reservation_util.println(' Subinventory code ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code ) ;
198: gmi_reservation_util.println(' Locator id ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id ) ;
199: gmi_reservation_util.println(' Lot Number ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number ) ;
200: gmi_reservation_util.println(' LPN Id ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id ) ;
201:
202: gmi_reservation_util.println('fetch the rows, Secondary qty '
203: ||WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).secondary_onhand_qty);
204: gmi_reservation_util.println('fetch the rows, grade_code '
199: gmi_reservation_util.println(' Lot Number ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number ) ;
200: gmi_reservation_util.println(' LPN Id ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id ) ;
201:
202: gmi_reservation_util.println('fetch the rows, Secondary qty '
203: ||WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).secondary_onhand_qty);
204: gmi_reservation_util.println('fetch the rows, grade_code '
205: ||WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code);
206: /* Fix for Bug#13920680. Validate locator_id for security */
207: x_dummy := TRUE ;
201:
202: gmi_reservation_util.println('fetch the rows, Secondary qty '
203: ||WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).secondary_onhand_qty);
204: gmi_reservation_util.println('fetch the rows, grade_code '
205: ||WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code);
206: /* Fix for Bug#13920680. Validate locator_id for security */
207: x_dummy := TRUE ;
208:
209: IF (WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id IS NOT NULL ) THEN
205: ||WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code);
206: /* Fix for Bug#13920680. Validate locator_id for security */
207: x_dummy := TRUE ;
208:
209: IF (WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id IS NOT NULL ) THEN
210: x_dummy := FND_FLEX_KEYVAL.validate_ccid(
211: appl_short_name => 'INV',
212: key_flex_code => 'MTLL',
213: structure_number => 101,
210: x_dummy := FND_FLEX_KEYVAL.validate_ccid(
211: appl_short_name => 'INV',
212: key_flex_code => 'MTLL',
213: structure_number => 101,
214: combination_id => WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id,
215: data_set => mtl_org_rec.organization_id,
216: security => 'ENFORCE');
217:
218:
219: END IF;
220:
221:
222: IF (x_dummy = TRUE ) THEN
223: gmi_reservation_util.println(' Locator id ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id ||
224: ' okay for security rules ' ) ;
225: l_txn_allowed := 'Y' ; -- 14168651
226:
227: /* start Fix for Bug#10170014. */
226:
227: /* start Fix for Bug#10170014. */
228: /* Fix for Bug#14168651. Removed is_status_applicable call as post-query trigger will take care of it */
229: /* Start for #14168651
230: IF (WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id is not null ) THEN
231: l_wms_installed := 'TRUE' ;
232: ELSE
233: l_wms_installed := 'FALSE' ;
234: END IF ;
242: p_lot_status_enabled =>NULL ,
243: p_serial_status_enabled =>NULL ,
244: p_organization_id =>mtl_org_rec.organization_id ,
245: p_inventory_item_id =>mtl_org_rec.inventory_item_id,
246: p_sub_code =>WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code,
247: p_locator_id =>WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id,
248: p_lot_number =>WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number ,
249: p_serial_number =>NULL ,
250: p_object_type =>'A' ,
243: p_serial_status_enabled =>NULL ,
244: p_organization_id =>mtl_org_rec.organization_id ,
245: p_inventory_item_id =>mtl_org_rec.inventory_item_id,
246: p_sub_code =>WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code,
247: p_locator_id =>WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id,
248: p_lot_number =>WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number ,
249: p_serial_number =>NULL ,
250: p_object_type =>'A' ,
251: p_lpn_id =>WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id) ;
244: p_organization_id =>mtl_org_rec.organization_id ,
245: p_inventory_item_id =>mtl_org_rec.inventory_item_id,
246: p_sub_code =>WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code,
247: p_locator_id =>WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id,
248: p_lot_number =>WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number ,
249: p_serial_number =>NULL ,
250: p_object_type =>'A' ,
251: p_lpn_id =>WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id) ;
252:
247: p_locator_id =>WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id,
248: p_lot_number =>WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number ,
249: p_serial_number =>NULL ,
250: p_object_type =>'A' ,
251: p_lpn_id =>WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id) ;
252:
253: gmi_reservation_util.println(' INV_MATERIAL_STATUS_GRP.Is_status_applicable returns ' || l_txn_allowed ) ;
254: End for #14168651
255: */
258: /* SAI MED */
259: /* Filter available inventory by move order subinventory and locator */
260: l_insert_allowed := TRUE ;
261: IF (mtl_org_rec.from_subinventory_code is not null) THEN
262: IF (WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code = mtl_org_rec.from_subinventory_code ) THEN
263: l_insert_allowed := TRUE ;
264: IF (mtl_org_rec.from_locator_id is not null) THEN
265: IF (WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id = mtl_org_rec.from_locator_id ) THEN
266: l_insert_allowed := TRUE ;
261: IF (mtl_org_rec.from_subinventory_code is not null) THEN
262: IF (WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code = mtl_org_rec.from_subinventory_code ) THEN
263: l_insert_allowed := TRUE ;
264: IF (mtl_org_rec.from_locator_id is not null) THEN
265: IF (WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id = mtl_org_rec.from_locator_id ) THEN
266: l_insert_allowed := TRUE ;
267: gmi_reservation_util.println(' Subinventory and Locator matches') ;
268: ELSE
269: l_insert_allowed := FALSE;
301: , order_by_string
302: )
303: Values
304: (
305: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).revision
306: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number
307: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_expiration_date
308: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code
309: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id
302: )
303: Values
304: (
305: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).revision
306: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number
307: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_expiration_date
308: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code
309: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id
310: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).cost_group_id
303: Values
304: (
305: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).revision
306: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number
307: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_expiration_date
308: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code
309: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id
310: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).cost_group_id
311: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).transaction_uom
304: (
305: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).revision
306: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number
307: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_expiration_date
308: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code
309: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id
310: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).cost_group_id
311: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).transaction_uom
312: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id
305: WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).revision
306: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number
307: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_expiration_date
308: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code
309: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id
310: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).cost_group_id
311: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).transaction_uom
312: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id
313: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number
306: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_number
307: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_expiration_date
308: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code
309: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id
310: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).cost_group_id
311: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).transaction_uom
312: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id
313: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number
314: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).onhand_qty
307: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lot_expiration_date
308: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code
309: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id
310: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).cost_group_id
311: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).transaction_uom
312: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id
313: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number
314: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).onhand_qty
315: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).secondary_onhand_qty
308: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).subinventory_code
309: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id
310: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).cost_group_id
311: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).transaction_uom
312: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id
313: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number
314: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).onhand_qty
315: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).secondary_onhand_qty
316: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code
309: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id
310: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).cost_group_id
311: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).transaction_uom
312: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id
313: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number
314: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).onhand_qty
315: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).secondary_onhand_qty
316: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code
317: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).consist_string
310: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).cost_group_id
311: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).transaction_uom
312: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id
313: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number
314: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).onhand_qty
315: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).secondary_onhand_qty
316: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code
317: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).consist_string
318: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).order_by_string
311: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).transaction_uom
312: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id
313: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number
314: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).onhand_qty
315: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).secondary_onhand_qty
316: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code
317: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).consist_string
318: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).order_by_string
319: );
312: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).lpn_id
313: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number
314: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).onhand_qty
315: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).secondary_onhand_qty
316: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code
317: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).consist_string
318: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).order_by_string
319: );
320: END IF ;
313: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).serial_number
314: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).onhand_qty
315: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).secondary_onhand_qty
316: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code
317: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).consist_string
318: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).order_by_string
319: );
320: END IF ;
321: END IF ;
314: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).onhand_qty
315: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).secondary_onhand_qty
316: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).grade_code
317: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).consist_string
318: ,WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).order_by_string
319: );
320: END IF ;
321: END IF ;
322: ELSE -- 13920680
319: );
320: END IF ;
321: END IF ;
322: ELSE -- 13920680
323: gmi_reservation_util.println(' Locator id ' || WMS_SEARCH_ORDER_GLOBALS_PVT.g_available_inv_tbl(i).locator_id ||
324: ' failed for security rules ' ) ;
325: END IF ; -- 13920680
326: WHEN OTHERS THEN NULL ;
327: