Friday 8 November 2013

Fast formula calculation of employee elements in payroll

Hi,
I would like to give you a brief introduction on creation of employee, element, creation of fast formula and attaching this fast formula to element for payroll calculation.

This post includes - Employee creation, element creation, balance creation, simple fast formula creation and checking run result values in payroll/SOE

Requirement: Employee is attached with 2 elements (Test element 1 & Test element 2) with user enterable inputs. The third element (Test element 3) which is not directly attached to employee in element entries should return the value in run results/SOE using the below formula:
Element 2 = Amount/30 (Amount is input value of Test element 2)                           
Element3 = 33% of (Element 1 + Element 2)
Where we are covering two requirements:
1.       Calculating pay value of element 2 using its own input value of amount using a fast formula (Direct result)
2.       Using same formula, calculating the 3rd element’s pay value which is indirect result as per the requirement
Solution:
1.       Create an employee
2.       Create element 1 – Create a balance – Feed this balance to this element – Dimension
3.       Create element 2 – Add a new input value of ‘Amount’ – Attach formula to it as in step 6
4.       Create element 3 – non recurring
5.       Define a formula
6.       Assign Formula results to element 2
7.       Assign element 1 and element 2 to employee assignment entries
8.       Run Quick Pay
9.       Check element and balance values in run results/SOE
Step1: Creation of employee
Navigation: HRMS Manager responsibility à People à Enter and Maintain à (Date track if necessary) New (there are also few other ways of creating employee)
Action would be ‘create Employment’ à Fill all the required information à Save
Go to Assignment à Fill all the required in information à Save
We can go to assignment - entries – to attach elements to employee
Tables: per_all_people_f (_f is for date tracked data)
             Per_all_assignments_f

Step 2: Creation of elements
Navigation: HRMS Manager Responsibility àTotal Compensation à Basic à Element description
Test Element 1 is created as recurring earnings element, similarly create Test element 2
Tables: pay_element_types_f


By default the element is created with a input value called ‘Pay Value’.
User enterable is useful to the end user to enter any input value for the element pay value.
And we can use this element pay value as a database item in fast formula. One database item will be created as soon as this check box is checked with the syntax as <Element Name>_<PAY_VALUE>%
Ex: TEST_ELEMENT_1_PAY_VALUE_ENTRY_VALUE
Table: ff_database_items

Create 2nd element with priority greater than the priority of 1st element

Created a new input value called ‘Amount’ which is required/mandatory and user enterable.

Create 3rd element (Test element 3) as non-recurring as this is not useful for calculating the result and should not attach to employee. Main point to be noted is the priority of this element should be greater than the priority of elements 1 and 2. This priority is useful at the time of payroll processing to get balance dimension values.

Step 3: Create element links to link above elements based on eligibility criteria – Define costing and balancing also for costing...etc...

Navigation: HRMS Manager Responsibility àTotal Compensation à Basic à Link
Table(s): select * from pay_element_links_f where element_type_id = --Get element type id from pay_element_types_f


Step 4: Creating a balance for the 1st element to get the dimension value of this balance into the fast formula (which is going to attach to 2nd element)
Navigation: HRMS Manager Responsibility àTotal Compensation à Basic à Balance
Table: pay_balance_types


Add feeds and Dimensions

We can find this feed in element screen after feeding the element to balance, shown below:

Step 5: Define formula – Define global values if required
Navigation: HRMS Manager Responsibility àTotal Compensation à Basic à Global Values (33%)
Table: ff_globals_f


Navigation: HRMS Manager Responsibility àTotal Compensation à Basic à Write Formulas
Table: ff_formulas_f


We can see input values of all elements in ‘Input Values’
Click on ‘Edit’ to open the editor to write the formula
Click on Verify to compile the formula and check if it successfully verified (as given below)

Step 6: Create formula results
Navigation: HRMS Manager Responsibility àTotal Compensation à Basic à Formula Results
Attach formula to Test element 2:
Enter the element name and Find – Enter processing rules and Formula results as shown below:
Note: As the element 2 is direct value from Amount, type is direct result and element 3 value is indirect from element Test Element 3, type is indirect result for element 3 value.

Step 7: Add element 1 and element 2 to employee assignment entries
Navigation: HRMS Manager Responsibility à People à Enter and Maintain à Find the employee (TestEMP) à Assignment à Entries



Step 8: Run the quick pay and check for run results/SOE
Not only for quick pay, this works for payroll process also. Quick pay is only to run payroll for a particular employee.
Navigation: HRMS Manager Responsibility à People à Enter and Maintain à Find the employee (TestEMP) à Assignment à Others à Quick Pay
Tables: pay_run_results, pay_run_result_values


Enter details à Save à Start run
Status will be completed as shown below.

Click on ‘View Results’ to check the values in run results
View results – Run results – Standard Run

As per our requirement,
Element 2 = Amount/30 (Amount is input value of Test element 2)     
                     = 3000/30
                   = 100                     
Element3 = 33% of (Element 1 + Element 2)
                   = 0.33 * (2000 + 100)
                   = 693
à We can see balance values also in view results – Balances – standard window – query for our balance ‘Element 1 Balance_ASG_RUN’

Similarly, we can see SOE- Statement Of Earnings
View results – SOE – Standard Run – shown below



Your suggestions and inputs are most welcome.
Thank You.
Cheers,
Rajesh