Search Results get_balance_details
Overview
OKL_STREAMS_UTIL is a utility package in the Oracle Lease and Finance Management (OKL) module of Oracle E-Business Suite, classified as a UTIL-type API under the APPS schema. It provides the shared plumbing used throughout the OKL streams subsystem, which governs the lifecycle of financial streams — the scheduled cash flows, accruals, and accounting events generated from leased assets, contracts, and financing arrangements. The package is declared AUTHID CURRENT_USER and depends heavily on the standard OKL_API exception and constant framework, adopting its message tokens (OKL_SQLERRM, OKL_SQLCODE), missing-value sentinels (G_MISS_NUM, G_MISS_CHAR, G_MISS_DATE), and return status values (G_RET_STS_SUCCESS, G_RET_STS_ERROR, G_RET_STS_UNEXP_ERROR). It is a widely reused component: the metadata records that it is referenced by 67 other packages. Its routines fall broadly into stream-type resolution, transaction state management, accounting option retrieval, bulk accumulation of stream headers and elements, and rounding or amortization calculations.
Key Procedures and Functions
The 27 documented routines can be grouped by purpose:
- Stream type resolution: GET_PRIMARY_STREAM_TYPE, GET_PRIMARY_STREAM_TYPE_REP, GET_DEPENDENT_STREAM_TYPE, GET_DEPENDENT_STREAM_TYPE_REP, and STRM_TMPT_CONTAINS_STRM_TYPE determine the primary or dependent stream types applicable to a contract or template.
- Transaction and state management: GET_TRANSACTION_STATUS, GET_K_TRX_STATE, and UPDATE_TRX_STATE read and maintain the transaction state of OKL entities, while GET_ORP_CODE resolves the operational/processing code associated with a stream transaction.
- Accounting and pricing configuration: GET_FND_PROFILE_VALUE retrieves a profile option value; GET_ACC_OPTIONS returns system accounting options; GET_PRICING_ENGINE identifies the pricing engine to be used.
- Accumulation and lookup helpers: ACCUMULATE_STRM_HEADERS and ACCUMULATE_STRM_ELEMENTS build in-memory collections of stream header and element rows from the interface tables; GET_LINE_ID returns a line identifier; GET_BALANCE_DETAILS retrieves balance information.
- Numeric and amortization routines: ROUND_STREAMS_AMOUNT and ROUND_STREAMS_AMOUNT_ESG apply consistent rounding; GET_VAR_AMORT_DETAILS supplies variable amortization detail rows.
- Logging: LOG_MESSAGE writes diagnostic output, using the ECX_UTL_LOG_DIR directory for UTL_FILE output.
Tables Accessed
The package reads and writes through APPS synonyms. Stream definition and type data come from OKL_STRM_TYPE_B, OKL_K_HEADERS, OKC_K_HEADERS_B, OKC_K_HEADERS_ALL_B, and OKL_K_LINES. Interface and return processing use OKL_STREAM_INTERFACES, OKL_SIF_LINES, OKL_SIF_RETS, OKL_SIF_RET_LEVELS, and OKL_AE_TMPT_SETS_ALL. Product and accounting configuration are sourced from OKL_PRODUCTS and OKL_SYS_ACCT_OPTS. OKL_RBK_SELECTED_CONTRACT supports buyback selection. FND_NEW_MESSAGES supplies message text, and UTL_FILE handles log file I/O.
Usage Notes
OKL_STREAMS_UTIL is not an end-user entry point; it is invoked internally by OKL forms, concurrent programs, and other PL/SQL APIs (the 67 dependent packages). Callers should expect the standard OKL_API return-status and exception conventions, so the G_RET_STS_* values and the G_EXCEPTION_* exceptions must be handled explicitly. Because it runs AUTHID CURRENT_USER, execute privileges and any direct object access are governed by the calling schema. GET_ORP_CODE in particular is used when a caller needs to translate a stream record into its operational reference code for downstream accounting, reporting, or interface processing. Custom extensions should call it only after the surrounding stream data has been loaded or accumulated.