SetEmployeeCurrentStatusFlag

Set Employee Current Status Flag\Employee Id Validation

Minor Business Rule

Object Name: N0800002

Parent DLL: CFND

Location: Client/Server

Language: NER

Functional Description

The purpose of this Named ER is to determine the employee's current status flag.  The status flag is set as such: 

'0' = Active employee and no payroll lock out

'1' = Locked employee and NO change is allowed, as the current user id is same as the user id locking the employee.

'2' = Locked employee and any change is allowed, as the current user id is the user id locking the employee.

'3' = Locked employee and only changes not affecting the net pay are allowed, as check has been cut for the locked  

employee.

'4' = New Employee (This is not set in the Named ER)

'5' = Terminated employee 

'6' = Employee on Leave of Absence


Additionally, if a value is passed in the Employee Identification parameter and no value is passed in the Address Number 

parameter, then NER will determine if the value is a name search value, tax id, other employee number, or employee number 

(address book number).  The value will be validated against the Employee Master (F060116) and, if valid, the address 

book number will be returned through the parameter Address Number.  If the value is invalid the parameter Error Status will be 

set to 1.


As long as the Address Number is passed in or, if Address Number is not passed in, a valid Employee Identification is 

passed in, the NER will check to see if the employee is involved in a OneWorld payroll lockout.


Important: If Address Number and Employee Identification are BOTH passed or not passed in, then payroll lockout id, 

termination date, and leave of absense begin and end dates MUST be passed in.  Also, OW payroll cannot be determined 

unless either Address Number and/or Employee Identification is passed in.  



Setup Notes and Prerequisites



The hierarchy status flag is:

a)Locked Status (ie. '1', '2', or '3')
b)Terminated Status (ie. '5')

c)Leave of Absence Status (ie. '6')





Technical Specification


1)If szEmployeeIdentification <> Blank and szEmployeeIdentification <> Null and mnAddressNumber = Zero
a)Trim leading and trailing spaces from szEmployeeIdentification
b)Isolate first character from szEmployeeIdentification
c)If first character = '?'

i)Name Search Value = character 2 to end of szEmployeeIdentification
ii)Call business function 'F0101 Edit Address Number' passing in Name Search Value and returning an address book number (AN8)

iii)Fetch Employee Master (F060116) based on Address Book Number from previous BSFN call

Else
If first character = '/'
• 
Employee Third Number = character 2 to end of szEmployeeIdentification
• 
Fetch Employee Master (F060116) record based on Employee Third Number
'b7'b7'b7Else
If length of szEmployeeIdentification >= 9
Fetch Employee Master (F060116) based on SSN using szEmployeeIdentification as value
Else
Fetch Employee Master (F060116) based on Address Book Number using szEmployeeIdentification
End if
End if
End if
d)If file i/o = ERROR
i)Set cErrorStatus = 1
ii)Continuation flag = 0
iii)Set NER Error for szEmployeeIdentification "0270"
End If
Else
Continuation flag = 1
End if


2)If Continuation flag = 1
a)If mnAddressNumber <> Zero

Call business function "Get Payroll Lockout Status" for lockout status and
lockout user id of OneWorld payroll users.  If not using payroll through 
OneWorld then function will return "0" in the status flag.  If running payroll on 

World then lockout id still stored in F060116.
Else
Status flag variable that would be set by "Get Payroll Lockout Status" is 
initialized to zero.

End If
b)    If status flag variable set by "Get Payroll Lockout Status" <> 0
        If user id from "Get Payroll Lockout Status" <> current User ID
set CurrentStatusFlag = '1'
Else
If status flag variable from "Get Payroll Lockout Status" = 2 or 3 (no changes allowed; see N0500021.doc or online documentation 
for N0500021)

set CurrentStatusFlag = '1'
Else
set CurrentStatusFlag = '2'
End if
End if
 Else
If PayrollLockoutID  (from Employee Master - F060116) <> Blank, and <> 
1)Get the Lockout User ID from the PayrollLockOutID parameter (which is the substring of PayrollLockOutID starting from the 1st 
character with length of 10).

2)Get the payroll ID from the PayrollLockOutID parameter (which is the substring of  PayrollLockOutID starting from 11th character 

with length of 3).

3)If the Lockout User ID from step i) is not the same as the current User ID
set CurrentStatusFlag = '1'
Else
• 
Retrieve the check control area (YDCKST) in F06210 for the payroll ID 
• If the YDCKST = '1' (Check Completed) or 'A' (Check Active)
'b7'b7'b7set CurrentStatusFlag = '3'
Else
set CurrentStatusFlag = '2'
End if 
• 
If  F06210 is not successful
'b7'b7'b7set CurrentStatusFlag = '2'
End if
End if
End if

c)If the CurrentStatusFlag is still blank and termination date > 0
set CurrentStatusFlag = '5'
End if
 

d)If the CurrentStatusFlag is still blank,
i)Retrieve Today's date and convert to Julian Format
ii)If Leave Begin date is not zero
convert to Julian Format
End if
iii)    If Leave End Date is not zero
convert to Julian Format
End if
iv)
  OR 


set the CurrentStatusFlag = '6' 
End if
End if

e)If the CurrentStatusFlag is still blank
default Current StatusFlag = '0'
End if
End if

Data Structure

DN0800002 - Set Employee Current Status FlagId Validation


^

Parameter NameData ItemData TypeReq/OptI/O/Both
CurrentStatusFlagEV01charOPTOUTPUT

An option that specifies the type of processing for an event.

PayrollLockoutIDUSRcharOPTNONE

This code is a combination of the IBM user ID and the batch number assigned to a prepayroll selection. It is used to prohibit one employee 
from being processed in more than one concurrent payroll cycle. It also locks out everyone but the user who is running the payroll (or 
prepayroll) from updating the employee's master file or time records until either the the cycle is complete or a reset of the payroll lockout is 
executed.

DateTerminatedDTJDEDATEOPTNONE

The date that the employee was terminated, if applicable.

LeaveBeginDateLSDTJDEDATEOPTNONE

The date on which an employee's paid or unpaid leave of absence begins. Use this date to indicate the leave for the Family and Medical 
Leave Act.

LeaveEndDateLADTJDEDATEOPTNONE

The date on which an employee's paid or unpaid leave of absence expires.

szEmployeeIdentificationENDYOWcharOPTINPUT

The employee number, TAX ID, or Alternate number, depending on the employee number mode that is set up in the Payroll Constants for 
company 00000.

mnAddressNumberAN8MATH_NUMERICOPTNONE

A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or 
location.

cErrorStatusVC01AcharOPTOUTPUT

This is a generic field used for video constants display.

szPayrollIDOWPAYDcharOPTOUTPUT

A code that identifies a group of employees for whom you are processing payroll. Use this ID to process each step of the payroll 
cycle. This code is also used to identify the interim ID that you select when you enter interim payments.

szUserIdUSERcharOPTOUTPUT

The code that identifies a user profile.

Related Functions

None

Related Tables

None