Over Time / Extra Income in Salary Slip - Payroll in HR

Dear Friends,
I have a problem incorporating Over Time / Extra Income in Salary Slip - Payroll in HR.
We have an ERPNext instance running. It is fully functional and the HR module is implemented.
We have created all the salary components and structures and run the payroll to test the same.
One of the salary component is Over time or Extra duty.

To automate the extra earnings in salary slip we need the following logic from code (server script)

In the attendance template (import), we will create a separate section for extra duty in that if we declare the additional salary is required in the salary slip so the system will create an additional salary document based on our entered data like total hours, rate and amount. While we import the attendance system will check the validation and make an additional salary.

Either we need the above script to be delivered OR you can suggest a method to achieve the same if an easier way is possible.
Visit - https://www.upwork.com/jobs/~017d12419b97ec0cb5

Looking forward to your suggestions.

@Deva_Bapat One way is to create the Timesheets for the Overtime hours. And then Create a new Payroll Entry and select the “Salary Slip Based on Timesheet” checkbox. The Salary Slip of the employee will fetch all the timesheets (if any) of that employee created for that particular period and calculate the Overtime Component in the Salary Slip accordingly.

Thanks
Nikhil Rana

Another way to do it would be to use the Additional Salary doctype:

https://docs.erpnext.com/docs/v13/user/manual/en/human-resources/additional-salary

You can check this out Create Payroll Entry with Timesheets

Thank you all for your suggestion>
It had helped.