Tuesday, August 26, 2014

Difference Between Security Group and Security Profile

Oracle HRMS provides two different security models which enable you to set up security specifically for your enterprise: Standard HRMS security and Security Groups Enabled security (formerly called Cross Business Group Responsibility Security). This note provides an overview of both models and a simplistic setup for the Security Groups Enabled Model.

Standard Security Model
--------------------------
Standard HRMS security restricts access to your enterprises records and data. To set up Standard HRMS Security, you first create responsibilities and then define the windows, menus items, workflows, data and records the user can access. The System Administrator then assigns users to as many of these responsibilities as is required to complete their business tasks.

If you are using Standard HRMS Security, you must ensure that the Enable Multiple Security Groups profile option is set to the default value No. You must then create a security profile for each distinct security grouping of employees your enterprise requires.

You then create a responsibility for each user type you require, for example HR Manager, Branch Manager and Salesperson, and link the security profile and responsibility to a business group. These three elements create a security grouping to which you assign employees.

Security Groups Enabled Model
---------------------------------
The main difference between the two security models is that the Security Groups Enabled model enables your enterprise to share security profiles and responsibilities between users and business groups. This reduces the set up time, and also increases the flexibility of this security model. The key to re-usability is the relationship between the security elements and the users that you create during the set up process.

Attention: Once you have set up Security Groups Enabled security, you cannot revert to Standard HRMS Security.

Security Groups Enabled Model Step-by-Step Setup Information
-------------------------------------------------------------

1. Set Enable Security Groups profile option for the application Oracle Human Resources to YES.

Navigation: System Administration -> Profile -> System. 
Application = Oracle Human Resources, Find %Enable%


2. Define a user. 

Responsibility - System Administrator. 
Navigation: Security -> User -> Define

3. Define a responsibility. 

Responsibility - System Administrator.
Navigation: Security -> Responsibility -> Define

4. Set HR User type profile option for the new responsibility to HR User or HR w/Payroll User.
(HR:User Type)
Navigation: System Administration -> Profile -> System.
Responsibility = <new responsibility>, Find = HR%

5. Run Enable Multiple Security Group process. 
Attention: Once you have set up Security Groups Enabled security, you CANNOT revert to Standard HRMS Security.

Responsibility - HRMS Manager
Navigation: Process & Reports -> Submit Processes and Reports

Select Enable Multiple Security Group.

6. Define a security profile with the restrictions required
(organization or position hierarchies or payroll). 

Responsibility - HRMS Manager
Navigation: Security -> Profiles

7. Assign security profiles. 

Responsibility - HRMS Manager
Navigation: Security -> Assign Security Profiles.
Combine the Username, Business Group and responsibility as of the appropriate start date.

8. Run Security List Maintenance (LISTGEN)

Responsibility - HRMS Manager
Navigation: Process & Reports -> Submit Processes and Reports

Select Security List Maintenance

Saturday, August 23, 2014

How to get Net Entitlement of Leaves in Oracle HRMS Payroll

How to get net entitlement of leaves of an employee on a specific date in oracle hrms?

Please refer to the function code below.

CREATE OR REPLACE FUNCTION CUST_GET_NET_ENTITLEMENT (
   P_ASSG_ID            IN   NUMBER,
   P_PAYROLL_ID         IN   NUMBER,
   P_CALCULATION_DATE   IN   DATE
)
   RETURN NUMBER
IS
   L_START_DATE         DATE;
   L_END_DATE           DATE;
   L_ACC_END_DATE       DATE;
   L_VALUE              NUMBER         := 0;
   L_NET_VALUE          NUMBER (15, 2);
   P_PLAN_ID            NUMBER;
--   L_CALCULATION_DATE   DATE;
BEGIN
   SELECT PAP.ACCRUAL_PLAN_ID
     INTO P_PLAN_ID
     FROM PAY_ACCRUAL_PLANS PAP
    WHERE UPPER (PAP.ACCRUAL_PLAN_NAME) LIKE
             (SELECT UPPER (PETF.ELEMENT_NAME)
                FROM PAY_ELEMENT_ENTRIES_F PEEF, PAY_ELEMENT_TYPES_F PETF
               WHERE PEEF.ELEMENT_TYPE_ID = PETF.ELEMENT_TYPE_ID
                 AND UPPER (PETF.ELEMENT_NAME) LIKE '%PLAN%'
                 AND PETF.PROCESSING_TYPE = 'R'
                 AND PEEF.ASSIGNMENT_ID = P_ASSG_ID
                 AND P_CALCULATION_DATE BETWEEN PEEF.EFFECTIVE_START_DATE
                                            AND PEEF.EFFECTIVE_END_DATE);

/* QUERY ABOVE AUTOMATICALLY GETS THE PLAN ID OF THE ACCRUAL PLAN ID ATTACHED AS ON CALCULATION DATE*/
   PER_ACCRUAL_CALC_FUNCTIONS.GET_NET_ACCRUAL
                           (P_ASSIGNMENT_ID               => P_ASSG_ID,
                            P_PLAN_ID                     => P_PLAN_ID,
                            P_PAYROLL_ID                  => P_PAYROLL_ID,
                            P_BUSINESS_GROUP_ID           => 81,   -- Kindly change your business group id accordingly
                            P_ASSIGNMENT_ACTION_ID        => -1,
                            P_CALCULATION_DATE            => TO_DATE
                                                               (P_CALCULATION_DATE
                                                                )
-- DATE YOU WANT TO CHECK THE NET ENTITLEMENT EX. TO_DATE('01-MAR-2009', 'DD-MON-YYYY')
   ,
                            P_ACCRUAL_START_DATE          => NULL,
                            P_ACCRUAL_LATEST_BALANCE      => NULL,
                            P_CALLING_POINT               => 'FRM',
                            P_START_DATE                  => L_START_DATE,
                            P_END_DATE                    => L_END_DATE,
                            P_ACCRUAL_END_DATE            => L_ACC_END_DATE,
                            P_ACCRUAL                     => L_VALUE,
                            P_NET_ENTITLEMENT             => L_NET_VALUE
                           );
   RETURN NVL (L_NET_VALUE, 0);
EXCEPTION
   WHEN OTHERS
   THEN
      RETURN 0;
END;
/