Sunday, 13 November 2011

11I_PAYMENT_LINE_Query

/* Formatted on 16-09-2011 14:47:39 (QP5 v5.115.810.9015) */
SELECT   aca.STATUS_LOOKUP_CODE,
         hou.name Operating_unit,
         aca.vendor_id,
         aca.CHECK_ID L_REFERENCE,
         aca.CHECK_NUMBER L_REFERENCE,
         aia.invoice_id,
         aia.INVOICE_NUM L_INVOICE_NUMBER,
         aip.AMOUNT L_AMOUNT,
         aia.INVOICE_CURRENCY_CODE L_CURRENCY_CODE,
         aca.DOC_SEQUENCE_ID,
         aca.DOC_SEQUENCE_VALUE
  FROM   ap_checks_all aca,
         AP_INVOICE_PAYMENTS_all aip,
         ap_lookup_codes lkup,
         ap_invoices_All aia,
         hr_operating_units hou
 WHERE       aip.CHECK_ID = aca.CHECK_ID
         AND aip.INVOICE_ID = aia.INVOICE_ID
         AND lkup.LOOKUP_CODE = aca.PAYMENT_TYPE_FLAG
         AND lkup.ENABLED_FLAG = 'Y'
         AND LKUP.LOOKUP_TYPE = 'PAYMENT TYPE'
         AND hou.organization_id = aca.org_id
         AND aca.STATUS_LOOKUP_CODE NOT IN ('VOIDED', 'Voided')
         AND aca.org_id IN (1202, 1203, 1204, 1205, 1280)
         AND aca.DOC_SEQUENCE_VALUE IN('470101098',
'470101101')

No comments:

Post a Comment