Assigning leave for employees with same name

feature requests for Leave Management Module

Moderator: Admin

Assigning leave for employees with same name

Postby Quicky » Thu Sep 02, 2010 2:04 pm

We have some employees who have identical names. When assigning leave to a particular employee, Orange always tries to assign leave to the first employee with that name irrespective of which employee was chosen during the autocomplete.

For example, we have two employees called Simon Davies. Leave has been assigned to Simon Davies (number 1) for 20th Sep 2010. If I go to the Assign Leave module, and begin typing 'Simon Davies' in the employee name, the autocomplete will list both Simons. If I choose Simon Davies (number 2) and then attempt to assign leave to him for 20th Sep 2010, I am unable to because "Your leave request overlaps with the following existing leave requests." However Simon Davies (number 2) currently does not have any leave assigned to his record at all.

I'm running version 2.5.0.3, but I have tested it in version 2.6 and the issue still exists.
Quicky
 
Posts: 2
Joined: Thu Sep 02, 2010 1:42 pm

Re: Assigning leave for employees with same name

Postby Quicky » Mon Sep 06, 2010 2:44 am

I have fixed this bug by modifying the query string in getEmployeeSearchList() within EmpInfo.php

I changed the first selectfields to:
$selecteFields[] = 'CONCAT(em.`emp_firstname`, \' \', em.`emp_lastname`, \' - \', em.`emp_number`)';

This concatenates the unique emp_number to the datasource, and therefore will populate the 'name' text field in the leave assign screen with the employee's name and their emp_number, e.g: Simon Davies - 63

This ensures that the leave is correctly assigned to the right employee, but it does mean that each name in the autocomplete list has a number appended to it, which isn't the best thing aesthetically for the user.
Quicky
 
Posts: 2
Joined: Thu Sep 02, 2010 1:42 pm


Return to Leave Module

Who is online

Users browsing this forum: No registered users and 1 guest