Search Results get_actual_inv_count




Overview

AP_BATCHES_PKG is a PL/SQL package owned by the APPS schema in Oracle E-Business Suite, present and valid in both release 12.1.1 and 12.2.2. It encapsulates the core database-level operations for the AP_BATCHES entity, which represents invoice batches used by Oracle Payables to group invoices for processing, approval, and payment. A batch is the principal control unit for entering, validating, and posting invoices; the batch record carries control totals such as invoice count and invoice amount, and the batch status governs whether invoices within it may still be modified.

The package therefore provides the low-level create, retrieve, lock, update, and delete services that higher-level Payables logic depends upon to maintain batch integrity. It is classified as an OTHER API rather than a public, supported interface, which indicates that it is an internal repository object invoked by Payables forms, views, and other packages rather than by customer extensions directly. The ETRM metadata records seven documented program units and two referenced tables, confirming its role as a thin persistence and validation layer over the invoice batch schema.

Key Procedures and Functions

  • GET_ACTUAL_INV_COUNT — Returns the actual number of invoices currently associated with a given batch, allowing the recorded batch control count to be reconciled against reality.
  • GET_ACTUAL_INV_AMOUNT — Returns the actual summed invoice amount for the invoices in a batch, supporting reconciliation of the documented batch total against the underlying invoice detail.
  • CHECK_UNIQUE — Validates uniqueness constraints on the batch record, typically preventing duplicate batch names or identifiers within the operating unit before an insert or update is committed.
  • INSERT_ROW — Creates a new row in the batch table, populating the batch attributes supplied by the caller as part of invoice entry or batch creation.
  • LOCK_ROW — Acquires a row-level lock on an existing batch record, serializing concurrent access so that two users or processes cannot modify the same batch simultaneously.
  • UPDATE_ROW — Applies changes to an existing batch record, including control totals and status transitions.
  • DELETE_ROW — Removes a batch record, subject to the business rules governing deletion of batches that contain no invoices.

Tables Accessed

The package operates against AP_BATCHES_ALL, the multi-organization table holding batch header records across operating units, whose columns include batch name, control count, control amount, status, and audit information. It also references AP_INVOICES_ALL, the base invoice table, to derive the actual invoice count and invoice amount associated with a batch through the GET_ACTUAL_INV_COUNT and GET_ACTUAL_INV_AMOUNT functions. Access is made through APPS synonyms, consistent with standard EBS schema design in which the APPS account owns the code while the base tables reside in the AP schema.

Usage Notes

AP_BATCHES_PKG is invoked indirectly by the Payables invoice workbench and related forms when users create, query, update, or delete invoice batches, and by concurrent programs and internal packages that manage batch processing. The ETRM dependency data shows it is referenced by the AP_BATCHES_V view and by AP_INVOICES_POST_PROCESS_PKG, confirming that the batch view and the invoice post-processing package call into this package for their batch-level database operations. Because it is an internal OTHER-classified package with no documented public parameters, customizations should not invoke it directly; integrators requiring batch manipulation should use supported Payables interfaces or the Open Interfaces rather than calling these row handlers. The presence of LOCK_ROW underscores that batch maintenance is designed for concurrent, multi-user environments and that callers are expected to lock before updating or deleting. In both 12.1.1 and 12.2.2 the package remains valid, with no functional divergence reported in the metadata.