Well, it's very complicated and confusing when you do calculation of leave and attendance manually and often it results into mistake if not done attentively. Most of the companies now using advanced HR and Payroll software to manage all the things in an easy way.
These advance software are often loaded with different modules when you need to enter the details once only and rest of the calculation and adjustments will be done by the software itself in an easy way.
You can go for
SaralPayroll software that comes with leave management module and other modules like attendance, employee management etc. that can help you. Initially you can try its free or trial version to check this.