Flat Amount or Spot Bonus Earnings Formula Changes

Using the Fast Formulas task, replace the text in the existing earnings element formula with the text shown and recompile the formula.

DEFAULT FOR ORA_HRX_FR_SENIORITY_IN_YEARS is 0
l_effective_date  = '0001/01/01 00:00:00' (Date)
l_effective_date = GET_CONTEXT(EFFECTIVE_DATE,l_effective_date)
l_effective_date_last_month = add_months(l_effective_date,-1)
l_seniority_last_month =0

CHANGE_CONTEXTS(EFFECTIVE_DATE = l_effective_date_last_month)
(
l_seniority_last_month = floor(ORA_HRX_FR_SENIORITY_IN_YEARS)
l_log = PAY_INTERNAL_LOG_WRITE('(GLBEARN) l_seniority_last_month  : '||TO_CHAR(l_seniority_last_month ))
)
l_seniority  = floor(ORA_HRX_FR_SENIORITY_IN_YEARS)
l_log = PAY_INTERNAL_LOG_WRITE('(GLBEARN) DHRX_Flat_l_seniority : '||TO_CHAR(l_seniority ))

if l_seniority > l_seniority_last_month then
(
l_seniority_allowance =0 
change_contexts(PART_NAME = 'ORA_RATE_AMOUNT') 
   (  
  SET_INPUT('BASE',l_seniority )
  EXECUTE('CALL_CALC_VALUE')
  l_seniority_allowance  = GET_OUTPUT('DED_AMOUNT',0)
     )	 
l_log = PAY_INTERNAL_LOG_WRITE('(GLBEARN) DHRX_Flat_l_seniority_allowance  : '||TO_CHAR(l_seniority_allowance ))
l_value = l_seniority_allowance 
return l_value
/* End Formula Text */