← Back to Cases
AP Invoice Tax Distribution Price Variance Account NULL
Case Number00117687
Oracle ModuleAccounts Payable (AP) / Purchasing (PO)
EBS VersionR12
Functional AreaInvoice Processing / PO Matching / Tax Distributions
Related PatchesNone

Symptoms

Root Cause

When a PO-matched AP invoice has tax lines with a price variance (the tax amount differs from the PO-expected amount), the system should automatically populate PRICE_VAR_CODE_COMBINATION_ID on the TAX distribution from the PO distribution's variance_account_id. This population was omitted, leaving the column NULL and causing validation to fail when it tries to generate the IPV/TIPV accounting entry.

Identification SQL

Use the following query to identify affected distributions, substituting the invoice ID:

SELECT *
FROM ap_invoice_distributions_all id
WHERE id.posted_flag = 'N'
  AND id.PRICE_VAR_CODE_COMBINATION_ID IS NULL
  AND NVL(id.invoice_price_variance, 0) <> 0
  AND id.LINE_TYPE_LOOKUP_CODE = 'TAX'
  AND id.PO_DISTRIBUTION_ID IS NOT NULL
  AND id.invoice_id = &Invoice_ID;

Resolution

Step 1 – Create backup table

Run data_fix.sql. A backup of the affected AP_INVOICE_DISTRIBUTIONS_ALL rows is created.

Step 2 – Verify the count

Confirm the backup table row count matches the expected number of affected distributions.

Step 3 – Populate the price variance account

Update AP_INVOICE_DISTRIBUTIONS_ALL.PRICE_VAR_CODE_COMBINATION_ID from PO_DISTRIBUTIONS_ALL.variance_account_id for the affected invoice TAX distributions joined via po_distribution_id.

Step 4 – Commit and validate

Issue COMMIT. Retry invoice validation or cancellation to confirm it proceeds without the missing variance account error.

Note: This fix is applicable to unposted (posted_flag = 'N') TAX distributions on PO-matched invoices with a non-zero invoice_price_variance. Test in a non-production instance before applying to production, as sequence values and distribution IDs may differ between environments.

Script Inventory

FileDescription
data_fix.sqlCreates backup of affected AP_INVOICE_DISTRIBUTIONS_ALL rows; updates PRICE_VAR_CODE_COMBINATION_ID from PO_DISTRIBUTIONS_ALL.variance_account_id for unposted TAX distributions with null variance account and non-zero invoice_price_variance.

Key Tables Affected

TableAction
AP_INVOICE_DISTRIBUTIONS_ALLUpdate PRICE_VAR_CODE_COMBINATION_ID from PO variance_account_id
PO_DISTRIBUTIONS_ALLRead only — source for variance_account_id