Hello, I am having some issues with Oracle Fusion Cloud. I am new to this platform from R12.
Now I am trying to do a basic proration.
I have written my proration formula which works:
/* VARIABLES */ DEFAULT FOR PRORATE_START IS '01-JAN-1980' (DATE) DEFAULT FOR PRORATE_END IS '31-DEC-4712' (DATE) DEFAULT FOR PAY_EARN_PERIOD_START IS '01-JAN-1980' (DATE) DEFAULT FOR PAY_EARN_PERIOD_END IS '31-DEC-4712' (DATE) DEFAULT FOR PAY_VALUE IS 0 /* INPUTS */ INPUTS ARE PAY_VALUE, PRORATE_START (DATE), PRORATE_END (DATE) /* CALCUATIONS */ TOTAL_DAYS = DAYS_BETWEEN(PAY_EARN_PERIOD_END, PAY_EARN_PERIOD_START) + 1 WORKED_DAYS = DAYS_BETWEEN(PRORATE_END, PRORATE_START) + 1 PAY_VALUE = ROUND( PAY_VALUE * (WORKED_DAYS/TOTAL_DAYS), 2) /* RETURN */ RETURN PAY_VALUE
Now I have attached this proration formula to an element, Basic Pay Element.
THe formula for the element is like this:
DEFAULT FOR TEST_ELEMENT_AMOUNT_ASG_ENTRY_VALUE IS 0 DEFAULT FOR PAY_VALUE IS 0 DEFAULT FOR MONTHLY_GROSS IS 0 /* INPUTS */ INPUTS ARE MONTHLY_GROSS, PAY_VALUE /* CALCUATIONS */ PAY_VALUE = TEST_ELEMENT_AMOUNT_ASG_ENTRY_VALUE * 0.25 MONTHLY_GROSS = TEST_ELEMENT_AMOUNT_ASG_ENTRY_VALUE /* RETURN */ RETURN PAY_VALUE, MONTHLY_GROSS
Now this calculation uses the Amount input value of an element called Test Element. So to get the value I am using the DBI, TEST_ELEMENT_AMOUNT_ASG_ENTRY_VALUE.
However, for the current month, I have updated the value of Test Element in the middle of the month.
This has triggered proration so I get two results. But the problem is that during the calculation, the value of the DBI TEST_ELEMENT_AMOUNT_ASG_ENTRY_VALUE is the same. That is the value it is using to calculate PAY_VALUE and MONTHLY_GROSS always uses the latest value of TEST_ELEMENT_AMOUNT_ASG_ENTRY_VALUE instead of the value as at the proration period.
Any ideas?