Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Important Tables in Payables Module (Oracle Payables - AP)

Payables Module (Oracle Payables - AP)


The accounts payable department is responsible for creating and maintaining a partnership with each supplier to
ensure that all terms and conditions of the relationship are met. Processing Invoices. The accounts payable
department receives invoices and records liabilities and corresponding expenses or assets.

Table Name Important Columns Description


AP_INVOICES_ALL INVOICE_ID (Primary Key) AP_INVOICES_ALL contains
ORG_ID (Ministry Identifier) records for invoices you enter.
INVOICE_NUM (Invoice Number) There is one row for each invoice
INVOICE_DATE (Invoice Date) you enter. An invoice can have one
INVOICE_AMOUNT (Invoice or more invoice distribution lines.
Amount) An invoice can also have one or
INVOICE_CURRENCY_CODE more scheduled payments.
(Invoice Currency)
VENDOR_ID (Supplier Id)
VENDOR_SITE_ID (Supplier Site
Id)
EXCHANGE_RATE (Exchange
rate for foreign currency Invoice)
EXCHANGE_RATE_TYPE
(Exchange rate type used for
foreign currency Invoice)
AP_INVOICE_LINES_ALL INVOICE_ID, LINE_NUMBER AP_INVOICE_LINES_ALL contains
(Primary Key) records for invoice lines entered
ORG_ID (Ministry Identifier) manually, generated automatically
DESCRIPTION (Invoice line or imported from the Open
description) Interface. An invoice can have
AMOUNT (Line Amount in Invoice multiple lines.
Currency)
AP_INVOICE_DISTRIBUTIONS_ALL INVOICE_ID, Invoice distribution line information,
DISTRIBUTION_LINE_NUMBER where accounting details are
(Primary Key) stored. An invoice can have
ORG_ID (Ministry Identifier) multiple distributions.
INVOICE_LINE_NUMBER (Invoice
line number for parent line)
AMOUNT (Invoice distribution
amount)
BASE_AMOUNT (Amount of
invoice in OMR (functional
currency), only used for foreign
currency invoices)
DIST_CODE_COMBINATION_ID
(Accounting Flexfield identifier
(Chart of Account) for account
associated with a distribution)

AP_SUPPLIERS VENDOR_ID (Primary Key) To get all the supplier information


SEGMENT1 (Supplier Number) for the invoice we need to go
VENDOR_NAME (Supplier Name) ap_suppliers. AP_SUPPLIERS
stores information about your
supplier level attributes. Each row
includes the purchasing, receiving,
invoice, tax, classification, and
general information. Oracle
Purchasing uses this information to
determine active suppliers.
AP_SUPPLIER_SITES_ALL VENDOR_SITE_ID (Primary Key) AP_SUPPLIER_SITES_ALL stores
VENDOR_ID (Supplier Id) information about your supplier
VENDOR_SITE_CODE (Identifier delivery site level attributes.
for serving site) Relates operating unit (Individual
ORG_ID (Ministry Identifier) Ministry) and the business

1
Important Tables in Payables Module (Oracle Payables - AP)

relationship that you have with the


supplier.
AP_PAYMENT_SCHEDULES_ALL INVOICE_ID (Invoice identifier) Scheduled payment information on
BATCH_ID (Invoice batch invoices
identifier)
EXTERNAL_BANK_ACCOUNT_ID
(External bank account identifier)
DUE_DATE (Payment due date)
ORG_ID (Ministry Identifier)
AP_BATCHES_ALL BATCH_ID (Primary key) AP_BATCHES_ALL contains
BATCH_NAME (Invoice batch summary information about
name (uniqueness enforced by the invoices you enter in batches if you
Invoice workbench)) enable the Batch Control Payables
BATCH_DATE (Invoice Batch option.
Date)
ORG_ID (Ministry Identifier)
INVOICE_CURRENCY_CODE
(Currency code of invoice,
overrides supplier invoice currency
(may be left null for Multiple
Currency Batches))
AP_CHECKS_ALL CHECK_ID (Primary Key) AP_CHECKS_ALL stores
CHECK_DATE (Payment Date) information about payments
AMOUNT (Payment Amount) issued to suppliers or refunds
BASE_AMOUNT (Payment received from suppliers.
Amount in OMR (Functional You need one row for each
Currency)) payment you issue to a
VENDOR_ID (Supplier Id) supplier or refund received from a
VENDOR_SITE_ID (Supplier Site supplier. Your Oracle
Id) Payables application uses this
CURRENCY_CODE (Payment information to record payments
Currency Code) you make to suppliers or refunds
EXCHANGE_RATE (Exchange you receive from
rate for foreign currency payment) suppliers. Your Oracle Payables
EXCHANGE_RATE_TYPE application uses
(Exchange rate type used for BANK_ACCOUNT_NUM,
foreign currency payment) BANK_NUM, and
ORG_ID (Ministry Identifier) BANK_ACCOUNT_TYPE for the
supplier's bank information
when you use the Electronic
payment method.
AP_INVOICE_PAYMENTS_ALL INVOICE_PAYMENT_ID (Primary AP_INVOICE_PAYMENTS_ALL
Key) contains records
INVOICE_ID (Invoice Id) of invoice payments that you made
CHECK_ID (Payment Id) to suppliers. There
AMOUNT (Payment Amount) is one row for each payment you
ORG_ID (Ministry Identifier) make for each
invoice.
AP_HOLDS_ALL INVOICE_ID (Invoice Identifier) AP_HOLDS_ALL contains
LINE_NUMBER (Invoice line information about holds that you or
number of the applied hold) your Oracle Payables application
HOLD_LOOKUP_CODE (Name of place on an invoice. Oracle
hold code) Payables application does not pay
HOLD_REASON (Reason for hold invoices that have one or more
being placed on invoice) unreleased holds recorded in this
RELEASE_LOOKUP_CODE table. Possible hold reasons are
(Name of release code) Accounting Holds, Funds Holds,
RELEASE_REASON (Reason for Invoice Holds, Matching Holds,
release being placed on invoice) Variance Holds, Miscellaneous
Holds

