TimeClock Report Formatting

Hello, got a question about the formatting of the duration of the employee.
I put now the days, h and min. It is okay, but the ideal format would be the sum of the hours and minutes.
Instead of 1 day, 10:38 would be mor suitable 34:38.

Is this possible by changing the fs\\:d\ \j\o\u\r\s\ \\:hh\\:mm or do I have do do a calculation?

Here the report:

{TIME}
@{REPORT TASK DETAILS:TSC.User:((TST=Punch))::{0}:,}
[Resumé par Employé:2,1,1]

Nom|Travail|Pause
{REPORT TASK DETAILS:TSC.User.asc, TSD.Clocked In.sum;fs\:d\ \j\o\u\r\s\ \:hh\:mm,TSD.Break.sum;fs\:hh\:mm,:(TST=Punch) AND T.Content="$1"}

[Détail du temps de travail:1.5,1,1.5,1.5,1.5,1,1,1]

Nom|Etat|Entrée|Sortie|Durée|Payée|Pause
@{REPORT TASK DETAILS:TSC.User:((TST=Punch))::{0}:,}
$1
{REPORT TASK DETAILS:
TSC.User.asc,
T.State,
T.StartDate,
T.StartTime,
T.Duration.sum,
[TDM($5)];hh,[TDM($5)];mm,
TSD.Clocked In.sum;fs\:hh\:mm,
TSD.Break.sum;fs\:hh\:mm,
T.EndDate,
T.EndTime,
:((TST=Punch)) AND T.Content="$1"
:{0}|{1}|[=FD("{2}",‘dd/MM/yyyy’)] {3}|[=FD("{9}",‘dd/MM/yyyy’)] {10}|{5} hr {6} min|{7}|{8}}
|||TOTAL|{REPORT TASK DETAILS:TSD.Clocked In.sum;fs\:d\ \j\o\u\r\s\ \:hh\:mm,TSD.Break.sum;fs\:hh\:mm:(TST=Punch) AND T.Content="$1"}

There is a bug with the default report that came with the timeclock import.

The bug happens when edit a time record. The TSD.Clocked In field doesn’t get adjusted with the edit.

Here is report I use that doesn’t use the TSD.Clocked in field.

[Punch Report:2.5,2.5,2,1.5,1.5,1.5, 1.5]
>Clocked In Date & Time|Clock Out Date & Time|Duration|Break|Total Hrs|Reported Tips
@{REPORT TASK DETAILS:TSC.User.asc:(TST=Punch) && T.Completed=True:,}
$1
{REPORT TASK DETAILS:
	T.StartDate,
	T.StartTime,
	T.EndDate,
	T.EndTime,
	T.Duration;fm\\:h\ \h\r\ m\ \m,
	TSD.Break.sum;fs\\:h\\:mm,
	=([T.Duration]-([TSD.Break]/60));fm\\:h\\:mm,
	TSCN.Tip.sum
:(TST=Punch) && T.Completed=True && (TSC.User=$1)
:[=FD('{0}','ddd M\/d')] [=FD('{1}','hh\:mm tt')]|[=FD('{2}','ddd M\/d')] [=FD('{3}','hh\:mm tt')]|{4}|{5}|{6}|${7}}
>   Totals for $1|   # Entries: {REPORT TASK DETAILS:T.EndDate.count:(TST=Punch) && T.Completed=True && (TSC.User=$1)}|{REPORT TASK DETAILS:[T.Duration.sum]/60,[T.Duration.sum]%60,[TSD.Break.sum]/60/60,[TSD.Break.sum]/60%60,=[([T.Duration]-([TSD.Break]/60)).Sum] / 60,=[([T.Duration]-([TSD.Break]/60)).Sum] % 60:(TST=Punch) && T.Completed=True && (TSC.User=$1):[=F(TN('{0}')<<0,'00')] hrs [=F(TN('{1}')<<0, '00')] mins|[=F(TN('{2}')<<0,'0')]\:[=F(TN('{3}')<<0,'00')]|[=F(TN('{4}')<<0,'0')]\:[=F(TN('{5}')<<0,'00')]}|$ {REPORT TASK DETAILS:TSCN.Tip.sum:(TST=Punch) && (TSC.User=$1)}
Persons on this Report: {REPORT TASK DETAILS:TSC.User.asc:(TST=Punch) && T.Completed=True:,}

I’m not sure if this is what your looking for or not, but hope it helps.

@Bob_be

