135: FUNCTION Get_Warranty_Flag(p_line_id IN Number) Return Varchar2 Is
136:
137: Cursor l_csr Is
138: Select 'Y'
139: From okc_k_lines_b
140: where id = p_line_id
141: -- and lse_id = 16;
142: and lse_id = 14;
143:
166: Cursor l_bp_csr Is
167: Select nvl(oksbpl.allow_bt_discount,'N') --'Y' -- fixed the 11.5.9 bug 3612660
168: From --okc_rules_b rul,
169: --okc_rule_groups_b rgp,
170: okc_k_lines_b bpl,
171: oks_k_lines_b oksbpl, -- 11.5.10 rule rearchitecture changes
172: okc_k_lines_b cov,
173: okc_k_lines_b svl,
174: okc_k_items cimbp
168: From --okc_rules_b rul,
169: --okc_rule_groups_b rgp,
170: okc_k_lines_b bpl,
171: oks_k_lines_b oksbpl, -- 11.5.10 rule rearchitecture changes
172: okc_k_lines_b cov,
173: okc_k_lines_b svl,
174: okc_k_items cimbp
175: where svl.id = p_line_id
176: and cov.cle_id = svl.id
169: --okc_rule_groups_b rgp,
170: okc_k_lines_b bpl,
171: oks_k_lines_b oksbpl, -- 11.5.10 rule rearchitecture changes
172: okc_k_lines_b cov,
173: okc_k_lines_b svl,
174: okc_k_items cimbp
175: where svl.id = p_line_id
176: and cov.cle_id = svl.id
177: and cov.lse_id in (2,15,20)
193: Cursor l_txn_grp_csr Is
194: Select nvl(oksbpl.allow_bt_discount,'N') --'Y' -- fixed the 11.5.9 bug 3612660
195: From --okc_rules_b rul,
196: --okc_rule_groups_b rgp,
197: okc_k_lines_b bpl,
198: oks_k_lines_b oksbpl, -- 11.5.10 rule rearchitecture changes
199: okc_k_lines_b cov,
200: okc_k_lines_b svl
201: where svl.id = p_line_id
195: From --okc_rules_b rul,
196: --okc_rule_groups_b rgp,
197: okc_k_lines_b bpl,
198: oks_k_lines_b oksbpl, -- 11.5.10 rule rearchitecture changes
199: okc_k_lines_b cov,
200: okc_k_lines_b svl
201: where svl.id = p_line_id
202: and cov.cle_id = svl.id
203: and cov.lse_id in (2,15,20)
196: --okc_rule_groups_b rgp,
197: okc_k_lines_b bpl,
198: oks_k_lines_b oksbpl, -- 11.5.10 rule rearchitecture changes
199: okc_k_lines_b cov,
200: okc_k_lines_b svl
201: where svl.id = p_line_id
202: and cov.cle_id = svl.id
203: and cov.lse_id in (2,15,20)
204: and bpl.cle_id = cov.id
220: -- Bug Fix #5369536. Added hint.
221: Cursor l_bp_csr Is
222: Select /*+ leading(svl) use_nl(svl ksl bpl cimbp oksbpl) index(cimbp okc_k_items_n1) */
223: nvl(oksbpl.allow_bt_discount,'N') --'Y' -- fixed the 11.5.9 bug 3612660
224: From okc_k_lines_b svl,
225: oks_k_Lines_b ksl,
226: okc_k_lines_b bpl,
227: okc_k_items cimbp,
228: oks_k_lines_b oksbpl -- 11.5.10 rule rearchitecture changes
222: Select /*+ leading(svl) use_nl(svl ksl bpl cimbp oksbpl) index(cimbp okc_k_items_n1) */
223: nvl(oksbpl.allow_bt_discount,'N') --'Y' -- fixed the 11.5.9 bug 3612660
224: From okc_k_lines_b svl,
225: oks_k_Lines_b ksl,
226: okc_k_lines_b bpl,
227: okc_k_items cimbp,
228: oks_k_lines_b oksbpl -- 11.5.10 rule rearchitecture changes
229: where svl.id = p_line_id
230: and svl.lse_id in (1,14,19)
240: -- related to p_txn_grp_id
241:
242: Cursor l_txn_grp_csr Is
243: Select nvl(oksbpl.allow_bt_discount,'N') --'Y' -- fixed the 11.5.9 bug 3612660
244: From okc_k_lines_b bpl,
245: oks_k_lines_b oksbpl, -- 11.5.10 rule rearchitecture changes
246: okc_k_lines_b svl,
247: oks_k_Lines_b ksl
248: where svl.id = p_line_id
242: Cursor l_txn_grp_csr Is
243: Select nvl(oksbpl.allow_bt_discount,'N') --'Y' -- fixed the 11.5.9 bug 3612660
244: From okc_k_lines_b bpl,
245: oks_k_lines_b oksbpl, -- 11.5.10 rule rearchitecture changes
246: okc_k_lines_b svl,
247: oks_k_Lines_b ksl
248: where svl.id = p_line_id
249: and svl.lse_id in (1,14,19)
250: and ksl.cle_id = svl.id
340: select btl.ID BTYPE_ID,
341: btl.CLE_ID TXNGRP_ID,
342: oksbtl.discount_amount UPTO_AMT,
343: oksbtl.discount_percent PER_CVD
344: from okc_k_lines_b svl,
345: okc_k_lines_b cov,
346: okc_k_lines_b bpl,
347: okc_k_lines_b btl,
348: oks_k_lines_b oksbtl, --11.5.10 rule reachitecture changes
341: btl.CLE_ID TXNGRP_ID,
342: oksbtl.discount_amount UPTO_AMT,
343: oksbtl.discount_percent PER_CVD
344: from okc_k_lines_b svl,
345: okc_k_lines_b cov,
346: okc_k_lines_b bpl,
347: okc_k_lines_b btl,
348: oks_k_lines_b oksbtl, --11.5.10 rule reachitecture changes
349: okc_k_items cimbp,
342: oksbtl.discount_amount UPTO_AMT,
343: oksbtl.discount_percent PER_CVD
344: from okc_k_lines_b svl,
345: okc_k_lines_b cov,
346: okc_k_lines_b bpl,
347: okc_k_lines_b btl,
348: oks_k_lines_b oksbtl, --11.5.10 rule reachitecture changes
349: okc_k_items cimbp,
350: okc_k_items cimbt
343: oksbtl.discount_percent PER_CVD
344: from okc_k_lines_b svl,
345: okc_k_lines_b cov,
346: okc_k_lines_b bpl,
347: okc_k_lines_b btl,
348: oks_k_lines_b oksbtl, --11.5.10 rule reachitecture changes
349: okc_k_items cimbp,
350: okc_k_items cimbt
351: -- okc_rule_groups_b rgp,
370: select btl.ID BTYPE_ID,
371: btl.CLE_ID TXNGRP_ID,
372: oksbtl.discount_amount UPTO_AMT,
373: oksbtl.discount_percent PER_CVD
374: from okc_k_lines_b svl,
375: okc_k_lines_b cov,
376: okc_k_lines_b bpl,
377: okc_k_lines_b btl,
378: oks_k_lines_b oksbtl, --11.5.10 rule reachitecture changes
371: btl.CLE_ID TXNGRP_ID,
372: oksbtl.discount_amount UPTO_AMT,
373: oksbtl.discount_percent PER_CVD
374: from okc_k_lines_b svl,
375: okc_k_lines_b cov,
376: okc_k_lines_b bpl,
377: okc_k_lines_b btl,
378: oks_k_lines_b oksbtl, --11.5.10 rule reachitecture changes
379: okc_k_items cimbt
372: oksbtl.discount_amount UPTO_AMT,
373: oksbtl.discount_percent PER_CVD
374: from okc_k_lines_b svl,
375: okc_k_lines_b cov,
376: okc_k_lines_b bpl,
377: okc_k_lines_b btl,
378: oks_k_lines_b oksbtl, --11.5.10 rule reachitecture changes
379: okc_k_items cimbt
380: -- okc_rule_groups_b rgp,
373: oksbtl.discount_percent PER_CVD
374: from okc_k_lines_b svl,
375: okc_k_lines_b cov,
376: okc_k_lines_b bpl,
377: okc_k_lines_b btl,
378: oks_k_lines_b oksbtl, --11.5.10 rule reachitecture changes
379: okc_k_items cimbt
380: -- okc_rule_groups_b rgp,
381: -- okc_rules_b rul
405: select btl.ID BTYPE_ID,
406: btl.CLE_ID TXNGRP_ID,
407: oksbtl.discount_amount UPTO_AMT,
408: oksbtl.discount_percent PER_CVD
409: from okc_k_lines_b svl,
410: okc_k_lines_b bpl,
411: okc_k_lines_b btl,
412: oks_k_lines_b oksbtl, --11.5.10 rule reachitecture changes
413: okc_k_items cimbp,
406: btl.CLE_ID TXNGRP_ID,
407: oksbtl.discount_amount UPTO_AMT,
408: oksbtl.discount_percent PER_CVD
409: from okc_k_lines_b svl,
410: okc_k_lines_b bpl,
411: okc_k_lines_b btl,
412: oks_k_lines_b oksbtl, --11.5.10 rule reachitecture changes
413: okc_k_items cimbp,
414: okc_k_items cimbt
407: oksbtl.discount_amount UPTO_AMT,
408: oksbtl.discount_percent PER_CVD
409: from okc_k_lines_b svl,
410: okc_k_lines_b bpl,
411: okc_k_lines_b btl,
412: oks_k_lines_b oksbtl, --11.5.10 rule reachitecture changes
413: okc_k_items cimbp,
414: okc_k_items cimbt
415: ,OKS_K_LINES_B ksl
431: select btl.ID BTYPE_ID,
432: btl.CLE_ID TXNGRP_ID,
433: oksbtl.discount_amount UPTO_AMT,
434: oksbtl.discount_percent PER_CVD
435: from okc_k_lines_b svl,
436: okc_k_lines_b bpl,
437: okc_k_lines_b btl,
438: oks_k_lines_b oksbtl, --11.5.10 rule reachitecture changes
439: okc_k_items cimbt
432: btl.CLE_ID TXNGRP_ID,
433: oksbtl.discount_amount UPTO_AMT,
434: oksbtl.discount_percent PER_CVD
435: from okc_k_lines_b svl,
436: okc_k_lines_b bpl,
437: okc_k_lines_b btl,
438: oks_k_lines_b oksbtl, --11.5.10 rule reachitecture changes
439: okc_k_items cimbt
440: ,OKS_K_LINES_B ksl
433: oksbtl.discount_amount UPTO_AMT,
434: oksbtl.discount_percent PER_CVD
435: from okc_k_lines_b svl,
436: okc_k_lines_b bpl,
437: okc_k_lines_b btl,
438: oks_k_lines_b oksbtl, --11.5.10 rule reachitecture changes
439: okc_k_items cimbt
440: ,OKS_K_LINES_B ksl
441:
791: bpl.end_date bpl_end_date,
792: bpl.price_list_id bpl_pre,
793: oksbpl.discount_list oksbpl_dst,
794: chr.price_list_id chr_pre
795: from okc_k_lines_b svl,
796: okc_k_lines_b cov,
797: okc_k_lines_b bpl,
798: oks_k_lines_b oksbpl,
799: okc_k_items cimbp,
792: bpl.price_list_id bpl_pre,
793: oksbpl.discount_list oksbpl_dst,
794: chr.price_list_id chr_pre
795: from okc_k_lines_b svl,
796: okc_k_lines_b cov,
797: okc_k_lines_b bpl,
798: oks_k_lines_b oksbpl,
799: okc_k_items cimbp,
800: okc_k_headers_b chr -- 11.5.10 addition
793: oksbpl.discount_list oksbpl_dst,
794: chr.price_list_id chr_pre
795: from okc_k_lines_b svl,
796: okc_k_lines_b cov,
797: okc_k_lines_b bpl,
798: oks_k_lines_b oksbpl,
799: okc_k_items cimbp,
800: okc_k_headers_b chr -- 11.5.10 addition
801: where svl.id = p_contract_line_id
823: bpl.end_date bpl_end_date,
824: bpl.price_list_id bpl_pre,
825: oksbpl.discount_list oksbpl_dst,
826: chr.price_list_id chr_pre
827: from okc_k_lines_b svl,
828: okc_k_lines_b bpl,
829: oks_k_lines_b oksbpl,
830: okc_k_items cimbp,
831: okc_k_headers_all_b chr -- Modified for 12.0 MOAC project (JVARGHES)
824: bpl.price_list_id bpl_pre,
825: oksbpl.discount_list oksbpl_dst,
826: chr.price_list_id chr_pre
827: from okc_k_lines_b svl,
828: okc_k_lines_b bpl,
829: oks_k_lines_b oksbpl,
830: okc_k_items cimbp,
831: okc_k_headers_all_b chr -- Modified for 12.0 MOAC project (JVARGHES)
832: , oks_k_lines_b ksl
904:
905: cursor get_btl_id (p_cont_line_id in number,p_busi_proc_id in number,
906: p_txn_bill_type_id in number,p_request_date in date) IS
907: select btl.id btl_id
908: from okc_k_lines_b svl,
909: okc_k_lines_b cov,
910: okc_k_lines_b bpl,
911: okc_k_items cimbp,
912: okc_k_lines_b btl,
905: cursor get_btl_id (p_cont_line_id in number,p_busi_proc_id in number,
906: p_txn_bill_type_id in number,p_request_date in date) IS
907: select btl.id btl_id
908: from okc_k_lines_b svl,
909: okc_k_lines_b cov,
910: okc_k_lines_b bpl,
911: okc_k_items cimbp,
912: okc_k_lines_b btl,
913: okc_k_items cimbt
906: p_txn_bill_type_id in number,p_request_date in date) IS
907: select btl.id btl_id
908: from okc_k_lines_b svl,
909: okc_k_lines_b cov,
910: okc_k_lines_b bpl,
911: okc_k_items cimbp,
912: okc_k_lines_b btl,
913: okc_k_items cimbt
914: where svl.id = p_cont_line_id
908: from okc_k_lines_b svl,
909: okc_k_lines_b cov,
910: okc_k_lines_b bpl,
911: okc_k_items cimbp,
912: okc_k_lines_b btl,
913: okc_k_items cimbt
914: where svl.id = p_cont_line_id
915: and cov.cle_id = svl.id
916: and cov.lse_id in (2,15,20)
931:
932: cursor get_btl_id (p_cont_line_id in number,p_busi_proc_id in number,
933: p_txn_bill_type_id in number,p_request_date in date) IS
934: select btl.id btl_id
935: from okc_k_lines_b svl,
936: okc_k_lines_b bpl,
937: okc_k_items cimbp,
938: okc_k_lines_b btl,
939: okc_k_items cimbt,
932: cursor get_btl_id (p_cont_line_id in number,p_busi_proc_id in number,
933: p_txn_bill_type_id in number,p_request_date in date) IS
934: select btl.id btl_id
935: from okc_k_lines_b svl,
936: okc_k_lines_b bpl,
937: okc_k_items cimbp,
938: okc_k_lines_b btl,
939: okc_k_items cimbt,
940: oks_k_lines_b ksl
934: select btl.id btl_id
935: from okc_k_lines_b svl,
936: okc_k_lines_b bpl,
937: okc_k_items cimbp,
938: okc_k_lines_b btl,
939: okc_k_items cimbt,
940: oks_k_lines_b ksl
941: where svl.id = p_cont_line_id
942: and svl.lse_id in (1,14,19)