Search Results cancel_batch




Overview

AP_AUTOSELECT_PKG is a core Oracle Payables package that supports the automatic invoice selection process used to build payment batches. It is the engine behind the Payment Workbench and related concurrent programs that identify payables candidates, apply selection criteria, and prepare invoices for payment. The package orchestrates the workflow through which invoices flagged as due are gathered into a payment batch, validated against the active batch selection criteria (including pay-through, pay-from, and payment date ranges), and made available for further processing such as recalculation, cancellation, and reporting.

The package also encapsulates several auxiliary concerns within the payment batch lifecycle: currency and group handling, prepayment and overpayment treatment, interest period computations, and withholding tax (AWT) gross amount proration and special rounding. Because these concerns intersect with multiple AP tables, the package acts as a coordinating layer rather than a simple utility.

Key Procedures and Functions

The documented procedures and functions cover the full selection and maintenance cycle. Note that parameter lists are not enumerated here; only purpose is described.

  • SELECT_INVOICES — Populates the payment batch by identifying and selecting invoices that satisfy the current selection criteria. Typically run as a concurrent program step within the payment batch workflow.
  • REMOVE_INVOICES — Removes previously selected invoices from a payment batch, keyed by the check run identifier. This is the routine the user searched for under "remove_invoices"; it supports corrections and re-selection when a batch must be rebuilt.
  • AWT_SPECIAL_ROUNDING — Applies special rounding logic to withholding tax amounts, introduced to address the deviation tracked in Bug 6459578.
  • RECALCULATE — Recomputes batch totals and related figures after selection changes, with an option to submit to IBY.
  • CANCEL_BATCH — Cancels an existing payment batch identified by the check run identifier.
  • SELECTION_CRITERIA_REPORT — Produces the report of selection criteria used for a given check run.
  • PRORATED_AWT_GROSS_AMT — Computes the prorated withholding tax gross amount across applicable transactions.
  • GET_PREPAY_WITH_TAX — Retrieves prepayment data together with associated tax amounts.
  • MARK_OVERPAYMENTS — Flags overpayment invoices for appropriate handling during payment processing.
  • CHECK_DOC_PAYABLE_REMOVE — Validates and supports removal of payable documents from the batch.

Tables Accessed

The package reads and writes through APPS synonyms across the core Payables data model. Invoice and distribution data is drawn from AP_INVOICES_ALL, AP_INVOICE_DISTRIBUTIONS_ALL, AP_INVOICE_LINES_ALL, AP_INVOICES, AP_INVOICES_S, and AP_INVOICE_PAYMENTS_ALL. Selection parameters and batch state are persisted in AP_INV_SELECTION_CRITERIA_ALL and AP_INV_SELECTION_CRITERIA_S. Withholding tax and distribution adjustments use AP_AWT_GROUP_TAXES_ALL, AP_AWT_TEMP_DISTRIBUTIONS_ALL, and AP_INTEREST_PERIODS. Currency handling leverages AP_CURRENCY_GROUP, AP_CURRENCY_GROUP_S, and AP_LE_GROUP, while AP_INVOICE_RELATIONSHIPS supports linkage between related invoices such as prepayments and their applications.

Usage Notes

AP_AUTOSELECT_PKG is primarily invoked by Oracle Payables forms (notably the Payment Workbench) and by concurrent programs in the payment batch flow. REMOVE_INVOICES in particular is commonly called when users remove selected invoices from a batch prior to formatting or payment. The package is not referenced by other documented packages, so custom code should call it directly only when replicating standard batch behavior. Because these routines manipulate critical payment tables, any custom invocation must respect check run context and selection criteria state to avoid data corruption.