Search Results create_cons_bill




Overview

The OKL_CONS_BILL_PUB package body is a public API wrapper within the Oracle E-Business Suite Lease Management (OKL) module. It exposes the core consolidated billing logic implemented in the internal OKL_CONS_BILL package, providing a stable, externally callable interface for generating consolidated invoices across lease contracts. In Oracle EBS 12.1.1 and 12.2.2, this package functions as the application programming interface layer that shields external callers — concurrent programs, forms, and custom extensions — from direct dependence on the underlying implementation package.

The primary business function is the creation of consolidated bills that aggregate charges spanning multiple contracts or billing periods into a single invoice message for downstream processing. The package does not perform the billing computation itself; it delegates to OKL_CONS_BILL.CREATE_CONS_BILL, applying the standard Oracle API conventions (API version, initialization flag, standardized return status and message stack outputs).

Key Procedures and Functions

The package exposes a single documented procedure, CREATE_CONS_BILL, provided in two overloaded forms:

  • CREATE_CONS_BILL (API form) — The procedural entry point intended for programmatic invocation. It accepts an API version, an initialization-message-list flag, an input invoice message, and an assigned parallel process identifier. It returns the standard API outputs: return status, message count, and message data. Internally it invokes OKL_CONS_BILL.CREATE_CONS_BILL with FND_API.G_TRUE for the commit flag, meaning the transaction is committed within the packaged call.
  • CREATE_CONS_BILL (concurrent program form) — The overloaded signature designed for concurrent program registration. It uses the standard concurrent manager parameters errbuf (OUT VARCHAR2) and retcode (OUT NUMBER), plus the same p_inv_msg and p_assigned_process inputs. It wraps the API form with an API version defaulted to 1 and OKC_API.G_FALSE for message-list initialization, passing errbuf as the returned message data.

Both forms include an exception handler. Notably, when an error occurs and an assigned parallel process is supplied, the handler purges the corresponding row from OKL_PARALLEL_PROCESSES and commits, ensuring failed parallel runs do not leave orphaned process records.

Tables Accessed

The documented table reference is OKL_PARALLEL_PROCESSES (referenced through an APPS synonym). This package writes to it exclusively in the exception path of both procedure overloads, issuing a DELETE keyed on the assigned_process column followed by a COMMIT. The purpose is cleanup: when consolidated bill creation fails within a parallel processing context, the associated tracking row is removed so the parallel process is not treated as active or pending. All other billing data manipulation occurs inside the delegated OKL_CONS_BILL package rather than in this public wrapper.

Usage Notes

This package is typically invoked in two ways. First, through a concurrent program registered against the retcode/errbuf overload, allowing billing administrators to submit consolidated bill generation as a batch job, optionally targeting a specific parallel process. Second, through direct API calls from custom PL/SQL code, forms personalizations, or integration routines that require consolidated billing as part of a larger business flow; such callers use the API overload and should inspect x_return_status and the message stack before proceeding. Because the API form forces a commit internally, callers cannot roll back the consolidated bill creation as part of a broader transaction. The ETRM metadata records that the package is referenced by zero other packages, indicating it is an entry-point API layer rather than a shared internal dependency, and confirming it is intended for external consumption. Custom code should always call the PUB wrapper rather than the underlying OKL_CONS_BILL package to preserve upgrade safety across 12.1.1 and 12.2.2.