Search Results standard_hours_worked




Overview

PAY_CALC_HOURS_WORKED is an Oracle Payroll PL/SQL package body owned by APPS that provides a standardized method for deriving hours worked over a given date range. Its primary business purpose is to support payroll calculations that depend on the number of hours an employee is expected to have worked (standard hours) or actually worked, rather than relying solely on assignment-level salary or rate information. The package was originally introduced in 2005 (bug 4338404) to deliver new functionality for calculating hours worked, and was subsequently refined to remove the dependency on a legislation code being explicitly passed as a parameter, thereby supporting international localizations. A later revision (bug 8414024, 2009) modified the dynamic function call and logic used within CALCULATE_ACTUAL_HOURS_WORKED.

Standard hours calculation is important in Oracle Payroll because many elements and payroll formulas need to pro-rate pay, validate timecard input, or compute overtime on the basis of a notional working day, week, month, or year. Rather than hard-coding five working days per week, the package encapsulates this logic so that payroll formulas and fast formulas can call a single, consistent source of truth. The package is classified under ETRM as OTHER, meaning it is not a public Oracle HRMS API with a formal API contract, but a utility package used internally by payroll processing logic.

Key Procedures and Functions

Two documented procedures/functions are exposed by this package body:

  • STANDARD_HOURS_WORKED — Returns the number of standard hours that fall within a supplied date range, based on a standard hours value and a standard frequency. The function accounts for daily, weekly, monthly, or annual frequency conventions, translating the supplied standard hours into the notional hours applicable to the specified start and end dates. It initializes constants representing five working days per week, twenty working days per month, and two hundred and fifty working days per year, and validates that the start of the range precedes the end of the range. This is the function most directly relevant to the user search term "standard_hours_worked".
  • CALCULATE_ACTUAL_HOURS_WORKED — Complements STANDARD_HOURS_WORKED by determining the actual hours worked, generally derived from assignment and time information, over a comparable period. Its internal logic was revised in 2009 to use a modified dynamic function call, allowing localization-specific routines to be invoked. It is used where the requirement is to compare actual time worked against standard expected time.

Tables Accessed

The package references the following tables through APPS synonyms:

  • PER_ALL_ASSIGNMENTS_F — The core assignment table, read to obtain assignment-level context such as the assignment's effective dates, employment category, and standard working conditions associated with the person and payroll. It provides the driver rows over which hours worked are evaluated.
  • HR_ORGANIZATION_INFORMATION — Read to retrieve organization-level attributes (for example, legislation or business group related configuration) that affect the standard working pattern or localization rules applied when calculating hours.

No other tables are documented as being referenced. The package does not maintain persistent data of its own; it is a read-only calculation utility.

Usage Notes

PAY_CALC_HOURS_WORKED is typically invoked from within payroll processing — specifically from payroll formulas, fast formulas, or element processing logic that requires a computed hours figure. Because STANDARD_HOURS_WORKED and CALCULATE_ACTUAL_HOURS_WORKED are packaged in the APPS schema, they may be called from custom PL/SQL, concurrent program wrappers, or user hooks in Oracle Forms where developers need to reproduce the same standard working-day conventions used by seeded payroll functionality. The package is not referenced by any other packaged API per the documented dependency map, so it functions as a leaf-level utility rather than a shared framework component.

Developers should be aware that the package is an internal Oracle utility, not a formally supported public API. It should not be relied upon as a stable interface across releases without verification against the target environment. When the legislation code is not passed explicitly, the package resolves it internally, which supports international deployments but may be sensitive to session context such as business group. Where custom logic is required, calling STANDARD_HOURS_WORKED is preferable to re-implementing the working-day constants, ensuring consistency with seeded payroll behavior across daily, weekly, monthly, and annual frequency definitions.