Who's Online
0 registered (), 7 Guests and 7 Spiders online.
Key: Admin, Global Mod, Mod
Recent Posts
Interfacing iRec and external sites
by DanC
0 seconds ago
Time and Labour & Oracle Projects
by Paul
Today at 07:34 PM
End of Year Legislation Patch for 11i
by delboy
Today at 02:00 PM
Search Engine Optimizers
by delboy
Today at 01:30 PM
Abseces in oracle hrms, super user: how to do I:
by JayTee
Today at 07:26 AM
Update EIT in SSHR
by Mr Oracle
Yesterday at 01:50 PM
Function for getting retropay-maintained balances
by CT
Yesterday at 12:21 PM
Grade End Date
by Chris
03/02/12 10:46 AM
OLM Mandatory Enrolments
by bcooper
01/02/12 12:23 PM
Retro-Notifs Report missing some ele entries
by CT
01/02/12 06:51 AM
Top Posters (30 Days)
CT 27
delboy 25
bcooper 14
Gus 5
paulgos 5
Sahir 4
tovia123 4
christm 3
Saqib Rahat 3
SBi 3
(Views)Popular Topics
Family Pack K issues thread 18192
CREATE_GRADE api returns:PLS-00306: wrong number o 13732
Still trying to locate... 12183
Creating hr jobs ORA-20001: HR_289477_JOB_GROUP_ID 10630
Viewing Output of another user 9121
HR_PF.K RUP4 8816
Review of my Release 12 laptop 8483
Adding a taskflow button to a form 7839
Enhanced Retro & Release 12 7660
Family Pack K 7100
Page 1 of 3 1 2 3 >
Topic Options
Rate This Topic
#4526 - 04/06/09 02:09 PM Custom Function issue in Fast Formula
JayTee Offline
enthusiast

Registered: 30/11/05
Posts: 33
Hi all,

I have a custom function in a formula that returns the previous 3 months' Taxable Earnings. When the formula is processed in a payroll run, the function works as expected and returns the correct value.

However when the formula is processed through Retropay by Element, a different value is calculated. To complicate matters further, when I process retropay using different start/end dates the value returned by the function varies.

The sql code I am using is below:

SELECT sum(TO_NUMBER(prrv.result_value))
FROM apps.pay_run_results prr,
apps.pay_run_result_values prrv,
apps.pay_assignment_actions paa,
apps.pay_payroll_actions ppa,
apps.pay_input_values_f piv,
apps.pay_element_types_f pet,
apps.pay_element_classifications pec,
apps.per_all_assignments_f asg,
apps.per_all_people_f per,
apps.pay_payrolls_f pay
WHERE prrv.run_result_id = prr.run_result_id
AND asg.assignment_id = paa.assignment_id
AND asg.business_group_id = c_business_group_id
AND pay.payroll_name = c_payroll_name
AND per.person_id = asg.person_id
AND asg.payroll_id = pay.payroll_id
AND prr.assignment_action_id = paa.assignment_action_id
AND paa.payroll_action_id = ppa.payroll_action_id
AND piv.input_value_id = prrv.input_value_id
AND piv.NAME = 'Pay Value'
AND ppa.action_type IN ('Q','R','V')
AND ppa.action_status = 'C'
AND paa.action_status = 'C'
AND nvl(paa.source_action_id,0) <> 0
AND pet.element_type_id = piv.element_type_id
AND pec.classification_id = pet.classification_id
AND TRUNC (ppa.date_earned) >= last_day(add_months(c_end_date,-3))+1
AND TRUNC (ppa.date_earned) <= c_end_date
and asg.assignment_id = c_assignment_id
and piv.input_value_id IN (
select distinct pbf.input_value_id
from pay_balance_feeds_f pbf
, pay_balance_types pbt
where pbf.balance_type_id = pbt.balance_type_id
and pbt.balance_name IN ('Taxable Pay','NIable Pay')
and c_end_date between pbf.effective_start_date and pbf.effective_end_date
)
AND ppa.date_earned BETWEEN asg.effective_start_date
AND asg.effective_end_date
AND ppa.date_earned BETWEEN per.effective_start_date
AND per.effective_end_date
AND ppa.date_earned BETWEEN pay.effective_start_date
AND pay.effective_end_date
AND ppa.date_earned BETWEEN pet.effective_start_date
AND pet.effective_end_date
AND ppa.date_earned BETWEEN piv.effective_start_date
AND piv.effective_end_date;


Has anyone come across this before, or can you see anything in the SQL code that may cause problems with Retropay?

