← Back to Cases
AP Multiple GDF Data Fixes — Wrong Check Status, Supplier Merge Remit Columns, One-Off Invoice Corruption, and Incomplete Payment Schedules
Case Number00047184
Oracle ModuleAccounts Payable (AP)
EBS VersionR12
Functional AreaAP Payments / Checks / Supplier Merge / Invoices / Tax / Payment Schedules
Related PatchesOracle Bug 12582979; Oracle Bug 17965275; Oracle Bug 13579759; Oracle Bug 17942317

Symptoms

Root Cause

Four separate Oracle-released GDF scripts address distinct corruption patterns:


Resolution — Script 01: Wrong Check Status Fix (Bug 12582979)

Pre-requisite — Populate driver table

Populate AP_TEMP_DATA_DRIVER_12582979 with the check_id values for all checks with incorrect status. Set PROCESS_FLAG = 'Y' for rows to be processed.

Fix Steps
  1. For each check in the driver table, evaluates the current status_lookup_code on AP_CHECKS_ALL.
  2. Updates AP_CHECKS_ALL.status_lookup_code using DECODE logic:
  3. Marks the driver table row as processed (PROCESS_FLAG = 'D').
  4. Commits.

Resolution — Script 02: Supplier Merge Remit Columns Fix (Bug 17965275)

Pre-requisite — Populate driver tables

Populate the four driver tables with the affected transaction IDs before running:

Fix Steps
  1. AP_INVOICES_ALL: sets REMIT_TO_SUPPLIER_NAME, REMIT_TO_SUPPLIER_ID, REMIT_TO_SUPPLIER_SITE, REMIT_TO_SUPPLIER_SITE_ID, and RELATIONSHIP_ID to NULL for all invoices in AP_TEMP_INVOICES_17965275.
  2. AP_CHECKS_ALL: nulls out the same five remit-to columns for all checks in AP_TEMP_CHECKS_17965275.
  3. AP_RECURRING_PAYMENTS_ALL: nulls out the same five remit-to columns for all recurring payment records in AP_TEMP_RECUR_INV_17965275.
  4. AP_PAYMENT_SCHEDULES_ALL: synchronizes remit-to columns from AP_INVOICES_ALL for all payment schedule rows in AP_TEMP_PAY_SCH_17965275.
  5. Commits after each table update.

Resolution — Script 03: AP One-Off Invoice Corruption Fix (Bug 13579759)

This script is identical to 02_ap_one_off_fix.sql from Case 00040385 — the same Oracle GDF ap_one_off_scripts_fix.sql applied under a different case number. Refer to Case 00040385 for the full description of all 16 corruption types across the INV, CAN, MAT, TAX, and PRE components.

Summary

Uses AP_ACCTG_DATA_FIX_PKG framework with driver table AP_TEMP_DATA_DRIVER_13579759. One component (INV, CAN, MAT, TAX, or PRE) is processed per run. Populate the driver table with the correct CORRUPTION_TYPE codes and run the selection script (ap_one_off_scripts_sel.sql) before executing.


Resolution — Script 04: Incomplete Payment Schedules Fix (Bug 17942317)

Pre-requisite — Populate driver table

Populate AP_TEMP_DATA_DRIVER_17942317 with the affected invoice_id, org_id, and Reason values. Valid Reason values include 'Incorrect Gross Amount on Schedule' (handled first) and other reasons for amount/status discrepancies. Set PROCESS_FLAG = 'Y'.

Fix Steps — Incorrect Gross Amount on Schedule
  1. For invoices with Reason = 'Incorrect Gross Amount on Schedule':
  2. For invoices with a non-null validation_request_id or active checkrun_id: skips processing (invoice is in-flight).
Fix Steps — Amount Paid and Amount Remaining Correction
  1. Before correcting payment schedules, calls AP_ACCTG_DATA_FIX_PKG.undo_acctg_entries (mode 'UNDO_DEL_ADJ') for any posted checks linked to affected invoices, to undo accounting before amount corrections.
  2. Recalculates amount_paid from AP_INVOICE_PAYMENTS_ALL, deducting prepayment amounts.
  3. If AP_INVOICES_ALL.amount_paid differs from the recalculated value: updates it.
  4. Overpaid detection: if |amount_paid| > |actual_amount_topay|, inserts a row into AP_OVERPAID_INVS_17942317 and sets amount_remaining = 0, payment_status_flag = 'Y' on the payment schedule — then skips the remaining correction steps for that invoice (requires business user action).
  5. Recalculates amount_remaining per payment schedule line by iterating schedules in due-date order and allocating remaining paid amount against each schedule's gross_amount.
  6. Corrects payment_status_flag on both AP_PAYMENT_SCHEDULES_ALL and AP_INVOICES_ALL:
  7. Marks driver table rows as processed (PROCESS_FLAG = 'D'). Commits after each invoice.
