Converting Numeric Clock Prompts into a Pay Item - TWP

Most numeric values (non-hours) that need to be collected and totaled on the time card are gathered with a Numeric Clock Prompt (I, J, K, Web Only Numeric). These prompts are often used for items like:
  • tips
  • mileage
  • piece work
If your payroll platform does not support mapping these numeric clock prompts*, you may need to convert them to a Pay Only category on the time card. This conversion would need to be done through a script. Below is an example case involving Tips and how we can take a tip value, entered by the employee at the clock, and change it into a pay item on the time card so it exports as a Punch Category called “Tips”.

*Some payroll platforms support mapping of these clock prompts through File Format Maintenance which means TimeWorksPlus can export the numeric prompt totals in a certain place on the Download Activity File.
 
In addition to the script, you will need:
  • a numeric clock prompt for the tip entry that is collected on the out punch. You can call this prompt whatever you want, but for this example, we will use the Field Name of tipPrompt.
  • a Punch Category to which the script will copy the clock prompt values. This needs to be setup in the Processing Rules page under Processing/ Punch Categories. Click the Add button at the bottom of the page to create the new category with the following setup:
    • Name of the category is Tips.
    • User Selectable should be set to No
    • In the Amount Collection column, select Pay from the dropdown
    • Hour Collection set to None. The end result will be an additional row on the time card with the tips under this category.
With the clock prompt and punch category in place, you can proceed with implementing the script.

NOTE: You can use different clock prompt field names and/or category names but you will need to alter your script. 

The following script in the AddEntry Script box. This box is found in the Scripting category of the Processing Rules page.

if(reportingdate.totalday("tipPrompt") > 0){
   addentry("amount", reportingdate.totalday("tipPrompt"), "Tips");
}

Did you find this article helpful?