how to add noumber of holydays as worked days for employee has full attendance?

hi
I have a certain policy:
in the company there is holyday, Sunday for example
*** If the month is 30 days so there is 26 working days and 4 holidays
take an example for employee salary 600$ for 30 days and 620$ for the 31-month days
the policy says:

  • The salary is divided for 30 days not for 26 days (600$/30=20$ per day)
  • If this employee works all the 26 days with no absence, then I want to give him 600$
  • If this employee works 25 days (1 absence), then I discount 1 day and give him 580$
  • If this employee works 24 days (2 absence), then I want to discount 2 days absence and 2 days from holydays (600$-40$-40$=520$)
  • If this employee works 23 days (3 absence), then I want to discount 3 days absence and 3 days from holydays (600$-60$-60$=480$)
  • If this employee works 22 days (4 absence and more), then I want to discount absence days and don’t give him holydays salary (600$ - number of absences - all holydays occur in the month = total) or (number of worked days * salary per day = total)
    *** In the 31-days month: If the employee works 22 days (5 absences and more), then I want to discount absence days and don’t give him holydays salary (620$ - number of absences - all holydays occur in the month = total) or (number of worked days * salary per day = total)
    how to enter this policy in ERP?
    thank you