Purchase Order Matching Database Tables

Payables provides sophisticated purchase order matching features to ensure that you only pay for goods and services you ordered, received and accepted. Payables is tightly integrated with Oracle Purchasing to facilitate paperless matching, but you can take advantage of matching to purchase orders even if you are using another purchasing system with Payables. Note that you can match to receipts only if you use Oracle Purchasing.

This document explains the data necessary to integrate Payables with a non-Oracle purchasing system and describes how Payables uses the data to perform two-way, three-way and four-way matching to purchase orders.

Important: We only include descriptions of the required tables and columns for matching to a non-Oracle purchasing system. For complete details on all the entities and relationships that Payables uses for matching, see: Table Definitions Payables Applications Technical Reference Manual.

This discussion includes the following topics:

Related Topics

Entering Invoices with Matched Purchase Orders in the Invoice Workbench, Oracle Payables User Guide

Purchasing Integration, Oracle Payables User Guide

Understanding the Matching Tables

Payables uses several of Oracle Purchasing tables for matching. To implement matching in Payables, you need to load these tables with the data from your non-Oracle purchasing application.

AutoUpgrade automatically installs these and other necessary Oracle Purchasing application tables when you install Payables.

PO_HEADERS

Each record in this table represents a purchase order, which is an order for goods or services from a single supplier. Each purchase order may have multiple lines (PO_LINES).

In addition, each blanket purchase order may have multiple blanket releases (PO_RELEASES), which release an amount from the blanket.

PO_LINES

Each record in this table represents a purchase order line, which identifies the items and unit price for the goods ordered on a purchase order. Each purchase order line may have multiple shipments (PO_LINE_LOCATIONS).

PO_LINE_LOCATIONS

Each record in this table represents a purchase order shipment, which identifies the quantity of an item shipped to a buyer location by the supplier. Each purchase order shipment may have multiple accounting distributions (PO_DISTRIBUTIONS).

PO_DISTRIBUTIONS/PO_DISTRIBUTIONS_AP_V

Each record in this table/view represents a purchase order distribution, which identifies the account charged for the items on a purchase order shipment.

PO_RELEASES

Each record in this table represents a blanket release for a purchase order. A blanket release may create multiple shipments.

AP_INVOICES/AP_INVOICE_DISTRIBUTIONS

Each purchase order shipment can be matched to multiple invoices (AP_INVOICES), and a single invoice may be matched to multiple purchase order shipments.

When you match an invoice to a purchase order shipment, Payables creates an invoice distribution (AP_INVOICE_DISTRIBUTIONS) from each purchase order distribution on the shipment. When you match an invoice to a single purchase order distribution, Payables creates a single invoice distribution from the purchase order distribution.

Table Descriptions

The following section describes the tables and the columns that Payables supports for matching to purchase orders from your non-Oracle purchase system. We describe how the columns are used and, if a column is required, the values you must load to successfully perform matching. For a complete description of the tables, please consult the Payables Applications Technical Reference Manual.

Important: You must populate all NOT NULL columns in the purchasing tables.

PO_HEADERS_ALL

The following table describes column information for the PO_HEADERS_ALL table.

Column Name Null Type Comments
PO_HEADER_ID NOT NULL NUMBER Primary key
AGENT_ID NOT NULL NUMBER Foreign key: HR_EMPLOYEES
TYPE_LOOKUP_CODE NOT NULL VARCHAR2(25) Foreign Key: PO_LOOKUP_ CODES
LAST_UPDATE_DATE NOT NULL DATE N/A
LAST_UPDATED_BY NOT NULL NUMBER N/A
SEGMENT1 NOT NULL VARCHAR2(20) PO number
SUMMARY_FLAG NOT NULL VARCHAR2(1) N
ENABLED_FLAG NOT NULL VARCHAR2(1) Y
VENDOR_ID NUMBER Foreign key: PO_VENDORS
VENDOR_SITE_ID NUMBER Foreign key: PO_VENDOR_SITES
TERMS_ID NUMBER N/A
FREIGHT_TERMS_ LOOKUP_CODE VARCHAR2(25) Foreign key: PO_LOOKUP_ CODES
CURRENCY_CODE VARCHAR2(15) N/A
APPROVED_FLAG VARCHAR2(1) Y

AGENT_ID

Enter the ID for the agent who created the purchase order.

This value is used by the following reports in Payables: Merge Suppliers, Matching Agent Notice and Receiving Hold Requestor Notice.

