Exceptions for changed punch time in Timesheet
Posted: Fri Aug 31, 2007 4:45 pm
I would like to have the timesheet show me exception codes for punches that were entered manually in the timesheet, or have been changed (like if an employee forgot to punch in and the supervisor added the punch in the timesheet or adjusted their time.)
I've been looking through the punch table trying to figure out an easy way to determine which punches were either created through the timesheet or adjusted after the fact. It looks like a good way is to compare "created_date" against "time_stamp" (converting "time_stamp" to a unix timestamp value.) If the absolute value (ABS function in MySQL) of the difference is greater than 300 (5 minutes), then the punch was either added manually, or changed.
That 5 minute threshold is good for me, but other people might want to be able to set their own.
Thanks,
-Ben
I've been looking through the punch table trying to figure out an easy way to determine which punches were either created through the timesheet or adjusted after the fact. It looks like a good way is to compare "created_date" against "time_stamp" (converting "time_stamp" to a unix timestamp value.) If the absolute value (ABS function in MySQL) of the difference is greater than 300 (5 minutes), then the punch was either added manually, or changed.
Code: Select all
ABS(`created_date` - UNIX_TIMESTAMP(`time_stamp`)) > 300
Thanks,
-Ben