Search Results pa_quantity




Overview

AP_DIST_PREPAY_APPLICATION_V is an internal Oracle Payables view owned by the APPS schema. It exposes the population of prepayment distributions from AP_INVOICE_DISTRIBUTIONS that remain available for application against supplier invoices, together with the associated accounting flexfield combination. The view is consumed primarily by Oracle Payables internal logic and by the prepayment application process, which drives the selection list of prepayment invoices and their remaining balances when an invoice is matched against an existing prepayment. It is not a user-facing inquiry window; rather, it is a programmatic access layer that presents a filtered, enriched snapshot of prepayment distribution balances, including inclusive tax amounts computed at runtime through the AP_PREPAY_UTILS_PKG package.

For reporting and integration purposes, the view is most valuable when the requirement is to identify open prepayment balances by distribution, and specifically to resolve the accounting code combination used on the prepayment. The column DIST_CODE_COMBINATION_ID is the primary key to the code combination that will be offset or reversed when the prepayment is applied.

Underlying Base Objects

The view is defined over two documented base objects:

  • AP_INVOICE_DISTRIBUTIONS (referenced through an APPS synonym) — the primary source for all distribution-level attributes such as amounts, quantities, accounting date, period, and the distribution code combination.
  • AP_PREPAY_UTILS_PKG (package) — invoked through the function GET_DIST_INCLUSIVE_TAX_AMT, which returns the inclusive tax amount for a given invoice, line, and distribution. This function is called twice in the view definition, once to add the tax amount to the remaining prepay amount and once to expose it as a separate column.

Filtering is applied at the base table level. Only rows whose LINE_TYPE_LOOKUP_CODE is 'ITEM' or 'ACCRUAL' are eligible, rows with a reversal flag of 'Y' are excluded by use of NVL(AID.REVERSAL_FLAG,'N') <> 'Y', and the computed remaining amount (prepay amount remaining, or total distribution amount when null, plus inclusive tax) must be greater than zero. The alias AID is preserved in the projection, and the view retains the ROWID of the base distribution as ROW_ID.

Key Columns

Common Use Cases and Queries

The most common requirement is to find open prepayment distributions and their accounting combinations for a given supplier or operating unit. Because the view filters to positive remaining amounts and excludes reversed rows, it can be queried directly without re-implementing the remaining-balance logic, provided the inclusive tax computed by the package is acceptable.

Resolve the account combination for open prepayments:

SELECT p.INVOICE_ID,
       p.PREPAY_LINE_NUMBER,
       p.INVOICE_DISTRIBUTION_ID,
       p.DIST_CODE_COMBINATION_ID,
       gcc.concatenated_segments,
       p.PREPAY_AMOUNT_REMAINING,
       p.TAX_AMOUNT_REMAINING,
       p.CURRENCY
FROM   APPS.AP_DIST_PREPAY_APPLICATION_V p,
       APPS.GL_CODE_COMBINATIONS_KFV gcc
WHERE  p.DIST_CODE_COMBINATION_ID = gcc.code_combination_id
AND    p.ORG_ID = :p_org_id;

Summarize open prepayment balances by account for reconciliation or audit support:

SELECT d.DIST_CODE_COMBINATION_ID,
       gcc.concatenated_segments,
       SUM(d.PREPAY_AMOUNT_REMAINING) prepay_open,
       SUM(d.TAX_AMOUNT_REMAINING)    tax_open
FROM   APPS.AP_DIST_PREPAY_APPLICATION_V d,
       APPS.GL_CODE_COMBINATIONS_KFV gcc
WHERE  d.DIST_CODE_COMBINATION_ID = gcc.code_combination_id
AND    d.ORG_ID = :p_org_id
AND    d.SET_OF_BOOKS_ID = :p_set_of_books_id
GROUP  BY d.DIST_CODE_COMBINATION_ID, gcc.concatenated_segments;

Because the view is designated internal and is not part of the documented public API surface, custom code should treat its definition as subject to change between releases. Where prepayment tax treatment must match the application exactly, invoking AP_PREPAY_UTILS_PKG.GET_DIST_INCLUSIVE_TAX_AMT in the same manner as the view is the reliable approach.