TYPE_LOOKUP_CODE

Enter BLANKET or STANDARD (Lookup Type: PO TYPE) to identify the type of purchase order.

TERMS_ID

Enter the ID for the payment terms of the purchase order. Payables defaults this value during matching of PO Default and Quickmatch invoices in the Invoices window. Payables Open Interface Import may also use this value as a default for matched invoices during import.

If you choose to leave this column empty, Payables will not warn you if the purchase order and invoice payment terms differ.

FREIGHT_TERMS_LOOKUP_CODE

Enter a value (Lookup Type: FREIGHT TERMS) to identify the freight terms for the purchase order. See: Lookups, Oracle Payables User Guide.

CURRENCY_CODE

Enter the currency code for the purchase order. You can obtain a list of valid codes from FND_CURRENCIES.CURRENCY_CODE.

The currency code for the invoice you want to match to this purchase order must be the same as the code you enter here.

PO_RELEASES_ALL (Blanket Releases)

The following table describes column information for the PO_RELEASES_ALL (Blanket Releases) table.

Column Name Null Type Comments
PO_RELEASE_ID NOT NULL NUMBER Primary key
LAST_UPDATE_DATE NOT NULL DATE N/A
LAST_UPDATED_BY NOT NULL NUMBER N/A
PO_HEADER_ID NOT NULL NUMBER Foreign key: PO_HEADERS
RELEASE_NUM NOT NULL NUMBER Release number
AGENT_ID NOT NULL NUMBER Foreign key: HR_EMPLOYEES
RELEASE_DATE NOT NULL DATE N/A

PO_LINES_ALL

The following matching to purchase order database table describes column information for the PO_LINES_ALL table.

Column Name Null Type Comments
PO_LINE_ID NOT NULL NUMBER Primary key
LAST_UPDATE_DATE NOT NULL DATE N/A
LAST_UPDATED_BY NOT NULL NUMBER N/A
PO_HEADER_ID NOT NULL NUMBER Foreign key: PO_HEADERS
LINE_TYPE_ID NOT NULL NUMBER Foreign key: PO_LINE_TYPES
LINE_NUM NUMBER Used for Query
ITEM_ID NUMBER Null
ITEM_DESCRIPTION VARCHAR2(240) Display only
UNIT_PRICE NUMBER N/A
TYPE_1099 VARCHAR2(10) N/A

LINE_TYPE_ID

Enter the ID for the line type of the purchase order line. You can obtain a list of valid IDs from PO_LINE_TYPES.LINE_TYPE_ID.

ITEM_ID

Do not enter a value in this column. Payables does not allow you to record purchase order lines with Items unless you install Oracle Purchasing.

ITEM_DESCRIPTION

Enter a description for your purchase order line. You can use this column to record information about the item on the purchase order line. Payables displays this description in the Purchase Order Shipments zone during matching.

TYPE_1099

Enter the income tax type for the purchase order line, if the supplier for the purchase order is a 1099 supplier. Payables assigns this type as the default income tax type for each invoice distribution created by matching to this purchase order line. If you leave the column empty, Payables uses the income tax type for the supplier as the default.

See: Entering Invoices for Suppliers Subject to Income Tax Reporting Requirements, Oracle Payables User Guide.

You can obtain a list of valid types from AP_INCOME_TAX_TYPES.INCOME_TAX_TYPE.

PO_LINE_LOCATIONS_ALL (PO Shipments)

The following table describes column information for the PO_LINE_LOCATIONS_ALL (PO Shipments) table.

Column Name Null Type Comments
LINE_LOCATION_ID NOT NULL NUMBER Primary key
LAST_UPDATE_DATE NOT NULL DATE N/A
LAST_UPDATED_BY NOT NULL NUMBER N/A
PO_HEADER_ID NOT NULL NUMBER Foreign key: PO_HEADERS
PO_LINE_ID NOT NULL NUMBER Foreign key: PO_LINES
QUANTITY NUMBER Quantity ordered: 2-way match
QUANTITY_RECEIVED NUMBER 3-way match
QUANTITY_ACCEPTED NUMBER 4-way match
QUANTITY_BILLED NUMBER UPDATED by Payables
QUANTITY_CANCELLED NUMBER 0 or Null
UNIT_MEAS_ LOOKUP_CODE VARCHAR2(25) Display only
PO_RELEASE_ID NUMBER Foreign key: PO_RELEASES
SHIP_TO_LOCATION_ID NUMBER Foreign key: HR_LOCATIONS
TAXABLE_FLAG VARCHAR2(1) Y or N (tax matching)
TAX_NAME VARCHAR2(15) Tax code match (TAX DIFF HOLD)
APPROVED_FLAG VARCHAR2(1) Y
SHIPMENT_NUM NUMBER Shipment number
SHIPMENT_TYPE VARCHAR2(25) Foreign Key: PO_LOOKUP_CODES
INSPECTION_ REQUIRED_FLAG VARCHAR2(1) Y or N (4-way match)
RECEIPT_ REQUIRED_FLAG VARCHAR2(1) Y or N (3-way match)
CLOSED_CODE VARCHAR2(1) Null