Your report was formatted wrong so it was replacing the single quotes with wrong characters making it not work if someone copied it from here and inserted it into sambapos.
I have corrected that. To prevent this in the future when you post code use ``` before the beginning and after the end of your code and the forum will format it correctly for you.

For those curious the ` key is the squigly key above tab on a standard usa keyboard. I am not sure if its the same for other country keyboard layout.

1 Like

Thanks @Jesse!

I didn’t know that. I’ve been using a single squiggly key before and after code. (I’m sure my other posts are going to be the same way)

Also, thanks for fixing this post.

1 Like

@Bob_be I took your report and did a little formatting to it.

[Punch Report:2.5,2.5,2,1.5,1.5,1.5, 1.5]
>>Clocked In Date & Time|Clock Out Date & Time|Duration|Break|Total Hrs|Reported Tips
@{REPORT TASK DETAILS:TSC.User.asc:(TST=Punch) && T.Completed=True:,}
>>$1
{REPORT TASK DETAILS:
	T.StartDate,
	T.StartTime,
	T.EndDate,
	T.EndTime,
	T.Duration;fm\\:h\ \h\r\ m\ \m,
	TSD.Break.sum;fs\\:h\\:mm,
	=([T.Duration]-([TSD.Break]/60));fm\\:h\\:mm,
	TSCN.Tip.sum
:(TST=Punch) && T.Completed=True && (TSC.User=$1)
:[=FD('{0}','ddd M\/d')] [=FD('{1}','hh\:mm tt')]|[=FD('{2}','ddd M\/d')] [=FD('{3}','hh\:mm tt')]|{4}|{5}|{6}|${7}}
>   Totals for $1|   # Entries: {REPORT TASK DETAILS:T.EndDate.count:(TST=Punch) && T.Completed=True && (TSC.User=$1)}|{REPORT TASK DETAILS:[T.Duration.sum]/60,[T.Duration.sum]%60,[TSD.Break.sum]/60/60,[TSD.Break.sum]/60%60,=[([T.Duration]-([TSD.Break]/60)).Sum] / 60,=[([T.Duration]-([TSD.Break]/60)).Sum] % 60:(TST=Punch) && T.Completed=True && (TSC.User=$1):[=F(TN('{0}')<<0,'00')] hrs [=F(TN('{1}')<<0, '00')] mins|[=F(TN('{2}')<<0,'0')]\:[=F(TN('{3}')<<0,'00')]|[=F(TN('{4}')<<0,'0')]\:[=F(TN('{5}')<<0,'00')]}|$ {REPORT TASK DETAILS:TSCN.Tip.sum:(TST=Punch) && (TSC.User=$1)}
>>Persons on this Report: {REPORT TASK DETAILS:TSC.User.asc:(TST=Punch) && T.Completed=True:,}

2 Likes

Looks Awesome!!! I could not have done better myself!

vrCtAWrTNk

LOL, the other changes looks good too, easier on the eyes with the separations.

1 Like

Hi @Jesse, I tried using this code to get the totals hours for each employee with the timeclock8 config file.

It shows the values like a charm. But I noticed that samba started to freeze after I created a new custom report with exactly this code.

Is there something in this code that could create such an issue?

Unsure what to do as I’m new to custom reports.

This is my current punch report at the moment without the total time for each employee


[Punch Report:1,1,1.5,1.5,1,1, 1]
>User|State|Clocked In|Shift Duration|Paid|Break|Reported Tip
{REPORT TASK DETAILS:
	TSC.User.asc,
	T.State,
	T.StartDate,
	T.StartTime,
	T.Duration.sum,
	[TDM($5)];hh,[TDM($5)];mm,
	TSD.Clocked In.sum;fs\\:hh\\:mm,
	TSD.Break.sum;fs\\:hh\\:mm,
	TSCN.Tip.sum
:(TST=Punch)
:{0}|{1}|{2} {3}|{5} hr {6} min|{7}|{8}|{9}}

No it shouldn’t freeze sambapos. What do you mean by freeze?

when I play around with different dates in the custom report (with total hours), Sambapos stops working and I can’t click anything.

From one of the other posts I read, I’m assuming it could be due to a mistake in custom report formatting?

I’m confused. You mean when you edit the report?

nope, when I’m trying to view custom dates from the top of the reports section

I restored some settings and it seems to have resolved. Sambapos has however crashed as I’m trying to edit custom reports :confused:

Seems its something not related. Do you have any scripts in reports? What version of SambaPOS? What does the crash report say?

