DBA Data[Home] [Help]

APPS.OKC_OPPORTUNITY_PVT dependencies on OKC_DEBUG

Line 27: okc_debug.Set_Indentation('Create_Opportunity');

23: l_msg_data VARCHAR2(2000);
24:
25: Begin
26: IF (l_debug = 'Y') THEN
27: okc_debug.Set_Indentation('Create_Opportunity');
28: okc_debug.log('1000: Entering okc_opportunity_pvt.create_opportunity', 2);
29: END IF;
30: x_return_status := okc_api.g_ret_sts_success;
31: --

Line 28: okc_debug.log('1000: Entering okc_opportunity_pvt.create_opportunity', 2);

24:
25: Begin
26: IF (l_debug = 'Y') THEN
27: okc_debug.Set_Indentation('Create_Opportunity');
28: okc_debug.log('1000: Entering okc_opportunity_pvt.create_opportunity', 2);
29: END IF;
30: x_return_status := okc_api.g_ret_sts_success;
31: --
32: IF (l_debug = 'Y') THEN

Line 33: okc_debug.log('1010: Before is_opp_creation_allowed');

29: END IF;
30: x_return_status := okc_api.g_ret_sts_success;
31: --
32: IF (l_debug = 'Y') THEN
33: okc_debug.log('1010: Before is_opp_creation_allowed');
34: END IF;
35: Is_Opp_Creation_Allowed(p_context,
36: p_contract_id,
37: l_return_status);

Line 43: okc_debug.log('1015: Setting Contract Context');

39: Raise g_exception_halt_validation;
40: End If;
41: --
42: IF (l_debug = 'Y') THEN
43: okc_debug.log('1015: Setting Contract Context');
44: END IF;
45: okc_context.set_okc_org_context(p_chr_id => p_contract_id);
46: IF (l_debug = 'Y') THEN
47: okc_debug.log('1020: Before create_opp_header');

Line 47: okc_debug.log('1020: Before create_opp_header');

43: okc_debug.log('1015: Setting Contract Context');
44: END IF;
45: okc_context.set_okc_org_context(p_chr_id => p_contract_id);
46: IF (l_debug = 'Y') THEN
47: okc_debug.log('1020: Before create_opp_header');
48: END IF;
49: Create_Opp_Header(p_api_version,
50: p_context,
51: p_contract_id,

Line 61: okc_debug.log('1030: Opp Header Creation Return Status - ' || l_return_status);

57: l_msg_count,
58: l_return_status);
59: If l_return_status <> okc_api.g_ret_sts_success Then
60: IF (l_debug = 'Y') THEN
61: okc_debug.log('1030: Opp Header Creation Return Status - ' || l_return_status);
62: END IF;
63: Raise g_exception_halt_validation;
64: End If;
65: IF (l_debug = 'Y') THEN

Line 66: okc_debug.log('1040: Opportunity Lead Id - ' || to_char(l_lead_id));

62: END IF;
63: Raise g_exception_halt_validation;
64: End If;
65: IF (l_debug = 'Y') THEN
66: okc_debug.log('1040: Opportunity Lead Id - ' || to_char(l_lead_id));
67: END IF;
68: --
69: IF (l_debug = 'Y') THEN
70: okc_debug.log('1050: Before create_opp_lines');

Line 70: okc_debug.log('1050: Before create_opp_lines');

66: okc_debug.log('1040: Opportunity Lead Id - ' || to_char(l_lead_id));
67: END IF;
68: --
69: IF (l_debug = 'Y') THEN
70: okc_debug.log('1050: Before create_opp_lines');
71: END IF;
72: Create_Opp_Lines(p_api_version,
73: p_context,
74: p_contract_id,

Line 81: okc_debug.log('1060: After create_opp_lines');

77: l_msg_data,
78: l_msg_count,
79: l_return_status);
80: IF (l_debug = 'Y') THEN
81: okc_debug.log('1060: After create_opp_lines');
82: END IF;
83: If l_return_status <> okc_api.g_ret_sts_success Then
84: IF (l_debug = 'Y') THEN
85: okc_debug.log('1060: Opp Lines Creation Return Status - ' || l_return_status);

Line 85: okc_debug.log('1060: Opp Lines Creation Return Status - ' || l_return_status);

81: okc_debug.log('1060: After create_opp_lines');
82: END IF;
83: If l_return_status <> okc_api.g_ret_sts_success Then
84: IF (l_debug = 'Y') THEN
85: okc_debug.log('1060: Opp Lines Creation Return Status - ' || l_return_status);
86: END IF;
87: Raise g_exception_halt_validation;
88: End If;
89: --

Line 93: okc_debug.log('2000: Exiting okc_opportunity_pvt.create_opportunity', 2);

89: --
90:
91: x_lead_id := l_lead_id;
92: IF (l_debug = 'Y') THEN
93: okc_debug.log('2000: Exiting okc_opportunity_pvt.create_opportunity', 2);
94: okc_debug.Reset_Indentation;
95: END IF;
96: Exception
97: When g_exception_halt_validation Then

Line 94: okc_debug.Reset_Indentation;

90:
91: x_lead_id := l_lead_id;
92: IF (l_debug = 'Y') THEN
93: okc_debug.log('2000: Exiting okc_opportunity_pvt.create_opportunity', 2);
94: okc_debug.Reset_Indentation;
95: END IF;
96: Exception
97: When g_exception_halt_validation Then
98: x_return_status := l_return_status;

Line 100: okc_debug.log('1970: Exiting okc_opportunity_pvt.create_opportunity', 2);

