# Time Clock - Basic Time Tracking

**URL:** <https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149>\
**Category:** V5 Tutorial\
**Created:** [September 17, 2015, 7:25pm UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149 "2015-09-17T19:25:02Z")\
**Posts on this page:** 20\
**Page:** 4

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [December 29, 2015, 5:44am UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/63 "2015-12-29T05:44:02Z")

</div>

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.

```auto
[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):

```sql
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

```

---

<div class="post-metadata">

**Author:** ![emre](https://forum.sambapos.com/user_avatar/forum.sambapos.com/emre/32/39073_2.png) [@emre](https://forum.sambapos.com/u/emre)\
**Post date:** [December 29, 2015, 9:06am UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/64 "2015-12-29T09:06:08Z")

</div>

You have a typo. Defined it as @@EmployeePunch **i** nLatest but calling it as @@EmployeePunch **I** nLatest. These are case sensitive.

---

<div class="post-metadata">

**Author:** ![rightguys](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/r/ad7895/32.png) [@rightguys](https://forum.sambapos.com/u/rightguys)\
**Post date:** [December 29, 2015, 12:00pm UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/65 "2015-12-29T12:00:57Z")

</div>

> [@emre](#):
>
> 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](http://forum.sambapos.com/t/timetrex-community-edition-integration-how-to-integrate-third-party-payroll-time-clock-software-into-sambapos/2048/59)

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.

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [December 29, 2015, 1:39pm UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/66 "2015-12-29T13:39:11Z")

</div>

> [@rightguys](#):
>
> 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?

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.

> [@rightguys](#):
>
> 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.

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.

> [@rightguys](#):
>
> How do I add PINs to add a layer of security?

With more automation, similar to above.

> [@rightguys](#):
>
> How do I CLEAR the SQL data for the Time Clock?

Run SQL script in SSMS…

```sql
DELETE FROM [EntityStateLogs]

```

> [@rightguys](#):
>
> How do I EDIT the SQL data for the Time Clock?

Install the Punch Editor setup. Part of this Tutorial:

> [@Time Clock & Punch Editor - Custom Navigation Flow: Uses Employee Entities not Users](http://forum.sambapos.com/t/time-clock-punch-editor-custom-navigation-flow-uses-employee-entities-not-users/7114):
>
> exclamation I have included only the configuration task as it is easy to update and it helps me keep this tutorial current Configuration Task Configuration Tasks: Time Clock + Punch Editor https://gist.github.com/kendash/35688644368ef581dc2d/raw/ Standalone Punch Editor https://gist.github.com/kendash/9a887f61097f1690b285/raw/arrow_right_hook Copy the URL and navigate to Settings \> Local Settings \> Online Services and paste that URL in the box then go to Settings \> Configuratio…

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.

> [@rightguys](#):
>
> Sorry for asking too much.

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

---

<div class="post-metadata">

**Author:** ![rightguys](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/r/ad7895/32.png) [@rightguys](https://forum.sambapos.com/u/rightguys)\
**Post date:** [December 29, 2015, 2:14pm UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/67 "2015-12-29T14:14:54Z")

</div>

Thank you for being so helpful.

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [December 29, 2015, 9:13pm UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/68 "2015-12-29T21:13:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [December 30, 2015, 3:39am UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/69 "2015-12-30T03:39:36Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [December 30, 2015, 3:55am UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/70 "2015-12-30T03:55:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rightguys](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/r/ad7895/32.png) [@rightguys](https://forum.sambapos.com/u/rightguys)\
**Post date:** [December 30, 2015, 7:08am UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/71 "2015-12-30T07:08:02Z")

</div>

Wow, thanks so much.

---

<div class="post-metadata">

**Author:** ![Dash](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/d/7c8e57/32.png) [@Dash](https://forum.sambapos.com/u/Dash)\
**Post date:** [February 7, 2016, 12:54pm UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/72 "2016-02-07T12:54:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![1bigwink](https://forum.sambapos.com/user_avatar/forum.sambapos.com/1bigwink/32/27185_2.png) [@1bigwink](https://forum.sambapos.com/u/1bigwink)\
**Post date:** [April 4, 2016, 11:39am UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/73 "2016-04-04T11:39:37Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [April 4, 2016, 1:09pm UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/74 "2016-04-04T13:09:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Mully](https://forum.sambapos.com/user_avatar/forum.sambapos.com/mully/32/26114_2.png) [@Mully](https://forum.sambapos.com/u/Mully)\
**Post date:** [September 5, 2016, 1:28am UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/75 "2016-09-05T01:28:03Z")

</div>

> [@QMcKay](#):
>
> Handler: @@EmployeePunch **i** nLatest

\*\*\* I think it should be @@EmployeePunch **I** nLatest. 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

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [September 5, 2016, 12:23pm UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/76 "2016-09-05T12:23:45Z")

</div>

> [@Mully](#):
>
> Its incorrect above in the body of the tutorial

…  
Fixed, thank you.

---

<div class="post-metadata">

**Author:** ![jrryfn](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/j/54ee81/32.png) [@jrryfn](https://forum.sambapos.com/u/jrryfn)\
**Post date:** [November 30, 2016, 4:55pm UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/77 "2016-11-30T16:55:24Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [December 1, 2016, 12:35am UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/78 "2016-12-01T00:35:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![na1978](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/n/3ec8ea/32.png) [@na1978](https://forum.sambapos.com/u/na1978)\
**Post date:** [December 1, 2016, 1:05am UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/79 "2016-12-01T01:05:28Z")

</div>

LOL. Is this a southern joke? 🙂

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [December 1, 2016, 1:09am UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/80 "2016-12-01T01:09:36Z")

</div>

Not really we have no moose here lol.

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [December 1, 2016, 1:23am UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/81 "2016-12-01T01:23:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Chipwagon](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/c/51bf81/32.png) [@Chipwagon](https://forum.sambapos.com/u/Chipwagon)\
**Post date:** [February 4, 2017, 2:31pm UTC](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149/82 "2017-02-04T14:31:31Z")

</div>

What if I called my Entities “Servers” (really wish I hadn’t for endless reasons!!), can I modify the Configuration Task to accommodate this?

[Previous page](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149.md?page=3)

[Next page](https://forum.sambapos.com/t/time-clock-basic-time-tracking/7149.md?page=5)
