I have developed an Employees Lunch Break-Time Tracker where the employee has to punch in/out before and after their lunch break time. I calculated the total break in minutes and saved it in the DB. I provided a report to the HR department of all the break time. The challenging part for me here was to provide a report where evening shift employees took a lunch break the next day should appear on the previous day. What I did was, I created an 8 character code for each day and that code will be saved for each employee.
What I need to provide is a summary report where it will show the employee and the rest of the columns are the days for that month.
I have two tables now.
Table CODE
:
ID | CODE | DATE_CREATED |
1 | 9VIHQIHE | 2019-03-30 |
2 | 6JFGGU9P | 2019-03-31 |
3 | UYVEWVN0 | 2019-04-01 |
Table BREAKTIME
:
ID | EMPLOYEE | CODE | TOTAL_BREAKTIME
1 | JOHN | 9VIHQIHE | 00:59:01
2 | RYAN | 9VIHQIHE | 01:01:20
3 | JOHN | 6JFGGU9P | 01:15:08
4 | RYAN | 6JFGGU9P | 00:58:12
5 | JOHN | UYVEWVN0 | 00:57:32
6 | RYAN | UYVEWVN0 | 01:05:16
Now, I need a report that will give me a summary of total break of each employee month-wise.
The report should look like this when my search parameter is March 2019.
EMPLOYEE | 01 | 02 | .......... | 30 | 31
JOHN | - | - | .......... | 00:59:01 | 01:15:08
RYAN | - | - | .......... | 01:01:20 | 00:58:12
I have not written any code because I don't know where to start with.
Please, I need your help.