Search Results get_last_working_day




Overview

APPS.PAY_FR_SCHEDULE_CALCULATION is a PL/SQL package in the Oracle E-Business Suite Payroll module, declared with AUTHID CURRENT_USER and last modified under header pyfrwktm.pkh. The "FR" prefix indicates it belongs to the French localization of Oracle Payroll. Its business function is to resolve an employee assignment's work schedule into concrete calendar figures over a requested date range: the number of scheduled working days and hours, holiday days, and protected (non-working or absence-excluded) days. It also exposes helper functions to walk a schedule forward and backward to find the last and next working day, honouring an optional limit date.

These calculations are central to French payroll processing, where statutory absence payments, holiday pay, and time-related entitlements must be derived from the assignment's working calendar rather than from a flat five-day assumption. The package therefore acts as a schedule engine consumed by other payroll routines rather than a standalone process.

Key Procedures and Functions

  • INITIALISE — Sets up the working context for a given assignment and effective date, priming the package for subsequent schedule calculations.
  • DERIVE_SCHEDULE — Derives the actual schedule for an assignment across a supplied start and end date, producing the daily work pattern used by the remaining functions.
  • HOLIDAY_DAYS — Returns the number of holiday days falling within the period for the assignment, drawing on holiday and absence data.
  • PROTECTED_DAYS — Returns the count of protected days within the period, typically days shielded from being treated as absence or otherwise granted special payroll treatment.
  • SCHEDULED_WORKING_DAYS — The function associated with the search term "scheduled_working_days". It returns the number of days the assignment is scheduled to work between the given start and end dates, evaluated at the effective date. This is the core figure used to pro-rate pay and absence entitlements.
  • SCHEDULED_WORKING_HOURS — Returns the corresponding scheduled working hours over the same period, complementing the day count where hourly precision is required.
  • GET_LAST_WORKING_DAY — Given a date, returns the most recent working day on or before it, with an optional limit date bounding the search.
  • GET_NEXT_WORKING_DAY — Given a date, returns the next working day on or after it, likewise bounded by an optional limit date.

Tables Accessed

The package reads assignment and schedule definitions from PER_ALL_ASSIGNMENTS_F and derives work patterns from the user-defined table structures PAY_USER_TABLES, PAY_USER_COLUMNS, PAY_USER_ROWS_F and PAY_USER_COLUMN_INSTANCES_F, with HR_SOFT_CODING_KEYFLEX supplying key flexfield context. Holiday determination draws on PER_STANDARD_HOLIDAYS, PER_STD_HOLIDAY_ABSENCES, PER_ABSENCE_ATTENDANCES and PER_ABSENCE_ATTENDANCE_TYPES. PER_SHARED_TYPES resolves shared lookup definitions, and PLITBLM is the standard Payroll PL/SQL index-by table used for in-memory collections during processing. All are referenced through APPS synonyms.

Usage Notes

This is an internal localization package (API classification OTHER) and is not referenced by any other documented package in the ETRM set, indicating it is invoked from French payroll form logic, concurrent processes or supplementary localization code rather than exposed as a public integration API. Custom code should not call it directly where a documented public API exists; where schedule day or hour counts are required for French payroll, the supported entry point is the localization routine that already wraps these functions. The metadata records no outbound dependencies from other packages, so callers should treat it as a leaf utility and respect the effective-date parameter, which controls the assignment version used for all calculations.