| Case Number | 00047184 |
| Oracle Module | Accounts Payable (AP) |
| EBS Version | R12 |
| Functional Area | AP Payments / Checks / Supplier Merge / Invoices / Tax / Payment Schedules |
| Related Patches | Oracle Bug 12582979; Oracle Bug 17965275; Oracle Bug 13579759; Oracle Bug 17942317 |
status_lookup_code of 'CLEARED BUT UNACCOUNTED' when the Payables Reconciled Accounting option is set to N — these checks should be in 'CLEARED' status.REMIT_TO_SUPPLIER_NAME, REMIT_TO_SUPPLIER_ID, REMIT_TO_SUPPLIER_SITE, REMIT_TO_SUPPLIER_SITE_ID, RELATIONSHIP_ID) on AP_INVOICES_ALL, AP_CHECKS_ALL, AP_RECURRING_PAYMENTS_ALL, and AP_PAYMENT_SCHEDULES_ALL are not updated to reflect the merged supplier, causing payment routing errors.amount_paid, amount_remaining, payment_status_flag, or gross_amount values on payment schedules, causing incorrect aging, duplicate payment risk, or payment processing failures. Overpaid invoices are identified and flagged for business user review.Four separate Oracle-released GDF scripts address distinct corruption patterns:
option = N), AP checks that were cleared should have status_lookup_code = 'CLEARED', not 'CLEARED BUT UNACCOUNTED'. Similarly, 'RECONCILED' status may need correction depending on context.ap_one_off_scripts_fix.sql as applied in Case 00040385. Covers 5 component categories (INV, CAN, MAT, TAX, PRE) with 16 corruption types across AP invoice, line, distribution, batch, tax, matching, and prepayment data. Refer to Case 00040385 for full corruption type details.gross_amount, amount_paid, amount_remaining, and payment_status_flag values are inconsistent with actual payment activity. Invoices with Reason = 'Incorrect Gross Amount on Schedule' also have PAY_CURR_INVOICE_AMOUNT recalculated. Overpaid invoices are logged to AP_OVERPAID_INVS_17942317 and excluded from automated correction — these require manual business review.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.
status_lookup_code on AP_CHECKS_ALL.AP_CHECKS_ALL.status_lookup_code using DECODE logic:
'CLEARED BUT UNACCOUNTED' → 'CLEARED''RECONCILED' → 'RECONCILED' (retained; corrects other status variants as applicable)PROCESS_FLAG = 'D').Populate the four driver tables with the affected transaction IDs before running:
AP_TEMP_INVOICES_17965275 — affected invoice_id valuesAP_TEMP_CHECKS_17965275 — affected check_id valuesAP_TEMP_RECUR_INV_17965275 — affected recurring_payment_id valuesAP_TEMP_PAY_SCH_17965275 — affected invoice_id / payment schedule rowsREMIT_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.AP_TEMP_CHECKS_17965275.AP_TEMP_RECUR_INV_17965275.AP_INVOICES_ALL for all payment schedule rows in AP_TEMP_PAY_SCH_17965275.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.
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.
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'.
Reason = 'Incorrect Gross Amount on Schedule':
AP_INVOICES_ALL.PAY_CURR_INVOICE_AMOUNT using ap_utilities_pkg.ap_round_currency, accounting for retainage flag and payment_cross_rate.AP_PAYMENT_SCHEDULES_ALL.gross_amount and inv_curr_gross_amount from the recalculated invoice amounts.validation_request_id or active checkrun_id: skips processing (invoice is in-flight).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.amount_paid from AP_INVOICE_PAYMENTS_ALL, deducting prepayment amounts.AP_INVOICES_ALL.amount_paid differs from the recalculated value: updates it.|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).amount_remaining per payment schedule line by iterating schedules in due-date order and allocating remaining paid amount against each schedule's gross_amount.payment_status_flag on both AP_PAYMENT_SCHEDULES_ALL and AP_INVOICES_ALL:
'P' (Partially Paid) on all schedules/invoice.'N' (Unpaid) where amount_remaining = gross_amount (less AWT allocation).'Y' (Fully Paid) where amount_remaining = 0 and appropriate payment/prepay conditions are met.payment_status_flag based on the resulting schedule statuses.PROCESS_FLAG = 'D'). Commits after each invoice.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.
| File | Description |
|---|---|
| 01_ap_wrong_check_status_fix.sql | Oracle 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.sql | Oracle 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.sql | Oracle 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.sql | Oracle 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. |
| Table | Action |
|---|---|
| AP_CHECKS_ALL | Update status_lookup_code (script 01); null out remit-to columns (script 02) |
| AP_INVOICES_ALL | Null out remit-to columns (script 02); update amount_paid and payment_status_flag (script 04) |
| AP_PAYMENT_SCHEDULES_ALL | Sync 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_ALL | Null out remit-to columns (script 02) |
| AP_OVERPAID_INVS_17942317 | Insert rows for overpaid invoices requiring business review (script 04) |
| XLA_EVENTS / XLA_AE_HEADERS / AP_PAYMENT_HISTORY_ALL | Undo 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_LINKS | Various fixes per corruption type (script 03 — see Case 00040385 for detail) |