Search Results get_payments_exist_flag




Overview

APPS.AP_PA_API_PKG is a public PL/SQL API package in Oracle E-Business Suite Payables, owned by the APPS schema and declared with AUTHID CURRENT_USER. Its name reflects its role as a supporting API layer for Payables invoice processing, specifically bridging Payables data with Project Accounting (PA) requirements. The package encapsulates a set of read-only accessor functions and one variance calculation procedure that expose invoice-level and distribution-level attributes without requiring callers to query base Payables tables directly.

The latest shipped version of the specification is 120.9.12020000.2, dated 2013/01/09. The package is classified as OTHER in the ETRM repository and is not referenced by any other documented package, indicating it is invoked directly by forms, concurrent programs, or custom extensions rather than being a shared internal dependency.

Key Procedures and Functions

The package exposes six functions and one procedure:

  • GET_ORG_ID — Returns the operating unit (organization) identifier associated with a given invoice. This is commonly used to derive the correct MOAC context for downstream processing.
  • GET_DISCOUNT_PAY_DISTS_FLAG — Returns a flag indicating whether the invoice pays discount distributions.
  • SELECTED_FOR_PAYMENT_FLAG — Returns a flag indicating whether the invoice has been selected for payment. This is the function most directly associated with the AP_SELECTED_INVOICES_ALL table and is frequently referenced by custom code checking payment selection status.
  • GET_PAYMENTS_EXIST_FLAG — Returns a flag indicating whether any payment records exist against the invoice.
  • GET_INVOICE_STATUS — Accepts an invoice identifier and a status type and returns the corresponding invoice status value.
  • GET_ASSET_TRACKING_FLAG — Accepts a code combination identifier and returns the asset tracking flag, supporting the determination of whether the accounting flexfield is enabled for asset tracking.
  • GET_INV_AMOUNT_VAR — A procedure that returns both the amount variance and base amount variance for a specified invoice and invoice distribution identifier.

Each function is declared with PRAGMA RESTRICT_REFERENCES (WNDS, WNPS), confirming that they do not write package state or database tables and can therefore be safely invoked from SQL statements and other read-only contexts.

Tables Accessed

The package reads from the following tables via APPS synonyms:

  • AP_INVOICES_ALL — Primary invoice header data used to derive organization, discount, and status attributes.
  • AP_INVOICE_DISTRIBUTIONS — Invoice distribution lines used by GET_INV_AMOUNT_VAR for variance comparison.
  • AP_INVOICE_PAYMENTS_ALL — Payment records referenced by GET_PAYMENTS_EXIST_FLAG.
  • AP_SELECTED_INVOICES_ALL — Payment selection records underlying SELECTED_FOR_PAYMENT_FLAG.
  • AP_SYSTEM_PARAMETERS_ALL — Payables system options, used for defaulting and flag interpretation.
  • GL_CODE_COMBINATIONS — Accounting flexfield data used by GET_ASSET_TRACKING_FLAG.
  • PO_HEADERS — Purchasing document headers, referenced for invoice-to-PO linkage.

Usage Notes

AP_PA_API_PKG is typically invoked from Oracle Forms, concurrent programs, or custom PL/SQL extensions that need to evaluate invoice payment readiness without querying base tables directly. A custom application verifying whether an invoice has been selected for payment would call SELECTED_FOR_PAYMENT_FLAG rather than querying AP_SELECTED_INVOICES_ALL, ensuring consistent interpretation of the selection logic.

Because all functions carry RESTRICT_REFERENCES pragmas, they may be called from SQL and used in views or reports. Since the package uses AUTHID CURRENT_USER, callers must have appropriate privileges on the underlying AP and GL objects. The absence of documented dependencies from other packages means implementations should treat this API as a stable, directly callable utility rather than assuming transitive coverage through other Payables APIs.