Attendance effect the salary slip

How i can make the attendance mark effect the total of salary slip ?
And does ERPNext automatically generate the salary at the end of each month?

In Payroll Settings check the appropriate option under Calculate Payroll Working Days Based On:

No. You’ll have to process the same via Payroll Entry.

You can also try to use the Auto-Repeat to generate the entry every month. Scripts can be used for further automation of the process.