67% found this document useful (3 votes)
1K views

Get Pay Availability

This formula returns the duration of availability from an HR assignment by calling the Core HR Availability API. It passes parameters like the assignment ID, start and end dates, and calculates the hours worked based on the entry level and work schedule. The formula was initially created in 2011 and has since been updated to support additional HR APIs and fix bugs.

Uploaded by

Dhina Karan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
67% found this document useful (3 votes)
1K views

Get Pay Availability

This formula returns the duration of availability from an HR assignment by calling the Core HR Availability API. It passes parameters like the assignment ID, start and end dates, and calculates the hours worked based on the entry level and work schedule. The formula was initially created in 2011 and has since been updated to support additional HR APIs and fix bugs.

Uploaded by

Dhina Karan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

/*******************************************************************************

* *
* FORMULA NAME: GET_PAY_AVAILABILITY *
* *
* FORMULA TYPE: Payroll Access to HR *
* *
* DESCRIPTION: This formula will return the Duration from Availability *
* *
* *
* Change History *
* --------------- *
* *
* Who Date Description *
* ---------- ---------- -------------------------------------- *
* Nprasath 10-Mar-11 Created *
* vdharmap Oct-2012 added a day to end date to cover for midnight and
* missing day
*
* vdharmap 13-Nov-2013 Bug 17790639 - UPTAKE WORK SCHEDULE API ENHANCEMENT IN
GLOBAL PAYROLL FORMULA
* *
* *
********************************************************************************/
DEFAULT FOR ENTRY_LEVEL IS 'AP'
Inputs are
actual_start_date (date),
actual_end_date (date),
unit_type (text),
hr_assign_id,
entry_level(text)

l_log = PAY_INTERNAL_LOG_WRITE('(GLBEARN) Inside Formula GET PAY AVAILABILITY ')


l_hr_assignment_id = hr_assign_id
l_entry_level=entry_level
l_actual_end_date = add_days(actual_end_date,1) /* since it 12:00 am, adding a
day i.e 24hrs to get correct hours */
l_log = PAY_INTERNAL_LOG_WRITE('(GLBEARN) Inside Formula GET PAY AVAILABILITY -
entry level' || l_entry_level)
l_default_hours_per_day = 8

/* Call to Core HR Availability API to get the actual number of Hours Worked

Parameters passed:
-----------------
p_resource_id => Assignment Id or Term Id from context
p_resource_type default ASSIGN or EMPTERM_AGGR
p_period_start Period Start
p_period_end Period End
p_use_sch_asg DEFAULT 'Y'
p_use_sch_inh DEFAULT 'Y'
p_include_noshift DEFAULT 'N'
p_include_calevents DEFAULT 'Y'
p_calc_units DEFAULT 'H'
-- added params below after HR enh, bug 17790639 --
p_get_full_pay_period DEFAULT 'N'
p_use_working_hour_method DEFAULT 'N'
p_default_hours_per_day DEFAULT 0
p_default_start_time DEFAULT '8:30' -- The format of time is
'hh24:mi'
p_default_work_week DEFAULT '0-1-1-1-1-1-0' -- work week starting
from Sunday

*/

l_log = PAY_INTERNAL_LOG_WRITE('(GLBEARN) HR_ASSIGNMENT_ID : '||


TO_CHAR(l_hr_assignment_id))
l_log = PAY_INTERNAL_LOG_WRITE('(GLBEARN) actual_start_date : '||
To_CHAR(actual_start_date))
l_log = PAY_INTERNAL_LOG_WRITE('(GLBEARN) actual_end_date : '||
TO_CHAR(l_actual_end_date))

CHANGE_CONTEXTS (HR_ASSIGNMENT_ID = l_hr_assignment_id)


(
l_units = 0
l_log = PAY_INTERNAL_LOG_WRITE('(GLBEARN) HR_ASSIGNMENT_ID '||
TO_CHAR(l_hr_assignment_id))
IF (l_entry_level = 'AP' or ENTRY_LEVEL = 'PT' ) THEN
(
l_resource_type = 'EMPTERM_AGGR'
)
ELSE IF (l_entry_level = 'PA' ) THEN
(
l_resource_type = 'ASSIGN'
)
l_log = PAY_INTERNAL_LOG_WRITE('(GLBEARN) RESOURCE_TYPE '|| l_resource_type)

l_units =
GET_PAY_AVAILABILITY( l_resource_type,actual_start_date,l_actual_end_date,'Y','Y','
N','N',unit_type,'Y','Y',l_default_hours_per_day,'8:30','0-1-1-1-1-1-0')
l_log = PAY_INTERNAL_LOG_WRITE('(GLBEARN) UNITS '||TO_CHAR(l_units))
)
return l_units

You might also like