QUANTITY

Enter the quantity of goods ordered for the purchase order shipment. Payables uses this amount to match against if you are using 2-way matching. Payables verifies that this quantity matches the invoice quantity within defined tolerance levels and places the invoice on hold if it doesn't match. In addition, if the quantity of the invoice is greater than the shipment quantity, your Payables warns you during invoice entry that the match will result in an overbill.

QUANTITY_RECEIVED/QUANTITY_ACCEPTED

Enter the quantity of goods received/accepted if you are using 3-way/4-way matching. Payables verifies that the quantity matches the invoice quantity within defined tolerance levels and places the invoice on hold if it doesn't match.

QUANTITY_BILLED

Do not enter a value in this column, unless you have already matched an invoice to this purchase order shipment. When a match successfully completes (invoice is validated), Payables updates this column with the quantity you specified during matching.

QUANTITY_CANCELLED

Only enter a value in this column if you have cancelled a portion of the purchase order shipment in your non-Oracle purchasing system. The amount you enter reduces the amount that Payables considers to be the outstanding quantity ordered. Payables displays a warning if you try to match to a shipment which has been cancelled.

When you cancel a shipment, Oracle Purchasing sets the PO_LINE_LOCATIONS.QUANTITY_CANCELLED to:

UNIT_MEAS_LOOKUP_CODE

Payables displays this value in the matching zones, but does not validate the column. You can enter any value into this column; however, you should use the same value that you use in your non-Oracle purchasing system.

TAXABLE_FLAG

Enter Y or N to indicate the purchase order shipment is subject to tax. If you enter Y, enter a value in the TAX_NAME column. During Invoice Validation, Payables verifies that the tax code value for the purchase order shipment matches the tax code value on the invoice and places a Tax Difference hold on the invoice if the tax code values don't match.

TAX_NAME

Enter the tax value (tax code or tax group) used to verify that the tax values on the invoice and purchase order shipment match. You do not need to enter a value if you enter N in the TAXABLE_FLAG column.

TYPE_LOOKUP_CODE

Enter BLANKET, STANDARD, or SCHEDULED (Lookup Type: SHIPMENT TYPE) to identify the type of purchase order shipment.

CLOSED_CODE

Do not enter a value in this column if you want to match an invoice to this purchase order shipment. If you enter the values CLOSED, FINALLY CLOSED, or CLOSED FOR INVOICE in the column, Payables warns you that you are matching to a closed purchase order.

PO_DISTRIBUTIONS_ALL (Account distribution)

Payables uses a view (PO_DISTRIBUTIONS_AP_V) to the PO_DISTRIBUTIONS_ALL table to perform purchase order distribution matching. The following table shows information for PO_DISTRIBUTIONS_ALL.

Column Name Null Type Comments
PO_DISTRIBUTION_ID NOT NULL NUMBER Primary key
LAST_UPDATE_DATE NOT NULL DATE N/A
LAST_UPDATED_BY NOT NULL NUMBER N/A
PO_HEADER_ID NOT NULL NUMBER Foreign key: PO_HEADERS
PO_LINE_ID NOT NULL NUMBER Foreign key: PO_LINES
LINE_LOCATION_ID NOT NULL NUMBER Foreign key: PO_LINE_ LOCATIONS
SET_OF_BOOKS_ID NOT NULL NUMBER N/A
CODE_COMBINATION_ID NUMBER Foreign key: GL_CODE_ COMBINATIONS
QUANTITY_ORDERED NUMBER N/A
QUANTITY_DELIVERED NUMBER Display only
QUANTITY_BILLED NUMBER UPDATED by Payables
QUANTITY_CANCELLED NUMBER 0 or Null
DELIVER_TO_PERSON_ID NUMBER Foreign key: HR_EMPLOYEES
RATE NUMBER Foreign currency
AMOUNT_BILLED NUMBER UPDATED by Payables
ENCUMBERED_AMOUNT NUMBER If encumbrance accounting enabled
BUDGET_ACCOUNT_ID NUMBER N/A
ACCRUAL_ACCOUNT_ID NUMBER N/A
VARIANCE_ACCOUNT_ID NUMBER N/A
DISTRIBUTION_NUM NOT_NULL NUMBER distribution number
PROJECT_ID NUMBER Projects
TASK_ID NUMBER Projects
EXPENDITURE_TYPE VARCHAR2(30) Projects
PROJECT_ ACCOUNTING_CONTEXT VARCHAR2(30) Projects
EXPENDITURE_ ORGANIZATION_ID NUMBER Projects
EXPENDITURE_ITEM_ DATE DATE Projects

