| Case Number | 00039693 |
| Oracle Module | Accounts Payable (AP) / E-Business Tax (ZX) |
| EBS Version | R12 |
| Functional Area | AP Invoices / Tax / ZX Tax Lines |
| Related Patches | None |
trx_number stored in the ZX tax tables (ZX_LINES, ZX_LINES_SUMMARY, and ZX_LINES_DET_FACTORS) does not match the invoice_num in AP_INVOICES_ALL.trx_number, causing a mismatch with the AP invoice record.The E-Business Tax (ZX) tax line tables (ZX_LINES, ZX_LINES_SUMMARY, ZX_LINES_DET_FACTORS) store the AP invoice number in a trx_number column. For the two affected invoices, this value was populated incorrectly at invoice creation time and does not match the current invoice_num in AP_INVOICES_ALL. The fix updates trx_number to the correct invoice number across all three ZX tables, sets cancel_flag = 'Y' on the ZX lines where applicable, and resets the object_version_number as required by the ZX data model.
Use the following query to identify invoices where the ZX transaction number does not match the AP invoice number:
SELECT ai.invoice_id, ai.invoice_num, zl.trx_number
FROM ap_invoices_all ai
JOIN zx_lines zl ON zl.trx_id = ai.invoice_id
AND zl.application_id = 200
AND zl.entity_code = 'AP_INVOICES'
WHERE ai.invoice_id IN (&invoice_ids)
AND zl.trx_number != ai.invoice_num;
Run data_fix.sql (backup section). Creates backup copies of all affected ZX rows before any updates:
ZX_LINES_DET_FACTORS rows for the affected invoice IDsZX_LINES rows for the affected invoice IDsZX_LINES_SUMMARY rows for the affected invoice IDsFor each affected invoice, update ZX_LINES_DET_FACTORS to set trx_number to the correct invoice number (matching AP_INVOICES_ALL.invoice_num). The update is keyed on trx_id = <invoice_id> and application_id = 200.
For each affected invoice, update ZX_LINES to:
trx_number to the correct invoice numbercancel_flag = 'Y' for the affected tax linesobject_version_number = 1296120000 (resets the optimistic locking version number as required by the ZX data model)The update is applied separately for each of the two invoice IDs.
For each affected invoice, update ZX_LINES_SUMMARY to set trx_number to the correct invoice number. The update is keyed on trx_id = <invoice_id>.
Commit after all updates. Verify that trx_number in all three ZX tables now matches invoice_num in AP_INVOICES_ALL for both affected invoices. Re-run any tax reports or reconciliation processes that previously showed the mismatch.
trx_number values differ per invoice. The object_version_number = 1296120000 value is a standard reset value used in ZX data fixes to force the row to be treated as newly written; confirm this is appropriate for the ZX version in the target environment. Always back up before applying.
| File | Description |
|---|---|
| data_fix.sql | Creates backup tables for ZX_LINES_DET_FACTORS, ZX_LINES, and ZX_LINES_SUMMARY. For each of the two affected invoice IDs: updates trx_number to match AP_INVOICES_ALL.invoice_num in all three ZX tables; sets cancel_flag='Y' and object_version_number=1296120000 on ZX_LINES. |
| Table | Action |
|---|---|
| ZX_LINES | Update trx_number to correct invoice number; set cancel_flag='Y'; set object_version_number=1296120000 |
| ZX_LINES_SUMMARY | Update trx_number to correct invoice number |
| ZX_LINES_DET_FACTORS | Update trx_number to correct invoice number |
| AP_INVOICES_ALL | Read only — source for correct invoice_num values |