The following sample formulas show how you can create payroll formulas to be used in different situations requiring historic rates.
Oracle may change this formula in future releases. This formula is strictly for example or prototype uses only, and is not intended to provide a ready-made solution. You can make a copy of this formula but you should not change your copied version. Always write a formula of your own to meet your own requirements. This formula may contain certain hard-coded values for simplified use.
/*
Formula name : SAMPLE_OVERTIME_PAY_USING_AN_ELEMENT_RATE
Description : Sample formula showing the use of historic rate to calculate overtime In this sample, the GET_HISTORIC_RATE function will reference the 'Overtime' element
*/
DEFAULT FOR date_worked IS '1951/01/01 00:00:00' (date)
DEFAULT FOR hours_worked IS 0
INPUTS ARE date_worked(date)
, number_of_hours_worked
hourly_rate =
GET_HISTORIC_RATE
('Overtime' /* Name of the rate to be calculated */
, date_worked /* Date as of which the rate is required */
, 'H' /* Time dimension required, 'H' for Hourly */
)overtime pay = hourly_rate * number_of_hours_worked
RETURN overtime_pay
, hourly rate
/*
Formula name : SAMPLE_OVERTIME_PAY_USING_A_RATE_TYPE
Description : Sample formula showing the use of historic rate to calculate the a pension deduction In this sample, the GET_HISTORIC_RATE will identify all elements attached.
*/ DEFAULT FOR employee_contribution IS 5.0
INPUTS employee_contribution /* Percentage */ effective_date = SESSION_DATE
annual_salary_rate =
GET_HISTORIC_RATE
('Pensionable Salary' /* Name or the rate to be calculated. */
, effective_date /* Date as of which the rate is required. */
, 'A' /* Time Dimension required, 'A' for Annual. */
, 'R' /* Specify whether the rate name is a Rate Type */
)
pension_deduction = (annual_salary_rate * (employee_contribution / 100 )
RETURN ,pension_deduction
,annual_salary_rate
The sample formulas can call the GET_HISTORIC_RATE formula function. The contexts, parameters and return values for the Rates History function are as follows:
GET_HISTORIC_RATE
GET_HISTORIC_RATE (rate_name, date, time_dimension, rate_type_or_element, contract_type, contract_type_usage).
The value returned by the function represents the rate as of the given date. The value returned is of type Number.
You can only use this function in formula types that have a context of Assignment_ID, for example, Oracle Payroll, QuickPaint.
| Parameter Name | Description |
|---|---|
| P_RATE_NAME | The name of the rate type or element that you want to process. The actual meaning of the parameter depends on what was passed in the P_RATE_TYPE_OR_ELEMENT parameter. By default, the rate name must be an element type. |
| P_EFFECTIVE_DATE | The date from which you want to calculate the rate. |
| P_TIME_DIMENSION | The time dimension in which you want to return the retrieved rate. If the p_rate_name references an element and you omit the time dimension in the GET_HISTORIC_RATE call, then the default time dimension returned is the same as the source time dimension that you defined on the element extra information Historic Rate - Element Attribution. You must supply a valid time dimension when the rate name references a rate type. |
| P_RATE_TYPE_OR_ELEMENT | Identifies whether the rate name is an element or rate type. By default, the rate name is an element type. Valid values for this parameter are:
|
| P_CONTRACT_TYPE | The name of a default or override contract type. This parameter specifies the name of the contract type that the GET_HISTORIC_RATE function uses. |
| P_CONTRACT_TYPE_USAGE | Specifies whether the contract in P_CONTRACT_TYPE has a default assignment level contract type, or overrides an assignment level contract level type. You define assignment level contracts on the Extra Details of Service window. Valid values for this parameter are:
|