Home      Ask a Question      My Stuff      Help   
  
Convert Salary Rate Into an Hourly Rate
This simple script can be used for clients that:
--have salaried employees using the clock.
--want to see an hourly equivalent of their salary in the pay rate column on the time card.

What the script does is change the pay rate on the time card into a value that is the pay period salary divided by the total hours on the time card.

It requires:
--An identifier in Employee Setup that is used to recognize whether the employee is Salaried. In this case, Home 1 = Salary
--A pay period salary amount entered in an Employee Setup field. In this case, we will use Home 2

if(employee.home1 = "Salary" and reportingdate.pphours > 0){
payrate = round(val(employee.home2) / reportingdate.pphours, 2);}

HOW IT WORKS
--The script verifies that the employee is salaried and that they have more than 0 hours on the time card. This last condition is used so that we avoid an error appearing on the time card when the employee clocks in for the first time of the pay period and the system tries to divide the salary by 0.
--If those conditions are true, the script takes the pay period salary amount in the Home 2 field and divides it by the total hours on the time card for the pay period. This means the rate will keep adjusting as the employee works.
--Home2 is used instead of the Pay Rate field in Employee Setup because, this way, on the first punch of the pay period, the pay rate field will be blank instead of showing the total pay period salary.
--"val" is use convert the string value of the Home 2 field into number that can be used for the calculation
--"round" is used on the entire calculation (to the nearest 100th), to avoid hourly rates that show 3 decimals.
ID
1678
Category
>Support
  Scripting
Date Created
9/30/2015 3:14:07 PM
Date Updated
9/30/2015 3:28:28 PM
Back to Search Results