This topic provides four sample accrual formulas for calculating the employee's holiday entitlements as required for the Hungarian Absence Report. You can record and report the entitlement amounts for the following holiday types:
Base Holiday
Additional holiday for bringing up children
Other Additional Holiday
Sickness Holiday
The following table lists the sample accrual formulas that you can use, as supplied, or use them as models to create your own, incorporating the rules required for your accrual plans.
Holiday Type | Formula | Description |
---|---|---|
Base Holiday | HU_BASE_HOLIDAY MULTIPLIER | This formula calculates the accrual rate for base holiday in a specific period. See: Sample Formula for Base Holiday |
Additional Holiday for bringing up children | HU_ADD_CHILD_CARE_HOLIDAY_MULTIPLIER | This formula calculates the Additional Holiday for bringing up children. See: Sample Formula for Additional Holiday |
Other Additional Holiday | HU_OTHER_ADD_HOLIDAY_MULTIPLIER | This formula calculates the Other Additional Holiday such as Youthful holiday and Additional Health Holiday. See: Sample Formula for Other Additional Holiday |
Sickness Holiday | HU_SICKNESS_HOLIDAY_MULTIPLIER | This formula calculates the Sickness Holiday. See: Sample Formula for Sickness Holiday |
You can use the Carry Over Formula, HU_ABS_CARRYOVER_FORMULA to calculate any carry over for the above holiday entitlements. See: Sample Formula for Carry Over Absence
Oracle HRMS provides the HU_BASE_HOLIDAY MULTIPLIER sample formula to calculate the accrual rate for Base Holiday in a specific period as required for the Hungarian Absence Report. The sample formula is for an accrual plan with the following rules:
Entitlement for Base Holiday depends on the employee's age.
Entitlement depends on the number of days worked in a week and takes in to account any work pattern changes within the leave year.
Base holiday for new hires begins on their hire date.
The formula calculates proportionately if the employee's birthday falls within the current year.
The following table lists the Base Holiday entitlements for employees based on their age and a five day work pattern.
Employee's Age | Base Holiday entitlement |
---|---|
Until age 24 | 20 working days holiday |
From age 25 | 21 working days holiday |
From age 28 | 22 working days holiday |
From age 31 | 23 working days holiday |
From age 33 | 24 working days holiday |
From age 35 | 25 working days holiday |
From age 37 | 26 working days holiday |
From age 39 | 27 working days holiday |
From age 41 | 28 working days holiday |
From age 43 | 29 working days holiday |
From age 45 | 30 working days holiday |
The following formula HU_BASE_HOLIDAY MULTIPLIER considers the employee's age and a five-day work pattern for employees to calculate the Base Holiday entitlement. The HU_BASE_HOLIDAY MULTIPLIER formula repeatedly calls another formula in a loop, HU_BASE_HOLIDAY_PERIOD_ACCRUAL to calculate the accrual for each period. You use the above formulas along with the carry over formula HU_ABS_HOLIDAY_CARRY_OVER. See: Sample Formula for Carry Over Absence
The top-level formula HU_BASE_HOLIDAY_MULTIPLIER and the looping formula HU_BASE_HOLIDAY_PERIOD_ACCRUAL are given below.
/* ------------------------------------------------------------------- NAME : HU_BASE_HOLIDAY_MULTIPLER This formula calculates the total accrued base holiday for a specific period ------------------------------------------------------------------*/ DEFAULT FOR ACP_INELIGIBILITY_PERIOD_TYPE IS 'CM' DEFAULT FOR ACP_INELIGIBILITY_PERIOD_LENGTH IS 0 DEFAULT FOR ACP_CONTINUOUS_SERVICE_DATE IS '4712/12/31 00:00:00' (date) DEFAULT FOR ACP_ENROLLMENT_END_DATE IS '4712/12/31 00:00:00' (date) DEFAULT FOR ACP_TERMINATION_DATE IS '4712/12/31 00:00:00' (date) DEFAULT FOR ACP_ENROLLMENT_START_DATE IS '4712/12/31 00:00:00' (date) DEFAULT FOR ACP_SERVICE_START_DATE IS '4712/12/31 00:00:00' (date) INPUTS ARE Calculation_Date (date) Accruing_Frequency = ' ' Accruing_Multiplier = 0 E = SET_DATE('CALCULATION_DATE',Calculation_Date) /* ------------------------------------------------------------------- Set the payroll period, accruing frequency, and accruing multiplier based on the payroll. -----------------------------------------------------------------*/ Payroll_period = HU_PAYROLL_PERIODS(Calculation_Date ,Accruing_Frequency ,Accruing_Multiplier) E = SET_TEXT('ACCRUING_FREQUENCY', Accruing_Frequency) E = SET_NUMBER('ACCRUING_MULTIPLIER', Accruing_Multiplier) Beginning_Of_Calculation_Year = TO_DATE('0101'||TO_CHAR(Calculation_Date,'YYYY') ,'DDMMYYYY') IF Beginning_Of_Calculation_Year > Calculation_Date THEN ( Beginning_of_Calculation_Year = ADD_MONTHS(Beginning_Of_Calculation_Year, -12) ) /* ------------------------------------------------------------------- Set the start and end dates of the first accrual period in the calculation year ------------------------------------------------------------------*/ E = SET_DATE('BEGINNING_OF_CALCULATION_YEAR' , Beginning_Of_Calculation_Year) E = GET_PERIOD_DATES(Beginning_of_Calculation_Year, Accruing_Frequency, Beginning_Of_Calculation_Year, Accruing_Multiplier) First_Period_SD = GET_DATE('PERIOD_START_DATE') First_Period_ED = GET_DATE('PERIOD_END_DATE') /* ------------------------------------------------------------------- Set the Calculation_Date to the Termination Date if not null -----------------------------------------------------------------*/ IF NOT (ACP_TERMINATION_DATE WAS DEFAULTED) OR NOT (ACP_ENROLLMENT_END_DATE WAS DEFAULTED) THEN ( Early_End_Date = least(ACP_TERMINATION_DATE, ACP_ENROLLMENT_END_DATE) IF (Early_End_Date < Calculation_Date) THEN ( Calculation_Date = Early_End_Date ) ) /* ------------------------------------------------------------------- Get the last whole period prior to the Calculation_Date and ensure that it is within the year (if the Calculation_Date is the end of a period then use that period) -----------------------------------------------------------------*/ E = GET_PERIOD_DATES(Calculation_Date ,Accruing_Frequency ,Beginning_of_Calculation_Year ,Accruing_Multiplier) Calculation_Period_SD = GET_DATE('PERIOD_START_DATE') Calculation_Period_ED = GET_DATE('PERIOD_END_DATE') /* ------------------------------------------------------------------- Set the Continuous Service Global Variable, whilst also ensuring that the continuous service date is before the Calculation Period ------------------------------------------------------------------*/ IF (ACP_CONTINUOUS_SERVICE_DATE WAS DEFAULTED) THEN ( E = SET_DATE('CONTINUOUS_SERVICE_DATE', ACP_SERVICE_START_DATE) ) ELSE IF(ACP_CONTINUOUS_SERVICE_DATE > Calculation_Period_SD) THEN ( E = SET_DATE('CONTINUOUS_SERVICE_DATE' , ACP_CONTINUOUS_SERVICE_DATE) ) ELSE ( E = SET_DATE('CONTINUOUS_SERVICE_DATE' , ACP_CONTINUOUS_SERVICE_DATE) ) Continuous_Service_Date = GET_DATE('CONTINUOUS_SERVICE_DATE') First_Eligible_To_Accrue_Date = Continuous_Service_Date /*-------------------------------------------------------------------- Determine the date on which accrued PTO may first be registered, i.e. the date on which the Ineligibility Period expires -----------------------------------------------------------------*/ Accrual_Ineligibility_Expired_Date = First_Eligible_To_Accrue_Date IF (ACP_INELIGIBILITY_PERIOD_LENGTH > 0) THEN ( IF ACP_INELIGIBILITY_PERIOD_TYPE = 'BM' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date, ACP_INELIGIBILITY_PERIOD_LENGTH*2) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'F' THEN ( Accrual_Ineligibility_Expired_Date = ADD_DAYS(Continuous_Service_Date, ACP_INELIGIBILITY_PERIOD_LENGTH*14) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'CM' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date, ACP_INELIGIBILITY_PERIOD_LENGTH) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'LM' THEN ( Accrual_Ineligibility_Expired_Date = ADD_DAYS(Continuous_Service_Date, ACP_INELIGIBILITY_PERIOD_LENGTH*28) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'Q' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date, ACP_INELIGIBILITY_PERIOD_LENGTH*3) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'SM' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date, ACP_INELIGIBILITY_PERIOD_LENGTH/2) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'SY' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date, ACP_INELIGIBILITY_PERIOD_LENGTH*6) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'W' THEN ( Accrual_Ineligibility_Expired_Date = ADD_DAYS(Continuous_Service_Date, ACP_INELIGIBILITY_PERIOD_LENGTH*7) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'Y' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date, ACP_INELIGIBILITY_PERIOD_LENGTH*12) ) IF Accrual_Ineligibility_Expired_Date > First_Eligible_To_Accrue_Date AND Calculation_Date < Accrual_Ineligibility_Expired_Date THEN ( First_Eligible_To_Accrue_Date = Accrual_Ineligibility_Expired_Date ) ) /* ------------------------------------------------------------------- Get the first full period following the First_Eligible_To_Accrue_Date (if it falls on the beginning of the period then use that period) --------------------------------------------------------------------*/ IF First_Eligible_To_Accrue_Date > Beginning_Of_Calculation_Year THEN ( E = GET_PERIOD_DATES(First_Eligible_To_Accrue_Date ,Accruing_Frequency ,Beginning_Of_Calculation_Year ,Accruing_Multiplier) First_Eligible_To_Accrue_Period_SD = GET_DATE('PERIOD_START_DATE') First_Eligible_To_Accrue_Period_ED = GET_DATE('PERIOD_END_DATE') IF (First_Eligible_To_Accrue_Period_SD > Calculation_Period_ED) THEN ( Total_Accrued_PTO = 0 E = PUT_MESSAGE('HR_52793_PTO_FML_ASG_INELIG') ) ) ELSE ( First_Eligible_To_Accrue_Period_SD = First_Period_SD First_Eligible_To_Accrue_Period_ED = First_Period_ED ) /* ------------------------------------------------------------------- Determine the date on which PTO actually starts accruing based on Hire Date, Continuous Service Date and Plan Enrollment Start Date. -------------------------------------------------------------------*/ IF Continuous_Service_date = ACP_CONTINUOUS_SERVICE_DATE THEN ( Actual_Accrual_Start_Date = Continuous_service_Date ) ELSE ( Actual_Accrual_Start_Date = GREATEST(Continuous_Service_Date, ACP_ENROLLMENT_START_DATE, First_Period_SD) ) /* ------------------------------------------------------------------- Determine the actual start date and end date of the first accrual period to use in the accrual calculation. Get the start date and end dates of the accrual period in which the Actual Accrual Start Date falls. -----------------------------------------------------------------*/ IF (Actual_Accrual_Start_Date > First_Period_SD AND Actual_Accrual_Start_Date > First_Eligible_To_Accrue_Period_SD) THEN ( E = GET_PERIOD_DATES(Actual_Accrual_Start_Date, Accruing_Frequency, Beginning_Of_Calculation_Year, Accruing_Multiplier) Accrual_Start_Period_SD = GET_DATE('PERIOD_START_DATE') Accrual_Start_Period_ED = GET_DATE('PERIOD_END_DATE') /* ------------------------------------------------------------------- If the Actual Accrual Period is after the Calculation Period then end the processing. -----------------------------------------------------------------*/ IF (Accrual_Start_Period_SD > Calculation_Period_ED) THEN ( Total_Accrued_PTO = 0 E = PUT_MESSAGE('HR_52797_PTO_FML_ACT_ACCRUAL') ) ) ELSE IF (First_Eligible_To_Accrue_Period_SD > First_Period_SD) THEN ( Accrual_Start_Period_SD = First_Eligible_To_Accrue_Period_SD Accrual_Start_Period_ED = First_Eligible_To_Accrue_Period_ED ) ELSE ( Accrual_Start_Period_SD = First_Period_SD Accrual_Start_Period_ED = First_Period_ED ) /* ------------------------------------------------------------------ Now set up the information that will be used in when looping through the periods and call the accrual sub formula. ----------------------------------------------------------------*/ IF Calculation_Period_ED >= Accrual_Start_Period_ED THEN ( E = set_date('PERIOD_SD',Accrual_Start_Period_SD) E = set_date('PERIOD_ED',Accrual_Start_Period_ED) E = set_date('LAST_PERIOD_SD',Calculation_Period_SD) E = set_date('LAST_PERIOD_ED',Calculation_Period_ED) E = set_number('TOTAL_ACCRUED_PTO',0) E = LOOP_CONTROL('HU_BASE_HOLIDAY_PERIOD_ACCRUAL') Total_Accrued_PTO = ROUND(get_number('TOTAL_ACCRUED_PTO')) ) IF Accrual_Start_Period_SD <= Calculation_Period_SD THEN ( Accrual_end_date = Calculation_Period_ED ) Effective_Start_Date = Accrual_Start_Period_SD Effective_End_Date = Calculation_Period_ED IF Effective_Start_Date >= Effective_End_Date THEN ( Effective_Start_Date = Effective_End_Date ) RETURN Total_Accrued_PTO ,Effective_start_date ,Effective_end_date ,Accrual_end_date
Looping Formula
/* ------------------------------------------------------------------- NAME : HU_BASE_HOLIDAY_PERIOD_ACCRUAL This formula calculates the number of base holiday accrued for a particular period. ------------------------------------------------------------------*/ /*-------------------------------------------------------------------- Get the global variable to be used in this formula ------------------------------------------------------------------*/ DEFAULT FOR ACP_TERMINATION_DATE IS '4712/12/31 00:00:00' (date) DEFAULT FOR EMP_HIRE_DATE IS '4712/12/31 00:00:00' (date) DEFAULT FOR person_dob IS '4712/12/31 00:00:00' (date) Continuous_Service_Date = GET_DATE('CONTINUOUS_SERVICE_DATE') Total_Accrued_PTO = GET_NUMBER('TOTAL_ACCRUED_PTO') Period_SD = GET_DATE('PERIOD_SD') Period_ED = GET_DATE('PERIOD_ED') Last_Period_SD = GET_DATE('LAST_PERIOD_SD') Last_Period_ED = GET_DATE('LAST_PERIOD_ED') Accruing_Frequency = GET_TEXT('ACCRUING_FREQUENCY') Accruing_Multiplier = GET_NUMBER('ACCRUING_MULTIPLIER') Beginning_of_Calculation_Year = GET_DATE('BEGINNING_OF_CALCULATION_YEAR') Calculation_Date = GET_DATE('CALCULATION_DATE') Accrual_Rate = 0 /* ------------------------------------------------------------------- Get the person date of birth and compute the age. -----------------------------------------------------------------*/ Person_dob = HU_PERSON_DOB(Calculation_Date) Age = FLOOR(MONTHS_BETWEEN(Period_ED,Person_dob)/12) /* ------------------------------------------------------------------- Set the payroll period, accruing frequency and accruing multiplier based on the payroll. -----------------------------------------------------------------*/ Payroll_period = HU_PAYROLL_PERIODS(Calculation_Date ,Accruing_Frequency ,Accruing_Multiplier) /* ------------------------------------------------------------------- Set period start date and period end date as employee hire date and employee termination date if the hire date and termination date falls with in the calculation period. -----------------------------------------------------------------*/ IF EMP_HIRE_DATE > Period_SD AND EMP_HIRE_DATE < Period_ED THEN Period_SD = EMP_HIRE_DATE IF ACP_TERMINATION_DATE > Period_SD AND ACP_TERMINATION_DATE < Period_ED THEN Period_ED = ACP_TERMINATION_DATE DOB = TO_DATE(TO_CHAR(Person_dob,'DD/MM/') ||TO_CHAR(PERIOD_SD,'YYYY'),'DD/MM/YYYY') /* ------------------------------------------------------------------- Set the accrual rate based on the age of the employee and on five day work pattern. -----------------------------------------------------------------*/ IF (DOB >= PERIOD_SD AND DOB <= PERIOD_ED) AND (AGE = 25 OR AGE = 28 OR AGE = 31 OR AGE = 33 OR AGE = 35 OR AGE = 37 OR AGE = 39 OR AGE = 41 OR AGE = 43 OR AGE = 45) THEN ( X = HU_ABS_GET_WORKING_DAYS(PERIOD_SD,ADD_DAYS(DOB,-1)) Y = HU_ABS_GET_WORKING_DAYS(DOB,Period_ED) IF Age = 25 THEN Accrual_Rate = ((20/260)* X +(21/260)* Y) ELSE IF Age = 28 THEN Accrual_Rate = ((21/260)* X +(22/260)* Y) ELSE IF Age = 31 THEN Accrual_Rate = ((22/260)* X +(23/260)* Y) ELSE IF Age = 33 THEN Accrual_Rate = ((23/260)* X +(24/260)* Y) ELSE IF Age = 35 THEN Accrual_Rate = ((24/260)* X +(25/260)* Y) ELSE IF Age = 37 THEN Accrual_Rate = ((25/260)* X +(26/260)* Y) ELSE IF Age = 39 THEN Accrual_Rate = ((26/260)* X +(27/260)* Y) ELSE IF Age = 41 THEN Accrual_Rate = ((27/260)* X +(28/260)* Y) ELSE IF Age = 43 THEN Accrual_Rate = ((28/260)* X +(29/260)* Y) ELSE IF Age = 45 THEN Accrual_Rate = ((29/260)* X +(30/260)* Y) ) ELSE ( X = HU_ABS_GET_WORKING_DAYS(PERIOD_SD,PERIOD_ED) IF Age <= 24 THEN Accrual_Rate = ((20/260)*X) ELSE IF (Age >= 25 AND Age < 28) THEN Accrual_Rate = ((21/260)*X) ELSE IF (Age >= 28 AND Age < 31) THEN Accrual_Rate = ((22/260)*X) ELSE IF (Age >= 31 AND Age < 33) THEN Accrual_Rate = ((23/260)*X) ELSE IF (Age >= 33 AND Age < 35) THEN Accrual_Rate = ((24/260)*X) ELSE IF (Age >= 35 AND Age < 37) THEN Accrual_Rate = ((25/260)*X) ELSE IF (Age >= 37 AND Age < 39) THEN Accrual_Rate = ((26/260)*X) ELSE IF (Age >= 39 AND Age < 41) THEN Accrual_Rate = ((27/260)*X) ELSE IF (Age >= 41 AND Age < 43) THEN Accrual_Rate = ((28/260)*X) ELSE IF (Age >= 43 AND Age < 45) THEN Accrual_Rate = ((29/260)*X) ELSE Accrual_Rate = ((30/260)*X) ) Period_Accrued_PTO = Accrual_Rate E = SET_NUMBER('TOTAL_ACCRUED_PTO', Total_Accrued_PTO +Period_Accrued_PTO) /* ------------------------------------------------------------------- Establish whether the current period is the last one, if so end the processing, otherwise get the next period. -----------------------------------------------------------------*/ IF Period_SD >= Last_Period_SD THEN ( Continue_Processing_Flag = 'N' ) ELSE ( E = GET_PERIOD_DATES(ADD_DAYS(Period_ED,1), Accruing_Frequency, Beginning_of_Calculation_Year, Accruing_Multiplier) E = SET_DATE('PERIOD_SD', GET_DATE('PERIOD_START_DATE')) E = SET_DATE('PERIOD_ED', GET_DATE('PERIOD_END_DATE')) Continue_Processing_Flag = 'Y' ) Return Continue_Processing_Flag
Oracle HRMS provides the HU_ADD_CHILD_CARE_HOLIDAY_MULTIPLIER sample formula to calculate the accrual rate for Additional Holiday for bringing up children in a specific period as required for the Hungarian Absence Report. The sample formula is for an accrual plan with the following rules:
Entitlement depends on the age and number of children (given in the table below)
Both parents work and share the entitlement. This eligibility is based on the value in the Holiday for Child Care field in the Further Contact Relationship Info on the Contact window.
Additional Holiday for bringing up children for new hires depends on Hire Date.
Entitlement begins from the birth date of the child, if a child is born during the leave year.
The following table lists the Additional Holiday entitlements for employees based on the number of children.
Number of Children | Additional Holiday entitlement |
---|---|
After 1 child | 2 working days |
After 2 children | 4 working days |
After more than 2 children | 7 working days |
The HU_ADD_CHILD_CARE_HOLIDAY_MULTIPLIER formula calls another formula HU_ADD_CHILD_CARE_HOLIDAY_PERIOD_ACCRUALcalculate the accrual for each period. You use the sample formulas along with the carry over formula HU_ABS_HOLIDAY_CARRY_OVER. See: Sample Formula for Carry Over Absence
The sample HU_ADD_CHILD_CARE_HOLIDAY_MULTIPLIER and the looping HU_ADD_CHILD_CARE_HOLIDAY_PERIOD_ACCRUAL formula are given below:
/* ------------------------------------------------------------------- NAME : HU_ADD_CHILD_CARE_HOLIDAY_MULTIPLIER This formula calculates the total accrued additional child care holiday for a specific period. -----------------------------------------------------------------*/ DEFAULT FOR ACP_INELIGIBILITY_PERIOD_TYPE IS 'CM' DEFAULT FOR ACP_INELIGIBILITY_PERIOD_LENGTH IS 0 DEFAULT FOR ACP_CONTINUOUS_SERVICE_DATE IS '4712/12/31 00:00:00'(DATE) DEFAULT FOR ACP_ENROLLMENT_END_DATE IS '4712/12/31 00:00:00' (DATE) DEFAULT FOR ACP_TERMINATION_DATE IS '4712/12/31 00:00:00' (DATE) DEFAULT FOR ACP_ENROLLMENT_START_DATE IS '4712/12/31 00:00:00' (DATE) DEFAULT FOR ACP_SERVICE_START_DATE IS '4712/12/31 00:00:00' (DATE) INPUTS ARE Calculation_Date (DATE) Accruing_Frequency = ' ' Accruing_Multiplier = 0 /* ------------------------------------------------------------------- Set the payroll period, accruing frequency, and accruing multiplier based on the payroll. -----------------------------------------------------------------*/ No_of_Payroll_Periods = HU_PAYROLL_PERIODS (Calculation_Date ,Accruing_Frequency ,Accruing_Multiplier) E = SET_TEXT('ACCRUING_FREQUENCY', Accruing_Frequency) E = SET_NUMBER('ACCRUING_MULTIPLIER', Accruing_Multiplier) /* ------------------------------------------------------------------- Calculate the start and end dates of the current leave year. ------------------------------------------------------------------*/ Beginning_Of_Calculation_Year=TO_DATE('0101'||to_char(Calculation_Date ,'YYYY'),'DDMMYYYY') End_Of_Calculation_Year = TO_DATE('3112'||to_char(Calculation_Date ,'YYYY'),'DDMMYYYY') /* ------------------------------------------------------------------- Set the start and end dates of the first accrual period in the calculation year. ------------------------------------------------------------------*/ IF Beginning_Of_Calculation_Year > Calculation_Date THEN ( Beginning_of_Calculation_Year = ADD_MONTHS(Beginning_Of_Calculation_Year, -12) ) E = SET_DATE('BEGINNING_OF_CALCULATION_YEAR' ,Beginning_Of_Calculation_Year) E = GET_PERIOD_DATES(Beginning_of_Calculation_Year ,Accruing_Frequency ,Beginning_Of_Calculation_Year ,Accruing_Multiplier) First_Period_SD = GET_DATE('PERIOD_START_DATE') First_Period_ED = GET_DATE('PERIOD_END_DATE') E = GET_PERIOD_DATES(End_Of_Calculation_Year ,Accruing_Frequency ,Beginning_Of_Calculation_Year ,Accruing_Multiplier) Last_Period_SD = GET_DATE('PERIOD_START_DATE') Last_Period_ED = GET_DATE('PERIOD_END_DATE') /* ------------------------------------------------------------------- Set the Calculation_Date to the Termination Date if not null -----------------------------------------------------------------*/ IF NOT (ACP_TERMINATION_DATE WAS DEFAULTED) OR NOT (ACP_ENROLLMENT_END_DATE WAS DEFAULTED) THEN ( Early_End_Date = LEAST(ACP_TERMINATION_DATE,ACP_ENROLLMENT_END_DATE) IF (Early_End_Date < First_Period_SD) THEN ( Total_Accrued_PTO = 0 E = PUT_MESSAGE('HR_52794_PTO_FML_ASG_TER') ) IF (Early_End_Date < Last_Period_ED) THEN ( E = GET_PERIOD_DATES(Early_End_Date ,Accruing_Frequency ,Beginning_Of_Calculation_Year ,Accruing_Multiplier) Last_Period_SD = GET_DATE('PERIOD_START_DATE') Last_Period_ED = GET_DATE('PERIOD_END_DATE') ) IF (Early_End_Date < Calculation_Date) THEN ( Calculation_Date = Early_End_Date ) ) /* ------------------------------------------------------------------- Get the last whole period prior to the Calculation Date and ensure that it is within the Year (if the Calculation Date is the End of a Period then use that period) -----------------------------------------------------------------*/ E = GET_PERIOD_DATES(Calculation_Date ,Accruing_Frequency ,Beginning_of_Calculation_Year ,Accruing_Multiplier) Calculation_Period_SD = GET_DATE('PERIOD_START_DATE') Calculation_Period_ED = GET_DATE('PERIOD_END_DATE') IF (Calculation_Period_ED < First_Period_SD) THEN ( Total_Accrued_PTO = 0 E = PUT_MESSAGE('HR_52795_PTO_FML_CALC_DATE') ) /* ------------------------------------------------------------------- Set the Continuous Service Global Variable, whilst also ensuring that the continuous service date is before the Calculation Period ------------------------------------------------------------------*/ IF (ACP_CONTINUOUS_SERVICE_DATE WAS DEFAULTED) THEN ( E = SET_DATE('CONTINUOUS_SERVICE_DATE', ACP_SERVICE_START_DATE) ) ELSE IF(ACP_CONTINUOUS_SERVICE_DATE > Calculation_Period_ED) THEN ( Total_Accrued_PTO = 0 E = PUT_MESSAGE('HR_52796_PTO_FML_CSD') E = SET_DATE('CONTINUOUS_SERVICE_DATE' ,ACP_CONTINUOUS_SERVICE_DATE) ) ELSE IF(ACP_CONTINUOUS_SERVICE_DATE > First_Period_SD) THEN ( E = GET_PERIOD_DATES(ACP_CONTINUOUS_SERVICE_DATE ,Accruing_Frequency ,Beginning_Of_Calculation_Year ,Accruing_Multiplier) First_Period_SD = GET_DATE('PERIOD_START_DATE') First_Period_ED = GET_DATE('PERIOD_END_DATE') ) ELSE ( E = SET_DATE('CONTINUOUS_SERVICE_DATE' , ACP_CONTINUOUS_SERVICE_DATE) ) Continuous_Service_Date = GET_DATE('CONTINUOUS_SERVICE_DATE') First_Eligible_To_Accrue_Date = Continuous_Service_Date /*-------------------------------------------------------------------- Determine the date on which accrued PTo may first be registered, i.e the date on which the Ineligibility Period expires -----------------------------------------------------------------*/ Accrual_Ineligibility_Expired_Date = First_Eligible_To_Accrue_Date IF (ACP_INELIGIBILITY_PERIOD_LENGTH > 0) THEN ( IF ACP_INELIGIBILITY_PERIOD_TYPE = 'BM' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*2) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'F' THEN ( Accrual_Ineligibility_Expired_Date = ADD_DAYS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*14) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'CM' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'LM' THEN ( Accrual_Ineligibility_Expired_Date = ADD_DAYS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*28) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'Q' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*3) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'SM' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH/2) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'SY' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*6) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'W' THEN ( Accrual_Ineligibility_Expired_Date = ADD_DAYS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*7) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'Y' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*12) ) IF Accrual_Ineligibility_Expired_Date > First_Eligible_To_Accrue_Date AND Calculation_Date < Accrual_Ineligibility_Expired_Date THEN ( First_Eligible_To_Accrue_Date = Accrual_Ineligibility_Expired_Date ) ) /* ------------------------------------------------------------------- Get the first full period following the First_Eligible_To_Accrue_Date (if it falls on the beginning of the period then use that period) ------------------------------------------------------------------- */ IF First_Eligible_To_Accrue_Date > Beginning_Of_Calculation_Year THEN ( E = GET_PERIOD_DATES(First_Eligible_To_Accrue_Date ,Accruing_Frequency ,Beginning_Of_Calculation_Year ,Accruing_Multiplier) First_Eligible_To_Accrue_Period_SD = GET_DATE('PERIOD_START_DATE') First_Eligible_To_Accrue_Period_ED = GET_DATE('PERIOD_END_DATE') IF (First_Eligible_To_Accrue_Period_SD > Calculation_period_ED)THEN ( Total_Accrued_PTO = 0 E = PUT_MESSAGE('HR_52793_PTO_FML_ASG_INELIG') ) ) ELSE ( First_Eligible_To_Accrue_Period_SD = First_Period_SD First_Eligible_To_Accrue_Period_ED = First_Period_ED ) /* ------------------------------------------------------------------- Determine the date on which PTO actually starts accruing based on Hire Date, Continuous Service Date and plan Enrollment Start Date. -------------------------------------------------------------------*/ IF Continuous_Service_date = ACP_CONTINUOUS_SERVICE_DATE THEN ( Actual_Accrual_Start_Date = Continuous_service_Date ) ELSE ( Actual_Accrual_Start_Date = GREATEST(Continuous_Service_Date, ACP_ENROLLMENT_START_DATE, First_Period_SD) ) /* ------------------------------------------------------------------- Determine the actual start of the accrual calculation --------------------------------------------------------------------*/ IF (Actual_Accrual_Start_Date > First_Period_SD AND Actual_Accrual_Start_Date > First_Eligible_To_Accrue_Period_SD) THEN ( E = GET_PERIOD_DATES(Actual_Accrual_Start_Date ,Accruing_Frequency ,Beginning_Of_Calculation_Year ,Accruing_Multiplier) Accrual_Start_Period_SD = GET_DATE('PERIOD_START_DATE') Accrual_Start_Period_ED = GET_DATE('PERIOD_END_DATE') /*----------------------------------------------------------------- If the Actual Accrual Period is after the Calculation Period then end the processing. ---------------------------------------------------------------- */ IF (Accrual_Start_Period_SD > Calculation_period_ED) THEN ( Total_Accrued_PTO = 0 E = PUT_MESSAGE('HR_52797_PTO_FML_ACT_ACCRUAL') ) ) ELSE IF (First_Eligible_To_Accrue_Period_SD > First_Period_SD) THEN ( Accrual_Start_Period_SD = First_Eligible_To_Accrue_Period_SD Accrual_Start_Period_ED = First_Eligible_To_Accrue_Period_ED ) ELSE ( Accrual_Start_Period_SD = First_Period_SD Accrual_Start_Period_ED = First_Period_ED ) /*-------------------------------------------------------------------- Now set up the information that will be used in when looping through the periods ----------------------------------------------------------------- */ IF Last_period_ED >= Accrual_Start_Period_ED THEN ( E = SET_DATE('PERIOD_SD',Accrual_Start_Period_SD) E = SET_DATE('PERIOD_ED',Accrual_Start_Period_ED) E = SET_DATE('LAST_PERIOD_SD',Calculation_period_SD) E = SET_DATE('LAST_PERIOD_ED',Calculation_period_ED) E = SET_NUMBER('TOTAL_ACCRUED_PTO',0) E = LOOP_CONTROL('HU_ADD_CHILD_CARE_HOLIDAY_PERIOD_ACCRUAL') Total_Accrued_PTO = ROUND(GET_NUMBER('TOTAL_ACCRUED_PTO')) ) IF Accrual_Start_Period_SD <= Calculation_period_ED THEN ( Accrual_end_date = Calculation_period_ED ) Effective_Start_Date = Accrual_Start_Period_SD Effective_End_Date = Calculation_period_ED IF Effective_Start_Date >= Effective_End_Date THEN ( Effective_Start_Date = Effective_End_Date ) RETURN Total_Accrued_PTO ,Effective_start_date ,Effective_end_date ,Accrual_end_date
Looping Formula
/* ------------------------------------------------------------------- NAME : HU_ADD_CHILD_CARE_HOLIDAY_PERIOD_ACCRUAL This formula calculates the amount of PTO accrued for a particular period -----------------------------------------------------------------*/ /*-------------------------------------------------------------------- Get the global variable to be used in this formula -------------------------------------------------------------------*/ DEFAULT FOR ACP_TERMINATION_DATE IS '4712/12/31 00:00:00' (DATE) DEFAULT FOR ACP_SERVICE_START_DATE IS '4712/12/31 00:00:00' (DATE) Continuous_Service_Date = GET_DATE('CONTINUOUS_SERVICE_DATE') Total_Accrued_PTO = GET_NUMBER('TOTAL_ACCRUED_PTO') Period_SD = GET_DATE('PERIOD_SD') Period_ED = GET_DATE('PERIOD_ED') Last_Period_SD = GET_DATE('LAST_PERIOD_SD') Last_Period_ED = GET_DATE('LAST_PERIOD_ED') Termination_date = GET_DATE('ACP_TERMINATION_DATE') Hire_date = GET_DATE('ACP_SERVICE_START_DATE') Accruing_Frequency = GET_TEXT('ACCRUING_FREQUENCY') Accruing_Multiplier = GET_NUMBER('ACCRUING_MULTIPLIER') Beginning_of_Calculation_Year = GET_DATE('BEGINNING_OF_CALCULATION_YEAR') First_Child_Date_of_birth = TO_DATE('01-01-4712','dd-mm-yyyy') Second_Child_Date_of_birth = TO_DATE('01-01-4712','dd-mm-yyyy') Third_Child_Date_of_birth = TO_DATE('01-01-4712','dd-mm-yyyy') /* ------------------------------------------------------------------- Set the payroll period, accruing frequency, and accruing multiplier based on the payroll. -----------------------------------------------------------------*/ No_of_Payroll_Periods = HU_PAYROLL_PERIODS (Period_SD ,Accruing_Frequency ,Accruing_Multiplier) No_Of_Children_less_16 = 0 No_Of_Children_16 = 0 /* ------------------------------------------------------------------- Retrieve child information for the current employee. ----------------------------------------------------------------- */ E = HU_ABS_GET_CHILD_INFO(Period_SD, Period_ED ,No_Of_Children_less_16 ,No_Of_Children_16 ,First_Child_Date_of_birth ,Second_Child_Date_of_birth ,Third_Child_Date_of_birth) Total_children = No_Of_Children_less_16 + No_Of_Children_16 Period_Accrued_PTO = 0 Total_days = DAYS_BETWEEN(Period_ED , Period_SD) days_valid = DAYS_BETWEEN(Period_ED , Period_SD) Accrual_Rate = 0 /* ------------------------------------------------------------------- Set accrual rate based on number of children and their age. ----------------------------------------------------------------- */ IF Total_children = 1 THEN ( Accrual_Rate = 2 ) ELSE IF Total_children = 2 THEN ( Accrual_Rate = 4 ) ELSE IF Total_children > 2 THEN ( Accrual_Rate = 7) Accrual_rate_per_period = Accrual_Rate/No_of_Payroll_Periods /* ------------------------------------------------------------------- Days worked prorated based on hire date and termination date of employee. ------------------------------------------------------------------*/ IF Hire_date >= Period_SD AND Hire_date <= Period_ED AND Termination_date >= Period_SD AND Termination_date <= Period_ED THEN ( days_valid = DAYS_BETWEEN(Termination_date,Hire_date) ) ELSE IF Hire_date >= Period_SD AND Hire_date <= Period_ED THEN ( days_valid = DAYS_BETWEEN(Period_ED,Hire_date) ) ELSE IF Termination_date >= Period_SD AND Termination_date <= Period_ED THEN ( days_valid = DAYS_BETWEEN(Termination_date,Period_SD) ) Accrual_rate_per_period = Accrual_rate_per_period *(days_valid/ Total_days) /* ------------------------------------------------------------------- Calculate the Amount Accrued this Period- -----------------------------------------------------------------*/ IF No_Of_Children_16 = 0 or No_Of_Children_less_16 > 2 THEN ( Period_Accrued_PTO = Accrual_rate_per_period ) ELSE ( IF No_Of_Children_16 = 1 THEN ( days_valid = DAYS_BETWEEN(First_Child_Date_of_birth,Period_SD) Period_Accrued_PTO = Accrual_rate_per_period *(days_valid / Total_days ) IF No_Of_Children_less_16 = 1 THEN ( Period_Accrued_PTO = Period_Accrued_PTO +(2*((Total_days-days_valid)/Total_days)) /No_of_Payroll_Periods ) IF No_Of_Children_less_16 = 2 THEN ( Period_Accrued_PTO = Period_Accrued_PTO +(4*((Total_days-days_valid)/Total_days)) /No_of_Payroll_Periods ) ) ELSE IF No_Of_Children_16 = 2 THEN ( IF No_Of_Children_less_16 > 1 THEN ( days_valid = DAYS_BETWEEN(Second_Child_Date_of_birth,Period_SD) Period_Accrued_PTO = Accrual_rate_per_period *(days_valid / Total_days) Period_Accrued_PTO = Period_Accrued_PTO +(4*((Total_days-days_valid)/Total_days)) /No_of_Payroll_Periods ) ELSE IF No_Of_Children_less_16 > 0 THEN ( days_valid = DAYS_BETWEEN(First_Child_Date_of_birth,Period_SD) Period_Accrued_PTO = Accrual_rate_per_period * (days_valid / Total_days) days_valid = DAYS_BETWEEN(Second_Child_Date_of_birth ,First_Child_Date_of_birth) Period_Accrued_PTO = Period_Accrued_PTO +(4 *(days_valid / Total_days)) /No_of_Payroll_Periods days_valid = DAYS_BETWEEN(Period_ED ,Second_Child_Date_of_birth) Period_Accrued_PTO = Period_Accrued_PTO +(2 *(days_valid / Total_days)) /No_of_Payroll_Periods ) ELSE IF No_Of_Children_less_16 = 0 THEN ( days_valid = DAYS_BETWEEN(First_Child_Date_of_birth,Period_SD) Period_Accrued_PTO = Accrual_rate_per_period *(days_valid / Total_days) days_valid = DAYS_BETWEEN(Second_Child_Date_of_birth ,First_Child_Date_of_birth) Period_Accrued_PTO = Period_Accrued_PTO + (2 * (days_valid / Total_days)) /No_of_Payroll_Periods ) ) ELSE IF No_Of_Children_16 = 3 THEN ( IF No_Of_Children_less_16 > 1 THEN ( days_valid = DAYS_BETWEEN(Third_Child_Date_of_birth,Period_SD) Period_Accrued_PTO = Accrual_rate_per_period *(days_valid / Total_days) Period_Accrued_PTO = Period_Accrued_PTO +(4*((Total_days-days_valid) / Total_days)) /No_of_Payroll_Periods ) ELSE IF No_Of_Children_less_16 > 0 THEN ( days_valid = DAYS_BETWEEN(Second_Child_Date_of_birth ,Period_SD) Period_Accrued_PTO = Accrual_rate_per_period *(days_valid / Total_days) days_valid = DAYS_BETWEEN(Third_Child_Date_of_birth ,Second_Child_Date_of_birth) Period_Accrued_PTO = Period_Accrued_PTO +(4 * (days_valid / Total_days)) /No_of_Payroll_Periods days_valid = DAYS_BETWEEN(Period_ED,Third_Child_Date_of_birth) Period_Accrued_PTO = Period_Accrued_PTO +(2 * (days_valid / Total_days)) /No_of_Payroll_Periods ) ELSE IF No_Of_Children_less_16 = 0 THEN ( days_valid = DAYS_BETWEEN(First_Child_Date_of_birth,Period_SD) Period_Accrued_PTO = Accrual_rate_per_period *(days_valid / Total_days) days_valid = DAYS_BETWEEN(Second_Child_Date_of_birth ,First_Child_Date_of_birth) Period_Accrued_PTO = Period_Accrued_PTO +(4 * (days_valid / Total_days)) /No_of_Payroll_Periods days_valid = DAYS_BETWEEN(Third_Child_Date_of_birth ,Second_Child_Date_of_birth) Period_Accrued_PTO = Period_Accrued_PTO +(2 * (days_valid / Total_days)) /No_of_Payroll_Periods ) ) ) /*-------------------------------------------------------------------- Set the Running Total ------------------------------------------------------------------*/ E = SET_NUMBER('TOTAL_ACCRUED_PTO' ,Total_Accrued_PTO + Period_Accrued_PTO) /* ------------------------------------------------------------------- Establish whether the current period is the last one, if so end the processing, otherwise get the next period -----------------------------------------------------------------*/ IF Period_SD >= Last_Period_SD THEN ( Continue_Processing_Flag = 'N' ) ELSE ( E = GET_PERIOD_DATES(ADD_DAYS(Period_ED,1) ,Accruing_Frequency ,Beginning_of_Calculation_Year ,Accruing_Multiplier) E = SET_DATE('PERIOD_SD' ,GET_DATE('PERIOD_START_DATE')) E = SET_DATE('PERIOD_ED' ,GET_DATE('PERIOD_END_DATE')) Continue_Processing_Flag = 'Y' ) RETURN Continue_Processing_Flag
Oracle HRMS provides the HU_OTHER_ADD_HOLIDAY_MULTIPLIER formula to calculate the Other Additional Holiday as required for the Hungarian Absence Report. The Other Additional Holiday comprises of Youthful Holiday and Additional Health Holiday. The sample formula is for an accrual plan with the following rules:
Employee under 18 years of age entitled to an additional 5 days holiday.
Blind employee entitled to an additional 5 days holiday. This eligibility is based on the information recorded on the Blind field on the Disabilities window.
Employee working underground or exposed to radiation entitled to an additional 5 days holiday. This eligibility is based on the information recorded on the Additional Health Holiday field on the Further Job Info in the Job window.
Entitlement depends on the number of days worked in a week. The formula takes into account any work pattern changes.
Entitlement begins or ends from the date of change, if the shift or disability change during the leave year.
Other Additional Holiday for new hires begins on their Hire Date.
The top level formula, HU_OTHER_ADD_HOLIDAY_MULTIPLIER calls another formula called HU_OTHER_ADD_HOLIDAY_PERIOD_ACCRUAL calculate the accrual for each period. You use the formulas along with the carry over formula HU_ABS_HOLIDAY_CARRY_OVER. See: Sample Formula for Carry Over Absence
The top-level formula, HU_OTHER_ADD_HOLIDAY_MULTIPLIER and the looping formula HU_OTHER_ADD_HOLIDAY_PERIOD_ACCRUAL are given below.
/* ------------------------------------------------------------------ NAME : HU_OTHER_ADD_HOLIDAY_MULTIPLIER This formula calculates the total accrued other additional holiday for a specific period. -----------------------------------------------------------------*/ DEFAULT FOR ACP_INELIGIBILITY_PERIOD_TYPE IS 'CM' DEFAULT FOR ACP_INELIGIBILITY_PERIOD_LENGTH IS 0 DEFAULT FOR ACP_CONTINUOUS_SERVICE_DATE IS '4712/12/31 00:00:00'(date) DEFAULT FOR ACP_ENROLLMENT_END_DATE IS '4712/12/31 00:00:00' (date) DEFAULT FOR ACP_TERMINATION_DATE IS '4712/12/31 00:00:00' (date) DEFAULT FOR ACP_ENROLLMENT_START_DATE IS '4712/12/31 00:00:00' (date) DEFAULT FOR ACP_SERVICE_START_DATE IS '4712/12/31 00:00:00' (date) INPUTS ARE Calculation_Date (date) Accruing_Frequency = ' ' Accruing_Multiplier = 0 E = SET_DATE('CALCULATION_DATE',Calculation_Date) /* ------------------------------------------------------------------ Set the payroll period, accruing frequency, and accruing multiplier based on the payroll. -----------------------------------------------------------------*/ Payroll_period = HU_PAYROLL_PERIODS(Calculation_Date ,Accruing_Frequency ,Accruing_Multiplier) E = SET_TEXT('ACCRUING_FREQUENCY', Accruing_Frequency) E = SET_NUMBER('ACCRUING_MULTIPLIER', Accruing_Multiplier) /* ------------------------------------------------------------------- Calculate the start and end dates of the current leave year ------------------------------------------------------------------*/ Beginning_Of_Calculation_Year = TO_DATE('0101'||TO_CHAR(Calculation_Date,'YYYY') ,'DDMMYYYY') IF Beginning_Of_Calculation_Year > Calculation_Date THEN ( Beginning_of_Calculation_Year = ADD_MONTHS(Beginning_Of_Calculation_Year, -12) ) E = SET_DATE('BEGINNING_OF_CALCULATION_YEAR' , Beginning_Of_Calculation_Year) E = GET_PERIOD_DATES(Beginning_of_Calculation_Year ,Accruing_Frequency ,Beginning_Of_Calculation_Year ,Accruing_Multiplier) First_Period_SD = GET_DATE('PERIOD_START_DATE') First_Period_ED = GET_DATE('PERIOD_END_DATE') /* ------------------------------------------------------------------- Set the Calculation_Date to the Termination Date if not null -----------------------------------------------------------------*/ IF NOT (ACP_TERMINATION_DATE WAS DEFAULTED) OR NOT (ACP_ENROLLMENT_END_DATE WAS DEFAULTED) THEN ( Early_End_Date = LEAST(ACP_TERMINATION_DATE ,ACP_ENROLLMENT_END_DATE) IF (Early_End_Date < Calculation_Date) THEN ( Calculation_Date = Early_End_Date ) ) /* ------------------------------------------------------------------- Get the last whole period prior to the Calculation Date and ensure that it is within the Year (if the Calculation Date is the End of a Period then use that period) -----------------------------------------------------------------*/ E = GET_PERIOD_DATES(Calculation_Date ,Accruing_Frequency ,Beginning_of_Calculation_Year ,Accruing_Multiplier) Calculation_Period_SD = GET_DATE('PERIOD_START_DATE') Calculation_Period_ED = GET_DATE('PERIOD_END_DATE') /* ------------------------------------------------------------------- Set the Continuous Service Global Variable, whilst also ensuring that the continuous service date is before the Calculation Period ------------------------------------------------------------------*/ IF (ACP_CONTINUOUS_SERVICE_DATE WAS DEFAULTED) THEN ( E = SET_DATE('CONTINUOUS_SERVICE_DATE', ACP_SERVICE_START_DATE) ) ELSE IF(ACP_CONTINUOUS_SERVICE_DATE > Calculation_Period_SD) THEN ( E = SET_DATE('CONTINUOUS_SERVICE_DATE' ,ACP_CONTINUOUS_SERVICE_DATE) ) ELSE ( E = SET_DATE('CONTINUOUS_SERVICE_DATE' ,ACP_CONTINUOUS_SERVICE_DATE) ) Continuous_Service_Date = GET_DATE('CONTINUOUS_SERVICE_DATE') First_Eligible_To_Accrue_Date = Continuous_Service_Date /*-------------------------------------------------------------------- Determine the date on which accrued PTO may first be registered, i.e the date on which the Ineligibility Period expires ------------------------------------------------------------------*/ Accrual_Ineligibility_Expired_Date = First_Eligible_To_Accrue_Date IF (ACP_INELIGIBILITY_PERIOD_LENGTH > 0) THEN ( IF ACP_INELIGIBILITY_PERIOD_TYPE = 'BM' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*2) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'F' THEN ( Accrual_Ineligibility_Expired_Date = ADD_DAYS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*14) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'CM' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'LM' THEN ( Accrual_Ineligibility_Expired_Date = ADD_DAYS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*28) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'Q' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*3) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'SM' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH/2) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'SY' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*6) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'W' THEN ( Accrual_Ineligibility_Expired_Date = ADD_DAYS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*7) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'Y' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*12) ) IF Accrual_Ineligibility_Expired_Date > First_Eligible_To_Accrue_Date AND Calculation_Date < Accrual_Ineligibility_Expired_Date THEN ( First_Eligible_To_Accrue_Date = Accrual_Ineligibility_Expired_Date ) ) /* ------------------------------------------------------------------- Get the first full period following the First_Eligible_To_Accrue_Date(if it falls on the beginning of the period then use that period) -------------------------------------------------------------------*/ IF First_Eligible_To_Accrue_Date > Beginning_Of_Calculation_Year THEN ( E = GET_PERIOD_DATES(First_Eligible_To_Accrue_Date ,Accruing_Frequency ,Beginning_Of_Calculation_Year ,Accruing_Multiplier) First_Eligible_To_Accrue_Period_SD = GET_DATE('PERIOD_START_DATE') First_Eligible_To_Accrue_Period_ED = GET_DATE('PERIOD_END_DATE') IF (First_Eligible_To_Accrue_Period_SD > Calculation_Period_ED) THEN ( Total_Accrued_PTO = 0 E = PUT_MESSAGE('HR_52793_PTO_FML_ASG_INELIG') ) ) ELSE ( First_Eligible_To_Accrue_Period_SD = First_Period_SD First_Eligible_To_Accrue_Period_ED = First_Period_ED ) /* ------------------------------------------------------------------- Determine the date on which PTO actually starts accruing based on Hire Date, Continuous Service Date and plan Enrollment Start Date. -------------------------------------------------------------------*/ IF Continuous_Service_date = ACP_CONTINUOUS_SERVICE_DATE THEN ( Actual_Accrual_Start_Date = Continuous_service_Date ) ELSE ( Actual_Accrual_Start_Date = GREATEST(Continuous_Service_Date ,ACP_ENROLLMENT_START_DATE ,First_Period_SD) ) /* ------------------------------------------------------------------- Determine the actual start of the accrual calculation -----------------------------------------------------------------*/ IF (Actual_Accrual_Start_Date > First_Period_SD AND Actual_Accrual_Start_Date > First_Eligible_To_Accrue_Period_SD) THEN ( E = GET_PERIOD_DATES(Actual_Accrual_Start_Date ,Accruing_Frequency ,Beginning_Of_Calculation_Year ,Accruing_Multiplier) Accrual_Start_Period_SD = GET_DATE('PERIOD_START_DATE') Accrual_Start_Period_ED = GET_DATE('PERIOD_END_DATE') /* ------------------------------------------------------------------- If the Actual Accrual Period is after the Calculation Period then end the processing. -----------------------------------------------------------------*/ IF (Accrual_Start_Period_SD > Calculation_Period_ED) THEN ( Total_Accrued_PTO = 0 E = PUT_MESSAGE('HR_52797_PTO_FML_ACT_ACCRUAL') ) ) ELSE IF (First_Eligible_To_Accrue_Period_SD > First_Period_SD) THEN ( Accrual_Start_Period_SD = First_Eligible_To_Accrue_Period_SD Accrual_Start_Period_ED = First_Eligible_To_Accrue_Period_ED ) ELSE ( Accrual_Start_Period_SD = First_Period_SD Accrual_Start_Period_ED = First_Period_ED ) /* ------------------------------------------------------------------- Now set up the information that will be used in when looping through the periods. -----------------------------------------------------------------*/ IF Calculation_Period_ED >= Accrual_Start_Period_ED THEN ( E = SET_DATE('PERIOD_SD',Accrual_Start_Period_SD) E = SET_DATE('PERIOD_ED',Accrual_Start_Period_ED) E = SET_DATE('LAST_PERIOD_SD',Calculation_Period_SD) E = SET_DATE('LAST_PERIOD_ED',Calculation_Period_ED) E = SET_NUMBER('TOTAL_ACCRUED_PTO',0) E = LOOP_CONTROL('HU_OTHER_ADD_HOLIDAY_PERIOD_ACCRUAL') Total_Accrued_PTO = ROUND(GET_NUMBER('TOTAL_ACCRUED_PTO')) ) IF Accrual_Start_Period_SD <= Calculation_Period_SD THEN ( Accrual_end_date = Calculation_Period_ED ) Effective_Start_Date = Accrual_Start_Period_SD Effective_End_Date = Calculation_Period_ED IF Effective_Start_Date >= Effective_End_Date THEN ( Effective_Start_Date = Effective_End_Date ) RETURN Total_Accrued_PTO ,Effective_start_date ,Effective_end_date ,Accrual_end_date
Looping Formula
/* ------------------------------------------------------------------- NAME : HU_OTHER_ADD_HOLIDAY_PERIOD_ACCRUAL This formula calculates the amount of PTO accrued for a particular period. ------------------------------------------------------------------*/ DEFAULT FOR PER_DATE_OF_BIRTH IS '4712/12/31 00:00:00' (date) DEFAULT FOR ACP_TERMINATION_DATE IS '4712/12/31 00:00:00' (date) DEFAULT FOR EMP_HIRE_DATE IS '4712/12/31 00:00:00' (date) DEFAULT FOR Person_dob IS '4712/12/31 00:00:00' (date) Continuous_Service_Date = GET_DATE('CONTINUOUS_SERVICE_DATE') Total_Accrued_PTO = GET_NUMBER('TOTAL_ACCRUED_PTO') Period_SD = GET_DATE('PERIOD_SD') Period_ED = GET_DATE('PERIOD_ED') Last_Period_SD = GET_DATE('LAST_PERIOD_SD') Last_Period_ED = GET_DATE('LAST_PERIOD_ED') Payroll_Year_SD = GET_DATE('PAYROLL_YEAR_SD') Accruing_Frequency = GET_TEXT('ACCRUING_FREQUENCY') Accruing_Multiplier = GET_NUMBER('ACCRUING_MULTIPLIER') beginining_year = GET_DATE('BEGINNING_OF_CALCULATION_YEAR') Calculation_Date=GET_DATE('CALCULATION_DATE') /* ------------------------------------------------------------------- Get the person date of birth and compute the age. -----------------------------------------------------------------*/ Person_dob = HU_PERSON_DOB(Calculation_Date) Age = FLOOR(MONTHS_BETWEEN(Period_ED, Person_dob)/12) /* ------------------------------------------------------------------- Set the payroll period, accruing frequency, and accruing multiplier based on the payroll. -----------------------------------------------------------------*/ P= HU_PAYROLL_PERIODS(Calculation_Date ,Accruing_Frequency ,Accruing_Multiplier) Accrual_Rate =0 st_date=beginining_year ed_date=TO_DATE('3112'||TO_CHAR(beginining_year,'YYYY'),'DDMMYYYY') IF EMP_HIRE_DATE > Period_SD AND EMP_HIRE_DATE < Period_ED THEN ( Period_SD= EMP_HIRE_DATE ) IF ACP_TERMINATION_DATE > Period_SD AND ACP_TERMINATION_DATE < Period_ED THEN ( Period_ED=ACP_TERMINATION_DATE ) DOB=TO_DATE(TO_CHAR(Person_dob,'DD/MM/')||TO_CHAR(PERIOD_SD,'YYYY') ,'DD/MM/YYYY') /* ------------------------------------------------------------------- Set accrual rate based on age and working pattern. ------------------------------------------------------------------*/ IF Age = 18 and DOB>=PERIOD_SD and DOB<=PERIOD_ED THEN ( x1 = HU_ABS_GET_WORKING_DAYS(PERIOD_SD,ADD_DAYS(DOB,-1)) Accrual_Rate = (5/260*x1) ) ELSE IF Age<18 THEN ( x1 = HU_ABS_GET_WORKING_DAYS(PERIOD_SD,PERIOD_ED) Accrual_Rate =5/260*x1 ) ELSE ( Accrual_Rate =0 ) Period_Accrued_PTO=Accrual_Rate /* ------------------------------------------------------------------- Checking for Blind Days -----------------------------------------------------------------*/ Accrual_Rate =0 Accrual_Rate =HU_ABS_GET_BLIND_DAYS(Period_SD,Period_ED)*5/260 Period_Accrued_PTO=Period_Accrued_PTO+Accrual_Rate /* ------------------------------------------------------------------- Checking the additional health of employees. ------------------------------------------------------------------*/ Accrual_Rate = 0 Accrual_Rate = HU_ABS_GET_JOB_DAYS(Period_SD,Period_ED)*5/260 Period_Accrued_PTO = Period_Accrued_PTO + Accrual_Rate /*-------------------------------------------------------------------- Set the Running Total for Total_Accrued_PTO ------------------------------------------------------------------*/ E = SET_NUMBER('TOTAL_ACCRUED_PTO',Total_Accrued_PTO + Period_Accrued_PTO) /* ------------------------------------------------------------------- Establish whether the current period is the last one, if so end the processing, otherwise get the next period --------------------------------------------------------------------*/ IF Period_SD >= Last_Period_SD THEN ( Continue_Processing_Flag = 'N' ) ELSE ( E = GET_PAYROLL_PERIOD(ADD_DAYS(Period_ED,1)) E = SET_DATE('PERIOD_SD',GET_DATE('PAYROLL_PERIOD_START_DATE')) E = SET_DATE('PERIOD_ED',GET_DATE('PAYROLL_PERIOD_END_DATE')) Continue_Processing_Flag = 'Y' ) RETURN Continue_Processing_Flag
Oracle HRMS provides the HU_SICKNESS_HOLIDAY_MULTIPLIER to calculate the Sickness Holiday as required for the Hungarian Absence Report. The sickness holiday is based on the following rules:
Annual sickness holiday of fifteen days.
Entitlement depends on the number of days worked in a week. The formula calculates proportionately if the work pattern changes within the leave year.
Entitlement depends on the sickness holiday the employee has taken in the previous employment.
The HU_SICKNESS_HOLIDAY_MULTIPLIER calls another formula, HU_SICKNESS_HOLIDAY_PERIOD_ACCRUAL to calculate the accrual within a specific period. There is no carry over formula for Sickness Holiday.
The top-level formula, HU_SICKNESS_HOLIDAY_MULTIPLIER, and the looping formula HU_SICKNESS_HOLIDAY_PERIOD_ACCRUAL are given below.
/* ------------------------------------------------------------------- NAME : HU_SICKNESS_HOLIDAY_MULTIPLIER This formula calculates the total accrued sickness holiday for a specific period. -----------------------------------------------------------------*/ DEFAULT FOR ACP_INELIGIBILITY_PERIOD_TYPE IS 'CM' DEFAULT FOR ACP_INELIGIBILITY_PERIOD_LENGTH IS 0 DEFAULT FOR ACP_CONTINUOUS_SERVICE_DATE IS '4712/12/31 00:00:00'(DATE) DEFAULT FOR ACP_ENROLLMENT_END_DATE IS '4712/12/31 00:00:00' (DATE) DEFAULT FOR ACP_TERMINATION_DATE IS '4712/12/31 00:00:00' (DATE) DEFAULT FOR ACP_ENROLLMENT_START_DATE IS '4712/12/31 00:00:00' (DATE) DEFAULT FOR ACP_SERVICE_START_DATE IS '4712/12/31 00:00:00' (DATE) INPUTS ARE Calculation_Date (DATE) Accruing_Frequency = ' ' Accruing_Multiplier = 0 /* ------------------------------------------------------------------- Set the payroll period, accruing frequency, and accruing multiplier based on the payroll. -----------------------------------------------------------------*/ No_of_Payroll_Periods = HU_PAYROLL_PERIODS (Calculation_Date ,Accruing_Frequency ,Accruing_Multiplier) E = SET_TEXT('ACCRUING_FREQUENCY', Accruing_Frequency) E = SET_NUMBER('ACCRUING_MULTIPLIER', Accruing_Multiplier) /* ------------------------------------------------------------------- Calculate the start and end Dates of the current leave year ------------------------------------------------------------------*/ Beginning_Of_Calculation_Year = TO_DATE('0101' ||TO_CHAR(Calculation_Date ,'YYYY') ,'DDMMYYYY') End_Of_Calculation_Year = to_DATE('3112'||TO_CHAR(Calculation_Date ,'YYYY') ,'DDMMYYYY') IF Beginning_Of_Calculation_Year > Calculation_Date THEN ( Beginning_of_Calculation_Year = ADD_MONTHS(Beginning_Of_Calculation_Year , -12) ) E = SET_DATE('BEGINNING_OF_CALCULATION_YEAR' , Beginning_Of_Calculation_Year) E = GET_PERIOD_DATES(Beginning_of_Calculation_Year ,Accruing_Frequency ,Beginning_Of_Calculation_Year ,Accruing_Multiplier) First_Period_SD = GET_DATE('PERIOD_START_DATE') First_Period_ED = GET_DATE('PERIOD_END_DATE') E = GET_PERIOD_DATES(End_Of_Calculation_Year ,Accruing_Frequency ,Beginning_Of_Calculation_Year ,Accruing_Multiplier) Last_Period_SD = GET_DATE('PERIOD_START_DATE') Last_Period_ED = GET_DATE('PERIOD_END_DATE') /* ------------------------------------------------------------------- Set the Calculation_Date to the Termination Date if not null --------------------------------------------------------------------*/ IF NOT (ACP_TERMINATION_DATE WAS DEFAULTED) OR NOT (ACP_ENROLLMENT_END_DATE WAS DEFAULTED) THEN ( Early_End_Date = LEAST(ACP_TERMINATION_DATE ,ACP_ENROLLMENT_END_DATE) IF (Early_End_Date < First_Period_SD) THEN ( Total_Accrued_PTO = 0 E = PUT_MESSAGE('HR_52794_PTO_FML_ASG_TER') ) IF (Early_End_Date < Last_Period_ED) THEN ( E = GET_PERIOD_DATES(Early_End_Date ,Accruing_Frequency ,Beginning_Of_Calculation_Year ,Accruing_Multiplier) Last_Period_SD = GET_DATE('PERIOD_START_DATE') Last_Period_ED = GET_DATE('PERIOD_END_DATE') ) IF (Early_End_Date < Calculation_Date) THEN ( Calculation_Date = Early_End_Date ) ) /* ------------------------------------------------------------------- Get the last whole period prior to the Calculation Date and ensure that it is within the Year (if the Calculation Date is the End of a Period then use that period) -------------------------------------------------------------------- */ E = GET_PERIOD_DATES(Calculation_Date ,Accruing_Frequency ,Beginning_of_Calculation_Year ,Accruing_Multiplier) Calculation_Period_SD = GET_DATE('PERIOD_START_DATE') Calculation_Period_ED = GET_DATE('PERIOD_END_DATE') IF (Calculation_Period_ED < First_Period_SD) THEN ( Total_Accrued_PTO = 0 E = PUT_MESSAGE('HR_52795_PTO_FML_CALC_DATE') ) /* ------------------------------------------------------------------- Set the Continuous Service Global Variable, whilst also ensuring that the continuous service date is before the Calculation Period ----------------------------------------------------------------- */ IF (ACP_CONTINUOUS_SERVICE_DATE WAS DEFAULTED) THEN ( E = SET_DATE('CONTINUOUS_SERVICE_DATE', ACP_SERVICE_START_DATE) ) ELSE IF(ACP_CONTINUOUS_SERVICE_DATE > Calculation_Period_ED) THEN ( Total_Accrued_PTO = 0 E = PUT_MESSAGE('HR_52796_PTO_FML_CSD') E = SET_DATE('CONTINUOUS_SERVICE_DATE' , ACP_CONTINUOUS_SERVICE_DATE) ) ELSE IF(ACP_CONTINUOUS_SERVICE_DATE > First_Period_SD) THEN ( E = GET_PERIOD_DATES(ACP_CONTINUOUS_SERVICE_DATE, Accruing_Frequency, Beginning_Of_Calculation_Year, Accruing_Multiplier) First_Period_SD = GET_DATE('PERIOD_START_DATE') First_Period_ED = GET_DATE('PERIOD_END_DATE') ) ELSE ( E = SET_DATE('CONTINUOUS_SERVICE_DATE' , ACP_CONTINUOUS_SERVICE_DATE) ) Continuous_Service_Date = GET_DATE('CONTINUOUS_SERVICE_DATE') First_Eligible_To_Accrue_Date = Continuous_Service_Date /*-------------------------------------------------------------------- Determine the date on which accrued PTo may first be registered, i.e the date on which the Ineligibility Period expires ---------------------------------------------------------------- */ Accrual_Ineligibility_Expired_Date = First_Eligible_To_Accrue_Date IF (ACP_INELIGIBILITY_PERIOD_LENGTH > 0) THEN ( IF ACP_INELIGIBILITY_PERIOD_TYPE = 'BM' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*2) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'F' THEN ( Accrual_Ineligibility_Expired_Date = ADD_DAYS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*14) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'CM' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'LM' THEN ( Accrual_Ineligibility_Expired_Date = ADD_DAYS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*28) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'Q' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*3) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'SM' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH/2) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'SY' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*6) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'W' THEN ( Accrual_Ineligibility_Expired_Date = ADD_DAYS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*7) ) ELSE IF ACP_INELIGIBILITY_PERIOD_TYPE = 'Y' THEN ( Accrual_Ineligibility_Expired_Date = ADD_MONTHS(Continuous_Service_Date ,ACP_INELIGIBILITY_PERIOD_LENGTH*12) ) IF Accrual_Ineligibility_Expired_Date > First_Eligible_To_Accrue_Date AND Calculation_Date < Accrual_Ineligibility_Expired_Date THEN ( First_Eligible_To_Accrue_Date = Accrual_Ineligibility_Expired_Date ) ) /* ------------------------------------------------------------------- Get the first full period following the First_Eligible_To_Accrue_Date (if it falls on the beginning of the period then use that period) ---------------------------------------------------------------- */ IF First_Eligible_To_Accrue_Date > Beginning_Of_Calculation_Year THEN ( E = GET_PERIOD_DATES(First_Eligible_To_Accrue_Date ,Accruing_Frequency ,Beginning_Of_Calculation_Year ,Accruing_Multiplier) First_Eligible_To_Accrue_Period_SD = GET_DATE('PERIOD_START_DATE') First_Eligible_To_Accrue_Period_ED = GET_DATE('PERIOD_END_DATE') IF (First_Eligible_To_Accrue_Period_SD > Calculation_period_ED) THEN ( Total_Accrued_PTO = 0 E = PUT_MESSAGE('HR_52793_PTO_FML_ASG_INELIG') ) ) ELSE ( First_Eligible_To_Accrue_Period_SD = First_Period_SD First_Eligible_To_Accrue_Period_ED = First_Period_ED ) /* ------------------------------------------------------------------- Determine the date on which PTO actually starts accruing based on Hire Date,Continuous Service Date and plan Enrollment Start Date. ---------------------------------------------------------------- */ IF Continuous_Service_date = ACP_CONTINUOUS_SERVICE_DATE THEN ( Actual_Accrual_Start_Date = Continuous_service_Date ) ELSE ( Actual_Accrual_Start_Date = GREATEST(Continuous_Service_Date ,ACP_ENROLLMENT_START_DATE ,First_Period_SD) ) /* ------------------------------------------------------------------- Determine the actual start of the accrual calculation -----------------------------------------------------------------*/ IF (Actual_Accrual_Start_Date > First_Period_SD AND Actual_Accrual_Start_Date > First_Eligible_To_Accrue_Period_SD) THEN ( E = GET_PERIOD_DATES(Actual_Accrual_Start_Date ,Accruing_Frequency ,Beginning_Of_Calculation_Year ,Accruing_Multiplier) Accrual_Start_Period_SD = GET_DATE('PERIOD_START_DATE') Accrual_Start_Period_ED = GET_DATE('PERIOD_END_DATE') /*---------------------------------------------------------------- If the Actual Accrual Period is after the Calculation Period then end the processing. -------------------------------------------------------------- */ IF (Accrual_Start_Period_SD > Calculation_period_ED) THEN ( Total_Accrued_PTO = 0 E = PUT_MESSAGE('HR_52797_PTO_FML_ACT_ACCRUAL') ) ) ELSE IF (First_Eligible_To_Accrue_Period_SD > First_Period_SD) THEN ( Accrual_Start_Period_SD = First_Eligible_To_Accrue_Period_SD Accrual_Start_Period_ED = First_Eligible_To_Accrue_Period_ED ) ELSE ( Accrual_Start_Period_SD = First_Period_SD Accrual_Start_Period_ED = First_Period_ED ) /*-------------------------------------------------------------------- Retrieve sickness information for previous employment ----------------------------------------------------------------- */ Previous_employment = 'N' Prev_Sickness_Leave = 0 IF TO_CHAR(ACP_SERVICE_START_DATE,'yyyy') = TO_CHAR (Calculation_Date,'yyyy') THEN ( Prev_Sickness_Leave = HU_ABS_GET_PREV_EMP_SICKNESS_LEAVE (TO_CHAR(Calculation_Date,'yyyy') ,Previous_employment) ) Accrued_PTO = 0 /* ------------------------------------------------------------------- Now set up the information that will be used in when looping through the periods ------------------------------------------------------------------- */ IF Last_period_ED >= Accrual_Start_Period_ED THEN ( E = SET_DATE('PERIOD_SD',Accrual_Start_Period_SD) E = SET_DATE('PERIOD_ED',Accrual_Start_Period_ED) E = SET_DATE('LAST_PERIOD_SD',Calculation_period_SD) E = SET_DATE('LAST_PERIOD_ED',Calculation_period_ED) E = SET_NUMBER('TOTAL_ACCRUED_PTO',Accrued_PTO) E = LOOP_CONTROL('HU_SICKNESS_HOLIDAY_PERIOD_ACCRUAL') Total_Accrued_PTO = ROUND(GET_NUMBER('TOTAL_ACCRUED_PTO')) IF Previous_employment = 'Y' AND Total_Accrued_PTO > 15 - Prev_Sickness_Leave THEN ( Total_Accrued_PTO = 15 - Prev_Sickness_Leave E = SET_NUMBER('TOTAL_ACCRUED_PTO',Total_Accrued_PTO) ) ) IF Accrual_Start_Period_SD <= Calculation_period_ED THEN ( Accrual_end_date = Calculation_period_ED ) Effective_Start_Date = Accrual_Start_Period_SD Effective_End_Date = Calculation_period_ED IF Effective_Start_Date >= Effective_End_Date THEN ( Effective_Start_Date = Effective_End_Date ) RETURN Total_Accrued_PTO, Effective_start_date , Effective_end_date, Accrual_end_date Looping formula /* ------------------------------------------------------------------- NAME : HU_SICKNESS_HOLIDAY_PERIOD_ACCRUAL This formula calculates the amount of PTO accrued for a particular period --------------------------------------------------------------------*/ /*-------------------------------------------------------------------- Get the global variable to be used in this formula --------------------------------------------------------------------*/ DEFAULT FOR ACP_TERMINATION_DATE IS '4712/12/31 00:00:00' (DATE) DEFAULT FOR EMP_HIRE_DATE IS '4712/12/31 00:00:00' (DATE) DEFAULT FOR ACP_SERVICE_START_DATE IS '4712/12/31 00:00:00' (DATE) Continuous_Service_Date = GET_DATE('CONTINUOUS_SERVICE_DATE') Total_Accrued_PTO = GET_NUMBER('TOTAL_ACCRUED_PTO') Period_SD = GET_DATE('PERIOD_SD') Period_ED = GET_DATE('PERIOD_ED') Last_Period_SD = GET_DATE('LAST_PERIOD_SD') Last_Period_ED = GET_DATE('LAST_PERIOD_ED') /* ------------------------------------------------------------------- Set the payroll period, accruing frequency, and accruing multiplier based on the payroll. -----------------------------------------------------------------*/ Accruing_Frequency = GET_TEXT('ACCRUING_FREQUENCY') Accruing_Multiplier = GET_NUMBER('ACCRUING_MULTIPLIER') Beginning_of_Calculation_Year = GET_DATE('BEGINNING_OF_CALCULATION_YEAR') Period_Accrued_PTO = 0 IF ACP_SERVICE_START_DATE >= Period_SD AND ACP_SERVICE_START_DATE <= Period_ED AND ACP_TERMINATION_DATE >= Period_SD AND ACP_TERMINATION_DATE <= Period_ED THEN ( Days_valid = HU_ABS_GET_WORKING_DAYS(ACP_SERVICE_START_DATE ,ACP_TERMINATION_DATE) ) ELSE IF ACP_SERVICE_START_DATE >= Period_SD AND ACP_SERVICE_START_DATE <= Period_ED THEN ( Days_valid = HU_ABS_GET_WORKING_DAYS(ACP_SERVICE_START_DATE , Period_ED) ) ELSE IF ACP_TERMINATION_DATE >= Period_SD AND ACP_TERMINATION_DATE <= Period_ED THEN ( Days_valid = HU_ABS_GET_WORKING_DAYS(Period_SD , ACP_TERMINATION_DATE) ) ELSE ( Days_valid = HU_ABS_GET_WORKING_DAYS(Period_SD,Period_ED) ) /* ------------------------------------------------------------------- Calculate the Amount Accrued this Period -----------------------------------------------------------------*/ Period_Accrued_PTO = 15 * (Days_valid/260) /*-------------------------------------------------------------------- Calculate any absence or bought/sold time etc. to be accounted for in this period. --------------------------------------------------------------------*/ Absence = GET_ABSENCE(Period_ED, Beginning_of_Calculation_Year) CarryOver = GET_CARRY_OVER(Period_ED, Beginning_of_Calculation_Year) Other = GET_OTHER_NET_CONTRIBUTION(Period_ED ,Beginning_of_Calculation_Year) Period_Others = CarryOver + Other - Absence /*-------------------------------------------------------------------- Set the Running Total ------------------------------------------------------------------*/ E = SET_NUMBER('TOTAL_ACCRUED_PTO' ,Total_Accrued_PTO + Period_Accrued_PTO) /* ------------------------------------------------------------------- Establish whether the current period is the last one, if so end the processing, otherwise get the next period -----------------------------------------------------------------*/ IF Period_SD = Last_Period_SD THEN ( Continue_Processing_Flag = 'N' ) ELSE ( E = GET_PERIOD_DATES(ADD_DAYS(Period_ED,1) ,Accruing_Frequency ,Beginning_of_Calculation_Year ,Accruing_Multiplier) E = SET_DATE('PERIOD_SD', GET_DATE('PERIOD_START_DATE')) E = SET_DATE('PERIOD_ED', GET_DATE('PERIOD_END_DATE')) Continue_Processing_Flag = 'Y' ) RETURN Continue_Processing_Flag
Oracle HRMS provides the HU_ABS_CARRYOVER_FORMULA to calculate their unused Base Holiday, Additional Holiday for bringing up children, and Other Additional Holiday except Sickness Holiday. Employees can carry over these holidays up to 30th June of the following year or, if the collective agreement permits, up to 31st December of the following year. The formula considers 30th June as the carry over expiry date.
You can use the sample formula HU_ABS_CARRYOVER_FORMULA to calculate the above entitlements. The sample formula is given below:
/*==================================================================== Formula Title : HU_ABS_HOLIDAY_CARRY_OVER Description : This Formula carries over the holidays remaining to next period. ==================================================================*/ DEFAULT FOR ACP_CONTINUOUS_SERVICE_DATE IS '4712/12/31 00:00:00' (date) DEFAULT FOR ACP_SERVICE_START_DATE IS '4712/12/31 00:00:00' (date) INPUTS ARE Calculation_Date (date) ,Accrual_Term (text) IF ACP_CONTINUOUS_SERVICE_DATE WAS DEFAULTED THEN ( Continuous_Service_Date = ACP_SERVICE_START_DATE ) ELSE ( Continuous_Service_Date = ACP_CONTINUOUS_SERVICE_DATE ) calculation_period_end_date = TO_DATE('3112'|| TO_CHAR(Calculation_Date,'YYYY'),'DDMMYYYY') IF Accrual_Term = 'PREVIOUS' THEN ( Effective_Date = ADD_YEARS(calculation_period_end_date, -1) ) ELSE ( Effective_Date = calculation_period_end_date ) Expiry_Date = ADD_MONTHS(effective_date, 6) Years_service = FLOOR(MONTHS_BETWEEN(ADD_DAYS(Effective_date,1) , Continuous_Service_Date) / 12) IF (GET_ACCRUAL_BAND(Years_service) = 0) THEN ( Max_carryover = GET_NUMBER('MAX_CARRY_OVER') ) ELSE Max_carryover = 30 Process = 'YES' RETURN Max_Carryover, Effective_date, Expiry_Date, Process