Hi Haritha,
The 2nd scenario is a complicated scenario. However, you can do the following:
Whenever a user has shift starting at 00:30, your pair formation logic should ensure that it should form time pairs using time events on the same day (03-Jan-15). However, if the user has come previous day (02-jan-15) ...lets say at 22:30, in that case, the program should dynamically create a clock in time event at 00:00 for current day (03-Jan-15) if the first time event on 03-Jan-15 is a clock out and the last time event on 02-Jan-15 is a clock in. You need to decide how far back you will go from 00:00 hours on current day to consider that the employee came previous for current day's overtime.
Also, for the previous day (02-Jan-15), you may not find a clock out because the clock out will be on current day (03-Jan-15). For this, you will have to dynamically create a clock with 24:00. You have to ensure that time pairs get formed accordingly.
You need to write logic to form time pairs for current day and previous day as per the above conditions.
From 00:00 - 12:30, let the overtime get calculated as it is and it will fall on current day.
For 22:30 - 24:00, you will have to pass the overtime hours from WT to a time type and reference this time type next day to generate the OT wage type again.
Night Shift - payment to be made on current day'
Honestly speaking, I am not a fan of changing pair formation logic. Because there are many things to be taken into consideration and will require extensive testing for various possible scenarios.
Thanks and regards,
Vivek Barnwal