| Case Number | 00061582 |
| Oracle Module | Accounts Payable (AP) / eBusiness Tax (ZX) |
| EBS Version | R12 |
| Functional Area | Invoice Processing / PO Matching / Base Amount Calculation |
| Related Oracle Bug | 9574881 |
base_amount does not match the correctly calculated value derived from invoice_amount * exchange_rate.base_amount or rounding_amt values with opposite signs, or variance amounts (IPV, ERV, TRV, TIPV, TERV) that are incorrect.Oracle Bug 9574881 caused AP invoice distributions to be created with incorrect base_amount values or with amount and base_amount having opposite signs, leading to variance distribution miscalculations. The fix script uses the Oracle GDF framework to classify affected invoices into reason categories, then corrects each category with appropriate recalculations using AP_UTILITIES_PKG.ap_round_currency and the AP events status API.
Populate AP_TEMP_DATA_DRIVER_9574881 with the affected invoice IDs and a reason classification before running the fix script. Reason values used by the script:
header base amount issue — invoice header base_amount is incorrectlines base amount issue — invoice line base_amount/rounding_amt is incorrectdists base amount issue — distribution base_amount is incorrectwrong variance — tax/variance distributions have incorrect amountsopposite signs — amount and base_amount have opposing signsRun data_fix.sql via SQL*Plus. The script prompts for User Name, Responsibility Name, and optionally an email address for log delivery. It creates backup tables and then processes each reason category.
Backup tables are created for:
AP_INVOICES_ALL (header base amount records)AP_INVOICE_LINES_ALLAP_INVOICE_DISTRIBUTIONS_ALLAP_SELF_ASSESSED_TAX_DIST_ALLZX_LINES, ZX_LINES_SUMMARY, ZX_REC_NREC_DISTFor active (non-cancelled) invoices:
AP_INVOICES_ALL.base_amount using ap_utilities_pkg.ap_round_currency(invoice_amount * exchange_rate).base_amount and rounding_amt on affected invoice lines.AP_INVOICE_DISTRIBUTIONS_ALL and linked ZX_REC_NREC_DIST records.base_amount on reversal distributions.total_dist_amount and total_dist_base_amount.force_revalidation_flag = 'Y' on the invoice header.AP_ACCOUNTING_EVENTS_PKG.UPDATE_INVOICE_EVENTS_STATUS for each affected invoice.For cancelled invoices:
base_amount and rounding_amt on cancelled/discarded lines with zero amounts.base_amount on distributions using the exchange rate.total_dist_amount and total_dist_base_amount.RSI_AP_Acctg_Data_Fix_PKG.repop_prepay_dists to repopulate prepayment distributions.The script commits and updates process_flag = 'P' in the driver table. Re-validate affected non-cancelled invoices via the AP Validate Invoices program.
RSI_AP_Acctg_Data_Fix_PKG. The driver table AP_TEMP_DATA_DRIVER_9574881 must be created and populated before running this script. Affected invoices flagged as non-cancelled must be revalidated after the fix.
| File | Description |
|---|---|
| data_fix.sql | Oracle GDF fix script (Bug 9574881). Corrects AP invoice header base_amount; nulls/recalculates line and distribution base amounts; deletes incorrect variance distributions; recalculates PO-matched amounts; sets force_revalidation_flag; calls accounting events status API. Handles both cancelled and non-cancelled invoices. |
| Table | Action |
|---|---|
| AP_INVOICES_ALL | Update base_amount; set force_revalidation_flag = 'Y' |
| AP_INVOICE_LINES_ALL | NULL or zero base_amount and rounding_amt |
| AP_INVOICE_DISTRIBUTIONS_ALL | Delete variance distributions; recalculate amounts and base_amounts; NULL total_dist_amount |
| ZX_REC_NREC_DIST | Delete records linked to deleted variance distributions |
| AP_TEMP_DATA_DRIVER_9574881 | Driver table — read for processing; updated to process_flag = 'P' on completion |