9 Replies Latest reply: Sep 25, 2013 7:12 AM by 1038684 RSS

    Leave Accrual

    1038684

      Hi,

       

      I need to calculate the balances for annual leave.for which i am trying to write a query.

      while using PER_UTILITY_FUNCTIONS.Get_Net_Accrual.

      per_accrual_calc_functions.get_absence.

      I am facing this error

      The formula (ACCRUALFormula) could not be executed because the context ASSIGNMENT_ACTION_ID was not set. All the relevant context values must be set before a formula can be executed.

      Please can anyone guide me on this.

        • 1. Re: Leave Accrual
          Vigneswar Battu

          check this -

          Re: Absence Balance Query

           

          Cheers,

          Vignesh

          • 2. Re: Leave Accrual
            1038684

            Thanks

            • 3. Re: Leave Accrual
              1038684

              Hi,

               

              Could you please guide on per_accrual_calc_functions.get_absence function.This function is not returning any value.

              • 4. Re: Leave Accrual
                Vigneswar Battu

                Don't know what you're trying to do.

                What is the complete code you're using ?

                 

                Can you also check -

                Re: HRMS Employee's Absence (Leave) Accrual Days

                 

                If you just need the leave balance, why can not you use - PER_UTILITY_FUNCTIONS.Get_Net_Accrual ?

                • 5. Re: Leave Accrual
                  1038684

                  I am working on a report .Where i am trying to use per_accrual_calc_functions.get_absence(paaf.assignment_id,2061,:END_DATE,:START_DATE) function its returning 0.Please guide.

                  • 6. Re: Leave Accrual
                    1038684

                    select papf.person_id,

                    papf.start_date,

                    papf.employee_number,

                    papf.first_name||' '||papf.last_name,

                    loc.LOCATION_CODE,

                    PER_UTILITY_FUNCTIONS.Get_Net_Accrual(paaf.assignment_id,paaf.payroll_id,papf.business_group_id,-1,:START_DATE,2061,null,null),

                    per_accrual_calc_functions.get_absence(paaf.assignment_id,2061,:END_DATE,:START_DATE),

                    PER_UTILITY_FUNCTIONS.Get_Net_Accrual(paaf.assignment_id,paaf.payroll_id,papf.business_group_id,-1,:END_DATE,2061,null,null)||';'

                    from per_all_people_f papf,

                    per_all_assignments_f  paaf,

                    per_periods_of_service ppos,

                    hr_locations loc

                    where least(nvl(ppos.ACTUAL_TERMINATION_DATE,:END_DATE),:END_DATE) between  papf.effective_start_date and papf.effective_end_date

                    AND least(nvl(ppos.ACTUAL_TERMINATION_DATE,:END_DATE),:END_DATE) between paaf.effective_start_date AND paaf.effective_end_date 

                    AND Hr_Person_Type_Usage_Info.get_user_person_type(least(nvl(ppos.ACTUAL_TERMINATION_DATE,:END_DATE),:END_DATE),papf.person_id) IN ('Permanent Employee')

                    and papf.person_id=paaf.person_id

                    AND paaf.primary_flag='Y'

                    AND ppos.PERIOD_OF_SERVICE_ID=paaf.PERIOD_OF_SERVICE_ID

                    and loc.LOCATION_ID=paaf.LOCATION_ID

                    AND least(nvl(ppos.ACTUAL_TERMINATION_DATE,:END_DATE),:END_DATE) between :START_DATE AND :END_DATE

                    and loc.LOCATION_CODE like nvl(:LOCATION,'%')

                    order by loc.LOCATION_CODE,papf.first_name||' '||papf.last_name asc

                    • 7. Re: Leave Accrual
                      Vigneswar Battu

                      Works perfect for me -

                      select per_accrual_calc_functions.get_absence(25652,10061,'31-DEC-2013','1-JAN-2013') from dual;

                       

                      You will have to make sure all the parameters you're passing are correct.

                      Just try it for a single assignment and see what it returns.

                      • 8. Re: Leave Accrual
                        1038684

                        No matter what i am passing its still returning zero ... is there anything thing that i am missing out on please guide.

                        • 9. Re: Leave Accrual
                          Vigneswar Battu

                          Check the code mate-

                          Desc per_accrual_calc_functions.get_absence

                          You will find a cursor in the package function, which you can debug.. is hardly a couple of lines code.

                           

                          Cheers,

                          Vignesh