So, the issue is, it does not calculate hours and break time deduction correctly when shift start time is in current day and shift end time is in next day. Any suggestion would be much appreciated.
This is because when a shift starts in one day and ends in the next, it complicates calculations, especially with break deductions. So, to fix this you would need to
Try these 2 approaches and see if your issue is fixed. I didnt had enough time to implement a code snippet. So, i explained it here. If i get time i will update the solution here.