Home      Ask a Question      My Stuff      Help   
  
Accruals - Accruing Based on a Benefits Date in Employee Setup
The below script allows one to accrue based on a date entered in an optional field or a "Benefits Date" meaning a date designated by the employer when an employee would receive benefits like accruing at a higher rate than they would if it was based off of their Hire Date.

It is important to note that dates need to be in the "cdate" format for this to work (YYYY-MM-DD).

In the example we are using home 3 in Employee Setup to calculate years of service using a date in Home 3 IF the date in Home 3 is earlier than the Hire Date field in Employee Setup:


if(employee.home3 <> ""){
if(cdate(employee.home3) < employee.startdate){
$sdate = cdate(employee.home3);
}else{
$sdate = employee.startdate;
}
}

$yos = (reportingdate.date - $sdate )/365;


==To convert this to months of service one could change the last line above to:

$mos = (reportingdate.date - $sdate )/365 * 12;


==Here is an example of an actual accruals script using $mos (months of service based on Home 3):

if(employee.home3 <> ""){
if(cdate(employee.home3) < employee.startdate){
$sdate = cdate(employee.home3);
}else{
$sdate = employee.startdate;
}
}

$mos = (reportingdate.date - $sdate )/365 * 12;


if(reportingdate.date >= "2015-01-1" AND reportingdate.date = reportingdate.payperiodend){
if($mos > 0){
accrueup("Vacation", 4, "","");
}
}


The above states that if the current date is 1/1/2015 or greater and the month of service of Home 3 ($mos) is greater than 0 then accrue up 4 hours of Vacation on the last day of the pay period.

ID
1491
Category
>Support
  Accruals
Date Created
4/1/2015 11:59:10 AM
Date Updated
1/18/2016 8:38:02 AM
Back to Search Results