607: **************************************************/
608: Function Get_actual_creditamount(p_line_id Number, P_batch_id Number, P_line_type Varchar2) return Number Is
609: Cursor l_credit_csr Is
610: Select NVL (SUM (bill.amount), 0)
611: From Oks_bill_sub_lines bill
612: , Oks_instance_history ih
613: , Oks_inst_hist_details id
614: , Oks_bill_cont_lines bcl
615: Where bill.cle_id = id.old_subline_id
623:
624: Cursor l_tl_credit_csr Is
625:
626: Select nvl(sum(bill.amount),0)
627: From Oks_bill_sub_lines bill
628: , Oks_instance_history ih
629: , Oks_inst_hist_details id
630: , Okc_k_lines_b Kl
631: , Oks_bill_cont_lines bcl
642:
643: Cursor l_Hdr_credit_csr Is
644: Select nvl(sum(bill.amount),0)
645: From Okc_k_lines_b kl
646: , Oks_bill_sub_lines bill
647: , Oks_instance_history ih
648: , Oks_inst_hist_details id
649: , Oks_bill_cont_lines bcl
650: Where ih.batch_id = p_batch_id
701: Function Get_actual_billedamount(p_line_id Number, P_batch_id Number, P_line_type Varchar2) return Number Is
702:
703: Cursor l_billed_csr Is
704: Select NVL (SUM (bill.amount), 0)
705: From Oks_bill_sub_lines bill
706: , Oks_instance_history ih
707: , Oks_inst_hist_details id
708: , Oks_bill_cont_lines bcl
709: Where bill.cle_id = id.old_subline_id
715:
716: Cursor l_tl_billed_csr Is
717:
718: Select nvl(sum(bill.amount),0)
719: From Oks_bill_sub_lines bill
720: , Oks_instance_history ih
721: , Oks_inst_hist_details id
722: , Okc_k_lines_b Kl
723: , Oks_bill_cont_lines bcl
732:
733: Cursor l_Hdr_billed_csr Is
734: Select nvl(sum(bill.amount),0)
735: From Okc_k_lines_b kl
736: , Oks_bill_sub_lines bill
737: , Oks_instance_history ih
738: , Oks_inst_hist_details id
739: , Oks_bill_cont_lines bcl
740: Where ih.batch_id = p_batch_id
791: IS
792: CURSOR l_billed_amount_csr (p_cle_id NUMBER)
793: IS
794: SELECT NVL (SUM (amount), 0)
795: FROM oks_bill_sub_lines_v
796: WHERE cle_id = p_cle_id;
797:
798: l_billed_amt NUMBER;
799: