# Add Members
 - Pull the latest changes!
 - In the `/hours/public/data` folder, add the member to the TeamData.csv
 - If the member works part time, open RequiredHours_??.csv and add a column for them with the percentage.
 - Open `crew.raumgleiter.com/hours/data` in FileZilla
 - Download the current files, to have a backup
 - Upload the file
 - Check on the page of the user wheter it works
   - The tool will only work one day after the first time entry was made
 - Commit and push the changes
 - Inform the new member about their link

# Update a Member
 - Pull the latest changes!
 - In the `/hours/public/data` folder, open RequiredHours_??.csv update the percentage for the affected days.
 - If hours were paid out, open the TeamData.csv and increase the paid out number by the paid out amount.
 - Open `crew.raumgleiter.com/hours/data` in FileZilla
 - Download the current files, to have a backup
 - Upload the file
 - Check on the page of the user wheter it works
   - The tool will only work one day after the first time entry was made
 - Commit and push the changes
 - Inform the member about the changes

# Calculation Overtime

### Data Sources
 - Clockify: Any tracked time (Project doesn't matter)  

 - TeamData table
   - One row per employee
   - Clockify-Mail of the employee
   - First date that will be taken into account
   - Location of the employee to determine which RequiredHours table should be used
   - Paind out hours that should be substracted from the overtime
![](_res/teamdata.jpg)

 - RequiredHours table
    - One row per date  
    - The hours required for a 100% employee
    - The percentage that the employee had to work on this day  
![](_res/requiredhours.jpg)

### Formula
**Total (Since the start day of the tracking):**
`Overtime = Sum of worked hours - Sum of required hours`

**Day (Starts and ends at 3:00 AM):**
`Worked hours = Time tracked in Clockify`
`Required hours = Required hours at full-time * part-time percentage`

### Example
This employee works 80% from Monday to Thursday:
![](_res/example.jpg)
 - They need to work 6.8 hours a day
 - From Monday to Thursday they work 8.5 hours each, accumulating 1.7 hours overtime a day
 - On Friday they lose the accumulated overtime

### Holidays?
 - When a holiday lands on a day that the employee doesn't work, they still accumulated the overtime across the other days. Therefore they gain the time they have to work a day (their percentage) as overtime.
 - When a holiday lands on a day that the employee works, on that day they can't accumulate the overtime required to compensate for the day they don't work. Therefore they need to work additional time to compensate for that.
 - This means, that the employees don't win or lose anything depending on the day that the holiday lands on. But the overtime increases or decreases if the employees don't work each day the exact percentage.
