← Back to Cases
AP Invoice PO Match Removed and PO Billed Quantities Reset
Case Number00102896
Oracle ModuleAccounts Payable (AP) / Purchasing (PO) / eBusiness Tax (ZX)
EBS VersionR12
Functional AreaInvoice Processing / PO Matching / Tax Correction
Related PatchesNone

Symptoms

Root Cause

An AP invoice was matched to a Purchase Order incorrectly. The match populated PO reference columns on the invoice lines and ZX tax tables, and updated billed quantity and closed status fields on the PO itself. The invoice needs to be effectively unmatched by clearing all PO reference columns from the AP and ZX tables, and by reversing the PO billed quantity/closed status updates on the PO side.

Resolution

Step 1 – Create backup tables

Run data_fix.sql. Backup tables are created for:

Step 2 – Remove PO references from AP invoice lines

Update AP_INVOICE_LINES_ALL to NULL out all PO reference columns: PO_HEADER_ID, PO_LINE_ID, PO_RELEASE_ID, PO_LINE_LOCATION_ID, and PO_DISTRIBUTION_ID.

Step 3 – Remove PO reference document links from ZX tables

Update ZX_LINES, ZX_REC_NREC_DIST, and ZX_LINES_DET_FACTORS to NULL out the REF_DOC_APPLICATION_ID, REF_DOC_ENTITY_CODE, REF_DOC_EVENT_CLASS_CODE, REF_DOC_TRX_ID, REF_DOC_LINE_ID, and (for ZX_REC_NREC_DIST) REF_DOC_DIST_ID columns for the affected invoice's AP_INVOICES entity records.

Step 4 – Reset PO billed quantities and closed status

Reverse the PO-side updates caused by the incorrect match:

Step 5 – Commit and validate

Issue COMMIT. Re-validate the invoice (now treated as a non-PO invoice) and confirm the PO is available for correct matching.


Script Inventory

FileDescription
data_fix.sqlCreates backups; removes PO reference columns from AP_INVOICE_LINES_ALL; clears REF_DOC links from ZX_LINES, ZX_REC_NREC_DIST, ZX_LINES_DET_FACTORS; resets PO billed quantities and closed status in PO_DISTRIBUTIONS_ALL, PO_LINES_ALL, PO_LINE_LOCATIONS_ALL, PO_HEADERS_ALL.

Key Tables Affected

TableAction
AP_INVOICE_LINES_ALLNULL out PO_HEADER_ID, PO_LINE_ID, PO_RELEASE_ID, PO_LINE_LOCATION_ID, PO_DISTRIBUTION_ID
ZX_LINESNULL out REF_DOC reference document columns
ZX_REC_NREC_DISTNULL out REF_DOC reference document columns including REF_DOC_DIST_ID
ZX_LINES_DET_FACTORSNULL out REF_DOC reference document columns
PO_DISTRIBUTIONS_ALLReset QUANTITY_BILLED and AMOUNT_BILLED to 0
PO_LINES_ALLClear CLOSED_CODE, CLOSED_DATE, CLOSED_BY
PO_LINE_LOCATIONS_ALLClear closed columns; reset QUANTITY_BILLED to 0
PO_HEADERS_ALLClear CLOSED_DATE and CLOSED_CODE