781: AND nvl(aida.reversal_flag, 'N') <> 'Y'
782: AND nvl(aida.tax_recoverable_flag, 'N') = 'N'
783: AND aia.invoice_id = aida.invoice_id
784: AND exists (
785: SELECT 'x' FROM ap_chrg_allocations_all
786: WHERE item_dist_id = p_item_dist_id
787: AND charge_dist_id = aida.invoice_distribution_id);
788:
789: FUNCTION allocated_amount (pf_item_dist_id IN number, pf_charge_dist_id IN number)
791: IS
792: l_alloc_amount number := 0;
793: CURSOR chrg_alloc_cur IS
794: SELECT allocated_amount
795: FROM ap_chrg_allocations_all
796: WHERE item_dist_id = pf_item_dist_id
797: AND charge_dist_id = pf_charge_dist_id;
798: BEGIN
799: FOR chrg_alloc_rec IN chrg_alloc_cur