77:
78: BEGIN
79:
80: IF (l_debug = 'Y') THEN
81: okc_debug.Set_Indentation(l_proc);
82: okc_debug.Log('10: Entering ',2);
83: END IF;
84:
85: IF NVL(FND_PROFILE.VALUE('AFLOG_ENABLED'),'N') = 'Y' THEN
78: BEGIN
79:
80: IF (l_debug = 'Y') THEN
81: okc_debug.Set_Indentation(l_proc);
82: okc_debug.Log('10: Entering ',2);
83: END IF;
84:
85: IF NVL(FND_PROFILE.VALUE('AFLOG_ENABLED'),'N') = 'Y' THEN
86: okc_util.init_trace;
93: fnd_file.put_line(FND_FILE.LOG,' ');
94: fnd_file.put_line(FND_FILE.LOG,' ');
95:
96: IF (l_debug = 'Y') THEN
97: okc_debug.Log('20: p_dflt_price_list_id : '||p_dflt_price_list_id,2);
98: okc_debug.Log('20: p_category_code : '||p_category_code,2);
99: okc_debug.Log('20: p_enable_qp_profile : '||p_enable_qp_profile,2);
100: okc_debug.Log('20: p_rpt_upgrade_status : '||p_rpt_upgrade_status,2);
101: END IF;
94: fnd_file.put_line(FND_FILE.LOG,' ');
95:
96: IF (l_debug = 'Y') THEN
97: okc_debug.Log('20: p_dflt_price_list_id : '||p_dflt_price_list_id,2);
98: okc_debug.Log('20: p_category_code : '||p_category_code,2);
99: okc_debug.Log('20: p_enable_qp_profile : '||p_enable_qp_profile,2);
100: okc_debug.Log('20: p_rpt_upgrade_status : '||p_rpt_upgrade_status,2);
101: END IF;
102:
95:
96: IF (l_debug = 'Y') THEN
97: okc_debug.Log('20: p_dflt_price_list_id : '||p_dflt_price_list_id,2);
98: okc_debug.Log('20: p_category_code : '||p_category_code,2);
99: okc_debug.Log('20: p_enable_qp_profile : '||p_enable_qp_profile,2);
100: okc_debug.Log('20: p_rpt_upgrade_status : '||p_rpt_upgrade_status,2);
101: END IF;
102:
103:
96: IF (l_debug = 'Y') THEN
97: okc_debug.Log('20: p_dflt_price_list_id : '||p_dflt_price_list_id,2);
98: okc_debug.Log('20: p_category_code : '||p_category_code,2);
99: okc_debug.Log('20: p_enable_qp_profile : '||p_enable_qp_profile,2);
100: okc_debug.Log('20: p_rpt_upgrade_status : '||p_rpt_upgrade_status,2);
101: END IF;
102:
103:
104: -- get the sessionid
106: FETCH csr_sessionid INTO l_sessionid;
107: CLOSE csr_sessionid;
108:
109: IF (l_debug = 'Y') THEN
110: okc_debug.Log('25: Session ID : '||l_sessionid,2);
111: okc_debug.Log('25: User ID : '||fnd_global.user_id,2);
112: okc_debug.Log('25: Conc Req ID : '||fnd_global.conc_request_id,2);
113: END IF;
114:
107: CLOSE csr_sessionid;
108:
109: IF (l_debug = 'Y') THEN
110: okc_debug.Log('25: Session ID : '||l_sessionid,2);
111: okc_debug.Log('25: User ID : '||fnd_global.user_id,2);
112: okc_debug.Log('25: Conc Req ID : '||fnd_global.conc_request_id,2);
113: END IF;
114:
115: -- log session details
108:
109: IF (l_debug = 'Y') THEN
110: okc_debug.Log('25: Session ID : '||l_sessionid,2);
111: okc_debug.Log('25: User ID : '||fnd_global.user_id,2);
112: okc_debug.Log('25: Conc Req ID : '||fnd_global.conc_request_id,2);
113: END IF;
114:
115: -- log session details
116: fnd_file.put_line(FND_FILE.LOG,' ********** DATABASE TRACE INFORMATION*************** ');
152:
153: -- Run Upgrade for category
154:
155: IF (l_debug = 'Y') THEN
156: okc_debug.Log('500: Calling call_qp_upgrade ',2);
157: END IF;
158:
159: call_qp_upgrade
160: (
186: fnd_file.put_line(FND_FILE.LOG,'Completed Concurrent Program. ');
187: fnd_file.put_line(FND_FILE.LOG,' ---------------------------------------------------------- ');
188:
189: IF (l_debug = 'Y') THEN
190: okc_debug.Log('500: Calling Stop Trace and Leaving ',2);
191: okc_debug.Log('1000: Leaving ',2);
192: END IF;
193:
194: IF NVL(FND_PROFILE.VALUE('AFLOG_ENABLED'),'N') = 'Y' THEN
187: fnd_file.put_line(FND_FILE.LOG,' ---------------------------------------------------------- ');
188:
189: IF (l_debug = 'Y') THEN
190: okc_debug.Log('500: Calling Stop Trace and Leaving ',2);
191: okc_debug.Log('1000: Leaving ',2);
192: END IF;
193:
194: IF NVL(FND_PROFILE.VALUE('AFLOG_ENABLED'),'N') = 'Y' THEN
195: -- print debug information
208: okc_util.stop_trace;
209: END IF;
210:
211: IF (l_debug = 'Y') THEN
212: okc_debug.Reset_Indentation;
213: END IF;
214:
215:
216: EXCEPTION
215:
216: EXCEPTION
217: WHEN g_error_exception THEN
218: IF (l_debug = 'Y') THEN
219: okc_debug.Log('2000: Leaving ',2);
220: okc_debug.Reset_Indentation;
221: END IF;
222: -- update the Category record as done with error
223: upd_category_rec
216: EXCEPTION
217: WHEN g_error_exception THEN
218: IF (l_debug = 'Y') THEN
219: okc_debug.Log('2000: Leaving ',2);
220: okc_debug.Reset_Indentation;
221: END IF;
222: -- update the Category record as done with error
223: upd_category_rec
224: (
227: );
228: raise;
229: WHEN others THEN
230: IF (l_debug = 'Y') THEN
231: okc_debug.Log('3000: Leaving ',2);
232: okc_debug.Reset_Indentation;
233: END IF;
234: raise;
235: END upgrade_contracts;
228: raise;
229: WHEN others THEN
230: IF (l_debug = 'Y') THEN
231: okc_debug.Log('3000: Leaving ',2);
232: okc_debug.Reset_Indentation;
233: END IF;
234: raise;
235: END upgrade_contracts;
236:
259:
260: BEGIN
261:
262: IF (l_debug = 'Y') THEN
263: okc_debug.Set_Indentation(l_proc);
264: okc_debug.Log('10: Entering ',2);
265: END IF;
266: /*
267: fnd_file.put_line(FND_FILE.LOG,' ');
260: BEGIN
261:
262: IF (l_debug = 'Y') THEN
263: okc_debug.Set_Indentation(l_proc);
264: okc_debug.Log('10: Entering ',2);
265: END IF;
266: /*
267: fnd_file.put_line(FND_FILE.LOG,' ');
268: fnd_file.put_line(FND_FILE.LOG,' ');
276: OPEN csr_summary_rec;
277: FETCH csr_summary_rec INTO l_qp_upgrade_rec;
278: IF csr_summary_rec%NOTFOUND THEN
279: IF (l_debug = 'Y') THEN
280: okc_debug.Log('20: Summary Record Not Found, Inserting ... ',2);
281: END IF;
282: -- record does not exist, so insert
283: INSERT INTO okc_qp_upgrade
284: (
310: -- commit the record
311: commit;
312:
313: IF (l_debug = 'Y') THEN
314: okc_debug.Log('30: Inserted Summary Record ',2);
315: END IF;
316: -- fnd_file.put_line(FND_FILE.LOG,'Inserted Summary Record');
317:
318: ELSE
317:
318: ELSE
319: -- Summary Record found, don't insert
320: IF (l_debug = 'Y') THEN
321: okc_debug.Log('40: Summary Record FOUND, skipping insert ',2);
322: END IF;
323: -- fnd_file.put_line(FND_FILE.LOG,'Summary Record Already Exits');
324: END IF; -- record does not exist
325: CLOSE csr_summary_rec;
325: CLOSE csr_summary_rec;
326:
327:
328: IF (l_debug = 'Y') THEN
329: okc_debug.Log('1000: Leaving ',2);
330: okc_debug.Reset_Indentation;
331: END IF;
332:
333: EXCEPTION
326:
327:
328: IF (l_debug = 'Y') THEN
329: okc_debug.Log('1000: Leaving ',2);
330: okc_debug.Reset_Indentation;
331: END IF;
332:
333: EXCEPTION
334: WHEN others THEN
332:
333: EXCEPTION
334: WHEN others THEN
335: IF (l_debug = 'Y') THEN
336: okc_debug.Log('2000: Leaving ',2);
337: okc_debug.Reset_Indentation;
338: END IF;
339: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
340: fnd_message.set_token('ROUTINE',l_proc);
333: EXCEPTION
334: WHEN others THEN
335: IF (l_debug = 'Y') THEN
336: okc_debug.Log('2000: Leaving ',2);
337: okc_debug.Reset_Indentation;
338: END IF;
339: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
340: fnd_message.set_token('ROUTINE',l_proc);
341: fnd_message.set_token('REASON',SQLERRM);
397:
398: BEGIN
399:
400: IF (l_debug = 'Y') THEN
401: okc_debug.Set_Indentation(l_proc);
402: okc_debug.Log('10: Entering ',2);
403: okc_debug.Log('15: Category Code : '||p_category_code ,2);
404: END IF;
405: /*
398: BEGIN
399:
400: IF (l_debug = 'Y') THEN
401: okc_debug.Set_Indentation(l_proc);
402: okc_debug.Log('10: Entering ',2);
403: okc_debug.Log('15: Category Code : '||p_category_code ,2);
404: END IF;
405: /*
406: fnd_file.put_line(FND_FILE.LOG,' ');
399:
400: IF (l_debug = 'Y') THEN
401: okc_debug.Set_Indentation(l_proc);
402: okc_debug.Log('10: Entering ',2);
403: okc_debug.Log('15: Category Code : '||p_category_code ,2);
404: END IF;
405: /*
406: fnd_file.put_line(FND_FILE.LOG,' ');
407: fnd_file.put_line(FND_FILE.LOG,' ');
414:
415: OPEN csr_category_rec;
416: FETCH csr_category_rec INTO l_qp_upgrade_rec;
417: IF (l_debug = 'Y') THEN
418: okc_debug.set_trace_off;
419: END IF;
420: IF csr_category_rec%NOTFOUND THEN
421: IF (l_debug = 'Y') THEN
422: okc_debug.Log('20: Category Record Not Found, Inserting ... ',2);
418: okc_debug.set_trace_off;
419: END IF;
420: IF csr_category_rec%NOTFOUND THEN
421: IF (l_debug = 'Y') THEN
422: okc_debug.Log('20: Category Record Not Found, Inserting ... ',2);
423: END IF;
424: -- record does not exist, so insert
425: INSERT INTO okc_qp_upgrade
426: (
452: -- commit the record
453: commit;
454:
455: IF (l_debug = 'Y') THEN
456: okc_debug.Log('30: Inserted Category Record for : '||p_category_code,2);
457: okc_debug.Log('35: Calling Upgrade for category : '||p_category_code,2);
458: END IF;
459:
460: -- populate the global variable with this cat_code it is processing
453: commit;
454:
455: IF (l_debug = 'Y') THEN
456: okc_debug.Log('30: Inserted Category Record for : '||p_category_code,2);
457: okc_debug.Log('35: Calling Upgrade for category : '||p_category_code,2);
458: END IF;
459:
460: -- populate the global variable with this cat_code it is processing
461: g_category_code := p_category_code ;
467: (
468: p_category_code => p_category_code
469: );
470: IF (l_debug = 'Y') THEN
471: okc_debug.set_trace_off;
472: END IF;
473:
474: l_status := 'Y';
475:
479: p_category_code => p_category_code,
480: p_status => l_status
481: );
482: IF (l_debug = 'Y') THEN
483: okc_debug.set_trace_off;
484: END IF;
485: fnd_file.put_line(FND_FILE.LOG,'Completed Upgrade For Category : '||p_category_code);
486:
487: ELSE
487: ELSE
488: -- Category Record found, don't insert
489:
490: IF (l_debug = 'Y') THEN
491: okc_debug.Log('40: Category Record FOUND ',2);
492: okc_debug.Log('40: completion_flag : '||l_qp_upgrade_rec.completion_flag,2);
493: END IF;
494:
495: IF l_qp_upgrade_rec.completion_flag = 'Y' THEN
488: -- Category Record found, don't insert
489:
490: IF (l_debug = 'Y') THEN
491: okc_debug.Log('40: Category Record FOUND ',2);
492: okc_debug.Log('40: completion_flag : '||l_qp_upgrade_rec.completion_flag,2);
493: END IF;
494:
495: IF l_qp_upgrade_rec.completion_flag = 'Y' THEN
496: /*
497: Case 1 : completion_flag = 'Y'
498: In this case this category was already upgraded, so skip
499: */
500: IF (l_debug = 'Y') THEN
501: okc_debug.Log('50: Skipping as category is already Upgraded : '||p_category_code,2);
502: END IF;
503: fnd_message.set_name('OKC','OKC_CATEGORY_UPGRADED');
504: fnd_message.set_token('CATEGORY',p_category_code);
505: fnd_file.put_line(FND_FILE.LOG,fnd_message.get);
518: -- 2. Commit record
519: commit;
520:
521: IF (l_debug = 'Y') THEN
522: okc_debug.Log('60: Updated completion_flag to P for : '||p_category_code,2);
523: okc_debug.Log('70: Calling Upgrade for category : '||p_category_code,2);
524: END IF;
525:
526: -- populate the global variable with this cat_code it is processing
519: commit;
520:
521: IF (l_debug = 'Y') THEN
522: okc_debug.Log('60: Updated completion_flag to P for : '||p_category_code,2);
523: okc_debug.Log('70: Calling Upgrade for category : '||p_category_code,2);
524: END IF;
525:
526: -- populate the global variable with this cat_code it is processing
527: g_category_code := p_category_code ;
535: p_category_code => p_category_code
536: );
537:
538: IF (l_debug = 'Y') THEN
539: okc_debug.set_trace_off;
540: END IF;
541: -- we ran for all contracts
542: l_status := 'Y';
543:
547: p_category_code => p_category_code,
548: p_status => l_status
549: );
550: IF (l_debug = 'Y') THEN
551: okc_debug.set_trace_off;
552: END IF;
553: fnd_file.put_line(FND_FILE.LOG,':Completed Upgrade For Category : '||p_category_code);
554:
555: ELSE
559: So we skip this category as only ONE conc. pgm can run at any point of time for a
560: given category
561: */
562: IF (l_debug = 'Y') THEN
563: okc_debug.Log('80: Another conc pgm IN PROGRESS for : '||p_category_code,2);
564: okc_debug.Log('100: Skipping Category : '||p_category_code,2);
565: END IF;
566: fnd_file.put_line(FND_FILE.LOG,' *********************************************** ');
567: fnd_message.set_name('OKC','OKC_CATEGORY_UPG_PROGESS');
560: given category
561: */
562: IF (l_debug = 'Y') THEN
563: okc_debug.Log('80: Another conc pgm IN PROGRESS for : '||p_category_code,2);
564: okc_debug.Log('100: Skipping Category : '||p_category_code,2);
565: END IF;
566: fnd_file.put_line(FND_FILE.LOG,' *********************************************** ');
567: fnd_message.set_name('OKC','OKC_CATEGORY_UPG_PROGESS');
568: fnd_message.set_token('CATEGORY',p_category_code);
573:
574: END IF; -- record does not exist
575: CLOSE csr_category_rec;
576: IF (l_debug = 'Y') THEN
577: okc_debug.set_trace_on;
578: okc_debug.Log('1000: Leaving ',2);
579: okc_debug.Reset_Indentation;
580: END IF;
581:
574: END IF; -- record does not exist
575: CLOSE csr_category_rec;
576: IF (l_debug = 'Y') THEN
577: okc_debug.set_trace_on;
578: okc_debug.Log('1000: Leaving ',2);
579: okc_debug.Reset_Indentation;
580: END IF;
581:
582: EXCEPTION
575: CLOSE csr_category_rec;
576: IF (l_debug = 'Y') THEN
577: okc_debug.set_trace_on;
578: okc_debug.Log('1000: Leaving ',2);
579: okc_debug.Reset_Indentation;
580: END IF;
581:
582: EXCEPTION
583: WHEN others THEN
581:
582: EXCEPTION
583: WHEN others THEN
584: IF (l_debug = 'Y') THEN
585: okc_debug.set_trace_on;
586: okc_debug.Log('2000: Leaving ',2);
587: okc_debug.Reset_Indentation;
588: END IF;
589: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
582: EXCEPTION
583: WHEN others THEN
584: IF (l_debug = 'Y') THEN
585: okc_debug.set_trace_on;
586: okc_debug.Log('2000: Leaving ',2);
587: okc_debug.Reset_Indentation;
588: END IF;
589: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
590: fnd_message.set_token('ROUTINE',l_proc);
583: WHEN others THEN
584: IF (l_debug = 'Y') THEN
585: okc_debug.set_trace_on;
586: okc_debug.Log('2000: Leaving ',2);
587: okc_debug.Reset_Indentation;
588: END IF;
589: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
590: fnd_message.set_token('ROUTINE',l_proc);
591: fnd_message.set_token('REASON',SQLERRM);
677:
678: BEGIN
679:
680: IF (l_debug = 'Y') THEN
681: okc_debug.Set_Indentation(l_proc);
682: okc_debug.Log('10: Entering ',2);
683: END IF;
684: /*
685: fnd_file.put_line(FND_FILE.LOG,' ');
678: BEGIN
679:
680: IF (l_debug = 'Y') THEN
681: okc_debug.Set_Indentation(l_proc);
682: okc_debug.Log('10: Entering ',2);
683: END IF;
684: /*
685: fnd_file.put_line(FND_FILE.LOG,' ');
686: fnd_file.put_line(FND_FILE.LOG,' ');
710: l_itm_to_price_tbl.delete;
711: l_lse_id_tbl.delete;
712:
713: IF (l_debug = 'Y') THEN
714: okc_debug.Log('20: Contract Record PROCESSING ... ',2);
715: okc_debug.Log('30: Contract Category : '||p_category_code,2);
716: okc_debug.Log('40: Contract Id : '||chr_rec.id,2);
717: okc_debug.Log('50: Contract Number : '||chr_rec.contract_number,2);
718: okc_debug.Log('60: Contract Number Mod : '||chr_rec.contract_number_modifier,2);
711: l_lse_id_tbl.delete;
712:
713: IF (l_debug = 'Y') THEN
714: okc_debug.Log('20: Contract Record PROCESSING ... ',2);
715: okc_debug.Log('30: Contract Category : '||p_category_code,2);
716: okc_debug.Log('40: Contract Id : '||chr_rec.id,2);
717: okc_debug.Log('50: Contract Number : '||chr_rec.contract_number,2);
718: okc_debug.Log('60: Contract Number Mod : '||chr_rec.contract_number_modifier,2);
719: END IF;
712:
713: IF (l_debug = 'Y') THEN
714: okc_debug.Log('20: Contract Record PROCESSING ... ',2);
715: okc_debug.Log('30: Contract Category : '||p_category_code,2);
716: okc_debug.Log('40: Contract Id : '||chr_rec.id,2);
717: okc_debug.Log('50: Contract Number : '||chr_rec.contract_number,2);
718: okc_debug.Log('60: Contract Number Mod : '||chr_rec.contract_number_modifier,2);
719: END IF;
720:
713: IF (l_debug = 'Y') THEN
714: okc_debug.Log('20: Contract Record PROCESSING ... ',2);
715: okc_debug.Log('30: Contract Category : '||p_category_code,2);
716: okc_debug.Log('40: Contract Id : '||chr_rec.id,2);
717: okc_debug.Log('50: Contract Number : '||chr_rec.contract_number,2);
718: okc_debug.Log('60: Contract Number Mod : '||chr_rec.contract_number_modifier,2);
719: END IF;
720:
721: -- compute the new estimated amount for the contract
714: okc_debug.Log('20: Contract Record PROCESSING ... ',2);
715: okc_debug.Log('30: Contract Category : '||p_category_code,2);
716: okc_debug.Log('40: Contract Id : '||chr_rec.id,2);
717: okc_debug.Log('50: Contract Number : '||chr_rec.contract_number,2);
718: okc_debug.Log('60: Contract Number Mod : '||chr_rec.contract_number_modifier,2);
719: END IF;
720:
721: -- compute the new estimated amount for the contract
722:
723: l_user_estimated_amount := NVL(chr_rec.estimated_amount,0);
724: l_estimated_amount := compute_estimated_amt(p_chr_id => chr_rec.id);
725:
726: IF (l_debug = 'Y') THEN
727: okc_debug.Log('70: user_estimated_amount : '||l_user_estimated_amount,2);
728: okc_debug.Log('80: estimated_amount : '||l_estimated_amount,2);
729: END IF;
730:
731: --???? asumming non configurator rows with only priced flag.
724: l_estimated_amount := compute_estimated_amt(p_chr_id => chr_rec.id);
725:
726: IF (l_debug = 'Y') THEN
727: okc_debug.Log('70: user_estimated_amount : '||l_user_estimated_amount,2);
728: okc_debug.Log('80: estimated_amount : '||l_estimated_amount,2);
729: END IF;
730:
731: --???? asumming non configurator rows with only priced flag.
732: --make a heirarachy of lines with for each contract, going from top line to sub lines(leaf node last)
812:
813: END IF; --#end If1
814:
815: IF (l_debug = 'Y') THEN
816: okc_debug.Log('100: HEADER Price List Id : '||l_hdr_price_list ,2);
817: END IF;
818:
819:
820: -- For each line defined for this contract, search for priced lines. The while loop below
861:
862: l_line_list_price_tbl(j):= NVL(l_qty,0) * NVL(l_price_unit_tbl(j),0);
863:
864: IF (l_debug = 'Y') THEN
865: okc_debug.Log('150: Quantity Selected : '||l_qty,2);
866: END IF;
867:
868: END IF; --#end if5 price_unit is not null
869:
879:
880: END IF; --#end if4 i.e l_priced_flag_tbl(j) = 'Y'
881:
882: IF (l_debug = 'Y') THEN
883: okc_debug.Log('200: Line List Price : '||l_line_list_price,2);
884: END IF;
885:
886: -----------end get list price---------------------------------------------------
887:
936: ELSE
937: l_price_list_tbl(k) := g_dflt_price_list_id;
938: g_k_price_list_id := g_dflt_price_list_id;
939: IF (l_debug = 'Y') THEN
940: okc_debug.Log('210: Using Default Price list Id ',2);
941: END IF;
942: END IF; -- skekkar
943:
944: END IF; --#end if11
1007: WHERE rowid = chr_rec.rowid;
1008:
1009:
1010: IF (l_debug = 'Y') THEN
1011: okc_debug.Log('400: Updated Header : '||chr_rec.contract_number,2);
1012: END IF;
1013:
1014: l_counter:=l_counter+1;
1015:
1013:
1014: l_counter:=l_counter+1;
1015:
1016: IF (l_debug = 'Y') THEN
1017: okc_debug.Log('410: Counter is : '||l_counter,2);
1018: END IF;
1019:
1020: -- END IF; --#end if13
1021:
1038:
1039: IF l_counter >= 100 THEN --#if14
1040:
1041: IF (l_debug = 'Y') THEN
1042: okc_debug.Log('420: Commiting Work as Counter is : '||l_counter,2);
1043: END IF;
1044:
1045: -- commit work
1046: commit;
1045: -- commit work
1046: commit;
1047:
1048: IF (l_debug = 'Y') THEN
1049: okc_debug.Log('430: Initializing Counter Again to 0',2);
1050: END IF;
1051:
1052: -- initialize counter
1053: l_counter := 0;
1061: -- commit work
1062: commit;
1063:
1064: IF (l_debug = 'Y') THEN
1065: okc_debug.Log('1000: Leaving ',2);
1066: okc_debug.Reset_Indentation;
1067: END IF;
1068:
1069: EXCEPTION
1062: commit;
1063:
1064: IF (l_debug = 'Y') THEN
1065: okc_debug.Log('1000: Leaving ',2);
1066: okc_debug.Reset_Indentation;
1067: END IF;
1068:
1069: EXCEPTION
1070: WHEN others THEN
1068:
1069: EXCEPTION
1070: WHEN others THEN
1071: IF (l_debug = 'Y') THEN
1072: okc_debug.Log('2000: Leaving ',2);
1073: okc_debug.Reset_Indentation;
1074: END IF;
1075: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1076: fnd_message.set_token('ROUTINE',l_proc);
1069: EXCEPTION
1070: WHEN others THEN
1071: IF (l_debug = 'Y') THEN
1072: okc_debug.Log('2000: Leaving ',2);
1073: okc_debug.Reset_Indentation;
1074: END IF;
1075: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1076: fnd_message.set_token('ROUTINE',l_proc);
1077: fnd_message.set_token('REASON',SQLERRM);
1105:
1106: BEGIN
1107:
1108: IF (l_debug = 'Y') THEN
1109: okc_debug.Set_Indentation(l_proc);
1110: okc_debug.Log('10: Entering ',2);
1111: END IF;
1112:
1113: IF (l_debug = 'Y') THEN
1106: BEGIN
1107:
1108: IF (l_debug = 'Y') THEN
1109: okc_debug.Set_Indentation(l_proc);
1110: okc_debug.Log('10: Entering ',2);
1111: END IF;
1112:
1113: IF (l_debug = 'Y') THEN
1114: okc_debug.Log('20: Contract Record Inserting ... ',2);
1110: okc_debug.Log('10: Entering ',2);
1111: END IF;
1112:
1113: IF (l_debug = 'Y') THEN
1114: okc_debug.Log('20: Contract Record Inserting ... ',2);
1115: okc_debug.Log('30: Contract Category : '||p_category_code,2);
1116: okc_debug.Log('40: Contract Id : '||p_chr_id,2);
1117: okc_debug.Log('50: Contract Number : '||p_contract_number,2);
1118: okc_debug.Log('60: Contract Number Mod : '||p_contract_number_modifier,2);
1111: END IF;
1112:
1113: IF (l_debug = 'Y') THEN
1114: okc_debug.Log('20: Contract Record Inserting ... ',2);
1115: okc_debug.Log('30: Contract Category : '||p_category_code,2);
1116: okc_debug.Log('40: Contract Id : '||p_chr_id,2);
1117: okc_debug.Log('50: Contract Number : '||p_contract_number,2);
1118: okc_debug.Log('60: Contract Number Mod : '||p_contract_number_modifier,2);
1119: okc_debug.Log('70: Default Price List Id : '||g_k_price_list_id,2);
1112:
1113: IF (l_debug = 'Y') THEN
1114: okc_debug.Log('20: Contract Record Inserting ... ',2);
1115: okc_debug.Log('30: Contract Category : '||p_category_code,2);
1116: okc_debug.Log('40: Contract Id : '||p_chr_id,2);
1117: okc_debug.Log('50: Contract Number : '||p_contract_number,2);
1118: okc_debug.Log('60: Contract Number Mod : '||p_contract_number_modifier,2);
1119: okc_debug.Log('70: Default Price List Id : '||g_k_price_list_id,2);
1120: END IF;
1113: IF (l_debug = 'Y') THEN
1114: okc_debug.Log('20: Contract Record Inserting ... ',2);
1115: okc_debug.Log('30: Contract Category : '||p_category_code,2);
1116: okc_debug.Log('40: Contract Id : '||p_chr_id,2);
1117: okc_debug.Log('50: Contract Number : '||p_contract_number,2);
1118: okc_debug.Log('60: Contract Number Mod : '||p_contract_number_modifier,2);
1119: okc_debug.Log('70: Default Price List Id : '||g_k_price_list_id,2);
1120: END IF;
1121:
1114: okc_debug.Log('20: Contract Record Inserting ... ',2);
1115: okc_debug.Log('30: Contract Category : '||p_category_code,2);
1116: okc_debug.Log('40: Contract Id : '||p_chr_id,2);
1117: okc_debug.Log('50: Contract Number : '||p_contract_number,2);
1118: okc_debug.Log('60: Contract Number Mod : '||p_contract_number_modifier,2);
1119: okc_debug.Log('70: Default Price List Id : '||g_k_price_list_id,2);
1120: END IF;
1121:
1122: /*
1115: okc_debug.Log('30: Contract Category : '||p_category_code,2);
1116: okc_debug.Log('40: Contract Id : '||p_chr_id,2);
1117: okc_debug.Log('50: Contract Number : '||p_contract_number,2);
1118: okc_debug.Log('60: Contract Number Mod : '||p_contract_number_modifier,2);
1119: okc_debug.Log('70: Default Price List Id : '||g_k_price_list_id,2);
1120: END IF;
1121:
1122: /*
1123: fnd_file.put_line(FND_FILE.LOG,'Processed Contract : '||p_contract_number||
1159: g_k_price_list_id := '';
1160:
1161:
1162: IF (l_debug = 'Y') THEN
1163: okc_debug.Log('1000: Leaving ',2);
1164: okc_debug.Reset_Indentation;
1165: END IF;
1166:
1167: EXCEPTION
1160:
1161:
1162: IF (l_debug = 'Y') THEN
1163: okc_debug.Log('1000: Leaving ',2);
1164: okc_debug.Reset_Indentation;
1165: END IF;
1166:
1167: EXCEPTION
1168: WHEN others THEN
1166:
1167: EXCEPTION
1168: WHEN others THEN
1169: IF (l_debug = 'Y') THEN
1170: okc_debug.Log('2000: Leaving ',2);
1171: okc_debug.Reset_Indentation;
1172: END IF;
1173: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1174: fnd_message.set_token('ROUTINE',l_proc);
1167: EXCEPTION
1168: WHEN others THEN
1169: IF (l_debug = 'Y') THEN
1170: okc_debug.Log('2000: Leaving ',2);
1171: okc_debug.Reset_Indentation;
1172: END IF;
1173: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1174: fnd_message.set_token('ROUTINE',l_proc);
1175: fnd_message.set_token('REASON',SQLERRM);
1220:
1221: BEGIN
1222:
1223: IF (l_debug = 'Y') THEN
1224: okc_debug.Set_Indentation(l_proc);
1225: okc_debug.Log('10: Entering ',2);
1226: END IF;
1227: /*
1228: fnd_file.put_line(FND_FILE.LOG,' ');
1221: BEGIN
1222:
1223: IF (l_debug = 'Y') THEN
1224: okc_debug.Set_Indentation(l_proc);
1225: okc_debug.Log('10: Entering ',2);
1226: END IF;
1227: /*
1228: fnd_file.put_line(FND_FILE.LOG,' ');
1229: fnd_file.put_line(FND_FILE.LOG,' ');
1234: fnd_file.put_line(FND_FILE.LOG,' ');
1235: */
1236:
1237: IF (l_debug = 'Y') THEN
1238: okc_debug.Log('20: p_category_code : '||p_category_code,2);
1239: END IF;
1240:
1241: -- check if the upgrade is already done, if Y then abort
1242: OPEN csr_summary_rec;
1244: IF csr_summary_rec%NOTFOUND THEN
1245: -- start processing here
1246:
1247: IF (l_debug = 'Y') THEN
1248: okc_debug.Log('60: Category Id is : '||p_category_code,2);
1249: END IF;
1250:
1251: -- insert the summary record
1252: ins_summary_rec;
1268:
1269:
1270: ELSE -- csr_summary_rec FOUND, upgrade already done abort
1271: IF (l_debug = 'Y') THEN
1272: okc_debug.Log('500: Aborting as the Upgrade is already Done ... ',2);
1273: END IF;
1274: fnd_file.put_line(FND_FILE.LOG,' ');
1275: fnd_file.put_line(FND_FILE.LOG,' ');
1276: fnd_message.set_name('OKC','OKC_QP_ALREADY_DONE');
1280: END IF;
1281:
1282:
1283: IF (l_debug = 'Y') THEN
1284: okc_debug.Log('1000: Leaving ',2);
1285: okc_debug.Reset_Indentation;
1286: END IF;
1287:
1288: EXCEPTION
1281:
1282:
1283: IF (l_debug = 'Y') THEN
1284: okc_debug.Log('1000: Leaving ',2);
1285: okc_debug.Reset_Indentation;
1286: END IF;
1287:
1288: EXCEPTION
1289: WHEN others THEN
1287:
1288: EXCEPTION
1289: WHEN others THEN
1290: IF (l_debug = 'Y') THEN
1291: okc_debug.Log('2000: Leaving ',2);
1292: okc_debug.Reset_Indentation;
1293: END IF;
1294: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1295: fnd_message.set_token('ROUTINE',l_proc);
1288: EXCEPTION
1289: WHEN others THEN
1290: IF (l_debug = 'Y') THEN
1291: okc_debug.Log('2000: Leaving ',2);
1292: okc_debug.Reset_Indentation;
1293: END IF;
1294: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1295: fnd_message.set_token('ROUTINE',l_proc);
1296: fnd_message.set_token('REASON',SQLERRM);
1330:
1331: BEGIN
1332:
1333: IF (l_debug = 'Y') THEN
1334: okc_debug.Set_Indentation(l_proc);
1335: okc_debug.Log('10: Entering ',2);
1336: END IF;
1337:
1338: /*
1331: BEGIN
1332:
1333: IF (l_debug = 'Y') THEN
1334: okc_debug.Set_Indentation(l_proc);
1335: okc_debug.Log('10: Entering ',2);
1336: END IF;
1337:
1338: /*
1339: fnd_file.put_line(FND_FILE.LOG,' ');
1348: OPEN csr_category_rec;
1349: LOOP
1350: FETCH csr_category_rec INTO l_qp_upgrade_rec;
1351: IF (l_debug = 'Y') THEN
1352: okc_debug.set_trace_off;
1353: END IF;
1354: EXIT WHEN csr_category_rec%NOTFOUND;
1355: UPDATE okc_qp_upgrade
1356: SET completion_flag = p_status,
1358: WHERE CURRENT OF csr_category_rec;
1359: END LOOP;
1360: CLOSE csr_category_rec;
1361: IF (l_debug = 'Y') THEN
1362: okc_debug.set_trace_on;
1363: END IF;
1364: -- commit work
1365: commit;
1366:
1368: g_category_code := '' ;
1369:
1370:
1371: IF (l_debug = 'Y') THEN
1372: okc_debug.Log('1000: Leaving ',2);
1373: okc_debug.Reset_Indentation;
1374: END IF;
1375:
1376: EXCEPTION
1369:
1370:
1371: IF (l_debug = 'Y') THEN
1372: okc_debug.Log('1000: Leaving ',2);
1373: okc_debug.Reset_Indentation;
1374: END IF;
1375:
1376: EXCEPTION
1377: WHEN others THEN
1375:
1376: EXCEPTION
1377: WHEN others THEN
1378: IF (l_debug = 'Y') THEN
1379: okc_debug.set_trace_on;
1380: okc_debug.Log('2000: Leaving ',2);
1381: okc_debug.Reset_Indentation;
1382: END IF;
1383: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1376: EXCEPTION
1377: WHEN others THEN
1378: IF (l_debug = 'Y') THEN
1379: okc_debug.set_trace_on;
1380: okc_debug.Log('2000: Leaving ',2);
1381: okc_debug.Reset_Indentation;
1382: END IF;
1383: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1384: fnd_message.set_token('ROUTINE',l_proc);
1377: WHEN others THEN
1378: IF (l_debug = 'Y') THEN
1379: okc_debug.set_trace_on;
1380: okc_debug.Log('2000: Leaving ',2);
1381: okc_debug.Reset_Indentation;
1382: END IF;
1383: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1384: fnd_message.set_token('ROUTINE',l_proc);
1385: fnd_message.set_token('REASON',SQLERRM);
1430:
1431: BEGIN
1432:
1433: IF (l_debug = 'Y') THEN
1434: okc_debug.Set_Indentation(l_proc);
1435: okc_debug.Log('10: Entering ',2);
1436: END IF;
1437:
1438: /*
1431: BEGIN
1432:
1433: IF (l_debug = 'Y') THEN
1434: okc_debug.Set_Indentation(l_proc);
1435: okc_debug.Log('10: Entering ',2);
1436: END IF;
1437:
1438: /*
1439: fnd_file.put_line(FND_FILE.LOG,' ');
1449: FETCH csr_total_categories INTO l_total_categories;
1450: CLOSE csr_total_categories;
1451:
1452: IF (l_debug = 'Y') THEN
1453: okc_debug.Log('50: Total Categories : '||l_total_categories,2);
1454: END IF;
1455: fnd_file.put_line(FND_FILE.LOG,' *********************************************** ');
1456: fnd_message.set_name('OKC','OKC_TOT_CONTRACT_CATS');
1457: fnd_message.set_token('TOTCATS',l_total_categories);
1461: FETCH csr_categories_done INTO l_categories_done;
1462: CLOSE csr_categories_done;
1463:
1464: IF (l_debug = 'Y') THEN
1465: okc_debug.Log('100: Categories Upgraded : '||l_categories_done,2);
1466: END IF;
1467: fnd_message.set_name('OKC','OKC_TOT_CATEGORIES_UPG');
1468: fnd_message.set_token('TOTUPG',l_categories_done);
1469: fnd_file.put_line(FND_FILE.LOG,fnd_message.get);
1473:
1474: IF NVL(l_total_categories,0) <> NVL(l_categories_done,0) THEN
1475: -- cannot enable profile as all categories are not processed
1476: IF (l_debug = 'Y') THEN
1477: okc_debug.Log('200: cannot enable profile as all categories are not processed ',2);
1478: END IF;
1479: fnd_message.set_name('OKC','OKC_QP_PROFILE_FAIL');
1480: fnd_file.put_line(FND_FILE.LOG,fnd_message.get);
1481: fnd_file.put_line(FND_FILE.LOG,' *********************************************** ');
1484: ELSE
1485: -- update the SUMMARY Record
1486: OPEN csr_summary_rec;
1487: IF (l_debug = 'Y') THEN
1488: okc_debug.set_trace_off;
1489: END IF;
1490: LOOP
1491: FETCH csr_summary_rec INTO l_qp_upgrade_rec;
1492: EXIT WHEN csr_summary_rec%NOTFOUND;
1496: WHERE CURRENT OF csr_summary_rec;
1497: END LOOP;
1498: CLOSE csr_summary_rec;
1499: IF (l_debug = 'Y') THEN
1500: okc_debug.set_trace_on;
1501: END IF;
1502: -- commit work
1503: commit;
1504:
1506: -- check the current value of OKC_ADVANCED_PRICING
1507: l_prof_val := fnd_profile.value('OKC_ADVANCED_PRICING');
1508:
1509: IF (l_debug = 'Y') THEN
1510: okc_debug.Log('400: Current OKC_ADVANCED_PRICING Profile Value : '||l_prof_val,2);
1511: END IF;
1512:
1513: IF NVL(l_prof_val,'N') = 'N' THEN
1514: -- set profile to Y
1512:
1513: IF NVL(l_prof_val,'N') = 'N' THEN
1514: -- set profile to Y
1515: IF (l_debug = 'Y') THEN
1516: okc_debug.Log('450: Setting OKC_ADVANCED_PRICING to Y ',2);
1517: END IF;
1518:
1519: -- check if profile successfully set to Y
1520: IF fnd_profile.save('OKC_ADVANCED_PRICING', 'Y', 'SITE') THEN
1520: IF fnd_profile.save('OKC_ADVANCED_PRICING', 'Y', 'SITE') THEN
1521: -- commit changes
1522: commit;
1523: IF (l_debug = 'Y') THEN
1524: okc_debug.Log('500: OKC_ADVANCED_PRICING Successfully Set to Y',2);
1525: END IF;
1526: fnd_file.put_line(FND_FILE.LOG,' ');
1527: fnd_file.put_line(FND_FILE.LOG,' ');
1528: fnd_file.put_line(FND_FILE.LOG,' *********************************************** ');
1533: fnd_file.put_line(FND_FILE.LOG,' ');
1534: ELSE
1535: -- give error here
1536: IF (l_debug = 'Y') THEN
1537: okc_debug.Log('600: Error Setting OKC_ADVANCED_PRICING to Y');
1538: END IF;
1539: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1540: fnd_message.set_token('ROUTINE',l_proc);
1541: fnd_message.set_token('REASON',SQLERRM);
1550:
1551: END IF; -- l_total_categories <> l_categories_done
1552:
1553: IF (l_debug = 'Y') THEN
1554: okc_debug.Log('1000: Leaving ',2);
1555: okc_debug.Reset_Indentation;
1556: END IF;
1557:
1558: EXCEPTION
1551: END IF; -- l_total_categories <> l_categories_done
1552:
1553: IF (l_debug = 'Y') THEN
1554: okc_debug.Log('1000: Leaving ',2);
1555: okc_debug.Reset_Indentation;
1556: END IF;
1557:
1558: EXCEPTION
1559: WHEN others THEN
1557:
1558: EXCEPTION
1559: WHEN others THEN
1560: IF (l_debug = 'Y') THEN
1561: okc_debug.set_trace_on;
1562: okc_debug.Log('2000: Leaving ',2);
1563: okc_debug.Reset_Indentation;
1564: END IF;
1565: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1558: EXCEPTION
1559: WHEN others THEN
1560: IF (l_debug = 'Y') THEN
1561: okc_debug.set_trace_on;
1562: okc_debug.Log('2000: Leaving ',2);
1563: okc_debug.Reset_Indentation;
1564: END IF;
1565: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1566: fnd_message.set_token('ROUTINE',l_proc);
1559: WHEN others THEN
1560: IF (l_debug = 'Y') THEN
1561: okc_debug.set_trace_on;
1562: okc_debug.Log('2000: Leaving ',2);
1563: okc_debug.Reset_Indentation;
1564: END IF;
1565: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1566: fnd_message.set_token('ROUTINE',l_proc);
1567: fnd_message.set_token('REASON',SQLERRM);
1586: BEGIN
1587:
1588:
1589: IF (l_debug = 'Y') THEN
1590: okc_debug.Set_Indentation(l_proc);
1591: okc_debug.Log('10: Entering ',2);
1592: END IF;
1593:
1594: /*
1587:
1588:
1589: IF (l_debug = 'Y') THEN
1590: okc_debug.Set_Indentation(l_proc);
1591: okc_debug.Log('10: Entering ',2);
1592: END IF;
1593:
1594: /*
1595: fnd_file.put_line(FND_FILE.LOG,' ');
1601: fnd_file.put_line(FND_FILE.LOG,' ');
1602: */
1603:
1604: IF (l_debug = 'Y') THEN
1605: okc_debug.Log('50: Calling upgrade_status_rpt ',2);
1606: END IF;
1607: fnd_file.put_line(FND_FILE.LOG,'Processing Upgrade Status report');
1608: upgrade_status_rpt;
1609:
1607: fnd_file.put_line(FND_FILE.LOG,'Processing Upgrade Status report');
1608: upgrade_status_rpt;
1609:
1610: IF (l_debug = 'Y') THEN
1611: okc_debug.Log('1000: Leaving ',2);
1612: okc_debug.Reset_Indentation;
1613: END IF;
1614:
1615: EXCEPTION
1608: upgrade_status_rpt;
1609:
1610: IF (l_debug = 'Y') THEN
1611: okc_debug.Log('1000: Leaving ',2);
1612: okc_debug.Reset_Indentation;
1613: END IF;
1614:
1615: EXCEPTION
1616: WHEN others THEN
1614:
1615: EXCEPTION
1616: WHEN others THEN
1617: IF (l_debug = 'Y') THEN
1618: okc_debug.Log('2000: Leaving ',2);
1619: okc_debug.Reset_Indentation;
1620: END IF;
1621: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1622: fnd_message.set_token('ROUTINE',l_proc);
1615: EXCEPTION
1616: WHEN others THEN
1617: IF (l_debug = 'Y') THEN
1618: okc_debug.Log('2000: Leaving ',2);
1619: okc_debug.Reset_Indentation;
1620: END IF;
1621: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1622: fnd_message.set_token('ROUTINE',l_proc);
1623: fnd_message.set_token('REASON',SQLERRM);
1693: BEGIN
1694:
1695:
1696: IF (l_debug = 'Y') THEN
1697: okc_debug.Set_Indentation(l_proc);
1698: okc_debug.Log('10: Entering ',2);
1699: END IF;
1700:
1701: /*
1694:
1695:
1696: IF (l_debug = 'Y') THEN
1697: okc_debug.Set_Indentation(l_proc);
1698: okc_debug.Log('10: Entering ',2);
1699: END IF;
1700:
1701: /*
1702: fnd_file.put_line(FND_FILE.LOG,' ');
1812:
1813:
1814:
1815: IF (l_debug = 'Y') THEN
1816: okc_debug.Log('1000: Leaving ',2);
1817: okc_debug.Reset_Indentation;
1818: END IF;
1819:
1820: EXCEPTION
1813:
1814:
1815: IF (l_debug = 'Y') THEN
1816: okc_debug.Log('1000: Leaving ',2);
1817: okc_debug.Reset_Indentation;
1818: END IF;
1819:
1820: EXCEPTION
1821: WHEN others THEN
1819:
1820: EXCEPTION
1821: WHEN others THEN
1822: IF (l_debug = 'Y') THEN
1823: okc_debug.Log('2000: Leaving ',2);
1824: okc_debug.Reset_Indentation;
1825: END IF;
1826: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1827: fnd_message.set_token('ROUTINE',l_proc);
1820: EXCEPTION
1821: WHEN others THEN
1822: IF (l_debug = 'Y') THEN
1823: okc_debug.Log('2000: Leaving ',2);
1824: okc_debug.Reset_Indentation;
1825: END IF;
1826: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1827: fnd_message.set_token('ROUTINE',l_proc);
1828: fnd_message.set_token('REASON',SQLERRM);
1848:
1849: BEGIN
1850:
1851: IF (l_debug = 'Y') THEN
1852: okc_debug.Set_Indentation(l_proc);
1853: okc_debug.Log('10: Entering ',2);
1854: END IF;
1855:
1856: -- check the current value of OKC_ADVANCED_PRICING
1849: BEGIN
1850:
1851: IF (l_debug = 'Y') THEN
1852: okc_debug.Set_Indentation(l_proc);
1853: okc_debug.Log('10: Entering ',2);
1854: END IF;
1855:
1856: -- check the current value of OKC_ADVANCED_PRICING
1857: l_prof_val := fnd_profile.value('OKC_ADVANCED_PRICING');
1856: -- check the current value of OKC_ADVANCED_PRICING
1857: l_prof_val := fnd_profile.value('OKC_ADVANCED_PRICING');
1858:
1859: IF (l_debug = 'Y') THEN
1860: okc_debug.Log('100: Current OKC_ADVANCED_PRICING Profile Value : '||l_prof_val,2);
1861: END IF;
1862:
1863: IF NVL(l_prof_val,'N') = 'Y' THEN
1864: -- upgrade already done, abort
1862:
1863: IF NVL(l_prof_val,'N') = 'Y' THEN
1864: -- upgrade already done, abort
1865: IF (l_debug = 'Y') THEN
1866: okc_debug.Log('200: Aborting as the Upgrade is already Done ... ',2);
1867: END IF;
1868: fnd_file.put_line(FND_FILE.LOG,' ');
1869: fnd_file.put_line(FND_FILE.LOG,' ');
1870: fnd_file.put_line(FND_FILE.LOG,' *********************************************** ');
1875: fnd_file.put_line(FND_FILE.LOG,' ');
1876: END IF;
1877:
1878: IF (l_debug = 'Y') THEN
1879: okc_debug.Log('1000: Leaving ',2);
1880: okc_debug.Reset_Indentation;
1881: END IF;
1882:
1883: RETURN l_prof_val;
1876: END IF;
1877:
1878: IF (l_debug = 'Y') THEN
1879: okc_debug.Log('1000: Leaving ',2);
1880: okc_debug.Reset_Indentation;
1881: END IF;
1882:
1883: RETURN l_prof_val;
1884:
1884:
1885: EXCEPTION
1886: WHEN others THEN
1887: IF (l_debug = 'Y') THEN
1888: okc_debug.Log('2000: Leaving ',2);
1889: okc_debug.Reset_Indentation;
1890: END IF;
1891: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1892: fnd_message.set_token('ROUTINE',l_proc);
1885: EXCEPTION
1886: WHEN others THEN
1887: IF (l_debug = 'Y') THEN
1888: okc_debug.Log('2000: Leaving ',2);
1889: okc_debug.Reset_Indentation;
1890: END IF;
1891: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1892: fnd_message.set_token('ROUTINE',l_proc);
1893: fnd_message.set_token('REASON',SQLERRM);
1921:
1922: BEGIN
1923:
1924: IF (l_debug = 'Y') THEN
1925: okc_debug.Set_Indentation(l_proc);
1926: okc_debug.Log('10: Entering ',2);
1927: END IF;
1928:
1929: OPEN csr_estimated_amt;
1922: BEGIN
1923:
1924: IF (l_debug = 'Y') THEN
1925: okc_debug.Set_Indentation(l_proc);
1926: okc_debug.Log('10: Entering ',2);
1927: END IF;
1928:
1929: OPEN csr_estimated_amt;
1930: FETCH csr_estimated_amt INTO l_estimated_amt;
1930: FETCH csr_estimated_amt INTO l_estimated_amt;
1931: CLOSE csr_estimated_amt;
1932:
1933: IF (l_debug = 'Y') THEN
1934: okc_debug.Log('100: New Estimated Amount : '||NVL(l_estimated_amt,0),2);
1935: END IF;
1936:
1937: IF (l_debug = 'Y') THEN
1938: okc_debug.Log('1000: Leaving ',2);
1934: okc_debug.Log('100: New Estimated Amount : '||NVL(l_estimated_amt,0),2);
1935: END IF;
1936:
1937: IF (l_debug = 'Y') THEN
1938: okc_debug.Log('1000: Leaving ',2);
1939: okc_debug.Reset_Indentation;
1940: END IF;
1941:
1942: RETURN NVL(l_estimated_amt,0);
1935: END IF;
1936:
1937: IF (l_debug = 'Y') THEN
1938: okc_debug.Log('1000: Leaving ',2);
1939: okc_debug.Reset_Indentation;
1940: END IF;
1941:
1942: RETURN NVL(l_estimated_amt,0);
1943:
1943:
1944: EXCEPTION
1945: WHEN others THEN
1946: IF (l_debug = 'Y') THEN
1947: okc_debug.Log('2000: Leaving ',2);
1948: okc_debug.Reset_Indentation;
1949: END IF;
1950: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1951: fnd_message.set_token('ROUTINE',l_proc);
1944: EXCEPTION
1945: WHEN others THEN
1946: IF (l_debug = 'Y') THEN
1947: okc_debug.Log('2000: Leaving ',2);
1948: okc_debug.Reset_Indentation;
1949: END IF;
1950: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
1951: fnd_message.set_token('ROUTINE',l_proc);
1952: fnd_message.set_token('REASON',SQLERRM);
2003:
2004: BEGIN
2005:
2006: IF (l_debug = 'Y') THEN
2007: okc_debug.Set_Indentation(l_proc);
2008: okc_debug.Log('10: Entering ',2);
2009: okc_debug.Log('50: p_chr_id : '||p_chr_id,2);
2010: END IF;
2011:
2004: BEGIN
2005:
2006: IF (l_debug = 'Y') THEN
2007: okc_debug.Set_Indentation(l_proc);
2008: okc_debug.Log('10: Entering ',2);
2009: okc_debug.Log('50: p_chr_id : '||p_chr_id,2);
2010: END IF;
2011:
2012: OPEN csr_man_adj;
2005:
2006: IF (l_debug = 'Y') THEN
2007: okc_debug.Set_Indentation(l_proc);
2008: okc_debug.Log('10: Entering ',2);
2009: okc_debug.Log('50: p_chr_id : '||p_chr_id,2);
2010: END IF;
2011:
2012: OPEN csr_man_adj;
2013: LOOP
2016:
2017: -- create man adj here
2018: l_adj_amt := NVL(l_k_lines_rec.line_list_price,0) - NVL(l_k_lines_rec.price_negotiated,0) ;
2019: IF (l_debug = 'Y') THEN
2020: okc_debug.Log('100: Adjusted Amt : '||l_adj_amt,2);
2021: END IF;
2022:
2023: IF l_adj_amt > 0 THEN
2024: -- this is discount as list pr > negotiated pr
2032:
2033: -- generate Primary Key
2034: l_id := get_seq_id;
2035: IF (l_debug = 'Y') THEN
2036: okc_debug.Log('200: Primary Key : '||l_id,2);
2037: END IF;
2038:
2039: -- insert adj into okc_price_adjustments
2040: INSERT INTO okc_price_adjustments
2123: END LOOP;
2124: CLOSE csr_man_adj;
2125:
2126: IF (l_debug = 'Y') THEN
2127: okc_debug.Log('1000: Leaving ',2);
2128: okc_debug.Reset_Indentation;
2129: END IF;
2130:
2131: EXCEPTION
2124: CLOSE csr_man_adj;
2125:
2126: IF (l_debug = 'Y') THEN
2127: okc_debug.Log('1000: Leaving ',2);
2128: okc_debug.Reset_Indentation;
2129: END IF;
2130:
2131: EXCEPTION
2132: WHEN others THEN
2130:
2131: EXCEPTION
2132: WHEN others THEN
2133: IF (l_debug = 'Y') THEN
2134: okc_debug.Log('2000: Leaving ',2);
2135: okc_debug.Reset_Indentation;
2136: END IF;
2137: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
2138: fnd_message.set_token('ROUTINE',l_proc);
2131: EXCEPTION
2132: WHEN others THEN
2133: IF (l_debug = 'Y') THEN
2134: okc_debug.Log('2000: Leaving ',2);
2135: okc_debug.Reset_Indentation;
2136: END IF;
2137: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
2138: fnd_message.set_token('ROUTINE',l_proc);
2139: fnd_message.set_token('REASON',SQLERRM);
2171:
2172: BEGIN
2173:
2174: IF (l_debug = 'Y') THEN
2175: okc_debug.Set_Indentation(l_proc);
2176: okc_debug.Log('10: Entering ',2);
2177: END IF;
2178:
2179: OPEN csr_list_lines;
2172: BEGIN
2173:
2174: IF (l_debug = 'Y') THEN
2175: okc_debug.Set_Indentation(l_proc);
2176: okc_debug.Log('10: Entering ',2);
2177: END IF;
2178:
2179: OPEN csr_list_lines;
2180: -- only one line for the modifier OKC_QP_UPGRADE
2181: FETCH csr_list_lines INTO l_qp_list_lines_rec;
2182: -- check if the above Modifier is defined else give message
2183: IF csr_list_lines%NOTFOUND THEN
2184: IF (l_debug = 'Y') THEN
2185: okc_debug.Log('100: Aborting as the Modifier OKC_QP_UPGRADE is not defined ',2);
2186: END IF;
2187: fnd_file.put_line(FND_FILE.LOG,' ');
2188: fnd_file.put_line(FND_FILE.LOG,' ');
2189: fnd_file.put_line(FND_FILE.LOG,' *********************************************** ');
2201: CLOSE csr_list_lines;
2202:
2203:
2204: IF (l_debug = 'Y') THEN
2205: okc_debug.Log('1000: Leaving ',2);
2206: okc_debug.Reset_Indentation;
2207: END IF;
2208:
2209: RETURN l_status;
2202:
2203:
2204: IF (l_debug = 'Y') THEN
2205: okc_debug.Log('1000: Leaving ',2);
2206: okc_debug.Reset_Indentation;
2207: END IF;
2208:
2209: RETURN l_status;
2210:
2210:
2211: EXCEPTION
2212: WHEN others THEN
2213: IF (l_debug = 'Y') THEN
2214: okc_debug.Log('2000: Leaving ',2);
2215: okc_debug.Reset_Indentation;
2216: END IF;
2217: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
2218: fnd_message.set_token('ROUTINE',l_proc);
2211: EXCEPTION
2212: WHEN others THEN
2213: IF (l_debug = 'Y') THEN
2214: okc_debug.Log('2000: Leaving ',2);
2215: okc_debug.Reset_Indentation;
2216: END IF;
2217: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
2218: fnd_message.set_token('ROUTINE',l_proc);
2219: fnd_message.set_token('REASON',SQLERRM);
2235: BEGIN
2236:
2237:
2238: IF (l_debug = 'Y') THEN
2239: okc_debug.Set_Indentation(l_proc);
2240: okc_debug.Log('10: Entering ',2);
2241: END IF;
2242:
2243: IF (l_debug = 'Y') THEN
2236:
2237:
2238: IF (l_debug = 'Y') THEN
2239: okc_debug.Set_Indentation(l_proc);
2240: okc_debug.Log('10: Entering ',2);
2241: END IF;
2242:
2243: IF (l_debug = 'Y') THEN
2244: okc_debug.Log('1000: Leaving ',2);
2240: okc_debug.Log('10: Entering ',2);
2241: END IF;
2242:
2243: IF (l_debug = 'Y') THEN
2244: okc_debug.Log('1000: Leaving ',2);
2245: okc_debug.Reset_Indentation;
2246: END IF;
2247:
2248: RETURN(okc_p_util.raw_to_number(sys_guid()));
2241: END IF;
2242:
2243: IF (l_debug = 'Y') THEN
2244: okc_debug.Log('1000: Leaving ',2);
2245: okc_debug.Reset_Indentation;
2246: END IF;
2247:
2248: RETURN(okc_p_util.raw_to_number(sys_guid()));
2249:
2249:
2250: EXCEPTION
2251: WHEN others THEN
2252: IF (l_debug = 'Y') THEN
2253: okc_debug.Log('2000: Leaving ',2);
2254: okc_debug.Reset_Indentation;
2255: END IF;
2256: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
2257: fnd_message.set_token('ROUTINE',l_proc);
2250: EXCEPTION
2251: WHEN others THEN
2252: IF (l_debug = 'Y') THEN
2253: okc_debug.Log('2000: Leaving ',2);
2254: okc_debug.Reset_Indentation;
2255: END IF;
2256: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
2257: fnd_message.set_token('ROUTINE',l_proc);
2258: fnd_message.set_token('REASON',SQLERRM);
2281:
2282: BEGIN
2283:
2284: IF (l_debug = 'Y') THEN
2285: okc_debug.Set_Indentation(l_proc);
2286: okc_debug.Log('10: Entering ',2);
2287: END IF;
2288:
2289: OPEN csr_item_to_price_flag;
2282: BEGIN
2283:
2284: IF (l_debug = 'Y') THEN
2285: okc_debug.Set_Indentation(l_proc);
2286: okc_debug.Log('10: Entering ',2);
2287: END IF;
2288:
2289: OPEN csr_item_to_price_flag;
2290: FETCH csr_item_to_price_flag INTO l_flag;
2290: FETCH csr_item_to_price_flag INTO l_flag;
2291: CLOSE csr_item_to_price_flag;
2292:
2293: IF (l_debug = 'Y') THEN
2294: okc_debug.Log('100: l_flag : '||l_flag,2);
2295: okc_debug.Log('1000: Leaving ',2);
2296: okc_debug.Reset_Indentation;
2297: END IF;
2298:
2291: CLOSE csr_item_to_price_flag;
2292:
2293: IF (l_debug = 'Y') THEN
2294: okc_debug.Log('100: l_flag : '||l_flag,2);
2295: okc_debug.Log('1000: Leaving ',2);
2296: okc_debug.Reset_Indentation;
2297: END IF;
2298:
2299: RETURN l_flag;
2292:
2293: IF (l_debug = 'Y') THEN
2294: okc_debug.Log('100: l_flag : '||l_flag,2);
2295: okc_debug.Log('1000: Leaving ',2);
2296: okc_debug.Reset_Indentation;
2297: END IF;
2298:
2299: RETURN l_flag;
2300:
2300:
2301: EXCEPTION
2302: WHEN others THEN
2303: IF (l_debug = 'Y') THEN
2304: okc_debug.Log('2000: Leaving ',2);
2305: okc_debug.Reset_Indentation;
2306: END IF;
2307: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
2308: fnd_message.set_token('ROUTINE',l_proc);
2301: EXCEPTION
2302: WHEN others THEN
2303: IF (l_debug = 'Y') THEN
2304: okc_debug.Log('2000: Leaving ',2);
2305: okc_debug.Reset_Indentation;
2306: END IF;
2307: fnd_message.set_name('OKC','OKC_CATASTROPHIC_ERROR');
2308: fnd_message.set_token('ROUTINE',l_proc);
2309: fnd_message.set_token('REASON',SQLERRM);