SET_OF_BOOKS_ID

Enter the set of books ID for your purchase order distribution. The ID you enter must be for the set of books you define in the Set of Books window.

CODE_COMBINATION_ID

Enter the Accounting Flexfield ID for the expense account you want to charge for the goods on the purchase order distribution.

QUANTITY_ORDERED

Enter the amount of goods charged to the Accounting Flexfield for this purchase order distribution.

Important: NOTE: Payables does not validate the following, but assumes it to be true: Total of PO_DISTRIBUTIONS.QUANTITY_ORDERED for one PO_LINE_LOCATION_ID = PO_LINES_LOCATIONS.QUANTITY (for the same ID). Payables sometimes prorates the PO_DISTRIBUTION.QUANTITY_ORDERED using the PO_LINES_LOCATIONS.QUANTITY as the total.

BUDGET_ACCOUNT_ID/ACCRUAL_ACCOUNT_ID/ VARIANCE_ACCOUNT_ID

Enter the same Accounting Flexfield ID you entered for the CODE_COMBINATION_ID. Payables allows you to record budget, accrual, and variance (price and exchange rate) amounts for your purchase order distributions, but requires you to charge these amounts to the same expense account for the distribution.

QUANTITY_BILLED

Do not enter a value in this column, unless you have already matched an invoice distribution to this purchase order distribution. When a match successfully completes (invoice is validated), Payables updates this column with the quantity you specified during matching.

QUANTITY_CANCELLED

Enter a value in this column only if you have cancelled a portion of the purchase order distribution in your non-Oracle purchasing system. The amount you enter reduces the amount that Payables considers to be the outstanding quantity ordered. Payables displays a warning if you try to match to a shipment which has been cancelled.

Important: Invoice Validation does all quantity checks assuming the quantity for the distribution is QUANTITY_ORDERED minus QUANTITY_CANCELLED.

AMOUNT_BILLED

Do not enter a value in this column unless you have already matched an invoice to this purchase order shipment. When a match successfully completes (invoice is validated), the system updates this column with the amount of the quantity you specified during matching multiplied by the unit price.

Oracle Projects Columns

Enter project information from Oracle Projects if you want to associate the invoice distribution (created through matching) with a project in Oracle Projects. Payables transfers the information into the AP_INVOICE_DISTRIBUTIONS table and uses it to create the default Accounting Flexfield for the invoice distribution.

Matching to Purchase Orders

Perform the following steps to match invoices to purchase order information from your non-Oracle purchasing system:

Create Flat File with Purchasing Information

To load invoice information into Payables via SQL*Loader, first create a program that produces a flat file containing the information from your non-Oracle purchasing system for the purchase orders you want to match to invoices.

Load Information into Purchasing Tables

Use SQL*Loader to load the required information into the purchasing tables. You will need to create a SQL*Loader control file to format the information you want to load. The file you write will vary greatly depending on the nature and format of the flat file you use. Your control file must populate the purchasing tables as indicated in the previous table descriptions. See also: SQL*Loader (ORACLE8 Server Utilities Guide).

Enter Invoices

You match invoices to purchase order shipments during invoice entry. This online function links an invoice in the database to one or more purchase order shipments you choose. You cannot pay or account for an invoice until the invoice is validated.

You can match any type of invoice to a purchase order, including credit and debit memos.

Match to Purchase Order Shipments and distributions

When you match during invoice entry, you indicate whether you want to match to the purchase order shipment or to specific invoice distributions. You then choose the shipment or distribution you want to match to, and the quantity and price you are matching. Then Payables performs the following for each matched shipment:

Match to Credit and Debit Memos

