Search Results match_status_flag




Overview

APPS.AP_APPLY_PREPAYS_V is a Payables module view that exposes prepayment invoices available for application against subsequent standard invoices. In Oracle E-Business Suite 12.1.1 and 12.2.2, the view operates as the data source behind the prepayment application workflow, presenting one row per applicable prepayment invoice line. Only lines meeting the full set of eligibility criteria are returned, including prepayment invoice type, confirmed payment status, posted lines, and a positive remaining unapplied balance.

The view is defined with the Status: VALID attribute in the ETRM repository and is owned by the APPS schema. Because it is a view rather than a table, it performs no physical storage; instead, it materializes its result set on demand by joining invoice header and line data with vendor, purchase order, and receiving information, while invoking PL/SQL utility functions to compute remaining balances.

Underlying Base Objects

The view is constructed as a multi-table join. Its principal driving table is AP_INVOICE_LINES_ALL, joined to AP_INVOICES on INVOICE_ID. Vendor and site attributes are drawn from the PO_VENDORS and PO_VENDOR_SITES_ALL views. Purchase order context is obtained from PO_HEADERS_ALL and PO_LINE_LOCATIONS_ALL, while receipt detail — displayed under the internal comment CONTRACT PAYMENTS — is sourced from RCV_TRANSACTIONS, RCV_SHIPMENT_HEADERS, and RCV_SHIPMENT_LINES.

Two PL/SQL objects are central to the view's behavior. AP_PREPAY_UTILS_PKG supplies the GET_LINE_PREPAY_AMT_REMAINING and GET_INC_TAX_PP_AMT_REMAINING functions, which calculate the unapplied prepayment balance and the corresponding inclusive-tax remainder at the line level. These functions also appear in the view's own WHERE clause, meaning each candidate row triggers a balance evaluation. The documented materialized dependency list additionally references AP_HOLDS, AP_HOLD_CODES, AP_INVOICE_DISTRIBUTIONS_ALL, FINANCIALS_SYSTEM_PARAMS_ALL, and FND_GLOBAL, consistent with hold validation, distribution-level controls, and MOAC operating unit access enforcement.

Key Columns

Common Use Cases and Queries

Payables users and developers query this view to determine which prepayments remain open for application, to reconcile unapplied prepayment balances during period close, and to build custom reports or integrations that require prepayment availability without invoking the standard application form. Because the view enforces eligibility internally — including payment status of Y, a PREPAYMENT invoice type, non-discarded lines, lines not already selected for application, and a null PREPAY_APPL_REQUEST_ID — consumers do not need to re-implement these filters.

A representative query listing outstanding prepayments for a supplier is:

SELECT prepay_number,
       prepay_line_number,
       vendor_name,
       prepay_amount_remaining,
       tax_amount_remaining,
       invoice_currency_code,
       earliest_settlement_date
FROM   ap_apply_prepays_v
WHERE  vendor_id = :p_vendor_id
ORDER  BY earliest_settlement_date;

A second pattern aggregates remaining balances by vendor for reconciliation purposes:

SELECT vendor_name,
       vendor_number,
       SUM(prepay_amount_remaining) total_unapplied
FROM   ap_apply_prepays_v
GROUP  BY vendor_name, vendor_number;

Filtering should always include ORG_ID where multi-organization access is enabled, and queries against large volumes may benefit from indexing strategy on the underlying invoice line and header tables, since the balance functions execute per qualifying line.