Afternoon and Midnight Premiums

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Locked
blabj
Posts: 70
Joined: Wed Dec 26, 2007 5:09 pm

Afternoon and Midnight Premiums

Post by blabj »

Created two Premium Policies - MIDPRM and AFTPRM

Both are date/time type, no start/end dates, no end time, no inclusion of partial punches and active after 00:00 daily/weekly - effective every day... 00:00 min/max.. pay type pay + premium (include meal policy in calc).

Start time on MIDPRM is 6:00pm.. Premium amount is $0.60
Start time on AFTPRM is 9:00am.. Premium amount is $0.50

Our contract stipulates if employee starts shift 6:00pm or later, they are entitled to midnight premium, and if shift starts at 9:00am or later they are entitled to afternoon premium.. BUT not both.

AFTPRM is attached to "AFT" Policy Group
MIDPRM is attached to "MID" Policy Group
Neither is attached to "DAY" Policy Group

The above setup works fine in the "normal" scenario.. ie. employee in "AFT" policy group works the afternoon shift, and employee in the "MID" policy group works the midnight shift.

But IF, for example, and employee from the "DAY" policy group works an afternoon or midnight shift, the premium doesn't kick in because premiums are tied to policy groups and not to shifts.

It would be great if premium policies were tied to schedule policies.

If I enable both premium policies to all policy groups.. the midnight shift gets both premiums. ug..

Any way around this?

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

Post by shaunw »

Yes, use start and end times, and make sure to not check "Include Partial Punches"

For example,

AFTPRM starts at 9AM, ends at 5:59PM
MIDPRM starts at 6PM, ends at ...

You should then be able to assign these policies to all employees and have them applied correctly.

Shifts that start between 9AM and 5:59PM get the AFTPRM, and shifts that start after 6PM get the MIDPRM, but because partial punches are not included, only one premium will be assigned at a time, even if a shift starts at like 1PM and ends at 8PM (only AFRPRM will be applied in this case for the entire 7 your shift).
blabj
Posts: 70
Joined: Wed Dec 26, 2007 5:09 pm

Post by blabj »

Actually I had tried what you suggested, and it doesn't work in one scenario..

For midnight shift (punching at 11pm).. it picks up both premiums (even though the window for AFTPRM is 9am - 5:59pm), and it assigns 8:00 to both!

Afternoon shift only picks AFTPRM which is good/expected, and day shift picks up neither - again as expected.

Also - Include partial punches is not checked in either premium.
blabj
Posts: 70
Joined: Wed Dec 26, 2007 5:09 pm

Post by blabj »

Also - for day shift employees that punch out/in for lunch.. it applies the AFTPRM to their afternoon!

In from lunch should not trigger premium..
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

I mentioned this to our developers and it looks like there is a strange bug that in this exact scenario where the out punch is after midnight and the time restrictions are not, the premium policy is extending the window to the next day so punches are mistakenly being applied to that premium policy.

This will be fixed in the next version of TimeTrex, but in the mean time if you modify the following file:

classes/modules/policy/PremiumPolicyFactory.class.php around line 1394:

Change this line:

Code: Select all

$end_time_stamp = TTDate::getTimeLockedDate( $this->getEndTime(), $out_epoch);
To this:

Code: Select all

$end_time_stamp = TTDate::getTimeLockedDate( $this->getEndTime(), $in_epoch);
Basically the last variable is changed from $out_epoch to $in_epoch. Save the file, then re-calculate the employees timesheet and it should correct the issue.
blabj
Posts: 70
Joined: Wed Dec 26, 2007 5:09 pm

Post by blabj »

I made this change, and now MIDPRM is not being picked up at all.. and Lunch IN punches are still triggering AFTPRM for day shift employees.
blabj
Posts: 70
Joined: Wed Dec 26, 2007 5:09 pm

Post by blabj »

I went back and put in an "End Time" of 03:00 am to the MIDPRM, and now they are getting picked up.

But.. problem with Lunch IN punches still exists.
blabj
Posts: 70
Joined: Wed Dec 26, 2007 5:09 pm

Post by blabj »

And another strange thing.. if employee punches at 12:00am or later for midnight shift, then MIDPRM doesn't get picked up (even though window is 6pm - 3am.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

I'll pass this on to the developers, if they find any issues they should be able to have them fixed for the next version of TimeTrex.
Locked