Tuesday, 6 December 2016

Supplier Master Query


/* Formatted on 11/27/2016 8:35:10 AM (QP5 v5.126.903.23003) */
SELECT   PO_VENDORS.SEGMENT1 SUPPLIER_NUMBER,
         PO_VENDORS.VENDOR_NAME SUPPLIER_NAME,
         PO_VENDOR_SITES_ALL.VENDOR_SITE_CODE SUPPLIER_SITE_CODE,
         PO_VENDORS.VENDOR_TYPE_LOOKUP_CODE VENDOR_TYPE,
         PO_VENDOR_SITES_ALL.ADDRESS_LINE1,
         PO_VENDOR_SITES_ALL.ADDRESS_LINE2,
         PO_VENDOR_SITES_ALL.ADDRESS_LINE3,
         PO_VENDOR_SITES_ALL.CITY,
         PO_VENDOR_SITES_ALL.STATE,
         PO_VENDOR_SITES_ALL.ZIP,
         PO_VENDOR_SITES_ALL.COUNTRY,
         PO_VENDOR_SITES_ALL.AREA_CODE,
         PO_VENDOR_SITES_ALL.PHONE,
         PO_VENDOR_SITES_ALL.FAX_AREA_CODE,
         PO_VENDOR_SITES_ALL.FAX,
         PO_VENDORS.CREATION_DATE,
         (SELECT   USER_NAME
            FROM   fnd_user
           WHERE   user_id = PO_VENDORS.CREATED_BY)
            created_By,
         PO_VENDORS.LAST_UPDATE_DATE,
         (SELECT   USER_NAME
            FROM   fnd_user
           WHERE   user_id = PO_VENDORS.LAST_UPDATED_BY)
            Last_Updated_By,
         PO_VENDORS.START_DATE_ACTIVE,
         PO_VENDORS.END_DATE_ACTIVE,
         PO_VENDOR_SITES_ALL.PAY_GROUP_LOOKUP_CODE,
         PO_VENDORS.ENABLED_FLAG,
         PO_VENDOR_SITES_ALL.attribute1 SUPPLIER_CLASSIFICATION,
         PO_VENDORS.TERMS_DATE_BASIS,
         PO_VENDORS.ATTRIBUTE1 PACER_VENDOR_NO,
         AP_TERMS_TL.NAME PAYMENT_TERMS,
         ieb.BANK_NUMBER,
         ieb.bank_name "BANK NAME",
         iebb.bank_branch_name "BANK BRANCH NAME",
         ieba.BANK_ACCOUNT_NUM "BANK ACCOUNT NUMBER",
         EFT_SWIFT_CODE BANK_SWIFT_CODE,
         IBAN,
         PO_VENDORS.INVOICE_CURRENCY_CODE,
         PO_VENDORS.PAYMENT_CURRENCY_CODE,
            PO_VENDOR_CONTACTS.PREFIX
         || ' '
         || PO_VENDOR_CONTACTS.FIRST_NAME
         || ' '
         || PO_VENDOR_CONTACTS.LAST_NAME
            SUPPLIER_CONTACT,
         PO_VENDOR_CONTACTS.EMAIL_ADDRESS
  FROM   PO_VENDOR_SITES_ALL,
         PO_VENDORS,
         AP_TERMS_TL,
         apps.iby_ext_bank_accounts ieba,
         apps.iby_account_owners iao,
         apps.iby_ext_banks_v ieb,
         apps.iby_ext_bank_branches_v iebb,
         PO_VENDOR_CONTACTS
 WHERE       PO_VENDOR_SITES_ALL.VENDOR_ID = PO_VENDORS.VENDOR_ID
         AND PO_VENDORS.TERMS_ID = AP_TERMS_TL.TERM_ID
         AND iao.account_owner_party_id = PO_VENDORS.party_id
         AND ieba.ext_bank_account_id = iao.ext_bank_account_id
         AND ieb.bank_party_id = iebb.bank_party_id
         AND ieba.branch_id = iebb.branch_party_id
         AND ieba.bank_id = ieb.bank_party_id
         AND PO_VENDORS.ENABLED_FLAG = 'Y'
         AND PO_VENDOR_SITES_ALL.VENDOR_ID = PO_VENDOR_CONTACTS.VENDOR_ID(+)
         AND PO_VENDOR_SITES_ALL.VENDOR_SITE_ID =
               PO_VENDOR_CONTACTS.VENDOR_SITE_ID(+)

No comments:

Post a Comment

Power BI: Show Last Data Refresh on Dashboard

 To show last data refresh on Power BI report follow the below steps. 1. Open Report Query Editor Mode. 2. Clink on Get Data -> Blank...