Search Results process_discount_subsidy




Overview

OKL_AM_LEASE_LOAN_TRMNT_PVT is a private PL/SQL package in the Oracle E-Business Suite Lease Management (OKL) module, declared with AUTHID CURRENT_USER and owned by APPS. It encapsulates the business logic that executes lease and loan termination processing within the Oracle Enterprise Trading and Risk Management (ETRM) application stack. The package coordinates the full lifecycle of a termination event: validating the contract, deriving or generating the termination quote, computing settlement amounts, integrating with Oracle Service Contracts, adjusting financial streams, and driving loan refunds.

The package follows Oracle's standard two-tier API design. A public wrapper package (typically OKL_AM_LEASE_LOAN_TRMNT_PUB or its functional equivalent) exposes the callable interface, while this private package (suffix _PVT) holds the internal procedural logic, validation rules, and direct DML on the underlying contract tables. The absence of a public interface in this object and the 16 dependent packages that reference it confirm its role as an internal engine rather than a direct integration point.

Key Procedures and Functions

The package exposes 15 documented procedures and functions. Principal among them is LEASE_LOAN_TERMINATION, the top-level driver that orchestrates the entire termination workflow and manages the transaction boundary through the package-level G_EXCEPTION_HALT exception. VALIDATE_CONTRACT performs pre-processing eligibility checks against contract status, headers, and lines before termination is permitted.

Quote-related logic is handled by CHECK_TRUE_PARTIAL_QUOTE, GET_SET_QUOTE_DATES, and GET_LAST_RUN, which together evaluate whether a partial termination quote exists and align termination dates with prior runs. PROCESS_ADJUSTMENTS and PROCESS_DISCOUNT_SUBSIDY apply financial adjustments and discount subsidy calculations to the terminated streams, while PROCESS_LOAN_REFUNDS handles refund generation for loan-type contracts.

Dependency and readiness checks include CHECK_BILLING_DONE, CHECK_INT_CALC_DONE, and CHECK_STREAM_BILLING_DONE, which prevent termination until billing and interest calculations have completed. CHECK_SERVICE_K_INT_NEEDED and SERVICE_K_INTEGRATION determine and execute integration with Oracle Service Contracts. GET_SET_TMG_RUN manages timing run identifiers used downstream.

Tables Accessed

The package reads and writes the core ETRM contract schema. OKC_K_HEADERS_B, OKC_K_ITEMS, OKC_K_LINES_B, OKC_K_PROCESSES, OKC_K_REL_OBJS, OKC_LINE_STYLES_B, OKC_RULES_B, and OKC_STATUSES_B provide contract header, line, rule, and status context. Lease-specific data resides in OKL_K_HEADERS, OKL_K_LINES, and OKL_PRODUCTS. Financial stream processing relies on OKL_STREAMS, OKL_STRM_ELEMENTS, and OKL_STRM_TYPE_B. FND_APPLICATION is referenced for application context. These accesses are performed through APPS synonyms.

Usage Notes

Invocation occurs indirectly through the public termination API and the Lease Management termination concurrent programs and forms, particularly when a user submits a lease or loan termination request. Custom code should call the public wrapper rather than this private package. Because the package uses AUTHID CURRENT_USER and raises G_EXCEPTION_HALT on unrecoverable conditions, callers must handle exceptions and preserve the transaction semantics expected by the parent API.