The payable header table is associated with the purchase receipt and purchase order table.

Source: Internet
Author: User

Select AIA. invoice_num,
AIA. invoice_date,
AIA. creation_date,
AIA. vendor_id,
AIA. invoice_currency_code,
AIl. amount,
AIl. base_amount,
AIA. description,
Decode (AIL. base_amount,
Null,
1,
Round (AIL. base_amount/ail. amount, 4 )),
AIl. inventory_item_id,
AIl. quantity_invoiced,
AIl. unit_price,
AIl. amount,
AIl. base_amount,
AIl. rcv_transaction_id,
MSI. segment1,
MSI. description,
RSH. receipt_num,
PHA. segment1,
PV. vendor_name,
RSL. quantity_policed
From AP. ap_invoices_all AIA,
AP. ap_invoice_lines_all aIl,
Po. po_headers_all PHA,
Apps. po_vendors PV,
Inv. mtl_system_items_ B MSI,
Rcv_shipment_headers RSH, -- receiving Header
Rcv_shipment_lines RSL -- receiving line
Where AIA. invoice_id = ail. invoice_id
And ail. po_header_id = PHA. po_header_id (+)
And AIA. vendor_id = pv. vendor_id
And ail. inventory_item_id = MSI. inventory_item_id (+)
And ail.org _ id = MSI. organization_id (+)
And ail. rcv_shipment_line_id = RSL. shipment_line_id (+)
And RSL. shipment_header_id = RSH. shipment_header_id (+)
And ail. line_type_lookup_code = 'item'

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.