Delivered Time Calculation Rule Threshold Formulas Use Starttime

Delivered formulas summarize at the day and time card levels, depending on the date of the start time. They don't use the ActualDate or RefDate generated from the person's work day definition.

Here are detailed results for the sample November 11 through 17, 2019 time card. The person reported time for Monday through Wednesday, November 11 through 13. Any time that they worked above an 8-hour daily threshold is overtime.

Day Payroll Time Type Start Time Stop Time

Mon to Tue

Nov 11 to 12

Regular

5:00a

1:00p

6:00p

7:00a

5:00p

3:00a

Wed, Nov 13 Regular 5:00a 7:00a

For example, if someone works 10 hours in a day, 8 hours is calculated as regular time and 2 hours as overtime. Hours over and under the threshold are determined using StartTime and the overtime work day--5:00p to 5:00p. The delivered threshold formulas determine that the person worked 15 hours on November 11 because all 3 entries start on that day. The ActualDate for all 9 hours of the third entry on November 11 is the same as the date for the start time. The RefDate is also the same, because the start and stop times of that entry are within the 5:00p to 5:00p work day. The ActualDate for the first time entry on 2019-Nov-12 is 2019-Nov-11 because there's less than 180 minutes between when it starts and the 2019-Nov-12 03:00 entry stops.

Start Time Stop Time Measure Payroll Time Type ActualDate RefDate
2019-Nov-11 05:00 2019-Nov-11 07:00 2h Regular 2019-Nov-11 2019-Nov-10
2019-Nov-11 13:00 2019-Nov-11 17:00 4h Regular 2019-Nov-11 2019-Nov-10
2019-Nov-11 18:00 2019-Nov-12 03:00 9h Regular 2019-Nov-11 2019-Nov-11
Daily total: 15h
2019-Nov-12 05:00 2019-Nov-12 07:00 2h Regular 2019-Nov-11 2019-Nov-11
2019-Nov-12 13:00 2019-Nov-12 17:00 4h Regular 2019-Nov-12 2019-Nov-11
2019-Nov-12 18:00 2019-Nov-13 03:00 9h Regular 2019-Nov-12 2019-Nov-12
Daily total: 15h
2019-Nov-13 05:00 2019-Nov-13 07:00 2h Regular 2019-Nov-12 2019-Nov-12
Daily total: 2h
Start Time Stop Time Measure Payroll Time Type ActualDate RefDate
2019-Nov-11 05:00 2019-Nov-11 07:00 2h Regular 2019-Nov-11 2019-Nov-10
2019-Nov-11 13:00 2019-Nov-11 17:00 4h Regular 2019-Nov-11 2019-Nov-10
2019-Nov-11 18:00 2019-Nov-11 20:00 2h Regular 2019-Nov-11 2019-Nov-11
2019-Nov-11 20:00 2019-Nov-12 03:00 7h Overtime 2019-Nov-11 2019-Nov-11
2019-Nov-12 05:00 2019-Nov-12 07:00 2h Regular 2019-Nov-11 2019-Nov-11
2019-Nov-12 13:00 2019-Nov-12 17:00 4h Regular 2019-Nov-12 2019-Nov-11
2019-Nov-11 18:00 2019-Nov-11 20:00 2h Regular 2019-Nov-12 2019-Nov-12
2019-Nov-11 20:00 2019-Nov-12 03:00 7h Overtime 2019-Nov-12 2019-Nov-12
2019-Nov-13 05:00 2019-Nov-13 07:00 2h Regular 2019-Nov-12 2019-Nov-12

Here's the pseudo code for the delivered threshold fast formula.

INPUTS ARE 
  HWM_CTXARY_RECORD_POSITIONS,
  HWM_CTXARY_HWM_MEASURE_DAY,
  Measure,  
  StartTime,
  StopTime,

….

wkTotalHrsDay = 0 
nidx = 0
WHILE (nidx < wMaAry ) LOOP (	  
   nidx = nidx + 1	 
   tcMeasure = 0  
   tcMeasureDay = 0
   tcStartTime = nullDate
	
	aiRecPosition   = HWM_CTXARY_RECORD_POSITIONS[nidx] 
	if (MEASURE.exists(nidx) ) then ( tcMeasure  = MEASURE[nidx]   )  
	if (StartTime.exists(nidx) ) then ( tcStartTime  = StartTime [nidx]   )  

if (recPosition = RecPositoinEoDay ) then  ( 
   /* trunc(tcStartTime)   is different last trunc(tcStartTime  )
   wkTotalHrsDay = tcMeasure  
) else (   
   wkTotalHrsDay =  wkTotalHrsDay  + tcMeasure  
)

If  (wkTotalHrsDay	> p threshold (
   /* create overtime …  */
)
…