Accrual Band

Dears,
I have a scenario like the below,
Accrual Band:
0 to 4 years == 110 hours (Max Carry Over), 120 hours (ceiling)
4 to 99 years == 140 hours (Max Carry Over), 160 hours (ceiling)
An employee X has net entitlement of 125 hours on the 4th year end (which is above ceiling hours)
During the first day of his 5th year,
I could see the carry over is 110 hours, instead 125 hours...
My questiions:
The carryover should be 125 hours right?
How could be net entitlement can be beyond ceiling hours???
Please suggest me some answers..
Guru
Edited by: GuruVividEdge on Feb 26, 2013 11:17 PM

Hi Guru,
If the issue is only for one employee then not to worry. Can you follow following things to identify the problem area:
Navigate to the accrual form: Fastpath -> accrual
and check the accrual, carry over and net entitlement value before the carryover process was run and post the carryover process was ran, Note the values.
Once you have identified the problem area, If accrual is exceeding the celing then its simple as suggested as the check of checking the accrual value against the celing number.
If carryover is incorrect then we need to make changes in the carryover formula. Share your results and we can check what can be the best option.
Thanks,
Sanjay

Similar Messages

  • Accrual plan  and accrual band ... can it be date tracked

    Is there a way we can date track accrual bands on the accrual plan.
    The client want the new accrual band be effective as of 01-apr-2011. Can we date track the accrual bands.
    If not what is the best way to make such a change. Accrual formula change is the only way I can think of. Any other suggestions?
    Thank you,
    Aakash
    Edited by: Aakash Gupta on Mar 22, 2011 9:05 AM

    Accrual bands are not date-tracked, no.
    I steer clear of Accrual Bands altogether because it forces you to create separate Accrual Plans for each sets of T&Cs, which I don't like. Instead what I do is:
    * Model the accrual bands in a custom User Defined Table (range-based)
    * Use the column as something that determines various T&Cs, eg, Grade
    * Use the Rows to define each Accrual Band for each set of T&Cs, which the Value being the amount of holiday
    I then use the GET_TABLE_VALUE Fast Formula function to retrieve the value according to the employee's T&Cs.
    Importantly, User Defined Tables are of course date-tracked as well.

  • PTO Accruals - Ceiling value needs to be grade based

    Release 11i.10.2
    Details of the plan
    =============
    Accrual Formula = PTO_PAYROLL_BALANCE_CALCULATION
    Carry Over Formula = PTO_PAYROLL_CARRYOVER
    Payroll Balance Reset Date = 1st January
    Period of Ineligibility = 6 months
    Accrual Band
    Years of Service = 0-99
    Annual Rate = 30
    Maximum Carry Over = 15
    Requirement
    ========
    Ceiling is to be 60 for employees in Grade A1-A5 and for the rest there is not limit.
    Can someone please help me? The Standard form does not seem to fulfill the needs and when I open forumlas PTO_PAYROLL_BALANCE_CALCULATION, PTO_PAYROLL_CARRYOVER I am unable to understand exaclty which part of the code should be modified.
    Pls Help
    Regards
    Woqar

    To achieve your requirement, you need to change the accrual sub formula PTO_PAYROLL_PERIOD_ACCRUAL. Follow the below steps.
    A.Create a pl/sql function :
    1. Create a new Pl/Sql Function in similar lines with parameters as p_assignment_id, p_date_earned, p_plan_id and p_number_of_years;
    2. The new function should call the pl/sql function per_utility_functions.Get_Accrual_Band passing values of p_plan_id and p_number_of_years.
    3. After the above function call, invoke your custom procedure to get the accrual value based on grade (passing p_assignment_id and p_date_earned as parameters).
    4. call the procedure per_formula_functions.set_number to set the ceiling value.
    So overall your function should like this
    FUNCTION <function name>(p_assignment_id NUMBER,p_date_earned DATE,p_plan_id NUMBER, p_number_of_years NUMBER ) RETURN NUMBER IS
    < variables declaration>
    l_ceiling number;
    BEGIN
    l_return := per_utility_functions.Get_Accrual_Band(p_plan_id,p_number_of_years);
    IF l_return = 1 THEN
    return l_return;
    ELSE
    l_return := <your custom function>(p_assignment_id,p_date_earned,l_ceiling);
    l_error := per_formula_functions.set_number('CEILING' ,l_ceiling);
    END IF;
    END <function name>;
    l_error := per_formula_functions.set_number('CEILING' ,l_ceiling);
    B. Create a Formula Function with the above pl/sql function with p_assignment_id, p_date_earned, p_plan_id as context usages and p_number_of_years as parameter.
    C. Copy the Formula PTO_PAYROLL_PERIOD_ACCRUAL and replace the entry of Get_Accrual_Band with your custom formula function defined in step B.
    D. Copy the formula PTO_PAYROLL_BALANCE_CALCULATION and replace the entry of PTO_PAYROLL_PERIOD_ACCRUAL with your custom formula defined in step C.
    Hope this helps.
    Regards,
    Sharath

  • Accrual Balance incorrect on SS LOA page in R12

    Hi,
    I have created the below steps for accruals for APAC region.
    1)Create Annual leave element (Non-recurring, Final Termination , multiple entries allowed)
    2) Input vales: Days
    3)Element link
    4)Absence type: Annual leave , Category :Vacation, balance :Increasing
    5) Accrual plan: Annual leave plan
    Accrual Category: Vacation
    Accrual Start: Beginning of year
    Accrual formula: PTO_PAYROLL_BALANCE_CALCULATION
    Carryover forumal: PTO_PAYROLL_CARRYOVER
    Payroll balance reset date: 1st Jan
    Absence element
    accual bands:
    6) It creates 4 elements , and I amattaching the recurring plan element to the employee
    7) when i navigate SSHR, give the employee annual leave and click on balance tab its just calculating as per bands that is 20/12 per month and if i give any absence in between its not calculating in increasing order going to zero or negative.
    Can some one help me with this please.

    Hi Avneesh, I did not get exactly what your question is....
    If employee is inbtween accrual bands of 0-5 years he is eligible for 15 days of annual leave....
    and the balance reset is on 1st jan ....
    so If I see the absence balance window, every month its calculting 15/12=1.25 at the end of each month..and dec 31st its 15th days....its intended behavior.
    now when I take absence of 15 days withn a month....its not calculating anything still going with basic calulation, the balances are not getting negative neither zero.

  • HRMS Employee's Absence (Leave) Accrual Days

    Hello,
    I have implemented Oracle Global HRMS. I have created reports for leave balances and I need to show the current accrual for leave balances. The path for the leave value is:- On the People window, click on others, then select absence, Select Annual Leave for the type field then click on the Accruals button, then select the End of Plan tab, the leave balance value is stored in the PROJECT ENTITLEMENT field. I need to display that field on my report but Im unable to find it on the table which it is related to.
    Can anyone please help me out with this as soon as possible...
    Thanking you in advance,
    Tasneem.

    Hi,
    I was referring to the accrual bands button only. So if you cannot find any values under accrual bands button, then tell us what is the accrual formula your are using. Open the accrual formula to see from where it takes the entitlement value. If no value is found in accrual bands button, then the value should either be hard coded inside the formula (very unlikely) or it would have defined in user tables (Other Definitons > Table Values). From where it picks the entitlement value depends upon the type of accrual formula you use.
    Regards.
    KK

  • Accrual Plan Does not work properly

    Hi All,
    I have created an accrual plan nd used PTO_PAYROLL_BALANCE_CALCULATION and PTO_PAYROLL_CARRYOVER formulas, however, I have determine the annual rate and the ceiling but the user can exceeds what I determine in the Accrual Bands.
    Can Anyone help please
    Thanks.

    Are you saying the Accrual balance is going negative and you don't want to let that happen ?
    If that is the case then it is the intended behavior. If you dont want to let negative balances then you need to add this validation in a user hook for the absence API to stop the users from creating absence requests that will result in negative accrual balances.
    Thanks,
    Tilak.

  • Part timer accrual formula - consider date track change

    Needed some help with part timers accrual formula.
    The accrual formula need to prorate the entitlement based on the work hours and accrual bands(years of service).
    The accrual formula should account for date track changes to both the years of service and work hours.
    How can this be achieved?

    This is a common but difficult problem to implement. When I've done this before I've:
    1) Used a looping Accrual Fast Formula inside the main Accrual Fast Formula (like the seeded ones), but
    2) Built a custom User Defined Fast Formula Function to retrieve the next date of change of hours/years service
    3) Called this UDT inside the looping Fast Formula to determine the next change
    4) Prorate accruals from the beginning of the year up until the next date of change
    5) Loop from the date of change going forward
    6) In the next looping iteration call the UDT again to find the next change from now
    7) Prorate accruals from now until the next date of change
    8) Continue 6-7 until there are no more changes this year.
    So in a simple year the looping formula just runs twice: once from the beginning of the year up until the service anniversary and again from the service anniversary to the end of the year. In an example where an employee changes hours it loops three times: once from the beginning of the year up until the hours change (assuming in this case the hours change comes before the service anniversary), then again from the hours change to the service anniversary, and then again from the service anniversary to the end of the year.
    In a complex example with multiple hours changes it can loop as many times as needed.

  • Is Add_Months allowed in a Fast Formula?

    Hi
    Im trying to add the following to the carry over fast formula.
    : Mid_Month_DDMM = to_char(to_date(to_char(ADD_MONTHS(Continuous_Service_Date, +1),'YYYYMM'),'YYYYMM')-1,'DDMM')
    But it seems the formula does not like the "Add_months". Im trying to get the formula to work that when an employees continuous_service_date is not the 1st of the Month the carry over will happen at the end of the month.
    Thanks
    Andrew

    The logic is as follows
    Every 12 months employees forfiet their leave and carry over any balance.
    From the PTO_CARRY_OVER with abit of customisation
    IF ISNULL(OverrideHireDate) = 'Y'
    THEN
    Continuous_Service_Date = Continuous_Service_Date
    ELSE
    Continuous_Service_Date = OverrideHireDate
    Ann_Date_DDMM = to_char(Continuous_Service_Date,'DDMM') /* ----Put this check to make sure 2902 is not concatenated to a non-leap YYYY ------ */
    IF Ann_Date_DDMM = '2902' THEN
    Anniversary_Date = to_date('0103' || to_char(Calculation_Date,'YYYY'),'DDMMYYYY')
    ELSE
    Anniversary_Date = to_date(Ann_Date_DDMM || to_char(Calculation_Date,'YYYY'),'DDMMYYYY')
    **Anniversary_Date = to_date('01' || to_char(Anniversary_Date, 'MMYYYY'), 'DDMMYYYY')**
    The last line makes sure that everyone no matter when you started has their forfieture date on the 1st of their anniversary month.
    I want to us the logic that if your Ann_Date_DDMM does not equal 0101,0102,0103,0104,0105,0106,0107,0108,0109,0110,0111,0112
    then your Anniversary date is the end of the anniversay month.
    So hence my code of : to_char(to_date(to_char(ADD_MONTHS(Continuous_Service_Date, +1),'YYYYMM'),'YYYYMM')-1,'DDMM') that if working will concatinate with to_char(Calculation_Date,'YYYY'),
    So for exampble. My anniversay date is the 13-May-2002.
    On the 13-May-2013 the process is run to work out my forfieture-carryover for the 14th. But now the company wants me to only forfeit on the 31-May-2013
    Calculation_Date = 13-May-2013 but with to_char(Calculation_Date,'YYYY') I get just the 2013 out.
    the code to_char(to_date(to_char(ADD_MONTHS(Continuous_Service_Date, +1),'YYYYMM'),'YYYYMM')-1,'DDMM') should return (and it does in SQL developer) 3105. Concatinated its 31052013 , that would be my new forfeiture - carry over date.
    So would be great to get the add_months working in the formula itself. Else if you can tell me where I can find the code for the seeded Continuous_Service_date then I can do the add_months in the package for the function.
    Below is the full Formula:
    /* Default Statements */
    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 Statements */
    INPUTS ARE
    Calculation_Date (date)
    ,Accrual_Term (text)
    /* trace=za_set_trace_on('CARRYOVER')*/
    /*--------------------------------- Formula Body -------------------------------------*/
    /* ------- Check whether the Continuous Service Date was Set or the Hire Date. ------ */
    /* ------- Accordingly set the Continuous Service Date. ------ */
    IF ACP_CONTINUOUS_SERVICE_DATE WAS DEFAULTED THEN
    Continuous_Service_Date = ACP_SERVICE_START_DATE
    ELSE
    Continuous_Service_Date = ACP_CONTINUOUS_SERVICE_DATE
    OverrideHireDate = KPMG_GET_OVERRIDE_HIRE_DATE(Calculation_Date)
    IF ISNULL(OverrideHireDate) = 'Y'
    THEN
    Continuous_Service_Date = Continuous_Service_Date
    ELSE
    Continuous_Service_Date = OverrideHireDate
    Ann_Date_DDMM = to_char(Continuous_Service_Date,'DDMM') /*Andrew Campbell 30-November-2012*/
    /*Mid_Month_DDMM = to_char(to_date(to_char(ADD_MONTHS(Continuous_Service_Date, +1),'YYYYMM'),'YYYYMM')-1,'DDMM')*/
    /* ----Put this check to make sure 2902 is not concatenated to a non-leap YYYY ------ */
    IF Ann_Date_DDMM = '2902' THEN
    Anniversary_Date = to_date('0103' || to_char(Calculation_Date,'YYYY'),'DDMMYYYY')
    ELSE
    Anniversary_Date = to_date(Ann_Date_DDMM || to_char(Calculation_Date,'YYYY'),'DDMMYYYY')
    Anniversary_Date = to_date('01' || to_char(Anniversary_Date, 'MMYYYY'), 'DDMMYYYY')
    /* Set Accrual Term to Previous, the requirement is to run CO once per month at the end of the */
    /* month for all assgs with Anniversary Dates during that month */
    IF Accrual_Term = 'PREVIOUS' THEN
    Effective_Date = add_years(add_days(Anniversary_Date, -1), -1)
    ELSE
    Effective_Date = add_days(Anniversary_Date,-1)
    /* For months in later half of the Year and process running for Six Monthly run then reduce */
    /* the Effective Date by one year. */
    Anniversary_Month = to_char(Anniversary_Date,'MM')
    IF (Calculation_Date < Anniversary_Date)
    AND ((Anniversary_Month = '07')
    OR (Anniversary_Month = '08')
    OR (Anniversary_Month = '09')
    OR (Anniversary_Month = '10')
    OR (Anniversary_Month = '11')
    OR (Anniversary_Month = '12')) THEN
    Effective_Date = add_years(Effective_Date, -1)
    /* Effective_Date = Effective_Date */ /* koos */
    /* Calculate Previous Cycle's Start Date,End Date and Six Monthly Anniversary Date in Current Cycle */
    Effective_End_Date = Effective_Date
    Effective_Start_Date = add_months(Effective_End_Date, -12)
    /* Semi_Anniversary_Date = add_months(Effective_End_Date,6) */
    Semi_Anniversary_Date = add_months(Effective_End_Date,12) /* Change forfeiture to 12 months after carry over */
    /* ------- Calculate the Number of Years completed -------*/
    Years_service = floor(months_between(add_days(Effective_date,1), Continuous_Service_Date) / 12)
    /* This PROCESS flag is set up so that CO will not run for those employees with eff dates -*/
    /* ----------------------------- before calculation_date --------------------------------------*/
    IF /* (Calculation_Date >= Effective_Date) */ /* Koos */
    (((to_char(Effective_Date,'MMYYYY') = to_char(Calculation_Date,'MMYYYY'))
    AND (last_day(Effective_Date) <> Effective_Date ))
    OR ((to_char(Anniversary_Date,'MM') = to_char(Calculation_Date,'MM'))
    AND (last_day(Effective_Date) = Effective_Date ))) THEN
    /* Calculating for Yearly Run */
    Process = 'YES'
    /* Expiry_Date = add_months(Effective_Date, 6) */
    Expiry_Date = add_months(Effective_Date, 12) /* Change forfeiture to 12 months after carry over */
    /* After 1 year set the date for calculating for Six Months period */
    IF Years_service > 1 THEN
    /* Effective_start_Date = add_months(Effective_start_Date,6) */
    Effective_start_Date = add_months(Effective_start_Date,12) /* Change forfeiture to 12 months after carry over */
    Annual_Cal = 1
    ELSE IF /* (Calculation_Date < add_years(Effective_Date,1)) */ /* Koos */
    (((to_char(Semi_Anniversary_Date,'MMYYYY') = to_char(Calculation_Date,'MMYYYY'))
    AND (last_day(Semi_Anniversary_Date) <> Semi_Anniversary_Date ))
    /* OR ((to_char(add_months(Anniversary_Date,6),'MM') = to_char(Calculation_Date,'MM')) */
    OR ((to_char(add_months(Anniversary_Date,12),'MM') = to_char(Calculation_Date,'MM')) /* Change forfeiture to 12 months after carry over */
    AND (last_day(Semi_Anniversary_Date) = Semi_Anniversary_Date ))) THEN
    /* Calculating for Six Monthly Run */
    Process = 'YES'
    /* Expiry_Date = add_months(Semi_Anniversary_Date,6) */
    Expiry_Date = Semi_Anniversary_Date /* Koos */
    /* For Semi Annual run set the date for calculation for Six Months */
    IF Years_service > 0 THEN
    Effective_start_Date = Effective_end_Date
    Effective_end_Date = Semi_Anniversary_Date
    Annual_Cal = 0
    ELSE
    /* If neither Annual or Semi Annual Run then Donot process */
    Process = 'NO'
    Expiry_Date = add_years(Effective_Date, 1)
    Annual_Cal = 1
    /* --------- Set the Public Variables eg. Maximum Carry Over from the accrual bands ------- */
    IF (GET_ACCRUAL_BAND(years_service) = 0) THEN
    IF Years_service > 1 then
    Max_Carryover = KPMG_GET_ANNUAL_ACCRUAL(Effective_End_Date)
    else
    Max_Carryover = KPMG_GET_ANNUAL_ACCRUAL(Effective_End_Date)
    ELSE
    Max_Carryover = KPMG_GET_ANNUAL_ACCRUAL(Effective_End_Date)
    /*---------------------- Return Statements --------------------------------------
    Effective_date is the last date of an accrual term
    Expiry_date is the date by which employees must use carried over PTO or lose it.
    /*trace_off = za_set_trace_off*/
    RETURN Max_Carryover, Effective_date, Expiry_Date, Process
    Thanks

  • Creating a medical leave plan

    Hi everyone, I'm being asked to create a medical leave plan for the organization im with. No exp in Oracle HR prior to this.
    The reqs are below.
    Pro-ration of 7 days for new joiners is based on days of the year served. If employee hire date = 6 Feb 2012, that means he is only applicable to apply this leave after 5 May 2012 (90 days of service). The leave available for him in the year of 2012 will be (number day of service/366)* 7 = 330/366 * 7 = 6 days.
    This is paid medical leave so no effect to payroll.
    However, i've created a leave element that is of type recurring. However i noticed that when trying to create a leave plan it does not show me any 'recurring' element types on the config screen.
    Additionally if i create a non-recurring element type then they are only valid for the current pay period.
    Oracle documentation is no much help and unfortunately, trying to check metalink notes dont help as i need a "Valid support identifier" when logging in, which no one in my organization has any idea about.
    Any help is appreciated. I could paypal you a fair amount if you could walk me though the end to end process for this.
    thanks

    Hi Razi,
    Thanks for the response.
    Some questions if you dont mind:
    1. You need to create a Leave Element of Type Absence.
    Should the element be of type recurring or non-recurring?
    2. Create a link of Element with Payroll. ( Or at whatever Level , u need to link it e.g: organization,Employee type , etc)
    Ok, i think i know how to do this, will link to the payroll
    3. Make a Leave Type using that Element.
    Ok
    4. You need to write a User Hook ( a Validation to restrict Employee to raise a leave after 90 days of Employment)
    How do i do this? I'm exploring to use accrual plans with the accrual bands with 'fast-formulas' is that the user hook?
    5. Also a User Hook to restrict employee only for applying applicable Medical Leave as per your formula : (number day of service in current year /366)* 7
    Where exactly is the setup screen for this?
    thanks!

  • How to rollback process of carry over leave as already ran

    Dear,
    We have configured setup carry over leave and having accrual band around 30 for a year, However, our policy regarding carry forward is maximum 10 days, but user forgot to mentione it in accrual band under the accrual plan, that process has already been run, now i want to do this the same process first removing previous on which was run at the end of last year,
    Kindly suggest, how could we rollback the carry over process.
    --thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Thanks for support.
    Secondly, could y pls tell me, how to validate user don't cross accrual ban as defined in accrual band setup either user apply through SSHR or forms base.
    is there any standard option.
    --thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Fast formul

    hi,
    i want to make negative carry over not possible
    In the accrual band ,the carry over is 20 and ceiling is 99999 means an employee can accrue any no of leave.but negative carry over not possible.
    if i write code like this it is not coming.
    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)
    Effective_Date = to_date('3112'||to_char(Calculation_date, 'YYYY'), 'DDMMYYYY')
    IF (Accrual_term = 'PREVIOUS') THEN
    Effective_date = ADD_YEARS(Effective_Date, -1)
    Expiry_Date = add_years(effective_date, 99)
    IF ACP_CONTINUOUS_SERVICE_DATE WAS DEFAULTED THEN
    Continuous_Service_Date = ACP_SERVICE_START_DATE
    ELSE
    Continuous_Service_Date = ACP_CONTINUOUS_SERVICE_DATE
    Years_service = floor(months_between(Effective_date, Continuous_Service_Date) / 12)
    IF (GET_ACCRUAL_BAND(years_service) = 0) THEN
    L_Max_carryover = GET_NUMBER('MAX_CARRY_OVER')
    ELSE
    L_Max_carryover = 0
    Max_Carryover = L_Max_carryover
    L_tot_carryover = GET_CARRY_OVER(Effective_Date,to_date('0101'||to_char(Effective_Date,'YYYY'), 'DDMMYYYY'))
    IF L_tot_carryover <0 THEN
    (Max_Carryover = 0)
    Process = 'YES'     
    RETURN Max_Carryover, Effective_date, Expiry_Date, Process
    pls help,
    tnx

    Per ESP SP 5 release , below OS are supported which should be compatible with API:
     Red Hat Enterprise Linux Release 5.8, 32-bit (and all 5.x minor versions below)
     Red Hat Enterprise Linux Release 5.8, 64-bit (and all 5.x minor versions below)
     Red Hat Enterprise Linux Release 6.3, 32-bit (and all 6.x minor versions below)
     Red Hat Enterprise Linux Release 6.3, 64-bit (and all 6.x minor versions below)
     SuSE Linux Enterprise Server 11, 64-bit
    The latest JDK i have seen working on a customer install is  jdk1.6.0_45.
    Probably you can try update 81 and see if you run into any issues.

  • PTO Simple Carry Over Formula

    Hi All:
    I have this case and I need help from any body who is experience in accrual formulas.
    I'm using the PTO_SIMPLE_MULTIPLIER and PTO_SIMPLE_CARRYOVR formulas in Accrual Plans form.
    I'm not defining any accrual bands in accrual plans formula and the case is I need to reset the net entitlment balace to be 0 for any employee in yearly basis.
    How I can configure this case in in PTO_SIMPLE_CARRYOVER formula ?
    Please Advice.
    Regards;

    not sure i understood this well. when you say reset net entitlement to 0, do you mean you do not want to carry over anything to the next year? If so then modify the carry over formula to set maximum to 0.
    If you are not using accrual bands then the best solution is create a pl/sql packaged function that calculates the entitlements correctly and call that function in the formula.
    there are lot of posts by very helpful Duncan Casemore explaining how to write accrual formulas..a bit of serach will give you lot of informaiton on that.
    Cheers

  • Accrual Formula Archive Table Issue?

    Hello Experts,
    I customized PTO_PAYROLL_BALANCE_CALCULATION as per our business requirment. High Level of the plan- It is based on the overtime an employee works per pay period and depending on overtime worked an employee gets time and half times. For example if the emp works 12 hours he accrues 18 hours of benefit time(formula calculating fine). To meet the business requirment we included employees who are hired in the mid of the pay period , here the issue is when the archive process is run
    We are unable to populate the employee's period accural(acrrued in a particular pay period) and if we populate the period accrual we are unable to process period accrual for an employee terminated in middle of the pay period. The requirement is to populate both in the archive table. ie to include both period accrual and mid pay period terminated employees.
    Below is the customized formula. Thanks much and appreciate your time and response in advance.
    DEFAULT FOR ACP_START IS 'HD'
    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)
    default for Accrual_Start_Date is '4712/12/31 00:00:00' (date)
    default for Accrual_Latest_Balance is 0
    INPUTS ARE
    Calculation_Date (date),
    Accrual_Start_Date (date),
    Accrual_Latest_Balance
    /* bug 4047666*/
    prm_Accrual_Start_Date (date) = Accrual_Start_Date
    prm_Calculation_Date (date) = Calculation_Date
    /* bug 4047666*/
    E = CALCULATE_PAYROLL_PERIODS()
    For the payroll year that spans the Calculation Date
    get the first days of the payroll year. If we have a latest balance,
    we use the Accrual Start Date.
    Calculation_Period_SD = get_date('PAYROLL_PERIOD_START_DATE')
    Calculation_Period_ED = get_date('PAYROLL_PERIOD_END_DATE')
    /**XXX CUSTOM **/
    /*Calculation_Date = get_date('PAYROLL_PERIOD_END_DATE')*/
    Payroll_Year_First_Valid_Date = GET_DATE('PAYROLL_YEAR_FIRST_VALID_DATE')
    IF (Calculation_Date <> Calculation_Period_ED) AND
    (Calculation_Period_SD > Payroll_Year_First_Valid_Date) THEN
    E = GET_PAYROLL_PERIOD(ADD_DAYS(Calculation_Period_SD,-1))
    Calculation_Period_SD = get_date('PAYROLL_PERIOD_START_DATE')
    Calculation_Period_ED = get_date('PAYROLL_PERIOD_END_DATE')
    ELSE IF (Calculation_Period_SD = Payroll_Year_First_Valid_Date) AND
    (Calculation_Date <> Calculation_Period_ED) THEN
    Calculation_Period_ED = ADD_DAYS(Calculation_Period_SD,-1)
    Set the Calculation_Date to the Termination Date / Enrollment end date if not defaulted
    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 payroll period prior to the Calculation Date and ensure that it is within the
    Payroll Year (if the Calculation Date is the End of a Period then use that period)
    E = GET_PAYROLL_PERIOD(Calculation_Date)
    Calculation_Period_SD = get_date('PAYROLL_PERIOD_START_DATE')
    Calculation_Period_ED = get_date('PAYROLL_PERIOD_END_DATE')
    /**XXX CUSTOM **/
    /*Calculation_Date = get_date('PAYROLL_PERIOD_END_DATE')*/
    IF (Calculation_Date <> Calculation_Period_ED) AND
    (Calculation_Period_SD > Payroll_Year_First_Valid_Date) THEN
    E = GET_PAYROLL_PERIOD(ADD_DAYS(Calculation_Period_SD,-1))
    Calculation_Period_SD = get_date('PAYROLL_PERIOD_START_DATE')
    Calculation_Period_ED = get_date('PAYROLL_PERIOD_END_DATE')
    ELSE IF (Calculation_Period_SD = Payroll_Year_First_Valid_Date) AND
    (Calculation_Date <> Calculation_Period_ED) THEN
    Calculation_Period_ED = ADD_DAYS(Calculation_Period_SD,-1)
    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
    Total_Accrued_PTO = 0
    E = PUT_MESSAGE('HR_52796_PTO_FML_CSD')
    E = set_date('CONTINUOUS_SERVICE_DATE', ACP_CONTINUOUS_SERVICE_DATE)
    ELSE
    E = set_date('CONTINUOUS_SERVICE_DATE', ACP_CONTINUOUS_SERVICE_DATE)
    Determine the Accrual Start Rule and modify the start date of the accrual calculation accordingly
    N.B. In this calculation the Accrual Start Rule determines the date from which a person may first accrue
    PTO. The Ineligibility Rule determines the period of time during which the PTO is not registered.
    Once this date has passed the accrual is registered from the date determined by the Accrual Start Rule.
    Continuous_Service_Date = get_date('CONTINUOUS_SERVICE_DATE')
    IF (ACP_START = 'BOY') THEN
    First_Eligible_To_Accrue_Date =
    to_date('01/01/'||to_char(add_months(Continuous_Service_Date, 12), 'YYYY'),
    'DD/MM/YYYY')
    ELSE IF (ACP_START = 'PLUS_SIX_MONTHS') THEN
    First_Eligible_To_Accrue_Date = add_months(Continuous_Service_Date,6)
    ELSE IF (ACP_START = 'HD') THEN
    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_START <> 'PLUS_SIX_MONTHS' AND
    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
    If the employee is eligible to accrue before the start of this year,
    we must get the period dates for the first period of the year.
    Otherwise, we do not need these dates, as we will never accrue that
    far back.
    IF (not Accrual_Start_Date was defaulted) AND
    ((Calculation_Date < Accrual_Ineligibility_Expired_Date) OR
    (Accrual_Start_Date > Accrual_Ineligibility_Expired_Date)) THEN
    * This function checks for unprocessed plan element entries, and
    * returns the EE effective start date of the earliest it finds. This may
    * be useful if we amend the design to process a partial year starting at
    * this date.
    * At the moment, however, we simply recalculate for the entire plan term
    * in these circumstances, so Adjusted_Start_Date is never used
    Adjusted_Start_Date = Get_Start_Date(Accrual_Start_Date,
    Payroll_Year_First_Valid_Date)
    /* Check whether RESET_PTO_ACCRUAL action parameter is defined and set to Y */
    /* If yes, then we need to calculate from the beginning */
    Reset_Accruals = Reset_PTO_Accruals()
    /* Check for retrospective Assignment changes */
    /* Return earliest effective date */
    Earliest_AsgUpd_Date = Get_Earliest_AsgChange_Date
    ( 'PTO Event Group',
    add_days(Calculation_Period_SD,-1),
    Calculation_Period_ED,
    Accrual_Start_Date)
    New_Adj_Start_Date = LEAST(Adjusted_Start_Date,
    Earliest_AsgUpd_Date)
    IF ((New_Adj_Start_Date < Accrual_Start_Date) OR
    (Reset_Accruals = 'TRUE')) THEN
    Process_Full_Term = 'Y'
    ELSE
    Process_Full_Term = 'N'
    ELSE
    Process_Full_Term = 'Y'
    Latest_Balance = 0
    IF (Process_Full_Term = 'Y') THEN
    /* Ensure the Payroll Year Start Date gets reset if caculating */
    /* from the beginning of the year. */
    E = SET_DATE('PAYROLL_YEAR_SD', Payroll_Year_First_Valid_Date)
    IF (Process_Full_Term = 'N') AND
    (Accrual_Start_Date >= First_Eligible_To_Accrue_Date) THEN
    E = GET_PAYROLL_PERIOD(Adjusted_Start_Date)
    Payroll_Year_1st_Period_SD = get_date('PAYROLL_PERIOD_START_DATE')
    Payroll_Year_1st_Period_ED = get_date('PAYROLL_PERIOD_END_DATE')
    Latest_Balance = Accrual_Latest_Balance
    Effective_Start_Date = Adjusted_Start_Date
    ) /* XXX Custom to include mid pay period hires*/
    ELSE IF First_Eligible_To_Accrue_Date <= Payroll_Year_First_Valid_Date THEN
    IF (not Accrual_Start_Date was defaulted) THEN
    Latest_Balance = Accrual_Latest_Balance
    ELSE
    Latest_Balance = 0
    E = GET_PAYROLL_PERIOD(Payroll_Year_First_Valid_Date)
    Payroll_Year_1st_Period_SD = get_date('PAYROLL_PERIOD_START_DATE')
    Payroll_Year_1st_Period_ED = get_date('PAYROLL_PERIOD_END_DATE')
    Effective_Start_Date = Payroll_Year_First_Valid_Date
    ELSE
    Get the first full payroll period following the First_Eligible_To_Accrue_Date
    (if it falls on the beginning of the period then use that period)
    IF (not Accrual_Start_Date was defaulted) THEN
    Latest_Balance = Accrual_Latest_Balance
    ELSE
    Latest_Balance = 0
    E = GET_PAYROLL_PERIOD(First_Eligible_To_Accrue_Date )
    First_Eligible_To_Accrue_Period_SD = get_date('PAYROLL_PERIOD_START_DATE')
    First_Eligible_To_Accrue_Period_ED = get_date('PAYROLL_PERIOD_END_DATE')
    /* IF First_Eligible_To_Accrue_Date <> First_Eligible_To_Accrue_Period_SD THEN
    E = GET_PAYROLL_PERIOD(add_days(First_Eligible_To_Accrue_Period_ED,1))
    First_Eligible_To_Accrue_Period_SD = get_date('PAYROLL_PERIOD_START_DATE')
    First_Eligible_To_Accrue_Period_ED = get_date('PAYROLL_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')
    ) */ /* XXX Custom to include mid pay period hires*/
    Payroll_Year_1st_Period_SD = First_Eligible_To_Accrue_Period_SD
    Payroll_Year_1st_Period_ED = First_Eligible_To_Accrue_Period_ED
    Effective_Start_Date = First_Eligible_To_Accrue_Date
    Effective_Start_Date = GREATEST(Effective_Start_Date, ACP_ENROLLMENT_START_DATE)
    Output messages based on calculated date
    IF (Early_End_Date < Payroll_Year_1st_Period_ED) THEN
    Total_Accrued_PTO = 0
    E = PUT_MESSAGE('HR_52794_PTO_FML_ASG_TER')
    If (Calculation_Period_ED < Payroll_Year_1st_Period_ED) THEN
    Total_Accrued_PTO = 0
    E = PUT_MESSAGE('HR_52795_PTO_FML_CALC_DATE')
    Determine the date on which PTO actually starts accruing based on Hire Date,
    Continuous Service Date and plan Enrollment Start Date. Remember, we have
    already determined whether to user hire date or CSD earlier in the formula.
    If this date is after the 1st period and the fisrt eligible date then
    establish the first full payroll period after this date
    (if the Actual Start Date falls on the beginning of a payroll period then
    use this period)
    Enrollment_Start_Date = ACP_ENROLLMENT_START_DATE
    Actual_Accrual_Start_Date = GREATEST(Enrollment_Start_Date,
    Continuous_Service_Date,
    Payroll_Year_1st_Period_SD)
    Determine the actual start of the accrual calculation
    IF (Actual_Accrual_Start_Date > Payroll_Year_1st_Period_SD AND
    Actual_Accrual_Start_Date > First_Eligible_To_Accrue_Date) THEN
    E = GET_PAYROLL_PERIOD(Actual_Accrual_Start_Date)
    Accrual_Start_Period_SD = get_date('PAYROLL_PERIOD_START_DATE')
    Accrual_Start_Period_ED = get_date('PAYROLL_PERIOD_END_DATE')
    IF Actual_Accrual_Start_Date > Accrual_Start_Period_SD THEN
    ( E = GET_PAYROLL_PERIOD(Actual_Accrual_Start_Date) /* XXX CUSTOM*/
    Accrual_Start_Period_SD = get_date('PAYROLL_PERIOD_START_DATE')
    Accrual_Start_Period_ED = get_date('PAYROLL_PERIOD_END_DATE')
    E = GET_PAYROLL_PERIOD(add_days(Accrual_Start_Period_ED,1))
    Accrual_Start_Period_SD = get_date('PAYROLL_PERIOD_START_DATE')
    Accrual_Start_Period_ED = get_date('PAYROLL_PERIOD_END_DATE')
    If the Actual Acrual 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_Date > Payroll_Year_1st_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 = Payroll_Year_1st_Period_SD
    Accrual_Start_Period_ED = Payroll_Year_1st_Period_ED
    Now set up the information that will be used in when looping
    through the payroll 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)
    IF (Process_Full_Term = 'N') THEN
    E = set_number('TOTAL_ACCRUED_PTO', Latest_Balance)
    ELSE
    E = set_number('TOTAL_ACCRUED_PTO', 0)
    Initialize Band Information
    E = set_number('ANNUAL_RATE', 0)
    E = set_number('UPPER_LIMIT', 0)
    E = set_number('CEILING', 0)
    E = LOOP_CONTROL('PTO_PAYROLL_PERIOD_ACCRUAL')
    Total_Accrued_PTO = get_number('TOTAL_ACCRUED_PTO') - Latest_Balance
    IF Accrual_Start_Period_SD <= Calculation_Period_SD THEN
    Accrual_end_date = Calculation_Period_ED
    IF Process_Full_Term = 'Y' AND
    Effective_Start_Date > Actual_Accrual_Start_Date THEN
    Effective_Start_Date = Actual_Accrual_Start_Date
    Effective_End_Date = Calculation_Date
    /* bug 4047666*/
    IF Process_Full_Term = 'N' AND NOT (Accrual_Start_Date WAS DEFAULTED)
    AND NOT (Accrual_Latest_Balance WAS DEFAULTED)
    AND prm_Accrual_Start_Date > prm_Calculation_Date THEN
    Effective_Start_Date = ADD_DAYS(Effective_End_Date,1)
    ELSE
    /* bug 4047666*/
    IF Effective_Start_Date >= Effective_End_Date THEN
    Effective_Start_Date = least(Effective_End_Date, Accrual_Start_Period_SD)
    RETURN Total_Accrued_PTO, Effective_start_date, Effective_end_date, Accrual_end_date
    Regards
    Edited by: user13149420 on Sep 5, 2012 2:50 PM

    issue in tcode : OAC0.. Content server path was incorrect.

  • Accrual Rate

    Dear Gurus,
    My client requirement is like they have Annual Rate is 30 Per year and Accrual Rate is different in different months like in Jan it will 2, in Feb it will 1, in Mar it will 3, in Apr it will 2 like this only every month it is different Accrual Rate but the total is (Annual Rate) is 30. Kindly suggest how i will capture it in system and in which Accrual Formula will use it. { Do I need to create a UDT like once it is JANUARY then Accrual_Rate is 2, by using function GET_TABLE_VALUE }
    Thanks,
    Shobhit

    Dear Sanjay sir,
    I have written the formula, for every BAND Ceiling (total entitlement) is working and in month JAN Accrual Rate is correct for every Bands but from FEB accrual rate is not working correct, it is accumulating some different amounts. Kindly find my Accrual Formula and please let me know where i am doing mistake , i will edit that code.
    FORMULA ********
        NAME : PTO_SIMPLE_BALANCE_MULTIPLIER
        This formula calculates the start and end dates for out simple multiplier.
        This formula calculates the dates between which an assignment is to accrue.
        It is based on PTO_SIMPLE_MULTIPLIER, but has been amended to allow its
        use in the new payroll balance functionality. It may not be used out of the box
        but must be amended, according to the documentaion, by inserting the
        name of the database item which was created with your defined balance.
        This defined balance should have been created immediately after the
        accrual plan.
    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)
    Default for Accrual_Start_Date is '4712/12/31 00:00:00' (date)
    Default for Accrual_Latest_Balance is 0
    DEFAULT FOR ASG_GRADE IS '0'
    INPUTS ARE
    Calculation_Date (date),
    Accrual_Start_Date (date),
    Accrual_Latest_Balance
    MONT=SUBSTR(TO_CHAR(Calculation_Date,'DD-MON-YYYY'),4,3)
    IF ASG_GRADE WAS NOT DEFAULTED THEN 
    (x=TO_NUMBER(GET_TABLE_VALUE('BMC_NL_ACRL_CEILING2000','BAND',ASG_GRADE))) /* this table for entitlement for one year with their BAND */
    E = SET_NUMBER('CEILING', X)
    (A=TO_NUMBER(GET_TABLE_VALUE('BMC_NL_ACRL_RATING2000',MONT,ASG_GRADE))) /* this table for monthly accrual rate, like if BAND is 1 and month is JAN the Accrual Rate is 2 */
    E = SET_NUMBER('ACCRUAL_RATE',A )
    Accruing_Frequency = 'M'   /* Month */
    Accruing_Multiplier = 1
    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)
    IF Accrual_Start_Date < Beginning_Of_Calculation_Year THEN
      Accrual_Start_Date = Beginning_Of_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 < First_Period_ED) THEN
        Total_Accrued_PTO = 0
        E = PUT_MESSAGE('HR_52794_PTO_FML_ASG_TER')
      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_Date <> Calculation_Period_ED) THEN
         E = GET_PERIOD_DATES(ADD_DAYS(Calculation_Period_SD,-1),
                                                    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_ED) 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_SD) THEN
        Total_Accrued_PTO = 0
        E = PUT_MESSAGE('HR_52796_PTO_FML_CSD')
        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)
    Latest_Balance = 0
    IF (not Accrual_Start_Date was defaulted) AND
       ((Calculation_Date < Accrual_Ineligibility_Expired_Date) OR
        (Accrual_Start_Date > Accrual_Ineligibility_Expired_Date)) THEN
      Adjusted_Start_Date = Get_Start_Date(Accrual_Start_Date,
                                           Beginning_Of_Calculation_Year)
      /* Check whether RESET_PTO_ACCRUAL action parameter is defined */
      /* If yes, then we need to calculate from the beginning         */
      Reset_Accruals = Reset_PTO_Accruals()
      IF ((Adjusted_Start_Date < Accrual_Start_Date) OR
          (Reset_Accruals = 'TRUE'))  THEN
        Process_Full_Term = 'Y'
      ELSE
        Process_Full_Term = 'N'
    ELSE
      Process_Full_Term = 'Y'
    IF (Process_Full_Term = 'N') AND
       (Accrual_Start_Date >= First_Eligible_To_Accrue_Date) THEN
      E = GET_PERIOD_DATES(Adjusted_Start_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')
      Latest_Balance = Accrual_Latest_Balance
      Effective_Start_Date = Accrual_Start_Date
    ELSE IF First_Eligible_To_Accrue_Date > Beginning_Of_Calculation_Year THEN
      IF (not Accrual_Start_Date was defaulted) THEN
        Latest_Balance = Accrual_Latest_Balance
      ELSE
        Latest_Balance = 0
      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_Date <> First_Eligible_To_Accrue_Period_SD THEN
           E = GET_PERIOD_DATES(add_days(First_Eligible_To_Accrue_Period_ED,1),
                                                      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')
      Effective_Start_Date = First_Eligible_To_Accrue_Date
    ELSE
      IF (not Accrual_Start_Date was defaulted) THEN
        Latest_Balance = Accrual_Latest_Balance
      ELSE
        Latest_Balance = 0
      First_Eligible_To_Accrue_Period_SD  = First_Period_SD
      First_Eligible_To_Accrue_Period_ED  = First_Period_ED
      Effective_Start_Date = Beginning_Of_Calculation_Year
    /*start of 4733782*/
    Effective_Start_Date = GREATEST(Effective_Start_Date, ACP_ENROLLMENT_START_DATE)
    /*end of 4733782*/
       Determine the date on which PTO actually starts accruing based on Hire Date,
       Continuous Service Date and plan Enrollment Start Date. Remember, we have already determined
       whether to user hire date or CSD earlier in the formula.
       If this date is after the 1st period and the fisrt eligible date then establish the first full period
       after this date (if the Actual Start Date falls on the beginning of a period then use this period)
    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 Actual_Accrual_Start_Date > Accrual_Start_Period_SD THEN
              E = GET_PERIOD_DATES(add_days(Accrual_Start_Period_ED,1),
                                   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 Acrual 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)
      IF (Process_Full_Term = 'N') THEN
        E = set_number('TOTAL_ACCRUED_PTO', Latest_Balance)
      ELSE
        E = set_number('TOTAL_ACCRUED_PTO', 0)
      E = LOOP_CONTROL('PTO_SIMPLE_PERIOD_ACCRUAL')
      Total_Accrued_PTO = get_number('TOTAL_ACCRUED_PTO') - Latest_Balance
    ELSE
      Total_Accrued_PTO = 0
    IF Accrual_Start_Period_SD <= Calculation_Period_SD THEN
      Accrual_end_date = Calculation_Period_ED
    IF Process_Full_Term = 'Y' AND
       Effective_Start_Date > Actual_Accrual_Start_Date THEN
      Effective_Start_Date = Actual_Accrual_Start_Date
    Effective_End_Date = Calculation_Date
    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
    Thanks & Regards,
    Shobhit

  • How to ensure that an accrual (FBS1) that was cleared and reversed/reset (FBRA) does not affect the books while being in open items (FAGLB03)?

    At first the user created an accrual using FBS1 for reversal on 5/1/2015.
    This created a clearing document.
    Then it was mistakenly reversed by the user for 5/1/2015 by using F.81
    This also created a clearing document.
    Based on advice in the following thread: Delete reverse accrual/defferal documents | SCN ,
    the user used FBRA to reset and reverse the document. We are unsure if the reset and reverse command was used or just the reset choice.
    Now the accrual value is in the respective accounts with an open status (i.e. red button). Does this mean that the entry has already been discarded and it won't affect the accounts? Or does one then use FB50 to reverse the effects of the accrual in the current and next month?

    Hi
    I guess that the user has not reverse the transaction as its still shows as open item in 30 /4 .. so I belive that you need to use fb50 or simply use FBR2 and enter the original entry no and the choose (generate reversal posting option )..
    regards
    mahmoud el nady

Maybe you are looking for

  • Using Grep to change case in 2nd of a two word string

    Hello all I found out after completing my project that I had made a big boo boo. I have multiple (hundreds) 2 word botanical names of plants which are all located after a certain heading style throughout 400 pages. The first word in this name is capi

  • Can't view XML Publisher document from JDeveloper environment

    Something has happened to my JDeveloper environment so that I can no longer view XML/BI Publisher output in the JDeveloper runtime web pages. I have developed pages using both DocumentHelper.getOutputURL and TemplateHelper.processTemplate functions.

  • Accepted domains in Exchange SAN certificate

    Hi All, I am having few queries please clarify me . In my environment ,i having the accepted domains list like below  xyz.com abc.com All the users in my organisation is having the primary smtp address as [email protected] and secondary smtp address

  • IWeb 08 - Custom Fonts not loading Anymore

    All, When I had iWeb '06 installed I could use custom fonts when designing and the fonts would display on any computer without having to install them. It seems that iWeb '06 used to load them as images. Now in iWeb '08 that doesn't seem to be the cas

  • Slow startup since Java 6 update 18

    We have a web start app that has worked fine for quite some time. However, it is taking forever to startup on machines running Java 6 Update 18 or later. If I enable the Java console, it starts up rather quickly, and then nothing else happens for a g