1061: SELECT aid.po_distribution_id,
1062: decode(pll.matching_basis,'QUANTITY',sum(nvl(aid.quantity_invoiced,0))),
1063: decode(pll.matching_basis,'AMOUNT',sum(nvl(aid.amount,0))),
1064: pll.matching_basis
1065: FROM ap_invoice_distributions_v aid,
1066: ap_invoices ai,
1067: po_line_locations pll
1068: WHERE pll.line_location_id = P_Po_Line_Location_Id
1069: AND pll.shipment_type <> 'PREPAYMENT'