Unable to calculate payroll as per attendance

Go to your Earning Salary Components and check the boxes names Depends on Payment Days. This will force the payroll to calculate earned income based on attendance.