79: l_location_id NUMBER;
80: l_region_id_list varchar2(32000) := ',';
81: l_return_status VARCHAR2(1);
82: l_region_id_tbl WSH_UTIL_CORE.ID_TAB_TYPE;
83: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
84: --15885432 Start
85: Region_Loc_zone_tab WSH_UTIL_CORE.Id_Tab_Type;
86: --15885432 End
87: begin
102: x_return_status => l_return_status );
103:
104: IF l_return_status <> FND_API.G_RET_STS_SUCCESS then
105: IF l_debug_level > 0 then
106: oe_debug_pub.add('Unexpected error in WSH_REGIONS_SEARCH_PKG.Get_All_RegionId_Matches');
107: END IF;
108:
109: RETURN NULL;
110: END IF;
119: x_return_status => l_return_status);
120:
121: IF l_return_status <> FND_API.G_RET_STS_SUCCESS then
122: IF l_debug_level > 0 then
123: oe_debug_pub.add('Unexpected error in WSH_REGIONS_SEARCH_PKG.Get_All_Zone_Matches');
124: END IF;
125:
126: RETURN NULL;
127: END IF;
150: END IF;
151: Exception
152: when others then
153: IF l_debug_level > 0 then
154: oe_debug_pub.add('Unexpected error in getting the region_ids :'||SQLERRM);
155: END IF;
156:
157: return NULL;
158:
245: P_INVOICE_TO_ORG_ID IN NUMBER,
246: P_DELIVER_TO_ORG_ID IN NUMBER
247: ) IS
248:
249: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
250: begin
251:
252: IF l_debug_level > 0 then
253: oe_debug_pub.add(' Set Globals - P_CUSTOMER_ID :'||P_CUSTOMER_ID );
249: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
250: begin
251:
252: IF l_debug_level > 0 then
253: oe_debug_pub.add(' Set Globals - P_CUSTOMER_ID :'||P_CUSTOMER_ID );
254: oe_debug_pub.add(' Set Globals - P_CUSTOMER_CLASS_ID :'||P_CUSTOMER_CLASS_ID );
255: oe_debug_pub.add(' Set Globals - P_CUSTOMER_CATEGORY_CODE :'||P_CUSTOMER_CATEGORY_CODE );
256: oe_debug_pub.add(' Set Globals - P_REGION_ID_LIST :'|| P_REGION_ID_LIST );
257: oe_debug_pub.add(' Set Globals - P_ORDER_TYPE_ID :'||P_ORDER_TYPE_ID );
250: begin
251:
252: IF l_debug_level > 0 then
253: oe_debug_pub.add(' Set Globals - P_CUSTOMER_ID :'||P_CUSTOMER_ID );
254: oe_debug_pub.add(' Set Globals - P_CUSTOMER_CLASS_ID :'||P_CUSTOMER_CLASS_ID );
255: oe_debug_pub.add(' Set Globals - P_CUSTOMER_CATEGORY_CODE :'||P_CUSTOMER_CATEGORY_CODE );
256: oe_debug_pub.add(' Set Globals - P_REGION_ID_LIST :'|| P_REGION_ID_LIST );
257: oe_debug_pub.add(' Set Globals - P_ORDER_TYPE_ID :'||P_ORDER_TYPE_ID );
258: oe_debug_pub.add(' Set Globals - P_SHIP_TO_ORG_ID :'||P_SHIP_TO_ORG_ID );
251:
252: IF l_debug_level > 0 then
253: oe_debug_pub.add(' Set Globals - P_CUSTOMER_ID :'||P_CUSTOMER_ID );
254: oe_debug_pub.add(' Set Globals - P_CUSTOMER_CLASS_ID :'||P_CUSTOMER_CLASS_ID );
255: oe_debug_pub.add(' Set Globals - P_CUSTOMER_CATEGORY_CODE :'||P_CUSTOMER_CATEGORY_CODE );
256: oe_debug_pub.add(' Set Globals - P_REGION_ID_LIST :'|| P_REGION_ID_LIST );
257: oe_debug_pub.add(' Set Globals - P_ORDER_TYPE_ID :'||P_ORDER_TYPE_ID );
258: oe_debug_pub.add(' Set Globals - P_SHIP_TO_ORG_ID :'||P_SHIP_TO_ORG_ID );
259: oe_debug_pub.add(' Set Globals - P_SALES_CHANNEL_CODE :'||P_SALES_CHANNEL_CODE);
252: IF l_debug_level > 0 then
253: oe_debug_pub.add(' Set Globals - P_CUSTOMER_ID :'||P_CUSTOMER_ID );
254: oe_debug_pub.add(' Set Globals - P_CUSTOMER_CLASS_ID :'||P_CUSTOMER_CLASS_ID );
255: oe_debug_pub.add(' Set Globals - P_CUSTOMER_CATEGORY_CODE :'||P_CUSTOMER_CATEGORY_CODE );
256: oe_debug_pub.add(' Set Globals - P_REGION_ID_LIST :'|| P_REGION_ID_LIST );
257: oe_debug_pub.add(' Set Globals - P_ORDER_TYPE_ID :'||P_ORDER_TYPE_ID );
258: oe_debug_pub.add(' Set Globals - P_SHIP_TO_ORG_ID :'||P_SHIP_TO_ORG_ID );
259: oe_debug_pub.add(' Set Globals - P_SALES_CHANNEL_CODE :'||P_SALES_CHANNEL_CODE);
260: oe_debug_pub.add(' Set Globals - P_SALESREP_ID :'||P_SALESREP_ID );
253: oe_debug_pub.add(' Set Globals - P_CUSTOMER_ID :'||P_CUSTOMER_ID );
254: oe_debug_pub.add(' Set Globals - P_CUSTOMER_CLASS_ID :'||P_CUSTOMER_CLASS_ID );
255: oe_debug_pub.add(' Set Globals - P_CUSTOMER_CATEGORY_CODE :'||P_CUSTOMER_CATEGORY_CODE );
256: oe_debug_pub.add(' Set Globals - P_REGION_ID_LIST :'|| P_REGION_ID_LIST );
257: oe_debug_pub.add(' Set Globals - P_ORDER_TYPE_ID :'||P_ORDER_TYPE_ID );
258: oe_debug_pub.add(' Set Globals - P_SHIP_TO_ORG_ID :'||P_SHIP_TO_ORG_ID );
259: oe_debug_pub.add(' Set Globals - P_SALES_CHANNEL_CODE :'||P_SALES_CHANNEL_CODE);
260: oe_debug_pub.add(' Set Globals - P_SALESREP_ID :'||P_SALESREP_ID );
261: oe_debug_pub.add(' Set Globals - P_END_CUSTOMER_ID :'||P_END_CUSTOMER_ID );
254: oe_debug_pub.add(' Set Globals - P_CUSTOMER_CLASS_ID :'||P_CUSTOMER_CLASS_ID );
255: oe_debug_pub.add(' Set Globals - P_CUSTOMER_CATEGORY_CODE :'||P_CUSTOMER_CATEGORY_CODE );
256: oe_debug_pub.add(' Set Globals - P_REGION_ID_LIST :'|| P_REGION_ID_LIST );
257: oe_debug_pub.add(' Set Globals - P_ORDER_TYPE_ID :'||P_ORDER_TYPE_ID );
258: oe_debug_pub.add(' Set Globals - P_SHIP_TO_ORG_ID :'||P_SHIP_TO_ORG_ID );
259: oe_debug_pub.add(' Set Globals - P_SALES_CHANNEL_CODE :'||P_SALES_CHANNEL_CODE);
260: oe_debug_pub.add(' Set Globals - P_SALESREP_ID :'||P_SALESREP_ID );
261: oe_debug_pub.add(' Set Globals - P_END_CUSTOMER_ID :'||P_END_CUSTOMER_ID );
262: oe_debug_pub.add(' Set Globals - P_INVOICE_TO_ORG_ID :'||P_INVOICE_TO_ORG_ID);
255: oe_debug_pub.add(' Set Globals - P_CUSTOMER_CATEGORY_CODE :'||P_CUSTOMER_CATEGORY_CODE );
256: oe_debug_pub.add(' Set Globals - P_REGION_ID_LIST :'|| P_REGION_ID_LIST );
257: oe_debug_pub.add(' Set Globals - P_ORDER_TYPE_ID :'||P_ORDER_TYPE_ID );
258: oe_debug_pub.add(' Set Globals - P_SHIP_TO_ORG_ID :'||P_SHIP_TO_ORG_ID );
259: oe_debug_pub.add(' Set Globals - P_SALES_CHANNEL_CODE :'||P_SALES_CHANNEL_CODE);
260: oe_debug_pub.add(' Set Globals - P_SALESREP_ID :'||P_SALESREP_ID );
261: oe_debug_pub.add(' Set Globals - P_END_CUSTOMER_ID :'||P_END_CUSTOMER_ID );
262: oe_debug_pub.add(' Set Globals - P_INVOICE_TO_ORG_ID :'||P_INVOICE_TO_ORG_ID);
263: oe_debug_pub.add(' Set Globals - P_DELIVER_TO_ORG_ID :'||P_DELIVER_TO_ORG_ID);
256: oe_debug_pub.add(' Set Globals - P_REGION_ID_LIST :'|| P_REGION_ID_LIST );
257: oe_debug_pub.add(' Set Globals - P_ORDER_TYPE_ID :'||P_ORDER_TYPE_ID );
258: oe_debug_pub.add(' Set Globals - P_SHIP_TO_ORG_ID :'||P_SHIP_TO_ORG_ID );
259: oe_debug_pub.add(' Set Globals - P_SALES_CHANNEL_CODE :'||P_SALES_CHANNEL_CODE);
260: oe_debug_pub.add(' Set Globals - P_SALESREP_ID :'||P_SALESREP_ID );
261: oe_debug_pub.add(' Set Globals - P_END_CUSTOMER_ID :'||P_END_CUSTOMER_ID );
262: oe_debug_pub.add(' Set Globals - P_INVOICE_TO_ORG_ID :'||P_INVOICE_TO_ORG_ID);
263: oe_debug_pub.add(' Set Globals - P_DELIVER_TO_ORG_ID :'||P_DELIVER_TO_ORG_ID);
264: oe_debug_pub.add(' Set Globals - OPERATING_UNIT_ID :'|| mo_global.get_current_org_id);
257: oe_debug_pub.add(' Set Globals - P_ORDER_TYPE_ID :'||P_ORDER_TYPE_ID );
258: oe_debug_pub.add(' Set Globals - P_SHIP_TO_ORG_ID :'||P_SHIP_TO_ORG_ID );
259: oe_debug_pub.add(' Set Globals - P_SALES_CHANNEL_CODE :'||P_SALES_CHANNEL_CODE);
260: oe_debug_pub.add(' Set Globals - P_SALESREP_ID :'||P_SALESREP_ID );
261: oe_debug_pub.add(' Set Globals - P_END_CUSTOMER_ID :'||P_END_CUSTOMER_ID );
262: oe_debug_pub.add(' Set Globals - P_INVOICE_TO_ORG_ID :'||P_INVOICE_TO_ORG_ID);
263: oe_debug_pub.add(' Set Globals - P_DELIVER_TO_ORG_ID :'||P_DELIVER_TO_ORG_ID);
264: oe_debug_pub.add(' Set Globals - OPERATING_UNIT_ID :'|| mo_global.get_current_org_id);
265: oe_debug_pub.add(' Set Globals - ITEM_VALIDATION_ORG_ID :'|| OE_SYS_PARAMETERS.VALUE('MASTER_ORGANIZATION_ID'));
258: oe_debug_pub.add(' Set Globals - P_SHIP_TO_ORG_ID :'||P_SHIP_TO_ORG_ID );
259: oe_debug_pub.add(' Set Globals - P_SALES_CHANNEL_CODE :'||P_SALES_CHANNEL_CODE);
260: oe_debug_pub.add(' Set Globals - P_SALESREP_ID :'||P_SALESREP_ID );
261: oe_debug_pub.add(' Set Globals - P_END_CUSTOMER_ID :'||P_END_CUSTOMER_ID );
262: oe_debug_pub.add(' Set Globals - P_INVOICE_TO_ORG_ID :'||P_INVOICE_TO_ORG_ID);
263: oe_debug_pub.add(' Set Globals - P_DELIVER_TO_ORG_ID :'||P_DELIVER_TO_ORG_ID);
264: oe_debug_pub.add(' Set Globals - OPERATING_UNIT_ID :'|| mo_global.get_current_org_id);
265: oe_debug_pub.add(' Set Globals - ITEM_VALIDATION_ORG_ID :'|| OE_SYS_PARAMETERS.VALUE('MASTER_ORGANIZATION_ID'));
266: END IF;
259: oe_debug_pub.add(' Set Globals - P_SALES_CHANNEL_CODE :'||P_SALES_CHANNEL_CODE);
260: oe_debug_pub.add(' Set Globals - P_SALESREP_ID :'||P_SALESREP_ID );
261: oe_debug_pub.add(' Set Globals - P_END_CUSTOMER_ID :'||P_END_CUSTOMER_ID );
262: oe_debug_pub.add(' Set Globals - P_INVOICE_TO_ORG_ID :'||P_INVOICE_TO_ORG_ID);
263: oe_debug_pub.add(' Set Globals - P_DELIVER_TO_ORG_ID :'||P_DELIVER_TO_ORG_ID);
264: oe_debug_pub.add(' Set Globals - OPERATING_UNIT_ID :'|| mo_global.get_current_org_id);
265: oe_debug_pub.add(' Set Globals - ITEM_VALIDATION_ORG_ID :'|| OE_SYS_PARAMETERS.VALUE('MASTER_ORGANIZATION_ID'));
266: END IF;
267:
260: oe_debug_pub.add(' Set Globals - P_SALESREP_ID :'||P_SALESREP_ID );
261: oe_debug_pub.add(' Set Globals - P_END_CUSTOMER_ID :'||P_END_CUSTOMER_ID );
262: oe_debug_pub.add(' Set Globals - P_INVOICE_TO_ORG_ID :'||P_INVOICE_TO_ORG_ID);
263: oe_debug_pub.add(' Set Globals - P_DELIVER_TO_ORG_ID :'||P_DELIVER_TO_ORG_ID);
264: oe_debug_pub.add(' Set Globals - OPERATING_UNIT_ID :'|| mo_global.get_current_org_id);
265: oe_debug_pub.add(' Set Globals - ITEM_VALIDATION_ORG_ID :'|| OE_SYS_PARAMETERS.VALUE('MASTER_ORGANIZATION_ID'));
266: END IF;
267:
268: G_CUSTOMER_ID := P_CUSTOMER_ID;
261: oe_debug_pub.add(' Set Globals - P_END_CUSTOMER_ID :'||P_END_CUSTOMER_ID );
262: oe_debug_pub.add(' Set Globals - P_INVOICE_TO_ORG_ID :'||P_INVOICE_TO_ORG_ID);
263: oe_debug_pub.add(' Set Globals - P_DELIVER_TO_ORG_ID :'||P_DELIVER_TO_ORG_ID);
264: oe_debug_pub.add(' Set Globals - OPERATING_UNIT_ID :'|| mo_global.get_current_org_id);
265: oe_debug_pub.add(' Set Globals - ITEM_VALIDATION_ORG_ID :'|| OE_SYS_PARAMETERS.VALUE('MASTER_ORGANIZATION_ID'));
266: END IF;
267:
268: G_CUSTOMER_ID := P_CUSTOMER_ID;
269: G_CUSTOMER_CLASS_ID := P_CUSTOMER_CLASS_ID;
394: Function Validate_item_orderability ( p_line_rec in OE_Order_PUB.Line_Rec_Type )
395: Return BOOLEAN IS
396: l_operating_unit_id NUMBER;
397: l_exists varchar2(1);
398: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
399:
400:
401: l_x_item_category_id NUMBER;
402: l_x_customer_class_id NUMBER;
416: l_x_order_type_id := OE_ITORD_UTIL.get_order_type_id (p_line_rec.header_id);
417: l_x_sales_channel_code := OE_ITORD_UTIL.get_sales_channel_code(p_line_rec.header_id);
418:
419: IF l_debug_level >0 then
420: oe_debug_pub.add('Entering OE_ITORD_UTIL.Validate_item_orderability',1);
421: oe_debug_pub.add('Inventory_item_id :'||p_line_rec.inventory_item_id);
422: oe_debug_pub.add('Item Category Id :'||l_x_item_category_id);
423: oe_debug_pub.add('Customer ID :'|| p_line_rec.sold_to_org_id);
424: oe_debug_pub.add('Customer Class ID :'||l_x_customer_class_id);
417: l_x_sales_channel_code := OE_ITORD_UTIL.get_sales_channel_code(p_line_rec.header_id);
418:
419: IF l_debug_level >0 then
420: oe_debug_pub.add('Entering OE_ITORD_UTIL.Validate_item_orderability',1);
421: oe_debug_pub.add('Inventory_item_id :'||p_line_rec.inventory_item_id);
422: oe_debug_pub.add('Item Category Id :'||l_x_item_category_id);
423: oe_debug_pub.add('Customer ID :'|| p_line_rec.sold_to_org_id);
424: oe_debug_pub.add('Customer Class ID :'||l_x_customer_class_id);
425: oe_debug_pub.add('region_id_list :'||l_x_region_id_list);
418:
419: IF l_debug_level >0 then
420: oe_debug_pub.add('Entering OE_ITORD_UTIL.Validate_item_orderability',1);
421: oe_debug_pub.add('Inventory_item_id :'||p_line_rec.inventory_item_id);
422: oe_debug_pub.add('Item Category Id :'||l_x_item_category_id);
423: oe_debug_pub.add('Customer ID :'|| p_line_rec.sold_to_org_id);
424: oe_debug_pub.add('Customer Class ID :'||l_x_customer_class_id);
425: oe_debug_pub.add('region_id_list :'||l_x_region_id_list);
426: oe_debug_pub.add('order_type_id :'||l_x_order_type_id);
419: IF l_debug_level >0 then
420: oe_debug_pub.add('Entering OE_ITORD_UTIL.Validate_item_orderability',1);
421: oe_debug_pub.add('Inventory_item_id :'||p_line_rec.inventory_item_id);
422: oe_debug_pub.add('Item Category Id :'||l_x_item_category_id);
423: oe_debug_pub.add('Customer ID :'|| p_line_rec.sold_to_org_id);
424: oe_debug_pub.add('Customer Class ID :'||l_x_customer_class_id);
425: oe_debug_pub.add('region_id_list :'||l_x_region_id_list);
426: oe_debug_pub.add('order_type_id :'||l_x_order_type_id);
427: oe_debug_pub.add('sales_channel_code :'||l_x_sales_channel_code);
420: oe_debug_pub.add('Entering OE_ITORD_UTIL.Validate_item_orderability',1);
421: oe_debug_pub.add('Inventory_item_id :'||p_line_rec.inventory_item_id);
422: oe_debug_pub.add('Item Category Id :'||l_x_item_category_id);
423: oe_debug_pub.add('Customer ID :'|| p_line_rec.sold_to_org_id);
424: oe_debug_pub.add('Customer Class ID :'||l_x_customer_class_id);
425: oe_debug_pub.add('region_id_list :'||l_x_region_id_list);
426: oe_debug_pub.add('order_type_id :'||l_x_order_type_id);
427: oe_debug_pub.add('sales_channel_code :'||l_x_sales_channel_code);
428:
421: oe_debug_pub.add('Inventory_item_id :'||p_line_rec.inventory_item_id);
422: oe_debug_pub.add('Item Category Id :'||l_x_item_category_id);
423: oe_debug_pub.add('Customer ID :'|| p_line_rec.sold_to_org_id);
424: oe_debug_pub.add('Customer Class ID :'||l_x_customer_class_id);
425: oe_debug_pub.add('region_id_list :'||l_x_region_id_list);
426: oe_debug_pub.add('order_type_id :'||l_x_order_type_id);
427: oe_debug_pub.add('sales_channel_code :'||l_x_sales_channel_code);
428:
429: END IF;
422: oe_debug_pub.add('Item Category Id :'||l_x_item_category_id);
423: oe_debug_pub.add('Customer ID :'|| p_line_rec.sold_to_org_id);
424: oe_debug_pub.add('Customer Class ID :'||l_x_customer_class_id);
425: oe_debug_pub.add('region_id_list :'||l_x_region_id_list);
426: oe_debug_pub.add('order_type_id :'||l_x_order_type_id);
427: oe_debug_pub.add('sales_channel_code :'||l_x_sales_channel_code);
428:
429: END IF;
430:
423: oe_debug_pub.add('Customer ID :'|| p_line_rec.sold_to_org_id);
424: oe_debug_pub.add('Customer Class ID :'||l_x_customer_class_id);
425: oe_debug_pub.add('region_id_list :'||l_x_region_id_list);
426: oe_debug_pub.add('order_type_id :'||l_x_order_type_id);
427: oe_debug_pub.add('sales_channel_code :'||l_x_sales_channel_code);
428:
429: END IF;
430:
431:
515:
516: END IF;
517:
518:
519: oe_debug_pub.add('Exiting OE_ITORD_UTIL.Validate_item_orderability',1);
520:
521: Exception
522: when others then
523: OE_MSG_PUB.Add_Exc_Msg
962: IS
963: l_rule_level_id NUMBER;
964: l_rule_level_value varchar2(200);
965: BEGIN
966: oe_debug_pub.add('Rule Level: '||P_RULE_LEVEL);
967: oe_debug_pub.add('Rule Level Value: '||P_RULE_LEVEL_VALUE);
968:
969: IF p_rule_level IN('CUSTOMER','END_CUST')
970: THEN
963: l_rule_level_id NUMBER;
964: l_rule_level_value varchar2(200);
965: BEGIN
966: oe_debug_pub.add('Rule Level: '||P_RULE_LEVEL);
967: oe_debug_pub.add('Rule Level Value: '||P_RULE_LEVEL_VALUE);
968:
969: IF p_rule_level IN('CUSTOMER','END_CUST')
970: THEN
971: