Search Results get_invoice_balance




Overview

PV_ENRL_REQUEST_ORDER_PUB is a public PL/SQL API owned by the APPS schema in Oracle E-Business Suite, shipped as part of the Oracle Procurement / supplier enrollment and request-for-order functionality. The package is declared with AUTHID CURRENT_USER, meaning its SQL statements execute under the privileges of the invoking schema rather than the definer, a design typical of EBS public APIs intended for controlled external invocation by forms, concurrent programs, and customer extensions. Its source header identifies the file as pvxperos.pls, version 115.3, dated August 2003, with a documented API version of 1.0.

The business purpose of the package is to surface invoice-related information tied to an order header or order line. Specifically, it answers questions such as: what is the outstanding balance on the invoice linked to a given order, in what currency is that invoice denominated, which invoice number corresponds to an order line, and what payment type applies to the order. These are recurring questions in the procure-to-pay and order-to-cash flows, where order data in OE_ORDER_HEADERS_ALL and OE_ORDER_LINES_ALL must be correlated with receivables transactions in RA_CUSTOMER_TRX_ALL and their associated payment schedules in AR_PAYMENT_SCHEDULES_ALL. The API classification "PUB" confirms that the package is documented for supported external use rather than being an internal implementation detail.

Key Procedures and Functions

The documented API surface consists of four callable units across three distinct names, of which the search term get_invoice_balance corresponds to two overloaded forms:

  • GET_INVOICE_BALANCE (function) — A function overload that accepts an order header identifier and returns the invoice balance as a NUMBER. This form is convenient when the caller needs only the balance value.
  • GET_INVOICE_BALANCE (procedure) — A procedure overload that accepts an order header identifier and returns two OUT NOCOPY parameters: the invoice balance as a NUMBER and the invoice currency as a VARCHAR2. The NOCOPY hint reduces overhead when passing large or frequently assigned OUT values.
  • GET_PAYMENT_TYPE — A function returning a VARCHAR2 payment type, keyed by order header identifier. It describes how the referenced order is expected to be paid.
  • GET_INVOICE_DETAILS — A procedure keyed by order line identifier (note: passed as VARCHAR2 rather than NUMBER) that returns the invoice balance, invoice currency, and invoice number. This is the richest of the APIs, providing full invoice context for a single order line.

Callers should note the asymmetry between the header-level APIs (GET_INVOICE_BALANCE, GET_PAYMENT_TYPE), which key on p_order_header_id as a NUMBER, and the line-level API (GET_INVOICE_DETAILS), which keys on p_order_line_id as a VARCHAR2.

Tables Accessed

The package reaches its data through APPS synonyms, consistent with standard EBS practice of isolating callers from schema names. The documented tables are:

  • OE_ORDER_HEADERS_ALL — the source of order header context, correlating the passed header identifier with the order.
  • OE_ORDER_LINES_ALL — used by the line-level API to resolve an order line and locate related invoice data.
  • RA_CUSTOMER_TRX_ALL — the receivables invoice header, providing the invoice number and currency.
  • RA_CUSTOMER_TRX_LINES_ALL — invoice lines linking transaction amounts to order lines.
  • AR_PAYMENT_SCHEDULES_ALL — the authoritative source of invoice balance and payment terms, from which the outstanding balance and payment type are derived.

The join path is effectively order header/line to customer transaction to payment schedule, which is the canonical EBS path for determining an invoice's remaining balance.

Usage Notes

The ETRM metadata records that PV_ENRL_REQUEST_ORDER_PUB is referenced by zero other packages, indicating it is a terminal API invoked directly rather than a shared internal dependency. Typical invocations include Oracle Forms customizations on order-entry or enrollment screens that display invoice balance and payment type alongside an order, concurrent programs that reconcile order-to-invoice positions, and custom PL/SQL extensions that require a supported, documented entry point instead of querying AR and OE tables directly. Because no other package depends on it, changes to its implementation carry limited blast radius, but callers should still treat the published signatures as the supported contract. When the metadata is silent on internal exception behavior, error handling, and the precise join predicates, developers should validate behavior against the target release (12.1.1 or 12.2.2) before relying on edge-case results.