Thanks in advance,
Jon

Top
#4527 - 04/06/09 03:31 PM Re: Custom Function issue in Fast Formula [Re: JayTee]
PeterP Offline
hacker
*****

Registered: 08/03/07
Posts: 92
Loc: Manchester, UK
I think you'll find it's down to your dates. Retropay is probably using the payroll_action.date_earned from the payroll runs it's recalculating. Hence each call to the function is actually based around a retrospective date.

Top
#4528 - 04/06/09 03:45 PM Re: Custom Function issue in Fast Formula [Re: PeterP]
JayTee Offline
enthusiast

Registered: 30/11/05
Posts: 33
The formula in question is linked to a Holiday element. I have created a holiday absence that starts and ends on 6th May 09, and the element effective start and end date is 6th May 09. The May payroll has already been run, so Retropay by Element picks this entry up and creates the Retro entry in the June period.

If I run Retropay with a start date of 1st May 09 and end date of 1st June 09, the calculation from the function is correct. However, if I run Retropay with a start date of 1st April 09 and end date of 1st June 09 the value returned is incorrect.

I don't understand how that can happen, because the element being processed by retropay is only effective in the May period, so running Retropay for April shouldn't affect the calculation?

Top
#4529 - 04/06/09 09:27 PM Re: Custom Function issue in Fast Formula [Re: JayTee]
PeterP Offline
hacker
*****

Registered: 08/03/07
Posts: 92
Loc: Manchester, UK
Without digging in to your payroll process, I can't answer your question as to why. However, since your query is based around the ppa.date_earned (pay_payroll_actions) as the key date, then when RetroPay is processing the April period, the query will be executing for that period when it's run.

Top
#4530 - 05/06/09 06:26 AM Re: Custom Function issue in Fast Formula [Re: PeterP]
SBi Offline
sitting tennant

Registered: 23/05/08
Posts: 344
Loc: UK
retropay process re-runs the each month's payroll and does a simple subtraction of the each of the run result values between previous run and retropay run.
It then creates single element entry for each respective month in the current pay period.

if you run from 1st apr to 1 jun there should be 3 retro entries for that element.

Top
#4531 - 05/06/09 06:27 AM Re: Custom Function issue in Fast Formula [Re: SBi]
SBi Offline
sitting tennant

Registered: 23/05/08
Posts: 344
Loc: UK
How many retro entries are generated?

Top
#4532 - 05/06/09 06:35 AM Re: Custom Function issue in Fast Formula [Re: SBi]
JayTee Offline
enthusiast

Registered: 30/11/05
Posts: 33
There is only 1 retro entry produced. This is what I would expect because the element is only present in the May period.

Top
#4533 - 05/06/09 07:19 AM Re: Custom Function issue in Fast Formula [Re: JayTee]
SBi Offline
sitting tennant

Registered: 23/05/08
Posts: 344
Loc: UK
So you have attached the FF to holiday element?

Top
#4534 - 05/06/09 07:25 AM Re: Custom Function issue in Fast Formula [Re: SBi]
SBi Offline
sitting tennant

Registered: 23/05/08
Posts: 344
Loc: UK
did u rollback the previous retropay run before you ran the 2nd one? with new dates


Edited by Shiva Bildikar (05/06/09 07:26 AM)

Top
#4535 - 05/06/09 07:55 AM Re: Custom Function issue in Fast Formula [Re: SBi]
JayTee Offline
enthusiast

Registered: 30/11/05
Posts: 33
Yes the FF is attached to the holiday element and I rolled back the previous retropay run before I ran the second one.

The issue is definitely with the custom function because I have enabled GMFZT logging on Retropay and I can see what parameters are being passed to the function and the value that is being returned - the odd thing is when I pass the same parameters in SQL PLUS, the function returns the correct value (similarly when I enter a holiday absence in the current month and run a payroll the correct value is calculated).

Thanks

Top
Page 1 of 3 1 2 3 >



Moderator:  CT, delboy 
Forum Stats
755 Members
48 Forums
1516 Topics
7282 Posts

Max Online: 63 @ 24/11/10 07:21 AM
Today's Birthdays
No Birthdays
Recent vacancies
Tea boy available 4 basic chores & some! services
by Simon_Mc
19/01/12 03:59 PM
Top Posters
bcooper 1094
CT 1080
delboy 499
Geoff Dixon 369
SBi 344
vkumar 223
kp_rapolu 213
cbrookes 197
Gavin Harris 160
Gus 132
February
Su M Tu W Th F Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29