Search Results fa_gainloss_pkg




Overview

FA_GAINLOSS_PKG is an Oracle E-Business Suite PL/SQL package owned by the APPS schema that encapsulates the gain and loss calculation logic used by Oracle Assets (Fixed Assets). When an asset is retired, transferred, or revalued, Oracle Assets must determine the difference between the asset's net book value and the proceeds or consideration received. FA_GAINLOSS_PKG is the internal engine that performs this computation, applying the appropriate depreciation method, book controls, and cost basis to derive the realized gain or loss for the affected asset and distribution lines.

The package is classified in the ETRM repository as an OTHER API, indicating that it is an internal utility rather than a formally published, externally supported interface. It is nevertheless a load-bearing component of the retirement and transfer flows, and its correctness directly affects the financial postings generated to General Ledger through the Create Accounting process.

Key Procedures and Functions

The ETRM metadata documents two procedures in the package specification:

  • DO_CALC_GAINLOSS — Performs the gain/loss calculation for a single asset or a set of assets within the context of a retirement or transfer transaction. It resolves the applicable depreciation method and book controls, retrieves the current net book value, compares it against proceeds or cost relieved, and returns the resulting gain or loss amount for downstream accounting and reporting.
  • DO_CALC_GAINLOSS_ASSET — The asset-level counterpart, executing the same core calculation for an individual asset record. This procedure isolates the per-asset logic so that multi-asset or mass retirement processes can iterate over each asset while sharing the common method, book, and proration logic.

Both procedures return values through standard Oracle Assets API data structures rather than a fixed parameter list, which is consistent with the package's dependency on FA_API_TYPES.

Tables Accessed

The package reads and writes the following Oracle Assets base tables through APPS synonyms:

  • FA_ADDITIONS_B — the asset definition table, supplying cost, asset type, and descriptive attributes.
  • FA_BOOKS and FA_BOOK_CONTROLS — the asset's book-level cost, salvage, and depreciation attributes, together with the controlling depreciation rules and calendar for the book.
  • FA_DEPRN_SUMMARY — accumulated depreciation and year-to-date figures used to derive net book value at the retirement or transfer date.
  • FA_METHODS — depreciation method definitions applied when prorating depreciation to the transaction date.
  • FA_RETIREMENTS and FA_MC_RETIREMENTS — retirement transaction records, including the multi-currency (MRC) mirror rows needed for reporting sets of books.
  • FA_TRANSACTION_HEADERS — the transaction header that groups the retirement or transfer lines being processed.
  • PLITBLM — the Oracle Assets PL/SQL table type store used to pass arrays of identifiers and computed values between procedures.

Usage Notes

FA_GAINLOSS_PKG is not intended to be called directly from custom code. Its documented caller is FA_RETIREMENT_PUB, the public retirement API, which invokes the gain/loss routines internally when a retirement is processed. The package also appears in its own dependency list, reflecting internal recursive calls between DO_CALC_GAINLOSS and DO_CALC_GAINLOSS_ASSET. In practice the package is exercised during the Oracle Assets retirement, transfer, and revaluation workflows, including mass retirements and the Create Accounting concurrent program, which consumes the computed gain or loss to generate the corresponding journal entries. Because it is an unsupported internal package, any customization should target the supported FA_RETIREMENT_PUB interface and treat FA_GAINLOSS_PKG as subject to change across releases.