Search Results get_paid_by
Overview
APPS.AP_INVOICE_PAYMENTS_PKG is a public PL/SQL package in the Oracle E-Business Suite Payables (AP) module. It serves as a lightweight accessor layer that exposes payment-related attributes for a given invoice and payment installment. The package is declared with AUTHID CURRENT_USER, meaning it executes under the privileges of the calling schema rather than the definer, which allows it to be invoked consistently from forms, concurrent programs, and custom code that already hold the necessary AP data privileges. Within the ETRM reference model it is classified as OTHER, indicating it is a supporting utility package rather than a formal Open Interface or public API. Its principal purpose is to answer common runtime questions about how and when an invoice was paid, without requiring the caller to write direct SQL against the underlying payment tables.
Key Procedures and Functions
The package exposes six documented functions, each returning a single scalar value:
- get_paid_by — Returns the party or source that paid the invoice, identified by invoice id and payment number.
- get_paid_by_list — Returns a list form of the paying party information for the invoice and payment number, suitable for display where multiple values must be concatenated.
- get_paid_date — Returns the date on which the specified payment was made.
- get_payment_id — Returns the internal payment identifier associated with the invoice and payment number.
- get_payment_type — Returns the type of the payment (for example, the payment method classification) recorded for that installment.
- get_max_gl_date — Returns the maximum general ledger date associated with a given check id, providing the accounting date boundary for the disbursement.
Purity level pragmas are declared on the functions, with get_paid_by_list, get_paid_date, get_payment_id, and get_payment_type restricted to WNDS (write no database state), and get_max_gl_date restricted to WNDS, WNPS, and RNPS. These declarations allow the functions to be safely called from SQL statements and from within queries.
Tables Accessed
The package reads from the core Payables payment and invoice tables through APPS synonyms. AP_INVOICE_PAYMENTS and AP_INVOICE_PAYMENTS_ALL supply the invoice-to-payment association that maps an invoice to its payment number and payment id. AP_CHECKS and AP_CHECKS_ALL provide the payment instrument details, including payment type, payment date, and the check id used by get_max_gl_date. AP_INVOICES and AP_INVOICES_ALL supply invoice header context needed to resolve the requested invoice. The package is a read-only accessor; none of the underlying tables are modified.
Usage Notes
AP_INVOICE_PAYMENTS_PKG is typically invoked from Oracle Forms-based Payables inquiry screens and from custom PL/SQL routines that need to render payment status information for an invoice. Because the functions are WNDS-restricted, they can also be embedded directly in SQL SELECT statements to project payment attributes into reports and views. The package is referenced by three other packages within the APPS schema, confirming its role as a shared dependency for higher-level Payables logic. Customizations and extensions that must display or validate payment details for a given invoice should call these functions rather than querying AP_INVOICE_PAYMENTS directly, ensuring consistent interpretation of payment number, payment type, and check-level GL date logic across releases 12.1.1 and 12.2.2.