Create Fast Formulas

You can write your own custom logic in the fast formula for absence payments.

To create the formulas, here's what to do:

Navigation: My Client Groups > Payroll > Fast Formulas
  1. Create a validation formula based on a delivered seeded formula IE Parental Absence Validation Included
    • Warning message if entered a parental leave period that's more than 26 weeks duration.
    • Warning message if take parental leave when the length of service is less than 1 year.
    Validation Formulas:
    /**********************************************************************
    FORMULA NAME: ORA_HRX_IE_PRTL_VALIDATION
    FORMULA TYPE: Global Absence Entry Validation 
    DESCRIPTION : IE Parental Absence Validation
    **********************************************************************/
    
    DEFAULT FOR IV_START_DATE IS '0001/01/01 00:00:00' (DATE)
    DEFAULT FOR IV_END_DATE IS '4712/12/31 00:00:00' (DATE)
    
    /* Seniority Date (Legal Employer Relationship Start Date) */
    DEFAULT FOR PER_ASG_REL_DATE_START IS '4712/12/31 00:00:00' (DATE)
    
    
    INPUTS ARE IV_START_DATE, IV_END_DATE
    
    VALID = 'Y'
    ERROR_MESSAGE = 'Success'
    
    l_trunc_eff_date = TRUNC(GET_CONTEXT(EFFECTIVE_DATE,'0001/01/01' (date)))
    l_min_check_date = l_trunc_eff_date 
    l_max_check_date = l_trunc_eff_date 
    
    l_start_date = IV_START_DATE
    l_end_date   = IV_END_DATE
    l_seniority_date = PER_ASG_REL_DATE_START
    
    l_char_max_duration = '0'
    l_max_duration = 0
    
    l_char_max_duration = GET_VALUE_SET('ORA_HRX_IE_GET_PRTL_MAX_WKS','|=CURRENT_EFFDATE='''||TO_CHAR(trunc(l_trunc_eff_date),'YYYY/MM/DD')||'''')
    l_max_duration = to_number(l_char_max_duration)
    
    l_max_duration = l_max_duration *7
    
    /* ============================================================
       Rule 1: Duration Limit – Max 26 Weeks (182 Days)
       ============================================================ */
    
    l_days_duration = TRUNC(DAYS_BETWEEN(l_end_date, l_start_date) + 1)
    
    IF (l_days_duration > l_max_duration) THEN
    (
        VALID = 'N'
        ERROR_CODE = 'W'
        ERROR_MESSAGE = 'HRX:::HRX_IE_PRTL_DURATION'
        RETURN VALID, ERROR_MESSAGE, ERROR_CODE
    )
    
    /* ============================================================
       Rule 2: Length of Service – Employee must have 1 year service
       Use ADD_MONTHS to check if start_date >= seniority_date + 12 months
       ============================================================ */
    l_required_service_date = ADD_MONTHS(l_seniority_date, 12)
    	
    /* If start date is BEFORE completion of 12 months → warning */
    IF (l_start_date < l_required_service_date) THEN
    (
        VALID = 'N'
        ERROR_CODE = 'W'
        ERROR_MESSAGE = 'HRX:::HRX_IE_PRTL_LOS'
        RETURN VALID, ERROR_MESSAGE, ERROR_CODE
    )
    /* Return success */
    RETURN VALID