Prüfung für Beginn Zeiterfassung oben bei der Uhr
This commit is contained in:
parent
97f29df5e8
commit
010a978779
Binary file not shown.
|
|
@ -341,6 +341,16 @@ def getactualworkingday(user):
|
||||||
returnstat = list(wd)[0].start
|
returnstat = list(wd)[0].start
|
||||||
return returnstat
|
return returnstat
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def getIsUserStartTime(user):
|
||||||
|
|
||||||
|
today = date.today()
|
||||||
|
starttime = False
|
||||||
|
if today >= user.usertime.usetime_start:
|
||||||
|
starttime = True
|
||||||
|
|
||||||
|
return starttime
|
||||||
|
|
||||||
# Berechnet die gesamte Arbeitszeit im Monat und gibt diese zurück
|
# Berechnet die gesamte Arbeitszeit im Monat und gibt diese zurück
|
||||||
@register.simple_tag
|
@register.simple_tag
|
||||||
def loadmonthwork(nextmonth, user):
|
def loadmonthwork(nextmonth, user):
|
||||||
|
|
@ -356,8 +366,16 @@ def loadmonthwork(nextmonth, user):
|
||||||
|
|
||||||
for ele in workdays.all():
|
for ele in workdays.all():
|
||||||
if ele.end != None:
|
if ele.end != None:
|
||||||
print(ele)
|
|
||||||
finalsum += (ele.end - ele.start).seconds
|
finalsum += (ele.end - ele.start).seconds
|
||||||
|
|
||||||
|
breaksum = 0
|
||||||
|
for ele in workdays.all():
|
||||||
|
for b in ele.breaks.all():
|
||||||
|
if(b.end != None):
|
||||||
|
breaksum += (b.end - b.start).seconds
|
||||||
|
|
||||||
|
finalsum -= breaksum
|
||||||
|
|
||||||
mon, sec = divmod(finalsum, 60)
|
mon, sec = divmod(finalsum, 60)
|
||||||
hr, mon = divmod(mon, 60)
|
hr, mon = divmod(mon, 60)
|
||||||
#return ("%d Stunden und %02d:%02d" % (hr, mon, sec))
|
#return ("%d Stunden und %02d:%02d" % (hr, mon, sec))
|
||||||
|
|
|
||||||
|
|
@ -429,7 +429,8 @@
|
||||||
<!-- Topbar Navbar -->
|
<!-- Topbar Navbar -->
|
||||||
<ul class="navbar-nav ml-auto ">
|
<ul class="navbar-nav ml-auto ">
|
||||||
<!-- TASK: Hier Cookie mit einbauen -->
|
<!-- TASK: Hier Cookie mit einbauen -->
|
||||||
{% if request.user.usertime.usetime %}
|
{% getIsUserStartTime request.user as starttime %}
|
||||||
|
{% if request.user.usertime.usetime and starttime %}
|
||||||
|
|
||||||
<li class="nav-item dropdown no-arrow mx-1">
|
<li class="nav-item dropdown no-arrow mx-1">
|
||||||
<a class="nav-link dropdown-toggle" id="timemanagement_realtime" role="button" data-toggle="dropdown" aria-haspopup="true" onclick="javascript:toggleDropDown()">
|
<a class="nav-link dropdown-toggle" id="timemanagement_realtime" role="button" data-toggle="dropdown" aria-haspopup="true" onclick="javascript:toggleDropDown()">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue