Modified code for ulf->getHighestEmployeeNumberByCompanyI
Posted: Wed Jan 17, 2007 9:30 am
I was having trouble with the next available employee_number. It was returning 9 when I had over 10 employees. So what I did is changed the code in the file UserListFactory.class.php on line 564 from
to
The cast allows mysql to select the correct employee_number.
MySQL = 5.0.24a
TimeTrex = 1.4.1
Code: Select all
$query = 'select * from'. $this->getTable() .' as a where company_id = ?AND employee_number != \'\' AND deleted = 0 ORDER BY employee_number desc LIMIT 1
Code: Select all
$query = 'select * from'. $this->getTable() .' as a where company_id = ?AND employee_number != \'\' AND deleted = 0 ORDER BY CAST(employee_number as unsigned) desc LIMIT 1;
MySQL = 5.0.24a
TimeTrex = 1.4.1