Using a script allows for the most
flexible rules, and hence is the approach most often used. Simply
put you can manipulate the time calculated, moving time from one
category to another. There are 2 embed points created especially for
this purpose. The one is called
Before Daily Running
and the other is
Before Payroll Running
An example script might look like this;
At Before Daily Running
If Dai:Hours2 > 2880000
Dai:Hours6 = Dai:Hours2 - 2880000
Dai:Hours2 = 2880000
Else
Dai:Hours7 = 2880000 - Dai:Hours2
Dai:Hours2 = 2880000
End
In the above script the normal time
is set to 8 hours (remember in the scripts time is measured in hundredths
of a second - ie 1 hour is 360000 and 8 hours is 2880000).
If the person has worked more than 8 hours then the excess is moved
to the Flexi+ category (category 6) and the normal time is limited
to 8 hours. If they've worked less than 8 hours then the missing
time is added to the Flexi- time, and the normal hours is again set
to 8.
A slightly more complicated script
might not allow the flexitime to become negative. In other words the
normal time is only padded out if sufficient flexitime exists. In
this case the script might look like this;
At Before Daily Running
If Dai:Hours2 > 2880000
Dai:Hours6 = Dai:Hours2 - 2880000
Dai:Hours2 = 2880000
Else
If Dai:Hours8 > Dai:Hours2 - 2880000
Dai:Hours7 = 2880000 - Dai:Hours2
Dai:Hours2 = 2880000
Else
Dai:Hours7 = Dai:Hours8
Dai:Hours2 = Dai:Hours2 + Dai:Hours8
End
End
In both of the above scripts the Add
category is category number 6, the subtract is number 7 and the
total is in 8. The Normal time is in category 2.
Of course these are just 2 common
examples. You will need to adjust the rules depending on the rules
required on your site. For more information on macros click here.