2
Important Tables in Payables Module (Oracle Payables - AP)

Some Sample Queries to understand links between tables and finding details related to invoices and payments

Query to Find Open AP invoices

SELECT
aia.invoice_num,
aia.invoice_currency_code,
decode(aia.payment_status_flag, 'N', 'UN-PAID', 'P', 'Partial Paid',
'Y', 'PAID') payment_status_flag,
aia.invoice_date,
aps.vendor_name,
apss.vendor_site_code,
aila.line_number,
aia.invoice_amount,
aila.amount line_amount,
pha.segment1 po_number,
aila.line_type_lookup_code,
apt.name term_name,
gcc.concatenated_segments distributed_code_combinations,
aca.check_number,
aipa.amount payment_amount,
apsa.amount_remaining,
aipa.invoice_payment_type,
hou.name operating_unit,
gl.name ledger_name
FROM
apps.ap_invoices_all aia,
ap_invoice_lines_all aila,
ap_invoice_distributions_all aida,
ap_suppliers aps,
ap_supplier_sites_all apss,
po_headers_all pha,
gl_code_combinations_kfv gcc,
ap_invoice_payments_all aipa,
ap_checks_all aca,
ap_payment_schedules_all apsa,
ap_terms apt,
hr_operating_units hou,
gl_ledgers gl
WHERE
aia.invoice_id = aila.invoice_id
AND aila.invoice_id = aida.invoice_id
AND aila.line_number = aida.invoice_line_number
AND aia.vendor_id = aps.vendor_id
AND aia.payment_status_flag <> 'Y'
AND aia.vendor_site_id = apss.vendor_site_id
AND aps.vendor_id = apss.vendor_id
AND aia.po_header_id = pha.po_header_id (+)
AND aida.dist_code_combination_id = gcc.code_combination_id
AND aipa.invoice_id (+) = aia.invoice_id
AND aca.check_id (+) = aipa.check_id
AND apsa.invoice_id = aia.invoice_id
AND apt.term_id = aia.terms_id
AND hou.organization_id = aia.org_id
AND gl.ledger_id = aia.set_of_books_id
AND aia.org_id = :p_org_id /*Parameter Operating Unit Id*/

3
Important Tables in Payables Module (Oracle Payables - AP)

SQL query to get the invoice validation and accounting details for the payment (Check)

SELECT
aca.check_number,
aia.invoice_id,
aia.invoice_num,
aia.invoice_currency_code,
aia.invoice_amount,
ail.line_number,
ail.amount line_amount ,
aida.distribution_line_number,
aida.amount distribution_amount ,
aida.accrual_posted_flag,
decode(aida.match_status_flag, 'A', 'Validated', 'N', 'Never Validated',
'T', 'Needs Revalidation', 'S', 'Stopped') "Invoice Validation Status" ,
decode(ap_invoices_pkg.get_posting_status(aia.invoice_id),
'S',
'Selected for Accounting',
'P',
'Partial',
'N',
'Unaccounted',
'Y',
'Accounted',
'Unaccounted') "Invoice Accounting Status" ,
aida.invoice_distribution_id,
aida.accounting_event_id,
gcc.concatenated_segments distribution_account,
apps.ap_invoices_pkg.get_approval_status(aia.invoice_id, aia.invoice_amount, aia.payment_status_flag,
aia.invoice_type_lookup_code
) "Invoice Approval Status",
decode(aida.posted_flag, 'Y', 'Posted', 'N', 'Not Posted',
'Not Posted') "Invoice Posting Status"
FROM
ap_checks_all aca,
ap_invoice_payments_all aipa,
ap_invoices_all aia,
ap_suppliers asa,
ap_invoice_lines_all ail,
ap_invoice_distributions_all aida,
gl_code_combinations_kfv gcc
WHERE
aca.check_id = aipa.check_id
AND aipa.invoice_id = aia.invoice_id
AND aia.vendor_id = asa.vendor_id
AND ail.invoice_id = aia.invoice_id
AND aida.invoice_id = aia.invoice_id
AND aida.invoice_line_number = ail.line_number
AND gcc.code_combination_id = aida.dist_code_combination_id
AND gcc.chart_of_accounts_id = 101
AND aca.check_number = :p_check_number /*Check Number*/
AND aia.org_id = :p_org_id /*Parameter Operating Unit Id*/;

You might also like