58: PROCEDURE Set_G_CC_Hold_Info
59: IS
60: BEGIN
61: IF G_debug_flag = 'Y' THEN
62: OE_DEBUG_PUB.ADD('OEXPCRGB: In Set_G_CC_Hold_Info', 1);
63: END IF;
64:
65: SELECT item_type,
66: activity_name
69: FROM oe_hold_definitions
70: WHERE hold_id = 1;
71:
72: IF G_debug_flag = 'Y' THEN
73: OE_DEBUG_PUB.ADD('G_cc_hold_item_type = '||G_cc_hold_item_type, 2);
74: OE_DEBUG_PUB.ADD('G_cc_hold_activity_name = '||G_cc_hold_activity_name, 2);
75: OE_DEBUG_PUB.ADD('OEXPCRGB: Out Set_G_CC_Hold_Info', 1);
76: END IF;
77: EXCEPTION
70: WHERE hold_id = 1;
71:
72: IF G_debug_flag = 'Y' THEN
73: OE_DEBUG_PUB.ADD('G_cc_hold_item_type = '||G_cc_hold_item_type, 2);
74: OE_DEBUG_PUB.ADD('G_cc_hold_activity_name = '||G_cc_hold_activity_name, 2);
75: OE_DEBUG_PUB.ADD('OEXPCRGB: Out Set_G_CC_Hold_Info', 1);
76: END IF;
77: EXCEPTION
78: WHEN NO_DATA_FOUND THEN
71:
72: IF G_debug_flag = 'Y' THEN
73: OE_DEBUG_PUB.ADD('G_cc_hold_item_type = '||G_cc_hold_item_type, 2);
74: OE_DEBUG_PUB.ADD('G_cc_hold_activity_name = '||G_cc_hold_activity_name, 2);
75: OE_DEBUG_PUB.ADD('OEXPCRGB: Out Set_G_CC_Hold_Info', 1);
76: END IF;
77: EXCEPTION
78: WHEN NO_DATA_FOUND THEN
79: -- Hold definition should exist. This exception should not occur if setup is correct.
79: -- Hold definition should exist. This exception should not occur if setup is correct.
80: -- Ideally, an error should be raised indicating no cc hold definition found instead
81: -- of unexpected error.
82: IF G_debug_flag = 'Y' THEN
83: OE_DEBUG_PUB.ADD('EXCEPTION: No credit check hold definition found.', 1);
84: END IF;
85: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
86: OE_MSG_PUB.Add_Exc_Msg
87: ( G_PKG_NAME
112: IS
113: BEGIN
114: IF G_debug_flag = 'Y'
115: THEN
116: OE_DEBUG_PUB.ADD('OEXPCRGB: In Get_Credit_Check_Rule_ID ');
117: OE_DEBUG_PUB.ADD('p_order_type_id = '|| p_order_type_id );
118: OE_DEBUG_PUB.ADD('p_calling_action = '|| p_calling_action );
119: END IF;
120: x_credit_rule_id := NULL ;
113: BEGIN
114: IF G_debug_flag = 'Y'
115: THEN
116: OE_DEBUG_PUB.ADD('OEXPCRGB: In Get_Credit_Check_Rule_ID ');
117: OE_DEBUG_PUB.ADD('p_order_type_id = '|| p_order_type_id );
118: OE_DEBUG_PUB.ADD('p_calling_action = '|| p_calling_action );
119: END IF;
120: x_credit_rule_id := NULL ;
121:
114: IF G_debug_flag = 'Y'
115: THEN
116: OE_DEBUG_PUB.ADD('OEXPCRGB: In Get_Credit_Check_Rule_ID ');
117: OE_DEBUG_PUB.ADD('p_order_type_id = '|| p_order_type_id );
118: OE_DEBUG_PUB.ADD('p_calling_action = '|| p_calling_action );
119: END IF;
120: x_credit_rule_id := NULL ;
121:
122: IF p_calling_action in ('BOOKING','BOOKING_INLINE','UPDATE',
200: END IF;
201:
202: IF G_debug_flag = 'Y'
203: THEN
204: OE_DEBUG_PUB.ADD('OEXPCRGB: Credit Check Rule ID: '
205: ||TO_CHAR(x_credit_rule_id) );
206:
207: OE_DEBUG_PUB.ADD('OEXPCRGB: Out Get_Credit_Check_Rule_ID');
208: END IF;
203: THEN
204: OE_DEBUG_PUB.ADD('OEXPCRGB: Credit Check Rule ID: '
205: ||TO_CHAR(x_credit_rule_id) );
206:
207: OE_DEBUG_PUB.ADD('OEXPCRGB: Out Get_Credit_Check_Rule_ID');
208: END IF;
209:
210: EXCEPTION
211: WHEN NO_DATA_FOUND
210: EXCEPTION
211: WHEN NO_DATA_FOUND
212: THEN
213: x_credit_rule_id := NULL ;
214: OE_DEBUG_PUB.ADD('EXCEPTION:No credit check rule found');
215: WHEN OTHERS THEN
216: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
217: OE_MSG_PUB.Add_Exc_Msg
218: ( G_PKG_NAME
249: OE_HOLDS_PVT.G_MISS_Hold_Source_REC;
250: BEGIN
251: IF G_debug_flag = 'Y'
252: THEN
253: OE_DEBUG_PUB.Add('OEXPCRGB: In Apply_exception_hold ');
254: END IF;
255:
256: l_hold_source_rec.hold_id := 1; -- credit hold
257: l_hold_source_rec.hold_entity_code := 'O'; -- order hold
258: l_hold_source_rec.hold_entity_id := p_header_id; -- order header
259:
260: IF G_debug_flag = 'Y'
261: THEN
262: OE_DEBUG_PUB.Add('Call OE_HOLDS_PUB.Check_Holds');
263: END IF;
264:
265: OE_HOLDS_PUB.Check_Holds
266: ( p_api_version => 1.0
283: END IF;
284:
285: IF l_hold_result = FND_API.G_TRUE
286: THEN
287: OE_DEBUG_PUB.Add('OEXVCRHB: Hold already applied on Header ID:' ||
288: p_header_id );
289: ELSE
290: l_hold_comment := 'Credit checking package API Error' ;
291: l_hold_source_rec.hold_comment :=
290: l_hold_comment := 'Credit checking package API Error' ;
291: l_hold_source_rec.hold_comment :=
292: NVL(OE_Credit_Engine_GRP.G_currency_error_msg, l_hold_comment) ;
293:
294: OE_DEBUG_PUB.Add('Call OE_Holds_PUB.Apply_Holds' );
295:
296: OE_Holds_PUB.Apply_Holds
297: ( p_api_version => 1.0
298: , p_validation_level => FND_API.G_VALID_LEVEL_NONE
306: RAISE FND_API.G_EXC_ERROR;
307: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
308: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
309: ELSIF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
310: OE_DEBUG_PUB.ADD('OEXPCRGB: Credit check hold applied on header_ID: '
311: ||p_header_id, 1);
312: END IF;
313: END IF; -- Check hold exist
314:
313: END IF; -- Check hold exist
314:
315: IF G_debug_flag = 'Y'
316: THEN
317: OE_DEBUG_PUB.Add('OEXPCRGB: Out Apply_exception_hold ');
318: END IF;
319:
320: EXCEPTION
321:
326: ( G_PKG_NAME
327: , 'Apply_exception_hold'
328: );
329: END IF;
330: OE_DEBUG_PUB.ADD( SUBSTR( SQLERRM,1,300) ,1 ) ;
331:
332:
333: END Apply_Exception_hold ;
334:
347:
348: BEGIN
349: IF G_debug_flag = 'Y'
350: THEN
351: OE_DEBUG_PUB.ADD('OEXPCRGB: In Get_GL_currency ');
352: END IF;
353:
354: BEGIN
355: l_sob_id := FND_PROFILE.VALUE('GL_SET_OF_BKS_ID') ;
355: l_sob_id := FND_PROFILE.VALUE('GL_SET_OF_BKS_ID') ;
356:
357: IF G_debug_flag = 'Y'
358: THEN
359: OE_DEBUG_PUB.ADD('l_sob_id = '|| l_sob_id );
360: OE_DEBUG_PUB.ADD('GET SOB currency ');
361: END IF;
362:
363: SELECT
356:
357: IF G_debug_flag = 'Y'
358: THEN
359: OE_DEBUG_PUB.ADD('l_sob_id = '|| l_sob_id );
360: OE_DEBUG_PUB.ADD('GET SOB currency ');
361: END IF;
362:
363: SELECT
364: currency_code
369: WHERE set_of_books_id = l_sob_id ;
370:
371: IF G_debug_flag = 'Y'
372: THEN
373: OE_DEBUG_PUB.ADD('l_gl_currency = '|| l_gl_currency );
374: END IF;
375:
376: EXCEPTION
377: WHEN NO_DATA_FOUND
376: EXCEPTION
377: WHEN NO_DATA_FOUND
378: THEN
379: l_gl_currency := NULL ;
380: OE_DEBUG_PUB.ADD('EXCEPTION: NO_DATA_FOUND ');
381: l_gl_currency := NULL ;
382: WHEN TOO_MANY_ROWS
383: THEN
384: l_gl_currency := NULL ;
381: l_gl_currency := NULL ;
382: WHEN TOO_MANY_ROWS
383: THEN
384: l_gl_currency := NULL ;
385: OE_DEBUG_PUB.ADD('EXCEPTION: TOO_MANY_ROWS');
386: l_gl_currency := NULL ;
387: END ;
388:
389: IF G_debug_flag = 'Y'
387: END ;
388:
389: IF G_debug_flag = 'Y'
390: THEN
391: OE_DEBUG_PUB.ADD('OEXPCRGB: Out Get_GL_currency ');
392: END IF;
393:
394: RETURN(l_GL_currency);
395:
400: ( G_PKG_NAME
401: , 'Get_GL_currency'
402: );
403: END IF;
404: OE_DEBUG_PUB.ADD( SUBSTR(SQLERRM,1,300) ) ;
405: END Get_GL_currency ;
406:
407: ---------------------------------------------------------------------------
408: --PROCEDURE: Credit_check_with_payment_typ
431: x_return_status := FND_API.G_RET_STS_SUCCESS;
432:
433: IF G_debug_flag = 'Y'
434: THEN
435: OE_DEBUG_PUB.ADD('OEXPCRGB: IN Credit_check_with_payment_typ ',1);
436: OE_DEBUG_PUB.ADD('p_header_id = '|| p_header_id,1 );
437: OE_DEBUG_PUB.ADD('p_calling_action = ' || p_calling_action,1 );
438: OE_DEBUG_PUB.ADD('p_delayed_request = '|| p_delayed_request,1 );
439: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id,1 );
432:
433: IF G_debug_flag = 'Y'
434: THEN
435: OE_DEBUG_PUB.ADD('OEXPCRGB: IN Credit_check_with_payment_typ ',1);
436: OE_DEBUG_PUB.ADD('p_header_id = '|| p_header_id,1 );
437: OE_DEBUG_PUB.ADD('p_calling_action = ' || p_calling_action,1 );
438: OE_DEBUG_PUB.ADD('p_delayed_request = '|| p_delayed_request,1 );
439: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id,1 );
440: END IF;
433: IF G_debug_flag = 'Y'
434: THEN
435: OE_DEBUG_PUB.ADD('OEXPCRGB: IN Credit_check_with_payment_typ ',1);
436: OE_DEBUG_PUB.ADD('p_header_id = '|| p_header_id,1 );
437: OE_DEBUG_PUB.ADD('p_calling_action = ' || p_calling_action,1 );
438: OE_DEBUG_PUB.ADD('p_delayed_request = '|| p_delayed_request,1 );
439: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id,1 );
440: END IF;
441:
434: THEN
435: OE_DEBUG_PUB.ADD('OEXPCRGB: IN Credit_check_with_payment_typ ',1);
436: OE_DEBUG_PUB.ADD('p_header_id = '|| p_header_id,1 );
437: OE_DEBUG_PUB.ADD('p_calling_action = ' || p_calling_action,1 );
438: OE_DEBUG_PUB.ADD('p_delayed_request = '|| p_delayed_request,1 );
439: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id,1 );
440: END IF;
441:
442: OE_Credit_Engine_GRP.G_delayed_request := NULL ;
435: OE_DEBUG_PUB.ADD('OEXPCRGB: IN Credit_check_with_payment_typ ',1);
436: OE_DEBUG_PUB.ADD('p_header_id = '|| p_header_id,1 );
437: OE_DEBUG_PUB.ADD('p_calling_action = ' || p_calling_action,1 );
438: OE_DEBUG_PUB.ADD('p_delayed_request = '|| p_delayed_request,1 );
439: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id,1 );
440: END IF;
441:
442: OE_Credit_Engine_GRP.G_delayed_request := NULL ;
443:
442: OE_Credit_Engine_GRP.G_delayed_request := NULL ;
443:
444: IF G_debug_flag = 'Y'
445: THEN
446: OE_DEBUG_PUB.ADD('call Check_Credit for credit checking',1);
447: END IF;
448:
449: Check_Credit
450: ( p_header_id => p_header_id
459: );
460:
461: IF G_debug_flag = 'Y'
462: THEN
463: OE_DEBUG_PUB.ADD('x_return_status '|| x_return_status );
464: END IF;
465:
466: IF x_return_status = FND_API.G_RET_STS_ERROR
467: THEN
476: END IF;
477:
478: IF G_debug_flag = 'Y'
479: THEN
480: OE_DEBUG_PUB.ADD('OEXPCRGB:Final x_return_status = '|| x_return_status,1 );
481: OE_DEBUG_PUB.ADD('OEXPCRGB:l_result_out = '|| l_result_out,1 );
482: OE_DEBUG_PUB.ADD('OEXPCRGB: OUT Credit_check_with_payment_typ ',1);
483: END IF;
484:
477:
478: IF G_debug_flag = 'Y'
479: THEN
480: OE_DEBUG_PUB.ADD('OEXPCRGB:Final x_return_status = '|| x_return_status,1 );
481: OE_DEBUG_PUB.ADD('OEXPCRGB:l_result_out = '|| l_result_out,1 );
482: OE_DEBUG_PUB.ADD('OEXPCRGB: OUT Credit_check_with_payment_typ ',1);
483: END IF;
484:
485: EXCEPTION
478: IF G_debug_flag = 'Y'
479: THEN
480: OE_DEBUG_PUB.ADD('OEXPCRGB:Final x_return_status = '|| x_return_status,1 );
481: OE_DEBUG_PUB.ADD('OEXPCRGB:l_result_out = '|| l_result_out,1 );
482: OE_DEBUG_PUB.ADD('OEXPCRGB: OUT Credit_check_with_payment_typ ',1);
483: END IF;
484:
485: EXCEPTION
486:
485: EXCEPTION
486:
487: WHEN FND_API.G_EXC_ERROR THEN
488: x_return_status := FND_API.G_RET_STS_ERROR;
489: oe_debug_pub.add(' SQLERRM: '|| SQLERRM );
490: OE_MSG_PUB.Count_And_Get
491: ( p_count => l_msg_count,
492: p_data => l_msg_data
493: );
493: );
494:
495: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
496: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
497: oe_debug_pub.add(' SQLERRM: '|| SQLERRM );
498: OE_MSG_PUB.Count_And_Get
499: ( p_count => l_msg_count,
500: p_data => l_msg_data
501: );
501: );
502:
503: WHEN OTHERS THEN
504: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
505: oe_debug_pub.add(' SQLERRM: '|| SQLERRM );
506: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
507: THEN
508: FND_MSG_PUB.Add_Exc_Msg
509: ( G_PKG_NAME
573:
574: BEGIN
575: IF G_debug_flag = 'Y'
576: THEN
577: OE_DEBUG_PUB.ADD('OEXPCRGB: IN Get_Customer_Exposure ',1);
578: OE_DEBUG_PUB.ADD('p_party_id => '|| p_party_id );
579: OE_DEBUG_PUB.ADD('p_customer_id => '|| p_customer_id );
580: OE_DEBUG_PUB.ADD('p_site_id => '|| p_site_id );
581: OE_DEBUG_PUB.ADD('p_limit_curr_code => '|| p_limit_curr_code );
574: BEGIN
575: IF G_debug_flag = 'Y'
576: THEN
577: OE_DEBUG_PUB.ADD('OEXPCRGB: IN Get_Customer_Exposure ',1);
578: OE_DEBUG_PUB.ADD('p_party_id => '|| p_party_id );
579: OE_DEBUG_PUB.ADD('p_customer_id => '|| p_customer_id );
580: OE_DEBUG_PUB.ADD('p_site_id => '|| p_site_id );
581: OE_DEBUG_PUB.ADD('p_limit_curr_code => '|| p_limit_curr_code );
582: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id );
575: IF G_debug_flag = 'Y'
576: THEN
577: OE_DEBUG_PUB.ADD('OEXPCRGB: IN Get_Customer_Exposure ',1);
578: OE_DEBUG_PUB.ADD('p_party_id => '|| p_party_id );
579: OE_DEBUG_PUB.ADD('p_customer_id => '|| p_customer_id );
580: OE_DEBUG_PUB.ADD('p_site_id => '|| p_site_id );
581: OE_DEBUG_PUB.ADD('p_limit_curr_code => '|| p_limit_curr_code );
582: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id );
583: OE_DEBUG_PUB.ADD('p_need_exposure_details => '|| p_need_exposure_details );
576: THEN
577: OE_DEBUG_PUB.ADD('OEXPCRGB: IN Get_Customer_Exposure ',1);
578: OE_DEBUG_PUB.ADD('p_party_id => '|| p_party_id );
579: OE_DEBUG_PUB.ADD('p_customer_id => '|| p_customer_id );
580: OE_DEBUG_PUB.ADD('p_site_id => '|| p_site_id );
581: OE_DEBUG_PUB.ADD('p_limit_curr_code => '|| p_limit_curr_code );
582: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id );
583: OE_DEBUG_PUB.ADD('p_need_exposure_details => '|| p_need_exposure_details );
584: END IF;
577: OE_DEBUG_PUB.ADD('OEXPCRGB: IN Get_Customer_Exposure ',1);
578: OE_DEBUG_PUB.ADD('p_party_id => '|| p_party_id );
579: OE_DEBUG_PUB.ADD('p_customer_id => '|| p_customer_id );
580: OE_DEBUG_PUB.ADD('p_site_id => '|| p_site_id );
581: OE_DEBUG_PUB.ADD('p_limit_curr_code => '|| p_limit_curr_code );
582: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id );
583: OE_DEBUG_PUB.ADD('p_need_exposure_details => '|| p_need_exposure_details );
584: END IF;
585:
578: OE_DEBUG_PUB.ADD('p_party_id => '|| p_party_id );
579: OE_DEBUG_PUB.ADD('p_customer_id => '|| p_customer_id );
580: OE_DEBUG_PUB.ADD('p_site_id => '|| p_site_id );
581: OE_DEBUG_PUB.ADD('p_limit_curr_code => '|| p_limit_curr_code );
582: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id );
583: OE_DEBUG_PUB.ADD('p_need_exposure_details => '|| p_need_exposure_details );
584: END IF;
585:
586: x_return_status := FND_API.G_RET_STS_SUCCESS;
579: OE_DEBUG_PUB.ADD('p_customer_id => '|| p_customer_id );
580: OE_DEBUG_PUB.ADD('p_site_id => '|| p_site_id );
581: OE_DEBUG_PUB.ADD('p_limit_curr_code => '|| p_limit_curr_code );
582: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id );
583: OE_DEBUG_PUB.ADD('p_need_exposure_details => '|| p_need_exposure_details );
584: END IF;
585:
586: x_return_status := FND_API.G_RET_STS_SUCCESS;
587: l_global_exposure_flag := 'N' ;
597: OE_CREDIT_CHECK_UTIL.GET_System_parameters
598: ( x_system_parameter_rec=>l_system_parameters_rec
599: );
600:
601: OE_DEBUG_PUB.ADD('Check entity type ');
602:
603: -------------------- EXPOSURE -----------------------
604:
605: /* Modified the following condition to fix the bug 5650329 */
608: l_global_exposure_flag := 'Y' ;
609:
610: IF G_debug_flag = 'Y'
611: THEN
612: OE_DEBUG_PUB.ADD('Party level exposure ');
613: OE_DEBUG_PUB.ADD('Calling Get_global_exposure_flag ');
614: OE_DEBUG_PUB.ADD('l_global_exposure_flag = '||
615: l_global_exposure_flag );
616: OE_DEBUG_PUB.ADD('OEXPCRGB: Get usages for PARTY level ');
609:
610: IF G_debug_flag = 'Y'
611: THEN
612: OE_DEBUG_PUB.ADD('Party level exposure ');
613: OE_DEBUG_PUB.ADD('Calling Get_global_exposure_flag ');
614: OE_DEBUG_PUB.ADD('l_global_exposure_flag = '||
615: l_global_exposure_flag );
616: OE_DEBUG_PUB.ADD('OEXPCRGB: Get usages for PARTY level ');
617: END IF;
610: IF G_debug_flag = 'Y'
611: THEN
612: OE_DEBUG_PUB.ADD('Party level exposure ');
613: OE_DEBUG_PUB.ADD('Calling Get_global_exposure_flag ');
614: OE_DEBUG_PUB.ADD('l_global_exposure_flag = '||
615: l_global_exposure_flag );
616: OE_DEBUG_PUB.ADD('OEXPCRGB: Get usages for PARTY level ');
617: END IF;
618:
612: OE_DEBUG_PUB.ADD('Party level exposure ');
613: OE_DEBUG_PUB.ADD('Calling Get_global_exposure_flag ');
614: OE_DEBUG_PUB.ADD('l_global_exposure_flag = '||
615: l_global_exposure_flag );
616: OE_DEBUG_PUB.ADD('OEXPCRGB: Get usages for PARTY level ');
617: END IF;
618:
619: ----get table of usages
620: OE_CREDIT_CHECK_UTIL.Get_Usages
629: );
630:
631: IF G_debug_flag = 'Y'
632: THEN
633: OE_DEBUG_PUB.ADD('OEXPCRGB: OUT of OE_CREDIT_CHECK_UTIL. Get_Usages ');
634: OE_DEBUG_PUB.ADD('x_include_all_flag: '||l_include_all_flag);
635: OE_DEBUG_PUB.ADD('---------------------------------------');
636: END IF;
637:
630:
631: IF G_debug_flag = 'Y'
632: THEN
633: OE_DEBUG_PUB.ADD('OEXPCRGB: OUT of OE_CREDIT_CHECK_UTIL. Get_Usages ');
634: OE_DEBUG_PUB.ADD('x_include_all_flag: '||l_include_all_flag);
635: OE_DEBUG_PUB.ADD('---------------------------------------');
636: END IF;
637:
638: ----IF l_include_all_flag is 'Y', assign it to the global variable
631: IF G_debug_flag = 'Y'
632: THEN
633: OE_DEBUG_PUB.ADD('OEXPCRGB: OUT of OE_CREDIT_CHECK_UTIL. Get_Usages ');
634: OE_DEBUG_PUB.ADD('x_include_all_flag: '||l_include_all_flag);
635: OE_DEBUG_PUB.ADD('---------------------------------------');
636: END IF;
637:
638: ----IF l_include_all_flag is 'Y', assign it to the global variable
639: --- used later for unchecked exposure
646: FOR a IN 1..l_usage_curr_tbl.COUNT
647: LOOP
648: IF G_debug_flag = 'Y'
649: THEN
650: OE_DEBUG_PUB.ADD('currency_code=: '
651: ||l_usage_curr_tbl(a).usage_curr_code);
652: END IF;
653: END LOOP;
654: --------------------------------------------------------------------------------
658: l_end:=OE_Credit_Engine_GRP.G_cust_curr_tbl.COUNT+l_usage_curr_tbl.COUNT;
659:
660: IF G_debug_flag = 'Y'
661: THEN
662: OE_DEBUG_PUB.ADD('l_start= '||TO_CHAR(l_start));
663: OE_DEBUG_PUB.ADD('l_end= '||TO_CHAR(l_end));
664: OE_DEBUG_PUB.ADD('IN loop for assign table of usge to Glb variable ');
665: END IF;
666:
659:
660: IF G_debug_flag = 'Y'
661: THEN
662: OE_DEBUG_PUB.ADD('l_start= '||TO_CHAR(l_start));
663: OE_DEBUG_PUB.ADD('l_end= '||TO_CHAR(l_end));
664: OE_DEBUG_PUB.ADD('IN loop for assign table of usge to Glb variable ');
665: END IF;
666:
667: FOR i IN l_start..l_end
660: IF G_debug_flag = 'Y'
661: THEN
662: OE_DEBUG_PUB.ADD('l_start= '||TO_CHAR(l_start));
663: OE_DEBUG_PUB.ADD('l_end= '||TO_CHAR(l_end));
664: OE_DEBUG_PUB.ADD('IN loop for assign table of usge to Glb variable ');
665: END IF;
666:
667: FOR i IN l_start..l_end
668: LOOP
699: FOR k IN 1..l_error_curr_tbl.COUNT
700: LOOP
701: IF G_debug_flag = 'Y'
702: THEN
703: OE_DEBUG_PUB.ADD('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
704: !!!!!!!');
705: OE_DEBUG_PUB.ADD('!!!!! Exchange rate between '||l_error_curr_tbl(k)
706: .usage_curr_code
707: ||' and credit limit currency '
701: IF G_debug_flag = 'Y'
702: THEN
703: OE_DEBUG_PUB.ADD('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
704: !!!!!!!');
705: OE_DEBUG_PUB.ADD('!!!!! Exchange rate between '||l_error_curr_tbl(k)
706: .usage_curr_code
707: ||' and credit limit currency '
708: ||p_limit_curr_code
709: ||' is missing for conversion type '
708: ||p_limit_curr_code
709: ||' is missing for conversion type '
710: || NVL(l_credit_check_rule_rec.user_conversion_type,'Corporate'),1
711: );
712: OE_DEBUG_PUB.ADD('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
713: !!!!!!!');
714:
715: END IF;
716: END LOOP;
730: ELSIF p_site_id IS NULL
731: THEN
732: IF G_debug_flag = 'Y'
733: THEN
734: OE_DEBUG_PUB.ADD('Customer level exposure ');
735: OE_DEBUG_PUB.ADD('Calling Get_global_exposure_flag ');
736: END IF;
737:
738: l_global_exposure_flag :=
731: THEN
732: IF G_debug_flag = 'Y'
733: THEN
734: OE_DEBUG_PUB.ADD('Customer level exposure ');
735: OE_DEBUG_PUB.ADD('Calling Get_global_exposure_flag ');
736: END IF;
737:
738: l_global_exposure_flag :=
739: OE_CREDIT_CHECK_UTIL.Get_global_exposure_flag
750: /* End MOAC CREDIT CHECK CHANGE */
751:
752: IF G_debug_flag = 'Y'
753: THEN
754: OE_DEBUG_PUB.ADD('l_global_exposure_flag = '||
755: l_global_exposure_flag );
756: OE_DEBUG_PUB.ADD('OEXPCRGB: Get usages for CUSTOMER level ');
757: END IF;
758:
752: IF G_debug_flag = 'Y'
753: THEN
754: OE_DEBUG_PUB.ADD('l_global_exposure_flag = '||
755: l_global_exposure_flag );
756: OE_DEBUG_PUB.ADD('OEXPCRGB: Get usages for CUSTOMER level ');
757: END IF;
758:
759: ----get table of usages
760: OE_CREDIT_CHECK_UTIL.Get_Usages
769: );
770:
771: IF G_debug_flag = 'Y'
772: THEN
773: OE_DEBUG_PUB.ADD('OEXPCRGB: OUT of OE_CREDIT_CHECK_UTIL. Get_Usages ');
774: OE_DEBUG_PUB.ADD('x_include_all_flag: '||l_include_all_flag);
775: OE_DEBUG_PUB.ADD('---------------------------------------');
776: END IF;
777:
770:
771: IF G_debug_flag = 'Y'
772: THEN
773: OE_DEBUG_PUB.ADD('OEXPCRGB: OUT of OE_CREDIT_CHECK_UTIL. Get_Usages ');
774: OE_DEBUG_PUB.ADD('x_include_all_flag: '||l_include_all_flag);
775: OE_DEBUG_PUB.ADD('---------------------------------------');
776: END IF;
777:
778: ----IF l_include_all_flag is 'Y', assign it to the global variable
771: IF G_debug_flag = 'Y'
772: THEN
773: OE_DEBUG_PUB.ADD('OEXPCRGB: OUT of OE_CREDIT_CHECK_UTIL. Get_Usages ');
774: OE_DEBUG_PUB.ADD('x_include_all_flag: '||l_include_all_flag);
775: OE_DEBUG_PUB.ADD('---------------------------------------');
776: END IF;
777:
778: ----IF l_include_all_flag is 'Y', assign it to the global variable
779: --- used later for unchecked exposure
787: FOR a IN 1..l_usage_curr_tbl.COUNT
788: LOOP
789: IF G_debug_flag = 'Y'
790: THEN
791: OE_DEBUG_PUB.ADD('currency_code=: '
792: ||l_usage_curr_tbl(a).usage_curr_code);
793: END IF;
794: END LOOP;
795: --------------------------------------------------------------------------------
799: l_end:=OE_Credit_Engine_GRP.G_cust_curr_tbl.COUNT+l_usage_curr_tbl.COUNT;
800:
801: IF G_debug_flag = 'Y'
802: THEN
803: OE_DEBUG_PUB.ADD('l_start= '||TO_CHAR(l_start));
804: OE_DEBUG_PUB.ADD('l_end= '||TO_CHAR(l_end));
805: OE_DEBUG_PUB.ADD('IN loop for assign table of usages to Global variable ');
806: END IF;
807:
800:
801: IF G_debug_flag = 'Y'
802: THEN
803: OE_DEBUG_PUB.ADD('l_start= '||TO_CHAR(l_start));
804: OE_DEBUG_PUB.ADD('l_end= '||TO_CHAR(l_end));
805: OE_DEBUG_PUB.ADD('IN loop for assign table of usages to Global variable ');
806: END IF;
807:
808: FOR i IN l_start..l_end
801: IF G_debug_flag = 'Y'
802: THEN
803: OE_DEBUG_PUB.ADD('l_start= '||TO_CHAR(l_start));
804: OE_DEBUG_PUB.ADD('l_end= '||TO_CHAR(l_end));
805: OE_DEBUG_PUB.ADD('IN loop for assign table of usages to Global variable ');
806: END IF;
807:
808: FOR i IN l_start..l_end
809: LOOP
842: FOR k IN 1..l_error_curr_tbl.COUNT
843: LOOP
844: IF G_debug_flag = 'Y'
845: THEN
846: OE_DEBUG_PUB.ADD('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
847: OE_DEBUG_PUB.ADD('!!!!! Exchange rate between '||l_error_curr_tbl(k).usage_curr_code
848: ||' and credit limit currency '
849: ||p_limit_curr_code
850: ||' is missing for conversion type '
843: LOOP
844: IF G_debug_flag = 'Y'
845: THEN
846: OE_DEBUG_PUB.ADD('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
847: OE_DEBUG_PUB.ADD('!!!!! Exchange rate between '||l_error_curr_tbl(k).usage_curr_code
848: ||' and credit limit currency '
849: ||p_limit_curr_code
850: ||' is missing for conversion type '
851: || NVL(l_credit_check_rule_rec.user_conversion_type,'Corporate'),1);
848: ||' and credit limit currency '
849: ||p_limit_curr_code
850: ||' is missing for conversion type '
851: || NVL(l_credit_check_rule_rec.user_conversion_type,'Corporate'),1);
852: OE_DEBUG_PUB.ADD('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
853: END IF;
854: END LOOP;
855:
856: ---bug fix 2439029
899: FOR k IN 1..l_conversion_status.COUNT
900: LOOP
901: IF G_debug_flag = 'Y'
902: THEN
903: OE_DEBUG_PUB.ADD('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
904: OE_DEBUG_PUB.ADD('!!!!! Exchange rate between '||l_conversion_status(k).usage_curr_code
905: ||' and credit limit currency '
906: ||p_limit_curr_code
907: ||' is missing for conversion type '
900: LOOP
901: IF G_debug_flag = 'Y'
902: THEN
903: OE_DEBUG_PUB.ADD('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
904: OE_DEBUG_PUB.ADD('!!!!! Exchange rate between '||l_conversion_status(k).usage_curr_code
905: ||' and credit limit currency '
906: ||p_limit_curr_code
907: ||' is missing for conversion type '
908: || NVL(l_credit_check_rule_rec.user_conversion_type,'Corporate'),1);
905: ||' and credit limit currency '
906: ||p_limit_curr_code
907: ||' is missing for conversion type '
908: || NVL(l_credit_check_rule_rec.user_conversion_type,'Corporate'),1);
909: OE_DEBUG_PUB.ADD('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
910: END IF;
911: END LOOP;
912:
913: ---bug fix 2439029
943:
944: EXCEPTION
945: WHEN NO_DATA_FOUND THEN
946: IF G_debug_flag = 'Y' THEN
947: OE_DEBUG_PUB.ADD ('Exception : No org id via site_id ', 1);
948: END IF;
949:
950: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
951: THEN
956: END IF;
957:
958: WHEN OTHERS THEN
959: IF G_debug_flag = 'Y' THEN
960: OE_DEBUG_PUB.ADD ('Exception : Unexpected error in finding org id via site_id ', 1);
961: END IF;
962:
963: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
964: THEN
978: /* End MOAC CREDIT CHECK CHANGE */
979:
980: IF G_debug_flag = 'Y'
981: THEN
982: OE_DEBUG_PUB.ADD('Site level exposure ');
983: END IF;
984:
985: ----get table of usages
986: OE_CREDIT_CHECK_UTIL.Get_Usages
1006: FOR a IN 1..l_usage_curr_tbl.COUNT
1007: LOOP
1008: IF G_debug_flag = 'Y'
1009: THEN
1010: OE_DEBUG_PUB.ADD('currency_code=: '||l_usage_curr_tbl(a).usage_curr_code);
1011: END IF;
1012: END LOOP;
1013: --------------------------------------------------------------------------------
1014:
1017: l_end := OE_Credit_Engine_GRP.G_site_curr_tbl.COUNT+l_usage_curr_tbl.COUNT;
1018:
1019: IF G_debug_flag = 'Y'
1020: THEN
1021: OE_DEBUG_PUB.ADD('l_start= '||TO_CHAR(l_start));
1022: OE_DEBUG_PUB.ADD('l_end= '||TO_CHAR(l_end));
1023: OE_DEBUG_PUB.ADD('IN loop for assign table of usages to Global variable ');
1024: OE_DEBUG_PUB.ADD('table of currencies:');
1025: END IF;
1018:
1019: IF G_debug_flag = 'Y'
1020: THEN
1021: OE_DEBUG_PUB.ADD('l_start= '||TO_CHAR(l_start));
1022: OE_DEBUG_PUB.ADD('l_end= '||TO_CHAR(l_end));
1023: OE_DEBUG_PUB.ADD('IN loop for assign table of usages to Global variable ');
1024: OE_DEBUG_PUB.ADD('table of currencies:');
1025: END IF;
1026:
1019: IF G_debug_flag = 'Y'
1020: THEN
1021: OE_DEBUG_PUB.ADD('l_start= '||TO_CHAR(l_start));
1022: OE_DEBUG_PUB.ADD('l_end= '||TO_CHAR(l_end));
1023: OE_DEBUG_PUB.ADD('IN loop for assign table of usages to Global variable ');
1024: OE_DEBUG_PUB.ADD('table of currencies:');
1025: END IF;
1026:
1027: FOR i IN l_start..l_end
1020: THEN
1021: OE_DEBUG_PUB.ADD('l_start= '||TO_CHAR(l_start));
1022: OE_DEBUG_PUB.ADD('l_end= '||TO_CHAR(l_end));
1023: OE_DEBUG_PUB.ADD('IN loop for assign table of usages to Global variable ');
1024: OE_DEBUG_PUB.ADD('table of currencies:');
1025: END IF;
1026:
1027: FOR i IN l_start..l_end
1028: LOOP
1032: := l_usage_curr_tbl(j).usage_curr_code;
1033:
1034: IF G_debug_flag = 'Y'
1035: THEN
1036: OE_DEBUG_PUB.ADD('currency= '||l_usage_curr_tbl(j).usage_curr_code);
1037: END IF;
1038: END LOOP;
1039:
1040:
1066: FOR f IN 1..l_error_curr_tbl.COUNT
1067: LOOP
1068: IF G_debug_flag = 'Y'
1069: THEN
1070: OE_DEBUG_PUB.ADD('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
1071: OE_DEBUG_PUB.ADD('!!!!! Exchange rate between '||l_error_curr_tbl(f).usage_curr_code
1072: ||' and credit limit currency '
1073: ||p_limit_curr_code
1074: ||' is missing for conversion type '
1067: LOOP
1068: IF G_debug_flag = 'Y'
1069: THEN
1070: OE_DEBUG_PUB.ADD('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
1071: OE_DEBUG_PUB.ADD('!!!!! Exchange rate between '||l_error_curr_tbl(f).usage_curr_code
1072: ||' and credit limit currency '
1073: ||p_limit_curr_code
1074: ||' is missing for conversion type '
1075: || NVL(l_credit_check_rule_rec.user_conversion_type,'Corporate'),1);
1072: ||' and credit limit currency '
1073: ||p_limit_curr_code
1074: ||' is missing for conversion type '
1075: || NVL(l_credit_check_rule_rec.user_conversion_type,'Corporate'),1);
1076: OE_DEBUG_PUB.ADD('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
1077: END IF;
1078: END LOOP;
1079:
1080: ---bug fix 2439029
1123: FOR f IN 1..l_conversion_status.COUNT
1124: LOOP
1125: IF G_debug_flag = 'Y'
1126: THEN
1127: OE_DEBUG_PUB.ADD('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
1128: OE_DEBUG_PUB.ADD('!!!!! Exchange rate between '||l_conversion_status(f).usage_curr_code
1129: ||' and credit limit currency '
1130: ||p_limit_curr_code
1131: ||' is missing for conversion type '
1124: LOOP
1125: IF G_debug_flag = 'Y'
1126: THEN
1127: OE_DEBUG_PUB.ADD('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
1128: OE_DEBUG_PUB.ADD('!!!!! Exchange rate between '||l_conversion_status(f).usage_curr_code
1129: ||' and credit limit currency '
1130: ||p_limit_curr_code
1131: ||' is missing for conversion type '
1132: || NVL(l_credit_check_rule_rec.user_conversion_type,'Corporate'),1);
1129: ||' and credit limit currency '
1130: ||p_limit_curr_code
1131: ||' is missing for conversion type '
1132: || NVL(l_credit_check_rule_rec.user_conversion_type,'Corporate'),1);
1133: OE_DEBUG_PUB.ADD('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
1134: END IF;
1135: END LOOP;
1136:
1137: ---bug fix 2439029
1153: END IF;
1154:
1155: IF G_debug_flag = 'Y'
1156: THEN
1157: OE_DEBUG_PUB.ADD('OEXPCRGB: OUT Get_Customer_Exposure with the status='||x_return_status);
1158: END IF;
1159:
1160: EXCEPTION
1161:
1217: BEGIN
1218:
1219: IF G_debug_flag = 'Y'
1220: THEN
1221: OE_DEBUG_PUB.ADD(' Into Get_customer_exposure ');
1222: OE_DEBUG_PUB.ADD(' Calling Get_customer_exposure with details');
1223: OE_DEBUG_PUB.ADD('p_customer_id => '|| p_customer_id );
1224: OE_DEBUG_PUB.ADD('p_site_id => '|| p_site_id );
1225: OE_DEBUG_PUB.ADD('p_limit_curr_code => '|| p_limit_curr_code );
1218:
1219: IF G_debug_flag = 'Y'
1220: THEN
1221: OE_DEBUG_PUB.ADD(' Into Get_customer_exposure ');
1222: OE_DEBUG_PUB.ADD(' Calling Get_customer_exposure with details');
1223: OE_DEBUG_PUB.ADD('p_customer_id => '|| p_customer_id );
1224: OE_DEBUG_PUB.ADD('p_site_id => '|| p_site_id );
1225: OE_DEBUG_PUB.ADD('p_limit_curr_code => '|| p_limit_curr_code );
1226: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id );
1219: IF G_debug_flag = 'Y'
1220: THEN
1221: OE_DEBUG_PUB.ADD(' Into Get_customer_exposure ');
1222: OE_DEBUG_PUB.ADD(' Calling Get_customer_exposure with details');
1223: OE_DEBUG_PUB.ADD('p_customer_id => '|| p_customer_id );
1224: OE_DEBUG_PUB.ADD('p_site_id => '|| p_site_id );
1225: OE_DEBUG_PUB.ADD('p_limit_curr_code => '|| p_limit_curr_code );
1226: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id );
1227:
1220: THEN
1221: OE_DEBUG_PUB.ADD(' Into Get_customer_exposure ');
1222: OE_DEBUG_PUB.ADD(' Calling Get_customer_exposure with details');
1223: OE_DEBUG_PUB.ADD('p_customer_id => '|| p_customer_id );
1224: OE_DEBUG_PUB.ADD('p_site_id => '|| p_site_id );
1225: OE_DEBUG_PUB.ADD('p_limit_curr_code => '|| p_limit_curr_code );
1226: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id );
1227:
1228: END IF;
1221: OE_DEBUG_PUB.ADD(' Into Get_customer_exposure ');
1222: OE_DEBUG_PUB.ADD(' Calling Get_customer_exposure with details');
1223: OE_DEBUG_PUB.ADD('p_customer_id => '|| p_customer_id );
1224: OE_DEBUG_PUB.ADD('p_site_id => '|| p_site_id );
1225: OE_DEBUG_PUB.ADD('p_limit_curr_code => '|| p_limit_curr_code );
1226: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id );
1227:
1228: END IF;
1229:
1222: OE_DEBUG_PUB.ADD(' Calling Get_customer_exposure with details');
1223: OE_DEBUG_PUB.ADD('p_customer_id => '|| p_customer_id );
1224: OE_DEBUG_PUB.ADD('p_site_id => '|| p_site_id );
1225: OE_DEBUG_PUB.ADD('p_limit_curr_code => '|| p_limit_curr_code );
1226: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id );
1227:
1228: END IF;
1229:
1230: OE_CREDIT_ENGINE_GRP.Get_customer_exposure
1243: );
1244:
1245: IF G_debug_flag = 'Y'
1246: THEN
1247: OE_DEBUG_PUB.ADD(' Out x_total_exposure => '|| x_total_exposure );
1248: OE_DEBUG_PUB.ADD(' Out x_return_status => '|| x_return_status );
1249: OE_DEBUG_PUB.ADD(' Out Get_customer_exposure');
1250: END IF;
1251:
1244:
1245: IF G_debug_flag = 'Y'
1246: THEN
1247: OE_DEBUG_PUB.ADD(' Out x_total_exposure => '|| x_total_exposure );
1248: OE_DEBUG_PUB.ADD(' Out x_return_status => '|| x_return_status );
1249: OE_DEBUG_PUB.ADD(' Out Get_customer_exposure');
1250: END IF;
1251:
1252: EXCEPTION
1245: IF G_debug_flag = 'Y'
1246: THEN
1247: OE_DEBUG_PUB.ADD(' Out x_total_exposure => '|| x_total_exposure );
1248: OE_DEBUG_PUB.ADD(' Out x_return_status => '|| x_return_status );
1249: OE_DEBUG_PUB.ADD(' Out Get_customer_exposure');
1250: END IF;
1251:
1252: EXCEPTION
1253: WHEN OTHERS THEN
1306: x_return_status := FND_API.G_RET_STS_SUCCESS;
1307:
1308: IF G_debug_flag = 'Y'
1309: THEN
1310: OE_DEBUG_PUB.ADD('OEXPCRGB: IN Check_Credit ',1);
1311: OE_DEBUG_PUB.ADD('Input parameters list ');
1312: OE_DEBUG_PUB.ADD('p_header_id = '|| p_header_id,1 );
1313: OE_DEBUG_PUB.ADD('p_delayed_request = '|| p_delayed_request,1 );
1314: OE_DEBUG_PUB.ADD('p_calling_action = '|| p_calling_action,1 );
1307:
1308: IF G_debug_flag = 'Y'
1309: THEN
1310: OE_DEBUG_PUB.ADD('OEXPCRGB: IN Check_Credit ',1);
1311: OE_DEBUG_PUB.ADD('Input parameters list ');
1312: OE_DEBUG_PUB.ADD('p_header_id = '|| p_header_id,1 );
1313: OE_DEBUG_PUB.ADD('p_delayed_request = '|| p_delayed_request,1 );
1314: OE_DEBUG_PUB.ADD('p_calling_action = '|| p_calling_action,1 );
1315: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id );
1308: IF G_debug_flag = 'Y'
1309: THEN
1310: OE_DEBUG_PUB.ADD('OEXPCRGB: IN Check_Credit ',1);
1311: OE_DEBUG_PUB.ADD('Input parameters list ');
1312: OE_DEBUG_PUB.ADD('p_header_id = '|| p_header_id,1 );
1313: OE_DEBUG_PUB.ADD('p_delayed_request = '|| p_delayed_request,1 );
1314: OE_DEBUG_PUB.ADD('p_calling_action = '|| p_calling_action,1 );
1315: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id );
1316: END IF;
1309: THEN
1310: OE_DEBUG_PUB.ADD('OEXPCRGB: IN Check_Credit ',1);
1311: OE_DEBUG_PUB.ADD('Input parameters list ');
1312: OE_DEBUG_PUB.ADD('p_header_id = '|| p_header_id,1 );
1313: OE_DEBUG_PUB.ADD('p_delayed_request = '|| p_delayed_request,1 );
1314: OE_DEBUG_PUB.ADD('p_calling_action = '|| p_calling_action,1 );
1315: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id );
1316: END IF;
1317:
1310: OE_DEBUG_PUB.ADD('OEXPCRGB: IN Check_Credit ',1);
1311: OE_DEBUG_PUB.ADD('Input parameters list ');
1312: OE_DEBUG_PUB.ADD('p_header_id = '|| p_header_id,1 );
1313: OE_DEBUG_PUB.ADD('p_delayed_request = '|| p_delayed_request,1 );
1314: OE_DEBUG_PUB.ADD('p_calling_action = '|| p_calling_action,1 );
1315: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id );
1316: END IF;
1317:
1318: OE_Credit_Engine_GRP.G_delayed_request := NULL ;
1311: OE_DEBUG_PUB.ADD('Input parameters list ');
1312: OE_DEBUG_PUB.ADD('p_header_id = '|| p_header_id,1 );
1313: OE_DEBUG_PUB.ADD('p_delayed_request = '|| p_delayed_request,1 );
1314: OE_DEBUG_PUB.ADD('p_calling_action = '|| p_calling_action,1 );
1315: OE_DEBUG_PUB.ADD('p_credit_check_rule_id => '|| p_credit_check_rule_id );
1316: END IF;
1317:
1318: OE_Credit_Engine_GRP.G_delayed_request := NULL ;
1319: OE_Credit_Engine_GRP.G_currency_error_msg := NULL ;
1346: END IF;
1347:
1348: IF G_debug_flag = 'Y'
1349: THEN
1350: OE_DEBUG_PUB.ADD('after query header ');
1351: OE_DEBUG_PUB.ADD(' ');
1352: OE_DEBUG_PUB.ADD('======================================');
1353: OE_DEBUG_PUB.ADD('Header ID = '|| l_header_rec.header_id );
1354: OE_DEBUG_PUB.ADD('order_category_code = '||
1347:
1348: IF G_debug_flag = 'Y'
1349: THEN
1350: OE_DEBUG_PUB.ADD('after query header ');
1351: OE_DEBUG_PUB.ADD(' ');
1352: OE_DEBUG_PUB.ADD('======================================');
1353: OE_DEBUG_PUB.ADD('Header ID = '|| l_header_rec.header_id );
1354: OE_DEBUG_PUB.ADD('order_category_code = '||
1355: l_header_rec.order_category_code );
1348: IF G_debug_flag = 'Y'
1349: THEN
1350: OE_DEBUG_PUB.ADD('after query header ');
1351: OE_DEBUG_PUB.ADD(' ');
1352: OE_DEBUG_PUB.ADD('======================================');
1353: OE_DEBUG_PUB.ADD('Header ID = '|| l_header_rec.header_id );
1354: OE_DEBUG_PUB.ADD('order_category_code = '||
1355: l_header_rec.order_category_code );
1356: OE_DEBUG_PUB.ADD('Booked flag = '||
1349: THEN
1350: OE_DEBUG_PUB.ADD('after query header ');
1351: OE_DEBUG_PUB.ADD(' ');
1352: OE_DEBUG_PUB.ADD('======================================');
1353: OE_DEBUG_PUB.ADD('Header ID = '|| l_header_rec.header_id );
1354: OE_DEBUG_PUB.ADD('order_category_code = '||
1355: l_header_rec.order_category_code );
1356: OE_DEBUG_PUB.ADD('Booked flag = '||
1357: l_header_rec.booked_flag );
1350: OE_DEBUG_PUB.ADD('after query header ');
1351: OE_DEBUG_PUB.ADD(' ');
1352: OE_DEBUG_PUB.ADD('======================================');
1353: OE_DEBUG_PUB.ADD('Header ID = '|| l_header_rec.header_id );
1354: OE_DEBUG_PUB.ADD('order_category_code = '||
1355: l_header_rec.order_category_code );
1356: OE_DEBUG_PUB.ADD('Booked flag = '||
1357: l_header_rec.booked_flag );
1358: OE_DEBUG_PUB.ADD('Order number = '||
1352: OE_DEBUG_PUB.ADD('======================================');
1353: OE_DEBUG_PUB.ADD('Header ID = '|| l_header_rec.header_id );
1354: OE_DEBUG_PUB.ADD('order_category_code = '||
1355: l_header_rec.order_category_code );
1356: OE_DEBUG_PUB.ADD('Booked flag = '||
1357: l_header_rec.booked_flag );
1358: OE_DEBUG_PUB.ADD('Order number = '||
1359: l_header_rec.order_number );
1360: OE_DEBUG_PUB.ADD('Credit crad approval date = '||
1354: OE_DEBUG_PUB.ADD('order_category_code = '||
1355: l_header_rec.order_category_code );
1356: OE_DEBUG_PUB.ADD('Booked flag = '||
1357: l_header_rec.booked_flag );
1358: OE_DEBUG_PUB.ADD('Order number = '||
1359: l_header_rec.order_number );
1360: OE_DEBUG_PUB.ADD('Credit crad approval date = '||
1361: l_header_rec.credit_card_approval_date );
1362: OE_DEBUG_PUB.ADD('payment_term_id = ' ||
1356: OE_DEBUG_PUB.ADD('Booked flag = '||
1357: l_header_rec.booked_flag );
1358: OE_DEBUG_PUB.ADD('Order number = '||
1359: l_header_rec.order_number );
1360: OE_DEBUG_PUB.ADD('Credit crad approval date = '||
1361: l_header_rec.credit_card_approval_date );
1362: OE_DEBUG_PUB.ADD('payment_term_id = ' ||
1363: l_header_rec.payment_term_id );
1364: OE_DEBUG_PUB.ADD('order_type_id = '||
1358: OE_DEBUG_PUB.ADD('Order number = '||
1359: l_header_rec.order_number );
1360: OE_DEBUG_PUB.ADD('Credit crad approval date = '||
1361: l_header_rec.credit_card_approval_date );
1362: OE_DEBUG_PUB.ADD('payment_term_id = ' ||
1363: l_header_rec.payment_term_id );
1364: OE_DEBUG_PUB.ADD('order_type_id = '||
1365: l_header_rec.order_type_id );
1366: OE_DEBUG_PUB.ADD(' ');
1360: OE_DEBUG_PUB.ADD('Credit crad approval date = '||
1361: l_header_rec.credit_card_approval_date );
1362: OE_DEBUG_PUB.ADD('payment_term_id = ' ||
1363: l_header_rec.payment_term_id );
1364: OE_DEBUG_PUB.ADD('order_type_id = '||
1365: l_header_rec.order_type_id );
1366: OE_DEBUG_PUB.ADD(' ');
1367: OE_DEBUG_PUB.ADD('======================================');
1368: END IF;
1362: OE_DEBUG_PUB.ADD('payment_term_id = ' ||
1363: l_header_rec.payment_term_id );
1364: OE_DEBUG_PUB.ADD('order_type_id = '||
1365: l_header_rec.order_type_id );
1366: OE_DEBUG_PUB.ADD(' ');
1367: OE_DEBUG_PUB.ADD('======================================');
1368: END IF;
1369:
1370: IF p_credit_check_rule_id is NULL or
1363: l_header_rec.payment_term_id );
1364: OE_DEBUG_PUB.ADD('order_type_id = '||
1365: l_header_rec.order_type_id );
1366: OE_DEBUG_PUB.ADD(' ');
1367: OE_DEBUG_PUB.ADD('======================================');
1368: END IF;
1369:
1370: IF p_credit_check_rule_id is NULL or
1371: NVL(p_credit_check_rule_id,0) = 0
1390: END IF;
1391:
1392: IF G_debug_flag = 'Y'
1393: THEN
1394: OE_DEBUG_PUB.ADD(' GL_CURRENCY after = '|| OE_Credit_Engine_GRP.GL_currency );
1395: OE_DEBUG_PUB.ADD('l_credit_check_rule_id = '|| l_credit_check_rule_id );
1396: END IF;
1397:
1398: ----------------------- start Processing --------------------
1391:
1392: IF G_debug_flag = 'Y'
1393: THEN
1394: OE_DEBUG_PUB.ADD(' GL_CURRENCY after = '|| OE_Credit_Engine_GRP.GL_currency );
1395: OE_DEBUG_PUB.ADD('l_credit_check_rule_id = '|| l_credit_check_rule_id );
1396: END IF;
1397:
1398: ----------------------- start Processing --------------------
1399:
1400: IF l_credit_check_rule_id is NULL
1401: THEN
1402: IF G_debug_flag = 'Y'
1403: THEN
1404: OE_DEBUG_PUB.ADD(' No credit check attached, return ');
1405: END IF;
1406: RETURN ;
1407: END IF;
1408:
1420: );
1421:
1422: IF G_debug_flag = 'Y'
1423: THEN
1424: OE_DEBUG_PUB.ADD('credit_check_level_code = '||
1425: l_credit_check_rule_rec.credit_check_level_code );
1426: END IF;
1427:
1428: IF NVL(l_credit_check_rule_rec.credit_check_level_code,'ORDER')
1442: );
1443:
1444: IF G_debug_flag = 'Y'
1445: THEN
1446: OE_DEBUG_PUB.ADD('OEXPCRGB: Out of Check_order_credit ');
1447: OE_DEBUG_PUB.ADD('x_return_status = '|| x_return_status );
1448: OE_DEBUG_PUB.ADD('x_result_out =>' || x_result_out );
1449: END IF;
1450:
1443:
1444: IF G_debug_flag = 'Y'
1445: THEN
1446: OE_DEBUG_PUB.ADD('OEXPCRGB: Out of Check_order_credit ');
1447: OE_DEBUG_PUB.ADD('x_return_status = '|| x_return_status );
1448: OE_DEBUG_PUB.ADD('x_result_out =>' || x_result_out );
1449: END IF;
1450:
1451: ELSIF NVL(l_credit_check_rule_rec.credit_check_level_code,'ORDER')
1444: IF G_debug_flag = 'Y'
1445: THEN
1446: OE_DEBUG_PUB.ADD('OEXPCRGB: Out of Check_order_credit ');
1447: OE_DEBUG_PUB.ADD('x_return_status = '|| x_return_status );
1448: OE_DEBUG_PUB.ADD('x_result_out =>' || x_result_out );
1449: END IF;
1450:
1451: ELSIF NVL(l_credit_check_rule_rec.credit_check_level_code,'ORDER')
1452: = 'LINE'
1466: ) ;
1467:
1468: IF G_debug_flag = 'Y'
1469: THEN
1470: OE_DEBUG_PUB.ADD('OEXPCRGB: Out of Check_order_lines_credit ');
1471: OE_DEBUG_PUB.ADD('x_return_status = '|| x_return_status );
1472: OE_DEBUG_PUB.ADD('x_result_out => '|| x_result_out );
1473: OE_DEBUG_PUB.ADD('line hold count =>'||OE_Credit_Check_lines_PVT.G_line_hold_count);
1474: END IF;
1467:
1468: IF G_debug_flag = 'Y'
1469: THEN
1470: OE_DEBUG_PUB.ADD('OEXPCRGB: Out of Check_order_lines_credit ');
1471: OE_DEBUG_PUB.ADD('x_return_status = '|| x_return_status );
1472: OE_DEBUG_PUB.ADD('x_result_out => '|| x_result_out );
1473: OE_DEBUG_PUB.ADD('line hold count =>'||OE_Credit_Check_lines_PVT.G_line_hold_count);
1474: END IF;
1475: END IF;
1468: IF G_debug_flag = 'Y'
1469: THEN
1470: OE_DEBUG_PUB.ADD('OEXPCRGB: Out of Check_order_lines_credit ');
1471: OE_DEBUG_PUB.ADD('x_return_status = '|| x_return_status );
1472: OE_DEBUG_PUB.ADD('x_result_out => '|| x_result_out );
1473: OE_DEBUG_PUB.ADD('line hold count =>'||OE_Credit_Check_lines_PVT.G_line_hold_count);
1474: END IF;
1475: END IF;
1476:
1469: THEN
1470: OE_DEBUG_PUB.ADD('OEXPCRGB: Out of Check_order_lines_credit ');
1471: OE_DEBUG_PUB.ADD('x_return_status = '|| x_return_status );
1472: OE_DEBUG_PUB.ADD('x_result_out => '|| x_result_out );
1473: OE_DEBUG_PUB.ADD('line hold count =>'||OE_Credit_Check_lines_PVT.G_line_hold_count);
1474: END IF;
1475: END IF;
1476:
1477: -- Moved calling_action check to outside of status check
1485: );
1486:
1487: IF G_debug_flag = 'Y'
1488: THEN
1489: OE_DEBUG_PUB.ADD('Apply_exception_hold x_return_status => '
1490: || x_return_status );
1491: END IF;
1492:
1493: IF x_return_status = FND_API.G_RET_STS_SUCCESS
1514: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1515:
1516: IF G_debug_flag = 'Y'
1517: THEN
1518: OE_DEBUG_PUB.ADD( ' x_return_status = '|| x_return_status );
1519: OE_DEBUG_PUB.ADD( ' G_currency_error_msg = '||
1520: OE_Credit_Engine_GRP.G_currency_error_msg );
1521: END IF;
1522: END IF;
1515:
1516: IF G_debug_flag = 'Y'
1517: THEN
1518: OE_DEBUG_PUB.ADD( ' x_return_status = '|| x_return_status );
1519: OE_DEBUG_PUB.ADD( ' G_currency_error_msg = '||
1520: OE_Credit_Engine_GRP.G_currency_error_msg );
1521: END IF;
1522: END IF;
1523:
1531: END IF;
1532:
1533: IF G_debug_flag = 'Y'
1534: THEN
1535: OE_DEBUG_PUB.ADD('after excp holds x_return_status => '
1536: || x_return_status );
1537: OE_DEBUG_PUB.ADD('after excp holds x_result_out => '
1538: || x_result_out );
1539: OE_DEBUG_PUB.ADD('Check for notification send ' ) ;
1533: IF G_debug_flag = 'Y'
1534: THEN
1535: OE_DEBUG_PUB.ADD('after excp holds x_return_status => '
1536: || x_return_status );
1537: OE_DEBUG_PUB.ADD('after excp holds x_result_out => '
1538: || x_result_out );
1539: OE_DEBUG_PUB.ADD('Check for notification send ' ) ;
1540: END IF;
1541:
1535: OE_DEBUG_PUB.ADD('after excp holds x_return_status => '
1536: || x_return_status );
1537: OE_DEBUG_PUB.ADD('after excp holds x_result_out => '
1538: || x_result_out );
1539: OE_DEBUG_PUB.ADD('Check for notification send ' ) ;
1540: END IF;
1541:
1542: IF x_result_out = 'FAIL_HOLD' AND -- Bug 4506263 FP
1543: NVL(p_calling_action, 'BOOKING') NOT IN ('EXTERNAL', 'AUTO RELEASE')
1553:
1554: IF G_debug_flag = 'Y'
1555: THEN
1556:
1557: OE_DEBUG_PUB.ADD('after call send_credit_hold_ntf ');
1558: OE_DEBUG_PUB.ADD('x_return_status = '|| x_return_status );
1559: OE_DEBUG_PUB.ADD('line hold count =>'||OE_Credit_Check_lines_PVT.G_line_hold_count);
1560: END IF;
1561:
1554: IF G_debug_flag = 'Y'
1555: THEN
1556:
1557: OE_DEBUG_PUB.ADD('after call send_credit_hold_ntf ');
1558: OE_DEBUG_PUB.ADD('x_return_status = '|| x_return_status );
1559: OE_DEBUG_PUB.ADD('line hold count =>'||OE_Credit_Check_lines_PVT.G_line_hold_count);
1560: END IF;
1561:
1562: IF x_return_status <> FND_API.G_RET_STS_SUCCESS
1555: THEN
1556:
1557: OE_DEBUG_PUB.ADD('after call send_credit_hold_ntf ');
1558: OE_DEBUG_PUB.ADD('x_return_status = '|| x_return_status );
1559: OE_DEBUG_PUB.ADD('line hold count =>'||OE_Credit_Check_lines_PVT.G_line_hold_count);
1560: END IF;
1561:
1562: IF x_return_status <> FND_API.G_RET_STS_SUCCESS
1563: THEN
1561:
1562: IF x_return_status <> FND_API.G_RET_STS_SUCCESS
1563: THEN
1564:
1565: OE_DEBUG_PUB.ADD('send failed ');
1566:
1567: x_return_status := FND_API.G_RET_STS_SUCCESS ;
1568:
1569: OE_DEBUG_PUB.ADD(' after assign x_return_status = '
1565: OE_DEBUG_PUB.ADD('send failed ');
1566:
1567: x_return_status := FND_API.G_RET_STS_SUCCESS ;
1568:
1569: OE_DEBUG_PUB.ADD(' after assign x_return_status = '
1570: || x_return_status );
1571: END IF;
1572:
1573:
1573:
1574: ELSE
1575: IF G_debug_flag = 'Y'
1576: THEN
1577: OE_DEBUG_PUB.ADD('No need for sending notifications flag OFF or ignored',1);
1578: END IF;
1579: END IF;
1580:
1581: END IF;
1593: END IF;
1594:
1595: IF G_debug_flag = 'Y'
1596: THEN
1597: OE_DEBUG_PUB.ADD('Final x_return_status => '|| x_return_status );
1598: OE_DEBUG_PUB.ADD('Final x_result_out => '|| x_result_out );
1599: OE_DEBUG_PUB.ADD('OEXPCRGB: OUT Check_Credit ',1);
1600: END IF;
1601:
1594:
1595: IF G_debug_flag = 'Y'
1596: THEN
1597: OE_DEBUG_PUB.ADD('Final x_return_status => '|| x_return_status );
1598: OE_DEBUG_PUB.ADD('Final x_result_out => '|| x_result_out );
1599: OE_DEBUG_PUB.ADD('OEXPCRGB: OUT Check_Credit ',1);
1600: END IF;
1601:
1602: EXCEPTION
1595: IF G_debug_flag = 'Y'
1596: THEN
1597: OE_DEBUG_PUB.ADD('Final x_return_status => '|| x_return_status );
1598: OE_DEBUG_PUB.ADD('Final x_result_out => '|| x_result_out );
1599: OE_DEBUG_PUB.ADD('OEXPCRGB: OUT Check_Credit ',1);
1600: END IF;
1601:
1602: EXCEPTION
1603:
1647: l_org_id NUMBER;
1648: --
1649: BEGIN
1650:
1651: OE_DEBUG_PUB.ADD('OEXPCRGB: IN Set_context ' );
1652: BEGIN
1653:
1654: l_org_id := mo_global.get_current_org_id;
1655:
1654: l_org_id := mo_global.get_current_org_id;
1655:
1656: IF l_org_id IS NOT NULL THEN
1657: IF G_debug_flag = 'Y' THEN
1658: oe_debug_pub.add( 'OEXPCRGB: setting single org context to '|| l_org_id , 1 );
1659: END IF;
1660:
1661: MO_GLOBAL.Set_Policy_Context('S', l_org_id);
1662: ELSE
1660:
1661: MO_GLOBAL.Set_Policy_Context('S', l_org_id);
1662: ELSE
1663: IF G_debug_flag = 'Y' THEN
1664: oe_debug_pub.add('OEXPCRGB: Unexpected error in setting org context where Customer Exposure flag is ''''N', 1 );
1665: END IF;
1666: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1667: END IF;
1668:
1680: l_org_id := NULL ;
1681:
1682: OE_CREDIT_CHECK_UTIL.G_org_id := NULL ;
1683:
1684: OE_DEBUG_PUB.ADD(' Exception Set context');
1685: END ;
1686:
1687: OE_DEBUG_PUB.ADD('OEXPCRGB: OUT Set_context ' );
1688:
1683:
1684: OE_DEBUG_PUB.ADD(' Exception Set context');
1685: END ;
1686:
1687: OE_DEBUG_PUB.ADD('OEXPCRGB: OUT Set_context ' );
1688:
1689: EXCEPTION
1690: WHEN OTHERS THEN
1691: IF G_debug_flag = 'Y' THEN
1688:
1689: EXCEPTION
1690: WHEN OTHERS THEN
1691: IF G_debug_flag = 'Y' THEN
1692: OE_DEBUG_PUB.ADD ('Exception : Unexpected error from Set_Context ', 1);
1693: END IF;
1694:
1695: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1696: THEN