select distinct ou.name "OPERATING UNIT"
,pv.segment1 "Supplier Number"
,pv.vendor_name "Supplier Name"
,PV.END_DATE_ACTIVE "Inactive Date"
-- ,pv.NUM_1099 "Taxpayer ID"
-- ,pvsa.VAT_REGISTRATION_NUM "Tax Registration Number"
-- ,PV.ORGANIZATION_TYPE_LOOKUP_CODE "Organization Type"
-- ,pvsa.country "Site Country"
,pvsa.VENDOR_SITE_CODE "Site Name"
-- ,pvsa.ADDRESS_LINE1 "Site Address Line 1"
-- ,pvsa.ADDRESS_LINE2 "Site Address Line 2"
--,pvsa.ADDRESS_LINE3 "Address Line3"
-- ,pvsa.CITY "Site City"
-- ,pvsa.STATE "Site State"
-- ,pvsa.PROVINCE "Province"
-- ,pvsa.ZIP "Postal Code"
-- ,pvsa.INACTIVE_DATE "Site Status"
-- ,pvsa.AREA_CODE "Phone Area Code"
-- ,pvsa.PHONE "Phone Number"
-- ,pvsa.FAX "Fax Number"
-- ,pvsa.FAX_AREA_CODE "Fax Area Code"
-- ,pvsa.EMAIL_ADDRESS "Email Address"
-- ,PVSA.PAY_SITE_FLAG "Address Purpose Payment"
-- ,PVSa.PURCHASING_SITE_FLAG "Address Purpose Purchasing"
,pvsa.PAYMENT_METHOD_LOOKUP_CODE "Site Payment Method"
,pv.PAYMENT_METHOD_LOOKUP_CODE "Header Payment Method"
-- ,pvsa.INVOICE_CURRENCY_CODE "Invoice Currency"
-- ,pvsa.PAYMENT_CURRENCY_CODE "Payment Currency"
-- ,pvsa.PAY_GROUP_LOOKUP_CODE "Pay Group"
-- ,att.TOLERANCE_NAME "Invoice Tolerance" -- pvsa.TOLERANCE_ID
-- ,pv.MATCH_OPTION "Invoice Match Option"
,apt.NAME "Site Payment Terms"
,apt1.name "Header Payment Terms"
-- ,apt.NAME "Payment Terms"
-- ,apt.description
-- ,pvsa.PAY_DATE_BASIS_LOOKUP_CODE "Pay Date Basis"
from apps.AP_SUPPLIERS pv
,apps.AP_SUPPLIER_SITES_ALL pvsa
-- ,apps.ap_invoices_all aia
--,apps.ap_invoice_payments_all aip
,(select * from apps.ap_terms_tl where lANGUAGE = 'US') apt
,(select * from apps.ap_terms_tl where lANGUAGE = 'US') apt1
,hr_operating_units ou
,ap_tolerance_templates att
where pv.vendor_id=pvsa.vendor_id
--AND pv.vendor_id=aia.vendor_id
--AND pvsa.VENDOR_SITE_ID = aia.VENDOR_SITE_ID
AND ou.organization_id=pvsa.org_id
--AND trunc(aia.CREATION_DATE) BETWEEN nvl(trunc(to_date(:cp_trx_date_low,'yyyy/MM/DD HH24:MI:SS')),trunc(aia.CREATION_DATE))
-- AND nvl(trunc(to_date(:cp_trx_date_high,'yyyy/MM/DD HH24:MI:SS')),trunc(aia.CREATION_DATE))
--AND aip.invoice_id = aia.invoice_id
and pvsa.TERMS_ID = apt.TERM_ID(+)
AND pv.TERMS_ID = apt1.TERM_ID(+)
AND pvsa.TOLERANCE_ID = att.TOLERANCE_ID(+)
--AND pvsa.PAY_DATE_BASIS_LOOKUP_CODE='DISCOUNT'
Order by pv.segment1 asc
No comments:
Post a Comment