96: Exception
97: When g_exception_halt_validation Then
98: x_return_status := l_return_status;
99: IF (l_debug = 'Y') THEN
100: okc_debug.log('1970: Exiting okc_opportunity_pvt.create_opportunity', 2);
101: okc_debug.Reset_Indentation;
102: END IF;
103: When Others Then
104: okc_api.Set_Message(p_app_name => g_app_name,

Line 101: okc_debug.Reset_Indentation;

97: When g_exception_halt_validation Then
98: x_return_status := l_return_status;
99: IF (l_debug = 'Y') THEN
100: okc_debug.log('1970: Exiting okc_opportunity_pvt.create_opportunity', 2);
101: okc_debug.Reset_Indentation;
102: END IF;
103: When Others Then
104: okc_api.Set_Message(p_app_name => g_app_name,
105: p_msg_name => g_unexpected_error,

Line 112: okc_debug.log('1990: Exiting okc_opportunity_pvt.create_opportunity', 2);

108: p_token2 => g_sqlerrm_token,
109: p_token2_value => sqlerrm);
110: x_return_status := okc_api.g_ret_sts_unexp_error;
111: IF (l_debug = 'Y') THEN
112: okc_debug.log('1990: Exiting okc_opportunity_pvt.create_opportunity', 2);
113: okc_debug.Reset_Indentation;
114: END IF;
115: End Create_Opportunity;
116:

Line 113: okc_debug.Reset_Indentation;

109: p_token2_value => sqlerrm);
110: x_return_status := okc_api.g_ret_sts_unexp_error;
111: IF (l_debug = 'Y') THEN
112: okc_debug.log('1990: Exiting okc_opportunity_pvt.create_opportunity', 2);
113: okc_debug.Reset_Indentation;
114: END IF;
115: End Create_Opportunity;
116:
117: PROCEDURE CREATE_OPP_HEADER(p_api_version IN NUMBER,

Line 230: okc_debug.Set_Indentation('Create_Opp_Header');

226: Note_Message VARCHAR2(2000); -- Bug : 2589898 ENHANCED TO VARCHAR2(2000) FROM VARCHAR2(300)
227:
228: Begin
229: IF (l_debug = 'Y') THEN
230: okc_debug.Set_Indentation('Create_Opp_Header');
231: okc_debug.log('3000: Entering okc_opportunity_pvt.create_opp_header', 2);
232: END IF;
233: x_return_status := okc_api.g_ret_sts_success;
234: --

Line 231: okc_debug.log('3000: Entering okc_opportunity_pvt.create_opp_header', 2);

227:
228: Begin
229: IF (l_debug = 'Y') THEN
230: okc_debug.Set_Indentation('Create_Opp_Header');
231: okc_debug.log('3000: Entering okc_opportunity_pvt.create_opp_header', 2);
232: END IF;
233: x_return_status := okc_api.g_ret_sts_success;
234: --
235: IF (l_debug = 'Y') THEN

Line 236: okc_debug.log('3010: Before Get_Opp_Defaults');

232: END IF;
233: x_return_status := okc_api.g_ret_sts_success;
234: --
235: IF (l_debug = 'Y') THEN
236: okc_debug.log('3010: Before Get_Opp_Defaults');
237: END IF;
238: Get_Opp_Defaults(p_context,
239: p_contract_id,
240: l_win_probability,

Line 245: okc_debug.log('3019: Get_Opp_Defaults Return Status - ' || l_return_status);

241: l_expected_close_days,
242: l_return_status);
243: If l_return_status <> okc_api.g_ret_sts_success Then
244: IF (l_debug = 'Y') THEN
245: okc_debug.log('3019: Get_Opp_Defaults Return Status - ' || l_return_status);
246: END IF;
247: Raise g_exception_halt_validation;
248: End If;
249: -- Get Contract's details

Line 258: okc_debug.log('3020: The contract is renewed from contract id #' || c1_rec.orig_system_id1 );

254: -- If contract is renewed and there's EXPIRE opportunity for pre-renewed
255: -- contract: we should just link the new contract to the opportunity
256: IF p_context = 'RENEW' and c1_rec.lead_id IS NOT NULL and c1_rec.orig_system_source_code='OKC_HDR' THEN
257: IF (l_debug = 'Y') THEN
258: okc_debug.log('3020: The contract is renewed from contract id #' || c1_rec.orig_system_id1 );
259: okc_debug.log('3021: There is opportunity #' || c1_rec.lead_id || ' for pre-renewed contract' );
260: okc_debug.log('3022: It will be reused (linked) for the new (renewed) contract' );
261: END IF;
262: l_lead_id := c1_rec.lead_id ;

Line 259: okc_debug.log('3021: There is opportunity #' || c1_rec.lead_id || ' for pre-renewed contract' );

255: -- contract: we should just link the new contract to the opportunity
256: IF p_context = 'RENEW' and c1_rec.lead_id IS NOT NULL and c1_rec.orig_system_source_code='OKC_HDR' THEN
257: IF (l_debug = 'Y') THEN
258: okc_debug.log('3020: The contract is renewed from contract id #' || c1_rec.orig_system_id1 );
259: okc_debug.log('3021: There is opportunity #' || c1_rec.lead_id || ' for pre-renewed contract' );
260: okc_debug.log('3022: It will be reused (linked) for the new (renewed) contract' );
261: END IF;
262: l_lead_id := c1_rec.lead_id ;
263: g_opp_h_created := FALSE; -- is used to prevent old header removing

Line 260: okc_debug.log('3022: It will be reused (linked) for the new (renewed) contract' );

256: IF p_context = 'RENEW' and c1_rec.lead_id IS NOT NULL and c1_rec.orig_system_source_code='OKC_HDR' THEN
257: IF (l_debug = 'Y') THEN
258: okc_debug.log('3020: The contract is renewed from contract id #' || c1_rec.orig_system_id1 );
259: okc_debug.log('3021: There is opportunity #' || c1_rec.lead_id || ' for pre-renewed contract' );
260: okc_debug.log('3022: It will be reused (linked) for the new (renewed) contract' );
261: END IF;
262: l_lead_id := c1_rec.lead_id ;
263: g_opp_h_created := FALSE; -- is used to prevent old header removing
264: l_cr_note := 'OKC_OPP_LINKED_TO_K';

Line 273: okc_debug.log('3030: Customer ID - ' || To_Char(l_customer_id));

269: Open c2('CUSTOMER');
270: Fetch c2 Into l_customer_id;
271: Close c2;
272: IF (l_debug = 'Y') THEN
273: okc_debug.log('3030: Customer ID - ' || To_Char(l_customer_id));
274: END IF;
275: -- Get Sales Rep ID, store it in a global so that it can be used
276: -- later for opp lines creation
277: g_sales_rep := Null;

Line 282: okc_debug.log('3040: Sales Rep ID - ' || To_Char(g_sales_rep));

278: Open c3('OKX_SALEPERS');
279: Fetch c3 Into g_sales_rep;
280: Close c3;
281: IF (l_debug = 'Y') THEN
282: okc_debug.log('3040: Sales Rep ID - ' || To_Char(g_sales_rep));
283: END IF;
284: --
285: /* Open c4;
286: Fetch c4 Into l_group_id;

Line 367: okc_debug.log('Opportunity name i.e. description: ' || l_header_rec.description);

363: l_header_rec.price_list_id := c5_rec.object1_id1;
364:
365: --TEMP okc_util.print_trace(9,'Opportunity name i.e. description: ' || l_header_rec.description);
366: IF (l_debug = 'Y') THEN
367: okc_debug.log('Opportunity name i.e. description: ' || l_header_rec.description);
368: END IF;
369:
370: begin --get sales_stage_id
371: OPEN c7(l_win_probability); --get sales_stage_id

Line 377: okc_debug.log('l_sales_stage_id : ' || TO_CHAR(l_sales_stage_id));

373: CLOSE c7;
374: l_header_rec.sales_stage_id := NVL(l_sales_stage_id, OKC_API.G_MISS_NUM);
375: --TEMP okc_util.print_trace(9,'l_sales_stage_id : ' || l_sales_stage_id);
376: IF (l_debug = 'Y') THEN
377: okc_debug.log('l_sales_stage_id : ' || TO_CHAR(l_sales_stage_id));
378: END IF;
379: exception
380: when others then
381: null;

Line 398: okc_debug.log('l_header_rec.source_promotion_id: ' || TO_CHAR(l_header_rec.source_promotion_id));

394: END IF;
395: l_header_rec.source_promotion_id := nvl(TO_NUMBER(fnd_profile.value('OKC_DEFAULT_OPP_CODE')), okc_api.g_miss_num);
396: --TEMP okc_util.print_trace(9,'l_header_rec.source_promotion_id: ' || l_header_rec.source_promotion_id);
397: IF (l_debug = 'Y') THEN
398: okc_debug.log('l_header_rec.source_promotion_id: ' || TO_CHAR(l_header_rec.source_promotion_id));
399: END IF;
400:
401: l_header_rec.address_id := nvl(to_number(l_party_site_id), okc_api.g_miss_num);
402: --TEMP okc_util.print_trace(9,'l_header_rec.address_id: ' || l_header_rec.address_id);

Line 404: okc_debug.log('l_header_rec.address_id: ' || TO_CHAR(l_header_rec.address_id));

400:
401: l_header_rec.address_id := nvl(to_number(l_party_site_id), okc_api.g_miss_num);
402: --TEMP okc_util.print_trace(9,'l_header_rec.address_id: ' || l_header_rec.address_id);
403: IF (l_debug = 'Y') THEN
404: okc_debug.log('l_header_rec.address_id: ' || TO_CHAR(l_header_rec.address_id));
405: END IF;
406:
407: IF (l_debug = 'Y') THEN
408: okc_debug.log('3500: Before as_opportunity_pub.create_opp_header');

Line 408: okc_debug.log('3500: Before as_opportunity_pub.create_opp_header');

404: okc_debug.log('l_header_rec.address_id: ' || TO_CHAR(l_header_rec.address_id));
405: END IF;
406:
407: IF (l_debug = 'Y') THEN
408: okc_debug.log('3500: Before as_opportunity_pub.create_opp_header');
409: END IF;
410: -- Finally call the opp header api
411: AS_OPPORTUNITY_PUB.Create_Opp_Header(
412: p_api_version_number => 2.0, --p_api_version,---2.0,

Line 432: okc_debug.log('3510: After as_opportunity_pub.create_opp_header');

428: x_lead_id => l_lead_id);
429: --
430: --Note: final commit is done in OKC_OPPORUNTITY_PUB.create_opportunity!
431: IF (l_debug = 'Y') THEN
432: okc_debug.log('3510: After as_opportunity_pub.create_opp_header');
433: END IF;
434: --TEMP okc_util.print_trace(9, 'x_lead_id returned: ' || l_lead_id);
435: IF (l_debug = 'Y') THEN
436: okc_debug.log('x_lead_id returned: ' || TO_CHAR(l_lead_id));

Line 436: okc_debug.log('x_lead_id returned: ' || TO_CHAR(l_lead_id));

432: okc_debug.log('3510: After as_opportunity_pub.create_opp_header');
433: END IF;
434: --TEMP okc_util.print_trace(9, 'x_lead_id returned: ' || l_lead_id);
435: IF (l_debug = 'Y') THEN
436: okc_debug.log('x_lead_id returned: ' || TO_CHAR(l_lead_id));
437: END IF;
438: If l_return_status <> okc_api.g_ret_sts_success Then
439: IF (l_debug = 'Y') THEN
440: okc_debug.log('3520: Return Status from Opp header Creation - ' || l_return_status);

Line 440: okc_debug.log('3520: Return Status from Opp header Creation - ' || l_return_status);

436: okc_debug.log('x_lead_id returned: ' || TO_CHAR(l_lead_id));
437: END IF;
438: If l_return_status <> okc_api.g_ret_sts_success Then
439: IF (l_debug = 'Y') THEN
440: okc_debug.log('3520: Return Status from Opp header Creation - ' || l_return_status);
441: END IF;
442: Raise g_exception_halt_validation;
443: End If;
444:

Line 456: okc_debug.log('3530: Before creating relation objects');

452: l_in_crjv_tbl(1).object1_id1 := l_lead_id;
453: l_in_crjv_tbl(1).object1_id2 := '#';
454: l_in_crjv_tbl(1).rty_code := g_rty_code;
455: IF (l_debug = 'Y') THEN
456: okc_debug.log('3530: Before creating relation objects');
457: END IF;
458: -- Call the rel object api
459: okc_k_rel_objs_pub.Create_Row(
460: p_api_version => 1.0, --p_api_version,--1.0,

Line 468: okc_debug.log('3540: After creating relation objects');

464: x_msg_data => l_msg_data,
465: p_crjv_tbl => l_in_crjv_tbl,
466: x_crjv_tbl => l_out_crjv_tbl);
467: IF (l_debug = 'Y') THEN
468: okc_debug.log('3540: After creating relation objects');
469: END IF;
470: If l_return_status <> okc_api.g_ret_sts_success Then
471: IF (l_debug = 'Y') THEN
472: okc_debug.log('3550: Return Status from Rel Objects Creation - ' || l_return_status);

Line 472: okc_debug.log('3550: Return Status from Rel Objects Creation - ' || l_return_status);

468: okc_debug.log('3540: After creating relation objects');
469: END IF;
470: If l_return_status <> okc_api.g_ret_sts_success Then
471: IF (l_debug = 'Y') THEN
472: okc_debug.log('3550: Return Status from Rel Objects Creation - ' || l_return_status);
473: END IF;
474: Raise g_exception_halt_validation;
475: End If;
476:

Line 484: okc_debug.log('3560: note creation:'|| Note_Message);

480: FND_MESSAGE.Set_Token('CONTEXT', p_context, FALSE);
481: Note_Message := FND_MESSAGE.Get;
482:
483: IF (l_debug = 'Y') THEN
484: okc_debug.log('3560: note creation:'|| Note_Message);
485: END IF;
486:
487: JTF_NOTES_PUB.Create_note (
488: p_api_version => 1.0,

Line 510: okc_debug.log('3570: After creating note');

506: p_last_update_login => FND_GLOBAL.LOGIN_ID
507: );
508:
509: IF (l_debug = 'Y') THEN
510: okc_debug.log('3570: After creating note');
511: END IF;
512: If l_return_status <> okc_api.g_ret_sts_success Then
513: IF (l_debug = 'Y') THEN
514: okc_debug.log('3580: Return Status from Note Creation - ' || l_return_status);

Line 514: okc_debug.log('3580: Return Status from Note Creation - ' || l_return_status);

510: okc_debug.log('3570: After creating note');
511: END IF;
512: If l_return_status <> okc_api.g_ret_sts_success Then
513: IF (l_debug = 'Y') THEN
514: okc_debug.log('3580: Return Status from Note Creation - ' || l_return_status);
515: END IF;
516: Raise g_exception_halt_validation;
517: End If;
518:

Line 526: okc_debug.log('4000: Exiting okc_opportunity_pvt.create_opp_header', 2);

522: x_msg_data := l_msg_data;
523: x_msg_count := l_msg_count;
524:
525: IF (l_debug = 'Y') THEN
526: okc_debug.log('4000: Exiting okc_opportunity_pvt.create_opp_header', 2);
527: okc_debug.Reset_Indentation;
528: END IF;
529: Exception
530: When g_exception_halt_validation Then

Line 527: okc_debug.Reset_Indentation;

523: x_msg_count := l_msg_count;
524:
525: IF (l_debug = 'Y') THEN
526: okc_debug.log('4000: Exiting okc_opportunity_pvt.create_opp_header', 2);
527: okc_debug.Reset_Indentation;
528: END IF;
529: Exception
530: When g_exception_halt_validation Then
531: x_return_status := l_return_status;

Line 533: okc_debug.log('3980: Exiting okc_opportunity_pvt.create_opp_header', 2);

529: Exception
530: When g_exception_halt_validation Then
531: x_return_status := l_return_status;
532: IF (l_debug = 'Y') THEN
533: okc_debug.log('3980: Exiting okc_opportunity_pvt.create_opp_header', 2);
534: okc_debug.Reset_Indentation;
535: END IF;
536: When Others Then
537: okc_api.Set_Message(p_app_name => g_app_name,

Line 534: okc_debug.Reset_Indentation;

530: When g_exception_halt_validation Then
531: x_return_status := l_return_status;
532: IF (l_debug = 'Y') THEN
533: okc_debug.log('3980: Exiting okc_opportunity_pvt.create_opp_header', 2);
534: okc_debug.Reset_Indentation;
535: END IF;
536: When Others Then
537: okc_api.Set_Message(p_app_name => g_app_name,
538: p_msg_name => g_unexpected_error,

Line 545: okc_debug.log('3990: Exiting okc_opportunity_pvt.create_opp_header', 2);

541: p_token2 => g_sqlerrm_token,
542: p_token2_value => sqlerrm);
543: x_return_status := okc_api.g_ret_sts_unexp_error;
544: IF (l_debug = 'Y') THEN
545: okc_debug.log('3990: Exiting okc_opportunity_pvt.create_opp_header', 2);
546: okc_debug.Reset_Indentation;
547: END IF;
548: End Create_Opp_Header;
549: --

Line 546: okc_debug.Reset_Indentation;

542: p_token2_value => sqlerrm);
543: x_return_status := okc_api.g_ret_sts_unexp_error;
544: IF (l_debug = 'Y') THEN
545: okc_debug.log('3990: Exiting okc_opportunity_pvt.create_opp_header', 2);
546: okc_debug.Reset_Indentation;
547: END IF;
548: End Create_Opp_Header;
549: --
550: PROCEDURE CREATE_OPP_LINES(p_api_version IN NUMBER,

Line 763: okc_debug.Set_Indentation('Create_Opp_Lines');

759: --
760: --
761: Begin
762: IF (l_debug = 'Y') THEN
763: okc_debug.Set_Indentation('Create_Opp_Lines');
764: okc_debug.log('5000: Entering okc_opportunity_pvt.create_opp_lines', 2);
765: okc_debug.log(' with next parameters:', 2);
766: okc_debug.log(' p_context = '||p_context);
767: okc_debug.log(' p_contract_id = '||p_contract_id);

Line 764: okc_debug.log('5000: Entering okc_opportunity_pvt.create_opp_lines', 2);

760: --
761: Begin
762: IF (l_debug = 'Y') THEN
763: okc_debug.Set_Indentation('Create_Opp_Lines');
764: okc_debug.log('5000: Entering okc_opportunity_pvt.create_opp_lines', 2);
765: okc_debug.log(' with next parameters:', 2);
766: okc_debug.log(' p_context = '||p_context);
767: okc_debug.log(' p_contract_id = '||p_contract_id);
768: okc_debug.log(' p_lead_id = '||p_lead_id);

Line 765: okc_debug.log(' with next parameters:', 2);

761: Begin
762: IF (l_debug = 'Y') THEN
763: okc_debug.Set_Indentation('Create_Opp_Lines');
764: okc_debug.log('5000: Entering okc_opportunity_pvt.create_opp_lines', 2);
765: okc_debug.log(' with next parameters:', 2);
766: okc_debug.log(' p_context = '||p_context);
767: okc_debug.log(' p_contract_id = '||p_contract_id);
768: okc_debug.log(' p_lead_id = '||p_lead_id);
769: okc_debug.log(' g_rty_code = '||g_rty_code);

Line 766: okc_debug.log(' p_context = '||p_context);

762: IF (l_debug = 'Y') THEN
763: okc_debug.Set_Indentation('Create_Opp_Lines');
764: okc_debug.log('5000: Entering okc_opportunity_pvt.create_opp_lines', 2);
765: okc_debug.log(' with next parameters:', 2);
766: okc_debug.log(' p_context = '||p_context);
767: okc_debug.log(' p_contract_id = '||p_contract_id);
768: okc_debug.log(' p_lead_id = '||p_lead_id);
769: okc_debug.log(' g_rty_code = '||g_rty_code);
770: END IF;

Line 767: okc_debug.log(' p_contract_id = '||p_contract_id);

763: okc_debug.Set_Indentation('Create_Opp_Lines');
764: okc_debug.log('5000: Entering okc_opportunity_pvt.create_opp_lines', 2);
765: okc_debug.log(' with next parameters:', 2);
766: okc_debug.log(' p_context = '||p_context);
767: okc_debug.log(' p_contract_id = '||p_contract_id);
768: okc_debug.log(' p_lead_id = '||p_lead_id);
769: okc_debug.log(' g_rty_code = '||g_rty_code);
770: END IF;
771: x_return_status := okc_api.g_ret_sts_success;

Line 768: okc_debug.log(' p_lead_id = '||p_lead_id);

764: okc_debug.log('5000: Entering okc_opportunity_pvt.create_opp_lines', 2);
765: okc_debug.log(' with next parameters:', 2);
766: okc_debug.log(' p_context = '||p_context);
767: okc_debug.log(' p_contract_id = '||p_contract_id);
768: okc_debug.log(' p_lead_id = '||p_lead_id);
769: okc_debug.log(' g_rty_code = '||g_rty_code);
770: END IF;
771: x_return_status := okc_api.g_ret_sts_success;
772: -- Set the org_id for the curernt contract

Line 769: okc_debug.log(' g_rty_code = '||g_rty_code);

765: okc_debug.log(' with next parameters:', 2);
766: okc_debug.log(' p_context = '||p_context);
767: okc_debug.log(' p_contract_id = '||p_contract_id);
768: okc_debug.log(' p_lead_id = '||p_lead_id);
769: okc_debug.log(' g_rty_code = '||g_rty_code);
770: END IF;
771: x_return_status := okc_api.g_ret_sts_success;
772: -- Set the org_id for the curernt contract
773: l_org_id := okc_context.get_okc_org_id;

Line 786: okc_debug.log('5005: Updating total header amount to '||l_updt_hdr_tot_amt, 2);

782:
783: l_header_rec.total_amount := l_updt_hdr_tot_amt;
784:
785: IF (l_debug = 'Y') THEN
786: okc_debug.log('5005: Updating total header amount to '||l_updt_hdr_tot_amt, 2);
787: END IF;
788: -- update header now
789: AS_OPPORTUNITY_PUB.Update_Opp_Header
790: ( p_api_version_number => 2.0,

Line 811: okc_debug.log('5010: Before opening cursor line_csr');

807:
808:
809: --
810: IF (l_debug = 'Y') THEN
811: okc_debug.log('5010: Before opening cursor line_csr');
812: END IF;
813: /* -- GF
814: -- Get all the eligible contract lines for opp lines creation
815: Open line_csr;

Line 825: okc_debug.log('5020: After Closing cursor line_csr');

821: l_currency_code_tbl;
822: Close line_csr;
823: --
824: IF (l_debug = 'Y') THEN
825: okc_debug.log('5020: After Closing cursor line_csr');
826: END IF;
827: l_count := l_id_tbl.count;
828: IF (l_debug = 'Y') THEN
829: okc_debug.log('5030: Number of lines for Opp creation - ' || to_char(l_count));

Line 829: okc_debug.log('5030: Number of lines for Opp creation - ' || to_char(l_count));

825: okc_debug.log('5020: After Closing cursor line_csr');
826: END IF;
827: l_count := l_id_tbl.count;
828: IF (l_debug = 'Y') THEN
829: okc_debug.log('5030: Number of lines for Opp creation - ' || to_char(l_count));
830: END IF;
831: */
832: -- Process further only if there are some eligible lines.
833: -- This should not arise since is_opp_creation_allowed will return Error

Line 862: okc_debug.log('5031.1: Opportunity line #'||l_object1_id1||' has already been created as expired for renewed line ');

858: l_rel_lead_line_id_tbl(l_rel_index) := l_object1_id1;
859: l_rel_index := l_rel_index + 1;
860: IF l_object1_id1 IS NOT NULL THEN
861: IF (l_debug = 'Y') THEN
862: okc_debug.log('5031.1: Opportunity line #'||l_object1_id1||' has already been created as expired for renewed line ');
863: END IF;
864: else
865: -- Make sure the parent is not already processed
866: -- If Not Parent_Inv_Item_Exists(l_cle_id_tbl(i)) Then

Line 868: okc_debug.log('5031.2: Contract line '||line_csr_rec.id||' is going to be included into opportunity');

864: else
865: -- Make sure the parent is not already processed
866: -- If Not Parent_Inv_Item_Exists(l_cle_id_tbl(i)) Then
867: IF (l_debug = 'Y') THEN
868: okc_debug.log('5031.2: Contract line '||line_csr_rec.id||' is going to be included into opportunity');
869: END IF;
870: /*
871: -- Get the item details
872: l_object1_id1 := NULL;

Line 897: okc_debug.log('5032: inventory_item_id='||line_csr_rec.object1_id1);

893: Close item_interest_csr;
894: -- Prepare the opp lines table for api call
895: l_line_tbl(l_index).lead_id := p_lead_id;
896: IF (l_debug = 'Y') THEN
897: okc_debug.log('5032: inventory_item_id='||line_csr_rec.object1_id1);
898: END IF;
899: l_line_tbl(l_index).inventory_item_id := line_csr_rec.object1_id1;
900: l_line_tbl(l_index).organization_id := line_csr_rec.object1_id2;
901: IF (l_debug = 'Y') THEN

Line 902: okc_debug.log('5033: uom_code='||line_csr_rec.uom_code);

898: END IF;
899: l_line_tbl(l_index).inventory_item_id := line_csr_rec.object1_id1;
900: l_line_tbl(l_index).organization_id := line_csr_rec.object1_id2;
901: IF (l_debug = 'Y') THEN
902: okc_debug.log('5033: uom_code='||line_csr_rec.uom_code);
903: END IF;
904: l_line_tbl(l_index).uom_code := line_csr_rec.uom_code;
905: IF (l_debug = 'Y') THEN
906: okc_debug.log('5034: quantity='||line_csr_rec.number_of_items);

Line 906: okc_debug.log('5034: quantity='||line_csr_rec.number_of_items);

902: okc_debug.log('5033: uom_code='||line_csr_rec.uom_code);
903: END IF;
904: l_line_tbl(l_index).uom_code := line_csr_rec.uom_code;
905: IF (l_debug = 'Y') THEN
906: okc_debug.log('5034: quantity='||line_csr_rec.number_of_items);
907: END IF;
908: l_line_tbl(l_index).quantity := line_csr_rec.number_of_items;
909: IF (l_debug = 'Y') THEN
910: okc_debug.log('5035: total_amount='||line_csr_rec.price_negotiated);

Line 910: okc_debug.log('5035: total_amount='||line_csr_rec.price_negotiated);

906: okc_debug.log('5034: quantity='||line_csr_rec.number_of_items);
907: END IF;
908: l_line_tbl(l_index).quantity := line_csr_rec.number_of_items;
909: IF (l_debug = 'Y') THEN
910: okc_debug.log('5035: total_amount='||line_csr_rec.price_negotiated);
911: END IF;
912: l_line_tbl(l_index).total_amount := line_csr_rec.price_negotiated;
913: l_line_tbl(l_index).unit_price := line_csr_rec.price_unit;
914: l_line_tbl(l_index).price := line_csr_rec.price_negotiated;

Line 918: okc_debug.log('5035: interest_type_id='||l_interest_type_id);

914: l_line_tbl(l_index).price := line_csr_rec.price_negotiated;
915: l_line_tbl(l_index).currency_code := line_csr_rec.currency_code;
916: l_line_tbl(l_index).org_id := l_org_id;
917: IF (l_debug = 'Y') THEN
918: okc_debug.log('5035: interest_type_id='||l_interest_type_id);
919: END IF;
920: l_line_tbl(l_index).interest_type_id := l_interest_type_id;
921: l_line_tbl(l_index).primary_interest_code_id := l_primary_interest_code_id;
922: l_line_tbl(l_index).secondary_interest_code_id := l_secondary_interest_code_id;

Line 930: okc_debug.log('5040: '||l_line_tbl.count ||' lines are requested to be created on total amount:'||l_updt_hdr_tot_amt);

926: End Loop;
927: --
928: l_header_rec.total_amount := l_updt_hdr_tot_amt; --??
929: IF (l_debug = 'Y') THEN
930: okc_debug.log('5040: '||l_line_tbl.count ||' lines are requested to be created on total amount:'||l_updt_hdr_tot_amt);
931: END IF;
932: -- Call the opp lines api
933: IF l_line_tbl.count>0 THEN
934: IF (l_debug = 'Y') THEN

Line 935: okc_debug.log('5043: Before calling as_opportunity_pub.create_opp_lines');

931: END IF;
932: -- Call the opp lines api
933: IF l_line_tbl.count>0 THEN
934: IF (l_debug = 'Y') THEN
935: okc_debug.log('5043: Before calling as_opportunity_pub.create_opp_lines');
936: END IF;
937: AS_OPPORTUNITY_PUB.Create_Opp_Lines(
938: p_api_version_number => 2.0, --p_api_version,--2.0,
939: p_init_msg_list => p_init_msg_list, --fnd_api.g_false,

Line 958: okc_debug.log('5048: After calling as_opportunity_pub.create_opp_lines');

954: x_msg_count => l_msg_count,
955: x_msg_data => l_msg_data);
956: --
957: IF (l_debug = 'Y') THEN
958: okc_debug.log('5048: After calling as_opportunity_pub.create_opp_lines');
959: END IF;
960: If l_return_status <> okc_api.g_ret_sts_success Then
961: IF (l_debug = 'Y') THEN
962: okc_debug.log('5049: Opp Lines Return Status - ' || l_return_status);

Line 962: okc_debug.log('5049: Opp Lines Return Status - ' || l_return_status);

958: okc_debug.log('5048: After calling as_opportunity_pub.create_opp_lines');
959: END IF;
960: If l_return_status <> okc_api.g_ret_sts_success Then
961: IF (l_debug = 'Y') THEN
962: okc_debug.log('5049: Opp Lines Return Status - ' || l_return_status);
963: END IF;
964: Raise g_exception_halt_validation;
965: End If;
966: --

Line 970: okc_debug.log('5060: There are not lines to be inserted into Oppurtunity');

966: --
967: l_count := l_line_out_tbl.count;
968: ELSE
969: IF (l_debug = 'Y') THEN
970: okc_debug.log('5060: There are not lines to be inserted into Oppurtunity');
971: END IF;
972: IF g_opp_h_created THEN
973: IF (l_debug = 'Y') THEN
974: okc_debug.log('5061: We should remove Opportunity Header because we''ve created it by mistake');

Line 974: okc_debug.log('5061: We should remove Opportunity Header because we''ve created it by mistake');

970: okc_debug.log('5060: There are not lines to be inserted into Oppurtunity');
971: END IF;
972: IF g_opp_h_created THEN
973: IF (l_debug = 'Y') THEN
974: okc_debug.log('5061: We should remove Opportunity Header because we''ve created it by mistake');
975: okc_debug.log('5063: Before calling as_opportunity_pub.Delete_Opp_Header');
976: END IF;
977: AS_OPPORTUNITY_PUB.Delete_Opp_Header(
978: p_api_version_number => 2.0, --p_api_version,--2.0,

Line 975: okc_debug.log('5063: Before calling as_opportunity_pub.Delete_Opp_Header');

971: END IF;
972: IF g_opp_h_created THEN
973: IF (l_debug = 'Y') THEN
974: okc_debug.log('5061: We should remove Opportunity Header because we''ve created it by mistake');
975: okc_debug.log('5063: Before calling as_opportunity_pub.Delete_Opp_Header');
976: END IF;
977: AS_OPPORTUNITY_PUB.Delete_Opp_Header(
978: p_api_version_number => 2.0, --p_api_version,--2.0,
979: p_init_msg_list => p_init_msg_list, --fnd_api.g_false,

Line 996: okc_debug.log('5068: After calling as_opportunity_pub.Delete_Opp_Header');

992: x_lead_id => l_lead_id
993: );
994: --
995: IF (l_debug = 'Y') THEN
996: okc_debug.log('5068: After calling as_opportunity_pub.Delete_Opp_Header');
997: END IF;
998: If l_return_status <> okc_api.g_ret_sts_success Then
999: IF (l_debug = 'Y') THEN
1000: okc_debug.log('5069: Opp Lines Return Status - ' || l_return_status);

Line 1000: okc_debug.log('5069: Opp Lines Return Status - ' || l_return_status);

996: okc_debug.log('5068: After calling as_opportunity_pub.Delete_Opp_Header');
997: END IF;
998: If l_return_status <> okc_api.g_ret_sts_success Then
999: IF (l_debug = 'Y') THEN
1000: okc_debug.log('5069: Opp Lines Return Status - ' || l_return_status);
1001: END IF;
1002: Raise g_exception_halt_validation;
1003: End If;
1004: End If; -- IF g_opp_h_created THEN

Line 1009: okc_debug.log('5070: Number of lines processed - ' || To_Char(l_count));

1005: --
1006: l_count := 0;
1007: END IF;
1008: IF (l_debug = 'Y') THEN
1009: okc_debug.log('5070: Number of lines processed - ' || To_Char(l_count));
1010: END IF;
1011:
1012: -- Now we need to populate the rel objects table
1013: If l_rel_id_tbl.count > 0 Then

Line 1019: okc_debug.log('5075: Contract Line ID - ' ||l_rel_id_tbl(i));

1015: l_rel_index := 1; -- point onto rec in l_in_crjv_tbl
1016: For i in l_rel_id_tbl.FIRST..l_rel_id_tbl.LAST -- point onto rec in l_rel_id_tbl
1017: Loop
1018: IF (l_debug = 'Y') THEN
1019: okc_debug.log('5075: Contract Line ID - ' ||l_rel_id_tbl(i));
1020: END IF;
1021: If l_rel_lead_line_id_tbl(i) IS NULL Then
1022: IF (l_debug = 'Y') THEN
1023: okc_debug.log('5080: Processed Line Status - ' || l_line_out_tbl(l_index).return_status);

Line 1023: okc_debug.log('5080: Processed Line Status - ' || l_line_out_tbl(l_index).return_status);

1019: okc_debug.log('5075: Contract Line ID - ' ||l_rel_id_tbl(i));
1020: END IF;
1021: If l_rel_lead_line_id_tbl(i) IS NULL Then
1022: IF (l_debug = 'Y') THEN
1023: okc_debug.log('5080: Processed Line Status - ' || l_line_out_tbl(l_index).return_status);
1024: END IF;
1025: If l_line_out_tbl(l_index).return_status = okc_api.g_ret_sts_success Then
1026: l_rel_lead_line_id_tbl(i) := l_line_out_tbl(l_index).lead_line_id;
1027: IF (l_debug = 'Y') THEN

Line 1028: okc_debug.log('5081: Opportunity for the line was created successfully');

1024: END IF;
1025: If l_line_out_tbl(l_index).return_status = okc_api.g_ret_sts_success Then
1026: l_rel_lead_line_id_tbl(i) := l_line_out_tbl(l_index).lead_line_id;
1027: IF (l_debug = 'Y') THEN
1028: okc_debug.log('5081: Opportunity for the line was created successfully');
1029: END IF;
1030: else
1031: IF (l_debug = 'Y') THEN
1032: okc_debug.log('5082: Opportunity for the line was not created');

Line 1032: okc_debug.log('5082: Opportunity for the line was not created');

1028: okc_debug.log('5081: Opportunity for the line was created successfully');
1029: END IF;
1030: else
1031: IF (l_debug = 'Y') THEN
1032: okc_debug.log('5082: Opportunity for the line was not created');
1033: END IF;
1034: END IF;
1035: l_index := l_index + 1;
1036: ELSE

Line 1038: okc_debug.log('5085: Opportunity for the line exists');

1034: END IF;
1035: l_index := l_index + 1;
1036: ELSE
1037: IF (l_debug = 'Y') THEN
1038: okc_debug.log('5085: Opportunity for the line exists');
1039: END IF;
1040: END IF;
1041: If l_rel_lead_line_id_tbl(i) IS NOT NULL Then
1042: IF (l_debug = 'Y') THEN

Line 1043: okc_debug.log('5090: Opportunity Line ID - ' ||l_rel_lead_line_id_tbl(i));

1039: END IF;
1040: END IF;
1041: If l_rel_lead_line_id_tbl(i) IS NOT NULL Then
1042: IF (l_debug = 'Y') THEN
1043: okc_debug.log('5090: Opportunity Line ID - ' ||l_rel_lead_line_id_tbl(i));
1044: END IF;
1045: -- prepare the rel obj table for api call
1046: l_in_crjv_tbl(l_rel_index).object_version_number := 1;
1047: l_in_crjv_tbl(l_rel_index).cle_id := l_rel_id_tbl(i);

Line 1056: okc_debug.log(' ------------ ' );

1052: l_in_crjv_tbl(l_rel_index).rty_code := g_rty_code;
1053: l_rel_index := l_rel_index + 1;
1054: End If;
1055: IF (l_debug = 'Y') THEN
1056: okc_debug.log(' ------------ ' );
1057: END IF;
1058: End Loop;
1059: If l_in_crjv_tbl.count > 0 Then
1060: IF (l_debug = 'Y') THEN

Line 1061: okc_debug.log('5091: Before creating relation objects');

1057: END IF;
1058: End Loop;
1059: If l_in_crjv_tbl.count > 0 Then
1060: IF (l_debug = 'Y') THEN
1061: okc_debug.log('5091: Before creating relation objects');
1062: okc_debug.log('5092: '||l_in_crjv_tbl.count||' relation lines to be created ');
1063: END IF;
1064: -- Call the api here
1065: okc_k_rel_objs_pub.Create_Row(

Line 1062: okc_debug.log('5092: '||l_in_crjv_tbl.count||' relation lines to be created ');

1058: End Loop;
1059: If l_in_crjv_tbl.count > 0 Then
1060: IF (l_debug = 'Y') THEN
1061: okc_debug.log('5091: Before creating relation objects');
1062: okc_debug.log('5092: '||l_in_crjv_tbl.count||' relation lines to be created ');
1063: END IF;
1064: -- Call the api here
1065: okc_k_rel_objs_pub.Create_Row(
1066: p_api_version => 1.0, --p_api_version

Line 1074: okc_debug.log('5095: After creating relation objects');

1070: x_msg_data => l_msg_data,
1071: p_crjv_tbl => l_in_crjv_tbl,
1072: x_crjv_tbl => l_out_crjv_tbl);
1073: IF (l_debug = 'Y') THEN
1074: okc_debug.log('5095: After creating relation objects');
1075: okc_debug.log('5096: '||l_out_crjv_tbl.count||' relation lines were created ');
1076: END IF;
1077: If l_return_status <> okc_api.g_ret_sts_success Then
1078: IF (l_debug = 'Y') THEN

Line 1075: okc_debug.log('5096: '||l_out_crjv_tbl.count||' relation lines were created ');

1071: p_crjv_tbl => l_in_crjv_tbl,
1072: x_crjv_tbl => l_out_crjv_tbl);
1073: IF (l_debug = 'Y') THEN
1074: okc_debug.log('5095: After creating relation objects');
1075: okc_debug.log('5096: '||l_out_crjv_tbl.count||' relation lines were created ');
1076: END IF;
1077: If l_return_status <> okc_api.g_ret_sts_success Then
1078: IF (l_debug = 'Y') THEN
1079: okc_debug.log('5099: Return Status from Rel Objects Creation - ' || l_return_status);

Line 1079: okc_debug.log('5099: Return Status from Rel Objects Creation - ' || l_return_status);

1075: okc_debug.log('5096: '||l_out_crjv_tbl.count||' relation lines were created ');
1076: END IF;
1077: If l_return_status <> okc_api.g_ret_sts_success Then
1078: IF (l_debug = 'Y') THEN
1079: okc_debug.log('5099: Return Status from Rel Objects Creation - ' || l_return_status);
1080: END IF;
1081: Raise g_exception_halt_validation;
1082: End If;
1083: End If;

Line 1089: okc_debug.log('5100: No lines selected for opp creation');

1085: /* Else -- If l_count > 0 Then -- 1
1086: -- this should never happen since this will be trapped by the itm_csr,
1087: -- line_csr and rel_csr cursor in is_opp_creation_allowed itself.
1088: IF (l_debug = 'Y') THEN
1089: okc_debug.log('5100: No lines selected for opp creation');
1090: END IF;
1091: l_return_status := okc_api.g_ret_sts_error;
1092: Raise g_exception_halt_validation;
1093: End If;*/

Line 1100: okc_debug.log('6000: Exiting okc_opportunity_pvt.create_opp_lines', 2);

1096: x_msg_data := l_msg_data;
1097: x_msg_count := l_msg_count;
1098:
1099: IF (l_debug = 'Y') THEN
1100: okc_debug.log('6000: Exiting okc_opportunity_pvt.create_opp_lines', 2);
1101: okc_debug.Reset_Indentation;
1102: END IF;
1103: Exception
1104: When g_exception_halt_validation Then

Line 1101: okc_debug.Reset_Indentation;

1097: x_msg_count := l_msg_count;
1098:
1099: IF (l_debug = 'Y') THEN
1100: okc_debug.log('6000: Exiting okc_opportunity_pvt.create_opp_lines', 2);
1101: okc_debug.Reset_Indentation;
1102: END IF;
1103: Exception
1104: When g_exception_halt_validation Then
1105: x_return_status := l_return_status;

Line 1107: okc_debug.log('5980: Exiting okc_opportunity_pvt.create_opp_lines', 2);

1103: Exception
1104: When g_exception_halt_validation Then
1105: x_return_status := l_return_status;
1106: IF (l_debug = 'Y') THEN
1107: okc_debug.log('5980: Exiting okc_opportunity_pvt.create_opp_lines', 2);
1108: okc_debug.Reset_Indentation;
1109: END IF;
1110: When Others Then
1111: okc_api.Set_Message(p_app_name => g_app_name,

Line 1108: okc_debug.Reset_Indentation;

1104: When g_exception_halt_validation Then
1105: x_return_status := l_return_status;
1106: IF (l_debug = 'Y') THEN
1107: okc_debug.log('5980: Exiting okc_opportunity_pvt.create_opp_lines', 2);
1108: okc_debug.Reset_Indentation;
1109: END IF;
1110: When Others Then
1111: okc_api.Set_Message(p_app_name => g_app_name,
1112: p_msg_name => g_unexpected_error,

Line 1119: okc_debug.log('5990: Exiting okc_opportunity_pvt.create_opp_lines', 2);

1115: p_token2 => g_sqlerrm_token,
1116: p_token2_value => sqlerrm);
1117: x_return_status := okc_api.g_ret_sts_unexp_error;
1118: IF (l_debug = 'Y') THEN
1119: okc_debug.log('5990: Exiting okc_opportunity_pvt.create_opp_lines', 2);
1120: okc_debug.Reset_Indentation;
1121: END IF;
1122: End Create_Opp_Lines;
1123:

Line 1120: okc_debug.Reset_Indentation;

1116: p_token2_value => sqlerrm);
1117: x_return_status := okc_api.g_ret_sts_unexp_error;
1118: IF (l_debug = 'Y') THEN
1119: okc_debug.log('5990: Exiting okc_opportunity_pvt.create_opp_lines', 2);
1120: okc_debug.Reset_Indentation;
1121: END IF;
1122: End Create_Opp_Lines;
1123:
1124: PROCEDURE IS_OPP_CREATION_ALLOWED(p_context IN VARCHAR2,

Line 1207: okc_debug.Set_Indentation('Is_Opp_Creation_Allowed');

1203: l_row_notfound Boolean;
1204: --
1205: Begin
1206: IF (l_debug = 'Y') THEN
1207: okc_debug.Set_Indentation('Is_Opp_Creation_Allowed');
1208: okc_debug.log('7000: Entering okc_opportunity_pvt.is_opp_creation_allowed', 2);
1209: END IF;
1210: x_return_status := okc_api.g_ret_sts_success;
1211: -- Get contract's details

Line 1208: okc_debug.log('7000: Entering okc_opportunity_pvt.is_opp_creation_allowed', 2);

1204: --
1205: Begin
1206: IF (l_debug = 'Y') THEN
1207: okc_debug.Set_Indentation('Is_Opp_Creation_Allowed');
1208: okc_debug.log('7000: Entering okc_opportunity_pvt.is_opp_creation_allowed', 2);
1209: END IF;
1210: x_return_status := okc_api.g_ret_sts_success;
1211: -- Get contract's details
1212: Open k_csr;

Line 1272: okc_debug.log('7300: Invalid contract status for the context' );

1268: If NOT(( p_context in ('AUTHORING', 'RENEW') And k_rec.ste_code = 'ENTERED')
1269: OR (p_context = 'EXPIRE' And k_rec.ste_code In ('SIGNED', 'ACTIVE') ))
1270: Then
1271: IF (l_debug = 'Y') THEN
1272: okc_debug.log('7300: Invalid contract status for the context' );
1273: okc_debug.log('7310: p_context='||p_context||', ste_code='||k_rec.ste_code );
1274: END IF;
1275: ----If p_context = 'AUTHORING' Then
1276: okc_api.Set_Message(G_APP_NAME, 'OKC_OPP_INVALID_STATUS');

Line 1273: okc_debug.log('7310: p_context='||p_context||', ste_code='||k_rec.ste_code );

1269: OR (p_context = 'EXPIRE' And k_rec.ste_code In ('SIGNED', 'ACTIVE') ))
1270: Then
1271: IF (l_debug = 'Y') THEN
1272: okc_debug.log('7300: Invalid contract status for the context' );
1273: okc_debug.log('7310: p_context='||p_context||', ste_code='||k_rec.ste_code );
1274: END IF;
1275: ----If p_context = 'AUTHORING' Then
1276: okc_api.Set_Message(G_APP_NAME, 'OKC_OPP_INVALID_STATUS');
1277: ----End If;

Line 1360: okc_debug.log('7500: Opportunity Creation is allowed');

1356: Raise g_exception_halt_validation;
1357: End If;
1358: --
1359: IF (l_debug = 'Y') THEN
1360: okc_debug.log('7500: Opportunity Creation is allowed');
1361: okc_debug.log('8000: Exiting okc_opportunity_pvt.is_opp_creation_allowed', 2);
1362: okc_debug.Reset_Indentation;
1363: END IF;
1364: Exception

Line 1361: okc_debug.log('8000: Exiting okc_opportunity_pvt.is_opp_creation_allowed', 2);

1357: End If;
1358: --
1359: IF (l_debug = 'Y') THEN
1360: okc_debug.log('7500: Opportunity Creation is allowed');
1361: okc_debug.log('8000: Exiting okc_opportunity_pvt.is_opp_creation_allowed', 2);
1362: okc_debug.Reset_Indentation;
1363: END IF;
1364: Exception
1365: When g_exception_halt_validation Then

Line 1362: okc_debug.Reset_Indentation;

1358: --
1359: IF (l_debug = 'Y') THEN
1360: okc_debug.log('7500: Opportunity Creation is allowed');
1361: okc_debug.log('8000: Exiting okc_opportunity_pvt.is_opp_creation_allowed', 2);
1362: okc_debug.Reset_Indentation;
1363: END IF;
1364: Exception
1365: When g_exception_halt_validation Then
1366: x_return_status := okc_api.g_ret_sts_error;

Line 1368: okc_debug.log('7600: Opportunity Creation is not allowed');

1364: Exception
1365: When g_exception_halt_validation Then
1366: x_return_status := okc_api.g_ret_sts_error;
1367: IF (l_debug = 'Y') THEN
1368: okc_debug.log('7600: Opportunity Creation is not allowed');
1369: okc_debug.log('7980: Exiting okc_opportunity_pvt.is_opp_creation_allowed', 2);
1370: okc_debug.Reset_Indentation;
1371: END IF;
1372: When Others Then

Line 1369: okc_debug.log('7980: Exiting okc_opportunity_pvt.is_opp_creation_allowed', 2);

1365: When g_exception_halt_validation Then
1366: x_return_status := okc_api.g_ret_sts_error;
1367: IF (l_debug = 'Y') THEN
1368: okc_debug.log('7600: Opportunity Creation is not allowed');
1369: okc_debug.log('7980: Exiting okc_opportunity_pvt.is_opp_creation_allowed', 2);
1370: okc_debug.Reset_Indentation;
1371: END IF;
1372: When Others Then
1373: okc_api.Set_Message(p_app_name => g_app_name,

Line 1370: okc_debug.Reset_Indentation;

1366: x_return_status := okc_api.g_ret_sts_error;
1367: IF (l_debug = 'Y') THEN
1368: okc_debug.log('7600: Opportunity Creation is not allowed');
1369: okc_debug.log('7980: Exiting okc_opportunity_pvt.is_opp_creation_allowed', 2);
1370: okc_debug.Reset_Indentation;
1371: END IF;
1372: When Others Then
1373: okc_api.Set_Message(p_app_name => g_app_name,
1374: p_msg_name => g_unexpected_error,

Line 1381: okc_debug.log('7990: Exiting okc_opportunity_pvt.is_opp_creation_allowed', 2);

1377: p_token2 => g_sqlerrm_token,
1378: p_token2_value => sqlerrm);
1379: x_return_status := okc_api.g_ret_sts_unexp_error;
1380: IF (l_debug = 'Y') THEN
1381: okc_debug.log('7990: Exiting okc_opportunity_pvt.is_opp_creation_allowed', 2);
1382: okc_debug.Reset_Indentation;
1383: END IF;
1384: End Is_Opp_Creation_Allowed;
1385:

Line 1382: okc_debug.Reset_Indentation;

1378: p_token2_value => sqlerrm);
1379: x_return_status := okc_api.g_ret_sts_unexp_error;
1380: IF (l_debug = 'Y') THEN
1381: okc_debug.log('7990: Exiting okc_opportunity_pvt.is_opp_creation_allowed', 2);
1382: okc_debug.Reset_Indentation;
1383: END IF;
1384: End Is_Opp_Creation_Allowed;
1385:
1386: PROCEDURE GET_OPP_DEFAULTS(p_context IN VARCHAR2,

Line 1406: okc_debug.Set_Indentation('Get_Opp_Defaults');

1402: l_row_found Boolean;
1403: --
1404: Begin
1405: IF (l_debug = 'Y') THEN
1406: okc_debug.Set_Indentation('Get_Opp_Defaults');
1407: okc_debug.log('9000: Entering okc_opportunity_pvt.get_opp_defaults', 2);
1408: okc_debug.log('9010: Calling Mode - ' || p_context);
1409: END IF;
1410: x_return_status := okc_api.g_ret_sts_success;

Line 1407: okc_debug.log('9000: Entering okc_opportunity_pvt.get_opp_defaults', 2);

1403: --
1404: Begin
1405: IF (l_debug = 'Y') THEN
1406: okc_debug.Set_Indentation('Get_Opp_Defaults');
1407: okc_debug.log('9000: Entering okc_opportunity_pvt.get_opp_defaults', 2);
1408: okc_debug.log('9010: Calling Mode - ' || p_context);
1409: END IF;
1410: x_return_status := okc_api.g_ret_sts_success;
1411: --

Line 1408: okc_debug.log('9010: Calling Mode - ' || p_context);

1404: Begin
1405: IF (l_debug = 'Y') THEN
1406: okc_debug.Set_Indentation('Get_Opp_Defaults');
1407: okc_debug.log('9000: Entering okc_opportunity_pvt.get_opp_defaults', 2);
1408: okc_debug.log('9010: Calling Mode - ' || p_context);
1409: END IF;
1410: x_return_status := okc_api.g_ret_sts_success;
1411: --
1412: If p_context = 'RENEW' Then

Line 1434: okc_debug.log('9050: Fetching win_probability from profile');

1430: End If;
1431: --
1432: If x_win_probability Is Null Then
1433: IF (l_debug = 'Y') THEN
1434: okc_debug.log('9050: Fetching win_probability from profile');
1435: END IF;
1436: x_win_probability := Fnd_Profile.Value('AS_OPP_WIN_PROBABILITY');
1437: End If;
1438: If x_closing_date_days Is Null Then

Line 1440: okc_debug.log('9060: Fetching closing_date_days from profile');

1436: x_win_probability := Fnd_Profile.Value('AS_OPP_WIN_PROBABILITY');
1437: End If;
1438: If x_closing_date_days Is Null Then
1439: IF (l_debug = 'Y') THEN
1440: okc_debug.log('9060: Fetching closing_date_days from profile');
1441: END IF;
1442: x_closing_date_days := Fnd_Profile.Value('AS_OPP_CLOSING_DATE_DAYS');
1443: End If;
1444: --

Line 1446: okc_debug.log('9070: x_win_probability - ' || x_win_probability);

1442: x_closing_date_days := Fnd_Profile.Value('AS_OPP_CLOSING_DATE_DAYS');
1443: End If;
1444: --
1445: IF (l_debug = 'Y') THEN
1446: okc_debug.log('9070: x_win_probability - ' || x_win_probability);
1447: okc_debug.log('9080: x_closing_date_days - ' || x_closing_date_days);
1448: okc_debug.log('10000: Exiting okc_opportunity_pvt.get_opp_defaults', 2);
1449: okc_debug.Reset_Indentation;
1450: END IF;

Line 1447: okc_debug.log('9080: x_closing_date_days - ' || x_closing_date_days);

1443: End If;
1444: --
1445: IF (l_debug = 'Y') THEN
1446: okc_debug.log('9070: x_win_probability - ' || x_win_probability);
1447: okc_debug.log('9080: x_closing_date_days - ' || x_closing_date_days);
1448: okc_debug.log('10000: Exiting okc_opportunity_pvt.get_opp_defaults', 2);
1449: okc_debug.Reset_Indentation;
1450: END IF;
1451: Exception

Line 1448: okc_debug.log('10000: Exiting okc_opportunity_pvt.get_opp_defaults', 2);

1444: --
1445: IF (l_debug = 'Y') THEN
1446: okc_debug.log('9070: x_win_probability - ' || x_win_probability);
1447: okc_debug.log('9080: x_closing_date_days - ' || x_closing_date_days);
1448: okc_debug.log('10000: Exiting okc_opportunity_pvt.get_opp_defaults', 2);
1449: okc_debug.Reset_Indentation;
1450: END IF;
1451: Exception
1452: When Others Then

Line 1449: okc_debug.Reset_Indentation;

1445: IF (l_debug = 'Y') THEN
1446: okc_debug.log('9070: x_win_probability - ' || x_win_probability);
1447: okc_debug.log('9080: x_closing_date_days - ' || x_closing_date_days);
1448: okc_debug.log('10000: Exiting okc_opportunity_pvt.get_opp_defaults', 2);
1449: okc_debug.Reset_Indentation;
1450: END IF;
1451: Exception
1452: When Others Then
1453: okc_api.Set_Message(p_app_name => g_app_name,

Line 1461: okc_debug.log('9990: Exiting okc_opportunity_pvt.get_opp_defaults', 2);

1457: p_token2 => g_sqlerrm_token,
1458: p_token2_value => sqlerrm);
1459: x_return_status := okc_api.g_ret_sts_unexp_error;
1460: IF (l_debug = 'Y') THEN
1461: okc_debug.log('9990: Exiting okc_opportunity_pvt.get_opp_defaults', 2);
1462: okc_debug.Reset_Indentation;
1463: END IF;
1464: End Get_Opp_Defaults;
1465: END OKC_OPPORTUNITY_PVT;

Line 1462: okc_debug.Reset_Indentation;

1458: p_token2_value => sqlerrm);
1459: x_return_status := okc_api.g_ret_sts_unexp_error;
1460: IF (l_debug = 'Y') THEN
1461: okc_debug.log('9990: Exiting okc_opportunity_pvt.get_opp_defaults', 2);
1462: okc_debug.Reset_Indentation;
1463: END IF;
1464: End Get_Opp_Defaults;
1465: END OKC_OPPORTUNITY_PVT;