[Home] [Help]
451: --Added bug 3978111
452: END;
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;
605: lotobjid NUMBER;
606: v_lasttrxtmpid NUMBER;
607: v_lastitemqty NUMBER;
608: v_lastitemsecqty NUMBER; ---INVCONV KKILLAMS
609: lastlotnum mtl_transaction_lots_temp.lot_number%TYPE;
610: itemqtychanged BOOLEAN := FALSE;
611: lotqtychanged BOOLEAN := FALSE;
612: lotqty NUMBER;
613: lotsecqty NUMBER; --invconv kkillams
836: IF (l_debug = 1) THEN
837: inv_log_util.TRACE('** Going to update last Lot rec1 qty = ' || lotqty, 'INV_LPN_TRX_PUB', 9);
838: END IF;
839:
840: UPDATE mtl_transaction_lots_temp
841: SET transaction_quantity = lotqty
842: , primary_quantity = lotqty * l_conv_fact /*Bug#5486052.*/
843: , secondary_quantity = lotsecqty --INVCONV kkillams
844: WHERE transaction_temp_id = v_lasttrxtmpid
945: IF (l_debug = 1) THEN
946: inv_log_util.TRACE('** Going to update last Lot rec2 qty = ' || lotqty, 'INV_LPN_TRX_PUB', 9);
947: END IF;
948:
949: UPDATE mtl_transaction_lots_temp
950: SET transaction_quantity = lotqty
951: , primary_quantity = lotqty * l_conv_fact /*Bug#5486052.*/
952: , secondary_quantity = lotsecqty --INVCONV kkillams
953: WHERE transaction_temp_id = v_lasttrxtmpid
1075: IF (l_debug = 1) THEN
1076: inv_log_util.TRACE('** Going to upd lst lot3. qty = ' || lotqty, 'INV_LPN_TRX_PUB', 9);
1077: END IF;
1078:
1079: UPDATE mtl_transaction_lots_temp
1080: SET transaction_quantity = lotqty
1081: , primary_quantity = lotqty * l_conv_fact /*Bug#5486052.*/
1082: , secondary_quantity = lotsecqty --INVCONV kkillams
1083: WHERE transaction_temp_id = v_lasttrxtmpid
1242: p_mmtt.secondary_transaction_quantity := CASE WHEN v_lastitemsecqty <> 0 THEN v_lastitemsecqty ELSE p_mmtt.secondary_transaction_quantity END; --INVCONV kkillams
1243: itemqtychanged := FALSE;
1244:
1245: IF (lotqtychanged) THEN
1246: UPDATE mtl_transaction_lots_temp
1247: SET transaction_quantity = lotqty
1248: , primary_quantity = lotqty * l_conv_fact /*Bug#5486052.*/
1249: , secondary_quantity = lotsecqty --INVCONV kkillams
1250: WHERE transaction_temp_id = v_lasttrxtmpid
1467: v_sertrxid NUMBER;
1468: v_lotfound BOOLEAN := FALSE;
1469: v_serfound BOOLEAN := FALSE;
1470: item_id NUMBER := NULL;
1471: v_lotnum mtl_transaction_lots_temp.lot_number%TYPE;
1472: v_lotqty NUMBER;
1473: v_lotsecqty NUMBER;
1474: v_serqty NUMBER;
1475: l_operation NUMBER := p_operation;
1486: , primary_quantity
1487: , transaction_quantity
1488: , secondary_quantity
1489: , serial_transaction_temp_id
1490: FROM mtl_transaction_lots_temp
1491: WHERE transaction_temp_id = p_tempid;
1492:
1493: l_debug NUMBER := NVL(fnd_profile.VALUE('INV_DEBUG_TRACE'), 0);
1494: BEGIN
3010: , primary_quantity
3011: , serial_transaction_temp_id
3012: , secondary_quantity
3013: , secondary_unit_of_measure
3014: FROM mtl_transaction_lots_temp
3015: WHERE transaction_temp_id = p_tempid
3016: ORDER BY lot_number;
3017: BEGIN
3018: -- Check if pricing is tracked by secondary qty
3330: /* *****************************************************
3331: CURSOR c_mtlt (p_transaction_temp_id NUMBER) IS
3332: SELECT lot_number
3333: ,primary_quantity
3334: FROM mtl_transaction_lots_temp
3335: WHERE transaction_temp_id = p_transaction_temp_id;
3336: *****************************************************
3337:
3338:
4283:
4284: -- Remove from MSNT rows with same MTNT transaction_temp_id
4285: DELETE FROM mtl_serial_numbers_temp
4286: WHERE transaction_temp_id IN(SELECT serial_transaction_temp_id
4287: FROM mtl_transaction_lots_temp
4288: WHERE transaction_temp_id IN(SELECT transaction_temp_id
4289: FROM mtl_material_transactions_temp
4290: WHERE transaction_header_id = p_trx_hdr_id -- Bug 5748351
4291: AND transaction_batch_id = v_mmtt.transaction_batch_id));
4290: WHERE transaction_header_id = p_trx_hdr_id -- Bug 5748351
4291: AND transaction_batch_id = v_mmtt.transaction_batch_id));
4292:
4293: -- Remove from MTLT rows with same MMTT transaction_temp_id
4294: DELETE FROM mtl_transaction_lots_temp
4295: WHERE transaction_temp_id IN(SELECT transaction_temp_id
4296: FROM mtl_material_transactions_temp
4297: WHERE transaction_header_id = p_trx_hdr_id -- Bug 5748351
4298: AND transaction_batch_id = v_mmtt.transaction_batch_id);
4326:
4327: -- Remove from MSNT rows with same MTNT transaction_temp_id
4328: DELETE FROM mtl_serial_numbers_temp
4329: WHERE transaction_temp_id IN(SELECT serial_transaction_temp_id
4330: FROM mtl_transaction_lots_temp
4331: WHERE transaction_temp_id = v_mmtt.transaction_temp_id);
4332:
4333: -- Remove from MTLT rows with same MMTT transaction_temp_id
4334: DELETE FROM mtl_transaction_lots_temp
4330: FROM mtl_transaction_lots_temp
4331: WHERE transaction_temp_id = v_mmtt.transaction_temp_id);
4332:
4333: -- Remove from MTLT rows with same MMTT transaction_temp_id
4334: DELETE FROM mtl_transaction_lots_temp
4335: WHERE transaction_temp_id = v_mmtt.transaction_temp_id;
4336:
4337: -- Remove from MMTT rows with same transaction group id
4338: DELETE FROM mtl_material_transactions_temp
4690:
4691: -- Remove from MSNT rows with same MTNT Transaction_header_id
4692: DELETE FROM mtl_serial_numbers_temp
4693: WHERE transaction_temp_id IN(SELECT serial_transaction_temp_id
4694: FROM mtl_transaction_lots_temp
4695: WHERE transaction_temp_id IN(SELECT transaction_temp_id
4696: FROM mtl_material_transactions_temp
4697: WHERE transaction_header_id = p_trx_hdr_id));
4698:
4696: FROM mtl_material_transactions_temp
4697: WHERE transaction_header_id = p_trx_hdr_id));
4698:
4699: -- Remove from MTLT rows with same MMTT Transaction_header_id
4700: DELETE FROM mtl_transaction_lots_temp
4701: WHERE transaction_temp_id IN(SELECT transaction_temp_id
4702: FROM mtl_material_transactions_temp
4703: WHERE transaction_header_id = p_trx_hdr_id);
4704:
6692: IF SQL%ROWCOUNT = 0 THEN
6693: DELETE FROM mtl_serial_numbers_temp
6694: WHERE transaction_temp_id IN(
6695: SELECT serial_transaction_temp_id
6696: FROM mtl_transaction_lots_temp
6697: WHERE transaction_temp_id =
6698: (SELECT transaction_temp_id
6699: FROM mtl_material_transactions_temp
6700: WHERE transaction_temp_id = p_transaction_temp_id
6704: IF (l_debug = 1) THEN
6705: inv_log_util.TRACE('* No of MSNT records deleted =' || SQL%ROWCOUNT, 'INV_LPN_TRX_PUB', 1);
6706: END IF;
6707:
6708: DELETE FROM mtl_transaction_lots_temp
6709: WHERE transaction_temp_id = (SELECT transaction_temp_id
6710: FROM mtl_material_transactions_temp
6711: WHERE transaction_temp_id = p_transaction_temp_id
6712: AND inventory_item_id = -1);