Time Clock - Basic Time Tracking

Ensure you have Clocked In and Clocked Out the Employee at least once. More times is better.

Change your Report so it is only making a single SQL call so we can narrow this down.

[Current Hours Daniel B.:13,12, 12, 12, 20, 16, 7]
@@EmployeePunchInLatest:Employee,Daniel B.

In the SQL script shown above, change these lines (just copy from here and paste over your script):

declare @StartDate datetime --= convert(varchar(25),'{Start}',126)
--declare @EndDate date = dateadd(Month,1,@StartDate)
declare @EndDate datetime --= convert(varchar(25),'{End}',126)
declare @Now datetime = CONVERT(VARCHAR(25), GETDATE(), 126)

set @StartDate= left(CONVERT(VARCHAR(25), GETDATE(), 126),7)+'-01T00:00:00'
--set @EndDate  = dateadd(Month,1,@StartDate)
set @EndDate  = dateadd(Month,1,left(convert(varchar(25),@StartDate,126),7)+'-01T00:00:00')


-- set Employee Name
declare @Employee varchar(20) = 'Daniel B.'--'@2'
declare @HolidayFlag varchar(20) = 'Holiday'
declare @EntityType varchar(20) = 'Employee'--'@1'
declare @Clockin varchar(20) = 'PunchIn'
-- set Overtime Hour Limit
declare @HourLimit decimal(4,2) = 8.00

You have a typo. Defined it as @@EmployeePunchinLatest but calling it as @@EmployeePunchInLatest. These are case sensitive.

Yep, that was it. Thank you so much.

Just a few things.

  1. I notice after the 8th hour of each day, the employee gets OT hours. How do I configure it so that the employee gets OT hours after the 40th HOUR of each WEEK?

  2. Will I be able to fit 20 or more employee widgets on this screen? The space seems limited. I guess Iā€™ll just remove the Reports Widget and leave only the Entity Grid Widgets.

  3. How do I add PINs to add a layer of security? Something like this: TimeTrex Community Edition Integration: How to integrate third party Payroll/Time Clock software into SambaPOS - #59 by emre

  4. In emreā€™s post, in the link above, there is a button for ā€œBreakā€. How do I implement that into the reports?

  5. How do I CLEAR the SQL data for the Time Clock?

  6. How do I EDIT the SQL data for the Time Clock?
    Letā€™s say an employee forgot to Clock Out at the end of his or her shift, or there was a problem and an employee could not Clock In.

Sorry for asking too much.

You need to change the SQL to calculate it in this way. You will also need to be specific as to what a ā€œweekā€ is - which day it starts and which day it ends.

Not likely, and the performance for pulling even just 4 Reports can be slow. You could have a single Report, and use automation to load the report for the chosen employee via click of Automation Button, Entity Button, or Entity Grid. I have the Punch Editor and Payroll setups operating this way.

With more automation, similar to above.

Run SQL script in SSMSā€¦

DELETE FROM [EntityStateLogs]

Install the Punch Editor setup. Part of this Tutorial:

That said, there does not appear to be a stand-alone Tutorial for the Punch Editor. Kendash has put the Timeclock and PunchEditor into a Configuration Task insteadā€¦ and you may not like the way his Timeclock is set up, since it is quite a different flow. Proceed with caution. I will try to find some time to create a Punch Editor Tutorial.

No worries. But each of these should be taken 1 at a time, and you should make separate topics for them.

Thank you for being so helpful.

I have a task just for punch editor itā€™s just hidden. Iā€™ll check it tonight to be sure it was complete then Iā€™ll publish the gist here.

2 Likes

@rightguys Ok sorry it was late but if you add this to your Configuration Repository URLā€™s section in Settings > Local Settings > Online Services it will give you the Punch Editor Configuration Task.

https://gist.github.com/kendash/9a887f61097f1690b285/raw/

Additionally if you ever need to add new employees just run the task again and it will auto generate reports etc for you.

3 Likes

@QMcKay I updated my tutorial to include the Standalone Punch Editor Config Task.

2 Likes

Wow, thanks so much.

I want to thank you for such a comprehensive walk through of this module. Truly a great assistance . If you have any other Modules to share I would be very grateful. I have struggled to setup some elements up but this walk through has given me a better understanding of setup.

Thank you very much for support and you are a asset to this forum.

1 Like

Hi guys, This looks ace - thank you for sharing. Is there a canned version of this available as a DB Tools import file, canā€™t seem to find it in the post?

Im not sure if there was but setups like these are normally reluctant to share db tool import as they ALWAYS follow with an onslaught of questions from people which just install and them mess it up as havenā€™t taken the time to learn how the setup was done.

*** I think it should be @@EmployeePunchInLatest. Upper case I. Emre noticed a typo in comments below and I had the same typo, since I cut and paste I thought I should check tutorial. Its incorrect above in the body of the tutorial. I couldnā€™t place it where the actual error is. I can explain it better if you can not locate the error. Thanks

1 Like

ā€¦
Fixed, thank you.

1 Like

This is really frustrating. I have a staging environment where Iā€™ve followed this tutorial and the time clock works, INSERTing records into the [EntityStateLogs] table. However, in our production environment, I have the exact set-up, but only see UPDATES for [EntityStateValues].

Iā€™ve numerously checked my TC_LogEntityState Action and Rule, but completely unable to find the reasons why. Can someone help me please?

We can only guess what is wrong. You need to provide screenshots of your setup for us to help.Right now based off what you have told us there is a 50/50 chance a moose has sat on your other till causing the issueā€¦ but I cant be certainā€¦

Ok sorry bad joke.

2 Likes

LOL. Is this a southern joke? :slight_smile:

Not really we have no moose here lol.

1 Like

Canadian I knew told me one time about how they ran over a moose, well not run over more like hit a moose and wrote off car and it just walked off LOL

1 Like

What if I called my Entities ā€œServersā€ (really wish I hadnā€™t for endless reasons!!), can I modify the Configuration Task to accommodate this?