Search Results round_currency_amt_nested_blk
Overview
PA_CURRENCY is a currency-handling utility package within the Oracle Projects (PA) application, owned by the APPS schema and classified in ETRM as an OTHER API. Its central business purpose is to centralize and expose currency information — currency codes, minimum accountable units (MAU), precision, and extended precision — for Oracle Projects transactions and reporting. Rather than have each Projects form, concurrent program, or package re-derive the rounding behavior of a currency, PA_CURRENCY encapsulates that logic behind a small set of functions and procedures that consult Oracle's currency setup in FND_CURRENCIES and the Projects implementation parameters in PA_IMPLEMENTATIONS.
The package is widely embedded in the Projects codebase: the ETRM metadata records that it is referenced by 141 other packages. This reach indicates that PA_CURRENCY is effectively the standard rounding and formatting gatekeeper for monetary values originating within Oracle Projects source, including expenditure items, bill amounts, and transfer amounts.
Key Procedures and Functions
The package exposes twelve documented routines. The requested entry point, ROUND_TRANS_CURRENCY_AMT, accepts an amount and a currency code and returns the amount rounded according to the rounding attributes of the specified currency as held in FND_CURRENCIES. This is the transacting-currency counterpart to the set-of-books rounding routine.
- SET_CURRENCY_INFO — Populates the package's global variables for currency information, establishing the cached currency context for subsequent calls within a session.
- GET_CURRENCY_CODE — Returns the currency code associated with the Oracle Projects set of books. It is restricted to WNPS and WNDS, meaning it can be safely invoked from SQL.
- ROUND_CURRENCY_AMT — Rounds a supplied amount based on the set-of-books currency. The global MAU, precision (G_sp), and extended precision (G_ep) values drive the calculation.
- ROUND_TRANS_CURRENCY_AMT — Rounds a supplied amount based on an explicitly supplied currency code, providing currency-specific rounding independent of the set of books.
- ROUND_CURRENCY_AMT1, ROUND_TRANS_CURRENCY_AMT1 — Variants of the primary rounding functions, documented among the twelve exposed routines.
- CURRENCY_FMT_MASK — Returns a format mask derived from the standard precision of a currency, capped at a supplied maximum length. The header notes it cannot be used in reports because org_id is not passed.
- RPT_CURRENCY_FMT_MASK — The report-oriented counterpart to CURRENCY_FMT_MASK, accepting an org_id so the correct formatting can be resolved in a multi-org reporting context.
- TRANS_CURRENCY_FMT_MASK — Returns a format mask based on a transacting currency's precision.
- GET_MAU — Retrieves the minimum accountable unit for currency processing.
- ROUND_CURRENCY_AMT_BLK, ROUND_CURRENCY_AMT_NESTED_BLK — PL/SQL block-level rounding routines, documented as part of the package's exposed interface.
Tables Accessed
PA_CURRENCY operates against four documented tables, reached through APPS synonyms. FND_CURRENCIES supplies the currency definition data: precision, extended precision, and minimum accountable unit used by ROUND_TRANS_CURRENCY_AMT and the format-mask functions. PA_IMPLEMENTATIONS and PA_IMPLEMENTATIONS_ALL supply the Projects implementation and organization-level parameters, notably the set-of-books currency that drives ROUND_CURRENCY_AMT and GET_CURRENCY_CODE. PLITBLM is an Oracle-provided support table used internally for PL/SQL parsing and temporary storage. The package's global variables (G_curr_code, G_mau, G_sp, G_ep, G_proj_curr_code, G_mau_chr, G_org_id) hold the resolved values during execution.
Usage Notes
PA_CURRENCY is invoked wherever Projects must present or persist a monetary amount with the correct number of decimals. Typical callers include Projects forms that display and validate amounts, concurrent programs that compute and report billing or expenditure totals, and custom client extensions that need Projects-consistent rounding rather than generic PL/SQL ROUND. The routines marked with RESTRICT_REFERENCES (WNPS, WNDS) — GET_CURRENCY_CODE, ROUND_CURRENCY_AMT, ROUND_TRANS_CURRENCY_AMT, and the format-mask functions — are callable from SQL statements and views. Because the package uses AUTHID CURRENT_USER and relies on session-level globals initialized by SET_CURRENCY_INFO, callers should ensure currency context is established before invoking dependent functions. Reporting contexts must use RPT_CURRENCY_FMT_MASK rather than CURRENCY_FMT_MASK, since the latter does not accept an org_id. The presence of the org_id global (added under bug 6847113) reflects multi-org sensitivity in currency resolution.
-
PACKAGE: APPS.PA_CURRENCY
12.2.2
-
PACKAGE: APPS.PA_CURRENCY
12.1.1
-
PACKAGE BODY: APPS.PA_CURRENCY
12.1.1
-
PACKAGE BODY: APPS.PA_CURRENCY
12.2.2
-
APPS.PA_CURRENCY dependencies on PA_NUM_TBL_TYPE
12.1.1
-
APPS.PA_CURRENCY dependencies on PA_NUM_TBL_TYPE
12.1.1
-
APPS.PA_CURRENCY dependencies on PA_NUM_TBL_TYPE
12.2.2
-
APPS.PA_CURRENCY dependencies on PA_PLSQL_DATATYPES
12.2.2
-
APPS.PA_CURRENCY dependencies on PA_NUM_TBL_TYPE
12.2.2
-
APPS.PA_CURRENCY dependencies on PA_PLSQL_DATATYPES
12.1.1
-
APPS.PA_CURRENCY dependencies on PA_VARCHAR2_30_TBL_TYPE
12.2.2
-
APPS.PA_CURRENCY dependencies on PA_VARCHAR2_30_TBL_TYPE
12.1.1
-
APPS.PA_CURRENCY dependencies on PA_VARCHAR2_30_TBL_TYPE
12.2.2
-
APPS.PA_CURRENCY dependencies on PA_VARCHAR2_30_TBL_TYPE
12.1.1
-
APPS.PA_CURRENCY dependencies on PA_CURRENCY
12.2.2
-
APPS.PA_CURRENCY dependencies on PA_CURRENCY
12.1.1
-
APPS.PA_CURRENCY dependencies on PA_PLSQL_DATATYPES
12.2.2
-
APPS.PA_CURRENCY dependencies on PA_PLSQL_DATATYPES
12.1.1