Search Results generate_voucher_number
Overview
JA_CN_VOUCHER_NUM_PKG is an Oracle E-Business Suite PL/SQL package owned by APPS and classified as OTHER in the ETRM repository. Its stated purpose, taken directly from the package header comment, is to generate the voucher numbers required by the China localization (JA_CN) legal reporting process. The package is defined with AUTHID CURRENT_USER, meaning that its unqualified database object references resolve under the privileges of the calling schema rather than the APPS schema itself, and that its runtime behavior is sensitive to the caller's privilege set.
The source file, JACNVNGS.pls, carries the version string 120.4 dated 2011/05/13. The revision history records creation by Chongwu Li on 29-Jul-2010, an update by Jianchao Chi on 29-Sep-2010, and a further update by Chongwu Li on 12-May-2011 that added the method get_balancing_segment in support of a "CFS separated" patch tracked under bug 12541220. This places the package in the Chinese voucher-numbering and balancing-segment reporting area, where sequential, period-scoped voucher identifiers must be produced consistently across a ledger and legal entity.
Key Procedures and Functions
- GENERATE_VOUCHER_NUMBER — Documented as the routine that generates the voucher number for a given period. The header comment indicates it accepts a ledger identifier, a legal entity identifier, a period name, and a regeneration flag as inputs.
- GENERATE_VOUCHER_NUM_PERIODS — Handles voucher number generation across a range of accounting periods rather than a single period.
- BEFOREREPORT — A report-level entry point, conventionally invoked as the Before Report trigger of an Oracle Reports concurrent program, used to initialize the package-level global variables and validate report parameters prior to query execution.
- GET_BALANCING_SEGMENT — Added in the 12-May-2011 revision for the CFS separated patch (bug 12541220). It retrieves the balancing segment applicable to the reporting context, allowing voucher output to be separated or grouped by balancing segment.
The package declares a set of global variables, including P_LEDGER_ID, P_LEDGER_NAME, P_CURRENCY, P_LEGAL_ENTITY_ID, P_LEGAL_ENTITY, P_COA_ID, P_PERIOD_FROM, P_PERIOD_TO, P_GL_DATE_FROM, P_GL_DATE_TO, P_PROFILE_OPTION_VALUE, and P_REGENERATE_FLAG. These carry report parameter context between the procedures during a single concurrent request run.
Tables Accessed
- JA_CN_VOUCHER_NUMBER — The primary persistence table for generated voucher numbers; GENERATE_VOUCHER_NUMBER writes to and reads from it.
- JA_CN_LEDGER_LE_BSV_GT — A global temporary table holding the mapping between ledger, legal entity, and balancing segment values used to drive voucher separation.
- GL_LEDGERS and GL_LEDGER_NORM_SEG_VALS — Supply ledger attributes and the normalized segment values (including the balancing segment) required by GET_BALANCING_SEGMENT.
- GL_CODE_COMBINATIONS — Resolves the accounting flexfield combinations associated with the voucher lines.
- GL_JE_HEADERS and GL_JE_LINES — Provide the journal header and line data from which voucher records are derived and numbered.
- GL_PERIOD_STATUSES — Validates and constrains the periods for which voucher numbers may be generated.
- FND_SEGMENT_ATTRIBUTE_VALUES — Determines the balancing-segment attribute of the chart of accounts structure.
Usage Notes
The package is typically invoked from Oracle Reports-based concurrent programs within the China localization module, where BEFOREREPORT executes as the Before Report trigger and the generation procedures run during report execution. It is referenced by three other packages in the ETRM repository, indicating reuse by dependent localization logic. Because the package compiles with AUTHID CURRENT_USER, callers must be granted direct privileges on the underlying GL and JA_CN tables. The P_REGENERATE_FLAG parameter controls whether previously generated voucher numbers are replaced, and the period and GL date range variables restrict processing to the requested reporting window.