On each line (Monday to Sunday) it calculates total work hours
It deducts breaks, which are fixed depending on duty duration
Depending on start times and end times it determines what the pay rate should be
All is good so far
When total hours worked > 36.25, then all hours above this are paid at a new rate
To allocate hours worked above 36.25 it has to remove the hours from the highest rate for that week, if the highest rate doesn't have enough hours to remove, then this is where I have a problem
It needs to remove what it can from highest pay rate, then work it's way down until all overtime hours have been removed
For example, in the attached file there are 13 hours to remove (G34)
It should take 8 hours away from Overtime 4 (G33)
Then take away 5 hours from Overtime 3 (G32)
In the adjusted section, it should also re-rank, to remove overtime details that have been wiped out during the above calculation, e.g. As all hours from Overtime 4 were removed, then there is now Overtime 3
Sounds messy, but viewing the file will make things clear
Bookmarks