Saturday 10 March 2012

AP Third Party Invoice Query against Receipt

AP Third Party Invoice Query against Receipt


SELECT rsh.receipt_num, TRUNC (rsh.creation_date) receipt_date,
       jrti.invoice_num, aia.invoice_date, aia.gl_date, jrti.invoice_id,
       pov.vendor_name, pvs.vendor_site_code, jrtid.line_number,
       jrtid.tax_type, jrtid.tax_rate, jrtid.tax_amount
  FROM jai_rcv_tp_invoices jrti,
       jai_rcv_tp_inv_details jrtid,
       rcv_shipment_headers rsh,
       po_vendors pov,
       po_vendor_sites_all pvs,
       ap_invoices_all aia
 WHERE jrti.batch_invoice_id = jrtid.batch_invoice_id
   AND rsh.shipment_header_id = jrti.shipment_header_id
   AND jrti.vendor_id = pov.vendor_id
   AND pov.vendor_id = pvs.vendor_id
   AND pvs.vendor_site_id = jrti.vendor_site_id
   AND aia.invoice_id = jrti.invoice_id
   AND rsh.shipment_header_id = 1664789

No comments:

Post a Comment