Oracle R12 HR Payroll “Using Oracle FastFormual For Payroll Calculatins

 

Using Oracle FastFormula for Payroll Calculations

 


 

 

 

 

 

 

 

 

 

 

You use Oracle FastFormula to define and maintain the formulas you need for pay and pay-related calculations.

When you receive Oracle Payroll, some formulas are predefined in your system. You cannot make any changes to these formulas, but you can copy them and modify the copies.

 

To write formulas for elements you define:

1. Design your element and how it will be calculated.

2.Write any formulas required to validate input values (formula type = Element Input Validation).

3.Write a formula, if required, to define the rules for skipping the element during payroll processing (formula type = Element Skip).

4. Define the element, referencing any formulas written in steps 2 and 3

5.Write the formula or formulas for calculating the run results (formula type = Oracle Payroll).

6.Associate each Oracle Payroll type formula with the element in the Formula Result Rules window, and specify what happens to the formula results for this element.

 

Note: You can associate several formulas with a single element, each one for use with a different employee assignment status. You can also use the same formula for more than one element. In this

case, if the formula references pay or input values (through the Inputs statement), each element must have pay and input values with the same names.

 

Writing Formulas for Element Skip Rules

If your payroll policies require periodic or conditional processing of an element, you can write a formula to define when the run should process the element and when it should skip it. For example, your formula could specify:

o process the Union Fees element every three periods, or

o process the Union Fees element every run unless the Union_Fees_Paid balance is greater than 10 000.

You can associate only one element skip rule formula with each element. You must write and validate the formula before you define the element so that you can select the formula from a list on the Element window.

 

To write a formula defining a skip rule:

1. Select formula type Element Skip in the Formulas window.

2. Use as many input values as you require. The formula must set and return a local variable of type text, and this variable must be called skip_flag. If the returned value of this variable begins with the letter y (such as ‘Yes’), all processing for the element is skipped. Otherwise the element processes as normal. The following example of a skip rule formula defines that the Union Fees element is not processed if the Union_Fees_Paid balance is greater than 10 000:

 

IF Union_Fees_Paid > 10000

THEN

skip_flag = ‘yes’

ELSE

skip_flag = ‘no’

RETURN skip_flag

 

Accessing Input Values in Payroll Formulas

 

In many formulas for calculating pay, some or all of the information you need comes from the input values of the element.

As a simple example, suppose you pay some salaried employees using a recurring element called Salary. The Salary element has an input value called annual_salary. You need a formula that divides the input value into

twelve parts:

 

INPUTS ARE annual_salary

Salary = annual_salary/12

RETURN Salary

 

Attention:
When you use an Inputs statement, you need to make sure that none of the input values can have a
value of null because this causes the formula to fail. You can avoid this problem by using the Default

statement.

Using an Inputs statement is the most efficient way to access the input values of the element with which the formula is associated. However, if the formula uses the input values of other elements, it must access the

database items for them. For example, if you want to use the input value annual_salary in the formula to calculate the element Bonus, you use the database item as follows:

 

IF Salary_annual_salary > 20000

THEN

Bonus = bonus_rate * (sales_achieved – sales_threshold)

 

Notice that the database item name is in two parts: the input value (annual_salary) name prefixed by the element name (Salary). This is the naming convention for the database items of element input values.

 

Multiple Entries of Element Input Values

When you define an element, you can enable multiple entries of the element within a payroll period. As a simple example, suppose you use the element Wages to pay some weekly-paid employees. The Wages element has the input value hours_worked. Each week, you regularly make five entries for the input value hours_worked.

To calculate Wages, you can multiply the hours worked each day by the employee’s standard rate from the grade rates table, so that your formula looks like this:

 

INPUTS ARE hours_worked

Wages = hours_worked * standard_rate

RETURN Wages

 

During the payroll run, the formula fires five times, creating five separate pay values, one for each entry.

Now consider using the database item Wages_hours_worked instead of an Inputs statement. The database item for an entry value sums up all the entries made in the payroll period.

This is a great convenience when referring to input value totals for a payroll period. However, you must be sure that it is the totals that you want to use. In this example, using the database item produces the wrong

result.

Wages_hours_worked gives a single value that is the sum of the five entries in each weekly payroll period. When the payroll runs, the formula fires five times, each time calculating wages using the total hours worked in the week.

Attention: If multiple entries are enabled for an element, be careful when using database items for the element’s entry values. These database items hold the sum of all the entries. This includes entries made as indirect formula results during the payroll run.

 

Database Items for Numeric Values Only

