Search Results invoice_includes_prepay_flag




Overview

The APPS.AP_UNAPPLY_PREPAYS_V view is a Payables reporting object in Oracle E-Business Suite 12.1.1 and 12.2.2 that exposes unapplied or reversed prepayment application lines. It reads from AP_INVOICE_LINES and joins upward to AP_INVOICES_ALL, supplier, purchasing, and receiving entities to present each prepayment application as a self-contained row. The view is used primarily by the Payables Unapply Prepayments form and by concurrent programs and integrations that must identify which prepayment amounts were applied to a standard invoice, how much tax was included, and how much of the original prepayment remains available.

The name reflects its filter logic: rows are restricted to lines where the line type lookup code equals PREPAY, the amount is negative, and the discarded flag is not Y. A negative amount on a PREPAY-type line represents the reversal or unapplication of a prior prepayment application. Consequently, the view helps users reconcile prepayment balances, reverse erroneous applications, and report outstanding prepayment amounts by supplier, purchase order, or receipt.

Underlying Base Objects

The view is defined over the following documented base objects:

The outer joins on PO_HEADERS_ALL and the receiving tables allow non-purchase-order and non-receipt prepayments to remain visible, so the view is not limited to matched transactions.

Key Columns

Common Use Cases and Queries

Typical scenarios include auditing unapplied prepayments, reversing incorrect applications, and reconciling supplier prepayment balances. A representative query follows:

SELECT prepay_number, prepay_line_number, invoice_id, prepay_amount_applied,
       prepay_amount_remaining, invoice_includes_prepay_flag
FROM   apps.ap_unapply_prepays_v
WHERE  vendor_id = :p_vendor_id
AND    accounting_date BETWEEN :p_start AND :p_end
ORDER BY accounting_date, prepay_number;

For period-based reporting, replace the date predicate with period_name = :p_period and aggregate PREPAY_AMOUNT_APPLIED by SET_OF_BOOKS_ID. For PO-linked prepayments, filter on PO_NUMBER IS NOT NULL or join on PO_DISTRIBUTION_ID. When correcting data, always reference ROW_ID rather than reconstructing a composite key, and drive any update through the standard Payables unapply prepayment process to preserve accounting integrity.