This content has been marked as final. Show 3 replies
Can you not use a ROUND() function ?
I used the round function but that makes it even worse. Instead of a 0.01 difference or thereabouts, I sometimes end up with a whole number difference
Found a temporary solution that works.
First I wrote a function, GET_ELEMENT_INFO, that checks if the element is a standard element, and that the Payment Amount input value has changed or not changed in the current period.
If the element hasn't changed, I simply get the current balance and subtract it from the total payment amount.
I did it for 5 elements since we have 5 standard elements. If element changes mid month, then this block is ignored.
In proration formula:
/* grossup check */
IF (PRORATE_END = PAY_PROC_PERIOD_END_DATE)
l_period_end_value = 0
l_standard_flag = 'N'
l_call = 0
l_calc_amount = 0
l_changed_in_period = 'N'
AMOUNT_REM = 0
l_call = GET_ELEMENT_INFO(ELEMENT_NAME, 'Payment Amount', PAY_PROC_PERIOD_END_DATE, l_period_end_value, l_standard_flag, l_changed_in_period, l_calc_amount)
IF (l_standard_flag = 'Y') and (l_changed_in_period = 'N') THEN
IF (ELEMENT_NAME = 'KSA Basic Salary') THEN
IF (ELEMENT_NAME = 'KSA Transport Allowance') THEN
/* l_period_end_value, value of element input value at the end of the payroll period */
PAY_VALUE = l_period_end_value - AMOUNT_CALCULATED
/* change final prorated amount to match */
/* end gross up check */