You are on page 1of 14

Mohamed Salah

Oracle HRMS Techno Functional Consultant


Loan Element
The business:
We want to give the employee loan and deduct it from him as number of installments.
Solution
We will create 3 elements:
1- Loan (Recurring information element contains Loan amount and installments)



Mohamed Salah
Oracle HRMS Techno Functional Consultant

Mohamed Salah
Oracle HRMS Techno Functional Consultant

2- Loan Payments (Non Recurring earnings element contains pay value)







Mohamed Salah
Oracle HRMS Techno Functional Consultant
3- Loan Deductions (Non Recurring Voluntary Deductions element contains pay value)





Mohamed Salah
Oracle HRMS Techno Functional Consultant


4- Link these elements to your payroll from Link Form and repeat this step for the remaining elements






Mohamed Salah
Oracle HRMS Techno Functional Consultant

5- Create balance Net Loan fed by Loan Deductions subtract ,Loan Payments add with Element Entry
inception to date dimension (ITD)


Mohamed Salah
Oracle HRMS Techno Functional Consultant






















Mohamed Salah
Oracle HRMS Techno Functional Consultant

6- Create balance Gross Loan fed by Loan Payments add with Element Entry inception to date dimension
(ITD)


Mohamed Salah
Oracle HRMS Techno Functional Consultant



7- Create Loan Formula







Mohamed Salah
Oracle HRMS Techno Functional Consultant
Press edit and write the following code:
Default For ENTRY_START_DATE is '01-jan-1950' (Date)
Default For PAY_PROC_PERIOD_END_DATE is '01-jan-1950' (Date)
Default For GROSS_LOAN_ENTRY_ITD is 0
Default For Net_LOAN_ENTRY_ITD is 0
Default For P_Loan is 0
Default For P_Net_Loan is 0
Default For P_Recovery is 0
Default For P_Periods_Paid is 0
Default For P_Stop is 0
Inputs Are Loan_Amount, Installments
/*For First Month We need To pay him the loan and don't deduct the recovery as it starts from next period*/
Message= To_char(ENTRY_START_DATE)||' Test '||To_char(PAY_PROC_PERIOD_END_DATE)
If (GROSS_LOAN_ENTRY_ITD=0) Then
( P_Loan=Loan_Amount
P_Recovery=0
Return P_Loan,P_Recovery,Message
)
Else
(
P_Net_Loan=Net_LOAN_ENTRY_ITD
/* Substract 2 From Get_Periods(formula function that is attached to database function we create ) as 1 for the
first pay period which was skipped and second for the current period*/
P_Periods_Paid= Get_Periods(ENTRY_START_DATE,PAY_PROC_PERIOD_END_DATE)-2

If (Installments-P_Periods_Paid<=1) Then

/*Last Period Recover the complete amount*/
( P_Recovery=Net_LOAN_ENTRY_ITD
P_Stop= 1 /*stop element entry after full recover of loan amount*/
Return P_Recovery,P_Stop,Message)
Else
(P_Recovery=Net_LOAN_ENTRY_ITD/(Installments-P_Periods_Paid)
Return P_Recovery,Message)
)













Mohamed Salah
Oracle HRMS Techno Functional Consultant
8- Make the formula results

9- Create formula function

And provide the parameters such as the database function parameters
Mohamed Salah
Oracle HRMS Techno Functional Consultant

10- Dont create formula function before the db function , write this code to create a package that
contains the function
CREATE OR REPLACE package APPS.MSA_PAYROLL_PKG AUTHID DEFINER as
FUNCTION GET_PERIODS_NUMBER (
P_Start_Date IN Date
,P_END_Date IN Date)
RETURN NUMBER ;
END MSA_PAYROLL_PKG;

/


CREATE OR REPLACE package body APPS.MSA_PAYROLL_PKG as
function GET_PERIODS_NUMBER (
P_Start_Date IN Date
,P_END_Date IN Date)
RETURN NUMBER IS


V_COUNT NUMBER;
BEGIN
Select count(*) INTO V_COUNT from per_time_periods
where start_date >= to_date (P_Start_Date)
and cut_off_date <= To_date(P_END_Date );

RETURN V_COUNT;

END GET_PERIODS_NUMBER ;

end MSA_PAYROLL_PKG;
/


Mohamed Salah
Oracle HRMS Techno Functional Consultant
11- Make element entry to an employee from assignment entries

Open Entry Values and add the values Loan amount 3500 and installments 2
12- Run Quick Pay 4 times to be sure that it works fine(1 month to give the loan with no deduct,2 months
to deduct the 2 installments, last month for stop the loan element after recover all the loan amount)
First month

Mohamed Salah
Oracle HRMS Techno Functional Consultant
Second and third month

Last month

You might also like