!!Get Employee GET_BBR !Functionality: The purpose of this function is to capture the [BBR_ID] from the [P2K_BE_RECIPIENTS] table. Given a specific benefit [PLAN_CODE] and an as of date determine if an contact is set up as a recipient in the specified plan. If they are then return the ID from the [P2K_BE_RECIPIENTS] table. If they are not, then null will be returned. !Parameters: |ECT_ID |''Required''. The ID from the P2K_HR_CONTACTS table for the person in which to the Employment ID in which the pay info is to be recovered |LEAVE_TYPE |''Required''. Leave type code from [IAPT] |AC_CODE |''Required''. AC_CODE as defined on [IAAC] (ie, A050, A700, A900, etc.) |WHEN |''Optional''. The as of date to be used (DD-MON-YYYY). Only the 'MON' portion of the date will be used. This date will be converted to the last day of the month for the query (The month from the Sysdate will be used if left blank). !Returns: Numeric !Errors: * When No Data is found than 0 will be returned * When the provided [LEAVE_TYPE_CODE] is not found -99996 will be returned * When the provided [AC_CODE] is not found -99997 will be returned * When there is an un-trapped exception than -99999 will be returned !Example: FUNCTION ALA_LAST(~,'VACATION','A700','01-Jan-2017') Using the EEM_ID as the ~ parameter, this will return the value from the last leave line to be processed in the month of January, linked to the leave type 'VACATION' and the AC_CODE A700. !Notes * The [EEM_ID] will be used to check leave lines details for the value of the specified AC code for the leave type as of the listed date. * Only leave lines without [TIME_CODE] will be picked up * Only Leave lines with an [ACCRUAL_STATUS] not in 3-In Payroll, 1-Requested or 2-Requested Processed will be picked up ----