select distinct hou.name,
        a.org_id,
a.invoice_id,
a.invoice_num,
a.invoice_date,
a.attribute11 ship_to
d.segment4 dist_loc,
aps.vendor_name,
apsa.vendor_site_code
from apps.ap_invoices_all a,
apps.ap_invoice_lines_all b,
apps.ap_invoice_distributions_all c,
apps.gl_code_combinations d,
apps.hr_operating_units hou,
apps.ap_suppliers aps,
apps.ap_supplier_sites_all apsa
where a.invoice_id=b.invoice_id
and b.invoice_id=c.invoice_id
and b.line_number=c.distribution_line_number
and c.dist_code_combination_id=d.code_combination_id
and a.org_id=hou.organization_id
and a.vendor_id=aps.vendor_id
and a.vendor_site_id=apsa.vendor_site_id
and b.line_type_lookup_code=’ITEM’
and c.line_type_lookup_code=’ITEM’
and a.attribute11<>d.segment4
and c.posted_flag=’N’
and trunc(a.gl_date) between :P_FROM_DATE and :P_TO_DATE
and hou.business_group_id=:P_BG_ID
order by 1
Recent Posts

Start typing and press Enter to search