1: PACKAGE BODY INV_MATERIAL_STATUS_GRP as
2: /* $Header: INVMSGRB.pls 120.34.12010000.2 2008/10/24 10:26:09 aambulka ship $ */
3:
4:
5:
3:
4:
5:
6: -- Global constant holding package name
7: g_pkg_name constant varchar2(50) := 'INV_MATERIAL_STATUS_GRP';
8:
9: g_status_id NUMBER;
10: g_transaction_type_id NUMBER;
11: g_is_allowed VARCHAR2(1);
651: l_msg_data VARCHAR2(256);
652: BEGIN
653:
654:
655: allowed := INV_MATERIAL_STATUS_GRP.is_trx_allowed(
656: p_status_id =>p_status_id
657: ,p_transaction_type_id=> p_transaction_type_id
658: ,x_return_status => l_return_status
659: ,x_msg_count => l_msg_count
748: l_return_status VARCHAR2(1);
749: BEGIN
750:
751: if (g_debug = 1) then
752: inv_trx_util_pub.TRACE('inside non-overloaded is_status_applicable ', 'INV_MATERIAL_STATUS_GRP', 14);
753: end if;
754:
755: l_return_status:= is_status_applicable(p_wms_installed ,
756: p_trx_status_enabled ,
960: l_serial_status_enabled := p_serial_status_enabled;
961: -- Onhand Material Status Support: We need lot and serial control even if the object type is not lot or serial.
962: if ( (p_lot_status_enabled is null) or
963: (p_serial_status_enabled is null) )then
964: INV_MATERIAL_STATUS_GRP.get_lot_serial_status_control(
965: p_organization_id =>p_organization_id
966: , p_inventory_item_id =>p_inventory_item_id
967: , x_return_status =>l_return_status
968: , x_msg_count =>l_msg_count
996: end if;
997: /* Bug 6918409 */
998:
999: if (g_debug = 1) then
1000: inv_trx_util_pub.TRACE('default org status id ' || l_default_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
1001: end if;
1002:
1003: if (p_sub_code is not null ) and (p_object_type = 'Z' or p_object_type = 'A') then
1004: if(( p_organization_id <> nvl(g_isa_organization_id,-9999) ) or
1019: if (p_inventory_item_id is not null) then
1020: begin
1021:
1022: if (g_debug = 1) then
1023: inv_trx_util_pub.TRACE('sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
1024: end if;
1025:
1026: select nvl(status_id, -1)
1027: into g_isa_sub_status_id
1034: and nvl(lpn_id, -9999) = nvl(p_lpn_id, -9999)
1035: and rownum = 1 ;
1036:
1037: if (g_debug = 1) then
1038: inv_trx_util_pub.TRACE('sub status id ' || g_isa_sub_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
1039: end if;
1040:
1041: g_isa_organization_id := p_organization_id;
1042: g_isa_sub_code := p_sub_code;
1045: -- If no onhand record exists and the item is not locator/lot/serial controlled then
1046: -- we need to check whether the subinv status allows the transaction as that is going to be
1047: -- the status in MOQD except for the transfer transactions.
1048: if (g_debug = 1) then
1049: inv_trx_util_pub.TRACE('locator control '|| get_locator_control(p_organization_id, p_inventory_item_id, p_sub_code), 'INV_MATERIAL_STATUS_GRP', 14);
1050: end if;
1051:
1052: /* Bug 6918409 */
1053: if(l_lot_status_enabled = 'Y' or l_serial_controlled = 1
1059: else
1060: if (get_action_id(p_trx_type_id) in (2,3,21,28)) then -- Need to use action Id.
1061:
1062: if (g_debug = 1) then
1063: inv_trx_util_pub.TRACE('returning Y as its a transfer transaction', 'INV_MATERIAL_STATUS_GRP', 14);
1064: end if;
1065:
1066: return 'Y';
1067: else
1068: /* Bug 6918409 */
1069: l_count := 0;
1070: if (l_lot_status_enabled <> 'Y' ) then
1071: if (g_debug = 1) then
1072: inv_trx_util_pub.TRACE('lot status is not enabled', 'INV_MATERIAL_STATUS_GRP', 14);
1073: end if;
1074: /* Bug 6975416 : Modified the SQL for 10g
1075: * compliance
1076: */
1080: from mtl_onhand_quantities_detail moqd
1081: where moqd.inventory_item_id = p_inventory_item_id
1082: and moqd.organization_id = p_organization_id
1083: and moqd.subinventory_code = p_sub_code
1084: and INV_MATERIAL_STATUS_GRP.is_trx_allowed_wrap(
1085: moqd.status_id
1086: ,p_trx_type_id) = 'Y'
1087: and rownum = 1;
1088: exception
1090: l_count := 0;
1091: end;
1092:
1093: if (g_debug = 1) then
1094: inv_trx_util_pub.TRACE('sub, l_count: '||l_count, 'INV_MATERIAL_STATUS_GRP', 14);
1095: end if;
1096:
1097: if (l_count = 1 and p_object_type <> 'A') then
1098: return 'Y';
1105: elsif inv_cache.set_tosub_rec(p_organization_id, p_sub_code) then
1106: g_isa_sub_status_id := inv_cache.tosub_rec.status_id;
1107: end if;
1108: if (g_debug = 1) then
1109: inv_trx_util_pub.TRACE('sub, l_count is 0, sub_status_id: '||g_isa_sub_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
1110: end if;
1111: end if;
1112: end if;
1113: end if;
1119: if inv_cache.set_item_rec(p_organization_id, p_inventory_item_id) then
1120: if (inv_cache.item_rec.serial_number_control_code in (1,6)) then
1121:
1122: if (g_debug = 1) then
1123: inv_trx_util_pub.TRACE('sub, status is null in MOQD for non-serial controlled item', 'INV_MATERIAL_STATUS_GRP', 14);
1124: end if;
1125:
1126: FND_MESSAGE.SET_NAME('INV', 'INV_NULL_MOQD_STATUS');
1127: FND_MESSAGE.SET_TOKEN('ORG_ID', p_organization_id);
1140: end if;
1141: end if;
1142: else
1143: if (g_debug = 1) then
1144: inv_trx_util_pub.TRACE('Item id is null for sub', 'INV_MATERIAL_STATUS_GRP', 14);
1145: end if;
1146:
1147: begin
1148: select count(distinct status_id)
1188: end if;
1189: l_status_id := g_isa_sub_status_id;
1190:
1191: if (g_debug = 1) then
1192: inv_trx_util_pub.TRACE('sub, l_status_id ' || l_status_id ||',trx type id '||p_trx_type_id, 'INV_MATERIAL_STATUS_GRP', 14);
1193: end if;
1194:
1195: l_return_status := INV_MATERIAL_STATUS_GRP.is_trx_allowed(
1196: p_status_id =>l_status_id
1191: if (g_debug = 1) then
1192: inv_trx_util_pub.TRACE('sub, l_status_id ' || l_status_id ||',trx type id '||p_trx_type_id, 'INV_MATERIAL_STATUS_GRP', 14);
1193: end if;
1194:
1195: l_return_status := INV_MATERIAL_STATUS_GRP.is_trx_allowed(
1196: p_status_id =>l_status_id
1197: ,p_transaction_type_id=> p_trx_type_id
1198: ,x_return_status => l_return_status
1199: ,x_msg_count => l_msg_count
1199: ,x_msg_count => l_msg_count
1200: ,x_msg_data => l_msg_data);
1201:
1202: if (g_debug = 1) then
1203: inv_trx_util_pub.TRACE('sub, l return status ' || l_return_status, 'INV_MATERIAL_STATUS_GRP', 14);
1204: end if;
1205:
1206: if (p_object_type = 'Z') or (p_object_type = 'A' and
1207: l_return_status = 'N') then
1235: if (p_inventory_item_id is not null) then
1236: begin
1237:
1238: if (g_debug = 1) then
1239: inv_trx_util_pub.TRACE('loc ' || p_locator_id, 'INV_MATERIAL_STATUS_GRP', 14);
1240: end if;
1241:
1242: select nvl(status_id, -1)
1243: into g_isa_loc_status_id
1249: and nvl(lpn_id, -9999) = nvl(p_lpn_id, -9999)
1250: and rownum = 1 ;
1251:
1252: if (g_debug = 1) then
1253: inv_trx_util_pub.TRACE('loc status id ' || g_isa_loc_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
1254: end if;
1255:
1256: g_isa_organization_id := p_organization_id;
1257: g_isa_locator_id := p_locator_id;
1270: /* Bug 6918409 */
1271: l_count := 0;
1272: if (l_lot_status_enabled <> 'Y' ) then
1273: if (g_debug = 1) then
1274: inv_trx_util_pub.TRACE('loc, lot status is not enabled', 'INV_MATERIAL_STATUS_GRP', 14);
1275: end if;
1276: /* Bug 6975416 : Modified the SQL for 10g
1277: * compliance
1278: */
1282: from mtl_onhand_quantities_detail moqd
1283: where moqd.inventory_item_id = p_inventory_item_id
1284: and moqd.organization_id = p_organization_id
1285: and moqd.locator_id = p_locator_id
1286: and INV_MATERIAL_STATUS_GRP.is_trx_allowed_wrap(
1287: moqd.status_id
1288: ,p_trx_type_id) = 'Y'
1289: and rownum = 1;
1290: exception
1292: l_count := 0;
1293: end;
1294:
1295: if (g_debug = 1) then
1296: inv_trx_util_pub.TRACE('loc, l_count: '||l_count, 'INV_MATERIAL_STATUS_GRP', 14);
1297: end if;
1298:
1299: if (l_count = 1 and p_object_type <> 'A') then
1300: return 'Y';
1340: if inv_cache.set_item_rec(p_organization_id, p_inventory_item_id) then
1341: if (inv_cache.item_rec.serial_number_control_code in (1,6)) then
1342:
1343: if (g_debug = 1) then
1344: inv_trx_util_pub.TRACE('Loc, status is null in MOQD for non-serial controlled item', 'INV_MATERIAL_STATUS_GRP', 14);
1345: end if;
1346:
1347: FND_MESSAGE.SET_NAME('INV', 'INV_NULL_MOQD_STATUS');
1348: FND_MESSAGE.SET_TOKEN('ORG_ID', p_organization_id);
1360: end if;
1361: else
1362:
1363: if (g_debug = 1) then
1364: inv_trx_util_pub.TRACE('Item id is null for loc', 'INV_MATERIAL_STATUS_GRP', 14);
1365: end if;
1366:
1367: begin
1368: select count(distinct status_id)
1406: end if;
1407: l_status_id := g_isa_loc_status_id;
1408:
1409: if (g_debug = 1) then
1410: inv_trx_util_pub.TRACE('loc, l_status_id ' || l_status_id ||',trx type id '||p_trx_type_id, 'INV_MATERIAL_STATUS_GRP', 14);
1411: end if;
1412:
1413: l_return_status := INV_MATERIAL_STATUS_GRP.is_trx_allowed(
1414: p_status_id =>l_status_id
1409: if (g_debug = 1) then
1410: inv_trx_util_pub.TRACE('loc, l_status_id ' || l_status_id ||',trx type id '||p_trx_type_id, 'INV_MATERIAL_STATUS_GRP', 14);
1411: end if;
1412:
1413: l_return_status := INV_MATERIAL_STATUS_GRP.is_trx_allowed(
1414: p_status_id =>l_status_id
1415: ,p_transaction_type_id=> p_trx_type_id
1416: ,x_return_status => l_return_status
1417: ,x_msg_count => l_msg_count
1417: ,x_msg_count => l_msg_count
1418: ,x_msg_data => l_msg_data);
1419:
1420: if (g_debug = 1) then
1421: inv_trx_util_pub.TRACE('loc, l return status ' || l_return_status, 'INV_MATERIAL_STATUS_GRP', 14);
1422: end if;
1423:
1424: if (p_object_type = 'L') or (p_object_type = 'A' and
1425: l_return_status = 'N') then
1457: else
1458: begin
1459:
1460: if (g_debug = 1 ) then
1461: inv_trx_util_pub.TRACE('Inside lot ', 'INV_MATERIAL_STATUS_GRP', 14);
1462: inv_trx_util_pub.TRACE('org ' || p_organization_id, 'INV_MATERIAL_STATUS_GRP', 14);
1463: inv_trx_util_pub.TRACE('item ' || p_inventory_item_id, 'INV_MATERIAL_STATUS_GRP', 14);
1464: inv_trx_util_pub.TRACE('sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
1465: inv_trx_util_pub.TRACE('loc ' || p_locator_id, 'INV_MATERIAL_STATUS_GRP', 14);
1458: begin
1459:
1460: if (g_debug = 1 ) then
1461: inv_trx_util_pub.TRACE('Inside lot ', 'INV_MATERIAL_STATUS_GRP', 14);
1462: inv_trx_util_pub.TRACE('org ' || p_organization_id, 'INV_MATERIAL_STATUS_GRP', 14);
1463: inv_trx_util_pub.TRACE('item ' || p_inventory_item_id, 'INV_MATERIAL_STATUS_GRP', 14);
1464: inv_trx_util_pub.TRACE('sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
1465: inv_trx_util_pub.TRACE('loc ' || p_locator_id, 'INV_MATERIAL_STATUS_GRP', 14);
1466: inv_trx_util_pub.TRACE('lot ' || p_lot_number, 'INV_MATERIAL_STATUS_GRP', 14);
1459:
1460: if (g_debug = 1 ) then
1461: inv_trx_util_pub.TRACE('Inside lot ', 'INV_MATERIAL_STATUS_GRP', 14);
1462: inv_trx_util_pub.TRACE('org ' || p_organization_id, 'INV_MATERIAL_STATUS_GRP', 14);
1463: inv_trx_util_pub.TRACE('item ' || p_inventory_item_id, 'INV_MATERIAL_STATUS_GRP', 14);
1464: inv_trx_util_pub.TRACE('sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
1465: inv_trx_util_pub.TRACE('loc ' || p_locator_id, 'INV_MATERIAL_STATUS_GRP', 14);
1466: inv_trx_util_pub.TRACE('lot ' || p_lot_number, 'INV_MATERIAL_STATUS_GRP', 14);
1467: inv_trx_util_pub.TRACE('lpn ' || p_lpn_id, 'INV_MATERIAL_STATUS_GRP', 14);
1460: if (g_debug = 1 ) then
1461: inv_trx_util_pub.TRACE('Inside lot ', 'INV_MATERIAL_STATUS_GRP', 14);
1462: inv_trx_util_pub.TRACE('org ' || p_organization_id, 'INV_MATERIAL_STATUS_GRP', 14);
1463: inv_trx_util_pub.TRACE('item ' || p_inventory_item_id, 'INV_MATERIAL_STATUS_GRP', 14);
1464: inv_trx_util_pub.TRACE('sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
1465: inv_trx_util_pub.TRACE('loc ' || p_locator_id, 'INV_MATERIAL_STATUS_GRP', 14);
1466: inv_trx_util_pub.TRACE('lot ' || p_lot_number, 'INV_MATERIAL_STATUS_GRP', 14);
1467: inv_trx_util_pub.TRACE('lpn ' || p_lpn_id, 'INV_MATERIAL_STATUS_GRP', 14);
1468: end if;
1461: inv_trx_util_pub.TRACE('Inside lot ', 'INV_MATERIAL_STATUS_GRP', 14);
1462: inv_trx_util_pub.TRACE('org ' || p_organization_id, 'INV_MATERIAL_STATUS_GRP', 14);
1463: inv_trx_util_pub.TRACE('item ' || p_inventory_item_id, 'INV_MATERIAL_STATUS_GRP', 14);
1464: inv_trx_util_pub.TRACE('sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
1465: inv_trx_util_pub.TRACE('loc ' || p_locator_id, 'INV_MATERIAL_STATUS_GRP', 14);
1466: inv_trx_util_pub.TRACE('lot ' || p_lot_number, 'INV_MATERIAL_STATUS_GRP', 14);
1467: inv_trx_util_pub.TRACE('lpn ' || p_lpn_id, 'INV_MATERIAL_STATUS_GRP', 14);
1468: end if;
1469:
1462: inv_trx_util_pub.TRACE('org ' || p_organization_id, 'INV_MATERIAL_STATUS_GRP', 14);
1463: inv_trx_util_pub.TRACE('item ' || p_inventory_item_id, 'INV_MATERIAL_STATUS_GRP', 14);
1464: inv_trx_util_pub.TRACE('sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
1465: inv_trx_util_pub.TRACE('loc ' || p_locator_id, 'INV_MATERIAL_STATUS_GRP', 14);
1466: inv_trx_util_pub.TRACE('lot ' || p_lot_number, 'INV_MATERIAL_STATUS_GRP', 14);
1467: inv_trx_util_pub.TRACE('lpn ' || p_lpn_id, 'INV_MATERIAL_STATUS_GRP', 14);
1468: end if;
1469:
1470: --Adding following locator id logic to support locator_id = -1
1463: inv_trx_util_pub.TRACE('item ' || p_inventory_item_id, 'INV_MATERIAL_STATUS_GRP', 14);
1464: inv_trx_util_pub.TRACE('sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
1465: inv_trx_util_pub.TRACE('loc ' || p_locator_id, 'INV_MATERIAL_STATUS_GRP', 14);
1466: inv_trx_util_pub.TRACE('lot ' || p_lot_number, 'INV_MATERIAL_STATUS_GRP', 14);
1467: inv_trx_util_pub.TRACE('lpn ' || p_lpn_id, 'INV_MATERIAL_STATUS_GRP', 14);
1468: end if;
1469:
1470: --Adding following locator id logic to support locator_id = -1
1471: --which is being passed from some mobile pages for null value.
1485: and nvl(lpn_id, -9999) = nvl(p_lpn_id, -9999)
1486: and rownum = 1 ;
1487:
1488: if (g_debug = 1 ) then
1489: inv_trx_util_pub.TRACE('lot status id ' || g_isa_lot_number_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
1490: end if;
1491:
1492: g_isa_lot_number := p_lot_number;
1493: exception
1554: if inv_cache.set_item_rec(p_organization_id, p_inventory_item_id) then
1555: if (inv_cache.item_rec.serial_number_control_code in (1,6)) then
1556:
1557: if (g_debug = 1) then
1558: inv_trx_util_pub.TRACE('lot, status is null in MOQD for non-serial controlled item', 'INV_MATERIAL_STATUS_GRP', 14);
1559: end if;
1560:
1561: FND_MESSAGE.SET_NAME('INV', 'INV_NULL_MOQD_STATUS');
1562: FND_MESSAGE.SET_TOKEN('ORG_ID', p_organization_id);
1577: end if;
1578: l_status_id := g_isa_lot_number_status_id;
1579:
1580: if (g_debug = 1) then
1581: inv_trx_util_pub.TRACE('lot, l_status_id ' || l_status_id ||',trx type id '||p_trx_type_id, 'INV_MATERIAL_STATUS_GRP', 14);
1582: end if;
1583:
1584: l_return_status := INV_MATERIAL_STATUS_GRP.is_trx_allowed(
1585: p_status_id =>l_status_id
1580: if (g_debug = 1) then
1581: inv_trx_util_pub.TRACE('lot, l_status_id ' || l_status_id ||',trx type id '||p_trx_type_id, 'INV_MATERIAL_STATUS_GRP', 14);
1582: end if;
1583:
1584: l_return_status := INV_MATERIAL_STATUS_GRP.is_trx_allowed(
1585: p_status_id =>l_status_id
1586: ,p_transaction_type_id=> p_trx_type_id
1587: ,x_return_status => l_return_status
1588: ,x_msg_count => l_msg_count
1588: ,x_msg_count => l_msg_count
1589: ,x_msg_data => l_msg_data);
1590:
1591: if (g_debug = 1) then
1592: inv_trx_util_pub.TRACE('lot, l return status ' || l_return_status, 'INV_MATERIAL_STATUS_GRP', 14);
1593: end if;
1594:
1595: if (p_object_type = 'O') or (p_object_type = 'A' and
1596: l_return_status = 'N') then
1611: where inventory_item_id = p_inventory_item_id
1612: and current_organization_id = p_organization_id
1613: and serial_number = p_serial_number;
1614:
1615: l_return_status := INV_MATERIAL_STATUS_GRP.is_trx_allowed(
1616: p_status_id =>l_status_id
1617: ,p_transaction_type_id=> p_trx_type_id
1618: ,x_return_status => l_return_status
1619: ,x_msg_count => l_msg_count
1812: l_serial_controlled NUMBER := 0;
1813: BEGIN
1814:
1815: if (g_debug = 1) then
1816: inv_trx_util_pub.TRACE('Inside get default status ', 'INV_MATERIAL_STATUS_GRP', 14);
1817: inv_trx_util_pub.TRACE('org id ' ||p_organization_id || ' Item id ' || p_inventory_item_id || ' sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
1818: inv_trx_util_pub.TRACE('loc '|| p_loc_id || ' lot ' || p_lot_number || ' lpn ' || p_lpn_id || ' action ' || p_transaction_action_id || ' src ' || p_src_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
1819: inv_trx_util_pub.TRACE('lock id '|| p_lock_id || ' header id '||p_header_id, 'INV_MATERIAL_STATUS_GRP', 14);
1820: end if;
1813: BEGIN
1814:
1815: if (g_debug = 1) then
1816: inv_trx_util_pub.TRACE('Inside get default status ', 'INV_MATERIAL_STATUS_GRP', 14);
1817: inv_trx_util_pub.TRACE('org id ' ||p_organization_id || ' Item id ' || p_inventory_item_id || ' sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
1818: inv_trx_util_pub.TRACE('loc '|| p_loc_id || ' lot ' || p_lot_number || ' lpn ' || p_lpn_id || ' action ' || p_transaction_action_id || ' src ' || p_src_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
1819: inv_trx_util_pub.TRACE('lock id '|| p_lock_id || ' header id '||p_header_id, 'INV_MATERIAL_STATUS_GRP', 14);
1820: end if;
1821:
1814:
1815: if (g_debug = 1) then
1816: inv_trx_util_pub.TRACE('Inside get default status ', 'INV_MATERIAL_STATUS_GRP', 14);
1817: inv_trx_util_pub.TRACE('org id ' ||p_organization_id || ' Item id ' || p_inventory_item_id || ' sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
1818: inv_trx_util_pub.TRACE('loc '|| p_loc_id || ' lot ' || p_lot_number || ' lpn ' || p_lpn_id || ' action ' || p_transaction_action_id || ' src ' || p_src_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
1819: inv_trx_util_pub.TRACE('lock id '|| p_lock_id || ' header id '||p_header_id, 'INV_MATERIAL_STATUS_GRP', 14);
1820: end if;
1821:
1822: if inv_cache.set_org_rec(p_organization_id) then
1815: if (g_debug = 1) then
1816: inv_trx_util_pub.TRACE('Inside get default status ', 'INV_MATERIAL_STATUS_GRP', 14);
1817: inv_trx_util_pub.TRACE('org id ' ||p_organization_id || ' Item id ' || p_inventory_item_id || ' sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
1818: inv_trx_util_pub.TRACE('loc '|| p_loc_id || ' lot ' || p_lot_number || ' lpn ' || p_lpn_id || ' action ' || p_transaction_action_id || ' src ' || p_src_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
1819: inv_trx_util_pub.TRACE('lock id '|| p_lock_id || ' header id '||p_header_id, 'INV_MATERIAL_STATUS_GRP', 14);
1820: end if;
1821:
1822: if inv_cache.set_org_rec(p_organization_id) then
1823: l_default_org_status_id := inv_cache.org_rec.default_status_id;
1823: l_default_org_status_id := inv_cache.org_rec.default_status_id;
1824: end if;
1825:
1826: if (g_debug = 1) then
1827: inv_trx_util_pub.TRACE('default org status ' || l_default_org_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
1828: end if;
1829:
1830: if inv_cache.set_item_rec(p_organization_id, p_inventory_item_id) then
1831: if (inv_cache.item_rec.serial_number_control_code in (2,5)) then
1858: AND rownum = 1;
1859: END IF ; /*LPN Status Project */
1860:
1861: if (g_debug = 1) then
1862: inv_trx_util_pub.TRACE('default status in MOQD ' || l_default_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
1863: end if;
1864:
1865: if (l_default_status_id = -1) then
1866: if (l_serial_controlled = 0) then
1865: if (l_default_status_id = -1) then
1866: if (l_serial_controlled = 0) then
1867:
1868: if (g_debug = 1) then
1869: inv_trx_util_pub.TRACE('status is null in MOQD for non-serial controlled item', 'INV_MATERIAL_STATUS_GRP', 14);
1870: end if;
1871:
1872: FND_MESSAGE.SET_NAME('INV', 'INV_NULL_MOQD_STATUS');
1873: FND_MESSAGE.SET_TOKEN('ORG_ID', p_organization_id);
1882: end if;
1883: end if;
1884:
1885: if (g_debug = 1) then
1886: inv_trx_util_pub.TRACE(' 1 default status returned ' || l_default_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
1887: end if;
1888:
1889: return l_default_status_id;
1890: end if;
1902: if (p_lock_id <> 0 and INV_TABLE_LOCK_PVT.lock_onhand_records(p_organization_id,p_inventory_item_id,null
1903: ,p_lot_number,p_sub_code,p_loc_id,1,p_header_id)
1904: ) then
1905: if (g_debug = 1) then
1906: inv_trx_util_pub.TRACE('Locked the MOQD record', 'INV_MATERIAL_STATUS_GRP', 14);
1907: end if;
1908: else
1909: if (g_debug = 1) then
1910: inv_trx_util_pub.TRACE('Unbale to lock MOQD ', 'INV_MATERIAL_STATUS_GRP', 14);
1906: inv_trx_util_pub.TRACE('Locked the MOQD record', 'INV_MATERIAL_STATUS_GRP', 14);
1907: end if;
1908: else
1909: if (g_debug = 1) then
1910: inv_trx_util_pub.TRACE('Unbale to lock MOQD ', 'INV_MATERIAL_STATUS_GRP', 14);
1911: end if;
1912: end if;
1913:
1914: --If onhand record doesnt exist and if it's a transfer transaction then return
1918: If (p_transaction_action_id is not null and p_transaction_action_id in (2,3,28,50,51,52) ) then --ADDED 50,51,52 FOR LPN STATUS PROJECT
1919: If(p_src_status_id is not null) then
1920:
1921: if (g_debug = 1) then
1922: inv_trx_util_pub.TRACE('src status ex ' || p_src_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
1923: end if;
1924: -- Bug 6798024 : Calling the insert procedure to insert the status of the new onhand record into
1925: -- the table : mtl_material_status_history
1926: insert_status_history(p_organization_id, p_inventory_item_id, p_sub_code, p_loc_id, p_lot_number
2014:
2015: WHEN OTHERS THEN
2016:
2017: if (g_debug = 1) then
2018: inv_trx_util_pub.TRACE('Exception default status returned ' || l_default_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
2019: end if;
2020:
2021: return l_default_status_id;
2022:
2043:
2044: BEGIN
2045:
2046: if (g_debug = 1) then
2047: inv_trx_util_pub.TRACE('Inside insert status history ', 'INV_MATERIAL_STATUS_GRP', 14);
2048: inv_trx_util_pub.TRACE('org id ' ||p_organization_id || ' Item id ' || p_inventory_item_id || ' sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
2049: inv_trx_util_pub.TRACE('loc '|| p_loc_id || ' lot ' || p_lot_number || ' lpn ' || p_lpn_id || ' status id ' || p_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
2050: inv_trx_util_pub.TRACE('lock id '|| p_lock_id, 'INV_MATERIAL_STATUS_GRP', 14);
2051: end if;
2044: BEGIN
2045:
2046: if (g_debug = 1) then
2047: inv_trx_util_pub.TRACE('Inside insert status history ', 'INV_MATERIAL_STATUS_GRP', 14);
2048: inv_trx_util_pub.TRACE('org id ' ||p_organization_id || ' Item id ' || p_inventory_item_id || ' sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
2049: inv_trx_util_pub.TRACE('loc '|| p_loc_id || ' lot ' || p_lot_number || ' lpn ' || p_lpn_id || ' status id ' || p_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
2050: inv_trx_util_pub.TRACE('lock id '|| p_lock_id, 'INV_MATERIAL_STATUS_GRP', 14);
2051: end if;
2052:
2045:
2046: if (g_debug = 1) then
2047: inv_trx_util_pub.TRACE('Inside insert status history ', 'INV_MATERIAL_STATUS_GRP', 14);
2048: inv_trx_util_pub.TRACE('org id ' ||p_organization_id || ' Item id ' || p_inventory_item_id || ' sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
2049: inv_trx_util_pub.TRACE('loc '|| p_loc_id || ' lot ' || p_lot_number || ' lpn ' || p_lpn_id || ' status id ' || p_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
2050: inv_trx_util_pub.TRACE('lock id '|| p_lock_id, 'INV_MATERIAL_STATUS_GRP', 14);
2051: end if;
2052:
2053:
2046: if (g_debug = 1) then
2047: inv_trx_util_pub.TRACE('Inside insert status history ', 'INV_MATERIAL_STATUS_GRP', 14);
2048: inv_trx_util_pub.TRACE('org id ' ||p_organization_id || ' Item id ' || p_inventory_item_id || ' sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
2049: inv_trx_util_pub.TRACE('loc '|| p_loc_id || ' lot ' || p_lot_number || ' lpn ' || p_lpn_id || ' status id ' || p_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
2050: inv_trx_util_pub.TRACE('lock id '|| p_lock_id, 'INV_MATERIAL_STATUS_GRP', 14);
2051: end if;
2052:
2053:
2054: if (p_lock_id <> 0) then
2068:
2069: WHEN OTHERS THEN
2070:
2071: if (g_debug = 1) then
2072: inv_trx_util_pub.TRACE('Exception in insert_status_history, l_ret_status: '|| l_return_status, 'INV_MATERIAL_STATUS_GRP', 14);
2073: inv_trx_util_pub.TRACE('Exception in insert_status_history, l_msg_count: '|| l_msg_count, 'INV_MATERIAL_STATUS_GRP', 14);
2074: inv_trx_util_pub.TRACE('Exception in insert_status_history, l_msg_data: '||l_msg_data, 'INV_MATERIAL_STATUS_GRP', 14);
2075: end if;
2076:
2069: WHEN OTHERS THEN
2070:
2071: if (g_debug = 1) then
2072: inv_trx_util_pub.TRACE('Exception in insert_status_history, l_ret_status: '|| l_return_status, 'INV_MATERIAL_STATUS_GRP', 14);
2073: inv_trx_util_pub.TRACE('Exception in insert_status_history, l_msg_count: '|| l_msg_count, 'INV_MATERIAL_STATUS_GRP', 14);
2074: inv_trx_util_pub.TRACE('Exception in insert_status_history, l_msg_data: '||l_msg_data, 'INV_MATERIAL_STATUS_GRP', 14);
2075: end if;
2076:
2077: END insert_status_history;
2070:
2071: if (g_debug = 1) then
2072: inv_trx_util_pub.TRACE('Exception in insert_status_history, l_ret_status: '|| l_return_status, 'INV_MATERIAL_STATUS_GRP', 14);
2073: inv_trx_util_pub.TRACE('Exception in insert_status_history, l_msg_count: '|| l_msg_count, 'INV_MATERIAL_STATUS_GRP', 14);
2074: inv_trx_util_pub.TRACE('Exception in insert_status_history, l_msg_data: '||l_msg_data, 'INV_MATERIAL_STATUS_GRP', 14);
2075: end if;
2076:
2077: END insert_status_history;
2078:
2092: l_serial_controlled NUMBER := 0;
2093: BEGIN
2094:
2095: if (g_debug = 1) then
2096: inv_trx_util_pub.TRACE('Inside get default status conc ', 'INV_MATERIAL_STATUS_GRP', 14);
2097: inv_trx_util_pub.TRACE('org id ' ||p_organization_id || ' Item id ' || p_inventory_item_id || ' sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
2098: inv_trx_util_pub.TRACE('loc '|| p_loc_id || ' lot ' || p_lot_number || ' lpn ' || p_lpn_id, 'INV_MATERIAL_STATUS_GRP', 14);
2099: end if;
2100:
2093: BEGIN
2094:
2095: if (g_debug = 1) then
2096: inv_trx_util_pub.TRACE('Inside get default status conc ', 'INV_MATERIAL_STATUS_GRP', 14);
2097: inv_trx_util_pub.TRACE('org id ' ||p_organization_id || ' Item id ' || p_inventory_item_id || ' sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
2098: inv_trx_util_pub.TRACE('loc '|| p_loc_id || ' lot ' || p_lot_number || ' lpn ' || p_lpn_id, 'INV_MATERIAL_STATUS_GRP', 14);
2099: end if;
2100:
2101: if inv_cache.set_org_rec(p_organization_id) then
2094:
2095: if (g_debug = 1) then
2096: inv_trx_util_pub.TRACE('Inside get default status conc ', 'INV_MATERIAL_STATUS_GRP', 14);
2097: inv_trx_util_pub.TRACE('org id ' ||p_organization_id || ' Item id ' || p_inventory_item_id || ' sub ' || p_sub_code, 'INV_MATERIAL_STATUS_GRP', 14);
2098: inv_trx_util_pub.TRACE('loc '|| p_loc_id || ' lot ' || p_lot_number || ' lpn ' || p_lpn_id, 'INV_MATERIAL_STATUS_GRP', 14);
2099: end if;
2100:
2101: if inv_cache.set_org_rec(p_organization_id) then
2102: l_default_org_status_id := inv_cache.org_rec.default_status_id;
2104:
2105: l_default_status_id := l_default_org_status_id;
2106:
2107: if (g_debug = 1) then
2108: inv_trx_util_pub.TRACE('default org status ' || l_default_org_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
2109: end if;
2110:
2111: if inv_cache.set_item_rec(p_organization_id, p_inventory_item_id) then
2112: if (inv_cache.item_rec.serial_number_control_code in (2,5)) then
2160:
2161: end if;
2162:
2163: if (g_debug = 1) then
2164: inv_trx_util_pub.TRACE(' 1 default status returned ' || l_default_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
2165: end if;
2166:
2167: return l_default_status_id;
2168:
2170:
2171: WHEN OTHERS THEN
2172:
2173: if (g_debug = 1) then
2174: inv_trx_util_pub.TRACE('Exception default status returned ' || l_default_status_id, 'INV_MATERIAL_STATUS_GRP', 14);
2175: end if;
2176:
2177: return l_default_status_id;
2178:
2258: l_onhand_status_id NUMBER ;
2259:
2260: BEGIN
2261: IF (g_debug = 1) then
2262: inv_trx_util_pub.TRACE('Inside get_onhand_status_id' , 'INV_MATERIAL_STATUS_GRP', 9);
2263: END IF;
2264: BEGIN
2265: SELECT NVL( status_id ,-1 )
2266: INTO l_onhand_status_id
2353: --First get the value of move different status parameter.
2354: --Printing all input parameters to debug file
2355:
2356: if (g_debug = 1) then
2357: inv_trx_util_pub.TRACE('inside check_move_diff: p_org_id = ' || p_org_id, 'INV_MATERIAL_STATUS_GRP', 9);
2358: inv_trx_util_pub.TRACE('inside check_move_diff: p_inventory_item_id = '|| p_inventory_item_id, 'INV_MATERIAL_STATUS_GRP', 9);
2359: inv_trx_util_pub.TRACE('inside check_move_diff: p_subinventory_code = ' || p_subinventory_code, 'INV_MATERIAL_STATUS_GRP', 9);
2360: inv_trx_util_pub.TRACE('inside check_move_diff: p_locator_id = '|| p_locator_id, 'INV_MATERIAL_STATUS_GRP', 9);
2361: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_org_id = ' || p_transfer_org_id, 'INV_MATERIAL_STATUS_GRP', 9);
2354: --Printing all input parameters to debug file
2355:
2356: if (g_debug = 1) then
2357: inv_trx_util_pub.TRACE('inside check_move_diff: p_org_id = ' || p_org_id, 'INV_MATERIAL_STATUS_GRP', 9);
2358: inv_trx_util_pub.TRACE('inside check_move_diff: p_inventory_item_id = '|| p_inventory_item_id, 'INV_MATERIAL_STATUS_GRP', 9);
2359: inv_trx_util_pub.TRACE('inside check_move_diff: p_subinventory_code = ' || p_subinventory_code, 'INV_MATERIAL_STATUS_GRP', 9);
2360: inv_trx_util_pub.TRACE('inside check_move_diff: p_locator_id = '|| p_locator_id, 'INV_MATERIAL_STATUS_GRP', 9);
2361: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_org_id = ' || p_transfer_org_id, 'INV_MATERIAL_STATUS_GRP', 9);
2362: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_subinventory = '|| p_transfer_subinventory, 'INV_MATERIAL_STATUS_GRP', 9);
2355:
2356: if (g_debug = 1) then
2357: inv_trx_util_pub.TRACE('inside check_move_diff: p_org_id = ' || p_org_id, 'INV_MATERIAL_STATUS_GRP', 9);
2358: inv_trx_util_pub.TRACE('inside check_move_diff: p_inventory_item_id = '|| p_inventory_item_id, 'INV_MATERIAL_STATUS_GRP', 9);
2359: inv_trx_util_pub.TRACE('inside check_move_diff: p_subinventory_code = ' || p_subinventory_code, 'INV_MATERIAL_STATUS_GRP', 9);
2360: inv_trx_util_pub.TRACE('inside check_move_diff: p_locator_id = '|| p_locator_id, 'INV_MATERIAL_STATUS_GRP', 9);
2361: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_org_id = ' || p_transfer_org_id, 'INV_MATERIAL_STATUS_GRP', 9);
2362: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_subinventory = '|| p_transfer_subinventory, 'INV_MATERIAL_STATUS_GRP', 9);
2363: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_locator_id = ' || p_transfer_locator_id, 'INV_MATERIAL_STATUS_GRP', 9);
2356: if (g_debug = 1) then
2357: inv_trx_util_pub.TRACE('inside check_move_diff: p_org_id = ' || p_org_id, 'INV_MATERIAL_STATUS_GRP', 9);
2358: inv_trx_util_pub.TRACE('inside check_move_diff: p_inventory_item_id = '|| p_inventory_item_id, 'INV_MATERIAL_STATUS_GRP', 9);
2359: inv_trx_util_pub.TRACE('inside check_move_diff: p_subinventory_code = ' || p_subinventory_code, 'INV_MATERIAL_STATUS_GRP', 9);
2360: inv_trx_util_pub.TRACE('inside check_move_diff: p_locator_id = '|| p_locator_id, 'INV_MATERIAL_STATUS_GRP', 9);
2361: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_org_id = ' || p_transfer_org_id, 'INV_MATERIAL_STATUS_GRP', 9);
2362: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_subinventory = '|| p_transfer_subinventory, 'INV_MATERIAL_STATUS_GRP', 9);
2363: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_locator_id = ' || p_transfer_locator_id, 'INV_MATERIAL_STATUS_GRP', 9);
2364: inv_trx_util_pub.TRACE('inside check_move_diff: p_lot_number = '|| p_lot_number, 'INV_MATERIAL_STATUS_GRP', 9);
2357: inv_trx_util_pub.TRACE('inside check_move_diff: p_org_id = ' || p_org_id, 'INV_MATERIAL_STATUS_GRP', 9);
2358: inv_trx_util_pub.TRACE('inside check_move_diff: p_inventory_item_id = '|| p_inventory_item_id, 'INV_MATERIAL_STATUS_GRP', 9);
2359: inv_trx_util_pub.TRACE('inside check_move_diff: p_subinventory_code = ' || p_subinventory_code, 'INV_MATERIAL_STATUS_GRP', 9);
2360: inv_trx_util_pub.TRACE('inside check_move_diff: p_locator_id = '|| p_locator_id, 'INV_MATERIAL_STATUS_GRP', 9);
2361: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_org_id = ' || p_transfer_org_id, 'INV_MATERIAL_STATUS_GRP', 9);
2362: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_subinventory = '|| p_transfer_subinventory, 'INV_MATERIAL_STATUS_GRP', 9);
2363: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_locator_id = ' || p_transfer_locator_id, 'INV_MATERIAL_STATUS_GRP', 9);
2364: inv_trx_util_pub.TRACE('inside check_move_diff: p_lot_number = '|| p_lot_number, 'INV_MATERIAL_STATUS_GRP', 9);
2365: inv_trx_util_pub.TRACE('inside check_move_diff: p_transaction_action_id = ' || p_transaction_action_id, 'INV_MATERIAL_STATUS_GRP', 9);
2358: inv_trx_util_pub.TRACE('inside check_move_diff: p_inventory_item_id = '|| p_inventory_item_id, 'INV_MATERIAL_STATUS_GRP', 9);
2359: inv_trx_util_pub.TRACE('inside check_move_diff: p_subinventory_code = ' || p_subinventory_code, 'INV_MATERIAL_STATUS_GRP', 9);
2360: inv_trx_util_pub.TRACE('inside check_move_diff: p_locator_id = '|| p_locator_id, 'INV_MATERIAL_STATUS_GRP', 9);
2361: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_org_id = ' || p_transfer_org_id, 'INV_MATERIAL_STATUS_GRP', 9);
2362: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_subinventory = '|| p_transfer_subinventory, 'INV_MATERIAL_STATUS_GRP', 9);
2363: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_locator_id = ' || p_transfer_locator_id, 'INV_MATERIAL_STATUS_GRP', 9);
2364: inv_trx_util_pub.TRACE('inside check_move_diff: p_lot_number = '|| p_lot_number, 'INV_MATERIAL_STATUS_GRP', 9);
2365: inv_trx_util_pub.TRACE('inside check_move_diff: p_transaction_action_id = ' || p_transaction_action_id, 'INV_MATERIAL_STATUS_GRP', 9);
2366: inv_trx_util_pub.TRACE('inside check_move_diff: p_object_type = '|| p_object_type, 'INV_MATERIAL_STATUS_GRP', 9);
2359: inv_trx_util_pub.TRACE('inside check_move_diff: p_subinventory_code = ' || p_subinventory_code, 'INV_MATERIAL_STATUS_GRP', 9);
2360: inv_trx_util_pub.TRACE('inside check_move_diff: p_locator_id = '|| p_locator_id, 'INV_MATERIAL_STATUS_GRP', 9);
2361: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_org_id = ' || p_transfer_org_id, 'INV_MATERIAL_STATUS_GRP', 9);
2362: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_subinventory = '|| p_transfer_subinventory, 'INV_MATERIAL_STATUS_GRP', 9);
2363: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_locator_id = ' || p_transfer_locator_id, 'INV_MATERIAL_STATUS_GRP', 9);
2364: inv_trx_util_pub.TRACE('inside check_move_diff: p_lot_number = '|| p_lot_number, 'INV_MATERIAL_STATUS_GRP', 9);
2365: inv_trx_util_pub.TRACE('inside check_move_diff: p_transaction_action_id = ' || p_transaction_action_id, 'INV_MATERIAL_STATUS_GRP', 9);
2366: inv_trx_util_pub.TRACE('inside check_move_diff: p_object_type = '|| p_object_type, 'INV_MATERIAL_STATUS_GRP', 9);
2367: inv_trx_util_pub.TRACE('inside check_move_diff: p_lpn_id = ' || p_lpn_id, 'INV_MATERIAL_STATUS_GRP', 9);
2360: inv_trx_util_pub.TRACE('inside check_move_diff: p_locator_id = '|| p_locator_id, 'INV_MATERIAL_STATUS_GRP', 9);
2361: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_org_id = ' || p_transfer_org_id, 'INV_MATERIAL_STATUS_GRP', 9);
2362: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_subinventory = '|| p_transfer_subinventory, 'INV_MATERIAL_STATUS_GRP', 9);
2363: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_locator_id = ' || p_transfer_locator_id, 'INV_MATERIAL_STATUS_GRP', 9);
2364: inv_trx_util_pub.TRACE('inside check_move_diff: p_lot_number = '|| p_lot_number, 'INV_MATERIAL_STATUS_GRP', 9);
2365: inv_trx_util_pub.TRACE('inside check_move_diff: p_transaction_action_id = ' || p_transaction_action_id, 'INV_MATERIAL_STATUS_GRP', 9);
2366: inv_trx_util_pub.TRACE('inside check_move_diff: p_object_type = '|| p_object_type, 'INV_MATERIAL_STATUS_GRP', 9);
2367: inv_trx_util_pub.TRACE('inside check_move_diff: p_lpn_id = ' || p_lpn_id, 'INV_MATERIAL_STATUS_GRP', 9);
2368: inv_trx_util_pub.TRACE('inside check_move_diff: p_demand_src_header_id = '|| p_demand_src_header_id, 'INV_MATERIAL_STATUS_GRP', 9);
2361: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_org_id = ' || p_transfer_org_id, 'INV_MATERIAL_STATUS_GRP', 9);
2362: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_subinventory = '|| p_transfer_subinventory, 'INV_MATERIAL_STATUS_GRP', 9);
2363: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_locator_id = ' || p_transfer_locator_id, 'INV_MATERIAL_STATUS_GRP', 9);
2364: inv_trx_util_pub.TRACE('inside check_move_diff: p_lot_number = '|| p_lot_number, 'INV_MATERIAL_STATUS_GRP', 9);
2365: inv_trx_util_pub.TRACE('inside check_move_diff: p_transaction_action_id = ' || p_transaction_action_id, 'INV_MATERIAL_STATUS_GRP', 9);
2366: inv_trx_util_pub.TRACE('inside check_move_diff: p_object_type = '|| p_object_type, 'INV_MATERIAL_STATUS_GRP', 9);
2367: inv_trx_util_pub.TRACE('inside check_move_diff: p_lpn_id = ' || p_lpn_id, 'INV_MATERIAL_STATUS_GRP', 9);
2368: inv_trx_util_pub.TRACE('inside check_move_diff: p_demand_src_header_id = '|| p_demand_src_header_id, 'INV_MATERIAL_STATUS_GRP', 9);
2369: inv_trx_util_pub.TRACE('inside check_move_diff: p_revision = ' || p_revision, 'INV_MATERIAL_STATUS_GRP', 9);
2362: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_subinventory = '|| p_transfer_subinventory, 'INV_MATERIAL_STATUS_GRP', 9);
2363: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_locator_id = ' || p_transfer_locator_id, 'INV_MATERIAL_STATUS_GRP', 9);
2364: inv_trx_util_pub.TRACE('inside check_move_diff: p_lot_number = '|| p_lot_number, 'INV_MATERIAL_STATUS_GRP', 9);
2365: inv_trx_util_pub.TRACE('inside check_move_diff: p_transaction_action_id = ' || p_transaction_action_id, 'INV_MATERIAL_STATUS_GRP', 9);
2366: inv_trx_util_pub.TRACE('inside check_move_diff: p_object_type = '|| p_object_type, 'INV_MATERIAL_STATUS_GRP', 9);
2367: inv_trx_util_pub.TRACE('inside check_move_diff: p_lpn_id = ' || p_lpn_id, 'INV_MATERIAL_STATUS_GRP', 9);
2368: inv_trx_util_pub.TRACE('inside check_move_diff: p_demand_src_header_id = '|| p_demand_src_header_id, 'INV_MATERIAL_STATUS_GRP', 9);
2369: inv_trx_util_pub.TRACE('inside check_move_diff: p_revision = ' || p_revision, 'INV_MATERIAL_STATUS_GRP', 9);
2370: end if;
2363: inv_trx_util_pub.TRACE('inside check_move_diff: p_transfer_locator_id = ' || p_transfer_locator_id, 'INV_MATERIAL_STATUS_GRP', 9);
2364: inv_trx_util_pub.TRACE('inside check_move_diff: p_lot_number = '|| p_lot_number, 'INV_MATERIAL_STATUS_GRP', 9);
2365: inv_trx_util_pub.TRACE('inside check_move_diff: p_transaction_action_id = ' || p_transaction_action_id, 'INV_MATERIAL_STATUS_GRP', 9);
2366: inv_trx_util_pub.TRACE('inside check_move_diff: p_object_type = '|| p_object_type, 'INV_MATERIAL_STATUS_GRP', 9);
2367: inv_trx_util_pub.TRACE('inside check_move_diff: p_lpn_id = ' || p_lpn_id, 'INV_MATERIAL_STATUS_GRP', 9);
2368: inv_trx_util_pub.TRACE('inside check_move_diff: p_demand_src_header_id = '|| p_demand_src_header_id, 'INV_MATERIAL_STATUS_GRP', 9);
2369: inv_trx_util_pub.TRACE('inside check_move_diff: p_revision = ' || p_revision, 'INV_MATERIAL_STATUS_GRP', 9);
2370: end if;
2371:
2364: inv_trx_util_pub.TRACE('inside check_move_diff: p_lot_number = '|| p_lot_number, 'INV_MATERIAL_STATUS_GRP', 9);
2365: inv_trx_util_pub.TRACE('inside check_move_diff: p_transaction_action_id = ' || p_transaction_action_id, 'INV_MATERIAL_STATUS_GRP', 9);
2366: inv_trx_util_pub.TRACE('inside check_move_diff: p_object_type = '|| p_object_type, 'INV_MATERIAL_STATUS_GRP', 9);
2367: inv_trx_util_pub.TRACE('inside check_move_diff: p_lpn_id = ' || p_lpn_id, 'INV_MATERIAL_STATUS_GRP', 9);
2368: inv_trx_util_pub.TRACE('inside check_move_diff: p_demand_src_header_id = '|| p_demand_src_header_id, 'INV_MATERIAL_STATUS_GRP', 9);
2369: inv_trx_util_pub.TRACE('inside check_move_diff: p_revision = ' || p_revision, 'INV_MATERIAL_STATUS_GRP', 9);
2370: end if;
2371:
2372:
2365: inv_trx_util_pub.TRACE('inside check_move_diff: p_transaction_action_id = ' || p_transaction_action_id, 'INV_MATERIAL_STATUS_GRP', 9);
2366: inv_trx_util_pub.TRACE('inside check_move_diff: p_object_type = '|| p_object_type, 'INV_MATERIAL_STATUS_GRP', 9);
2367: inv_trx_util_pub.TRACE('inside check_move_diff: p_lpn_id = ' || p_lpn_id, 'INV_MATERIAL_STATUS_GRP', 9);
2368: inv_trx_util_pub.TRACE('inside check_move_diff: p_demand_src_header_id = '|| p_demand_src_header_id, 'INV_MATERIAL_STATUS_GRP', 9);
2369: inv_trx_util_pub.TRACE('inside check_move_diff: p_revision = ' || p_revision, 'INV_MATERIAL_STATUS_GRP', 9);
2370: end if;
2371:
2372:
2373: l_org_id := p_org_id ;
2412: END IF;
2413:
2414: if (g_debug = 1) then
2415:
2416: inv_trx_util_pub.TRACE('inside check_move_diff: object_type = ' || p_object_type, 'INV_MATERIAL_STATUS_GRP', 9);
2417: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_source_status = '||l_lot_source_status, 'INV_MATERIAL_STATUS_GRP', 9);
2418: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_control_code_source = '||l_lot_control_code_source, 'INV_MATERIAL_STATUS_GRP', 9);
2419:
2420: inv_trx_util_pub.TRACE('inside check_move_diff: l_serial_control_code_source = ' || l_serial_control_code_source, 'INV_MATERIAL_STATUS_GRP', 9);
2413:
2414: if (g_debug = 1) then
2415:
2416: inv_trx_util_pub.TRACE('inside check_move_diff: object_type = ' || p_object_type, 'INV_MATERIAL_STATUS_GRP', 9);
2417: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_source_status = '||l_lot_source_status, 'INV_MATERIAL_STATUS_GRP', 9);
2418: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_control_code_source = '||l_lot_control_code_source, 'INV_MATERIAL_STATUS_GRP', 9);
2419:
2420: inv_trx_util_pub.TRACE('inside check_move_diff: l_serial_control_code_source = ' || l_serial_control_code_source, 'INV_MATERIAL_STATUS_GRP', 9);
2421: inv_trx_util_pub.TRACE('inside check_move_diff: l_revision_control_code_destin = '||l_revision_control_code_destin, 'INV_MATERIAL_STATUS_GRP', 9);
2414: if (g_debug = 1) then
2415:
2416: inv_trx_util_pub.TRACE('inside check_move_diff: object_type = ' || p_object_type, 'INV_MATERIAL_STATUS_GRP', 9);
2417: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_source_status = '||l_lot_source_status, 'INV_MATERIAL_STATUS_GRP', 9);
2418: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_control_code_source = '||l_lot_control_code_source, 'INV_MATERIAL_STATUS_GRP', 9);
2419:
2420: inv_trx_util_pub.TRACE('inside check_move_diff: l_serial_control_code_source = ' || l_serial_control_code_source, 'INV_MATERIAL_STATUS_GRP', 9);
2421: inv_trx_util_pub.TRACE('inside check_move_diff: l_revision_control_code_destin = '||l_revision_control_code_destin, 'INV_MATERIAL_STATUS_GRP', 9);
2422: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_destin_status = '||l_lot_destin_status, 'INV_MATERIAL_STATUS_GRP', 9);
2416: inv_trx_util_pub.TRACE('inside check_move_diff: object_type = ' || p_object_type, 'INV_MATERIAL_STATUS_GRP', 9);
2417: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_source_status = '||l_lot_source_status, 'INV_MATERIAL_STATUS_GRP', 9);
2418: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_control_code_source = '||l_lot_control_code_source, 'INV_MATERIAL_STATUS_GRP', 9);
2419:
2420: inv_trx_util_pub.TRACE('inside check_move_diff: l_serial_control_code_source = ' || l_serial_control_code_source, 'INV_MATERIAL_STATUS_GRP', 9);
2421: inv_trx_util_pub.TRACE('inside check_move_diff: l_revision_control_code_destin = '||l_revision_control_code_destin, 'INV_MATERIAL_STATUS_GRP', 9);
2422: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_destin_status = '||l_lot_destin_status, 'INV_MATERIAL_STATUS_GRP', 9);
2423:
2424: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_control_code_destin = ' || l_lot_control_code_destin, 'INV_MATERIAL_STATUS_GRP', 9);
2417: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_source_status = '||l_lot_source_status, 'INV_MATERIAL_STATUS_GRP', 9);
2418: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_control_code_source = '||l_lot_control_code_source, 'INV_MATERIAL_STATUS_GRP', 9);
2419:
2420: inv_trx_util_pub.TRACE('inside check_move_diff: l_serial_control_code_source = ' || l_serial_control_code_source, 'INV_MATERIAL_STATUS_GRP', 9);
2421: inv_trx_util_pub.TRACE('inside check_move_diff: l_revision_control_code_destin = '||l_revision_control_code_destin, 'INV_MATERIAL_STATUS_GRP', 9);
2422: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_destin_status = '||l_lot_destin_status, 'INV_MATERIAL_STATUS_GRP', 9);
2423:
2424: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_control_code_destin = ' || l_lot_control_code_destin, 'INV_MATERIAL_STATUS_GRP', 9);
2425: inv_trx_util_pub.TRACE('inside check_move_diff: l_serial_control_code_destin= '||l_serial_control_code_destin, 'INV_MATERIAL_STATUS_GRP', 9);
2418: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_control_code_source = '||l_lot_control_code_source, 'INV_MATERIAL_STATUS_GRP', 9);
2419:
2420: inv_trx_util_pub.TRACE('inside check_move_diff: l_serial_control_code_source = ' || l_serial_control_code_source, 'INV_MATERIAL_STATUS_GRP', 9);
2421: inv_trx_util_pub.TRACE('inside check_move_diff: l_revision_control_code_destin = '||l_revision_control_code_destin, 'INV_MATERIAL_STATUS_GRP', 9);
2422: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_destin_status = '||l_lot_destin_status, 'INV_MATERIAL_STATUS_GRP', 9);
2423:
2424: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_control_code_destin = ' || l_lot_control_code_destin, 'INV_MATERIAL_STATUS_GRP', 9);
2425: inv_trx_util_pub.TRACE('inside check_move_diff: l_serial_control_code_destin= '||l_serial_control_code_destin, 'INV_MATERIAL_STATUS_GRP', 9);
2426: inv_trx_util_pub.TRACE('inside check_move_diff: l_locator_control_code = '||l_locator_control_code, 'INV_MATERIAL_STATUS_GRP', 9);
2420: inv_trx_util_pub.TRACE('inside check_move_diff: l_serial_control_code_source = ' || l_serial_control_code_source, 'INV_MATERIAL_STATUS_GRP', 9);
2421: inv_trx_util_pub.TRACE('inside check_move_diff: l_revision_control_code_destin = '||l_revision_control_code_destin, 'INV_MATERIAL_STATUS_GRP', 9);
2422: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_destin_status = '||l_lot_destin_status, 'INV_MATERIAL_STATUS_GRP', 9);
2423:
2424: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_control_code_destin = ' || l_lot_control_code_destin, 'INV_MATERIAL_STATUS_GRP', 9);
2425: inv_trx_util_pub.TRACE('inside check_move_diff: l_serial_control_code_destin= '||l_serial_control_code_destin, 'INV_MATERIAL_STATUS_GRP', 9);
2426: inv_trx_util_pub.TRACE('inside check_move_diff: l_locator_control_code = '||l_locator_control_code, 'INV_MATERIAL_STATUS_GRP', 9);
2427:
2428: end if;
2421: inv_trx_util_pub.TRACE('inside check_move_diff: l_revision_control_code_destin = '||l_revision_control_code_destin, 'INV_MATERIAL_STATUS_GRP', 9);
2422: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_destin_status = '||l_lot_destin_status, 'INV_MATERIAL_STATUS_GRP', 9);
2423:
2424: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_control_code_destin = ' || l_lot_control_code_destin, 'INV_MATERIAL_STATUS_GRP', 9);
2425: inv_trx_util_pub.TRACE('inside check_move_diff: l_serial_control_code_destin= '||l_serial_control_code_destin, 'INV_MATERIAL_STATUS_GRP', 9);
2426: inv_trx_util_pub.TRACE('inside check_move_diff: l_locator_control_code = '||l_locator_control_code, 'INV_MATERIAL_STATUS_GRP', 9);
2427:
2428: end if;
2429:
2422: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_destin_status = '||l_lot_destin_status, 'INV_MATERIAL_STATUS_GRP', 9);
2423:
2424: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_control_code_destin = ' || l_lot_control_code_destin, 'INV_MATERIAL_STATUS_GRP', 9);
2425: inv_trx_util_pub.TRACE('inside check_move_diff: l_serial_control_code_destin= '||l_serial_control_code_destin, 'INV_MATERIAL_STATUS_GRP', 9);
2426: inv_trx_util_pub.TRACE('inside check_move_diff: l_locator_control_code = '||l_locator_control_code, 'INV_MATERIAL_STATUS_GRP', 9);
2427:
2428: end if;
2429:
2430: IF (
2456: END IF;
2457: END IF;
2458:
2459: if (g_debug = 1) then
2460: inv_trx_util_pub.TRACE('inside check_move_diff: l_default_source_status = ' || l_default_source_status, 'INV_MATERIAL_STATUS_GRP', 9);
2461: inv_trx_util_pub.TRACE('inside check_move_diff: l_default_destin_status = ' ||l_default_destin_status, 'INV_MATERIAL_STATUS_GRP', 9);
2462: end if;
2463:
2464: IF (l_default_source_status = 'Y' AND l_default_destin_status ='Y'
2457: END IF;
2458:
2459: if (g_debug = 1) then
2460: inv_trx_util_pub.TRACE('inside check_move_diff: l_default_source_status = ' || l_default_source_status, 'INV_MATERIAL_STATUS_GRP', 9);
2461: inv_trx_util_pub.TRACE('inside check_move_diff: l_default_destin_status = ' ||l_default_destin_status, 'INV_MATERIAL_STATUS_GRP', 9);
2462: end if;
2463:
2464: IF (l_default_source_status = 'Y' AND l_default_destin_status ='Y'
2465: AND NVL(l_allow_different_status,1) = 2) --(O,O) Third if
2466: -- If both the organizations are onhand status controlled
2467: -- then get the status from corresponding SKU's and compare.
2468: THEN
2469: if (g_debug = 1) then
2470: inv_trx_util_pub.TRACE('Inside O=O', 'INV_MATERIAL_STATUS_GRP', 9);
2471: end if ;
2472: IF l_serial_control_code_source IN (1,6) AND l_serial_control_code_destin IN (1,6) THEN
2473: --Get onhand status id from source org.
2474:
2471: end if ;
2472: IF l_serial_control_code_source IN (1,6) AND l_serial_control_code_destin IN (1,6) THEN
2473: --Get onhand status id from source org.
2474:
2475: inv_material_status_grp.get_onhand_status_id
2476: ( p_organization_id => l_org_id
2477: , p_inventory_item_id => p_inventory_item_id
2478: , p_subinventory_code => p_subinventory_code
2479: , p_locator_id => p_locator_id
2482: , x_onhand_status_id => l_onhand_source_status_id );
2483:
2484:
2485: --Get onhand status id from destination org.
2486: inv_material_status_grp.get_onhand_status_id
2487: ( p_organization_id => l_transfer_org_id
2488: , p_inventory_item_id => p_inventory_item_id
2489: , p_subinventory_code => p_transfer_subinventory
2490: , p_locator_id => p_transfer_locator_id
2492: , p_lpn_id => p_lpn_id
2493: , x_onhand_status_id => l_onhand_destin_status_id );
2494:
2495: if (g_debug = 1) then
2496: inv_trx_util_pub.TRACE('inside check_move_diff: l_onhand_source_status_id = ' || l_onhand_source_status_id, 'INV_MATERIAL_STATUS_GRP', 9);
2497: inv_trx_util_pub.TRACE('inside check_move_diff: l_onhand_destin_status_id = '||l_onhand_destin_status_id, 'INV_MATERIAL_STATUS_GRP', 9);
2498: end if;
2499:
2500:
2493: , x_onhand_status_id => l_onhand_destin_status_id );
2494:
2495: if (g_debug = 1) then
2496: inv_trx_util_pub.TRACE('inside check_move_diff: l_onhand_source_status_id = ' || l_onhand_source_status_id, 'INV_MATERIAL_STATUS_GRP', 9);
2497: inv_trx_util_pub.TRACE('inside check_move_diff: l_onhand_destin_status_id = '||l_onhand_destin_status_id, 'INV_MATERIAL_STATUS_GRP', 9);
2498: end if;
2499:
2500:
2501: IF NVL(l_onhand_source_status_id , -1) = 0 --no onhand in source org
2513: AND p_object_type = 'O' AND NVL(l_allow_different_status,1) = 2)
2514: --(L ,0)
2515: THEN
2516: if (g_debug = 1) then
2517: inv_trx_util_pub.TRACE('Inside L-O', 'INV_MATERIAL_STATUS_GRP', 9);
2518: end if ;
2519: -- In source org, item is lot status enabled and destination org is onhand so
2520: -- get the lot status from source org and MOQD status from destination org
2521: IF l_serial_control_code_destin IN (1,6) THEN
2530: WHEN NO_DATA_FOUND THEN
2531: l_lot_status_id := 0;
2532: END;
2533:
2534: inv_material_status_grp.get_onhand_status_id
2535: ( p_organization_id => l_transfer_org_id
2536: , p_inventory_item_id => p_inventory_item_id
2537: , p_subinventory_code => p_transfer_subinventory
2538: , p_locator_id => p_transfer_locator_id
2540: , p_lpn_id => p_lpn_id
2541: , x_onhand_status_id => l_onhand_destin_status_id );
2542:
2543: if (g_debug = 1) then
2544: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_status_id = ' || l_lot_status_id, 'INV_MATERIAL_STATUS_GRP', 9);
2545: inv_trx_util_pub.TRACE('inside check_move_diff: l_onhand_destin_status_id = '|| l_onhand_destin_status_id, 'INV_MATERIAL_STATUS_GRP', 9);
2546: end if;
2547:
2548:
2541: , x_onhand_status_id => l_onhand_destin_status_id );
2542:
2543: if (g_debug = 1) then
2544: inv_trx_util_pub.TRACE('inside check_move_diff: l_lot_status_id = ' || l_lot_status_id, 'INV_MATERIAL_STATUS_GRP', 9);
2545: inv_trx_util_pub.TRACE('inside check_move_diff: l_onhand_destin_status_id = '|| l_onhand_destin_status_id, 'INV_MATERIAL_STATUS_GRP', 9);
2546: end if;
2547:
2548:
2549: IF NVL(l_lot_status_id, -1) = 0 -- lot doesnt exists in source org
2560: ELSIF (l_default_source_status = 'Y' AND l_lot_destin_status = 'Y' AND p_object_type = 'O')
2561: --(O,L)
2562: THEN
2563: if (g_debug = 1) then
2564: inv_trx_util_pub.TRACE('Inside O-L', 'INV_MATERIAL_STATUS_GRP', 9);
2565: end if ;
2566: -- source org is onhand status enabled and destination is lot status enabled
2567: -- Check onhand status id from source org and lot status id from destination org
2568:
2566: -- source org is onhand status enabled and destination is lot status enabled
2567: -- Check onhand status id from source org and lot status id from destination org
2568:
2569: IF l_serial_control_code_source IN (1,6) THEN
2570: inv_material_status_grp.get_onhand_status_id
2571: ( p_organization_id => l_org_id
2572: , p_inventory_item_id => p_inventory_item_id
2573: , p_subinventory_code => p_subinventory_code
2574: , p_locator_id => p_locator_id
2588: l_lot_status_id := 0;
2589: END;
2590:
2591: if (g_debug = 1) then
2592: inv_trx_util_pub.TRACE('l_onhand_source_status_id'||l_onhand_source_status_id, 'INV_MATERIAL_STATUS_GRP', 9);
2593: inv_trx_util_pub.TRACE('l_lot_status_id' || l_lot_status_id, 'INV_MATERIAL_STATUS_GRP', 9);
2594: end if ;
2595:
2596: IF NVL(l_onhand_source_status_id,-1)= 0
2589: END;
2590:
2591: if (g_debug = 1) then
2592: inv_trx_util_pub.TRACE('l_onhand_source_status_id'||l_onhand_source_status_id, 'INV_MATERIAL_STATUS_GRP', 9);
2593: inv_trx_util_pub.TRACE('l_lot_status_id' || l_lot_status_id, 'INV_MATERIAL_STATUS_GRP', 9);
2594: end if ;
2595:
2596: IF NVL(l_onhand_source_status_id,-1)= 0
2597: OR NVL(l_lot_status_id ,-1) = 0
2670:
2671: END IF ; --Third if
2672: IF NOT l_go THEN
2673: if (g_debug = 1) then
2674: inv_trx_util_pub.TRACE('Comingling Occurs', 'INV_MATERIAL_STATUS_GRP', 9);
2675: end if ;
2676:
2677: fnd_message.set_name('INV','INV_TXF_MOVE_DIFF_MAT_STAT');
2678: fnd_msg_pub.ADD;
2761:
2762:
2763: BEGIN
2764: if(g_debug = 1)THEN
2765: inv_trx_util_pub.TRACE('In get_lpn_status','INV_MATERIAL_STATUS_GRP',9);
2766: END if;
2767: l_lpn_org_id := p_organization_id;
2768: l_lpn_sub := p_sub_code;
2769: l_lpn_loc := p_loc_id;
2777: where lpn_id = p_lpn_id;
2778: EXCEPTION
2779: WHEN NO_DATA_FOUND THEN
2780: if(g_debug = 1)THEN
2781: inv_trx_util_pub.TRACE('Unable to find the LPN''INV_MATERIAL_STATUS_GRP',9);
2782: END IF;
2783: x_return_status_code := NULL;
2784: x_return_status_id :=NULL;
2785: RETURN;
2787: END IF;
2788: IF l_lpn_context IN (WMS_Container_PUB.LPN_CONTEXT_PREGENERATED,
2789: WMS_Container_PUB.LPN_CONTEXT_VENDOR) THEN
2790: IF(g_debug = 1)THEN
2791: inv_trx_util_pub.TRACE('LPN CONTEXT IS '||l_lpn_context||' Status should be NULL for that','INV_MATERIAL_STATUS_GRP',9);
2792: END IF;
2793: l_return_status_id := NULL; --if lpn_context is 5 or 7 lpn status should be NULL
2794: ELSIF l_lpn_context IN (WMS_Container_PUB.LPN_CONTEXT_STORES,
2795: WMS_Container_PUB.LPN_CONTEXT_INTRANSIT) THEN
2798: INTO l_def_org_status
2799: FROM mtl_parameters
2800: WHERE organization_id = l_lpn_org_id;
2801: IF(g_debug = 1)THEN
2802: inv_trx_util_pub.TRACE('LPN CONTEXT IS '||l_lpn_context|| ' Status should be default org level staus which is '||l_return_status_id,'INV_MATERIAL_STATUS_GRP',9);
2803: END IF;
2804: l_return_status_id := l_def_org_status; --If lpn_context is 4 or 6 lpn status should be derived from default org parameters
2805: ELSE
2806:
2805: ELSE
2806:
2807: IF (l_lpn_context = WMS_Container_PUB.LPN_CONTEXT_PACKING )THEN--wlc don't exists for the lpn therefore checking mmtt
2808: IF(g_debug = 1)THEN
2809: inv_trx_util_pub.TRACE('WLC is not there and no child record is there for the lpn therefor querying mmtt for details','INV_MATERIAL_STATUS_GRP',9);
2810: END IF;
2811: FOR l_mmtt_cur IN mmtt_cur
2812: LOOP
2813: l_serial_status_enabled := 0;
2829: --item is lot controlled so need to loop through mtlt also
2830: FOR l_mtlt_cur IN mtlt_cur(l_mmtt_cur.transaction_temp_id)
2831: LOOP
2832: l_counter := l_counter + 1;
2833: l_return_status_id := INV_MATERIAL_STATUS_GRP.get_default_status --calling function to get the MOQD status
2834: (p_organization_id => p_organization_id,
2835: p_inventory_item_id => l_mmtt_cur.inventory_item_id,
2836: p_sub_code => l_mmtt_cur.subinventory_code,
2837: p_loc_id => l_mmtt_cur.locator_id,
2846: IF NVL(l_return_status_id,-99) <> NVL(l_status_id,-99) THEN --checking current status from the first status
2847: --There are mixed status so returning -1 and exiting the loop
2848: l_return_status_id := -1;
2849: IF(g_debug = 1)THEN
2850: inv_trx_util_pub.TRACE('lpn has item of mixed statuses so returning mixed at 1','INV_MATERIAL_STATUS_GRP',9);
2851: END IF;
2852: EXIT;
2853: END IF;
2854: END LOOP; --mtlt_cur loop finished
2864: IF l_return_status_id <> l_status_id THEN --checking current status from the first status
2865: --There are mixed status so returning -1 and exiting the loop
2866: l_return_status_id := -1;
2867: IF(g_debug = 1)THEN
2868: inv_trx_util_pub.TRACE('lpn has item of mixed statuses so returning mixed at 2','INV_MATERIAL_STATUS_GRP',9);
2869: END IF;
2870: EXIT;
2871: END IF;
2872: END LOOP; --l_msnt_cur loop finished
2874:
2875: ELSE
2876: l_counter := l_counter + 1;
2877: l_return_status_id :=
2878: INV_MATERIAL_STATUS_GRP.get_default_status --calling function to get the MOQD status
2879: (p_organization_id => p_organization_id,
2880: p_inventory_item_id => l_mmtt_cur.inventory_item_id,
2881: p_sub_code => l_mmtt_cur.subinventory_code,
2882: p_loc_id => l_mmtt_cur.locator_id,
2915: END IF;
2916: IF (l_serial_controlled <> 1) then
2917: l_counter := l_counter + 1;
2918: l_return_status_id :=
2919: INV_MATERIAL_STATUS_GRP.get_default_status --calling function to get the MOQD status
2920: (p_organization_id => p_organization_id,
2921: p_inventory_item_id => l_cur_wlc.inventory_item_id,
2922: p_sub_code => l_lpn_sub,
2923: p_loc_id => l_lpn_loc,
2929: l_status_id := l_return_status_id ; --assigning it for the first to check further if all the statuses are same or not
2930: END IF;
2931: IF (NVL(l_status_id,-99) <> NVL(l_return_status_id,-99)) THEN
2932: IF(g_debug = 1)THEN
2933: inv_trx_util_pub.TRACE('lpn has item of mixed statuses so returning mixed at 3','INV_MATERIAL_STATUS_GRP',9);
2934: END IF;
2935: l_return_status_id := -1;
2936: END IF;
2937: ELSE --item is serial controlled therefor checkin msn for status
2970: ELSIF (NVL(l_return_status_id,-99) = -1)THEN
2971: l_return_status_code := FND_MESSAGE.get_string('WMS','WMS_LPN_STATUS_MIXED');
2972: END IF;
2973: IF(g_debug = 1)THEN
2974: inv_trx_util_pub.TRACE('Return Status id is '||l_return_status_id||' Return staus code is '||l_return_status_code,'INV_MATERIAL_STATUS_GRP',9);
2975: END IF;
2976: x_return_status_id := l_return_status_id;
2977: x_return_status_code := l_return_status_code;
2978: END get_lpn_status;
3275: -- WHERE msnt.transaction_temp_id = l_transaction_temp_id
3276: -- AND msn.serial_number BETWEEN msnt.fm_serial_number AND msnt.to_serial_number;
3277: BEGIN
3278: IF(g_debug = 1)THEN
3279: inv_trx_util_pub.TRACE(c_api_name||':Entered is_status_applicable ', 'inv_material_status_grp', 9);
3280: inv_trx_util_pub.TRACE('p_wms_installed: '||p_wms_installed,'inv_material_status_grp', 9);
3281: inv_trx_util_pub.TRACE('p_trx_status_enabled: '||p_trx_status_enabled,'inv_material_status_grps', 9);
3282: inv_trx_util_pub.TRACE('p_trx_type_id: '||p_trx_type_id,'inv_material_status_grp', 9);
3283: inv_trx_util_pub.TRACE('p_lot_status_enabled: '||p_lot_status_enabled,'inv_material_status_grp', 9);
3276: -- AND msn.serial_number BETWEEN msnt.fm_serial_number AND msnt.to_serial_number;
3277: BEGIN
3278: IF(g_debug = 1)THEN
3279: inv_trx_util_pub.TRACE(c_api_name||':Entered is_status_applicable ', 'inv_material_status_grp', 9);
3280: inv_trx_util_pub.TRACE('p_wms_installed: '||p_wms_installed,'inv_material_status_grp', 9);
3281: inv_trx_util_pub.TRACE('p_trx_status_enabled: '||p_trx_status_enabled,'inv_material_status_grps', 9);
3282: inv_trx_util_pub.TRACE('p_trx_type_id: '||p_trx_type_id,'inv_material_status_grp', 9);
3283: inv_trx_util_pub.TRACE('p_lot_status_enabled: '||p_lot_status_enabled,'inv_material_status_grp', 9);
3284: inv_trx_util_pub.TRACE('p_serial_status_enabled: '||p_serial_status_enabled, 'inv_material_status_grp', 9);
3277: BEGIN
3278: IF(g_debug = 1)THEN
3279: inv_trx_util_pub.TRACE(c_api_name||':Entered is_status_applicable ', 'inv_material_status_grp', 9);
3280: inv_trx_util_pub.TRACE('p_wms_installed: '||p_wms_installed,'inv_material_status_grp', 9);
3281: inv_trx_util_pub.TRACE('p_trx_status_enabled: '||p_trx_status_enabled,'inv_material_status_grps', 9);
3282: inv_trx_util_pub.TRACE('p_trx_type_id: '||p_trx_type_id,'inv_material_status_grp', 9);
3283: inv_trx_util_pub.TRACE('p_lot_status_enabled: '||p_lot_status_enabled,'inv_material_status_grp', 9);
3284: inv_trx_util_pub.TRACE('p_serial_status_enabled: '||p_serial_status_enabled, 'inv_material_status_grp', 9);
3285: inv_trx_util_pub.TRACE('p_organization_id: '||p_organization_id,'inv_material_status_grp', 9);
3278: IF(g_debug = 1)THEN
3279: inv_trx_util_pub.TRACE(c_api_name||':Entered is_status_applicable ', 'inv_material_status_grp', 9);
3280: inv_trx_util_pub.TRACE('p_wms_installed: '||p_wms_installed,'inv_material_status_grp', 9);
3281: inv_trx_util_pub.TRACE('p_trx_status_enabled: '||p_trx_status_enabled,'inv_material_status_grps', 9);
3282: inv_trx_util_pub.TRACE('p_trx_type_id: '||p_trx_type_id,'inv_material_status_grp', 9);
3283: inv_trx_util_pub.TRACE('p_lot_status_enabled: '||p_lot_status_enabled,'inv_material_status_grp', 9);
3284: inv_trx_util_pub.TRACE('p_serial_status_enabled: '||p_serial_status_enabled, 'inv_material_status_grp', 9);
3285: inv_trx_util_pub.TRACE('p_organization_id: '||p_organization_id,'inv_material_status_grp', 9);
3286: inv_trx_util_pub.TRACE('p_inventory_item_id: '||p_inventory_item_id,'inv_material_status_grp', 9);
3279: inv_trx_util_pub.TRACE(c_api_name||':Entered is_status_applicable ', 'inv_material_status_grp', 9);
3280: inv_trx_util_pub.TRACE('p_wms_installed: '||p_wms_installed,'inv_material_status_grp', 9);
3281: inv_trx_util_pub.TRACE('p_trx_status_enabled: '||p_trx_status_enabled,'inv_material_status_grps', 9);
3282: inv_trx_util_pub.TRACE('p_trx_type_id: '||p_trx_type_id,'inv_material_status_grp', 9);
3283: inv_trx_util_pub.TRACE('p_lot_status_enabled: '||p_lot_status_enabled,'inv_material_status_grp', 9);
3284: inv_trx_util_pub.TRACE('p_serial_status_enabled: '||p_serial_status_enabled, 'inv_material_status_grp', 9);
3285: inv_trx_util_pub.TRACE('p_organization_id: '||p_organization_id,'inv_material_status_grp', 9);
3286: inv_trx_util_pub.TRACE('p_inventory_item_id: '||p_inventory_item_id,'inv_material_status_grp', 9);
3287: inv_trx_util_pub.TRACE('p_sub_code: '||p_sub_code,'inv_material_status_grp', 9);
3280: inv_trx_util_pub.TRACE('p_wms_installed: '||p_wms_installed,'inv_material_status_grp', 9);
3281: inv_trx_util_pub.TRACE('p_trx_status_enabled: '||p_trx_status_enabled,'inv_material_status_grps', 9);
3282: inv_trx_util_pub.TRACE('p_trx_type_id: '||p_trx_type_id,'inv_material_status_grp', 9);
3283: inv_trx_util_pub.TRACE('p_lot_status_enabled: '||p_lot_status_enabled,'inv_material_status_grp', 9);
3284: inv_trx_util_pub.TRACE('p_serial_status_enabled: '||p_serial_status_enabled, 'inv_material_status_grp', 9);
3285: inv_trx_util_pub.TRACE('p_organization_id: '||p_organization_id,'inv_material_status_grp', 9);
3286: inv_trx_util_pub.TRACE('p_inventory_item_id: '||p_inventory_item_id,'inv_material_status_grp', 9);
3287: inv_trx_util_pub.TRACE('p_sub_code: '||p_sub_code,'inv_material_status_grp', 9);
3288: inv_trx_util_pub.TRACE('p_locator_id: '||p_locator_id,'inv_material_status_grp', 9);
3281: inv_trx_util_pub.TRACE('p_trx_status_enabled: '||p_trx_status_enabled,'inv_material_status_grps', 9);
3282: inv_trx_util_pub.TRACE('p_trx_type_id: '||p_trx_type_id,'inv_material_status_grp', 9);
3283: inv_trx_util_pub.TRACE('p_lot_status_enabled: '||p_lot_status_enabled,'inv_material_status_grp', 9);
3284: inv_trx_util_pub.TRACE('p_serial_status_enabled: '||p_serial_status_enabled, 'inv_material_status_grp', 9);
3285: inv_trx_util_pub.TRACE('p_organization_id: '||p_organization_id,'inv_material_status_grp', 9);
3286: inv_trx_util_pub.TRACE('p_inventory_item_id: '||p_inventory_item_id,'inv_material_status_grp', 9);
3287: inv_trx_util_pub.TRACE('p_sub_code: '||p_sub_code,'inv_material_status_grp', 9);
3288: inv_trx_util_pub.TRACE('p_locator_id: '||p_locator_id,'inv_material_status_grp', 9);
3289: inv_trx_util_pub.TRACE('p_lot_number: '||p_lot_number,'inv_material_status_grp', 9);
3282: inv_trx_util_pub.TRACE('p_trx_type_id: '||p_trx_type_id,'inv_material_status_grp', 9);
3283: inv_trx_util_pub.TRACE('p_lot_status_enabled: '||p_lot_status_enabled,'inv_material_status_grp', 9);
3284: inv_trx_util_pub.TRACE('p_serial_status_enabled: '||p_serial_status_enabled, 'inv_material_status_grp', 9);
3285: inv_trx_util_pub.TRACE('p_organization_id: '||p_organization_id,'inv_material_status_grp', 9);
3286: inv_trx_util_pub.TRACE('p_inventory_item_id: '||p_inventory_item_id,'inv_material_status_grp', 9);
3287: inv_trx_util_pub.TRACE('p_sub_code: '||p_sub_code,'inv_material_status_grp', 9);
3288: inv_trx_util_pub.TRACE('p_locator_id: '||p_locator_id,'inv_material_status_grp', 9);
3289: inv_trx_util_pub.TRACE('p_lot_number: '||p_lot_number,'inv_material_status_grp', 9);
3290: inv_trx_util_pub.TRACE('p_serial_number: '||p_serial_number,'inv_material_status_grp', 9);
3283: inv_trx_util_pub.TRACE('p_lot_status_enabled: '||p_lot_status_enabled,'inv_material_status_grp', 9);
3284: inv_trx_util_pub.TRACE('p_serial_status_enabled: '||p_serial_status_enabled, 'inv_material_status_grp', 9);
3285: inv_trx_util_pub.TRACE('p_organization_id: '||p_organization_id,'inv_material_status_grp', 9);
3286: inv_trx_util_pub.TRACE('p_inventory_item_id: '||p_inventory_item_id,'inv_material_status_grp', 9);
3287: inv_trx_util_pub.TRACE('p_sub_code: '||p_sub_code,'inv_material_status_grp', 9);
3288: inv_trx_util_pub.TRACE('p_locator_id: '||p_locator_id,'inv_material_status_grp', 9);
3289: inv_trx_util_pub.TRACE('p_lot_number: '||p_lot_number,'inv_material_status_grp', 9);
3290: inv_trx_util_pub.TRACE('p_serial_number: '||p_serial_number,'inv_material_status_grp', 9);
3291: inv_trx_util_pub.TRACE('p_object_type: '||p_object_type,'inv_material_status_grp', 9);
3284: inv_trx_util_pub.TRACE('p_serial_status_enabled: '||p_serial_status_enabled, 'inv_material_status_grp', 9);
3285: inv_trx_util_pub.TRACE('p_organization_id: '||p_organization_id,'inv_material_status_grp', 9);
3286: inv_trx_util_pub.TRACE('p_inventory_item_id: '||p_inventory_item_id,'inv_material_status_grp', 9);
3287: inv_trx_util_pub.TRACE('p_sub_code: '||p_sub_code,'inv_material_status_grp', 9);
3288: inv_trx_util_pub.TRACE('p_locator_id: '||p_locator_id,'inv_material_status_grp', 9);
3289: inv_trx_util_pub.TRACE('p_lot_number: '||p_lot_number,'inv_material_status_grp', 9);
3290: inv_trx_util_pub.TRACE('p_serial_number: '||p_serial_number,'inv_material_status_grp', 9);
3291: inv_trx_util_pub.TRACE('p_object_type: '||p_object_type,'inv_material_status_grp', 9);
3292:
3285: inv_trx_util_pub.TRACE('p_organization_id: '||p_organization_id,'inv_material_status_grp', 9);
3286: inv_trx_util_pub.TRACE('p_inventory_item_id: '||p_inventory_item_id,'inv_material_status_grp', 9);
3287: inv_trx_util_pub.TRACE('p_sub_code: '||p_sub_code,'inv_material_status_grp', 9);
3288: inv_trx_util_pub.TRACE('p_locator_id: '||p_locator_id,'inv_material_status_grp', 9);
3289: inv_trx_util_pub.TRACE('p_lot_number: '||p_lot_number,'inv_material_status_grp', 9);
3290: inv_trx_util_pub.TRACE('p_serial_number: '||p_serial_number,'inv_material_status_grp', 9);
3291: inv_trx_util_pub.TRACE('p_object_type: '||p_object_type,'inv_material_status_grp', 9);
3292:
3293: inv_trx_util_pub.TRACE('p_fromlpn_id: '||p_fromlpn_id,'inv_material_status_grp', 9);
3286: inv_trx_util_pub.TRACE('p_inventory_item_id: '||p_inventory_item_id,'inv_material_status_grp', 9);
3287: inv_trx_util_pub.TRACE('p_sub_code: '||p_sub_code,'inv_material_status_grp', 9);
3288: inv_trx_util_pub.TRACE('p_locator_id: '||p_locator_id,'inv_material_status_grp', 9);
3289: inv_trx_util_pub.TRACE('p_lot_number: '||p_lot_number,'inv_material_status_grp', 9);
3290: inv_trx_util_pub.TRACE('p_serial_number: '||p_serial_number,'inv_material_status_grp', 9);
3291: inv_trx_util_pub.TRACE('p_object_type: '||p_object_type,'inv_material_status_grp', 9);
3292:
3293: inv_trx_util_pub.TRACE('p_fromlpn_id: '||p_fromlpn_id,'inv_material_status_grp', 9);
3294: inv_trx_util_pub.TRACE('p_xfer_lpn_id: '||p_xfer_lpn_id,'inv_material_status_grp', 9);
3287: inv_trx_util_pub.TRACE('p_sub_code: '||p_sub_code,'inv_material_status_grp', 9);
3288: inv_trx_util_pub.TRACE('p_locator_id: '||p_locator_id,'inv_material_status_grp', 9);
3289: inv_trx_util_pub.TRACE('p_lot_number: '||p_lot_number,'inv_material_status_grp', 9);
3290: inv_trx_util_pub.TRACE('p_serial_number: '||p_serial_number,'inv_material_status_grp', 9);
3291: inv_trx_util_pub.TRACE('p_object_type: '||p_object_type,'inv_material_status_grp', 9);
3292:
3293: inv_trx_util_pub.TRACE('p_fromlpn_id: '||p_fromlpn_id,'inv_material_status_grp', 9);
3294: inv_trx_util_pub.TRACE('p_xfer_lpn_id: '||p_xfer_lpn_id,'inv_material_status_grp', 9);
3295: inv_trx_util_pub.TRACE('p_xfer_sub_code: '||p_xfer_sub_code,'inv_material_status_grp', 9);
3289: inv_trx_util_pub.TRACE('p_lot_number: '||p_lot_number,'inv_material_status_grp', 9);
3290: inv_trx_util_pub.TRACE('p_serial_number: '||p_serial_number,'inv_material_status_grp', 9);
3291: inv_trx_util_pub.TRACE('p_object_type: '||p_object_type,'inv_material_status_grp', 9);
3292:
3293: inv_trx_util_pub.TRACE('p_fromlpn_id: '||p_fromlpn_id,'inv_material_status_grp', 9);
3294: inv_trx_util_pub.TRACE('p_xfer_lpn_id: '||p_xfer_lpn_id,'inv_material_status_grp', 9);
3295: inv_trx_util_pub.TRACE('p_xfer_sub_code: '||p_xfer_sub_code,'inv_material_status_grp', 9);
3296: inv_trx_util_pub.TRACE('p_xfer_locator_id: '||p_xfer_locator_id,'inv_material_status_grp', 9);
3297: inv_trx_util_pub.TRACE('p_xfer_org_id: '||p_xfer_org_id, 'inv_material_status_grp', 9);
3290: inv_trx_util_pub.TRACE('p_serial_number: '||p_serial_number,'inv_material_status_grp', 9);
3291: inv_trx_util_pub.TRACE('p_object_type: '||p_object_type,'inv_material_status_grp', 9);
3292:
3293: inv_trx_util_pub.TRACE('p_fromlpn_id: '||p_fromlpn_id,'inv_material_status_grp', 9);
3294: inv_trx_util_pub.TRACE('p_xfer_lpn_id: '||p_xfer_lpn_id,'inv_material_status_grp', 9);
3295: inv_trx_util_pub.TRACE('p_xfer_sub_code: '||p_xfer_sub_code,'inv_material_status_grp', 9);
3296: inv_trx_util_pub.TRACE('p_xfer_locator_id: '||p_xfer_locator_id,'inv_material_status_grp', 9);
3297: inv_trx_util_pub.TRACE('p_xfer_org_id: '||p_xfer_org_id, 'inv_material_status_grp', 9);
3298: END IF;
3291: inv_trx_util_pub.TRACE('p_object_type: '||p_object_type,'inv_material_status_grp', 9);
3292:
3293: inv_trx_util_pub.TRACE('p_fromlpn_id: '||p_fromlpn_id,'inv_material_status_grp', 9);
3294: inv_trx_util_pub.TRACE('p_xfer_lpn_id: '||p_xfer_lpn_id,'inv_material_status_grp', 9);
3295: inv_trx_util_pub.TRACE('p_xfer_sub_code: '||p_xfer_sub_code,'inv_material_status_grp', 9);
3296: inv_trx_util_pub.TRACE('p_xfer_locator_id: '||p_xfer_locator_id,'inv_material_status_grp', 9);
3297: inv_trx_util_pub.TRACE('p_xfer_org_id: '||p_xfer_org_id, 'inv_material_status_grp', 9);
3298: END IF;
3299:
3292:
3293: inv_trx_util_pub.TRACE('p_fromlpn_id: '||p_fromlpn_id,'inv_material_status_grp', 9);
3294: inv_trx_util_pub.TRACE('p_xfer_lpn_id: '||p_xfer_lpn_id,'inv_material_status_grp', 9);
3295: inv_trx_util_pub.TRACE('p_xfer_sub_code: '||p_xfer_sub_code,'inv_material_status_grp', 9);
3296: inv_trx_util_pub.TRACE('p_xfer_locator_id: '||p_xfer_locator_id,'inv_material_status_grp', 9);
3297: inv_trx_util_pub.TRACE('p_xfer_org_id: '||p_xfer_org_id, 'inv_material_status_grp', 9);
3298: END IF;
3299:
3300: BEGIN
3293: inv_trx_util_pub.TRACE('p_fromlpn_id: '||p_fromlpn_id,'inv_material_status_grp', 9);
3294: inv_trx_util_pub.TRACE('p_xfer_lpn_id: '||p_xfer_lpn_id,'inv_material_status_grp', 9);
3295: inv_trx_util_pub.TRACE('p_xfer_sub_code: '||p_xfer_sub_code,'inv_material_status_grp', 9);
3296: inv_trx_util_pub.TRACE('p_xfer_locator_id: '||p_xfer_locator_id,'inv_material_status_grp', 9);
3297: inv_trx_util_pub.TRACE('p_xfer_org_id: '||p_xfer_org_id, 'inv_material_status_grp', 9);
3298: END IF;
3299:
3300: BEGIN
3301:
3312:
3313: END;
3314:
3315: IF(g_debug = 1)THEN
3316: inv_trx_util_pub.TRACE('LPN Context: '|| l_lpn_context,'inv_material_status_grp', 9);
3317: inv_trx_util_pub.TRACE('LPN Org Id: '|| l_lpn_org_id,'inv_material_status_grp', 9);
3318: inv_trx_util_pub.TRACE('LPN Sub: '|| l_lpn_sub,'inv_material_status_grp', 9);
3319: inv_trx_util_pub.TRACE('LPN Locator: '|| l_lpn_loc,'inv_material_status_grp', 9);
3320: END IF;
3313: END;
3314:
3315: IF(g_debug = 1)THEN
3316: inv_trx_util_pub.TRACE('LPN Context: '|| l_lpn_context,'inv_material_status_grp', 9);
3317: inv_trx_util_pub.TRACE('LPN Org Id: '|| l_lpn_org_id,'inv_material_status_grp', 9);
3318: inv_trx_util_pub.TRACE('LPN Sub: '|| l_lpn_sub,'inv_material_status_grp', 9);
3319: inv_trx_util_pub.TRACE('LPN Locator: '|| l_lpn_loc,'inv_material_status_grp', 9);
3320: END IF;
3321:
3314:
3315: IF(g_debug = 1)THEN
3316: inv_trx_util_pub.TRACE('LPN Context: '|| l_lpn_context,'inv_material_status_grp', 9);
3317: inv_trx_util_pub.TRACE('LPN Org Id: '|| l_lpn_org_id,'inv_material_status_grp', 9);
3318: inv_trx_util_pub.TRACE('LPN Sub: '|| l_lpn_sub,'inv_material_status_grp', 9);
3319: inv_trx_util_pub.TRACE('LPN Locator: '|| l_lpn_loc,'inv_material_status_grp', 9);
3320: END IF;
3321:
3322: if l_lpn_context=WMS_Container_PUB.LPN_CONTEXT_INV then
3315: IF(g_debug = 1)THEN
3316: inv_trx_util_pub.TRACE('LPN Context: '|| l_lpn_context,'inv_material_status_grp', 9);
3317: inv_trx_util_pub.TRACE('LPN Org Id: '|| l_lpn_org_id,'inv_material_status_grp', 9);
3318: inv_trx_util_pub.TRACE('LPN Sub: '|| l_lpn_sub,'inv_material_status_grp', 9);
3319: inv_trx_util_pub.TRACE('LPN Locator: '|| l_lpn_loc,'inv_material_status_grp', 9);
3320: END IF;
3321:
3322: if l_lpn_context=WMS_Container_PUB.LPN_CONTEXT_INV then
3323:
3333: LOOP
3334: IF(g_debug = 1)THEN
3335: inv_trx_util_pub.TRACE('In loop, Checking the material status for the item: '||l_cur_wlc.inventory_item_id);
3336: END IF;
3337: l_trx_allow := inv_material_status_grp.is_status_applicable_lpns(p_wms_installed => p_wms_installed,
3338: p_trx_status_enabled =>p_trx_status_enabled,
3339: p_trx_type_id => l_trx_type_id,
3340: p_lot_status_enabled => p_lot_status_enabled,
3341: p_serial_status_enabled => p_serial_status_enabled,
3374: elsif l_lpn_context= WMS_Container_PUB.LPN_CONTEXT_RCV or
3375: l_lpn_context= WMS_Container_PUB.LPN_CONTEXT_WIP then
3376: -- LPN is in receiving or WIP
3377: IF(g_debug = 1)THEN
3378: inv_trx_util_pub.TRACE('LPN is in Receiving:','inv_material_status_grp', 9);
3379: END IF;
3380:
3381: --IF p_trx_type_id IS NULL AND l_lpn_context= WMS_Container_PUB.LPN_CONTEXT_WIP THEN
3382: --p_trx_type_id:=43; -- WIP Component Return.
3403: IF(g_debug = 1)THEN
3404: inv_trx_util_pub.TRACE('Before calling get_default_status');
3405: END IF;
3406: l_return_status :=
3407: INV_MATERIAL_STATUS_GRP.get_default_status
3408: (p_organization_id => p_organization_id,
3409: p_inventory_item_id => l_cur_mtrl.inventory_item_id,
3410: p_sub_code => l_lpn_sub,
3411: p_loc_id => l_lpn_loc,
3415: IF(g_debug = 1)THEN
3416: inv_trx_util_pub.TRACE('Value of l_return_status: '||l_return_status);
3417: END IF;
3418:
3419: l_trx_allowed := inv_material_status_grp.is_trx_allowed(
3420: p_status_id => l_return_status
3421: ,p_transaction_type_id => l_cur_mtrl.transaction_type_id
3422: ,x_return_status => l_trx_allowed
3423: ,x_msg_count => l_msg_count
3445: FOR l_msn_cur in msn_cur(l_cur_mtrl.lpn_id , l_cur_mtrl.inventory_item_id) loop
3446: --l_counter := l_counter + 1;
3447: l_return_status := l_msn_cur.status_id;
3448:
3449: l_trx_allowed := inv_material_status_grp.is_trx_allowed(
3450: p_status_id => l_return_status
3451: ,p_transaction_type_id => l_cur_mtrl.transaction_type_id
3452: ,x_return_status => l_trx_allowed
3453: ,x_msg_count => l_msg_count
3514: IF (l_lot_controlled = 1 AND l_serial_controlled = 0) THEN
3515: -- Item is lot controlled item. We are not taking care of both lot and serial controlled items.
3516: FOR l_mtlt_cur IN mtlt_cur(l_mmtt_cur.transaction_temp_id)
3517: LOOP
3518: l_return_status := INV_MATERIAL_STATUS_GRP.get_default_status --calling function to get the MOQD status
3519: (p_organization_id => p_organization_id,
3520: p_inventory_item_id => l_mmtt_cur.inventory_item_id,
3521: p_sub_code => l_mmtt_cur.subinventory_code,
3522: p_loc_id => l_mmtt_cur.locator_id,
3532: inv_trx_util_pub.TRACE('Value of l_return_status: '||l_return_status);
3533:
3534: END IF;
3535:
3536: l_trx_allowed := inv_material_status_grp.is_trx_allowed(
3537: p_status_id => l_return_status
3538: ,p_transaction_type_id => l_mmtt_cur.transaction_type_id
3539: ,x_return_status => l_trx_allowed
3540: ,x_msg_count => l_msg_count
3585: inv_trx_util_pub.TRACE('It is serial controlled item ', 9);
3586: inv_trx_util_pub.TRACE('Querying MSN and MSNT to know the status ', 9);
3587: FOR l_msnt_cur IN msnt_cur(l_mmtt_cur.transaction_temp_id) LOOP
3588: l_return_status := l_msnt_cur.status_id;
3589: l_trx_allowed := inv_material_status_grp.is_trx_allowed(
3590: p_status_id => l_return_status
3591: ,p_transaction_type_id => l_mmtt_cur.transaction_type_id
3592: ,x_return_status => l_trx_allowed
3593: ,x_msg_count => l_msg_count
3612:
3613: ELSE
3614: -- Not lot controlled and not serial controlled item
3615: l_return_status :=
3616: INV_MATERIAL_STATUS_GRP.get_default_status --calling function to get the MOQD status
3617: (p_organization_id => p_organization_id,
3618: p_inventory_item_id => l_mmtt_cur.inventory_item_id,
3619: p_sub_code => l_mmtt_cur.subinventory_code,
3620: p_loc_id => l_mmtt_cur.locator_id,
3621: p_lot_number => NULL,
3622: p_lpn_id => l_mmtt_cur.lpn_id,
3623: p_transaction_action_id=> NULL,
3624: p_src_status_id => NULL);
3625: l_trx_allowed := inv_material_status_grp.is_trx_allowed(
3626: p_status_id => l_return_status
3627: ,p_transaction_type_id => l_mmtt_cur.transaction_type_id
3628: ,x_return_status => l_trx_allowed
3629: ,x_msg_count => l_msg_count
3684: END is_trx_allow_lpns;
3685: /* -- LPN Status Project --*/
3686:
3687:
3688: END INV_MATERIAL_STATUS_GRP;