Search Results get_deductions




Overview

APPS.PAY_HK_SOE_PKG is a Hong Kong statutory reporting package within the Oracle E-Business Suite Payroll module. The package name reflects its purpose: "SOE" denotes Statement of Earnings, the statutory remuneration statement that Hong Kong employers are required to issue to employees. It provides a programmatic layer that assembles the earning, deduction, liability, and leave components needed to render that statement, and it also exposes general balance retrieval routines consumed by other payroll reporting objects. The package is declared AUTHID CURRENT_USER, meaning its SQL executes with the privileges of the invoking schema rather than the definer.

The header comment (pyhksoe.pkh 120.2.12010000.1, shipped 2008/07/27) and the embedded bug references (Bug 4210525, Bug 5396046) indicate the package has been maintained across multiple release cycles and is present in both 12.1.1 and 12.2.2. It is classified as OTHER in the ETRM API registry and is referenced by four other packages.

Key Procedures and Functions

The package exposes twelve documented procedures and functions:

  • GET_BALANCE_ID — Returns the defined balance identifier corresponding to a supplied balance name and balance dimension name. It resolves the logical balance definition used by the subsequent retrieval routines.
  • BALANCE_TOTALS — Returns aggregate figures for a given assignment action and tax unit, including earnings, deductions, net pay, direct payments, and total payments, each split between this-pay and year-to-date values.
  • BUSINESS_CURRENCY_CODE — Returns the business group's operating currency code by resolving the business group identifier against the currencies table.
  • GET_EARNINGS — Returns the SQL statement that drives the Earnings region of the Statement of Earnings.
  • GET_DEDUCTIONS — Returns the SQL statement that populates the Deductions region.
  • GET_EMPLOYER_LIABILITIES — Returns SQL for the employer liability region of the statement.
  • GET_BALANCES — Returns SQL that retrieves balance values for the statement; this is the routine most commonly referenced by external callers searching for balance-level reporting logic.
  • GET_PAYMENT_METHODS — Returns SQL covering payment method detail.
  • GET_OTHER_ELEMENT_INFORMATION — Returns SQL for supplementary element-level detail.
  • GET_OTHER_BALANCE_INFORMATION — Returns SQL for additional balance information beyond the primary balance set.
  • GET_ANNUAL_LEAVE_INFO — Returns SQL describing annual leave entitlement and accrual information.
  • GET_LEAVE_TAKEN — Returns SQL describing leave actually taken during the period.

Two package-level globals, g_def_bal_id_populated_payment and g_def_bal_id_populated_ytd, were added under Bug 4210525 to cache balance identifier population state.

Tables Accessed

The package reads the following tables through APPS synonyms: PAY_ASSIGNMENT_ACTIONS (assignment action and tax unit context), PAY_BALANCE_TYPES and PAY_BALANCE_DIMENSIONS (balance name and dimension resolution for GET_BALANCE_ID), PAY_DEFINED_BALANCES (defined balance identifiers), FND_CURRENCIES (currency code lookup), HR_ORGANIZATION_INFORMATION and HR_ORGANIZATION_UNITS (business group detail), PAY_ELEMENT_TYPES_F and PAY_ELEMENT_LINKS_F (element definition and eligibility), PAY_ELEMENT_ENTRIES_F (element entry values), PAY_ACCRUAL_PLANS (leave accrual definitions), PAY_ACTION_INTERLOCKS, and PAY_PAYROLL_ACTIONS (payroll run and action context).

Usage Notes

PAY_HK_SOE_PKG is principally invoked by the Hong Kong Statement of Earnings report output and by the functional forms or concurrent programs that generate it. Because several functions return SQL text rather than result sets, they are designed to be embedded into dynamically constructed report queries rather than called for direct data retrieval. GET_BALANCE_ID and BALANCE_TOTALS are the most reusable entry points for custom code that needs balance identifiers or aggregate pay figures. The package is referenced by four other packages, so changes to its public signatures carry downstream impact across the Hong Kong payroll localization. Customizations should treat the package as a reporting utility rather than as a data-maintenance API; none of the documented routines write to payroll tables.