Note: Script 03 is the same Oracle GDF Bug 13579759 script (ap_one_off_scripts_fix.sql) applied in Case 00040385 — refer to that case for corruption type detail. Script 04 (Bug 17942317) backs up AP_INVOICES_ALL to AP_INVOICES_17942317_BKP and AP_PAYMENT_SCHEDULES_ALL to AP_PAY_SCH_17942317_BKP before any updates. Invoices with undo-accounting errors are flagged with PROCESS_FLAG = 'E' in the driver table and must be reviewed manually. Overpaid invoices are logged to AP_OVERPAID_INVS_17942317 — these require business user action and are not auto-corrected beyond setting payment schedules to fully paid status. Always populate driver tables and take a full backup before executing.

Script Inventory

FileDescription
01_ap_wrong_check_status_fix.sqlOracle GDF Bug 12582979 (ap_wrgchksts_fix.sql). Corrects AP_CHECKS_ALL.status_lookup_code from 'CLEARED BUT UNACCOUNTED' to 'CLEARED' when Payables Reconciled Accounting option = N. Driver: AP_TEMP_DATA_DRIVER_12582979.
02_ap_supplier_merge_remit_fix.sqlOracle GDF Bug 17965275 (ap_sup_merge_remit_cols_fix.sql). Nulls out REMIT_TO_SUPPLIER_NAME/ID/SITE/SITE_ID and RELATIONSHIP_ID on AP_INVOICES_ALL, AP_CHECKS_ALL, AP_RECURRING_PAYMENTS_ALL. Syncs AP_PAYMENT_SCHEDULES_ALL remit columns from AP_INVOICES_ALL. Drivers: AP_TEMP_INVOICES_17965275, AP_TEMP_CHECKS_17965275, AP_TEMP_RECUR_INV_17965275, AP_TEMP_PAY_SCH_17965275.
03_ap_one_off_fix.sqlOracle GDF Bug 13579759 (ap_one_off_scripts_fix.sql) — identical to Case 00040385 script 02. Fixes 5 component categories (INV, CAN, MAT, TAX, PRE) with 16 corruption types. Uses AP_ACCTG_DATA_FIX_PKG and driver table AP_TEMP_DATA_DRIVER_13579759. See Case 00040385 for full details.
04_ap_incomplete_payment_schedules_fix.sqlOracle GDF Bug 17942317 (ap_inc_payment_schedules_fix.sql). Corrects amount_paid, amount_remaining, payment_status_flag, and gross_amount on AP_PAYMENT_SCHEDULES_ALL and AP_INVOICES_ALL. Undoes accounting for affected checks via AP_ACCTG_DATA_FIX_PKG.undo_acctg_entries before applying corrections. Flags overpaid invoices in AP_OVERPAID_INVS_17942317 for business review. Driver: AP_TEMP_DATA_DRIVER_17942317. Backups: AP_INVOICES_17942317_BKP, AP_PAY_SCH_17942317_BKP.

Key Tables Affected

TableAction
AP_CHECKS_ALLUpdate status_lookup_code (script 01); null out remit-to columns (script 02)
AP_INVOICES_ALLNull out remit-to columns (script 02); update amount_paid and payment_status_flag (script 04)
AP_PAYMENT_SCHEDULES_ALLSync remit-to columns from AP_INVOICES_ALL (script 02); update gross_amount, inv_curr_gross_amount, amount_remaining, payment_status_flag (script 04)
AP_RECURRING_PAYMENTS_ALLNull out remit-to columns (script 02)
AP_OVERPAID_INVS_17942317Insert rows for overpaid invoices requiring business review (script 04)
XLA_EVENTS / XLA_AE_HEADERS / AP_PAYMENT_HISTORY_ALLUndo accounting entries for affected checks before payment schedule correction (script 04)
AP_INVOICE_LINES_ALL / AP_INVOICE_DISTRIBUTIONS_ALL / ZX_LINES / ZX_LINES_SUMMARY / ZX_LINES_DET_FACTORS / ZX_REC_NREC_DIST / AP_SELF_ASSESSED_TAX_DIST_ALL / PO_DISTRIBUTIONS_ALL / PO_LINE_LOCATIONS_ALL / AP_PREPAY_HISTORY_ALL / AP_PREPAY_APP_DISTS / XLA_DISTRIBUTION_LINKSVarious fixes per corruption type (script 03 — see Case 00040385 for detail)