Search Results inv_qty




Overview

APPS.AP_FUNDS_CONTROL_PKG is the core PL/SQL package body that implements Oracle Payables funds control and budgetary encumbrance processing within Oracle E-Business Suite 12.1.1 and 12.2.2. Its principal responsibility is to determine whether an invoice or invoice distribution has sufficient available funds before it is approved and accounted, and to reserve or relieve those funds against the appropriate general ledger budgetary accounts. The package enforces the funds check behavior defined in General Ledger and Payables system parameters, including the Encumbrance and Funds Check Level settings configured at the set of books level.

The package integrates tightly with Oracle General Ledger funds reservation features, honoring organization-level encumbrance enablement through its internal Encumbrance_Enabled function. It also implements the logging infrastructure built on FND_LOG, allowing diagnosticians to trace execution at statement, procedure, event, exception, error, and unexpected severity levels. The header comment identifies the source as aprfundb.pls, version 120.44, reflecting a mature and heavily maintained component of the Payables codebase.

Key Procedures and Functions

  • FUNDS_RESERVE — The primary entry point for reserving funds against an invoice. It establishes the funds reservation context, determines the override mode, and identifies the funds check user and responsibility identifiers used when posting reservation entries.
  • FUNDS_CHECK — The principal check routine. It evaluates the invoice and its distributions against available budgetary balances and determines whether the document passes or fails funds control. The related private initializer, FundsCheck_Init, resolves the set of books, exchange gain and loss accounts, base currency, and encumbrance type prior to the actual check.
  • FUNDS_CHECK_PROCESSOR — The orchestration routine that drives the overall check-and-reserve workflow, sequencing the initialization, validation, and reservation activities and returning the outcome to the calling process.
  • GET_ERV_CCID — Retrieves the code combination identifier associated with the Encumbrance Reserve Variance account used during funds control accounting.
  • ENCUM_UNPROCESSED_EVENTS_DEL — Deletes unprocessed encumbrance events, supporting the asynchronous or deferred processing of funds control activity and cleanup of pending event records.
  • CALC_QV — Computes the quantity variance component used in evaluating distribution-level funds availability.
  • CALC_AV — Computes the amount variance component, complementing CALC_QV in the distribution-level funds calculation.

In addition to these documented procedures, the package body defines private helper specifications including Setup_Gl_FundsCtrl_Params, FundsReserve_Init, and Encumbrance_Enabled, which support parameter resolution and organization-level encumbrance gating.

Tables Accessed

The package operates primarily across the Payables transaction schema. It reads AP_INVOICES_ALL and AP_INVOICE_DISTRIBUTIONS_ALL to obtain invoice and distribution amounts, along with AP_INVOICE_LINES_ALL for line-level detail. AP_PREPAY_APP_DISTS and AP_PREPAY_HISTORY_ALL support prepayment application and relief processing. AP_SELF_ASSESSED_TAX_DIST_ALL contributes self-assessed tax distribution amounts to the funds calculation. AP_BATCHES provides invoice batch context. AP_HOLDS and AP_HOLD_CODES are consulted when holds are placed or released as a result of a funds check failure. AP_SYSTEM_PARAMETERS, FINANCIALS_SYSTEM_PARAMETERS, and FINANCIALS_SYSTEM_PARAMS_ALL supply the funds control configuration, including the funds check level and encumbrance settings. Additional legacy views such as AP_INVOICES, AP_INVOICE_DISTRIBUTIONS, and AP_INVOICE_LINES are referenced via APPS synonyms.

Usage Notes

AP_FUNDS_CONTROL_PKG is invoked during invoice validation, approval, and accounting entry creation in Payables, and is referenced by four other packages in the application. It is typically called indirectly through the Payables invoice workflow and the Create Accounting process rather than directly by end users. Customizations that need to test or reserve funds programmatically should call FUNDS_CHECK and FUNDS_RESERVE through the documented interfaces, preserving the initialization sequence performed by FundsCheck_Init and FundsReserve_Init. Diagnostic logging is governed by FND_LOG runtime levels and the module prefix AP.PLSQL.AP_FUNDS_CONTROL_PKG. Because it writes holds and encumbrance events, direct invocation in custom code should be confined to controlled batch processes with appropriate rollback handling.