Hello:
I have an idea for a function (or what i think could be a function) and I wanted input as to whether or not it is do-able.
The process says that employees are awarded leave on a monthly basis, if no employee in a certain department has an incident. If an employee does have an incident, that employee along with the other employees in his department are restricted from receiving vacation time/leave for the next two months. Otherwise, they are awarded 4 hours for the new month. this process will be ran once a month, probably on the first day of the new month. The tricky part is dealing with a transferred employee. I need to make sure that if he transfers while his current department is on restriction from receiving leave, that his new dept isn't penalized with him and his old dept.
I have a query that lists emps who have incidents associated with them. My idea was the create a function (EmpRestriction) that:
1)Gets all of the incidents for the last 2 months from the query. In my employee table I have a field, empRestStatus (Restriction Status--holds whether or not the employee is eligible for vacation time/leave).
2)After the query returns the emps with restrictions, set their empRestStatus to True, meaning they have an incident.
The next function I have sets the department restrictions. It should:
1) Get all incidents with in the last 2 months
2) Set their empRestStatus to True
3) Get dept of all emps
**Check to see if the employees have had an infraction within the last 2 months, if they have then set their new department to false (unless a member of their team has an infraction), but ensure the emp who committed the incident is still restricted (I generate an eligibility date for everyone...if they have an infraction a month 2 months after the incident is generated...if not a date for the new month is generated)
The last function I believe I need will add the four hours to anyone who's empRestStatus is False
1) Check infractions from last 2 months
2) If there are none, set empRestStatus to False
3) If status is False, vacaEarnedTime + 4
Is this feasible?
Thank you for your time
I have an idea for a function (or what i think could be a function) and I wanted input as to whether or not it is do-able.
The process says that employees are awarded leave on a monthly basis, if no employee in a certain department has an incident. If an employee does have an incident, that employee along with the other employees in his department are restricted from receiving vacation time/leave for the next two months. Otherwise, they are awarded 4 hours for the new month. this process will be ran once a month, probably on the first day of the new month. The tricky part is dealing with a transferred employee. I need to make sure that if he transfers while his current department is on restriction from receiving leave, that his new dept isn't penalized with him and his old dept.
I have a query that lists emps who have incidents associated with them. My idea was the create a function (EmpRestriction) that:
1)Gets all of the incidents for the last 2 months from the query. In my employee table I have a field, empRestStatus (Restriction Status--holds whether or not the employee is eligible for vacation time/leave).
2)After the query returns the emps with restrictions, set their empRestStatus to True, meaning they have an incident.
The next function I have sets the department restrictions. It should:
1) Get all incidents with in the last 2 months
2) Set their empRestStatus to True
3) Get dept of all emps
**Check to see if the employees have had an infraction within the last 2 months, if they have then set their new department to false (unless a member of their team has an infraction), but ensure the emp who committed the incident is still restricted (I generate an eligibility date for everyone...if they have an infraction a month 2 months after the incident is generated...if not a date for the new month is generated)
The last function I believe I need will add the four hours to anyone who's empRestStatus is False
1) Check infractions from last 2 months
2) If there are none, set empRestStatus to False
3) If status is False, vacaEarnedTime + 4
Is this feasible?
Thank you for your time