Search Results get_deferred_gain




Overview

The APPS.OKL_LIKE_KIND_EXCHANGE_PUB package body is a public PL/SQL API within the Oracle Lease and Finance Management (OKL) module of Oracle E-Business Suite. It supports the accounting and reporting treatment of like-kind exchanges, a tax-deferred transaction in which one leased or owned asset is exchanged for another of similar nature. Such exchanges require precise calculation of match amounts, remaining sale proceeds, and deferred gain so that the resulting financial and tax postings comply with regulatory treatment.

This package is structured as a thin public wrapper layer. Its public functions delegate their logic to the corresponding private implementations in OKL_LIKE_KIND_EXCHANGE_PVT, and its single public procedure, CREATE_LIKE_KIND_EXCHANGE, exposes an API-driven creation routine with standard Oracle EBS API conventions: an API version parameter, message list initialization flag, and outbound return status, message count, and message data. As a "PUB" classified API, it is intended as the supported external interface, insulating callers from the private package's internals.

Key Procedures and Functions

The package exposes four documented program units:

  • GET_TOTAL_MATCH_AMT — Returns the total match amount for a given asset and tax book, allowing callers to determine the qualifying value attributable to the like-kind exchange.
  • GET_BALANCE_SALE_PROCEEDS — Returns the balance of sale proceeds associated with an asset and tax book, supporting proceeds allocation and deferral calculations.
  • GET_DEFERRED_GAIN — Returns the deferred gain amount for an asset and tax book, the portion of gain whose recognition is postponed under like-kind exchange rules.
  • CREATE_LIKE_KIND_EXCHANGE — The primary transactional procedure. It accepts corporate book and tax book context, comments, a representative asset record, and a table of requested assets, then creates the like-kind exchange transaction using standard API messaging.

The three retrieval functions share a defensive error pattern: any exception is trapped by WHEN OTHERS, and the function returns NULL rather than propagating the error. The creation procedure follows the conventional API pattern, initializing an internal return status to success and validating/processing against the private package.

Tables Accessed

The package body does not access tables directly. All persistence operations are performed by the underlying private package OKL_LIKE_KIND_EXCHANGE_PVT, which reads and writes the OKL contract, asset, and accounting distribution tables through APPS synonyms in the standard manner. The public layer therefore acts purely as a delegation and signature-stability boundary.

Usage Notes

The package is typically invoked from the Oracle Lease and Finance Management forms, from concurrent programs that process like-kind exchange accounting, or from custom PL/SQL that must create exchange transactions programmatically. Callers should supply a valid API version, set the initialization flag per convention, and inspect x_return_status, x_msg_count, and x_msg_data before proceeding. Because the retrieval functions suppress exceptions and return NULL on failure, callers must treat a null result as a potential error condition rather than a legitimate zero. One other package references this API, confirming its role as a reusable integration point. Header version 115.2 dates the object to earlier OKL releases, and the same API remains available in EBS 12.1.1 and 12.2.2.