Search Results pay_hk_rules




Overview

PAY_HK_RULES is an Oracle Applications (APPS) PL/SQL package that encapsulates Hong Kong (HK) legislative payroll rules within the Oracle E-Business Suite Payroll module. Its presence in the PAY_HK schema family places it alongside other country-specific payroll rule packages that Oracle Payroll invokes during payroll processing to apply statutory, tax, and reporting logic unique to a localization. The package header is declared with AUTHID CURRENT_USER, meaning it executes with the privileges of the invoking user rather than the package owner, which is the standard Oracle EBS construct for packages that must respect the caller's security context and session environment.

The package is classified in ETRM as an API of type OTHER, indicating it is not a public, customer-facing business API but rather an internal engine component invoked by the payroll processing framework. Its change history shows an original creation in November 2000 by jbailie, with two subsequent revisions in December 2002 by srrajago that added the nocopy compiler hint to the out and in out parameters of its sole procedure, along with supporting dbdrv and checkfile commands. These changes are purely performance-related, allowing PL/SQL to pass large parameters by reference instead of by value. The package is versioned at 115.2, consistent with the 11i code line that carried forward into EBS 12.1.1 and 12.2.2.

Key Procedures and Functions

The ETRM metadata documents a single public procedure:

  • GET_SOURCE_CONTEXT — Retrieves the payroll "source context" associated with a given assignment action, employee, and source identifier. The procedure takes an assignment action identifier, an employee (person) identifier, and a source identifier as inputs, and returns the derived source context through an in out nocopy parameter. This context is used by the payroll engine to determine the origin and routing of a payroll run or element entry, ensuring the correct Hong Kong rules are applied to the assignment being processed.

No functions or additional procedures are documented. The nocopy hints applied to this procedure in version 115.2 confirm it is invoked frequently enough that parameter-passing overhead warranted optimization.

Tables Accessed

The package references three APPS-synonymed tables, per the documented dependency list:

  • PAY_ASSIGNMENT_ACTIONS — Records the actions applied to an assignment (such as hire, termination, or payroll-related changes). GET_SOURCE_CONTEXT uses the assignment action identifier as its primary input, so this table supplies the action context for the source lookup.
  • PAY_ELEMENT_ENTRIES_F — Stores element entry definitions and values for a payroll assignment. The procedure reads this table to resolve which element entries and sources apply to the employee, which is central to determining the correct source context.
  • PAY_PAYROLL_ACTIONS — Holds payroll action records (run, reversal, quick pay, etc.). The package consults this table to align the source context with the payroll action under which the assignment is being processed.

All three tables are core Oracle Payroll entities, confirming the package operates as a localization extension of the standard payroll processing engine.

Usage Notes

PAY_HK_RULES is not intended for direct invocation by end users or customer code. It is called internally by the Oracle Payroll processing engine during Hong Kong payroll runs, and potentially by Hong Kong localization forms or concurrent programs that need to resolve source context for an assignment. The metadata shows it is referenced by zero other packages, indicating its callers are either forms, concurrent programs, or engine-level C/Java code rather than other PL/SQL packages.

Because it is an internal engine component, customizations should avoid direct calls. Any extension of Hong Kong payroll logic should be implemented through supported element configuration, fast formulas, or documented payroll APIs, preserving the integrity of this package and the payroll engine that depends on it. The AUTHID CURRENT_USER clause means callers must have appropriate grants on the underlying tables, which is normally satisfied by the APPS schema context in which the payroll engine executes.