Sunday, 13 November 2011

11I_PAYMENT_HEADERS_Query

/* Formatted on 16-09-2011 13:28:31 (QP5 v5.115.810.9015) */
SELECT   hou.name Operating_unit,
         aca.CHECK_ID,
         aca.VENDOR_ID,
         (SELECT   segment1
            FROM   po_vendors
           WHERE   vendor_id = aca.vendor_id)
            Vendor_Code,
         aca.check_number H_REFERENCE,
         LKUP.DISPLAYED_FIELD H_PAYMENT_TYPE,
         aca.vendor_name H_VENDOR_NAME,
         aca.vendor_Site_code H_VENDOR_SITE_CODE,
         TRUNC (aca.check_date) H_CHECK_DATE,
         aca.amount H_AMOUNT,
         aca.bank_account_name H_BANK_ACCT_NAME,
         aca.payment_method_lookup_code H_PAYMENT_METHOD,
         acs.name H_PAYMENT_DOCUMENT,
         aca.DOC_SEQUENCE_VALUE H_DOCUMENT_NUMBER,
         'APIL_STANDARD_PROFILE' H_PAYMENT_PROFILE,
         aca.currency_code H_CURRENCY_CODE,
         aca.DESCRIPTION H_NARRATION,
         aca.DOC_SEQUENCE_ID,
         aca.DOC_SEQUENCE_VALUE
  FROM   ap_checks_all aca,
         ap_lookup_codes lkup,
         ap_check_stocks_all acs,
         hr_operating_units hou
 WHERE       lkup.LOOKUP_CODE = aca.PAYMENT_TYPE_FLAG
         AND acs.CHECK_STOCK_ID = aca.CHECK_STOCK_ID
         AND lkup.ENABLED_FLAG = 'Y'
         AND LKUP.LOOKUP_TYPE = 'PAYMENT TYPE'
         AND hou.organization_id = aca.org_id
         AND aca.org_id IN (1202, 1203, 1204, 1205, 1280)
         AND aca.STATUS_LOOKUP_CODE NOT IN ('VOIDED', 'Voided')
         AND aca.DOC_SEQUENCE_VALUE IN('470101098',
'470101101')

No comments:

Post a Comment