Clocking out employees automatically

,

I’m not in 700. Try opening it in a text editor and changing the versions and importing into a test db. If that works then export from your test and import into your production proper.

Change .baq to .zip and open it up

Strange, the version says “3.2.200.0” , should I replace the 200 with 700?

Thanks,

image

verify what ice version you are on but i assume it’s .700 yes.

Help > About > System Info > Framework Base Version

The following post demonstrates using Powershell to generate a list of employees that need clocking and then fires DMT to clock off the users in the list

1 Like

Thank you! This is a great idea, I’ll give it a try and see if I could get it working.

@jgiese.wci I know this is an old topic, but do you mind helping out a complete novice?

I imported your BAQ (after fixing version compatibility - I’m on 10.2.700.24) and when I check the syntax of the BPM code, I get the following error:

The name ‘BetterLog’ does not exist in the current context

Is that something I need to create or reference? I did notice a UD field as well (MissedPunch_c) that I could create later, but for now I’ve simply commented that line out to test.

Thank you, or anyone else for that matter, in advance for any help provided!

That’s an external dll for creating log files. You can comment those out if you want to skip the logging part of it.

1 Like

Or replace those lines with Ice.Diagnostics.Log.WriteEntry()

1 Like

Thank you! This is working great for me. I have it set up on the Post-Processing of GetList so that I can run it every night at 6:00 PM.

Do you know how I might modify the code so that, as a last step, the LaborDtl.TimeStatus is set to ‘E’ ? This will make it easier to Fix those ClockOutTimes on a UBAQ Dashboard I’m creating for the supervisors.

Here’s what I tried so far:

 foreach (var dtl in laborData.LaborDtl)
          {
            try
            {
              if (dtl.ActiveTrans)
              {
                  dtl.RowMod = "U";
                  labor.EndActivity(ref laborData);
                  dtl["TimeStatus"] = "E";
                  labor.Update(ref laborData);
                  Ice.Diagnostics.Log.WriteEntry($"Type = {dtl.LaborType}, Resource = {dtl.ResourceDesc}, JobNum = {dtl.JobNum}, LaborHedSeq = {dtl.LaborHedSeq}, LaborDtlSeq = {dtl.LaborDtlSeq}, LaborDtlTimeStatus = {dtl.TimeStatus}", "BAQ Auto - Clock Out");
              }
            }
            catch (Exception ex)
            {
              Ice.Diagnostics.Log.WriteEntry($"ERROR ENDING ACTIVITY: JobNum = {dtl.JobNum}, LaborHedSeq = {dtl.LaborHedSeq}, LaborDtlSeq = {dtl.LaborDtlSeq}--Error: {ex.Message}", "BAQ Auto - Clock Out");
            }

The log file showed the Time Status as ‘E’ but then when I open the record in Time and Expense Entry, it is ‘Approved’ instead of ‘Entered.’ Can anyone tell me what I did wrong?

Looks like you ran an action on the row with EndActivity, and then an Update.
EndActivity probably changed the RowMod.

Check and see. You will probably need to change the RowMod before Update.

There is a checkbox called ‘Automatically Approve time’ - believe it’s on the Employee record. Is that set?

@MikeGross is this what you’re referring too?

image

It looks like it is unchecked by default for our employees, which makes it all the more curious why the activities are automatically marked as approved when they are ended.

Yes - and there is also one in Site Configuration.

1 Like

The option to automatically approve is unchecked for Employees and in Site Config, so I’m not sure what is forcing the approval immediately. I’ll look for a BPM that might be handling that.

Regardless, I don’t want Supervisors to have to approve all labor. I just want them to correct labor entries when needed, preferably from an Updateable Dashboard.

And coordinate that with finance/accounting as once labor is posted, it’s so much more difficult to correct.

1 Like

Are you backflushing labor? It will be approved automatically.

Otherwise, you may need to open a ticket to get help, or do a client (or server) trace to see if you can see what is being called when you enter time that gets automatically approved.

When we were running 10.2.500 I also created an Auto-Clock Out BPM driven by a scheduled BAQ, and had the same issue of labor details being approved automatically. Unfortunately, I never could solve it. There was an email notification that would prompt the supervisor to review in Time & Expense entry, where they would recall, edit, and resubmit.

After upgrading to 2022.1 I’ve replaced it with an Epicor Function and can schedule that directly and it doesn’t have the same issue.

Sorry I don’t have better news for you.

We use ‘Time and Backflush QTY’ as our Labor Method. This may be a culprit.

I’ll run the trace like you suggested and see what I can find.