130: BEGIN
131: IF G_debug_flag = 'Y'
132: THEN
133:
134: OE_DEBUG_PUB.Add('OEXVCRHB: In Check_Manual_Released_Holds');
135: OE_DEBUG_PUB.Add('Check Header ID/Line ID: '||p_header_id||'/'||p_line_id);
136: OE_DEBUG_PUB.Add('p_calling action = '|| p_calling_action );
137: OE_DEBUG_PUB.Add('G_delayed_request = '||
138: OE_credit_engine_GRP.G_delayed_request );
131: IF G_debug_flag = 'Y'
132: THEN
133:
134: OE_DEBUG_PUB.Add('OEXVCRHB: In Check_Manual_Released_Holds');
135: OE_DEBUG_PUB.Add('Check Header ID/Line ID: '||p_header_id||'/'||p_line_id);
136: OE_DEBUG_PUB.Add('p_calling action = '|| p_calling_action );
137: OE_DEBUG_PUB.Add('G_delayed_request = '||
138: OE_credit_engine_GRP.G_delayed_request );
139: END IF;
132: THEN
133:
134: OE_DEBUG_PUB.Add('OEXVCRHB: In Check_Manual_Released_Holds');
135: OE_DEBUG_PUB.Add('Check Header ID/Line ID: '||p_header_id||'/'||p_line_id);
136: OE_DEBUG_PUB.Add('p_calling action = '|| p_calling_action );
137: OE_DEBUG_PUB.Add('G_delayed_request = '||
138: OE_credit_engine_GRP.G_delayed_request );
139: END IF;
140:
133:
134: OE_DEBUG_PUB.Add('OEXVCRHB: In Check_Manual_Released_Holds');
135: OE_DEBUG_PUB.Add('Check Header ID/Line ID: '||p_header_id||'/'||p_line_id);
136: OE_DEBUG_PUB.Add('p_calling action = '|| p_calling_action );
137: OE_DEBUG_PUB.Add('G_delayed_request = '||
138: OE_credit_engine_GRP.G_delayed_request );
139: END IF;
140:
141: -- Will check only if delayed_request is FALSE
166: AND S.HOLD_ENTITY_ID = p_header_id
167: AND S.RELEASED_FLAG ='Y';
168: EXCEPTION
169: WHEN NO_DATA_FOUND THEN
170: OE_DEBUG_PUB.Add
171: ('No data found ');
172: l_released_rec_exists := 'N';*/
173: --commented for BUG#9728597
174:
175: --added for BUG#9728597 Start
176: OPEN released_hold;
177: FETCH released_hold INTO l_hold_release_id;
178: IF (released_hold%notfound) THEN
179: oe_debug_pub.add('No Released record found');
180: l_released_rec_exists := 'N';
181: END IF;
182: CLOSE released_hold;
183:
182: CLOSE released_hold;
183:
184: EXCEPTION
185: WHEN OTHERS THEN
186: oe_debug_pub.add('An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
187: --added for BUG#9728597 End
188:
189: END;
190:
215: END IF;
216: END IF; --ER 12363706
217: EXCEPTION
218: WHEN NO_DATA_FOUND THEN
219: OE_DEBUG_PUB.Add
220: ('No manually released credit holds for Header ID/Line ID: '||
221: p_header_id||'/'||p_line_id,1);
222: l_manual_hold_exists := 'N';
223:
226: END IF;
227:
228: IF G_debug_flag = 'Y'
229: THEN
230: OE_DEBUG_PUB.Add('OEXVCRHB: Out Check_Manual_Released_Holds:'||l_manual_hold_exists);
231: END IF;
232:
233: RETURN l_manual_hold_exists;
234:
233: RETURN l_manual_hold_exists;
234:
235: EXCEPTION
236: WHEN OTHERS THEN
237: OE_DEBUG_PUB.ADD(SUBSTR(SQLERRM,1,300) ) ;
238:
239: OE_MSG_PUB.Add_Exc_Msg
240: ( G_PKG_NAME
241: , 'Check_Manual_Released_Holds'
261: l_msg_data VARCHAR2(2000);
262: BEGIN
263: IF G_debug_flag = 'Y'
264: THEN
265: OE_DEBUG_PUB.ADD('OEXVCRHB: In Hold_Exists');
266: OE_DEBUG_PUB.ADD('OEXVCRHB: Check holds for Header ID : '
267: || p_header_id,1);
268: OE_DEBUG_PUB.ADD('g_hold_exist => '|| g_hold_exist );
269:
262: BEGIN
263: IF G_debug_flag = 'Y'
264: THEN
265: OE_DEBUG_PUB.ADD('OEXVCRHB: In Hold_Exists');
266: OE_DEBUG_PUB.ADD('OEXVCRHB: Check holds for Header ID : '
267: || p_header_id,1);
268: OE_DEBUG_PUB.ADD('g_hold_exist => '|| g_hold_exist );
269:
270:
264: THEN
265: OE_DEBUG_PUB.ADD('OEXVCRHB: In Hold_Exists');
266: OE_DEBUG_PUB.ADD('OEXVCRHB: Check holds for Header ID : '
267: || p_header_id,1);
268: OE_DEBUG_PUB.ADD('g_hold_exist => '|| g_hold_exist );
269:
270:
271: END IF;
272:
278: l_hold_result := 'F' ;
279: ELSE
280: l_hold_result := NULL ;
281:
282: OE_DEBUG_PUB.ADD('Calling OE_HOLDS_PUB.Check_Holds ');
283:
284: OE_HOLDS_PUB.Check_Holds
285: ( p_api_version => 1.0
286: , p_header_id => p_header_id
298: );
299:
300: IF G_debug_flag = 'Y'
301: THEN
302: OE_DEBUG_PUB.ADD('OEXVCRHB: Out Check_Holds ');
303: OE_DEBUG_PUB.ADD('l_return_status = '|| l_return_status );
304: END IF;
305:
306: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
299:
300: IF G_debug_flag = 'Y'
301: THEN
302: OE_DEBUG_PUB.ADD('OEXVCRHB: Out Check_Holds ');
303: OE_DEBUG_PUB.ADD('l_return_status = '|| l_return_status );
304: END IF;
305:
306: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
307: RAISE FND_API.G_EXC_ERROR;
312: END IF; -- g_hold_exist
313:
314: IF G_debug_flag = 'Y'
315: THEN
316: OE_DEBUG_PUB.ADD('OEXVCRHB: about to Hold_Exists');
317: OE_DEBUG_PUB.ADD('l_hold_result => '|| l_hold_result );
318: END IF;
319:
320: IF l_hold_result = FND_API.G_TRUE THEN
313:
314: IF G_debug_flag = 'Y'
315: THEN
316: OE_DEBUG_PUB.ADD('OEXVCRHB: about to Hold_Exists');
317: OE_DEBUG_PUB.ADD('l_hold_result => '|| l_hold_result );
318: END IF;
319:
320: IF l_hold_result = FND_API.G_TRUE THEN
321: return TRUE;
349: BEGIN
350:
351: IF G_debug_flag = 'Y'
352: THEN
353: OE_DEBUG_PUB.Add('OEXVCRHB: In Write_Release_Message');
354: END IF;
355:
356: IF p_calling_action = 'AUTO RELEASE' THEN
357: FND_FILE.PUT_LINE(FND_FILE.LOG, 'Order Number: '||TO_CHAR(p_order_number)
366: ---OE_MSG_PUB.Save_Messages(1);
367:
368: IF G_debug_flag = 'Y'
369: THEN
370: OE_DEBUG_PUB.Add('OEXVCRHB: Out Write_Release_Message');
371: END IF;
372: EXCEPTION
373: WHEN OTHERS THEN
374: OE_MSG_PUB.Add_Exc_Msg
401: l_calling_activity VARCHAR2(50); --ER#7479609
402: BEGIN
403: IF G_debug_flag = 'Y'
404: THEN
405: OE_DEBUG_PUB.Add('OEXVCRHB: In Write_Order_Hold_Msg');
406: OE_DEBUG_PUB.Add('p_calling_action => '||
407: p_calling_action );
408: OE_DEBUG_PUB.Add('p_cc_limit_used => '||
409: p_cc_limit_used );
402: BEGIN
403: IF G_debug_flag = 'Y'
404: THEN
405: OE_DEBUG_PUB.Add('OEXVCRHB: In Write_Order_Hold_Msg');
406: OE_DEBUG_PUB.Add('p_calling_action => '||
407: p_calling_action );
408: OE_DEBUG_PUB.Add('p_cc_limit_used => '||
409: p_cc_limit_used );
410: OE_DEBUG_PUB.Add('p_cc_profile_used => '||
404: THEN
405: OE_DEBUG_PUB.Add('OEXVCRHB: In Write_Order_Hold_Msg');
406: OE_DEBUG_PUB.Add('p_calling_action => '||
407: p_calling_action );
408: OE_DEBUG_PUB.Add('p_cc_limit_used => '||
409: p_cc_limit_used );
410: OE_DEBUG_PUB.Add('p_cc_profile_used => '||
411: p_cc_profile_used );
412: OE_DEBUG_PUB.Add('p_order_number => '||
406: OE_DEBUG_PUB.Add('p_calling_action => '||
407: p_calling_action );
408: OE_DEBUG_PUB.Add('p_cc_limit_used => '||
409: p_cc_limit_used );
410: OE_DEBUG_PUB.Add('p_cc_profile_used => '||
411: p_cc_profile_used );
412: OE_DEBUG_PUB.Add('p_order_number => '||
413: p_order_number );
414: END IF;
408: OE_DEBUG_PUB.Add('p_cc_limit_used => '||
409: p_cc_limit_used );
410: OE_DEBUG_PUB.Add('p_cc_profile_used => '||
411: p_cc_profile_used );
412: OE_DEBUG_PUB.Add('p_order_number => '||
413: p_order_number );
414: END IF;
415:
416: l_cc_profile_used := OE_CREDIT_CHECK_UTIL.Get_CC_Lookup_Meaning('OE_CC_PROFILE', p_cc_profile_used); --ER8880886
499: x_comment := l_comment;
500:
501: IF G_debug_flag = 'Y'
502: THEN
503: OE_DEBUG_PUB.Add('x_comment => '||
504: x_comment );
505: OE_DEBUG_PUB.Add('OEXVCRHB: Out Write_Order_Hold_Msg');
506: END IF;
507:
501: IF G_debug_flag = 'Y'
502: THEN
503: OE_DEBUG_PUB.Add('x_comment => '||
504: x_comment );
505: OE_DEBUG_PUB.Add('OEXVCRHB: Out Write_Order_Hold_Msg');
506: END IF;
507:
508: EXCEPTION
509: WHEN OTHERS THEN
527: IS
528: BEGIN
529: IF G_debug_flag = 'Y'
530: THEN
531: OE_DEBUG_PUB.Add('OEXVCRHB: In Write_Order_Release_Msg');
532: END IF;
533:
534: IF p_calling_action = 'AUTO RELEASE' THEN
535: FND_FILE.PUT_LINE(FND_FILE.LOG, 'Order '||TO_CHAR(p_order_number)
540: END IF;
541: --
542: IF G_debug_flag = 'Y'
543: THEN
544: OE_DEBUG_PUB.Add('OEXVCRHB: Out Write_Order_Release_Msg');
545: END IF;
546:
547: EXCEPTION
548: WHEN OTHERS THEN
570:
571:
572: BEGIN
573:
574: OE_DEBUG_PUB.ADD(' OEXVCRHB: In Apply_hold_and_commit ');
575: OE_DEBUG_PUB.ADD(' Call OE_Holds_PUB.Apply_Holds ');
576:
577:
578: OE_Holds_PUB.Apply_Holds
571:
572: BEGIN
573:
574: OE_DEBUG_PUB.ADD(' OEXVCRHB: In Apply_hold_and_commit ');
575: OE_DEBUG_PUB.ADD(' Call OE_Holds_PUB.Apply_Holds ');
576:
577:
578: OE_Holds_PUB.Apply_Holds
579: ( p_api_version => 1.0
583: , x_msg_data => x_msg_data
584: , x_return_status => x_return_status
585: );
586:
587: OE_DEBUG_PUB.ADD(' Out OE_Holds_PUB.Apply_Holds ');
588: OE_DEBUG_PUB.ADD(' x_return_status => '|| x_return_status );
589:
590: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
591: RAISE FND_API.G_EXC_ERROR;
584: , x_return_status => x_return_status
585: );
586:
587: OE_DEBUG_PUB.ADD(' Out OE_Holds_PUB.Apply_Holds ');
588: OE_DEBUG_PUB.ADD(' x_return_status => '|| x_return_status );
589:
590: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
591: RAISE FND_API.G_EXC_ERROR;
592: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
592: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
593: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
594: ELSIF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
595:
596: OE_DEBUG_PUB.ADD(' Holds success ');
597: OE_DEBUG_PUB.ADD(' About to Issue COMMIT');
598:
599: COMMIT;
600:
593: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
594: ELSIF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
595:
596: OE_DEBUG_PUB.ADD(' Holds success ');
597: OE_DEBUG_PUB.ADD(' About to Issue COMMIT');
598:
599: COMMIT;
600:
601: OE_DEBUG_PUB.ADD(' AFter Issue COMMIT');
597: OE_DEBUG_PUB.ADD(' About to Issue COMMIT');
598:
599: COMMIT;
600:
601: OE_DEBUG_PUB.ADD(' AFter Issue COMMIT');
602:
603: END IF;
604:
605: OE_DEBUG_PUB.ADD(' OEXVCRHB: OUT Apply_hold_and_commit ');
601: OE_DEBUG_PUB.ADD(' AFter Issue COMMIT');
602:
603: END IF;
604:
605: OE_DEBUG_PUB.ADD(' OEXVCRHB: OUT Apply_hold_and_commit ');
606:
607: EXCEPTION
608: WHEN OTHERS THEN
609: rollback;
606:
607: EXCEPTION
608: WHEN OTHERS THEN
609: rollback;
610: OE_DEBUG_PUB.ADD(' Error in Apply_hold_and_commit ' );
611: OE_DEBUG_PUB.ADD(' SQLERRM: '|| SQLERRM );
612: OE_MSG_PUB.Add_Exc_Msg
613: ( G_PKG_NAME
614: , 'Apply_hold_and_commit'
607: EXCEPTION
608: WHEN OTHERS THEN
609: rollback;
610: OE_DEBUG_PUB.ADD(' Error in Apply_hold_and_commit ' );
611: OE_DEBUG_PUB.ADD(' SQLERRM: '|| SQLERRM );
612: OE_MSG_PUB.Add_Exc_Msg
613: ( G_PKG_NAME
614: , 'Apply_hold_and_commit'
615: );
632: BEGIN
633:
634: IF G_debug_flag = 'Y'
635: THEN
636: OE_DEBUG_PUB.ADD('OEXVCRHB: Entering Update_Comments_And_Commit');
637: OE_DEBUG_PUB.ADD('OEXVCRHB: Before OE_Holds_PUB.Update_Hold_Comments');
638: END IF;
639:
640: OE_Holds_PUB.Update_Hold_comments
633:
634: IF G_debug_flag = 'Y'
635: THEN
636: OE_DEBUG_PUB.ADD('OEXVCRHB: Entering Update_Comments_And_Commit');
637: OE_DEBUG_PUB.ADD('OEXVCRHB: Before OE_Holds_PUB.Update_Hold_Comments');
638: END IF;
639:
640: OE_Holds_PUB.Update_Hold_comments
641: ( p_hold_source_rec => p_hold_source_rec
645: );
646:
647: IF G_debug_flag = 'Y'
648: THEN
649: OE_DEBUG_PUB.ADD('OEXVCRHB: After OE_Holds_PUB.Update_Hold_Comments Status '
650: || x_return_status);
651: END IF;
652:
653: --ER 12363706 start
653: --ER 12363706 start
654:
655: IF G_debug_flag = 'Y'
656: THEN
657: OE_DEBUG_PUB.ADD('OEXVCRHB: Call OE_CREDIT_CHECK_UTIL.Update_Credit_Profile_Level');
658: END IF;
659:
660: IF p_hold_source_rec.hold_entity_code = 'O' AND p_hold_source_rec.hold_id = 1 THEN
661: OE_DEBUG_PUB.ADD('OEXVCRHB: calling Update_Credit_Profile_Level');
657: OE_DEBUG_PUB.ADD('OEXVCRHB: Call OE_CREDIT_CHECK_UTIL.Update_Credit_Profile_Level');
658: END IF;
659:
660: IF p_hold_source_rec.hold_entity_code = 'O' AND p_hold_source_rec.hold_id = 1 THEN
661: OE_DEBUG_PUB.ADD('OEXVCRHB: calling Update_Credit_Profile_Level');
662: OE_CREDIT_CHECK_UTIL.Update_Credit_Profile_Level(p_hold_source_rec);
663: END IF;
664:
665: IF G_debug_flag = 'Y'
663: END IF;
664:
665: IF G_debug_flag = 'Y'
666: THEN
667: OE_DEBUG_PUB.ADD('OEXVCRHB: Out OE_CREDIT_CHECK_UTIL.Update_Credit_Profile_Level');
668: END IF;
669:
670: --ER 12363706 end
671:
675: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
676: ELSIF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
677: IF G_debug_flag = 'Y'
678: THEN
679: OE_DEBUG_PUB.ADD('OEXVCRHB: Update Hold Comment Success, Issue COMMIT');
680: END IF;
681:
682: COMMIT;
683:
682: COMMIT;
683:
684: IF G_debug_flag = 'Y'
685: THEN
686: OE_DEBUG_PUB.ADD('OEXVCRHB: After Issuing COMMIT');
687: END IF;
688: END IF;
689:
690: IF G_debug_flag = 'Y'
688: END IF;
689:
690: IF G_debug_flag = 'Y'
691: THEN
692: OE_DEBUG_PUB.ADD(' OEXVCRHB: Exiting Update_Comments_And_Commit');
693: END IF;
694:
695: EXCEPTION
696: WHEN OTHERS THEN
694:
695: EXCEPTION
696: WHEN OTHERS THEN
697: rollback;
698: OE_DEBUG_PUB.ADD('OEXVCRHB: Error in Update_Comments_And_Commit' );
699: OE_DEBUG_PUB.ADD('SQLERRM: '|| SQLERRM );
700: OE_MSG_PUB.Add_Exc_Msg
701: ( G_PKG_NAME
702: , 'Update_Comments_And_Commit'
695: EXCEPTION
696: WHEN OTHERS THEN
697: rollback;
698: OE_DEBUG_PUB.ADD('OEXVCRHB: Error in Update_Comments_And_Commit' );
699: OE_DEBUG_PUB.ADD('SQLERRM: '|| SQLERRM );
700: OE_MSG_PUB.Add_Exc_Msg
701: ( G_PKG_NAME
702: , 'Update_Comments_And_Commit'
703: );
753: OE_HOLDS_PVT.G_MISS_Hold_Source_REC;
754: BEGIN
755: IF G_debug_flag = 'Y'
756: THEN
757: OE_DEBUG_PUB.Add('OEXVCRHB: In Apply_Order_CC_Hold');
758: END IF;
759:
760: IF p_cc_limit_used = 'ITEM' THEN
761: OPEN item_category_csr;
787: l_hold_source_rec.hold_comment := l_hold_comment;
788:
789: IF G_debug_flag = 'Y'
790: THEN
791: OE_DEBUG_PUB.Add('OEXVCRHB: Hold already applied on Header ID:' ||
792: p_header_id, 1);
793: END IF;
794:
795:
797: IF NVL(p_calling_action, 'BOOKING') IN ('SHIPPING','PACKING','PICKING')
798: THEN
799: IF G_debug_flag = 'Y'
800: THEN
801: OE_DEBUG_PUB.ADD('OEXVCRHB: Call Update_Comments_And_Commit');
802: END IF;
803:
804: OE_Credit_Engine_GRP.G_Credit_Profile_Level := p_cc_profile_used; --ER 12363706
805: l_cc_result_out := 'FAIL_HOLD';--kadiraju added for Bug$ 13768161
813: OE_Credit_Engine_GRP.G_Credit_Profile_Level := NULL; --ER 12363706
814:
815: IF G_debug_flag = 'Y'
816: THEN
817: OE_DEBUG_PUB.ADD('OEXVCRHB: Out Update_Comments_And_Commit');
818: END IF;
819:
820: ELSIF NVL( p_calling_action,'BOOKING') IN ('BOOKING','UPDATE','AUTO HOLD')
821: THEN
820: ELSIF NVL( p_calling_action,'BOOKING') IN ('BOOKING','UPDATE','AUTO HOLD')
821: THEN
822: IF G_debug_flag = 'Y'
823: THEN
824: OE_DEBUG_PUB.ADD('OEXVCRHB: Call OE_Holds_PUB.Update_Hold_Comments directly');
825: END IF;
826: l_cc_result_out := 'FAIL_HOLD';--kadiraju added for Bug$ 13768161
827: OE_Holds_PUB.Update_hold_comments
828: ( p_hold_source_rec => l_hold_source_rec
832: );
833:
834: IF G_debug_flag = 'Y'
835: THEN
836: OE_DEBUG_PUB.ADD('OEXVCRHB: Out OE_Holds_PUB.Update_Hold_Comments directly');
837: END IF;
838:
839: --ER 12363706 start
840: IF G_debug_flag = 'Y'
838:
839: --ER 12363706 start
840: IF G_debug_flag = 'Y'
841: THEN
842: OE_DEBUG_PUB.ADD('OEXVCRHB: Call OE_CREDIT_CHECK_UTIL.Update_Credit_Profile_Level');
843: END IF;
844:
845: OE_Credit_Engine_GRP.G_Credit_Profile_Level := p_cc_profile_used;
846:
844:
845: OE_Credit_Engine_GRP.G_Credit_Profile_Level := p_cc_profile_used;
846:
847: IF l_hold_source_rec.hold_entity_code = 'O' AND l_hold_source_rec.hold_id = 1 THEN
848: OE_DEBUG_PUB.ADD('OEXVCRHB: calling Update_Credit_Profile_Level');
849: OE_CREDIT_CHECK_UTIL.Update_Credit_Profile_Level(l_hold_source_rec);
850: END IF;
851:
852: OE_Credit_Engine_GRP.G_Credit_Profile_Level := NULL;
852: OE_Credit_Engine_GRP.G_Credit_Profile_Level := NULL;
853:
854: IF G_debug_flag = 'Y'
855: THEN
856: OE_DEBUG_PUB.ADD('OEXVCRHB: Out OE_CREDIT_CHECK_UTIL.Update_Credit_Profile_Level');
857: END IF;
858: --ER 12363706 end
859:
860: END IF; -- Calling Action
865: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
866: ELSIF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
867: IF G_debug_flag = 'Y'
868: THEN
869: OE_DEBUG_PUB.ADD('OEXVCRHB: Updated Comments on Header ID:'
870: ||p_header_id, 1);
871: END IF;
872: END IF;
873: ELSE
883: --ER 12363706 end
884: THEN
885: IF G_debug_flag = 'Y'
886: THEN
887: OE_DEBUG_PUB.Add('No manual released holds ');
888: END IF;
889: G_result_out := 'FAIL' ;
890: Write_Order_Hold_Msg
891: (
907: THEN
908:
909: IF G_debug_flag = 'Y'
910: THEN
911: OE_DEBUG_PUB.ADD('OEXVCRHB: Call Apply_hold_and_commit ');
912: oe_debug_pub.ADD('OEXVCRHB: p_cc_profile_used ' || p_cc_profile_used);
913: END IF;
914:
915: Apply_hold_and_commit
908:
909: IF G_debug_flag = 'Y'
910: THEN
911: OE_DEBUG_PUB.ADD('OEXVCRHB: Call Apply_hold_and_commit ');
912: oe_debug_pub.ADD('OEXVCRHB: p_cc_profile_used ' || p_cc_profile_used);
913: END IF;
914:
915: Apply_hold_and_commit
916: ( p_hold_source_rec => l_hold_source_rec
920: );
921:
922: IF G_debug_flag = 'Y'
923: THEN
924: OE_DEBUG_PUB.ADD('OEXVCRHB: Out Apply_hold_and_commit ');
925: END IF;
926:
927: ELSIF NVL( p_calling_action,'BOOKING') IN ('BOOKING','UPDATE','AUTO HOLD')
928: THEN
928: THEN
929:
930: IF G_debug_flag = 'Y'
931: THEN
932: OE_DEBUG_PUB.ADD('OEXVCRHB: Call OE_Holds_PUB.Apply_Holds directly');
933: oe_debug_pub.ADD('OEXVCRHB: p_cc_profile_used ' || p_cc_profile_used);
934: END IF;
935:
936: OE_Holds_PUB.Apply_Holds
929:
930: IF G_debug_flag = 'Y'
931: THEN
932: OE_DEBUG_PUB.ADD('OEXVCRHB: Call OE_Holds_PUB.Apply_Holds directly');
933: oe_debug_pub.ADD('OEXVCRHB: p_cc_profile_used ' || p_cc_profile_used);
934: END IF;
935:
936: OE_Holds_PUB.Apply_Holds
937: ( p_api_version => 1.0
942: , x_return_status => l_return_status
943: );
944:
945: IF G_debug_flag = 'Y' THEN
946: OE_DEBUG_PUB.ADD('OEXVCRHB: Out OE_Holds_PUB.Apply_Holds directly');
947: END IF;
948:
949: END IF; --check calling action
950:
955: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
956: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
957: ELSIF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
958: IF G_debug_flag = 'Y' THEN
959: OE_DEBUG_PUB.ADD('OEXVCRHB: Credit check hold applied header_ID: '
960: ||p_header_id, 1);
961: END IF;
962: END IF;
963: l_cc_result_out := 'FAIL_HOLD';
967: x_cc_result_out := l_cc_result_out;
968:
969: IF G_debug_flag = 'Y'
970: THEN
971: OE_DEBUG_PUB.ADD('OEXVCRHB: Apply_Order_CC_Hold Result = '
972: ||x_cc_result_out);
973: OE_DEBUG_PUB.Add('OEXVCRHB: Out Apply_Order_CC_Hold');
974: END IF;
975:
969: IF G_debug_flag = 'Y'
970: THEN
971: OE_DEBUG_PUB.ADD('OEXVCRHB: Apply_Order_CC_Hold Result = '
972: ||x_cc_result_out);
973: OE_DEBUG_PUB.Add('OEXVCRHB: Out Apply_Order_CC_Hold');
974: END IF;
975:
976: EXCEPTION
977: WHEN OTHERS THEN
1015: l_calling_activity VARCHAR2(50); --ER#7479609
1016: BEGIN
1017: IF G_debug_flag = 'Y'
1018: THEN
1019: OE_DEBUG_PUB.Add('OEXVCRHB: In Release_Order_CC_Hold',1);
1020: END IF;
1021:
1022: l_return_status := FND_API.G_RET_STS_SUCCESS;
1023:
1022: l_return_status := FND_API.G_RET_STS_SUCCESS;
1023:
1024: IF G_debug_flag = 'Y'
1025: THEN
1026: OE_DEBUG_PUB.Add('Check if Holds exist to release ');
1027: END IF;
1028:
1029: IF hold_exists( p_header_id => p_header_id
1030: , p_line_id => NULL
1055:
1056:
1057: IF G_debug_flag = 'Y'
1058: THEN
1059: OE_DEBUG_PUB.ADD('Attempt to Release hold on ' || p_header_id, 1);
1060: END IF;
1061:
1062: IF NVL(p_calling_action, 'BOOKING') <> 'AUTO HOLD' THEN
1063: OE_Holds_PUB.Release_Holds
1079: );
1080:
1081: IF G_debug_flag = 'Y'
1082: THEN
1083: OE_DEBUG_PUB.ADD('OEXVCRHB: Released credit check hold on Header ID:'
1084: || p_header_id, 1);
1085: END IF;
1086: END IF;
1087: l_cc_result_out := 'PASS_REL';
1090: x_cc_result_out := l_cc_result_out;
1091:
1092: IF G_debug_flag = 'Y'
1093: THEN
1094: OE_DEBUG_PUB.Add('OEXVCRHB: Out Release_Order_CC_Hold');
1095: END IF;
1096: EXCEPTION
1097: WHEN OTHERS THEN
1098: OE_MSG_PUB.Add_Exc_Msg
1130:
1131: BEGIN
1132: IF G_debug_flag = 'Y'
1133: THEN
1134: OE_DEBUG_PUB.ADD('OEXVCRHB: In Chk_Past_Due_Invoice');
1135: OE_DEBUG_PUB.ADD('p_global_exposure_flag = '|| p_global_exposure_flag );
1136: OE_DEBUG_PUB.ADD('Call Get_Past_Due_Invoice ');
1137: END IF;
1138:
1131: BEGIN
1132: IF G_debug_flag = 'Y'
1133: THEN
1134: OE_DEBUG_PUB.ADD('OEXVCRHB: In Chk_Past_Due_Invoice');
1135: OE_DEBUG_PUB.ADD('p_global_exposure_flag = '|| p_global_exposure_flag );
1136: OE_DEBUG_PUB.ADD('Call Get_Past_Due_Invoice ');
1137: END IF;
1138:
1139: -- Initialize return status to success
1132: IF G_debug_flag = 'Y'
1133: THEN
1134: OE_DEBUG_PUB.ADD('OEXVCRHB: In Chk_Past_Due_Invoice');
1135: OE_DEBUG_PUB.ADD('p_global_exposure_flag = '|| p_global_exposure_flag );
1136: OE_DEBUG_PUB.ADD('Call Get_Past_Due_Invoice ');
1137: END IF;
1138:
1139: -- Initialize return status to success
1140: x_return_status := FND_API.G_RET_STS_SUCCESS;
1159: );
1160:
1161: IF G_debug_flag = 'Y'
1162: THEN
1163: OE_DEBUG_PUB.ADD(' After Get_Past_Due_Invoice ');
1164: OE_DEBUG_PUB.ADD(' x_return_status = '|| x_return_status);
1165: OE_DEBUG_PUB.ADD(' l_exist_flag = '|| l_exist_flag );
1166: END IF;
1167:
1160:
1161: IF G_debug_flag = 'Y'
1162: THEN
1163: OE_DEBUG_PUB.ADD(' After Get_Past_Due_Invoice ');
1164: OE_DEBUG_PUB.ADD(' x_return_status = '|| x_return_status);
1165: OE_DEBUG_PUB.ADD(' l_exist_flag = '|| l_exist_flag );
1166: END IF;
1167:
1168: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1161: IF G_debug_flag = 'Y'
1162: THEN
1163: OE_DEBUG_PUB.ADD(' After Get_Past_Due_Invoice ');
1164: OE_DEBUG_PUB.ADD(' x_return_status = '|| x_return_status);
1165: OE_DEBUG_PUB.ADD(' l_exist_flag = '|| l_exist_flag );
1166: END IF;
1167:
1168: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1169: RAISE FND_API.G_EXC_ERROR;
1178: END IF;
1179:
1180: IF G_debug_flag = 'Y'
1181: THEN
1182: OE_DEBUG_PUB.ADD(' x_cc_result_out = '|| x_cc_result_out );
1183: OE_DEBUG_PUB.ADD('OEXVCRHB: Out Chk_Past_Due_Invoice');
1184: END IF;
1185: EXCEPTION
1186: WHEN OTHERS THEN
1179:
1180: IF G_debug_flag = 'Y'
1181: THEN
1182: OE_DEBUG_PUB.ADD(' x_cc_result_out = '|| x_cc_result_out );
1183: OE_DEBUG_PUB.ADD('OEXVCRHB: Out Chk_Past_Due_Invoice');
1184: END IF;
1185: EXCEPTION
1186: WHEN OTHERS THEN
1187: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1219: BEGIN
1220:
1221: IF G_debug_flag = 'Y'
1222: THEN
1223: OE_DEBUG_PUB.ADD('OEXVCRHB: In Check_Trx_Limit');
1224: END IF;
1225:
1226: -- Initialize return status to success
1227: x_return_status := FND_API.G_RET_STS_SUCCESS;
1247: -- means Y. |
1248: ----------------------------------------------
1249: IF G_debug_flag = 'Y'
1250: THEN
1251: OE_DEBUG_PUB.ADD(' call GET_transaction_amount ');
1252: END IF;
1253:
1254: OE_CREDIT_CHECK_UTIL.GET_transaction_amount
1255: ( p_header_id => p_header_rec.header_id
1265: );
1266:
1267: IF G_debug_flag = 'Y'
1268: THEN
1269: OE_DEBUG_PUB.ADD(' after GET_transaction_amount with status '
1270: || x_return_status );
1271: END IF;
1272:
1273: ELSE
1272:
1273: ELSE
1274: IF G_debug_flag = 'Y'
1275: THEN
1276: OE_DEBUG_PUB.ADD(' call GET_external_trx_amount ');
1277: END IF;
1278:
1279: OE_CREDIT_CHECK_UTIL.GET_external_trx_amount
1280: ( p_transaction_curr_code => p_header_rec.transactional_curr_code
1288: );
1289:
1290: IF G_debug_flag = 'Y'
1291: THEN
1292: OE_DEBUG_PUB.ADD(' after GET_transaction_amount with status '
1293: || x_return_status );
1294: END IF;
1295:
1296: END IF;
1296: END IF;
1297:
1298: IF G_debug_flag = 'Y'
1299: THEN
1300: OE_DEBUG_PUB.ADD(' err curr table count = '
1301: || x_conversion_status.COUNT );
1302: END IF;
1303:
1304: IF NVL(x_conversion_status.COUNT,0) > 0
1304: IF NVL(x_conversion_status.COUNT,0) > 0
1305: THEN
1306: IF G_debug_flag = 'Y'
1307: THEN
1308: OE_DEBUG_PUB.ADD(' Currency conversion failure ');
1309: END IF;
1310:
1311: x_cc_result_out := 'FAIL';
1312:
1311: x_cc_result_out := 'FAIL';
1312:
1313: IF G_debug_flag = 'Y'
1314: THEN
1315: OE_DEBUG_PUB.Add('Fails trx credit limit');
1316: END IF;
1317:
1318: END IF;
1319:
1318: END IF;
1319:
1320: IF G_debug_flag = 'Y'
1321: THEN
1322: OE_DEBUG_PUB.ADD(' l_order_value = ' || l_order_value );
1323: OE_DEBUG_PUB.ADD(' p_trx_credit_limit = '|| p_trx_credit_limit );
1324: END IF;
1325:
1326:
1319:
1320: IF G_debug_flag = 'Y'
1321: THEN
1322: OE_DEBUG_PUB.ADD(' l_order_value = ' || l_order_value );
1323: OE_DEBUG_PUB.ADD(' p_trx_credit_limit = '|| p_trx_credit_limit );
1324: END IF;
1325:
1326:
1327: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1338: IF NVL(x_conversion_status.COUNT,0) > 0
1339: THEN
1340: IF G_debug_flag = 'Y'
1341: THEN
1342: OE_DEBUG_PUB.ADD(' Currency conversion failure ');
1343: END IF;
1344:
1345: x_cc_result_out := 'FAIL';
1346:
1364: x_return_status := FND_API.G_RET_STS_ERROR;
1365:
1366: IF G_debug_flag = 'Y'
1367: THEN
1368: OE_DEBUG_PUB.ADD('Return status after assigned as Error = '
1369: || x_return_status );
1370: END IF;
1371:
1372: END IF;
1372: END IF;
1373:
1374: IF G_debug_flag = 'Y'
1375: THEN
1376: OE_DEBUG_PUB.ADD('x_cc_result_out = ' || x_cc_result_out );
1377: OE_DEBUG_PUB.ADD('OEXVCRHB: Out Check_Trx_Limit');
1378: END IF;
1379: EXCEPTION
1380: WHEN others THEN
1373:
1374: IF G_debug_flag = 'Y'
1375: THEN
1376: OE_DEBUG_PUB.ADD('x_cc_result_out = ' || x_cc_result_out );
1377: OE_DEBUG_PUB.ADD('OEXVCRHB: Out Check_Trx_Limit');
1378: END IF;
1379: EXCEPTION
1380: WHEN others THEN
1381: OE_DEBUG_PUB.Add('Check_Trx_Limit: Other exceptions');
1377: OE_DEBUG_PUB.ADD('OEXVCRHB: Out Check_Trx_Limit');
1378: END IF;
1379: EXCEPTION
1380: WHEN others THEN
1381: OE_DEBUG_PUB.Add('Check_Trx_Limit: Other exceptions');
1382: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1383: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1384: OE_MSG_PUB.Add_Exc_Msg
1385: ( G_PKG_NAME
1414:
1415: BEGIN
1416: IF G_debug_flag = 'Y'
1417: THEN
1418: OE_DEBUG_PUB.Add(' IN check_credit_check_flags ');
1419: END IF;
1420:
1421: SELECT /* MOAC_SQL_NO_CHANGE */ COUNT(line_id)
1422: INTO l_count
1446:
1447:
1448: IF G_debug_flag = 'Y'
1449: THEN
1450: OE_DEBUG_PUB.Add(' l_exist = '|| l_exist );
1451: OE_DEBUG_PUB.Add(' l_count = '|| l_count );
1452: OE_DEBUG_PUB.Add(' OUT check_credit_check_flags ');
1453: END IF;
1454:
1447:
1448: IF G_debug_flag = 'Y'
1449: THEN
1450: OE_DEBUG_PUB.Add(' l_exist = '|| l_exist );
1451: OE_DEBUG_PUB.Add(' l_count = '|| l_count );
1452: OE_DEBUG_PUB.Add(' OUT check_credit_check_flags ');
1453: END IF;
1454:
1455: RETURN l_exist;
1448: IF G_debug_flag = 'Y'
1449: THEN
1450: OE_DEBUG_PUB.Add(' l_exist = '|| l_exist );
1451: OE_DEBUG_PUB.Add(' l_count = '|| l_count );
1452: OE_DEBUG_PUB.Add(' OUT check_credit_check_flags ');
1453: END IF;
1454:
1455: RETURN l_exist;
1456:
1455: RETURN l_exist;
1456:
1457: EXCEPTION
1458: WHEN others THEN
1459: OE_DEBUG_PUB.Add('check_credit_check_flags: Other exceptions');
1460: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1461: OE_MSG_PUB.Add_Exc_Msg
1462: ( G_PKG_NAME
1463: , 'check_credit_check_flags'
1506:
1507: BEGIN
1508: IF G_debug_flag = 'Y'
1509: THEN
1510: OE_DEBUG_PUB.ADD('OEXVCRHB: In Validate_other_credit_check');
1511: OE_DEBUG_PUB.ADD('HEADER id = '|| p_header_rec.header_id );
1512: OE_DEBUG_PUB.ADD('p_customer_id = '|| p_customer_id );
1513: OE_DEBUG_PUB.ADD('p_site_use_id = ' || p_site_use_id );
1514: END IF;
1507: BEGIN
1508: IF G_debug_flag = 'Y'
1509: THEN
1510: OE_DEBUG_PUB.ADD('OEXVCRHB: In Validate_other_credit_check');
1511: OE_DEBUG_PUB.ADD('HEADER id = '|| p_header_rec.header_id );
1512: OE_DEBUG_PUB.ADD('p_customer_id = '|| p_customer_id );
1513: OE_DEBUG_PUB.ADD('p_site_use_id = ' || p_site_use_id );
1514: END IF;
1515:
1508: IF G_debug_flag = 'Y'
1509: THEN
1510: OE_DEBUG_PUB.ADD('OEXVCRHB: In Validate_other_credit_check');
1511: OE_DEBUG_PUB.ADD('HEADER id = '|| p_header_rec.header_id );
1512: OE_DEBUG_PUB.ADD('p_customer_id = '|| p_customer_id );
1513: OE_DEBUG_PUB.ADD('p_site_use_id = ' || p_site_use_id );
1514: END IF;
1515:
1516: x_check_order_flag := 'Y';
1509: THEN
1510: OE_DEBUG_PUB.ADD('OEXVCRHB: In Validate_other_credit_check');
1511: OE_DEBUG_PUB.ADD('HEADER id = '|| p_header_rec.header_id );
1512: OE_DEBUG_PUB.ADD('p_customer_id = '|| p_customer_id );
1513: OE_DEBUG_PUB.ADD('p_site_use_id = ' || p_site_use_id );
1514: END IF;
1515:
1516: x_check_order_flag := 'Y';
1517: x_return_status := FND_API.G_RET_STS_SUCCESS;
1528: END IF;
1529:
1530: IF G_debug_flag = 'Y'
1531: THEN
1532: OE_DEBUG_PUB.ADD('QUICK_CR_CHECK_FLAG = '||
1533: p_credit_check_rule_rec.QUICK_CR_CHECK_FLAG );
1534: OE_DEBUG_PUB.ADD('l_suppress_flag = '|| l_suppress_flag );
1535: OE_DEBUG_PUB.ADD('----------------------------------------- ');
1536: END IF;
1530: IF G_debug_flag = 'Y'
1531: THEN
1532: OE_DEBUG_PUB.ADD('QUICK_CR_CHECK_FLAG = '||
1533: p_credit_check_rule_rec.QUICK_CR_CHECK_FLAG );
1534: OE_DEBUG_PUB.ADD('l_suppress_flag = '|| l_suppress_flag );
1535: OE_DEBUG_PUB.ADD('----------------------------------------- ');
1536: END IF;
1537:
1538:
1531: THEN
1532: OE_DEBUG_PUB.ADD('QUICK_CR_CHECK_FLAG = '||
1533: p_credit_check_rule_rec.QUICK_CR_CHECK_FLAG );
1534: OE_DEBUG_PUB.ADD('l_suppress_flag = '|| l_suppress_flag );
1535: OE_DEBUG_PUB.ADD('----------------------------------------- ');
1536: END IF;
1537:
1538:
1539:
1588: );
1589:
1590: IF G_debug_flag = 'Y'
1591: THEN
1592: OE_DEBUG_PUB.ADD(' after SITE Get_Limit_Info ');
1593: OE_DEBUG_PUB.ADD(' l_credit_check_flag ==> '|| l_credit_check_flag );
1594: OE_DEBUG_PUB.ADD(' x_limit_curr_code ==> ' || x_limit_curr_code );
1595: OE_DEBUG_PUB.ADD(' x_trx_credit_limit ==> '|| x_trx_credit_limit );
1596: OE_DEBUG_PUB.ADD(' x_overall_credit_limit
1589:
1590: IF G_debug_flag = 'Y'
1591: THEN
1592: OE_DEBUG_PUB.ADD(' after SITE Get_Limit_Info ');
1593: OE_DEBUG_PUB.ADD(' l_credit_check_flag ==> '|| l_credit_check_flag );
1594: OE_DEBUG_PUB.ADD(' x_limit_curr_code ==> ' || x_limit_curr_code );
1595: OE_DEBUG_PUB.ADD(' x_trx_credit_limit ==> '|| x_trx_credit_limit );
1596: OE_DEBUG_PUB.ADD(' x_overall_credit_limit
1597: ==> '|| x_overall_credit_limit );
1590: IF G_debug_flag = 'Y'
1591: THEN
1592: OE_DEBUG_PUB.ADD(' after SITE Get_Limit_Info ');
1593: OE_DEBUG_PUB.ADD(' l_credit_check_flag ==> '|| l_credit_check_flag );
1594: OE_DEBUG_PUB.ADD(' x_limit_curr_code ==> ' || x_limit_curr_code );
1595: OE_DEBUG_PUB.ADD(' x_trx_credit_limit ==> '|| x_trx_credit_limit );
1596: OE_DEBUG_PUB.ADD(' x_overall_credit_limit
1597: ==> '|| x_overall_credit_limit );
1598: END IF;
1591: THEN
1592: OE_DEBUG_PUB.ADD(' after SITE Get_Limit_Info ');
1593: OE_DEBUG_PUB.ADD(' l_credit_check_flag ==> '|| l_credit_check_flag );
1594: OE_DEBUG_PUB.ADD(' x_limit_curr_code ==> ' || x_limit_curr_code );
1595: OE_DEBUG_PUB.ADD(' x_trx_credit_limit ==> '|| x_trx_credit_limit );
1596: OE_DEBUG_PUB.ADD(' x_overall_credit_limit
1597: ==> '|| x_overall_credit_limit );
1598: END IF;
1599:
1592: OE_DEBUG_PUB.ADD(' after SITE Get_Limit_Info ');
1593: OE_DEBUG_PUB.ADD(' l_credit_check_flag ==> '|| l_credit_check_flag );
1594: OE_DEBUG_PUB.ADD(' x_limit_curr_code ==> ' || x_limit_curr_code );
1595: OE_DEBUG_PUB.ADD(' x_trx_credit_limit ==> '|| x_trx_credit_limit );
1596: OE_DEBUG_PUB.ADD(' x_overall_credit_limit
1597: ==> '|| x_overall_credit_limit );
1598: END IF;
1599:
1600: IF (x_trx_credit_limit IS NULL AND
1607: END IF;
1608:
1609: IF G_debug_flag = 'Y'
1610: THEN
1611: OE_DEBUG_PUB.ADD(' ');
1612: OE_DEBUG_PUB.ADD('Results from the credit profiles check');
1613: OE_DEBUG_PUB.ADD('--------------------------------------------');
1614: OE_DEBUG_PUB.Add('x_check_order_flag = '
1615: || x_check_order_flag,1 );
1608:
1609: IF G_debug_flag = 'Y'
1610: THEN
1611: OE_DEBUG_PUB.ADD(' ');
1612: OE_DEBUG_PUB.ADD('Results from the credit profiles check');
1613: OE_DEBUG_PUB.ADD('--------------------------------------------');
1614: OE_DEBUG_PUB.Add('x_check_order_flag = '
1615: || x_check_order_flag,1 );
1616: OE_DEBUG_PUB.Add('x_credit_check_lvl_out = '
1609: IF G_debug_flag = 'Y'
1610: THEN
1611: OE_DEBUG_PUB.ADD(' ');
1612: OE_DEBUG_PUB.ADD('Results from the credit profiles check');
1613: OE_DEBUG_PUB.ADD('--------------------------------------------');
1614: OE_DEBUG_PUB.Add('x_check_order_flag = '
1615: || x_check_order_flag,1 );
1616: OE_DEBUG_PUB.Add('x_credit_check_lvl_out = '
1617: || x_credit_check_lvl_out,1);
1610: THEN
1611: OE_DEBUG_PUB.ADD(' ');
1612: OE_DEBUG_PUB.ADD('Results from the credit profiles check');
1613: OE_DEBUG_PUB.ADD('--------------------------------------------');
1614: OE_DEBUG_PUB.Add('x_check_order_flag = '
1615: || x_check_order_flag,1 );
1616: OE_DEBUG_PUB.Add('x_credit_check_lvl_out = '
1617: || x_credit_check_lvl_out,1);
1618: OE_DEBUG_PUB.Add('x_default_limit_flag = '
1612: OE_DEBUG_PUB.ADD('Results from the credit profiles check');
1613: OE_DEBUG_PUB.ADD('--------------------------------------------');
1614: OE_DEBUG_PUB.Add('x_check_order_flag = '
1615: || x_check_order_flag,1 );
1616: OE_DEBUG_PUB.Add('x_credit_check_lvl_out = '
1617: || x_credit_check_lvl_out,1);
1618: OE_DEBUG_PUB.Add('x_default_limit_flag = '
1619: || x_default_limit_flag);
1620: OE_DEBUG_PUB.Add('x_limit_curr_code = '
1614: OE_DEBUG_PUB.Add('x_check_order_flag = '
1615: || x_check_order_flag,1 );
1616: OE_DEBUG_PUB.Add('x_credit_check_lvl_out = '
1617: || x_credit_check_lvl_out,1);
1618: OE_DEBUG_PUB.Add('x_default_limit_flag = '
1619: || x_default_limit_flag);
1620: OE_DEBUG_PUB.Add('x_limit_curr_code = '
1621: || x_limit_curr_code,1);
1622: OE_DEBUG_PUB.Add('x_overall_credit_limit = '
1616: OE_DEBUG_PUB.Add('x_credit_check_lvl_out = '
1617: || x_credit_check_lvl_out,1);
1618: OE_DEBUG_PUB.Add('x_default_limit_flag = '
1619: || x_default_limit_flag);
1620: OE_DEBUG_PUB.Add('x_limit_curr_code = '
1621: || x_limit_curr_code,1);
1622: OE_DEBUG_PUB.Add('x_overall_credit_limit = '
1623: ||x_overall_credit_limit,1);
1624: OE_DEBUG_PUB.Add('x_trx_credit_limit = '
1618: OE_DEBUG_PUB.Add('x_default_limit_flag = '
1619: || x_default_limit_flag);
1620: OE_DEBUG_PUB.Add('x_limit_curr_code = '
1621: || x_limit_curr_code,1);
1622: OE_DEBUG_PUB.Add('x_overall_credit_limit = '
1623: ||x_overall_credit_limit,1);
1624: OE_DEBUG_PUB.Add('x_trx_credit_limit = '
1625: || x_trx_credit_limit,1);
1626: OE_DEBUG_PUB.Add('x_include_all_flag = '
1620: OE_DEBUG_PUB.Add('x_limit_curr_code = '
1621: || x_limit_curr_code,1);
1622: OE_DEBUG_PUB.Add('x_overall_credit_limit = '
1623: ||x_overall_credit_limit,1);
1624: OE_DEBUG_PUB.Add('x_trx_credit_limit = '
1625: || x_trx_credit_limit,1);
1626: OE_DEBUG_PUB.Add('x_include_all_flag = '
1627: ||x_include_all_flag);
1628: OE_DEBUG_PUB.add ('x_global_exposure_flag = '||
1622: OE_DEBUG_PUB.Add('x_overall_credit_limit = '
1623: ||x_overall_credit_limit,1);
1624: OE_DEBUG_PUB.Add('x_trx_credit_limit = '
1625: || x_trx_credit_limit,1);
1626: OE_DEBUG_PUB.Add('x_include_all_flag = '
1627: ||x_include_all_flag);
1628: OE_DEBUG_PUB.add ('x_global_exposure_flag = '||
1629: x_global_exposure_flag,1 );
1630: OE_DEBUG_PUB.add ('x_credit_limit_entity_id => '||
1624: OE_DEBUG_PUB.Add('x_trx_credit_limit = '
1625: || x_trx_credit_limit,1);
1626: OE_DEBUG_PUB.Add('x_include_all_flag = '
1627: ||x_include_all_flag);
1628: OE_DEBUG_PUB.add ('x_global_exposure_flag = '||
1629: x_global_exposure_flag,1 );
1630: OE_DEBUG_PUB.add ('x_credit_limit_entity_id => '||
1631: x_credit_limit_entity_id );
1632:
1626: OE_DEBUG_PUB.Add('x_include_all_flag = '
1627: ||x_include_all_flag);
1628: OE_DEBUG_PUB.add ('x_global_exposure_flag = '||
1629: x_global_exposure_flag,1 );
1630: OE_DEBUG_PUB.add ('x_credit_limit_entity_id => '||
1631: x_credit_limit_entity_id );
1632:
1633: OE_DEBUG_PUB.ADD(' ');
1634: OE_DEBUG_PUB.ADD('****** List of associated Usage currency rules **** ');
1629: x_global_exposure_flag,1 );
1630: OE_DEBUG_PUB.add ('x_credit_limit_entity_id => '||
1631: x_credit_limit_entity_id );
1632:
1633: OE_DEBUG_PUB.ADD(' ');
1634: OE_DEBUG_PUB.ADD('****** List of associated Usage currency rules **** ');
1635: OE_DEBUG_PUB.ADD(' ');
1636: END IF;
1637:
1630: OE_DEBUG_PUB.add ('x_credit_limit_entity_id => '||
1631: x_credit_limit_entity_id );
1632:
1633: OE_DEBUG_PUB.ADD(' ');
1634: OE_DEBUG_PUB.ADD('****** List of associated Usage currency rules **** ');
1635: OE_DEBUG_PUB.ADD(' ');
1636: END IF;
1637:
1638: FOR K IN 1..x_usage_curr.COUNT
1631: x_credit_limit_entity_id );
1632:
1633: OE_DEBUG_PUB.ADD(' ');
1634: OE_DEBUG_PUB.ADD('****** List of associated Usage currency rules **** ');
1635: OE_DEBUG_PUB.ADD(' ');
1636: END IF;
1637:
1638: FOR K IN 1..x_usage_curr.COUNT
1639: LOOP
1638: FOR K IN 1..x_usage_curr.COUNT
1639: LOOP
1640: IF G_debug_flag = 'Y'
1641: THEN
1642: OE_DEBUG_PUB.Add(' Usage currency ' || k || ' => ' ||
1643: x_usage_curr(K).usage_curr_code );
1644: END IF;
1645:
1646: END LOOP ;
1647:
1648:
1649: IF G_debug_flag = 'Y'
1650: THEN
1651: OE_DEBUG_PUB.ADD(' ');
1652: OE_DEBUG_PUB.ADD('**************** End of List *********************** ');
1653: OE_DEBUG_PUB.Add('OEXVCRHB: Out Validate_other_credit_check');
1654: END IF;
1655:
1648:
1649: IF G_debug_flag = 'Y'
1650: THEN
1651: OE_DEBUG_PUB.ADD(' ');
1652: OE_DEBUG_PUB.ADD('**************** End of List *********************** ');
1653: OE_DEBUG_PUB.Add('OEXVCRHB: Out Validate_other_credit_check');
1654: END IF;
1655:
1656: EXCEPTION
1649: IF G_debug_flag = 'Y'
1650: THEN
1651: OE_DEBUG_PUB.ADD(' ');
1652: OE_DEBUG_PUB.ADD('**************** End of List *********************** ');
1653: OE_DEBUG_PUB.Add('OEXVCRHB: Out Validate_other_credit_check');
1654: END IF;
1655:
1656: EXCEPTION
1657: WHEN OTHERS THEN
1724:
1725: IF G_debug_flag = 'Y'
1726: THEN
1727:
1728: OE_DEBUG_PUB.Add('OEXVCRHB: IN Check_order_exposure ');
1729: OE_DEBUG_PUB.Add(' ');
1730: OE_DEBUG_PUB.Add('-******-------------********---------------**********--');
1731: OE_DEBUG_PUB.Add('p_header_id = '|| p_header_id );
1732: OE_DEBUG_PUB.Add('p_customer_id = '|| p_customer_id );
1725: IF G_debug_flag = 'Y'
1726: THEN
1727:
1728: OE_DEBUG_PUB.Add('OEXVCRHB: IN Check_order_exposure ');
1729: OE_DEBUG_PUB.Add(' ');
1730: OE_DEBUG_PUB.Add('-******-------------********---------------**********--');
1731: OE_DEBUG_PUB.Add('p_header_id = '|| p_header_id );
1732: OE_DEBUG_PUB.Add('p_customer_id = '|| p_customer_id );
1733: OE_DEBUG_PUB.Add('p_site_use_id = '|| p_site_use_id );
1726: THEN
1727:
1728: OE_DEBUG_PUB.Add('OEXVCRHB: IN Check_order_exposure ');
1729: OE_DEBUG_PUB.Add(' ');
1730: OE_DEBUG_PUB.Add('-******-------------********---------------**********--');
1731: OE_DEBUG_PUB.Add('p_header_id = '|| p_header_id );
1732: OE_DEBUG_PUB.Add('p_customer_id = '|| p_customer_id );
1733: OE_DEBUG_PUB.Add('p_site_use_id = '|| p_site_use_id );
1734: OE_DEBUG_PUB.Add('p_party_id = ' || p_party_id );
1727:
1728: OE_DEBUG_PUB.Add('OEXVCRHB: IN Check_order_exposure ');
1729: OE_DEBUG_PUB.Add(' ');
1730: OE_DEBUG_PUB.Add('-******-------------********---------------**********--');
1731: OE_DEBUG_PUB.Add('p_header_id = '|| p_header_id );
1732: OE_DEBUG_PUB.Add('p_customer_id = '|| p_customer_id );
1733: OE_DEBUG_PUB.Add('p_site_use_id = '|| p_site_use_id );
1734: OE_DEBUG_PUB.Add('p_party_id = ' || p_party_id );
1735: OE_DEBUG_PUB.Add('p_credit_limit_entity_id = '||
1728: OE_DEBUG_PUB.Add('OEXVCRHB: IN Check_order_exposure ');
1729: OE_DEBUG_PUB.Add(' ');
1730: OE_DEBUG_PUB.Add('-******-------------********---------------**********--');
1731: OE_DEBUG_PUB.Add('p_header_id = '|| p_header_id );
1732: OE_DEBUG_PUB.Add('p_customer_id = '|| p_customer_id );
1733: OE_DEBUG_PUB.Add('p_site_use_id = '|| p_site_use_id );
1734: OE_DEBUG_PUB.Add('p_party_id = ' || p_party_id );
1735: OE_DEBUG_PUB.Add('p_credit_limit_entity_id = '||
1736: p_credit_limit_entity_id );
1729: OE_DEBUG_PUB.Add(' ');
1730: OE_DEBUG_PUB.Add('-******-------------********---------------**********--');
1731: OE_DEBUG_PUB.Add('p_header_id = '|| p_header_id );
1732: OE_DEBUG_PUB.Add('p_customer_id = '|| p_customer_id );
1733: OE_DEBUG_PUB.Add('p_site_use_id = '|| p_site_use_id );
1734: OE_DEBUG_PUB.Add('p_party_id = ' || p_party_id );
1735: OE_DEBUG_PUB.Add('p_credit_limit_entity_id = '||
1736: p_credit_limit_entity_id );
1737: OE_DEBUG_PUB.Add('p_credit_level = '|| p_credit_level );
1730: OE_DEBUG_PUB.Add('-******-------------********---------------**********--');
1731: OE_DEBUG_PUB.Add('p_header_id = '|| p_header_id );
1732: OE_DEBUG_PUB.Add('p_customer_id = '|| p_customer_id );
1733: OE_DEBUG_PUB.Add('p_site_use_id = '|| p_site_use_id );
1734: OE_DEBUG_PUB.Add('p_party_id = ' || p_party_id );
1735: OE_DEBUG_PUB.Add('p_credit_limit_entity_id = '||
1736: p_credit_limit_entity_id );
1737: OE_DEBUG_PUB.Add('p_credit_level = '|| p_credit_level );
1738: OE_DEBUG_PUB.Add('p_transaction_curr_code = '|| p_transaction_curr_code );
1731: OE_DEBUG_PUB.Add('p_header_id = '|| p_header_id );
1732: OE_DEBUG_PUB.Add('p_customer_id = '|| p_customer_id );
1733: OE_DEBUG_PUB.Add('p_site_use_id = '|| p_site_use_id );
1734: OE_DEBUG_PUB.Add('p_party_id = ' || p_party_id );
1735: OE_DEBUG_PUB.Add('p_credit_limit_entity_id = '||
1736: p_credit_limit_entity_id );
1737: OE_DEBUG_PUB.Add('p_credit_level = '|| p_credit_level );
1738: OE_DEBUG_PUB.Add('p_transaction_curr_code = '|| p_transaction_curr_code );
1739: OE_DEBUG_PUB.Add('p_limit_curr_code = '|| p_limit_curr_code );
1733: OE_DEBUG_PUB.Add('p_site_use_id = '|| p_site_use_id );
1734: OE_DEBUG_PUB.Add('p_party_id = ' || p_party_id );
1735: OE_DEBUG_PUB.Add('p_credit_limit_entity_id = '||
1736: p_credit_limit_entity_id );
1737: OE_DEBUG_PUB.Add('p_credit_level = '|| p_credit_level );
1738: OE_DEBUG_PUB.Add('p_transaction_curr_code = '|| p_transaction_curr_code );
1739: OE_DEBUG_PUB.Add('p_limit_curr_code = '|| p_limit_curr_code );
1740: OE_DEBUG_PUB.Add('p_include_all_flag = '|| p_include_all_flag );
1741: OE_DEBUG_PUB.Add('p_default_limit_flag = '|| p_default_limit_flag );
1734: OE_DEBUG_PUB.Add('p_party_id = ' || p_party_id );
1735: OE_DEBUG_PUB.Add('p_credit_limit_entity_id = '||
1736: p_credit_limit_entity_id );
1737: OE_DEBUG_PUB.Add('p_credit_level = '|| p_credit_level );
1738: OE_DEBUG_PUB.Add('p_transaction_curr_code = '|| p_transaction_curr_code );
1739: OE_DEBUG_PUB.Add('p_limit_curr_code = '|| p_limit_curr_code );
1740: OE_DEBUG_PUB.Add('p_include_all_flag = '|| p_include_all_flag );
1741: OE_DEBUG_PUB.Add('p_default_limit_flag = '|| p_default_limit_flag );
1742: OE_DEBUG_PUB.Add('p_global_exposure_flag = '|| p_global_exposure_flag );
1735: OE_DEBUG_PUB.Add('p_credit_limit_entity_id = '||
1736: p_credit_limit_entity_id );
1737: OE_DEBUG_PUB.Add('p_credit_level = '|| p_credit_level );
1738: OE_DEBUG_PUB.Add('p_transaction_curr_code = '|| p_transaction_curr_code );
1739: OE_DEBUG_PUB.Add('p_limit_curr_code = '|| p_limit_curr_code );
1740: OE_DEBUG_PUB.Add('p_include_all_flag = '|| p_include_all_flag );
1741: OE_DEBUG_PUB.Add('p_default_limit_flag = '|| p_default_limit_flag );
1742: OE_DEBUG_PUB.Add('p_global_exposure_flag = '|| p_global_exposure_flag );
1743: OE_DEBUG_PUB.Add('p_transaction_amount = '|| p_transaction_amount );
1736: p_credit_limit_entity_id );
1737: OE_DEBUG_PUB.Add('p_credit_level = '|| p_credit_level );
1738: OE_DEBUG_PUB.Add('p_transaction_curr_code = '|| p_transaction_curr_code );
1739: OE_DEBUG_PUB.Add('p_limit_curr_code = '|| p_limit_curr_code );
1740: OE_DEBUG_PUB.Add('p_include_all_flag = '|| p_include_all_flag );
1741: OE_DEBUG_PUB.Add('p_default_limit_flag = '|| p_default_limit_flag );
1742: OE_DEBUG_PUB.Add('p_global_exposure_flag = '|| p_global_exposure_flag );
1743: OE_DEBUG_PUB.Add('p_transaction_amount = '|| p_transaction_amount );
1744: OE_DEBUG_PUB.Add('-******------------********---------------**********--');
1737: OE_DEBUG_PUB.Add('p_credit_level = '|| p_credit_level );
1738: OE_DEBUG_PUB.Add('p_transaction_curr_code = '|| p_transaction_curr_code );
1739: OE_DEBUG_PUB.Add('p_limit_curr_code = '|| p_limit_curr_code );
1740: OE_DEBUG_PUB.Add('p_include_all_flag = '|| p_include_all_flag );
1741: OE_DEBUG_PUB.Add('p_default_limit_flag = '|| p_default_limit_flag );
1742: OE_DEBUG_PUB.Add('p_global_exposure_flag = '|| p_global_exposure_flag );
1743: OE_DEBUG_PUB.Add('p_transaction_amount = '|| p_transaction_amount );
1744: OE_DEBUG_PUB.Add('-******------------********---------------**********--');
1745: OE_DEBUG_PUB.Add(' ');
1738: OE_DEBUG_PUB.Add('p_transaction_curr_code = '|| p_transaction_curr_code );
1739: OE_DEBUG_PUB.Add('p_limit_curr_code = '|| p_limit_curr_code );
1740: OE_DEBUG_PUB.Add('p_include_all_flag = '|| p_include_all_flag );
1741: OE_DEBUG_PUB.Add('p_default_limit_flag = '|| p_default_limit_flag );
1742: OE_DEBUG_PUB.Add('p_global_exposure_flag = '|| p_global_exposure_flag );
1743: OE_DEBUG_PUB.Add('p_transaction_amount = '|| p_transaction_amount );
1744: OE_DEBUG_PUB.Add('-******------------********---------------**********--');
1745: OE_DEBUG_PUB.Add(' ');
1746: OE_DEBUG_PUB.Add(' Precalculated flag = '||
1739: OE_DEBUG_PUB.Add('p_limit_curr_code = '|| p_limit_curr_code );
1740: OE_DEBUG_PUB.Add('p_include_all_flag = '|| p_include_all_flag );
1741: OE_DEBUG_PUB.Add('p_default_limit_flag = '|| p_default_limit_flag );
1742: OE_DEBUG_PUB.Add('p_global_exposure_flag = '|| p_global_exposure_flag );
1743: OE_DEBUG_PUB.Add('p_transaction_amount = '|| p_transaction_amount );
1744: OE_DEBUG_PUB.Add('-******------------********---------------**********--');
1745: OE_DEBUG_PUB.Add(' ');
1746: OE_DEBUG_PUB.Add(' Precalculated flag = '||
1747: p_credit_check_rule_rec.QUICK_CR_CHECK_FLAG );
1740: OE_DEBUG_PUB.Add('p_include_all_flag = '|| p_include_all_flag );
1741: OE_DEBUG_PUB.Add('p_default_limit_flag = '|| p_default_limit_flag );
1742: OE_DEBUG_PUB.Add('p_global_exposure_flag = '|| p_global_exposure_flag );
1743: OE_DEBUG_PUB.Add('p_transaction_amount = '|| p_transaction_amount );
1744: OE_DEBUG_PUB.Add('-******------------********---------------**********--');
1745: OE_DEBUG_PUB.Add(' ');
1746: OE_DEBUG_PUB.Add(' Precalculated flag = '||
1747: p_credit_check_rule_rec.QUICK_CR_CHECK_FLAG );
1748: OE_DEBUG_PUB.Add(' ');
1741: OE_DEBUG_PUB.Add('p_default_limit_flag = '|| p_default_limit_flag );
1742: OE_DEBUG_PUB.Add('p_global_exposure_flag = '|| p_global_exposure_flag );
1743: OE_DEBUG_PUB.Add('p_transaction_amount = '|| p_transaction_amount );
1744: OE_DEBUG_PUB.Add('-******------------********---------------**********--');
1745: OE_DEBUG_PUB.Add(' ');
1746: OE_DEBUG_PUB.Add(' Precalculated flag = '||
1747: p_credit_check_rule_rec.QUICK_CR_CHECK_FLAG );
1748: OE_DEBUG_PUB.Add(' ');
1749: END IF;
1742: OE_DEBUG_PUB.Add('p_global_exposure_flag = '|| p_global_exposure_flag );
1743: OE_DEBUG_PUB.Add('p_transaction_amount = '|| p_transaction_amount );
1744: OE_DEBUG_PUB.Add('-******------------********---------------**********--');
1745: OE_DEBUG_PUB.Add(' ');
1746: OE_DEBUG_PUB.Add(' Precalculated flag = '||
1747: p_credit_check_rule_rec.QUICK_CR_CHECK_FLAG );
1748: OE_DEBUG_PUB.Add(' ');
1749: END IF;
1750:
1744: OE_DEBUG_PUB.Add('-******------------********---------------**********--');
1745: OE_DEBUG_PUB.Add(' ');
1746: OE_DEBUG_PUB.Add(' Precalculated flag = '||
1747: p_credit_check_rule_rec.QUICK_CR_CHECK_FLAG );
1748: OE_DEBUG_PUB.Add(' ');
1749: END IF;
1750:
1751:
1752: x_total_exposure := 0 ;
1766: END IF;
1767:
1768: IF G_debug_flag = 'Y'
1769: THEN
1770: OE_DEBUG_PUB.ADD('err curr table count = ' || l_conversion_status.COUNT );
1771: END IF;
1772:
1773: IF NVL(l_conversion_status.COUNT,0) > 0 THEN
1774: x_cc_result_out := 'FAIL';
1786: IF NVL(p_calling_action, 'BOOKING') = 'EXTERNAL' THEN
1787:
1788: IF G_debug_flag = 'Y'
1789: THEN
1790: OE_DEBUG_PUB.Add('OEXVCRHB GET_external_trx_amount ');
1791: END IF;
1792:
1793: OE_CREDIT_CHECK_UTIL.GET_external_trx_amount
1794: ( p_transaction_curr_code => p_transaction_curr_code
1803:
1804: IF G_debug_flag = 'Y'
1805: THEN
1806:
1807: OE_DEBUG_PUB.Add(' after get_external_trx_amount ');
1808: OE_DEBUG_PUB.Add(' x_return_status ' || x_return_status );
1809: OE_DEBUG_PUB.Add(' l_trasaction_value = '|| l_transaction_value );
1810: OE_DEBUG_PUB.ADD('err curr table count = '
1811: || l_conversion_status.COUNT );
1804: IF G_debug_flag = 'Y'
1805: THEN
1806:
1807: OE_DEBUG_PUB.Add(' after get_external_trx_amount ');
1808: OE_DEBUG_PUB.Add(' x_return_status ' || x_return_status );
1809: OE_DEBUG_PUB.Add(' l_trasaction_value = '|| l_transaction_value );
1810: OE_DEBUG_PUB.ADD('err curr table count = '
1811: || l_conversion_status.COUNT );
1812: END IF;
1805: THEN
1806:
1807: OE_DEBUG_PUB.Add(' after get_external_trx_amount ');
1808: OE_DEBUG_PUB.Add(' x_return_status ' || x_return_status );
1809: OE_DEBUG_PUB.Add(' l_trasaction_value = '|| l_transaction_value );
1810: OE_DEBUG_PUB.ADD('err curr table count = '
1811: || l_conversion_status.COUNT );
1812: END IF;
1813:
1806:
1807: OE_DEBUG_PUB.Add(' after get_external_trx_amount ');
1808: OE_DEBUG_PUB.Add(' x_return_status ' || x_return_status );
1809: OE_DEBUG_PUB.Add(' l_trasaction_value = '|| l_transaction_value );
1810: OE_DEBUG_PUB.ADD('err curr table count = '
1811: || l_conversion_status.COUNT );
1812: END IF;
1813:
1814: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1819: END IF;
1820:
1821: IF NVL(l_conversion_status.COUNT,0) > 0 THEN
1822: IF G_debug_flag = 'Y' THEN
1823: OE_DEBUG_PUB.Add(' Currency conversion failure ');
1824: END IF;
1825: ELSE
1826: -- Get exposure only when there are no previous conversion failures.
1827: -- otherwise, just fail the exposure credit check with status Error.
1853: );
1854:
1855: IF G_debug_flag = 'Y'
1856: THEN
1857: OE_DEBUG_PUB.Add(' after get_order_exposure ');
1858: OE_DEBUG_PUB.Add(' x_return_status ' || x_return_status );
1859: OE_DEBUG_PUB.Add(' x_total_exposure = '|| x_total_exposure );
1860: OE_DEBUG_PUB.Add(' err cur tbl count = '||
1861: l_conversion_status.COUNT );
1854:
1855: IF G_debug_flag = 'Y'
1856: THEN
1857: OE_DEBUG_PUB.Add(' after get_order_exposure ');
1858: OE_DEBUG_PUB.Add(' x_return_status ' || x_return_status );
1859: OE_DEBUG_PUB.Add(' x_total_exposure = '|| x_total_exposure );
1860: OE_DEBUG_PUB.Add(' err cur tbl count = '||
1861: l_conversion_status.COUNT );
1862: END IF;
1855: IF G_debug_flag = 'Y'
1856: THEN
1857: OE_DEBUG_PUB.Add(' after get_order_exposure ');
1858: OE_DEBUG_PUB.Add(' x_return_status ' || x_return_status );
1859: OE_DEBUG_PUB.Add(' x_total_exposure = '|| x_total_exposure );
1860: OE_DEBUG_PUB.Add(' err cur tbl count = '||
1861: l_conversion_status.COUNT );
1862: END IF;
1863:
1856: THEN
1857: OE_DEBUG_PUB.Add(' after get_order_exposure ');
1858: OE_DEBUG_PUB.Add(' x_return_status ' || x_return_status );
1859: OE_DEBUG_PUB.Add(' x_total_exposure = '|| x_total_exposure );
1860: OE_DEBUG_PUB.Add(' err cur tbl count = '||
1861: l_conversion_status.COUNT );
1862: END IF;
1863:
1864: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1891: );
1892:
1893: IF G_debug_flag = 'Y'
1894: THEN
1895: OE_DEBUG_PUB.Add('Out of Precalculated exposure ');
1896: OE_DEBUG_PUB.Add('x_return_status = '|| x_return_status );
1897: OE_DEBUG_PUB.Add('x_total_exposure = '|| x_total_exposure );
1898: OE_DEBUG_PUB.Add('Error table count = '||l_conversion_status.COUNT );
1899: END IF;
1892:
1893: IF G_debug_flag = 'Y'
1894: THEN
1895: OE_DEBUG_PUB.Add('Out of Precalculated exposure ');
1896: OE_DEBUG_PUB.Add('x_return_status = '|| x_return_status );
1897: OE_DEBUG_PUB.Add('x_total_exposure = '|| x_total_exposure );
1898: OE_DEBUG_PUB.Add('Error table count = '||l_conversion_status.COUNT );
1899: END IF;
1900:
1893: IF G_debug_flag = 'Y'
1894: THEN
1895: OE_DEBUG_PUB.Add('Out of Precalculated exposure ');
1896: OE_DEBUG_PUB.Add('x_return_status = '|| x_return_status );
1897: OE_DEBUG_PUB.Add('x_total_exposure = '|| x_total_exposure );
1898: OE_DEBUG_PUB.Add('Error table count = '||l_conversion_status.COUNT );
1899: END IF;
1900:
1901: -- BUG Fix 2338145
1894: THEN
1895: OE_DEBUG_PUB.Add('Out of Precalculated exposure ');
1896: OE_DEBUG_PUB.Add('x_return_status = '|| x_return_status );
1897: OE_DEBUG_PUB.Add('x_total_exposure = '|| x_total_exposure );
1898: OE_DEBUG_PUB.Add('Error table count = '||l_conversion_status.COUNT );
1899: END IF;
1900:
1901: -- BUG Fix 2338145
1902: -- Get the current order amount to be included into the
1933: l_current_order_value :=
1934: NVL(OE_CREDIT_CHECK_UTIL.g_current_order_value,0) ;
1935: IF G_debug_flag = 'Y'
1936: THEN
1937: OE_DEBUG_PUB.Add('Calling action=BOOKING and G_delayed_request=FALSE');
1938: END IF;
1939: ELSIF NVL(p_calling_action, 'BOOKING') <> 'EXTERNAL'
1940: THEN
1941: IF p_calling_action <> 'BOOKING'
1946: IF NVL(p_credit_check_rule_rec.uninvoiced_orders_flag,'N') = 'Y'
1947: THEN
1948: IF G_debug_flag = 'Y'
1949: THEN
1950: OE_DEBUG_PUB.Add(' Call Hold_Exists after get_exposure ');
1951: END IF;
1952: --
1953: IF Hold_Exists( p_header_id => p_header_id
1954: , p_line_id => NULL )
1959: END IF;
1960:
1961: IF G_debug_flag = 'Y'
1962: THEN
1963: OE_DEBUG_PUB.Add(' after g_hold_exist => '|| g_hold_exist );
1964: END IF;
1965:
1966: IF g_hold_exist = 'Y'
1967: THEN
1978: END IF;
1979:
1980: IF G_debug_flag = 'Y'
1981: THEN
1982: OE_DEBUG_PUB.Add('l_current_order_value = '|| l_current_order_value );
1983: OE_DEBUG_PUB.Add('x_total_exposure before add = '|| x_total_exposure );
1984: END IF;
1985:
1986: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1979:
1980: IF G_debug_flag = 'Y'
1981: THEN
1982: OE_DEBUG_PUB.Add('l_current_order_value = '|| l_current_order_value );
1983: OE_DEBUG_PUB.Add('x_total_exposure before add = '|| x_total_exposure );
1984: END IF;
1985:
1986: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1987: RAISE FND_API.G_EXC_ERROR;
1997: ELSE
1998: x_total_exposure := 0 ;
1999: x_return_status := FND_API.G_RET_STS_SUCCESS;
2000: IF G_debug_flag = 'Y' THEN
2001: OE_DEBUG_PUB.Add(' UNLIMITED overall credi '
2002: || p_overall_credit_limit );
2003: END IF;
2004: END IF;
2005:
2004: END IF;
2005:
2006: IF G_debug_flag = 'Y'
2007: THEN
2008: OE_DEBUG_PUB.Add('OEXVCRHB: x_total_exposure ' || x_total_exposure,1 );
2009: OE_DEBUG_PUB.Add('OEXVCRHB: p_overall_credit_limit '
2010: || p_overall_credit_limit,1 );
2011: OE_DEBUG_PUB.Add(' curr conv err count ' || l_conversion_status.COUNT );
2012: END IF;
2005:
2006: IF G_debug_flag = 'Y'
2007: THEN
2008: OE_DEBUG_PUB.Add('OEXVCRHB: x_total_exposure ' || x_total_exposure,1 );
2009: OE_DEBUG_PUB.Add('OEXVCRHB: p_overall_credit_limit '
2010: || p_overall_credit_limit,1 );
2011: OE_DEBUG_PUB.Add(' curr conv err count ' || l_conversion_status.COUNT );
2012: END IF;
2013:
2007: THEN
2008: OE_DEBUG_PUB.Add('OEXVCRHB: x_total_exposure ' || x_total_exposure,1 );
2009: OE_DEBUG_PUB.Add('OEXVCRHB: p_overall_credit_limit '
2010: || p_overall_credit_limit,1 );
2011: OE_DEBUG_PUB.Add(' curr conv err count ' || l_conversion_status.COUNT );
2012: END IF;
2013:
2014: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2015: RAISE FND_API.G_EXC_ERROR;
2019:
2020: IF NVL(l_conversion_status.COUNT,0) > 0
2021: THEN
2022: IF G_debug_flag = 'Y' THEN
2023: OE_DEBUG_PUB.Add(' Currency conversion error ');
2024: END IF;
2025: x_cc_result_out := 'FAIL';
2026:
2027:
2046: x_return_status := FND_API.G_RET_STS_ERROR;
2047:
2048: IF G_debug_flag = 'Y'
2049: THEN
2050: OE_DEBUG_PUB.Add(' Exposure CC Failed due to currency failure');
2051: OE_DEBUG_PUB.ADD('Return status after assigned as Error = '
2052: || x_return_status );
2053: END IF;
2054:
2047:
2048: IF G_debug_flag = 'Y'
2049: THEN
2050: OE_DEBUG_PUB.Add(' Exposure CC Failed due to currency failure');
2051: OE_DEBUG_PUB.ADD('Return status after assigned as Error = '
2052: || x_return_status );
2053: END IF;
2054:
2055: ELSE
2063: END IF;
2064:
2065: IF G_debug_flag = 'Y'
2066: THEN
2067: OE_DEBUG_PUB.Add(' x_cc_result_out = ' || x_cc_result_out );
2068: OE_DEBUG_PUB.Add('OEXVCRHB: Out Check_order_Exposure ');
2069: END IF;
2070:
2071: EXCEPTION
2064:
2065: IF G_debug_flag = 'Y'
2066: THEN
2067: OE_DEBUG_PUB.Add(' x_cc_result_out = ' || x_cc_result_out );
2068: OE_DEBUG_PUB.Add('OEXVCRHB: Out Check_order_Exposure ');
2069: END IF;
2070:
2071: EXCEPTION
2072: WHEN others THEN
2071: EXCEPTION
2072: WHEN others THEN
2073: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2074: IF G_debug_flag = 'Y' THEN
2075: OE_DEBUG_PUB.Add('Check_order_exposure: Other exceptions');
2076: END IF;
2077: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2078: OE_MSG_PUB.Add_Exc_Msg
2079: ( G_PKG_NAME
2081: );
2082: END IF;
2083: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2084: IF G_debug_flag = 'Y' THEN
2085: OE_DEBUG_PUB.Add( SUBSTR(SQLERRM,1,300) ) ;
2086: END IF;
2087: END Check_order_Exposure ;
2088:
2089: -----------------------------------------------------------
2121:
2122: BEGIN
2123: IF G_debug_flag = 'Y'
2124: THEN
2125: OE_DEBUG_PUB.Add('OEXVCRHB: In Check_Item_Limits');
2126: END IF;
2127: --
2128: -- Initialize return status to success
2129: x_return_status := FND_API.G_RET_STS_SUCCESS;
2150: THEN
2151: x_cc_result_out := 'NOCHECK';
2152: IF G_debug_flag = 'Y'
2153: THEN
2154: OE_DEBUG_PUB.Add(' Count of category table = 0 ');
2155: END IF;
2156: ELSE
2157: IF G_debug_flag = 'Y'
2158: THEN
2155: END IF;
2156: ELSE
2157: IF G_debug_flag = 'Y'
2158: THEN
2159: OE_DEBUG_PUB.Add(' start category LOOP ');
2160: OE_DEBUG_PUB.Add(' ===================== ');
2161: END IF;
2162:
2163: FOR i in 1..l_item_limits.count
2156: ELSE
2157: IF G_debug_flag = 'Y'
2158: THEN
2159: OE_DEBUG_PUB.Add(' start category LOOP ');
2160: OE_DEBUG_PUB.Add(' ===================== ');
2161: END IF;
2162:
2163: FOR i in 1..l_item_limits.count
2164: LOOP
2166: -- For each item category, sum the line values
2167:
2168: IF G_debug_flag = 'Y'
2169: THEN
2170: OE_DEBUG_PUB.ADD(' ');
2171: OE_DEBUG_PUB.Add(' ------------------------------------ ');
2172: OE_DEBUG_PUB.Add(' Category id = '
2173: || l_item_limits(i).item_category_id );
2174: OE_DEBUG_PUB.Add(' ctg_line_amount = '
2167:
2168: IF G_debug_flag = 'Y'
2169: THEN
2170: OE_DEBUG_PUB.ADD(' ');
2171: OE_DEBUG_PUB.Add(' ------------------------------------ ');
2172: OE_DEBUG_PUB.Add(' Category id = '
2173: || l_item_limits(i).item_category_id );
2174: OE_DEBUG_PUB.Add(' ctg_line_amount = '
2175: || l_item_limits(i).ctg_line_amount );
2168: IF G_debug_flag = 'Y'
2169: THEN
2170: OE_DEBUG_PUB.ADD(' ');
2171: OE_DEBUG_PUB.Add(' ------------------------------------ ');
2172: OE_DEBUG_PUB.Add(' Category id = '
2173: || l_item_limits(i).item_category_id );
2174: OE_DEBUG_PUB.Add(' ctg_line_amount = '
2175: || l_item_limits(i).ctg_line_amount );
2176: OE_DEBUG_PUB.Add(' limit_curr_code = '
2170: OE_DEBUG_PUB.ADD(' ');
2171: OE_DEBUG_PUB.Add(' ------------------------------------ ');
2172: OE_DEBUG_PUB.Add(' Category id = '
2173: || l_item_limits(i).item_category_id );
2174: OE_DEBUG_PUB.Add(' ctg_line_amount = '
2175: || l_item_limits(i).ctg_line_amount );
2176: OE_DEBUG_PUB.Add(' limit_curr_code = '
2177: || l_item_limits(i).limit_curr_code );
2178: OE_DEBUG_PUB.Add(' item_limit = '
2172: OE_DEBUG_PUB.Add(' Category id = '
2173: || l_item_limits(i).item_category_id );
2174: OE_DEBUG_PUB.Add(' ctg_line_amount = '
2175: || l_item_limits(i).ctg_line_amount );
2176: OE_DEBUG_PUB.Add(' limit_curr_code = '
2177: || l_item_limits(i).limit_curr_code );
2178: OE_DEBUG_PUB.Add(' item_limit = '
2179: || l_item_limits(i).item_limit );
2180: OE_DEBUG_PUB.Add(' grouping = '
2174: OE_DEBUG_PUB.Add(' ctg_line_amount = '
2175: || l_item_limits(i).ctg_line_amount );
2176: OE_DEBUG_PUB.Add(' limit_curr_code = '
2177: || l_item_limits(i).limit_curr_code );
2178: OE_DEBUG_PUB.Add(' item_limit = '
2179: || l_item_limits(i).item_limit );
2180: OE_DEBUG_PUB.Add(' grouping = '
2181: || l_item_limits(i).grouping_id );
2182: END IF;
2176: OE_DEBUG_PUB.Add(' limit_curr_code = '
2177: || l_item_limits(i).limit_curr_code );
2178: OE_DEBUG_PUB.Add(' item_limit = '
2179: || l_item_limits(i).item_limit );
2180: OE_DEBUG_PUB.Add(' grouping = '
2181: || l_item_limits(i).grouping_id );
2182: END IF;
2183:
2184: l_category_sum := l_item_limits(i).ctg_line_amount ;
2187: -- what to do when there is not limit
2188:
2189: IF G_debug_flag = 'Y'
2190: THEN
2191: OE_DEBUG_PUB.Add(' l_category_sum = ' || l_category_sum );
2192: OE_DEBUG_PUB.Add(' GL_CURRENCY = '||
2193: OE_Credit_Engine_GRP.GL_currency );
2194:
2195: OE_DEBUG_PUB.Add(' ------------------------------------ ');
2188:
2189: IF G_debug_flag = 'Y'
2190: THEN
2191: OE_DEBUG_PUB.Add(' l_category_sum = ' || l_category_sum );
2192: OE_DEBUG_PUB.Add(' GL_CURRENCY = '||
2193: OE_Credit_Engine_GRP.GL_currency );
2194:
2195: OE_DEBUG_PUB.Add(' ------------------------------------ ');
2196: OE_DEBUG_PUB.Add(' ');
2191: OE_DEBUG_PUB.Add(' l_category_sum = ' || l_category_sum );
2192: OE_DEBUG_PUB.Add(' GL_CURRENCY = '||
2193: OE_Credit_Engine_GRP.GL_currency );
2194:
2195: OE_DEBUG_PUB.Add(' ------------------------------------ ');
2196: OE_DEBUG_PUB.Add(' ');
2197: END IF;
2198:
2199: l_check_category_id := l_item_limits(i).item_category_id ;
2192: OE_DEBUG_PUB.Add(' GL_CURRENCY = '||
2193: OE_Credit_Engine_GRP.GL_currency );
2194:
2195: OE_DEBUG_PUB.Add(' ------------------------------------ ');
2196: OE_DEBUG_PUB.Add(' ');
2197: END IF;
2198:
2199: l_check_category_id := l_item_limits(i).item_category_id ;
2200: l_limit_curr := l_item_limits(i).limit_curr_code ;
2209: ) ;
2210:
2211: IF G_debug_flag = 'Y'
2212: THEN
2213: OE_DEBUG_PUB.Add(' l_limit_category_sum = ' || l_limit_category_sum );
2214: OE_DEBUG_PUB.Add(' item_limit = ' || l_item_limits(i).item_limit );
2215: END IF;
2216:
2217: IF l_limit_category_sum > l_item_limits(i).item_limit
2210:
2211: IF G_debug_flag = 'Y'
2212: THEN
2213: OE_DEBUG_PUB.Add(' l_limit_category_sum = ' || l_limit_category_sum );
2214: OE_DEBUG_PUB.Add(' item_limit = ' || l_item_limits(i).item_limit );
2215: END IF;
2216:
2217: IF l_limit_category_sum > l_item_limits(i).item_limit
2218: THEN
2217: IF l_limit_category_sum > l_item_limits(i).item_limit
2218: THEN
2219: IF G_debug_flag = 'Y'
2220: THEN
2221: OE_DEBUG_PUB.Add
2222: ('Fails item category ID: '|| l_item_limits(i).item_category_id);
2223: END IF;
2224: Apply_Order_CC_Hold
2225: ( p_header_id => p_header_rec.header_id
2246: END IF;
2247:
2248: IF G_debug_flag = 'Y'
2249: THEN
2250: OE_DEBUG_PUB.ADD('x_cc_result_out = '|| x_cc_result_out );
2251: OE_DEBUG_PUB.ADD('OEXVCRHB: Out Check_Item_Limit');
2252: END IF;
2253:
2254: EXCEPTION
2247:
2248: IF G_debug_flag = 'Y'
2249: THEN
2250: OE_DEBUG_PUB.ADD('x_cc_result_out = '|| x_cc_result_out );
2251: OE_DEBUG_PUB.ADD('OEXVCRHB: Out Check_Item_Limit');
2252: END IF;
2253:
2254: EXCEPTION
2255: WHEN GL_CURRENCY_API.NO_RATE
2255: WHEN GL_CURRENCY_API.NO_RATE
2256: THEN
2257: BEGIN
2258: IF G_debug_flag = 'Y' THEN
2259: OE_DEBUG_PUB.Add('EXCEPTION: GL_CURRENCY_API.NO_RATE ');
2260: OE_DEBUG_PUB.Add('Apply_Order_CC_Hold for Item category');
2261: OE_DEBUG_PUB.Add('currency = '|| p_header_rec.transactional_curr_code );
2262: OE_DEBUG_PUB.Add('checking category = '|| l_check_category_id );
2263: END IF;
2256: THEN
2257: BEGIN
2258: IF G_debug_flag = 'Y' THEN
2259: OE_DEBUG_PUB.Add('EXCEPTION: GL_CURRENCY_API.NO_RATE ');
2260: OE_DEBUG_PUB.Add('Apply_Order_CC_Hold for Item category');
2261: OE_DEBUG_PUB.Add('currency = '|| p_header_rec.transactional_curr_code );
2262: OE_DEBUG_PUB.Add('checking category = '|| l_check_category_id );
2263: END IF;
2264:
2257: BEGIN
2258: IF G_debug_flag = 'Y' THEN
2259: OE_DEBUG_PUB.Add('EXCEPTION: GL_CURRENCY_API.NO_RATE ');
2260: OE_DEBUG_PUB.Add('Apply_Order_CC_Hold for Item category');
2261: OE_DEBUG_PUB.Add('currency = '|| p_header_rec.transactional_curr_code );
2262: OE_DEBUG_PUB.Add('checking category = '|| l_check_category_id );
2263: END IF;
2264:
2265: fnd_message.set_name('ONT', 'OE_CC_CONVERSION_ERORR');
2258: IF G_debug_flag = 'Y' THEN
2259: OE_DEBUG_PUB.Add('EXCEPTION: GL_CURRENCY_API.NO_RATE ');
2260: OE_DEBUG_PUB.Add('Apply_Order_CC_Hold for Item category');
2261: OE_DEBUG_PUB.Add('currency = '|| p_header_rec.transactional_curr_code );
2262: OE_DEBUG_PUB.Add('checking category = '|| l_check_category_id );
2263: END IF;
2264:
2265: fnd_message.set_name('ONT', 'OE_CC_CONVERSION_ERORR');
2266: FND_MESSAGE.Set_Token('FROM',p_header_rec.transactional_curr_code);
2282: x_cc_result_out := 'FAIL';
2283: x_return_status := FND_API.G_RET_STS_ERROR;
2284:
2285: IF G_debug_flag = 'Y' THEN
2286: OE_DEBUG_PUB.Add(' Item CTG CC Failed due to currency failure');
2287: OE_DEBUG_PUB.ADD('Return status after assigned as Error = '
2288: || x_return_status );
2289: END IF;
2290: END;
2283: x_return_status := FND_API.G_RET_STS_ERROR;
2284:
2285: IF G_debug_flag = 'Y' THEN
2286: OE_DEBUG_PUB.Add(' Item CTG CC Failed due to currency failure');
2287: OE_DEBUG_PUB.ADD('Return status after assigned as Error = '
2288: || x_return_status );
2289: END IF;
2290: END;
2291:
2290: END;
2291:
2292: WHEN others THEN
2293: IF G_debug_flag = 'Y' THEN
2294: OE_DEBUG_PUB.Add('Check_Item_Limit: Other exceptions');
2295: END IF;
2296: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2297: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
2298: OE_MSG_PUB.Add_Exc_Msg
2300: , 'Check_Item_Limits'
2301: );
2302: END IF;
2303: IF G_debug_flag = 'Y' THEN
2304: OE_DEBUG_PUB.Add( SUBSTR(SQLERRM,1,300),1 ) ;
2305: END IF;
2306: END Check_Item_Limits;
2307:
2308: ------------------------------------------------------------
2406: BEGIN
2407:
2408: IF G_debug_flag = 'Y'
2409: THEN
2410: OE_DEBUG_PUB.Add('OEXVCRHB: In Check_Other_Credit Limits',1);
2411: END IF;
2412:
2413: --
2414: -- Set the default behavior to pass credit check
2423: l_cc_overall_result_out := 'PASS';
2424:
2425: IF G_debug_flag = 'Y'
2426: THEN
2427: OE_DEBUG_PUB.Add(' ');
2428: OE_DEBUG_PUB.Add('Calling action = '|| p_calling_action);
2429: OE_DEBUG_PUB.Add('p_customer_id = '|| p_customer_id);
2430: OE_DEBUG_PUB.Add('p_site_use_id = '|| p_site_use_id );
2431: OE_DEBUG_PUB.Add('p_party_id => '|| p_party_id );
2424:
2425: IF G_debug_flag = 'Y'
2426: THEN
2427: OE_DEBUG_PUB.Add(' ');
2428: OE_DEBUG_PUB.Add('Calling action = '|| p_calling_action);
2429: OE_DEBUG_PUB.Add('p_customer_id = '|| p_customer_id);
2430: OE_DEBUG_PUB.Add('p_site_use_id = '|| p_site_use_id );
2431: OE_DEBUG_PUB.Add('p_party_id => '|| p_party_id );
2432: OE_DEBUG_PUB.Add(' ');
2425: IF G_debug_flag = 'Y'
2426: THEN
2427: OE_DEBUG_PUB.Add(' ');
2428: OE_DEBUG_PUB.Add('Calling action = '|| p_calling_action);
2429: OE_DEBUG_PUB.Add('p_customer_id = '|| p_customer_id);
2430: OE_DEBUG_PUB.Add('p_site_use_id = '|| p_site_use_id );
2431: OE_DEBUG_PUB.Add('p_party_id => '|| p_party_id );
2432: OE_DEBUG_PUB.Add(' ');
2433: OE_DEBUG_PUB.Add('Calling Validate_other_credit_check');
2426: THEN
2427: OE_DEBUG_PUB.Add(' ');
2428: OE_DEBUG_PUB.Add('Calling action = '|| p_calling_action);
2429: OE_DEBUG_PUB.Add('p_customer_id = '|| p_customer_id);
2430: OE_DEBUG_PUB.Add('p_site_use_id = '|| p_site_use_id );
2431: OE_DEBUG_PUB.Add('p_party_id => '|| p_party_id );
2432: OE_DEBUG_PUB.Add(' ');
2433: OE_DEBUG_PUB.Add('Calling Validate_other_credit_check');
2434: END IF;
2427: OE_DEBUG_PUB.Add(' ');
2428: OE_DEBUG_PUB.Add('Calling action = '|| p_calling_action);
2429: OE_DEBUG_PUB.Add('p_customer_id = '|| p_customer_id);
2430: OE_DEBUG_PUB.Add('p_site_use_id = '|| p_site_use_id );
2431: OE_DEBUG_PUB.Add('p_party_id => '|| p_party_id );
2432: OE_DEBUG_PUB.Add(' ');
2433: OE_DEBUG_PUB.Add('Calling Validate_other_credit_check');
2434: END IF;
2435: --
2428: OE_DEBUG_PUB.Add('Calling action = '|| p_calling_action);
2429: OE_DEBUG_PUB.Add('p_customer_id = '|| p_customer_id);
2430: OE_DEBUG_PUB.Add('p_site_use_id = '|| p_site_use_id );
2431: OE_DEBUG_PUB.Add('p_party_id => '|| p_party_id );
2432: OE_DEBUG_PUB.Add(' ');
2433: OE_DEBUG_PUB.Add('Calling Validate_other_credit_check');
2434: END IF;
2435: --
2436: -----------------------------------------------------------
2429: OE_DEBUG_PUB.Add('p_customer_id = '|| p_customer_id);
2430: OE_DEBUG_PUB.Add('p_site_use_id = '|| p_site_use_id );
2431: OE_DEBUG_PUB.Add('p_party_id => '|| p_party_id );
2432: OE_DEBUG_PUB.Add(' ');
2433: OE_DEBUG_PUB.Add('Calling Validate_other_credit_check');
2434: END IF;
2435: --
2436: -----------------------------------------------------------
2437: -- Check if order site use needs credit check. Also |
2463:
2464: --ER 12363706 start
2465: IF p_credit_check_rule_rec.credit_hold_level_code = 'ORDER' THEN
2466: BEGIN
2467: OE_DEBUG_PUB.Add('slagiset: Retrieve the latest released Credit Profile ' || p_header_rec.header_id);
2468: --slagiset
2469: OPEN released_hold;
2470: FETCH released_hold INTO l_credit_profile_level;
2471: IF (released_hold%notfound) THEN
2468: --slagiset
2469: OPEN released_hold;
2470: FETCH released_hold INTO l_credit_profile_level;
2471: IF (released_hold%notfound) THEN
2472: oe_debug_pub.add('No Released record found');
2473: l_credit_profile_level := NULL;
2474: END IF;
2475: CLOSE released_hold;
2476: --slagiset
2475: CLOSE released_hold;
2476: --slagiset
2477: EXCEPTION
2478: WHEN OTHERS THEN
2479: oe_debug_pub.ADD('slagiset: In Exception block');
2480: l_credit_profile_level := NULL;
2481: END;
2482: END IF;
2483:
2482: END IF;
2483:
2484: FOR i IN 1 .. OE_CREDIT_CHECK_UTIL.G_CC_Invoice_tab.count
2485: LOOP
2486: OE_DEBUG_PUB.Add('Bill to site changed to: ' || OE_CREDIT_CHECK_UTIL.G_CC_Invoice_tab(i).new_invoice_to_org_id || ' from: ' || OE_CREDIT_CHECK_UTIL.G_CC_Invoice_tab(i).old_invoice_to_org_id);
2487: OE_DEBUG_PUB.Add('slagiset: x_credit_level ' || x_credit_level);
2488: OE_DEBUG_PUB.Add('slagiset: l_credit_profile_level ' || l_credit_profile_level);
2489: IF x_credit_level = 'CUSTOMER' AND l_credit_profile_level ='CUSTOMER' THEN
2490: SELECT acct_site.cust_account_id
2483:
2484: FOR i IN 1 .. OE_CREDIT_CHECK_UTIL.G_CC_Invoice_tab.count
2485: LOOP
2486: OE_DEBUG_PUB.Add('Bill to site changed to: ' || OE_CREDIT_CHECK_UTIL.G_CC_Invoice_tab(i).new_invoice_to_org_id || ' from: ' || OE_CREDIT_CHECK_UTIL.G_CC_Invoice_tab(i).old_invoice_to_org_id);
2487: OE_DEBUG_PUB.Add('slagiset: x_credit_level ' || x_credit_level);
2488: OE_DEBUG_PUB.Add('slagiset: l_credit_profile_level ' || l_credit_profile_level);
2489: IF x_credit_level = 'CUSTOMER' AND l_credit_profile_level ='CUSTOMER' THEN
2490: SELECT acct_site.cust_account_id
2491: INTO l_new_cust_account_id
2484: FOR i IN 1 .. OE_CREDIT_CHECK_UTIL.G_CC_Invoice_tab.count
2485: LOOP
2486: OE_DEBUG_PUB.Add('Bill to site changed to: ' || OE_CREDIT_CHECK_UTIL.G_CC_Invoice_tab(i).new_invoice_to_org_id || ' from: ' || OE_CREDIT_CHECK_UTIL.G_CC_Invoice_tab(i).old_invoice_to_org_id);
2487: OE_DEBUG_PUB.Add('slagiset: x_credit_level ' || x_credit_level);
2488: OE_DEBUG_PUB.Add('slagiset: l_credit_profile_level ' || l_credit_profile_level);
2489: IF x_credit_level = 'CUSTOMER' AND l_credit_profile_level ='CUSTOMER' THEN
2490: SELECT acct_site.cust_account_id
2491: INTO l_new_cust_account_id
2492: FROM HZ_CUST_SITE_USES_ALL SITE,
2508: AND SITE.CUST_ACCT_SITE_ID = ACCT_SITE.CUST_ACCT_SITE_ID
2509: AND ACCT_SITE.PARTY_SITE_ID = PARTY_SITE.PARTY_SITE_ID
2510: AND SITE.ORG_ID = ACCT_SITE.ORG_ID;
2511: IF l_new_cust_account_id <> l_old_cust_account_id THEN
2512: OE_DEBUG_PUB.Add('slagiset: Sites belong to the different customer and credit checking at Customer level. Tolerance check N ');
2513: l_tolerance_check := 'N';
2514: EXIT;
2515: ELSE
2516: OE_DEBUG_PUB.Add('slagiset: Sites belong to the same customer and credit checking at Customer level. Tolerance check Y ');
2512: OE_DEBUG_PUB.Add('slagiset: Sites belong to the different customer and credit checking at Customer level. Tolerance check N ');
2513: l_tolerance_check := 'N';
2514: EXIT;
2515: ELSE
2516: OE_DEBUG_PUB.Add('slagiset: Sites belong to the same customer and credit checking at Customer level. Tolerance check Y ');
2517: l_tolerance_check := 'Y';
2518: END IF;
2519: END IF;
2520: END LOOP;
2525: p_hold_id => 1 ,
2526: p_header_id => p_header_rec.header_id ,
2527: p_line_id => NULL ,
2528: p_credit_check_rule_rec=>p_credit_check_rule_rec) = 'Y' THEN
2529: oe_debug_pub.ADD('slagiset: l_tolerance_check ' || l_tolerance_check);
2530: IF OE_CREDIT_ENGINE_GRP.CREDIT_TOLERANCE_CHECK( p_header_id => p_header_rec.header_id) THEN
2531: RETURN;
2532: END IF;
2533: ELSE
2530: IF OE_CREDIT_ENGINE_GRP.CREDIT_TOLERANCE_CHECK( p_header_id => p_header_rec.header_id) THEN
2531: RETURN;
2532: END IF;
2533: ELSE
2534: oe_debug_pub.ADD('slagiset: No tolerance check is required. Since, there is no released hold for this order.');
2535: END IF;
2536: OE_CREDIT_CHECK_UTIL.G_CC_Invoice_tab.delete;
2537: --ER 12363706 end
2538: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2559: ----------------------------------------------------+
2560: -- order site use is subject to credit check: |
2561: ----------------------------------------------------|
2562: IF G_debug_flag = 'Y' THEN
2563: OE_DEBUG_PUB.Add('Calling Check Transaction Limit procedure');
2564: END IF;
2565:
2566: OE_credit_check_order_PVT.Check_Trx_Limit
2567: ( p_header_rec => p_header_rec
2579: , x_conversion_status => l_error_curr_tbl
2580: );
2581:
2582: IF G_debug_flag = 'Y' THEN
2583: OE_DEBUG_PUB.Add('Check_Trx_Limit: Result Out ='||l_cc_trx_result_out);
2584: OE_DEBUG_PUB.Add('Check_Trx_Limit: Return Status ='|| x_return_status );
2585: END IF;
2586:
2587: -- bug 4002820
2580: );
2581:
2582: IF G_debug_flag = 'Y' THEN
2583: OE_DEBUG_PUB.Add('Check_Trx_Limit: Result Out ='||l_cc_trx_result_out);
2584: OE_DEBUG_PUB.Add('Check_Trx_Limit: Return Status ='|| x_return_status );
2585: END IF;
2586:
2587: -- bug 4002820
2588: IF l_cc_trx_result_out = 'FAIL' THEN
2619:
2620: IF l_cc_trx_result_out = 'PASS'
2621: OR OE_CREDIT_CHECK_UTIL.G_crmgmt_installed = TRUE THEN
2622: IF G_debug_flag = 'Y' THEN
2623: OE_DEBUG_PUB.Add('Calling Check Past Due Invoice procedure');
2624: END IF;
2625:
2626: OE_credit_check_order_PVT.Chk_Past_Due_Invoice
2627: ( p_customer_id => p_customer_id
2637: , x_return_status => x_return_status
2638: );
2639:
2640: IF G_debug_flag = 'Y' THEN
2641: OE_DEBUG_PUB.Add('Chk_Duedate_Limit: Result Out ='|| l_cc_duedate_result_out );
2642: OE_DEBUG_PUB.Add('Chk_Duedate_Limit: Return Status ='|| x_return_status );
2643: END IF;
2644:
2645: -- bug 4002820
2638: );
2639:
2640: IF G_debug_flag = 'Y' THEN
2641: OE_DEBUG_PUB.Add('Chk_Duedate_Limit: Result Out ='|| l_cc_duedate_result_out );
2642: OE_DEBUG_PUB.Add('Chk_Duedate_Limit: Return Status ='|| x_return_status );
2643: END IF;
2644:
2645: -- bug 4002820
2646: IF l_cc_duedate_result_out = 'FAIL' THEN
2692:
2693: x_check_exposure_mode := 'INLINE';
2694:
2695: IF G_debug_flag = 'Y' THEN
2696: OE_DEBUG_PUB.Add('x_check_exposure_mode = '|| x_check_exposure_mode );
2697: OE_DEBUG_PUB.Add('Calling Check order Exposure procedure');
2698: END IF;
2699:
2700: OE_credit_check_order_PVT.Check_order_exposure
2693: x_check_exposure_mode := 'INLINE';
2694:
2695: IF G_debug_flag = 'Y' THEN
2696: OE_DEBUG_PUB.Add('x_check_exposure_mode = '|| x_check_exposure_mode );
2697: OE_DEBUG_PUB.Add('Calling Check order Exposure procedure');
2698: END IF;
2699:
2700: OE_credit_check_order_PVT.Check_order_exposure
2701: ( p_customer_id => p_customer_id
2722: , x_return_status => x_return_status
2723: );
2724:
2725: IF G_debug_flag = 'Y' THEN
2726: OE_DEBUG_PUB.Add('After call to Check_order_exposure ');
2727: OE_DEBUG_PUB.Add('l_cc_result_out = ' || l_cc_result_out );
2728: OE_DEBUG_PUB.Add('total exposure = ' || l_total_exposure );
2729: OE_DEBUG_PUB.Add('x_return_status = ' || x_return_status );
2730: OE_DEBUG_PUB.Add(' Credit Rule Id = '
2723: );
2724:
2725: IF G_debug_flag = 'Y' THEN
2726: OE_DEBUG_PUB.Add('After call to Check_order_exposure ');
2727: OE_DEBUG_PUB.Add('l_cc_result_out = ' || l_cc_result_out );
2728: OE_DEBUG_PUB.Add('total exposure = ' || l_total_exposure );
2729: OE_DEBUG_PUB.Add('x_return_status = ' || x_return_status );
2730: OE_DEBUG_PUB.Add(' Credit Rule Id = '
2731: ||to_char(p_credit_check_rule_rec.credit_check_rule_id));
2724:
2725: IF G_debug_flag = 'Y' THEN
2726: OE_DEBUG_PUB.Add('After call to Check_order_exposure ');
2727: OE_DEBUG_PUB.Add('l_cc_result_out = ' || l_cc_result_out );
2728: OE_DEBUG_PUB.Add('total exposure = ' || l_total_exposure );
2729: OE_DEBUG_PUB.Add('x_return_status = ' || x_return_status );
2730: OE_DEBUG_PUB.Add(' Credit Rule Id = '
2731: ||to_char(p_credit_check_rule_rec.credit_check_rule_id));
2732: END IF;
2725: IF G_debug_flag = 'Y' THEN
2726: OE_DEBUG_PUB.Add('After call to Check_order_exposure ');
2727: OE_DEBUG_PUB.Add('l_cc_result_out = ' || l_cc_result_out );
2728: OE_DEBUG_PUB.Add('total exposure = ' || l_total_exposure );
2729: OE_DEBUG_PUB.Add('x_return_status = ' || x_return_status );
2730: OE_DEBUG_PUB.Add(' Credit Rule Id = '
2731: ||to_char(p_credit_check_rule_rec.credit_check_rule_id));
2732: END IF;
2733: --Bug 4320650
2726: OE_DEBUG_PUB.Add('After call to Check_order_exposure ');
2727: OE_DEBUG_PUB.Add('l_cc_result_out = ' || l_cc_result_out );
2728: OE_DEBUG_PUB.Add('total exposure = ' || l_total_exposure );
2729: OE_DEBUG_PUB.Add('x_return_status = ' || x_return_status );
2730: OE_DEBUG_PUB.Add(' Credit Rule Id = '
2731: ||to_char(p_credit_check_rule_rec.credit_check_rule_id));
2732: END IF;
2733: --Bug 4320650
2734: l_unrounded_exposure := l_total_exposure;
2799: l_cc_limit_used := 'TRX';
2800: END IF;
2801: ELSE
2802: IF G_debug_flag = 'Y' THEN
2803: OE_DEBUG_PUB.Add('No credit check required');
2804: END IF;
2805: l_cc_result_out := 'NOCHECK';
2806: END IF;
2807: --
2814:
2815: IF G_debug_flag = 'Y'
2816: THEN
2817:
2818: OE_DEBUG_PUB.Add(' OEXVCRHB: l_cc_limit_used ==> '|| l_cc_limit_used );
2819: OE_DEBUG_PUB.Add(' before l_cc_result_out => '|| l_cc_result_out );
2820:
2821: OE_DEBUG_PUB.add(' g_current_order_value => '||
2822: OE_CREDIT_CHECK_UTIL.g_current_order_value );
2815: IF G_debug_flag = 'Y'
2816: THEN
2817:
2818: OE_DEBUG_PUB.Add(' OEXVCRHB: l_cc_limit_used ==> '|| l_cc_limit_used );
2819: OE_DEBUG_PUB.Add(' before l_cc_result_out => '|| l_cc_result_out );
2820:
2821: OE_DEBUG_PUB.add(' g_current_order_value => '||
2822: OE_CREDIT_CHECK_UTIL.g_current_order_value );
2823:
2817:
2818: OE_DEBUG_PUB.Add(' OEXVCRHB: l_cc_limit_used ==> '|| l_cc_limit_used );
2819: OE_DEBUG_PUB.Add(' before l_cc_result_out => '|| l_cc_result_out );
2820:
2821: OE_DEBUG_PUB.add(' g_current_order_value => '||
2822: OE_CREDIT_CHECK_UTIL.g_current_order_value );
2823:
2824: OE_DEBUG_PUB.Add('before g_order ==> ' || g_order );
2825: END IF;
2820:
2821: OE_DEBUG_PUB.add(' g_current_order_value => '||
2822: OE_CREDIT_CHECK_UTIL.g_current_order_value );
2823:
2824: OE_DEBUG_PUB.Add('before g_order ==> ' || g_order );
2825: END IF;
2826:
2827: -- IF NVL(g_order,0) = 0
2828: IF (OE_OE_FORM_CANCEL_LINE.g_ord_lvl_can) --bug 3944617
2840:
2841:
2842: IF G_debug_flag = 'Y'
2843: THEN
2844: OE_DEBUG_PUB.Add('after l_cc_result_out => '|| l_cc_result_out );
2845: OE_DEBUG_PUB.Add('after g_order ==> ' || g_order );
2846: END IF;
2847:
2848: IF l_cc_result_out = 'FAIL' THEN
2841:
2842: IF G_debug_flag = 'Y'
2843: THEN
2844: OE_DEBUG_PUB.Add('after l_cc_result_out => '|| l_cc_result_out );
2845: OE_DEBUG_PUB.Add('after g_order ==> ' || g_order );
2846: END IF;
2847:
2848: IF l_cc_result_out = 'FAIL' THEN
2849: IF NVL(p_calling_action,'BOOKING') <> 'EXTERNAL' THEN
2847:
2848: IF l_cc_result_out = 'FAIL' THEN
2849: IF NVL(p_calling_action,'BOOKING') <> 'EXTERNAL' THEN
2850: IF G_debug_flag = 'Y' THEN
2851: OE_DEBUG_PUB.Add('Calling Apply_Order_CC_Hold ');
2852: END IF;
2853:
2854: -- bug 4153299
2855: -- 6616741 l_cc_profile_used := OE_CREDIT_CHECK_UTIL.Get_CC_Lookup_Meaning('OE_CC_PROFILE', l_cc_profile_used);
2918: := FND_PROFILE.VALUE('SECURITY_GROUP_ID');
2919:
2920: IF G_debug_flag = 'Y'
2921: THEN
2922: OE_DEBUG_PUB.Add('Calling Create_credit_request,
2923: credit check level= '||x_credit_level);
2924:
2925: OE_DEBUG_PUB.Add('Parameters: ');
2926: OE_DEBUG_PUB.Add('-------------------------------------------');
2921: THEN
2922: OE_DEBUG_PUB.Add('Calling Create_credit_request,
2923: credit check level= '||x_credit_level);
2924:
2925: OE_DEBUG_PUB.Add('Parameters: ');
2926: OE_DEBUG_PUB.Add('-------------------------------------------');
2927: OE_DEBUG_PUB.Add('p_requestor_id= '||TO_CHAR(fnd_global.employee_id));
2928: OE_DEBUG_PUB.Add('p_review_type= ORDER_HOLD');
2929: OE_DEBUG_PUB.Add('p_credit_classification= NULL');
2922: OE_DEBUG_PUB.Add('Calling Create_credit_request,
2923: credit check level= '||x_credit_level);
2924:
2925: OE_DEBUG_PUB.Add('Parameters: ');
2926: OE_DEBUG_PUB.Add('-------------------------------------------');
2927: OE_DEBUG_PUB.Add('p_requestor_id= '||TO_CHAR(fnd_global.employee_id));
2928: OE_DEBUG_PUB.Add('p_review_type= ORDER_HOLD');
2929: OE_DEBUG_PUB.Add('p_credit_classification= NULL');
2930: OE_DEBUG_PUB.Add('p_requested_amount= '||TO_CHAR(l_total_exposure ));
2923: credit check level= '||x_credit_level);
2924:
2925: OE_DEBUG_PUB.Add('Parameters: ');
2926: OE_DEBUG_PUB.Add('-------------------------------------------');
2927: OE_DEBUG_PUB.Add('p_requestor_id= '||TO_CHAR(fnd_global.employee_id));
2928: OE_DEBUG_PUB.Add('p_review_type= ORDER_HOLD');
2929: OE_DEBUG_PUB.Add('p_credit_classification= NULL');
2930: OE_DEBUG_PUB.Add('p_requested_amount= '||TO_CHAR(l_total_exposure ));
2931: OE_DEBUG_PUB.Add('p_requested_currency= '||l_limit_curr_code);
2924:
2925: OE_DEBUG_PUB.Add('Parameters: ');
2926: OE_DEBUG_PUB.Add('-------------------------------------------');
2927: OE_DEBUG_PUB.Add('p_requestor_id= '||TO_CHAR(fnd_global.employee_id));
2928: OE_DEBUG_PUB.Add('p_review_type= ORDER_HOLD');
2929: OE_DEBUG_PUB.Add('p_credit_classification= NULL');
2930: OE_DEBUG_PUB.Add('p_requested_amount= '||TO_CHAR(l_total_exposure ));
2931: OE_DEBUG_PUB.Add('p_requested_currency= '||l_limit_curr_code);
2932: OE_DEBUG_PUB.Add('p_trx_amount= '||TO_CHAR(g_order));
2925: OE_DEBUG_PUB.Add('Parameters: ');
2926: OE_DEBUG_PUB.Add('-------------------------------------------');
2927: OE_DEBUG_PUB.Add('p_requestor_id= '||TO_CHAR(fnd_global.employee_id));
2928: OE_DEBUG_PUB.Add('p_review_type= ORDER_HOLD');
2929: OE_DEBUG_PUB.Add('p_credit_classification= NULL');
2930: OE_DEBUG_PUB.Add('p_requested_amount= '||TO_CHAR(l_total_exposure ));
2931: OE_DEBUG_PUB.Add('p_requested_currency= '||l_limit_curr_code);
2932: OE_DEBUG_PUB.Add('p_trx_amount= '||TO_CHAR(g_order));
2933: OE_DEBUG_PUB.Add('p_trx_currency= '||p_header_rec.transactional_curr_code );
2926: OE_DEBUG_PUB.Add('-------------------------------------------');
2927: OE_DEBUG_PUB.Add('p_requestor_id= '||TO_CHAR(fnd_global.employee_id));
2928: OE_DEBUG_PUB.Add('p_review_type= ORDER_HOLD');
2929: OE_DEBUG_PUB.Add('p_credit_classification= NULL');
2930: OE_DEBUG_PUB.Add('p_requested_amount= '||TO_CHAR(l_total_exposure ));
2931: OE_DEBUG_PUB.Add('p_requested_currency= '||l_limit_curr_code);
2932: OE_DEBUG_PUB.Add('p_trx_amount= '||TO_CHAR(g_order));
2933: OE_DEBUG_PUB.Add('p_trx_currency= '||p_header_rec.transactional_curr_code );
2934: OE_DEBUG_PUB.Add('p_credit_type = TRADE' );
2927: OE_DEBUG_PUB.Add('p_requestor_id= '||TO_CHAR(fnd_global.employee_id));
2928: OE_DEBUG_PUB.Add('p_review_type= ORDER_HOLD');
2929: OE_DEBUG_PUB.Add('p_credit_classification= NULL');
2930: OE_DEBUG_PUB.Add('p_requested_amount= '||TO_CHAR(l_total_exposure ));
2931: OE_DEBUG_PUB.Add('p_requested_currency= '||l_limit_curr_code);
2932: OE_DEBUG_PUB.Add('p_trx_amount= '||TO_CHAR(g_order));
2933: OE_DEBUG_PUB.Add('p_trx_currency= '||p_header_rec.transactional_curr_code );
2934: OE_DEBUG_PUB.Add('p_credit_type = TRADE' );
2935: OE_DEBUG_PUB.Add('p_term_length = NULL' );
2928: OE_DEBUG_PUB.Add('p_review_type= ORDER_HOLD');
2929: OE_DEBUG_PUB.Add('p_credit_classification= NULL');
2930: OE_DEBUG_PUB.Add('p_requested_amount= '||TO_CHAR(l_total_exposure ));
2931: OE_DEBUG_PUB.Add('p_requested_currency= '||l_limit_curr_code);
2932: OE_DEBUG_PUB.Add('p_trx_amount= '||TO_CHAR(g_order));
2933: OE_DEBUG_PUB.Add('p_trx_currency= '||p_header_rec.transactional_curr_code );
2934: OE_DEBUG_PUB.Add('p_credit_type = TRADE' );
2935: OE_DEBUG_PUB.Add('p_term_length = NULL' );
2936: OE_DEBUG_PUB.Add('p_credit_check_rule_id= '||
2929: OE_DEBUG_PUB.Add('p_credit_classification= NULL');
2930: OE_DEBUG_PUB.Add('p_requested_amount= '||TO_CHAR(l_total_exposure ));
2931: OE_DEBUG_PUB.Add('p_requested_currency= '||l_limit_curr_code);
2932: OE_DEBUG_PUB.Add('p_trx_amount= '||TO_CHAR(g_order));
2933: OE_DEBUG_PUB.Add('p_trx_currency= '||p_header_rec.transactional_curr_code );
2934: OE_DEBUG_PUB.Add('p_credit_type = TRADE' );
2935: OE_DEBUG_PUB.Add('p_term_length = NULL' );
2936: OE_DEBUG_PUB.Add('p_credit_check_rule_id= '||
2937: TO_CHAR(p_credit_check_rule_rec.credit_check_rule_id));
2930: OE_DEBUG_PUB.Add('p_requested_amount= '||TO_CHAR(l_total_exposure ));
2931: OE_DEBUG_PUB.Add('p_requested_currency= '||l_limit_curr_code);
2932: OE_DEBUG_PUB.Add('p_trx_amount= '||TO_CHAR(g_order));
2933: OE_DEBUG_PUB.Add('p_trx_currency= '||p_header_rec.transactional_curr_code );
2934: OE_DEBUG_PUB.Add('p_credit_type = TRADE' );
2935: OE_DEBUG_PUB.Add('p_term_length = NULL' );
2936: OE_DEBUG_PUB.Add('p_credit_check_rule_id= '||
2937: TO_CHAR(p_credit_check_rule_rec.credit_check_rule_id));
2938: OE_DEBUG_PUB.Add('p_credit_request_status = SUBMIT');
2931: OE_DEBUG_PUB.Add('p_requested_currency= '||l_limit_curr_code);
2932: OE_DEBUG_PUB.Add('p_trx_amount= '||TO_CHAR(g_order));
2933: OE_DEBUG_PUB.Add('p_trx_currency= '||p_header_rec.transactional_curr_code );
2934: OE_DEBUG_PUB.Add('p_credit_type = TRADE' );
2935: OE_DEBUG_PUB.Add('p_term_length = NULL' );
2936: OE_DEBUG_PUB.Add('p_credit_check_rule_id= '||
2937: TO_CHAR(p_credit_check_rule_rec.credit_check_rule_id));
2938: OE_DEBUG_PUB.Add('p_credit_request_status = SUBMIT');
2939: OE_DEBUG_PUB.Add('p_party_id= '||TO_CHAR(p_party_id));
2932: OE_DEBUG_PUB.Add('p_trx_amount= '||TO_CHAR(g_order));
2933: OE_DEBUG_PUB.Add('p_trx_currency= '||p_header_rec.transactional_curr_code );
2934: OE_DEBUG_PUB.Add('p_credit_type = TRADE' );
2935: OE_DEBUG_PUB.Add('p_term_length = NULL' );
2936: OE_DEBUG_PUB.Add('p_credit_check_rule_id= '||
2937: TO_CHAR(p_credit_check_rule_rec.credit_check_rule_id));
2938: OE_DEBUG_PUB.Add('p_credit_request_status = SUBMIT');
2939: OE_DEBUG_PUB.Add('p_party_id= '||TO_CHAR(p_party_id));
2940: OE_DEBUG_PUB.Add('p_cust_account_id= '||TO_CHAR(l_customer_id));
2934: OE_DEBUG_PUB.Add('p_credit_type = TRADE' );
2935: OE_DEBUG_PUB.Add('p_term_length = NULL' );
2936: OE_DEBUG_PUB.Add('p_credit_check_rule_id= '||
2937: TO_CHAR(p_credit_check_rule_rec.credit_check_rule_id));
2938: OE_DEBUG_PUB.Add('p_credit_request_status = SUBMIT');
2939: OE_DEBUG_PUB.Add('p_party_id= '||TO_CHAR(p_party_id));
2940: OE_DEBUG_PUB.Add('p_cust_account_id= '||TO_CHAR(l_customer_id));
2941: OE_DEBUG_PUB.Add('p_cust_acct_site_id = NULL');
2942: OE_DEBUG_PUB.Add('p_site_use_id= '||TO_CHAR(l_site_use_id));
2935: OE_DEBUG_PUB.Add('p_term_length = NULL' );
2936: OE_DEBUG_PUB.Add('p_credit_check_rule_id= '||
2937: TO_CHAR(p_credit_check_rule_rec.credit_check_rule_id));
2938: OE_DEBUG_PUB.Add('p_credit_request_status = SUBMIT');
2939: OE_DEBUG_PUB.Add('p_party_id= '||TO_CHAR(p_party_id));
2940: OE_DEBUG_PUB.Add('p_cust_account_id= '||TO_CHAR(l_customer_id));
2941: OE_DEBUG_PUB.Add('p_cust_acct_site_id = NULL');
2942: OE_DEBUG_PUB.Add('p_site_use_id= '||TO_CHAR(l_site_use_id));
2943: OE_DEBUG_PUB.Add('p_contact_party_id = NULL');
2936: OE_DEBUG_PUB.Add('p_credit_check_rule_id= '||
2937: TO_CHAR(p_credit_check_rule_rec.credit_check_rule_id));
2938: OE_DEBUG_PUB.Add('p_credit_request_status = SUBMIT');
2939: OE_DEBUG_PUB.Add('p_party_id= '||TO_CHAR(p_party_id));
2940: OE_DEBUG_PUB.Add('p_cust_account_id= '||TO_CHAR(l_customer_id));
2941: OE_DEBUG_PUB.Add('p_cust_acct_site_id = NULL');
2942: OE_DEBUG_PUB.Add('p_site_use_id= '||TO_CHAR(l_site_use_id));
2943: OE_DEBUG_PUB.Add('p_contact_party_id = NULL');
2944: OE_DEBUG_PUB.Add('p_notes = NULL');
2937: TO_CHAR(p_credit_check_rule_rec.credit_check_rule_id));
2938: OE_DEBUG_PUB.Add('p_credit_request_status = SUBMIT');
2939: OE_DEBUG_PUB.Add('p_party_id= '||TO_CHAR(p_party_id));
2940: OE_DEBUG_PUB.Add('p_cust_account_id= '||TO_CHAR(l_customer_id));
2941: OE_DEBUG_PUB.Add('p_cust_acct_site_id = NULL');
2942: OE_DEBUG_PUB.Add('p_site_use_id= '||TO_CHAR(l_site_use_id));
2943: OE_DEBUG_PUB.Add('p_contact_party_id = NULL');
2944: OE_DEBUG_PUB.Add('p_notes = NULL');
2945: OE_DEBUG_PUB.Add('p_source_org_id= '||TO_CHAR(l_source_org_id));
2938: OE_DEBUG_PUB.Add('p_credit_request_status = SUBMIT');
2939: OE_DEBUG_PUB.Add('p_party_id= '||TO_CHAR(p_party_id));
2940: OE_DEBUG_PUB.Add('p_cust_account_id= '||TO_CHAR(l_customer_id));
2941: OE_DEBUG_PUB.Add('p_cust_acct_site_id = NULL');
2942: OE_DEBUG_PUB.Add('p_site_use_id= '||TO_CHAR(l_site_use_id));
2943: OE_DEBUG_PUB.Add('p_contact_party_id = NULL');
2944: OE_DEBUG_PUB.Add('p_notes = NULL');
2945: OE_DEBUG_PUB.Add('p_source_org_id= '||TO_CHAR(l_source_org_id));
2946: OE_DEBUG_PUB.Add('p_source_user_id= '||TO_CHAR(l_source_user_id));
2939: OE_DEBUG_PUB.Add('p_party_id= '||TO_CHAR(p_party_id));
2940: OE_DEBUG_PUB.Add('p_cust_account_id= '||TO_CHAR(l_customer_id));
2941: OE_DEBUG_PUB.Add('p_cust_acct_site_id = NULL');
2942: OE_DEBUG_PUB.Add('p_site_use_id= '||TO_CHAR(l_site_use_id));
2943: OE_DEBUG_PUB.Add('p_contact_party_id = NULL');
2944: OE_DEBUG_PUB.Add('p_notes = NULL');
2945: OE_DEBUG_PUB.Add('p_source_org_id= '||TO_CHAR(l_source_org_id));
2946: OE_DEBUG_PUB.Add('p_source_user_id= '||TO_CHAR(l_source_user_id));
2947: OE_DEBUG_PUB.Add('p_source_resp_id= '||TO_CHAR(l_source_resp_id));
2940: OE_DEBUG_PUB.Add('p_cust_account_id= '||TO_CHAR(l_customer_id));
2941: OE_DEBUG_PUB.Add('p_cust_acct_site_id = NULL');
2942: OE_DEBUG_PUB.Add('p_site_use_id= '||TO_CHAR(l_site_use_id));
2943: OE_DEBUG_PUB.Add('p_contact_party_id = NULL');
2944: OE_DEBUG_PUB.Add('p_notes = NULL');
2945: OE_DEBUG_PUB.Add('p_source_org_id= '||TO_CHAR(l_source_org_id));
2946: OE_DEBUG_PUB.Add('p_source_user_id= '||TO_CHAR(l_source_user_id));
2947: OE_DEBUG_PUB.Add('p_source_resp_id= '||TO_CHAR(l_source_resp_id));
2948: OE_DEBUG_PUB.Add('p_source_appln_id= '||TO_CHAR(l_source_appln_id));
2941: OE_DEBUG_PUB.Add('p_cust_acct_site_id = NULL');
2942: OE_DEBUG_PUB.Add('p_site_use_id= '||TO_CHAR(l_site_use_id));
2943: OE_DEBUG_PUB.Add('p_contact_party_id = NULL');
2944: OE_DEBUG_PUB.Add('p_notes = NULL');
2945: OE_DEBUG_PUB.Add('p_source_org_id= '||TO_CHAR(l_source_org_id));
2946: OE_DEBUG_PUB.Add('p_source_user_id= '||TO_CHAR(l_source_user_id));
2947: OE_DEBUG_PUB.Add('p_source_resp_id= '||TO_CHAR(l_source_resp_id));
2948: OE_DEBUG_PUB.Add('p_source_appln_id= '||TO_CHAR(l_source_appln_id));
2949: OE_DEBUG_PUB.Add('p_source_security_group_id= '||TO_CHAR(l_source_security_group_id));
2942: OE_DEBUG_PUB.Add('p_site_use_id= '||TO_CHAR(l_site_use_id));
2943: OE_DEBUG_PUB.Add('p_contact_party_id = NULL');
2944: OE_DEBUG_PUB.Add('p_notes = NULL');
2945: OE_DEBUG_PUB.Add('p_source_org_id= '||TO_CHAR(l_source_org_id));
2946: OE_DEBUG_PUB.Add('p_source_user_id= '||TO_CHAR(l_source_user_id));
2947: OE_DEBUG_PUB.Add('p_source_resp_id= '||TO_CHAR(l_source_resp_id));
2948: OE_DEBUG_PUB.Add('p_source_appln_id= '||TO_CHAR(l_source_appln_id));
2949: OE_DEBUG_PUB.Add('p_source_security_group_id= '||TO_CHAR(l_source_security_group_id));
2950: OE_DEBUG_PUB.Add('p_source_name = OM');
2943: OE_DEBUG_PUB.Add('p_contact_party_id = NULL');
2944: OE_DEBUG_PUB.Add('p_notes = NULL');
2945: OE_DEBUG_PUB.Add('p_source_org_id= '||TO_CHAR(l_source_org_id));
2946: OE_DEBUG_PUB.Add('p_source_user_id= '||TO_CHAR(l_source_user_id));
2947: OE_DEBUG_PUB.Add('p_source_resp_id= '||TO_CHAR(l_source_resp_id));
2948: OE_DEBUG_PUB.Add('p_source_appln_id= '||TO_CHAR(l_source_appln_id));
2949: OE_DEBUG_PUB.Add('p_source_security_group_id= '||TO_CHAR(l_source_security_group_id));
2950: OE_DEBUG_PUB.Add('p_source_name = OM');
2951: OE_DEBUG_PUB.Add('p_source_column1 = header_id= '||
2944: OE_DEBUG_PUB.Add('p_notes = NULL');
2945: OE_DEBUG_PUB.Add('p_source_org_id= '||TO_CHAR(l_source_org_id));
2946: OE_DEBUG_PUB.Add('p_source_user_id= '||TO_CHAR(l_source_user_id));
2947: OE_DEBUG_PUB.Add('p_source_resp_id= '||TO_CHAR(l_source_resp_id));
2948: OE_DEBUG_PUB.Add('p_source_appln_id= '||TO_CHAR(l_source_appln_id));
2949: OE_DEBUG_PUB.Add('p_source_security_group_id= '||TO_CHAR(l_source_security_group_id));
2950: OE_DEBUG_PUB.Add('p_source_name = OM');
2951: OE_DEBUG_PUB.Add('p_source_column1 = header_id= '||
2952: TO_CHAR(p_header_rec.header_id));
2945: OE_DEBUG_PUB.Add('p_source_org_id= '||TO_CHAR(l_source_org_id));
2946: OE_DEBUG_PUB.Add('p_source_user_id= '||TO_CHAR(l_source_user_id));
2947: OE_DEBUG_PUB.Add('p_source_resp_id= '||TO_CHAR(l_source_resp_id));
2948: OE_DEBUG_PUB.Add('p_source_appln_id= '||TO_CHAR(l_source_appln_id));
2949: OE_DEBUG_PUB.Add('p_source_security_group_id= '||TO_CHAR(l_source_security_group_id));
2950: OE_DEBUG_PUB.Add('p_source_name = OM');
2951: OE_DEBUG_PUB.Add('p_source_column1 = header_id= '||
2952: TO_CHAR(p_header_rec.header_id));
2953: OE_DEBUG_PUB.Add('p_source_column2 = order_number= '||
2946: OE_DEBUG_PUB.Add('p_source_user_id= '||TO_CHAR(l_source_user_id));
2947: OE_DEBUG_PUB.Add('p_source_resp_id= '||TO_CHAR(l_source_resp_id));
2948: OE_DEBUG_PUB.Add('p_source_appln_id= '||TO_CHAR(l_source_appln_id));
2949: OE_DEBUG_PUB.Add('p_source_security_group_id= '||TO_CHAR(l_source_security_group_id));
2950: OE_DEBUG_PUB.Add('p_source_name = OM');
2951: OE_DEBUG_PUB.Add('p_source_column1 = header_id= '||
2952: TO_CHAR(p_header_rec.header_id));
2953: OE_DEBUG_PUB.Add('p_source_column2 = order_number= '||
2954: TO_CHAR(p_header_rec.order_number));
2947: OE_DEBUG_PUB.Add('p_source_resp_id= '||TO_CHAR(l_source_resp_id));
2948: OE_DEBUG_PUB.Add('p_source_appln_id= '||TO_CHAR(l_source_appln_id));
2949: OE_DEBUG_PUB.Add('p_source_security_group_id= '||TO_CHAR(l_source_security_group_id));
2950: OE_DEBUG_PUB.Add('p_source_name = OM');
2951: OE_DEBUG_PUB.Add('p_source_column1 = header_id= '||
2952: TO_CHAR(p_header_rec.header_id));
2953: OE_DEBUG_PUB.Add('p_source_column2 = order_number= '||
2954: TO_CHAR(p_header_rec.order_number));
2955: OE_DEBUG_PUB.Add('p_source_column3= ORDER');
2949: OE_DEBUG_PUB.Add('p_source_security_group_id= '||TO_CHAR(l_source_security_group_id));
2950: OE_DEBUG_PUB.Add('p_source_name = OM');
2951: OE_DEBUG_PUB.Add('p_source_column1 = header_id= '||
2952: TO_CHAR(p_header_rec.header_id));
2953: OE_DEBUG_PUB.Add('p_source_column2 = order_number= '||
2954: TO_CHAR(p_header_rec.order_number));
2955: OE_DEBUG_PUB.Add('p_source_column3= ORDER');
2956:
2957: END IF;
2951: OE_DEBUG_PUB.Add('p_source_column1 = header_id= '||
2952: TO_CHAR(p_header_rec.header_id));
2953: OE_DEBUG_PUB.Add('p_source_column2 = order_number= '||
2954: TO_CHAR(p_header_rec.order_number));
2955: OE_DEBUG_PUB.Add('p_source_column3= ORDER');
2956:
2957: END IF;
2958: ----------------Submit Credit Review--------------------
2959: AR_CMGT_CREDIT_REQUEST_API.Create_credit_request
3011: THEN
3012: IF x_return_status='S'
3013: THEN
3014:
3015: OE_DEBUG_PUB.Add('Credit review submitted, request_id= '
3016: ||TO_CHAR(l_request_id));
3017: ELSE
3018: OE_DEBUG_PUB.Add('Credit review has not been submitted');
3019: END IF;
3014:
3015: OE_DEBUG_PUB.Add('Credit review submitted, request_id= '
3016: ||TO_CHAR(l_request_id));
3017: ELSE
3018: OE_DEBUG_PUB.Add('Credit review has not been submitted');
3019: END IF;
3020: END IF;
3021:
3022: OE_DEBUG_PUB.Add('l_request_id= '||TO_CHAR(l_request_id));
3018: OE_DEBUG_PUB.Add('Credit review has not been submitted');
3019: END IF;
3020: END IF;
3021:
3022: OE_DEBUG_PUB.Add('l_request_id= '||TO_CHAR(l_request_id));
3023: OE_DEBUG_PUB.Add('x_return_status= '||x_return_status);
3024: OE_DEBUG_PUB.Add('l_msg_count= '||TO_CHAR(l_msg_count));
3025: OE_DEBUG_PUB.Add('l_msg_data= '||l_msg_data);
3026:
3019: END IF;
3020: END IF;
3021:
3022: OE_DEBUG_PUB.Add('l_request_id= '||TO_CHAR(l_request_id));
3023: OE_DEBUG_PUB.Add('x_return_status= '||x_return_status);
3024: OE_DEBUG_PUB.Add('l_msg_count= '||TO_CHAR(l_msg_count));
3025: OE_DEBUG_PUB.Add('l_msg_data= '||l_msg_data);
3026:
3027:
3020: END IF;
3021:
3022: OE_DEBUG_PUB.Add('l_request_id= '||TO_CHAR(l_request_id));
3023: OE_DEBUG_PUB.Add('x_return_status= '||x_return_status);
3024: OE_DEBUG_PUB.Add('l_msg_count= '||TO_CHAR(l_msg_count));
3025: OE_DEBUG_PUB.Add('l_msg_data= '||l_msg_data);
3026:
3027:
3028: END IF;
3021:
3022: OE_DEBUG_PUB.Add('l_request_id= '||TO_CHAR(l_request_id));
3023: OE_DEBUG_PUB.Add('x_return_status= '||x_return_status);
3024: OE_DEBUG_PUB.Add('l_msg_count= '||TO_CHAR(l_msg_count));
3025: OE_DEBUG_PUB.Add('l_msg_data= '||l_msg_data);
3026:
3027:
3028: END IF;
3029:
3054: END IF;
3055:
3056: IF G_debug_flag = 'Y'
3057: THEN
3058: OE_DEBUG_PUB.Add('x_check_exposure_mode = ' || x_check_exposure_mode );
3059: OE_DEBUG_PUB.Add('x_cc_result_out = '|| x_cc_result_out );
3060: OE_DEBUG_PUB.Add('OEXVCRHB: Out Check_Other_Credit Limits');
3061: END IF;
3062:
3055:
3056: IF G_debug_flag = 'Y'
3057: THEN
3058: OE_DEBUG_PUB.Add('x_check_exposure_mode = ' || x_check_exposure_mode );
3059: OE_DEBUG_PUB.Add('x_cc_result_out = '|| x_cc_result_out );
3060: OE_DEBUG_PUB.Add('OEXVCRHB: Out Check_Other_Credit Limits');
3061: END IF;
3062:
3063: EXCEPTION
3056: IF G_debug_flag = 'Y'
3057: THEN
3058: OE_DEBUG_PUB.Add('x_check_exposure_mode = ' || x_check_exposure_mode );
3059: OE_DEBUG_PUB.Add('x_cc_result_out = '|| x_cc_result_out );
3060: OE_DEBUG_PUB.Add('OEXVCRHB: Out Check_Other_Credit Limits');
3061: END IF;
3062:
3063: EXCEPTION
3064: WHEN FND_API.G_EXC_ERROR THEN
3071: OE_MSG_PUB.Add_Exc_Msg
3072: ( G_PKG_NAME, 'Check_Other_Credit_Limits');
3073: END IF;
3074: IF G_debug_flag = 'Y' THEN
3075: OE_DEBUG_PUB.Add( SUBSTR(SQLERRM,1,300),1 ) ;
3076: END IF;
3077: END Check_Other_Credit_Limits;
3078:
3079: ------------------------------------------------+
3113: l_cc_hold_comment VARCHAR2(2000) := NULL;
3114:
3115: BEGIN
3116: IF G_debug_flag = 'Y' THEN
3117: OE_DEBUG_PUB.Add('OEXVCRHB: In Check_order_credit API');
3118: END IF;
3119: --
3120: -- Set the default behavior to pass credit check
3121: --
3125: l_global_exposure_flag := 'N' ;
3126: g_hold_exist := NULL ;
3127: OE_Credit_Engine_GRP.G_currency_error_msg := NULL ;
3128: IF G_debug_flag = 'Y' THEN
3129: OE_DEBUG_PUB.Add( 'Initial start G_result_out = '|| G_result_out );
3130: OE_DEBUG_PUB.Add( 'Initial start G_currency_error_msg = '||
3131: substr(OE_Credit_Engine_GRP.G_currency_error_msg,1,10)) ;
3132: OE_DEBUG_PUB.Add(' ');
3133: OE_DEBUG_PUB.Add(' -------------------------------------------- ');
3126: g_hold_exist := NULL ;
3127: OE_Credit_Engine_GRP.G_currency_error_msg := NULL ;
3128: IF G_debug_flag = 'Y' THEN
3129: OE_DEBUG_PUB.Add( 'Initial start G_result_out = '|| G_result_out );
3130: OE_DEBUG_PUB.Add( 'Initial start G_currency_error_msg = '||
3131: substr(OE_Credit_Engine_GRP.G_currency_error_msg,1,10)) ;
3132: OE_DEBUG_PUB.Add(' ');
3133: OE_DEBUG_PUB.Add(' -------------------------------------------- ');
3134: OE_DEBUG_PUB.Add(' Calling action = '|| p_calling_action);
3128: IF G_debug_flag = 'Y' THEN
3129: OE_DEBUG_PUB.Add( 'Initial start G_result_out = '|| G_result_out );
3130: OE_DEBUG_PUB.Add( 'Initial start G_currency_error_msg = '||
3131: substr(OE_Credit_Engine_GRP.G_currency_error_msg,1,10)) ;
3132: OE_DEBUG_PUB.Add(' ');
3133: OE_DEBUG_PUB.Add(' -------------------------------------------- ');
3134: OE_DEBUG_PUB.Add(' Calling action = '|| p_calling_action);
3135: OE_DEBUG_PUB.Add(' Transaction Amount = '|| p_transaction_amount);
3136: OE_DEBUG_PUB.Add(' Header ID = '|| p_header_rec.header_id );
3129: OE_DEBUG_PUB.Add( 'Initial start G_result_out = '|| G_result_out );
3130: OE_DEBUG_PUB.Add( 'Initial start G_currency_error_msg = '||
3131: substr(OE_Credit_Engine_GRP.G_currency_error_msg,1,10)) ;
3132: OE_DEBUG_PUB.Add(' ');
3133: OE_DEBUG_PUB.Add(' -------------------------------------------- ');
3134: OE_DEBUG_PUB.Add(' Calling action = '|| p_calling_action);
3135: OE_DEBUG_PUB.Add(' Transaction Amount = '|| p_transaction_amount);
3136: OE_DEBUG_PUB.Add(' Header ID = '|| p_header_rec.header_id );
3137: OE_DEBUG_PUB.Add(' Order Number = '|| p_header_rec.order_number );
3130: OE_DEBUG_PUB.Add( 'Initial start G_currency_error_msg = '||
3131: substr(OE_Credit_Engine_GRP.G_currency_error_msg,1,10)) ;
3132: OE_DEBUG_PUB.Add(' ');
3133: OE_DEBUG_PUB.Add(' -------------------------------------------- ');
3134: OE_DEBUG_PUB.Add(' Calling action = '|| p_calling_action);
3135: OE_DEBUG_PUB.Add(' Transaction Amount = '|| p_transaction_amount);
3136: OE_DEBUG_PUB.Add(' Header ID = '|| p_header_rec.header_id );
3137: OE_DEBUG_PUB.Add(' Order Number = '|| p_header_rec.order_number );
3138: OE_DEBUG_PUB.Add(' Order currency = '
3131: substr(OE_Credit_Engine_GRP.G_currency_error_msg,1,10)) ;
3132: OE_DEBUG_PUB.Add(' ');
3133: OE_DEBUG_PUB.Add(' -------------------------------------------- ');
3134: OE_DEBUG_PUB.Add(' Calling action = '|| p_calling_action);
3135: OE_DEBUG_PUB.Add(' Transaction Amount = '|| p_transaction_amount);
3136: OE_DEBUG_PUB.Add(' Header ID = '|| p_header_rec.header_id );
3137: OE_DEBUG_PUB.Add(' Order Number = '|| p_header_rec.order_number );
3138: OE_DEBUG_PUB.Add(' Order currency = '
3139: || p_header_rec.transactional_curr_code );
3132: OE_DEBUG_PUB.Add(' ');
3133: OE_DEBUG_PUB.Add(' -------------------------------------------- ');
3134: OE_DEBUG_PUB.Add(' Calling action = '|| p_calling_action);
3135: OE_DEBUG_PUB.Add(' Transaction Amount = '|| p_transaction_amount);
3136: OE_DEBUG_PUB.Add(' Header ID = '|| p_header_rec.header_id );
3137: OE_DEBUG_PUB.Add(' Order Number = '|| p_header_rec.order_number );
3138: OE_DEBUG_PUB.Add(' Order currency = '
3139: || p_header_rec.transactional_curr_code );
3140: OE_DEBUG_PUB.Add(' sold_to_org = '
3133: OE_DEBUG_PUB.Add(' -------------------------------------------- ');
3134: OE_DEBUG_PUB.Add(' Calling action = '|| p_calling_action);
3135: OE_DEBUG_PUB.Add(' Transaction Amount = '|| p_transaction_amount);
3136: OE_DEBUG_PUB.Add(' Header ID = '|| p_header_rec.header_id );
3137: OE_DEBUG_PUB.Add(' Order Number = '|| p_header_rec.order_number );
3138: OE_DEBUG_PUB.Add(' Order currency = '
3139: || p_header_rec.transactional_curr_code );
3140: OE_DEBUG_PUB.Add(' sold_to_org = '
3141: || p_header_rec.sold_to_org_id );
3134: OE_DEBUG_PUB.Add(' Calling action = '|| p_calling_action);
3135: OE_DEBUG_PUB.Add(' Transaction Amount = '|| p_transaction_amount);
3136: OE_DEBUG_PUB.Add(' Header ID = '|| p_header_rec.header_id );
3137: OE_DEBUG_PUB.Add(' Order Number = '|| p_header_rec.order_number );
3138: OE_DEBUG_PUB.Add(' Order currency = '
3139: || p_header_rec.transactional_curr_code );
3140: OE_DEBUG_PUB.Add(' sold_to_org = '
3141: || p_header_rec.sold_to_org_id );
3142: OE_DEBUG_PUB.Add(' Inv_to_org = '
3136: OE_DEBUG_PUB.Add(' Header ID = '|| p_header_rec.header_id );
3137: OE_DEBUG_PUB.Add(' Order Number = '|| p_header_rec.order_number );
3138: OE_DEBUG_PUB.Add(' Order currency = '
3139: || p_header_rec.transactional_curr_code );
3140: OE_DEBUG_PUB.Add(' sold_to_org = '
3141: || p_header_rec.sold_to_org_id );
3142: OE_DEBUG_PUB.Add(' Inv_to_org = '
3143: || p_header_rec.invoice_to_org_id );
3144: OE_DEBUG_PUB.Add(' Credit check level = '
3138: OE_DEBUG_PUB.Add(' Order currency = '
3139: || p_header_rec.transactional_curr_code );
3140: OE_DEBUG_PUB.Add(' sold_to_org = '
3141: || p_header_rec.sold_to_org_id );
3142: OE_DEBUG_PUB.Add(' Inv_to_org = '
3143: || p_header_rec.invoice_to_org_id );
3144: OE_DEBUG_PUB.Add(' Credit check level = '
3145: || p_credit_check_rule_rec.credit_check_level_code );
3146: OE_DEBUG_PUB.Add(' Conversion Type = '
3140: OE_DEBUG_PUB.Add(' sold_to_org = '
3141: || p_header_rec.sold_to_org_id );
3142: OE_DEBUG_PUB.Add(' Inv_to_org = '
3143: || p_header_rec.invoice_to_org_id );
3144: OE_DEBUG_PUB.Add(' Credit check level = '
3145: || p_credit_check_rule_rec.credit_check_level_code );
3146: OE_DEBUG_PUB.Add(' Conversion Type = '
3147: || p_credit_check_rule_rec.conversion_type );
3148: OE_DEBUG_PUB.Add(' User Conversion Type = '
3142: OE_DEBUG_PUB.Add(' Inv_to_org = '
3143: || p_header_rec.invoice_to_org_id );
3144: OE_DEBUG_PUB.Add(' Credit check level = '
3145: || p_credit_check_rule_rec.credit_check_level_code );
3146: OE_DEBUG_PUB.Add(' Conversion Type = '
3147: || p_credit_check_rule_rec.conversion_type );
3148: OE_DEBUG_PUB.Add(' User Conversion Type = '
3149: || p_credit_check_rule_rec.user_conversion_type );
3150: OE_DEBUG_PUB.Add(' Credit check rule id = '
3144: OE_DEBUG_PUB.Add(' Credit check level = '
3145: || p_credit_check_rule_rec.credit_check_level_code );
3146: OE_DEBUG_PUB.Add(' Conversion Type = '
3147: || p_credit_check_rule_rec.conversion_type );
3148: OE_DEBUG_PUB.Add(' User Conversion Type = '
3149: || p_credit_check_rule_rec.user_conversion_type );
3150: OE_DEBUG_PUB.Add(' Credit check rule id = '
3151: || p_credit_check_rule_rec.credit_check_rule_id );
3152: OE_DEBUG_PUB.Add(' CHECK_ITEM_CATEGORIES_FLAG = '
3146: OE_DEBUG_PUB.Add(' Conversion Type = '
3147: || p_credit_check_rule_rec.conversion_type );
3148: OE_DEBUG_PUB.Add(' User Conversion Type = '
3149: || p_credit_check_rule_rec.user_conversion_type );
3150: OE_DEBUG_PUB.Add(' Credit check rule id = '
3151: || p_credit_check_rule_rec.credit_check_rule_id );
3152: OE_DEBUG_PUB.Add(' CHECK_ITEM_CATEGORIES_FLAG = '
3153: || p_credit_check_rule_rec.CHECK_ITEM_CATEGORIES_FLAG );
3154: OE_DEBUG_PUB.Add(' SEND_HOLD_NOTIFICATIONS_FLAG = '
3148: OE_DEBUG_PUB.Add(' User Conversion Type = '
3149: || p_credit_check_rule_rec.user_conversion_type );
3150: OE_DEBUG_PUB.Add(' Credit check rule id = '
3151: || p_credit_check_rule_rec.credit_check_rule_id );
3152: OE_DEBUG_PUB.Add(' CHECK_ITEM_CATEGORIES_FLAG = '
3153: || p_credit_check_rule_rec.CHECK_ITEM_CATEGORIES_FLAG );
3154: OE_DEBUG_PUB.Add(' SEND_HOLD_NOTIFICATIONS_FLAG = '
3155: || p_credit_check_rule_rec.SEND_HOLD_NOTIFICATIONS_FLAG );
3156: OE_DEBUG_PUB.Add('g_hold_exist => '|| g_hold_exist );
3150: OE_DEBUG_PUB.Add(' Credit check rule id = '
3151: || p_credit_check_rule_rec.credit_check_rule_id );
3152: OE_DEBUG_PUB.Add(' CHECK_ITEM_CATEGORIES_FLAG = '
3153: || p_credit_check_rule_rec.CHECK_ITEM_CATEGORIES_FLAG );
3154: OE_DEBUG_PUB.Add(' SEND_HOLD_NOTIFICATIONS_FLAG = '
3155: || p_credit_check_rule_rec.SEND_HOLD_NOTIFICATIONS_FLAG );
3156: OE_DEBUG_PUB.Add('g_hold_exist => '|| g_hold_exist );
3157: OE_DEBUG_PUB.Add(' -------------------------------------------- ');
3158: OE_DEBUG_PUB.Add(' ');
3152: OE_DEBUG_PUB.Add(' CHECK_ITEM_CATEGORIES_FLAG = '
3153: || p_credit_check_rule_rec.CHECK_ITEM_CATEGORIES_FLAG );
3154: OE_DEBUG_PUB.Add(' SEND_HOLD_NOTIFICATIONS_FLAG = '
3155: || p_credit_check_rule_rec.SEND_HOLD_NOTIFICATIONS_FLAG );
3156: OE_DEBUG_PUB.Add('g_hold_exist => '|| g_hold_exist );
3157: OE_DEBUG_PUB.Add(' -------------------------------------------- ');
3158: OE_DEBUG_PUB.Add(' ');
3159: END IF;
3160: --
3153: || p_credit_check_rule_rec.CHECK_ITEM_CATEGORIES_FLAG );
3154: OE_DEBUG_PUB.Add(' SEND_HOLD_NOTIFICATIONS_FLAG = '
3155: || p_credit_check_rule_rec.SEND_HOLD_NOTIFICATIONS_FLAG );
3156: OE_DEBUG_PUB.Add('g_hold_exist => '|| g_hold_exist );
3157: OE_DEBUG_PUB.Add(' -------------------------------------------- ');
3158: OE_DEBUG_PUB.Add(' ');
3159: END IF;
3160: --
3161: -- Check payment term only if the calling action is not EXTERNAL
3154: OE_DEBUG_PUB.Add(' SEND_HOLD_NOTIFICATIONS_FLAG = '
3155: || p_credit_check_rule_rec.SEND_HOLD_NOTIFICATIONS_FLAG );
3156: OE_DEBUG_PUB.Add('g_hold_exist => '|| g_hold_exist );
3157: OE_DEBUG_PUB.Add(' -------------------------------------------- ');
3158: OE_DEBUG_PUB.Add(' ');
3159: END IF;
3160: --
3161: -- Check payment term only if the calling action is not EXTERNAL
3162: --
3161: -- Check payment term only if the calling action is not EXTERNAL
3162: --
3163: IF NVL(p_calling_action,'BOOKING') <> 'EXTERNAL' THEN
3164: IF G_debug_flag = 'Y' THEN
3165: OE_DEBUG_PUB.Add(' Call check_credit_check_flags ');
3166: END IF;
3167: l_check_order_eligible := check_credit_check_flags
3168: ( p_header_id => p_header_rec.header_id );
3169: ELSE
3170: l_check_order_eligible := 'Y';
3171: END IF;
3172:
3173: IF G_debug_flag = 'Y' THEN
3174: OE_DEBUG_PUB.Add(' l_check_order_eligible = '|| l_check_order_eligible );
3175: END IF;
3176:
3177: IF l_check_order_eligible = 'Y'
3178: THEN
3176:
3177: IF l_check_order_eligible = 'Y'
3178: THEN
3179: IF G_debug_flag = 'Y' THEN
3180: OE_DEBUG_PUB.Add('OEXVCRHB: Payment term YES CC checked , continue CC ');
3181: END IF;
3182:
3183: SELECT /* MOAC_SQL_CHANGE */ cas.cust_account_id
3184: , su.site_use_id
3193: AND cas.CUST_ACCT_SITE_ID = su.CUST_ACCT_SITE_ID
3194: AND cas.cust_account_id=ca.cust_account_id; ---------new (FPI)
3195:
3196: IF G_debug_flag = 'Y' THEN
3197: OE_DEBUG_PUB.Add('l_own_customer_id '|| l_own_customer_id );
3198: OE_DEBUG_PUB.Add('l_order_site_use_id '|| l_order_site_use_id);
3199: END IF;
3200:
3201: ---------------------------------------------------+
3194: AND cas.cust_account_id=ca.cust_account_id; ---------new (FPI)
3195:
3196: IF G_debug_flag = 'Y' THEN
3197: OE_DEBUG_PUB.Add('l_own_customer_id '|| l_own_customer_id );
3198: OE_DEBUG_PUB.Add('l_order_site_use_id '|| l_order_site_use_id);
3199: END IF;
3200:
3201: ---------------------------------------------------+
3202: -- order is subject to credit check: |
3212: IF NVL(OE_credit_engine_GRP.G_delayed_request, FND_API.G_FALSE ) = FND_API.G_TRUE
3213: THEN
3214: IF OE_CREDIT_ENGINE_GRP.TOLERANCE_CHECK_REQUIRED
3215: THEN
3216: oe_debug_pub.ADD('OEXVCRLB: Tolerance Check is required');
3217: IF NOT OE_HOLDS_PUB.Hold_exists( p_hold_entity_code => 'O'
3218: , p_hold_entity_id => p_header_rec.header_id
3219: , p_hold_id => 1
3220: , p_org_id => mo_global.get_current_org_id
3219: , p_hold_id => 1
3220: , p_org_id => mo_global.get_current_org_id
3221: )
3222: THEN
3223: oe_debug_pub.ADD('OEXVCRLB: Active hold does not exists.');
3224: IF Check_Manual_Released_Holds( p_calling_action => p_calling_action ,
3225: p_hold_id => 1 ,
3226: p_header_id => p_header_rec.header_id ,
3227: p_line_id => NULL ,
3226: p_header_id => p_header_rec.header_id ,
3227: p_line_id => NULL ,
3228: p_credit_check_rule_rec=>p_credit_check_rule_rec) = 'Y'
3229: THEN
3230: oe_debug_pub.ADD('OEXVCRLB: Manual released hold exists.');
3231: IF OE_CREDIT_ENGINE_GRP.CREDIT_TOLERANCE_CHECK( p_header_id => p_header_rec.header_id)
3232: THEN
3233: OE_CREDIT_ENGINE_GRP.TOLERANCE_CHECK_REQUIRED := TRUE; -- slagiset: Resetting the value to NULL
3234: RETURN;
3254: , x_cc_result_out => l_cc_result_out
3255: , x_return_status => x_return_status
3256: );
3257: IF G_debug_flag = 'Y' THEN
3258: OE_DEBUG_PUB.Add('Check_Item_Limit: Result Out = '
3259: || l_cc_result_out );
3260: OE_DEBUG_PUB.Add('Check_Item_Limit: Return Status = '
3261: || x_return_status );
3262: END IF;
3256: );
3257: IF G_debug_flag = 'Y' THEN
3258: OE_DEBUG_PUB.Add('Check_Item_Limit: Result Out = '
3259: || l_cc_result_out );
3260: OE_DEBUG_PUB.Add('Check_Item_Limit: Return Status = '
3261: || x_return_status );
3262: END IF;
3263: ELSE
3264: l_cc_result_out := 'PASS' ;
3263: ELSE
3264: l_cc_result_out := 'PASS' ;
3265: x_return_status := FND_API.G_RET_STS_SUCCESS;
3266: IF G_debug_flag = 'Y' THEN
3267: OE_DEBUG_PUB.Add(' No Item category credit checking, flag OFF ');
3268: OE_DEBUG_PUB.Add('l_cc_result_out = '
3269: || l_cc_result_out );
3270: OE_DEBUG_PUB.Add('x_return_status = '
3271: || x_return_status );
3264: l_cc_result_out := 'PASS' ;
3265: x_return_status := FND_API.G_RET_STS_SUCCESS;
3266: IF G_debug_flag = 'Y' THEN
3267: OE_DEBUG_PUB.Add(' No Item category credit checking, flag OFF ');
3268: OE_DEBUG_PUB.Add('l_cc_result_out = '
3269: || l_cc_result_out );
3270: OE_DEBUG_PUB.Add('x_return_status = '
3271: || x_return_status );
3272: END IF;
3266: IF G_debug_flag = 'Y' THEN
3267: OE_DEBUG_PUB.Add(' No Item category credit checking, flag OFF ');
3268: OE_DEBUG_PUB.Add('l_cc_result_out = '
3269: || l_cc_result_out );
3270: OE_DEBUG_PUB.Add('x_return_status = '
3271: || x_return_status );
3272: END IF;
3273: END IF;
3274:
3286: THEN
3287: -- set the order hold release flag
3288: l_release_order_hold := 'N';
3289: IF G_debug_flag = 'Y' THEN
3290: OE_DEBUG_PUB.Add(' l_release_order_hold = '||l_release_order_hold );
3291: END IF;
3292: ELSE
3293: IF G_debug_flag = 'Y'
3294: THEN
3291: END IF;
3292: ELSE
3293: IF G_debug_flag = 'Y'
3294: THEN
3295: OE_DEBUG_PUB.Add('Item checking PASS, call Check_Other_Credit_Limits' );
3296: END IF;
3297:
3298: ---------------------------------------------------+
3299: -- Check other credit limits for the bill-to site: |
3319: );
3320:
3321: IF G_debug_flag = 'Y'
3322: THEN
3323: OE_DEBUG_PUB.Add('Check_Other_Credit_Limits: Result Out = '
3324: || l_cc_result_out );
3325: OE_DEBUG_PUB.Add('l_check_exposure_mode = '||
3326: l_check_exposure_mode );
3327: OE_DEBUG_PUB.Add('l_credit_level = '||
3321: IF G_debug_flag = 'Y'
3322: THEN
3323: OE_DEBUG_PUB.Add('Check_Other_Credit_Limits: Result Out = '
3324: || l_cc_result_out );
3325: OE_DEBUG_PUB.Add('l_check_exposure_mode = '||
3326: l_check_exposure_mode );
3327: OE_DEBUG_PUB.Add('l_credit_level = '||
3328: l_credit_level );
3329: OE_DEBUG_PUB.Add('x_cc_hold_comment = '||
3323: OE_DEBUG_PUB.Add('Check_Other_Credit_Limits: Result Out = '
3324: || l_cc_result_out );
3325: OE_DEBUG_PUB.Add('l_check_exposure_mode = '||
3326: l_check_exposure_mode );
3327: OE_DEBUG_PUB.Add('l_credit_level = '||
3328: l_credit_level );
3329: OE_DEBUG_PUB.Add('x_cc_hold_comment = '||
3330: x_cc_hold_comment );
3331: OE_DEBUG_PUB.Add('Check_Other_Credit_Limits: Return Status = '
3325: OE_DEBUG_PUB.Add('l_check_exposure_mode = '||
3326: l_check_exposure_mode );
3327: OE_DEBUG_PUB.Add('l_credit_level = '||
3328: l_credit_level );
3329: OE_DEBUG_PUB.Add('x_cc_hold_comment = '||
3330: x_cc_hold_comment );
3331: OE_DEBUG_PUB.Add('Check_Other_Credit_Limits: Return Status = '
3332: || x_return_status );
3333: END IF;
3327: OE_DEBUG_PUB.Add('l_credit_level = '||
3328: l_credit_level );
3329: OE_DEBUG_PUB.Add('x_cc_hold_comment = '||
3330: x_cc_hold_comment );
3331: OE_DEBUG_PUB.Add('Check_Other_Credit_Limits: Return Status = '
3332: || x_return_status );
3333: END IF;
3334:
3335: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
3346: THEN
3347: -- set the order hold release flag
3348: l_release_order_hold := 'N';
3349: IF G_debug_flag = 'Y' THEN
3350: OE_DEBUG_PUB.Add(' l_release_order_hold = '||l_release_order_hold );
3351: END IF;
3352: END IF;
3353:
3354: END IF; -- else item checking
3360: END IF;
3361:
3362: IF G_debug_flag = 'Y'
3363: THEN
3364: OE_DEBUG_PUB.Add('OEXVCRHB: Check_order_credit Results');
3365: OE_DEBUG_PUB.Add('l_release_order_hold : '|| l_release_order_hold );
3366: OE_DEBUG_PUB.Add('l_cc_result_out : '|| l_cc_result_out );
3367: END IF;
3368:
3361:
3362: IF G_debug_flag = 'Y'
3363: THEN
3364: OE_DEBUG_PUB.Add('OEXVCRHB: Check_order_credit Results');
3365: OE_DEBUG_PUB.Add('l_release_order_hold : '|| l_release_order_hold );
3366: OE_DEBUG_PUB.Add('l_cc_result_out : '|| l_cc_result_out );
3367: END IF;
3368:
3369: ELSE
3362: IF G_debug_flag = 'Y'
3363: THEN
3364: OE_DEBUG_PUB.Add('OEXVCRHB: Check_order_credit Results');
3365: OE_DEBUG_PUB.Add('l_release_order_hold : '|| l_release_order_hold );
3366: OE_DEBUG_PUB.Add('l_cc_result_out : '|| l_cc_result_out );
3367: END IF;
3368:
3369: ELSE
3370: x_cc_result_out := 'NOCHECK';
3371: l_release_order_hold := 'Y' ;
3372:
3373: IF G_debug_flag = 'Y'
3374: THEN
3375: OE_DEBUG_PUB.Add('OEXVCRHB: Payment term NO CC checked ');
3376: END IF;
3377:
3378: END IF; -- payment term check
3379:
3378: END IF; -- payment term check
3379:
3380: IF G_debug_flag = 'Y'
3381: THEN
3382: OE_DEBUG_PUB.Add(' l_release_order_hold = '|| l_release_order_hold );
3383: OE_DEBUG_PUB.Add(' x_cc_result_out = ' || x_cc_result_out );
3384: END IF;
3385: --
3386: -- Also check calling action to release hold only when action not EXTERNAL
3379:
3380: IF G_debug_flag = 'Y'
3381: THEN
3382: OE_DEBUG_PUB.Add(' l_release_order_hold = '|| l_release_order_hold );
3383: OE_DEBUG_PUB.Add(' x_cc_result_out = ' || x_cc_result_out );
3384: END IF;
3385: --
3386: -- Also check calling action to release hold only when action not EXTERNAL
3387: --
3390: -- AND l_cc_result_out <> 'NOCHECK'
3391: THEN
3392: IF G_debug_flag = 'Y'
3393: THEN
3394: OE_DEBUG_PUB.Add(' CALL Release_Order_CC_Hold ' );
3395: END IF;
3396:
3397: Release_Order_CC_Hold
3398: ( p_header_id => p_header_rec.header_id
3403: );
3404:
3405: IF G_debug_flag = 'Y'
3406: THEN
3407: OE_DEBUG_PUB.Add(' Release_Order_CC_Hold : Result Out = '
3408: || l_cc_result_out );
3409: END IF;
3410:
3411: END IF;
3417: g_hold_exist := NULL ;
3418:
3419: IF G_debug_flag = 'Y'
3420: THEN
3421: OE_DEBUG_PUB.Add(' l_cc_result_out = '|| l_cc_result_out );
3422: OE_DEBUG_PUB.Add(' G_result_out = ' || G_result_out );
3423: OE_DEBUG_PUB.Add(' final x_cc_result_out = '|| x_cc_result_out );
3424: OE_DEBUG_PUB.Add('OEXVCRHB: Out Check_order_credit API');
3425: END IF;
3418:
3419: IF G_debug_flag = 'Y'
3420: THEN
3421: OE_DEBUG_PUB.Add(' l_cc_result_out = '|| l_cc_result_out );
3422: OE_DEBUG_PUB.Add(' G_result_out = ' || G_result_out );
3423: OE_DEBUG_PUB.Add(' final x_cc_result_out = '|| x_cc_result_out );
3424: OE_DEBUG_PUB.Add('OEXVCRHB: Out Check_order_credit API');
3425: END IF;
3426:
3419: IF G_debug_flag = 'Y'
3420: THEN
3421: OE_DEBUG_PUB.Add(' l_cc_result_out = '|| l_cc_result_out );
3422: OE_DEBUG_PUB.Add(' G_result_out = ' || G_result_out );
3423: OE_DEBUG_PUB.Add(' final x_cc_result_out = '|| x_cc_result_out );
3424: OE_DEBUG_PUB.Add('OEXVCRHB: Out Check_order_credit API');
3425: END IF;
3426:
3427: EXCEPTION
3420: THEN
3421: OE_DEBUG_PUB.Add(' l_cc_result_out = '|| l_cc_result_out );
3422: OE_DEBUG_PUB.Add(' G_result_out = ' || G_result_out );
3423: OE_DEBUG_PUB.Add(' final x_cc_result_out = '|| x_cc_result_out );
3424: OE_DEBUG_PUB.Add('OEXVCRHB: Out Check_order_credit API');
3425: END IF;
3426:
3427: EXCEPTION
3428: WHEN FND_API.G_EXC_ERROR THEN
3427: EXCEPTION
3428: WHEN FND_API.G_EXC_ERROR THEN
3429: OE_CREDIT_ENGINE_GRP.TOLERANCE_CHECK_REQUIRED := TRUE; -- ER 12363706
3430: IF G_debug_flag = 'Y' THEN
3431: OE_DEBUG_PUB.Add('Check_order_credit: Error ');
3432: END IF;
3433: x_return_status := FND_API.G_RET_STS_ERROR;
3434: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3435: OE_CREDIT_ENGINE_GRP.TOLERANCE_CHECK_REQUIRED := TRUE; -- ER 12363706
3433: x_return_status := FND_API.G_RET_STS_ERROR;
3434: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3435: OE_CREDIT_ENGINE_GRP.TOLERANCE_CHECK_REQUIRED := TRUE; -- ER 12363706
3436: IF G_debug_flag = 'Y' THEN
3437: OE_DEBUG_PUB.Add('Check_order_credit: Unexpected Error ');
3438: END IF;
3439: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3440: WHEN OTHERS THEN
3441: OE_CREDIT_ENGINE_GRP.TOLERANCE_CHECK_REQUIRED := TRUE; -- ER 12363706
3439: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3440: WHEN OTHERS THEN
3441: OE_CREDIT_ENGINE_GRP.TOLERANCE_CHECK_REQUIRED := TRUE; -- ER 12363706
3442: IF G_debug_flag = 'Y' THEN
3443: OE_DEBUG_PUB.Add('Check_order_credit: Other Unexpected Error ');
3444: END IF;
3445: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3446: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3447: OE_MSG_PUB.Add_Exc_Msg
3449: , 'Check_order_credit'
3450: );
3451: END IF;
3452: IF G_debug_flag = 'Y' THEN
3453: OE_DEBUG_PUB.Add( SUBSTR(SQLERRM,1,300),1 ) ;
3454: END IF;
3455: OE_MSG_PUB.Count_And_Get
3456: ( p_count => x_msg_count
3457: , p_data => x_msg_data