Payables lets you enter a credit or debit memo (with a negative amount) and match to a purchase order. You would enter a negative quantity in the Quantity Invoiced field in the Purchase Order Shipment Match zone, thereby matching this credit invoice to one or no purchase order shipment lines. Payables then decreases the quantity billed against the purchase order shipment line(s).

When you match a credit invoice to a purchase order shipment line, Payables:

Close a Purchase Order Shipment

Invoice entry closes a purchase order shipment (sets CLOSED_CODE in PO_LINE_LOCATIONS to 'CLOSED') when:

Final Close

Payables does not support finally closing a purchase order if you do not install Oracle Purchasing with Payables. See: Final Matching Invoices and Final Closing Purchase Orders, Oracle Payables User Guide.

Online Review of Purchasing Information

Without an Oracle Purchasing application, Payables does not allow you to review purchasing information, such as purchase order header and line information, online in the Invoice Workbench.

Using Invoice Validation

Invoice Validation is the Payables feature that performs two-, three-, or four-way matching. An invoice must pass Invoice Validation before you can pay or account for the invoice. Invoice Validation reviews each invoice and places one or more matching holds on the invoice if the invoice does not meet your matching criteria. It also releases any existing matching holds if you adjust your invoice or purchase order to meet your matching criteria and current information on order, receipt and acceptance prices and quantities.

You must submit Invoice Validation for all invoices, not just matched invoices, since it also checks for distribution variances, tax variances, and exchange rate information. You can submit Invoice Validation online for an invoice or in batch for a group of invoices. See also: Invoice Validation, Oracle Payables User Guide.

2-way, 3-way, and 4-way Matching

When you match to a purchase order, Payables automatically checks that the total of PO_DISTRIBUTIONS.QUANTITY_ORDERED = AP_INVOICE_DISTRIBUTIONS.QUANTITY_INVOICED (2-way matching).

Payables only checks QUANTITY_RECEIVED (3-way matching) if the RECEIPT_REQUIRED_FLAG is set to Y and only checks QUANTITY_ACCEPTED (4-way matching) if the INSPECTION_REQUIRED_FLAG is set to Y.

Matching Tolerance

You can define percentage and amount tolerances for Matching quantities and price. Payables places a matching hold on an invoice only if the invoice quantity or price is greater than the purchasing quantity or price by more than your tolerance.

Matching Holds

When you submit Invoice Validation, Payables places a matching hold on a matched invoice (by inserting one or more rows in AP_HOLDS, one row for each type of hold for each invoice distribution) if:

See also: Releasing Holds, Oracle Payables User Guide.

Using Encumbrance Accounting with Purchasing

Payables supports using encumbrance accounting with a non-Oracle purchasing system. To use encumbrance accounting, however, you must initially record the encumbered amount for the purchase order to which you want to match an invoice.

Then, when Invoice Validation validates the invoice, if there is a variance between the invoice and its matched purchase order within the tolerances you define, Payables automatically creates an encumbrance journal entry for the amount of the variance.

Important: Invoice Validation uses the Payables table, AP_TRANSFER_ENCUMBRANCE, if you enable encumbrance accounting. Payables never drops this table, but deletes the appropriate lines from this table at the beginning of the program each time you submit Invoice Validation.

With an Oracle Purchasing application installed, Payables allows you to record these variance encumbrance journal entries to a separate variance account. With a non-Oracle purchasing system, Payables requires you to record the variance amount to the same Accounting Flexfield as the expense Accounting Flexfield for the purchase order distribution.

When you post the invoice to your general ledger, Payables relieves both the original encumbrance journal entries that you created when you encumbered the purchase order and the encumbrance journal entries it automatically created for the variance. Payables then creates actual journal entries for your invoice transaction. Your variance encumbrance journal entries and your actual journal entries update your account balances only when you post the journal entries in your general ledger. See also: Encumbrances in Payables, Oracle Payables User Guide.

Budgetary Control

The budgetary control feature does not use purchasing information unless you install Oracle Purchasing.

Related Topics

Encumbrance Entries in Payables, Oracle Payables User Guide

Purging Purchasing Information

Payables does not allow you to purge purchasing information if you do not have an Oracle Purchasing application installed. When you match an invoice to a purchase order from a non-Oracle purchasing system, you will not be able to purge the invoice because Payables requires that all objects, including matched purchase orders, associated with an invoice must be purgeable before you can purge the invoice. See: Purging Records, Oracle Payables User Guide.