How to deduct from the customer salary based on coming late

I have employee and his salary is 1000$, and we agreed he will come at 9:00 AM and Leave in 5:00 PM.
so if he came late more that 15 minute i want to deduct from his salary 25%, and if he came late 60 minute i want to deduct half day.
how can i do that in the system?

Thanks.

This might be what you are after?

https://erpnext.org/docs/user/manual/en/projects/timesheet/salary-slip-from-timesheet?