Timesheet Lunch Time - How To Exclude


Is there a way to exclude lunch time from daily timesheet detail row?

A user worked from 9am to 6pm and the start/end time needs to be logged in the Timesheet.
When a user keys in Timesheet detail row FromTime as 9am, then with Hours as 8hrs, the EndTime is automatically set as 5pm (need to show as 6pm).
If the user keys in FromTime as 9am, and EndTime as 6pm, the Hours would be 9hrs, and this will overpay at the Salary side (linked to Timesheet).

Even if scripting is required for this, kindly point me to the right direction.

Any advice is much appreciated.


Best Regards.

Write a custom script and split the time for the day, in 2 parts

08 until 12
13 until 18

It will remove the lunch from the timesheets

The validation event is perfect to do that

Hi Max @max_morais_dmm,
Thanks for your reply.

Regarding your suggestion to split them, I’ve tried but I am not familiar on how to manipulate the child table’s rows. I understand that you mean to read the from_time & to_time, and then split them into 2 new rows, right? I couldn’t get a way to do it.

As for the validation event, thanks for the tip, but again, it wouldn’t work as expected. Probably due to child table issues, or that I’m not familiar with manipulating it.

It took a while but I managed to do it eventually.
I used the event on the from_time field, and then manipulate a new end time.

I still mark your reply as solution because:

  1. It would work if it is a normal doctype (without child tables)
  2. It pointed me to the direction where I can explore therein.

BUT, somehow I couldn’t find anywhere how to mark as solution.

Thank you.