Rouding Policy Ignoring Break Time

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Post Reply
andrewW
Posts: 4
Joined: Fri Oct 21, 2016 4:53 am

Rouding Policy Ignoring Break Time

Post by andrewW »

Hi,
Just upgraded from 9.0.2 to 11.1.3 (yes, quite a leap!) and noticed that the rounding policy is no longer working in the same way. We have a 15 minute daily total average rounding which worked fine in 9.0.2 e.g. an employee punching in at 08:31, taking a 50 minute lunch would have the punch out rounded to 17:06 giving a work total of 7:45. In 11.1.3 we get an example of punch in at 08:23, lunch 59 minutes and punch out rounded to 17:08. The 17:08 is a correct rounding for a 60 minute lunch but not 59. Rounding now seems to be ignoring the break time.

Do I need to modify some new setting or is this considered a "fix" to the "old" way? OR is this indeed (as I see it) a bug?

Thoughts/help anybody?

Thanks.

Andrew.
andrewW
Posts: 4
Joined: Fri Oct 21, 2016 4:53 am

Re: Rouding Policy Ignoring Break Time

Post by andrewW »

I actullay checked my debug logs for the "end of shift" final punch out. Here are the details:

Punch in at 2:07 PM
Out to lunch at 3:58 PM
Lunch In at 4:05 PM
Attempting to punch out at 5:41:55 PM:

DEBUG [L0615] [00013ms]: APIPunch::setPunch(): Setting object data...
DEBUG [L2442] [00013ms]: PunchFactory::setObjectFromArray(): Setting User ID: ccf1a93d-53a3-e0e4-4b0c-000000000016
DEBUG [L0445] [00013ms]: PunchFactory::setStatus(): Status: 20
DEBUG [L0557] [00013ms]: PunchFactory::roundTimeStamp(): Rounding Timestamp: 21/01/2018 5:41 PM(1516556514) Status ID: 20 Type ID: 10 Round Policy Type: 50 Is Transfer: 0
DEBUG [L0560] [00015ms]: PunchFactory::roundTimeStamp(): Round Interval Punch Type: 50 User: ccf1a93d-53a3-e0e4-4b0c-000000000016 Total Records: 1
DEBUG [L0565] [00015ms]: PunchFactory::roundTimeStamp(): Found Rounding Policy: daily-15-mins(ccf1a93d-53a3-e0e4-4b0c-000000000014) Punch Type: 120 Conditional Type: 0
DEBUG [L0742] [00015ms]: PunchFactory::roundTimeStamp(): Day Total Rounding: 21/01/2018 5:41 PM
DEBUG [L0744] [00015ms]: PunchFactory::roundTimeStamp(): bDay Total Rounding: 21/01/2018 5:41 PM
DEBUG [L1049] [00015ms]: PunchListFactory::getPreviousPunchByUserIdAndEpochAndNotPunchIDAndMaximumShiftTime(): User ID: ccf1a93d-53a3-e0e4-4b0c-000000000016 Epoch: 1516556514
DEBUG [L0062] [00016ms]: PunchListFactory::getPayPeriodMaximumShiftTime(): cPay Period Schedule Maximum Shift Time: 75600
DEBUG [L1061] [00016ms]: PunchListFactory::getPreviousPunchByUserIdAndEpochAndNotPunchIDAndMaximumShiftTime(): Start Time: 20/01/2018 8:41 PM
DEBUG [L0750] [00017ms]: PunchFactory::roundTimeStamp(): Found Previous Punch In: 21/01/2018 4:05 PM
DEBUG [L0758] [00018ms]: PunchFactory::roundTimeStamp(): aDay Total Time: 5814 Current Punch Control ID:
DEBUG [L0762] [00018ms]: PunchFactory::roundTimeStamp(): Punch Control Total Time: 6660 ID: 11e7feb4-6acf-b4e0-b72a-ccf1a93d5367
DEBUG [L0777] [00020ms]: PunchFactory::roundTimeStamp(): Meal and Break Adjustment: 420 Records: 1
DEBUG [L0783] [00020ms]: PunchFactory::roundTimeStamp(): cDay Total Time: 12894
DEBUG [L0816] [00021ms]: PunchFactory::roundTimeStamp(): Rounding to interval: 900
DEBUG [L0818] [00021ms]: PunchFactory::roundTimeStamp(): After Rounding: 12600
DEBUG [L0835] [00021ms]: PunchFactory::roundTimeStamp(): cDay Total Time: 12600
DEBUG [L0838] [00021ms]: PunchFactory::roundTimeStamp(): Day Total Diff: -294
DEBUG [L0950] [00021ms]: PunchFactory::roundTimeStamp(): Rounded TimeStamp: 21/01/2018 5:37 PM(1516556220) Original TimeStamp: 21/01/2018 5:41 PM
DEBUG [L1000] [00021ms]: PunchFactory::setTimeStamp(): Set: 1516556220

Punch out is rounded DOWN to 5:37 PM giving a working day of 3:23! It should be rounded UP to 5:44 PM and 3:30. The calulation all seems well in the bold lines when working in seconds but its the final calculation (underlined) storing the timestamp which has lost the 420 second / 7 minute lunch break.

Andrew
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Rouding Policy Ignoring Break Time

Post by shaunw »

According to that log, TimeTrex thinks the daily total time worked is 5814 seconds (1.615 hours), which is only the time from 4:05PM to 5:41PM, so that leads me to believe that the "lunch" punches aren't actually flagged as "lunch", and instead are "normal" punches.

Can you confirm if this is the case or not?
andrewW
Posts: 4
Joined: Fri Oct 21, 2016 4:53 am

Re: Rouding Policy Ignoring Break Time

Post by andrewW »

The aDay value is 5814, but the "Punch Control Total Time" is 6660 which is the first part of the shift and when added give the total worked time as 12,474. This should be rounded to 12,600 (which by chance it is in this case) but cDay is wrong because it is 12474 +420 (the lunch break) giving 12,894. The day diff is then calculated as 12,600 - 12,894 = -294. This 294 seconds is then subtracted from the punch time causing the rounding down to the wrong value. The diff value should in fact be 12,600 - 12,474 = 126 which would round the punch out time UP to the correct value 5:44.

When I compare my previous logs I see the cause is the fact that the break time is now added to the working shift times. I have no idea why as I did not change any DB settings before/during/after the migration. To prove my theory I have modified the code to skip the processing of the break time and the calcuation works perfectly as it did before.

I checked my break policies etc. and I can see that all breaks are set as "unpaid" (as they were before)

I'll try to add a screen shot of the offending day (Sunday Jan 21 2018)
Attachments
timetrex.jpg
timetrex.jpg (389.99 KiB) Viewed 3414 times
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Rouding Policy Ignoring Break Time

Post by shaunw »

Can you attach a screenshot of your meal policy so we can see what settings you have on it?
Post Reply