In some countries it is required to have a register of the hours that an employee worked. For example a law was approved in Spain that forces all companies to have the attendance registry of his employees. This can not be achieved with the current timesheet module because timesheet is only about tracking the time spent in some works but the attendance means having the time when the employee started to work and the hours when the employee finished to work.
Add a new module named company_attendance which will add the following model:
- Type: In/Out
When creating a record the In/Out value will be set based on the last value of the employee, allowing the user to see it’s current status but it will allowed to change it an no consistency check will be implemented.
Each user will be only allowed to access it’s own attendances. If the user is part of a especial group it will be allowed to see the attendances of all employees.
This information should be used to report for each employee the hours worked. The Attendance Report model will contain the following fields:
- Start Time: The minimun time of this day
- End Time: The maximum time of this day
- Worked Duration: The duration that this employee worked on this day
All this information will be computed using a table_query.
If the timesheet module is activated, the report will contain an additional Timesheet Duration field to sum up the timesheet duration of the current day for the employee.
A process should be added to close the attendance until a date. This process will ensure that all the attendance lines have the valid alternance. Once this process is executed the attendance records until this date will be readonly.