177: * If the transaction is an InterOrg transfer type, call the CostGroup
178: * API to determine cost groups.
179: *******************************************************************/
180: PROCEDURE insert_line_trx(
181: curlpnrec wms_container_pub.wms_container_content_rec_type
182: , v_trxtempid NUMBER
183: , v_trxaction NUMBER
184: , v_orgid NUMBER
185: , v_subinv VARCHAR2
453:
454: /********************************************************************
455: * Insert a row into MTL_TRANSACTION_LOTS_TEMP
456: *******************************************************************/
457: FUNCTION insert_lot_trx(curlpnrec wms_container_pub.wms_container_content_rec_type, trxtmpid NUMBER)
458: RETURN NUMBER IS
459: lotobjid NUMBER;
460: sertrxid NUMBER;
461: retval NUMBER;
583: * Explode the contents of the lpn and insert into MMTT, MSNT and MTLT
584: *******************************************************************/
585: FUNCTION explode_and_insert(p_lpn_id NUMBER, p_hdr_id NUMBER, p_mmtt IN OUT NOCOPY mtl_material_transactions_temp%ROWTYPE)
586: RETURN NUMBER IS
587: tb_lpn_cnts wms_container_pub.wms_container_tbl_type;
588: lpnitndx NUMBER;
589: curlpnrec wms_container_pub.wms_container_content_rec_type;
590: insrowcnt NUMBER := 0;
591: trxtmpid NUMBER;
585: FUNCTION explode_and_insert(p_lpn_id NUMBER, p_hdr_id NUMBER, p_mmtt IN OUT NOCOPY mtl_material_transactions_temp%ROWTYPE)
586: RETURN NUMBER IS
587: tb_lpn_cnts wms_container_pub.wms_container_tbl_type;
588: lpnitndx NUMBER;
589: curlpnrec wms_container_pub.wms_container_content_rec_type;
590: insrowcnt NUMBER := 0;
591: trxtmpid NUMBER;
592: sertrxid NUMBER;
593: l_pre_sertrxid NUMBER;
640: WMS_Container_PVT.Explode_LPN(1.0, fnd_api.g_false, fnd_api.g_false, ret_status, ret_msgcnt, ret_msgdata, p_lpn_id, 0, tb_lpn_cnts);
641:
642: IF ( ret_status <> fnd_api.g_ret_sts_success) THEN
643: IF (l_debug = 1) THEN
644: inv_log_util.TRACE('**Error: Failed in wms_container_pub.explode_lpn API :' || ret_msgdata, 'INV_LPN_TRX_PUB', 1);
645: END IF;
646:
647: RAISE fnd_api.g_exc_error;
648: END IF;
1969:
1970: /********************************************************************
1971: * Update the status of the LPN
1972: *******************************************************************/
1973: PROCEDURE update_lpn_status(v_lpn wms_container_pub.lpn) IS
1974: l_debug NUMBER := NVL(fnd_profile.VALUE('INV_DEBUG_TRACE'), 0);
1975: BEGIN
1976: WMS_Container_PVT.Modify_LPN (
1977: p_api_version => 1.0
3427: failedrowcnt NUMBER := 0;
3428: expldrowcnt NUMBER := 0;
3429: retval NUMBER := 0;
3430: v_mmtt mtl_material_transactions_temp%ROWTYPE;
3431: v_lpn wms_container_pub.lpn;
3432: v_deleterow BOOLEAN := FALSE; -- Should the original row in MMTT be deleted ?
3433: l_cst_grp VARCHAR2(30);
3434: l_req_id NUMBER;
3435: l_proc_mode NUMBER := p_proc_mode;
4773: l_debug NUMBER := NVL(fnd_profile.VALUE('INV_DEBUG_TRACE'), 0);
4774: l_progress VARCHAR2(500) := '0';
4775: l_msgdata VARCHAR2(1000);
4776: l_item_rec inv_validate.item;
4777: v_lpn wms_container_pub.lpn;
4778: v_lpn_ctx NUMBER;
4779: v_cnt_lpn_ctx NUMBER;
4780: v_xfrlpn_ctx NUMBER;
4781: v_autounpack NUMBER := 1;
5065: -- Update the context of lpn to resides in receiving
5066: -- if it's a adj of whole lpn. lpn_id = transfer_lpn_id
5067: IF (p_lpn_id = p_transfer_lpn_id) THEN
5068: UPDATE wms_license_plate_numbers
5069: SET lpn_context = wms_container_pub.lpn_context_rcv
5070: WHERE lpn_id = p_lpn_id;
5071: END IF;
5072: ELSE
5073: IF (l_debug = 1) THEN
5176: inv_log_util.TRACE('Got v_cnt_lpn_ctx='||v_cnt_lpn_ctx, 'INV_LPN_TRX_PUB', 9);
5177: END IF;
5178: END IF;
5179:
5180: IF ( v_cnt_lpn_ctx <> wms_container_pub.lpn_context_intransit ) THEN
5181: v_lpn.lpn_context := wms_container_pub.lpn_context_stores;
5182: END IF;
5183: ELSE
5184: -- For manual rcpt, both Inventory and Expense Internal orders lpns context
5177: END IF;
5178: END IF;
5179:
5180: IF ( v_cnt_lpn_ctx <> wms_container_pub.lpn_context_intransit ) THEN
5181: v_lpn.lpn_context := wms_container_pub.lpn_context_stores;
5182: END IF;
5183: ELSE
5184: -- For manual rcpt, both Inventory and Expense Internal orders lpns context
5185: -- should be marked as intransit for recieving
5182: END IF;
5183: ELSE
5184: -- For manual rcpt, both Inventory and Expense Internal orders lpns context
5185: -- should be marked as intransit for recieving
5186: v_lpn.lpn_context := wms_container_pub.lpn_context_intransit;
5187: END IF;
5188: ELSIF(p_transaction_action_id = inv_globals.g_action_issue
5189: AND p_transaction_source_type_id = inv_globals.g_sourcetype_wip) THEN
5190: -- For WIP Issues the LPN set to be defined but not used
5187: END IF;
5188: ELSIF(p_transaction_action_id = inv_globals.g_action_issue
5189: AND p_transaction_source_type_id = inv_globals.g_sourcetype_wip) THEN
5190: -- For WIP Issues the LPN set to be defined but not used
5191: v_lpn.lpn_context := wms_container_pub.lpn_context_pregenerated;
5192:
5193: IF (l_debug = 1) THEN
5194: inv_log_util.TRACE('WIP Issue, unpack all items', 'INV_LPN_TRX_PUB', 9);
5195: END IF;
5220: fnd_msg_pub.ADD;
5221: RAISE fnd_api.g_exc_error;
5222: END IF;
5223: ELSE
5224: v_lpn.lpn_context := wms_container_pub.lpn_context_stores; --ISSUED OUT
5225: END IF;
5226:
5227: -- For an Intransit Shipment, update the LPN with the shipmentNumber
5228: -- so that this LPN can be tracked during the corresponding receipt
5284: IF (p_lpn_id IS NULL
5285: AND p_transfer_lpn_id IS NOT NULL) THEN
5286: -- Change context of transfer lpn to recieving
5287: UPDATE wms_license_plate_numbers
5288: SET lpn_context = wms_container_pub.lpn_context_rcv
5289: , subinventory_code = nvl(l_sub,subinventory_code) --6374764
5290: , locator_id = nvl(l_loc_id,locator_id) --6374764
5291: WHERE lpn_id = p_transfer_lpn_id;
5292:
5339: );
5340:
5341: -- Change context of transfer lpn to recieving
5342: UPDATE wms_license_plate_numbers
5343: SET lpn_context = wms_container_pub.lpn_context_rcv
5344: , subinventory_code = nvl(l_sub,subinventory_code) --6374764
5345: , locator_id = nvl(l_loc_id,locator_id) --6374764
5346: WHERE lpn_id = p_transfer_lpn_id;
5347:
5381: WHERE parent_lpn_id = p_lpn_id;
5382:
5383: -- Change context of transfer lpn to recieving
5384: UPDATE wms_license_plate_numbers
5385: SET lpn_context = wms_container_pub.lpn_context_rcv
5386: , subinventory_code = nvl(l_sub,subinventory_code) --6374764
5387: , locator_id = nvl(l_loc_id,locator_id) --6374764
5388: WHERE lpn_id = p_lpn_id;
5389:
5480: -- Since correction is in same lpn, need to change context
5481: -- of lpn to recieving
5482: -- Change context of transfer lpn to recieving
5483: UPDATE wms_license_plate_numbers
5484: SET lpn_context = wms_container_pub.lpn_context_rcv
5485: WHERE lpn_id = p_lpn_id;
5486: END IF;
5487: ELSE
5488: -- Default Action
5774: INTO v_lpn_ctx
5775: FROM wms_license_plate_numbers
5776: WHERE lpn_id = v_lpn.lpn_id;
5777:
5778: IF (v_lpn_ctx <> wms_container_pub.lpn_context_picked) THEN
5779: v_lpn.lpn_context := wms_container_pub.lpn_context_inv;
5780: ELSE
5781: v_lpn.lpn_context := wms_container_pub.lpn_context_picked;
5782: END IF;
5775: FROM wms_license_plate_numbers
5776: WHERE lpn_id = v_lpn.lpn_id;
5777:
5778: IF (v_lpn_ctx <> wms_container_pub.lpn_context_picked) THEN
5779: v_lpn.lpn_context := wms_container_pub.lpn_context_inv;
5780: ELSE
5781: v_lpn.lpn_context := wms_container_pub.lpn_context_picked;
5782: END IF;
5783:
5777:
5778: IF (v_lpn_ctx <> wms_container_pub.lpn_context_picked) THEN
5779: v_lpn.lpn_context := wms_container_pub.lpn_context_inv;
5780: ELSE
5781: v_lpn.lpn_context := wms_container_pub.lpn_context_picked;
5782: END IF;
5783:
5784: v_lpn.organization_id := p_organization_id;
5785: v_lpn.subinventory_code := p_subinventory_code;
5860: IF (l_debug = 1) THEN
5861: inv_log_util.TRACE('SUBXFER from LPN context=' || v_lpn_ctx, 'INV_LPN_TRX_PUB', 9);
5862: END IF;
5863:
5864: IF (v_lpn_ctx = wms_container_pub.lpn_context_picked) THEN
5865: split_delivery(
5866: p_tempid => p_transaction_temp_id
5867: , p_lpn_id => p_lpn_id
5868: , p_xfr_lpn_id => p_transfer_lpn_id
5894: INTO v_lpn_ctx
5895: FROM wms_license_plate_numbers
5896: WHERE lpn_id = p_lpn_id;
5897:
5898: IF (v_lpn_ctx <> wms_container_pub.lpn_context_inv
5899: AND v_lpn_ctx <> wms_container_pub.lpn_context_picked) THEN
5900: x_proc_msg := 'Error. Invalid LPN context for Transfer Trx:' || v_lpn_ctx;
5901:
5902: IF (l_debug = 1) THEN
5895: FROM wms_license_plate_numbers
5896: WHERE lpn_id = p_lpn_id;
5897:
5898: IF (v_lpn_ctx <> wms_container_pub.lpn_context_inv
5899: AND v_lpn_ctx <> wms_container_pub.lpn_context_picked) THEN
5900: x_proc_msg := 'Error. Invalid LPN context for Transfer Trx:' || v_lpn_ctx;
5901:
5902: IF (l_debug = 1) THEN
5903: inv_log_util.TRACE('Error. Invalid LPN context for Transfer Trx:' || v_lpn_ctx, 'INV_LPN_TRX_PUB', 1);
5938: SET lpn_context = v_lpn_ctx
5939: , subinventory_code = p_subinventory_code
5940: , locator_id = p_locator_id
5941: WHERE lpn_id = p_lpn_id
5942: AND lpn_context = wms_container_pub.lpn_context_pregenerated;
5943: END IF;
5944: END IF;
5945:
5946: IF (p_transaction_action_id = inv_globals.g_action_orgxfr) THEN
6002:
6003: -- For Sub transfers reservations should be transfered
6004: -- for content lpn of who's context is not picked
6005: IF (p_transaction_action_id = inv_globals.g_action_subxfr
6006: AND(l_lpn_ctx_tmp <> wms_container_pub.lpn_context_picked
6007: AND NVL(l_system_task_type, -1) <> 7)) THEN
6008: IF (l_debug = 1) THEN
6009: inv_log_util.TRACE('Sub Xfer of LPN, calling Transfer_LPN_Reservations ', 'INV_LPN_TRX_PUB', 9);
6010: END IF;
6045: -- For Sub transfers reservations should be transfered
6046: -- for content lpn of who's context is not picked
6047: IF (
6048: p_transaction_action_id = inv_globals.g_action_subxfr
6049: AND(v_cnt_lpn_ctx <> wms_container_pub.lpn_context_picked
6050: AND NVL(l_system_task_type, -1) <> 7)
6051: ) -- bug 2879208 added nv for 3240617
6052: THEN
6053: IF (l_debug = 1) THEN
6090: inv_log_util.TRACE('Done with call to Transfer_LPN_Reservations', 'INV_LPN_TRX_PUB', 9);
6091: END IF;
6092: END IF;
6093:
6094: /*if ( v_lpn_ctx <> WMS_Container_PUB.LPN_CONTEXT_PICKED ) then
6095: v_lpn.lpn_context := WMS_Container_PUB.LPN_CONTEXT_INV;
6096: else
6097: v_lpn.lpn_context := WMS_Container_PUB.LPN_CONTEXT_PICKED;
6098: end if;
6091: END IF;
6092: END IF;
6093:
6094: /*if ( v_lpn_ctx <> WMS_Container_PUB.LPN_CONTEXT_PICKED ) then
6095: v_lpn.lpn_context := WMS_Container_PUB.LPN_CONTEXT_INV;
6096: else
6097: v_lpn.lpn_context := WMS_Container_PUB.LPN_CONTEXT_PICKED;
6098: end if;
6099: */
6093:
6094: /*if ( v_lpn_ctx <> WMS_Container_PUB.LPN_CONTEXT_PICKED ) then
6095: v_lpn.lpn_context := WMS_Container_PUB.LPN_CONTEXT_INV;
6096: else
6097: v_lpn.lpn_context := WMS_Container_PUB.LPN_CONTEXT_PICKED;
6098: end if;
6099: */
6100: v_lpn.lpn_id := p_content_lpn_id;
6101: v_lpn.organization_id := v_xfr_org;
6138: RAISE fnd_api.g_exc_error;
6139: END IF;
6140: ELSE
6141: IF ( l_system_task_type = 7 AND
6142: v_cnt_lpn_ctx = wms_container_pub.lpn_loaded_in_stage )
6143: THEN
6144: -- Bug 4247497 Staging Move. Context should be changed to pick
6145: v_lpn.lpn_context := wms_container_pub.lpn_context_picked;
6146: ELSIF (v_cnt_lpn_ctx <> wms_container_pub.lpn_context_picked) THEN
6141: IF ( l_system_task_type = 7 AND
6142: v_cnt_lpn_ctx = wms_container_pub.lpn_loaded_in_stage )
6143: THEN
6144: -- Bug 4247497 Staging Move. Context should be changed to pick
6145: v_lpn.lpn_context := wms_container_pub.lpn_context_picked;
6146: ELSIF (v_cnt_lpn_ctx <> wms_container_pub.lpn_context_picked) THEN
6147: v_lpn.lpn_context := wms_container_pub.lpn_context_inv;
6148: ELSE
6149: --Bug 5509764
6142: v_cnt_lpn_ctx = wms_container_pub.lpn_loaded_in_stage )
6143: THEN
6144: -- Bug 4247497 Staging Move. Context should be changed to pick
6145: v_lpn.lpn_context := wms_container_pub.lpn_context_picked;
6146: ELSIF (v_cnt_lpn_ctx <> wms_container_pub.lpn_context_picked) THEN
6147: v_lpn.lpn_context := wms_container_pub.lpn_context_inv;
6148: ELSE
6149: --Bug 5509764
6150: --For direct org transfer against an internal req, set the lpn_context
6143: THEN
6144: -- Bug 4247497 Staging Move. Context should be changed to pick
6145: v_lpn.lpn_context := wms_container_pub.lpn_context_picked;
6146: ELSIF (v_cnt_lpn_ctx <> wms_container_pub.lpn_context_picked) THEN
6147: v_lpn.lpn_context := wms_container_pub.lpn_context_inv;
6148: ELSE
6149: --Bug 5509764
6150: --For direct org transfer against an internal req, set the lpn_context
6151: --to "In Inventory" from Picked to reflect the correct status
6153: p_transaction_action_id = inv_globals.G_ACTION_ORGXFR) THEN
6154: IF (l_debug = 1) THEN
6155: inv_log_util.trace('int req direct org xfr. setting lpn_ctxt to in inventory','INV_LPN_TRX_PUB',1);
6156: END IF;
6157: v_lpn.lpn_context := wms_container_pub.lpn_context_inv;
6158: ELSE
6159: v_lpn.lpn_context := wms_container_pub.lpn_context_picked;
6160: END IF; --END IF check txn_source_type intorder and action direct org xfr
6161: END IF; --END IF LPN context is picked
6155: inv_log_util.trace('int req direct org xfr. setting lpn_ctxt to in inventory','INV_LPN_TRX_PUB',1);
6156: END IF;
6157: v_lpn.lpn_context := wms_container_pub.lpn_context_inv;
6158: ELSE
6159: v_lpn.lpn_context := wms_container_pub.lpn_context_picked;
6160: END IF; --END IF check txn_source_type intorder and action direct org xfr
6161: END IF; --END IF LPN context is picked
6162:
6163: v_lpn.subinventory_code := p_transfer_subinventory;
6166:
6167: -- Bug 4247497 Moving update of context to TM. If this is a stagexfr transaction
6168: -- then lpn-context should be updated to 'picked'
6169: IF ( p_transaction_action_id = inv_globals.G_ACTION_STGXFR ) THEN
6170: v_lpn.lpn_context := wms_container_pub.LPN_CONTEXT_PICKED;
6171: END IF;
6172:
6173: /** moved update here to fix bug3299521, this way we would avoid updating
6174: the parent_lpn context for unpacked inner lpns**/
6189: -- If the item/lpn is transfered to another LPN, then update the
6190: -- status of that LPN, provided the context is 2, 3, or 8
6191: -- and xfr sub is not non-LPN controlled sub
6192: IF (
6193: (v_xfrlpn_ctx = wms_container_pub.lpn_context_wip)
6194: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_rcv)
6195: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_packing)
6196: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_pregenerated)
6197: )
6190: -- status of that LPN, provided the context is 2, 3, or 8
6191: -- and xfr sub is not non-LPN controlled sub
6192: IF (
6193: (v_xfrlpn_ctx = wms_container_pub.lpn_context_wip)
6194: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_rcv)
6195: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_packing)
6196: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_pregenerated)
6197: )
6198: AND(v_autounpack <> 2) THEN
6191: -- and xfr sub is not non-LPN controlled sub
6192: IF (
6193: (v_xfrlpn_ctx = wms_container_pub.lpn_context_wip)
6194: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_rcv)
6195: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_packing)
6196: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_pregenerated)
6197: )
6198: AND(v_autounpack <> 2) THEN
6199: -- If context is pre-generated, then inherit the context of the contentLPN or fromLPN
6192: IF (
6193: (v_xfrlpn_ctx = wms_container_pub.lpn_context_wip)
6194: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_rcv)
6195: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_packing)
6196: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_pregenerated)
6197: )
6198: AND(v_autounpack <> 2) THEN
6199: -- If context is pre-generated, then inherit the context of the contentLPN or fromLPN
6200: -- if that context is INV or PICKED
6197: )
6198: AND(v_autounpack <> 2) THEN
6199: -- If context is pre-generated, then inherit the context of the contentLPN or fromLPN
6200: -- if that context is INV or PICKED
6201: IF (v_xfrlpn_ctx = wms_container_pub.lpn_context_pregenerated)
6202: AND NVL(v_cnt_lpn_ctx, v_lpn_ctx) NOT IN
6203: (
6204: wms_container_pub.lpn_context_wip
6205: , wms_container_pub.lpn_context_rcv
6200: -- if that context is INV or PICKED
6201: IF (v_xfrlpn_ctx = wms_container_pub.lpn_context_pregenerated)
6202: AND NVL(v_cnt_lpn_ctx, v_lpn_ctx) NOT IN
6203: (
6204: wms_container_pub.lpn_context_wip
6205: , wms_container_pub.lpn_context_rcv
6206: , wms_container_pub.lpn_context_packing
6207: , wms_container_pub.lpn_context_vendor
6208: ) THEN
6201: IF (v_xfrlpn_ctx = wms_container_pub.lpn_context_pregenerated)
6202: AND NVL(v_cnt_lpn_ctx, v_lpn_ctx) NOT IN
6203: (
6204: wms_container_pub.lpn_context_wip
6205: , wms_container_pub.lpn_context_rcv
6206: , wms_container_pub.lpn_context_packing
6207: , wms_container_pub.lpn_context_vendor
6208: ) THEN
6209: v_lpn.lpn_context := NVL(v_cnt_lpn_ctx, v_lpn_ctx);
6202: AND NVL(v_cnt_lpn_ctx, v_lpn_ctx) NOT IN
6203: (
6204: wms_container_pub.lpn_context_wip
6205: , wms_container_pub.lpn_context_rcv
6206: , wms_container_pub.lpn_context_packing
6207: , wms_container_pub.lpn_context_vendor
6208: ) THEN
6209: v_lpn.lpn_context := NVL(v_cnt_lpn_ctx, v_lpn_ctx);
6210:
6203: (
6204: wms_container_pub.lpn_context_wip
6205: , wms_container_pub.lpn_context_rcv
6206: , wms_container_pub.lpn_context_packing
6207: , wms_container_pub.lpn_context_vendor
6208: ) THEN
6209: v_lpn.lpn_context := NVL(v_cnt_lpn_ctx, v_lpn_ctx);
6210:
6211: IF (l_debug = 1) THEN
6214: END IF;
6215: ELSE
6216: -- Bug 4247497 Moving update of context to TM
6217: IF ( p_transaction_action_id = inv_globals.g_action_stgxfr ) THEN
6218: v_lpn.lpn_context := wms_container_pub.lpn_context_picked;
6219: ELSE
6220: v_lpn.lpn_context := wms_container_pub.lpn_context_inv;
6221: END IF;
6222: END IF;
6216: -- Bug 4247497 Moving update of context to TM
6217: IF ( p_transaction_action_id = inv_globals.g_action_stgxfr ) THEN
6218: v_lpn.lpn_context := wms_container_pub.lpn_context_picked;
6219: ELSE
6220: v_lpn.lpn_context := wms_container_pub.lpn_context_inv;
6221: END IF;
6222: END IF;
6223:
6224: v_lpn.lpn_id := p_transfer_lpn_id;
6226: v_lpn.subinventory_code := p_transfer_subinventory;
6227: v_lpn.locator_id := p_transfer_to_location;
6228: update_lpn_status(v_lpn);
6229: ELSIF(
6230: v_xfrlpn_ctx <> wms_container_pub.lpn_context_inv
6231: AND v_xfrlpn_ctx <> wms_container_pub.lpn_context_picked
6232: AND v_xfrlpn_ctx <> wms_container_pub.lpn_context_pregenerated
6233: AND v_xfrlpn_ctx <> wms_container_pub.lpn_context_packing /*added for 3160462*/
6234: ) THEN
6227: v_lpn.locator_id := p_transfer_to_location;
6228: update_lpn_status(v_lpn);
6229: ELSIF(
6230: v_xfrlpn_ctx <> wms_container_pub.lpn_context_inv
6231: AND v_xfrlpn_ctx <> wms_container_pub.lpn_context_picked
6232: AND v_xfrlpn_ctx <> wms_container_pub.lpn_context_pregenerated
6233: AND v_xfrlpn_ctx <> wms_container_pub.lpn_context_packing /*added for 3160462*/
6234: ) THEN
6235: -- Verify that the context of this LPN is 'Resides in Inventory'
6228: update_lpn_status(v_lpn);
6229: ELSIF(
6230: v_xfrlpn_ctx <> wms_container_pub.lpn_context_inv
6231: AND v_xfrlpn_ctx <> wms_container_pub.lpn_context_picked
6232: AND v_xfrlpn_ctx <> wms_container_pub.lpn_context_pregenerated
6233: AND v_xfrlpn_ctx <> wms_container_pub.lpn_context_packing /*added for 3160462*/
6234: ) THEN
6235: -- Verify that the context of this LPN is 'Resides in Inventory'
6236: x_proc_msg := 'Error. Invalid LPN context for XFR_LPN:' || v_xfrlpn_ctx;
6229: ELSIF(
6230: v_xfrlpn_ctx <> wms_container_pub.lpn_context_inv
6231: AND v_xfrlpn_ctx <> wms_container_pub.lpn_context_picked
6232: AND v_xfrlpn_ctx <> wms_container_pub.lpn_context_pregenerated
6233: AND v_xfrlpn_ctx <> wms_container_pub.lpn_context_packing /*added for 3160462*/
6234: ) THEN
6235: -- Verify that the context of this LPN is 'Resides in Inventory'
6236: x_proc_msg := 'Error. Invalid LPN context for XFR_LPN:' || v_xfrlpn_ctx;
6237:
6316: , p_sec_qty => abs(l_secondary_trx_quantity) --INVCONV kkillams
6317: , p_sec_uom => p_secondary_uom_code --INVCONV kkillams
6318: , p_source_trx_id => p_source_transaction_id
6319: );
6320: ELSIF(v_xfrlpn_ctx = wms_container_pub.lpn_context_packing) THEN
6321: -- Since the transfer sub is non lpn controlled, change xfer lpn
6322: -- is not packed into and should become defined but not used again.
6323: v_lpn.organization_id := v_xfr_org;
6324: v_lpn.lpn_id := p_transfer_lpn_id;
6321: -- Since the transfer sub is non lpn controlled, change xfer lpn
6322: -- is not packed into and should become defined but not used again.
6323: v_lpn.organization_id := v_xfr_org;
6324: v_lpn.lpn_id := p_transfer_lpn_id;
6325: v_lpn.lpn_context := wms_container_pub.lpn_context_pregenerated;
6326: update_lpn_status(v_lpn);
6327: END IF;
6328: END IF;
6329:
6344: -- If the lpn is transfered update the status of that LPN
6345: -- provided the context is 2, 3, or 8
6346: IF (p_transaction_source_type_id <> inv_globals.g_sourcetype_salesorder)
6347: AND(
6348: (v_xfrlpn_ctx = wms_container_pub.lpn_context_wip)
6349: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_rcv)
6350: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_packing)
6351: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_pregenerated)
6352: ) THEN
6345: -- provided the context is 2, 3, or 8
6346: IF (p_transaction_source_type_id <> inv_globals.g_sourcetype_salesorder)
6347: AND(
6348: (v_xfrlpn_ctx = wms_container_pub.lpn_context_wip)
6349: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_rcv)
6350: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_packing)
6351: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_pregenerated)
6352: ) THEN
6353: v_lpn.lpn_context := wms_container_pub.lpn_context_inv;
6346: IF (p_transaction_source_type_id <> inv_globals.g_sourcetype_salesorder)
6347: AND(
6348: (v_xfrlpn_ctx = wms_container_pub.lpn_context_wip)
6349: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_rcv)
6350: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_packing)
6351: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_pregenerated)
6352: ) THEN
6353: v_lpn.lpn_context := wms_container_pub.lpn_context_inv;
6354: ELSE
6347: AND(
6348: (v_xfrlpn_ctx = wms_container_pub.lpn_context_wip)
6349: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_rcv)
6350: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_packing)
6351: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_pregenerated)
6352: ) THEN
6353: v_lpn.lpn_context := wms_container_pub.lpn_context_inv;
6354: ELSE
6355: -- bug 5620764
6349: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_rcv)
6350: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_packing)
6351: OR(v_xfrlpn_ctx = wms_container_pub.lpn_context_pregenerated)
6352: ) THEN
6353: v_lpn.lpn_context := wms_container_pub.lpn_context_inv;
6354: ELSE
6355: -- bug 5620764
6356: -- For staging transfer transactions change context to picked
6357: v_lpn.lpn_context := wms_container_pub.lpn_context_picked;
6353: v_lpn.lpn_context := wms_container_pub.lpn_context_inv;
6354: ELSE
6355: -- bug 5620764
6356: -- For staging transfer transactions change context to picked
6357: v_lpn.lpn_context := wms_container_pub.lpn_context_picked;
6358: --v_lpn.lpn_context := NULL;
6359:
6360: -- Verify that the context of this LPN is 'Resides in Inventory'
6361: IF (
6358: --v_lpn.lpn_context := NULL;
6359:
6360: -- Verify that the context of this LPN is 'Resides in Inventory'
6361: IF (
6362: v_xfrlpn_ctx <> wms_container_pub.lpn_context_inv
6363: AND v_xfrlpn_ctx <> wms_container_pub.lpn_context_picked
6364: AND v_xfrlpn_ctx <> wms_container_pub.lpn_context_packing
6365: ) THEN
6366: x_proc_msg := 'Error. Invalid LPN context for XFR_LPN:' || v_xfrlpn_ctx;
6359:
6360: -- Verify that the context of this LPN is 'Resides in Inventory'
6361: IF (
6362: v_xfrlpn_ctx <> wms_container_pub.lpn_context_inv
6363: AND v_xfrlpn_ctx <> wms_container_pub.lpn_context_picked
6364: AND v_xfrlpn_ctx <> wms_container_pub.lpn_context_packing
6365: ) THEN
6366: x_proc_msg := 'Error. Invalid LPN context for XFR_LPN:' || v_xfrlpn_ctx;
6367:
6360: -- Verify that the context of this LPN is 'Resides in Inventory'
6361: IF (
6362: v_xfrlpn_ctx <> wms_container_pub.lpn_context_inv
6363: AND v_xfrlpn_ctx <> wms_container_pub.lpn_context_picked
6364: AND v_xfrlpn_ctx <> wms_container_pub.lpn_context_packing
6365: ) THEN
6366: x_proc_msg := 'Error. Invalid LPN context for XFR_LPN:' || v_xfrlpn_ctx;
6367:
6368: IF (l_debug = 1) THEN
6400: IF (l_debug = 1) THEN
6401: inv_log_util.TRACE('SUBXFER cont LPN context=' || v_cnt_lpn_ctx, 'INV_LPN_TRX_PUB', 9);
6402: END IF;
6403:
6404: IF (v_cnt_lpn_ctx = wms_container_pub.lpn_context_picked)
6405: OR (NVL(l_system_task_type, -1) = 7) THEN --Bug 3620318
6406: --A call to transfer the reservation is also needed if LPN is of the picked context
6407: --Consolidating lpn across subinventories, must transfer reservations
6408: inv_reservation_pvt.transfer_lpn_trx_reservation(
6463: -- Receiving. However, after packing, the LPN has to be Inventory.
6464: -- Note: Since only the context of LPN is changed, directly modifying on Table
6465: -- instead of calling modify_LPN API except when the context is picking
6466: UPDATE wms_license_plate_numbers
6467: SET lpn_context = wms_container_pub.lpn_context_inv
6468: WHERE lpn_id = p_transfer_lpn_id
6469: AND lpn_context <> wms_container_pub.lpn_context_picked;
6470: /***** Actions for UNPACK transactions ****/
6471: ELSIF(p_transaction_action_id = inv_globals.g_action_containerunpack) THEN
6465: -- instead of calling modify_LPN API except when the context is picking
6466: UPDATE wms_license_plate_numbers
6467: SET lpn_context = wms_container_pub.lpn_context_inv
6468: WHERE lpn_id = p_transfer_lpn_id
6469: AND lpn_context <> wms_container_pub.lpn_context_picked;
6470: /***** Actions for UNPACK transactions ****/
6471: ELSIF(p_transaction_action_id = inv_globals.g_action_containerunpack) THEN
6472: IF (l_debug = 1) THEN
6473: inv_log_util.TRACE(' Action = UnPack', 'INV_LPN_TRX_PUB', 9);
6508: INTO v_lpn_ctx
6509: FROM wms_license_plate_numbers
6510: WHERE lpn_id = p_lpn_id;
6511:
6512: IF (v_lpn_ctx = wms_container_pub.lpn_context_picked) THEN
6513: split_delivery(
6514: p_tempid => p_transaction_temp_id
6515: , p_lpn_id => p_lpn_id
6516: , p_xfr_lpn_id => p_transfer_lpn_id
6539:
6540: -- If context is pre-generated, then inherit the context of the contentLPN or fromLPN
6541: -- If that context is INV or PICKED
6542: IF (
6543: v_xfrlpn_ctx = wms_container_pub.lpn_context_pregenerated
6544: AND v_lpn_ctx NOT IN
6545: (
6546: wms_container_pub.lpn_context_wip
6547: , wms_container_pub.lpn_context_rcv
6542: IF (
6543: v_xfrlpn_ctx = wms_container_pub.lpn_context_pregenerated
6544: AND v_lpn_ctx NOT IN
6545: (
6546: wms_container_pub.lpn_context_wip
6547: , wms_container_pub.lpn_context_rcv
6548: , wms_container_pub.lpn_context_packing
6549: , wms_container_pub.lpn_context_vendor
6550: )
6543: v_xfrlpn_ctx = wms_container_pub.lpn_context_pregenerated
6544: AND v_lpn_ctx NOT IN
6545: (
6546: wms_container_pub.lpn_context_wip
6547: , wms_container_pub.lpn_context_rcv
6548: , wms_container_pub.lpn_context_packing
6549: , wms_container_pub.lpn_context_vendor
6550: )
6551: ) THEN
6544: AND v_lpn_ctx NOT IN
6545: (
6546: wms_container_pub.lpn_context_wip
6547: , wms_container_pub.lpn_context_rcv
6548: , wms_container_pub.lpn_context_packing
6549: , wms_container_pub.lpn_context_vendor
6550: )
6551: ) THEN
6552: v_lpn.lpn_id := p_transfer_lpn_id;
6545: (
6546: wms_container_pub.lpn_context_wip
6547: , wms_container_pub.lpn_context_rcv
6548: , wms_container_pub.lpn_context_packing
6549: , wms_container_pub.lpn_context_vendor
6550: )
6551: ) THEN
6552: v_lpn.lpn_id := p_transfer_lpn_id;
6553: v_lpn.lpn_context := v_lpn_ctx;