Entry value database items are    not created for input values with units of character, date, or time when multiple entries are enabled for the element. This is because entry values of these types cannot be summed over the payroll period. Only numeric values can be summed. Numeric input values are those with units of:

o Hours

o Integer

o Money

o Number

Notice that other database items, such as default, minimum, or maximum, may be created for non-numeric input values.

 

Writing Efficient Payroll Calculation Formulas

The following statements are true as general guidelines for typical payroll runs:

o The longer an element’s formula, the longer its processing time.

o The more elements entered for an assignment, the longer its processing time.

o One element associated with a lengthy formula usually processes faster than two related elements each associated with a short formula.

o The overall number of elements and formulas in the system has little effect on processing efficiency. It is the number of elements per assignment that affects processing time.

 

Formula Format

Use comments and white space freely when entering formulas. This makes the formulas easier to read and understand, and has no effect on performance or memory usage. Use indentation for the same reason, especially when you are using brackets to control the order of processing. It is good practice to include the following information in a comment at the beginning of a formula:

o formula title and short statement of its purpose

o description of formula inputs

o list of variables and constants that may require updating

o description of the input values of the element that receives the formula’s direct result

o explanation of the formula’s calculations

o administrative information such as the name, address and telephone number of an office administering the earnings, deduction, or charge the formula affects

o the dates of formula modifications, the names of those entering the edits, and possibly the reasons for change

Variable Names and Aliases

Use names that are brief yet meaningful to improve readability. Name length has no effect on performance or memory usage. Use Aliases if the names of database items or global values are long.

Input Statements

Use Input statements rather than database items whenever possible. This improves formula processing by as much as a factor of ten. It speeds up the running of your payroll by eliminating the need to access the database for the input values.

Inefficient:

Salary = Salary_annual_salary / 12

RETURN Salary

Efficient:

INPUTS ARE Annual_salary

Salary = Annual_salary / 12

RETURN Salary

Date Literals

Use the TO_DATE function only when the operand is a variable.

Inefficient:

Start_date = TO_DATE ( ’12-JAN-1992′ )

Efficient:

Start_date = ’12-JAN-1992′ (date)

Single Expressions

Use a single expression in straightforward formulas where this does not lead to confusion.

Inefficient:

Temp = Salary / Annualizing_factor

Tax = Temp * 3

Efficient:

Tax = (Salary / Annualizing_factor) * 3

 

Database Items

Do not refer to database items until you need them. People sometimes list at the top of a formula all the database items the formula might need, thinking this helps Oracle FastFormula process more quickly.

However, this in fact slows processing by causing unnecessary database calls.

Inefficient:

S = Salary

A = Age

IF S < 20000 THEN

IF A < 20 THEN

Training_allowance = 30

ELSE

Training_allowance = 0

Efficient:

IF Salary < 20000 THEN

IF Age < 20 THEN

Training_allowance = 30

ELSE

Training_allowance = 0

The first example always causes a database fetch for Age whereas the second only fetches Age if Salary is less than 20000.

 

Defining and Linking a Salary Element

You define a salary element in the Element window.

To define a salary element:

1. Set your effective date to a day on or before the start of the first payroll period for which you want to enter salaries.

2. Enter a name for the element, and select the classification Earnings.

3. Select the Type Recurring.

4. Do not check the Standard check box.

5. Save the element, then choose the Input Values button.

6. In the Input Values window, create one input value to hold the salary value. This is normally the

Pay Value. If you want to associate this element with more than one salary basis, create one input

value for each salary basis.

 

Suggestion:
If the salary basis is different from the payroll periods of the employees who will receive
this element, make this clear in the input value name. For example, if the salary basis is Annual, you could name the input value Annual Salary.

7. You can enter validation criteria for the input value, such as a Minimum and Maximum value, or a formula to perform the validation. Select Error in the Warning or Error field.

Note: If you select Warning, users do not see the warning in the Salary Administration window

8. Save your work.

 

To link the salary element:

1. Set your effective date to a day on or before the start of the first payroll period for which you want to enter salaries.

2. In the Element Link window, select your new salary element.

3. Do not check the Standard check box.

4. Select eligibility criteria for this element. If you want to make the element available to all employees, do not select any criteria.

5. Save the link.

6. If you want to enter different validation criteria for different eligibility groups, you can change the Min and Max valid values in the Link Input Values window.

To define salary basis for the salary element only:

1. Set your effective date to a day on or before the start of the first payroll period for which you want to enter salary basis

2. In the salary basis window, select your new salary basis.

7. Define salary basis for salary element