875: and cbl.termination_date between cp_from_date and cp_to_date
876: group by trunc(cbl.termination_date);
877:
878: --get payments for revolving loans for receipt date range
879: -- sjalasut, modified the cursor to include okl_txl_ap_inv_lns_all_b and
880: -- okl_cnsld_ap_invs_all. khr_id now will be stored at the internal transaction
881: -- line table and consolidated invoice id is also stored at the internal
882: -- transaction lines table (okl_txl_ap_inv_lns_all_b)
883: -- changes made as part of OKLR12B disbursements project
878: --get payments for revolving loans for receipt date range
879: -- sjalasut, modified the cursor to include okl_txl_ap_inv_lns_all_b and
880: -- okl_cnsld_ap_invs_all. khr_id now will be stored at the internal transaction
881: -- line table and consolidated invoice id is also stored at the internal
882: -- transaction lines table (okl_txl_ap_inv_lns_all_b)
883: -- changes made as part of OKLR12B disbursements project
884: Cursor c_borrower_payment_csr(cp_khr_id IN NUMBER, cp_from_date IN DATE, cp_to_date IN DATE) IS
885: select iph.check_date borrower_payment_date
886: , sum(iph.amount) borrower_payment
886: , sum(iph.amount) borrower_payment
887: from ap_invoices_all ap_inv
888: , okl_trx_ap_invoices_v okl_inv
889: , ap_invoice_payment_history_v iph
890: , okl_txl_ap_inv_lns_all_b okl_inv_ln
891: , okl_cnsld_Ap_invs_all okl_cnsld
892: , fnd_application fnd_app
893: where okl_inv.id = okl_inv_ln.tap_id
894: and okl_inv_ln.khr_id = cp_khr_id
902: and iph.check_date BETWEEN cp_from_date AND NVL(cp_to_date, iph.check_date)
903: group by iph.check_date;
904:
905: --get sum of payments upto a date
906: -- sjalasut, modified the cursor to include okl_txl_ap_inv_lns_all_b and
907: -- okl_cnsld_ap_invs_all. khr_id now will be stored at the internal transaction
908: -- line table and consolidated invoice id is also stored at the internal
909: -- transaction lines table (okl_txl_ap_inv_lns_all_b)
910: -- changes made as part of OKLR12B disbursements project
905: --get sum of payments upto a date
906: -- sjalasut, modified the cursor to include okl_txl_ap_inv_lns_all_b and
907: -- okl_cnsld_ap_invs_all. khr_id now will be stored at the internal transaction
908: -- line table and consolidated invoice id is also stored at the internal
909: -- transaction lines table (okl_txl_ap_inv_lns_all_b)
910: -- changes made as part of OKLR12B disbursements project
911: Cursor c_payment_amount_csr(cp_khr_id IN NUMBER, cp_from_date IN DATE) IS
912: select sum(iph.amount) payment_amount
913: from ap_invoices_all ap_inv
912: select sum(iph.amount) payment_amount
913: from ap_invoices_all ap_inv
914: , okl_trx_ap_invoices_v okl_inv
915: , ap_invoice_payment_history_v iph
916: , okl_txl_ap_inv_lns_all_b okl_inv_ln
917: , okl_cnsld_Ap_invs_all okl_cnsld
918: , fnd_application fnd_app
919: where okl_inv.id = okl_inv_ln.tap_id
920: and okl_inv_ln.khr_id = cp_khr_id