We are using this same report in several locations with no issue. I have it on our test system here and no issue. The report is fairly basic… I cant see why the report would cause any issues. Maybe there is something about your database?

It seems to only happen when editing the reports sometimes so hopefully this doesn’t occur when the system is live for order taking. If it does, I will shoot through the crash report!

I’ve come across a new challenge however in turning the hh:mm format to total number of hours with two decimal places.

I’ve been able to update it for parts of the report but I’m unsure how to format the ‘Totals’ into an houry format with two decimals.

[Punch Report:5,5,2.5,2.5,2.5,2.5,0.5]
>>Clocked In Date & Time|Clock Out Date & Time|Duration|Break|Total Hrs|Reported Tips
@{REPORT TASK DETAILS:TSC.User.asc:(TST=Punch) && T.Completed=True:,}
>>$1
{REPORT TASK DETAILS:
	T.StartDate,
	T.StartTime,
	T.EndDate,
	T.EndTime,
	=TN([T.Duration]/60);0.00,
	TSD.Break.sum,
	=TN(([T.Duration]-([TSD.Break]/60))/60);0.00,
	TSCN.Tip.sum
:(TST=Punch) && T.Completed=True && (TSC.User=$1)
:[=FD('{0}','ddd M\/d')] [=FD('{1}','hh\:mm tt')]|[=FD('{2}','ddd M\/d')] [=FD('{3}','hh\:mm tt')]|{4}|{5}|{6}|${7}}
>   Totals for $1|   # Entries: {REPORT TASK DETAILS:T.EndDate.count:(TST=Punch) && T.Completed=True && (TSC.User=$1)}|{REPORT TASK DETAILS:[T.Duration.sum]/60,[T.Duration.sum]%60,[TSD.Break.sum]/60/60,[TSD.Break.sum]/60%60,=[([T.Duration]-([TSD.Break]/60)).Sum] / 60,=[([T.Duration]-([TSD.Break]/60)).Sum] % 60:(TST=Punch) && T.Completed=True && (TSC.User=$1):[=F(TN('{0}')<<0,'00')] hrs [=F(TN('{1}')<<0, '00')] mins|[=F(TN('{2}')<<0,'0')]\:[=F(TN('{3}')<<0,'00')]|[=F(TN('{4}')<<0,'0')]\:[=F(TN('{5}')<<0,'00')]}|$ {REPORT TASK DETAILS:TSCN.Tip.sum:(TST=Punch) && (TSC.User=$1)}
>>Persons on this Report: {REPORT TASK DETAILS:TSC.User.asc:(TST=Punch) && T.Completed=True:,}

Finally got it working, woohoo!

[Punch Report:5,5,2.5,2.5,2.5,2.5,0.5]
>>Clocked In Date & Time|Clock Out Date & Time|Duration|Break|Total Hrs|Reported Tips
@{REPORT TASK DETAILS:TSC.User.asc:(TST=Punch) && T.Completed=True:,}
>>$1
{REPORT TASK DETAILS:
	T.StartDate,
	T.StartTime,
	T.EndDate,
	T.EndTime,
	=TN([T.Duration]/60);0.00,
	TSD.Break.sum,
	=TN(([T.Duration]-([TSD.Break]/60))/60);0.00,
	TSCN.Tip.sum
:(TST=Punch) && T.Completed=True && (TSC.User=$1)
:[=FD('{0}','ddd M\/d')] [=FD('{1}','hh\:mm tt')]|[=FD('{2}','ddd M\/d')] [=FD('{3}','hh\:mm tt')]|{4}|{5}|{6}|${7}}
>   Totals for $1|   # Entries: {REPORT TASK DETAILS:T.EndDate.count:(TST=Punch) && T.Completed=True && (TSC.User=$1)}|{REPORT TASK DETAILS:[T.Duration.sum]/60,[T.Duration.sum]%60,[TSD.Break.sum]/60/60,[TSD.Break.sum]/60%60,=[([T.Duration]-([TSD.Break]/60)).Sum] / 60,=[([T.Duration]-([TSD.Break]/60)).Sum] % 60:(TST=Punch) && T.Completed=True && (TSC.User=$1):[=F(TN('{0}'))]|[=F(TN('{2}'))]\|[=F(TN('{4}'))]\}|$ {REPORT TASK DETAILS:TSCN.Tip.sum:(TST=Punch) && (TSC.User=$1)}
>>Persons on this Report: {REPORT TASK DETAILS:TSC.User.asc:(TST=Punch) && T.Completed=True:,}
1 Like