Tuesday, 3 November 2015

How to Link between RTN to Credit Memo in Payable

SELECT jat.dm_invoice_num
  FROM jai_ap_tds_invoices jat,
       ap_invoices_all aia,
       ap_invoice_distributions_all aida
 WHERE aia.invoice_id = aida.invoice_id
   AND jat.invoice_id = aia.invoice_id
   AND aida.invoice_distribution_id IN (
          SELECT aid.prepay_distribution_id
            FROM jai_ap_tds_thhold_trxs jtx, ap_invoice_distributions_all aid
           WHERE jtx.invoice_distribution_id = aid.invoice_distribution_id
             AND invoice_to_vendor_id = 516912) --- RTN Invoice ID

No comments:

Post a Comment