Commit 07cb738f authored by Georgios Dagkakis's avatar Georgios Dagkakis

do not create shift patterns in weekend

parent 584aa0f8
...@@ -54,6 +54,7 @@ class ReadJSShifts(plugin.InputPreparationPlugin, TimeSupportMixin): ...@@ -54,6 +54,7 @@ class ReadJSShifts(plugin.InputPreparationPlugin, TimeSupportMixin):
if shiftData: if shiftData:
shiftData.pop(0) shiftData.pop(0)
#iteration through the raw data to structure it into ManPy config #iteration through the raw data to structure it into ManPy config
lastrec=None
for line in shiftData: for line in shiftData:
# if all the records of that line are none then continue # if all the records of that line are none then continue
toContinue = False toContinue = False
...@@ -105,7 +106,7 @@ class ReadJSShifts(plugin.InputPreparationPlugin, TimeSupportMixin): ...@@ -105,7 +106,7 @@ class ReadJSShifts(plugin.InputPreparationPlugin, TimeSupportMixin):
if line[0]: if line[0]:
entityID = line[0].split("-")[0] entityID = line[0].split("-")[0]
else: else:
entityID = "" entityID = ""
if str(entityID) == '': if str(entityID) == '':
#take it as a continuation for the last entered resource #take it as a continuation for the last entered resource
for index, start in enumerate(timeStartList): for index, start in enumerate(timeStartList):
...@@ -145,7 +146,12 @@ class ReadJSShifts(plugin.InputPreparationPlugin, TimeSupportMixin): ...@@ -145,7 +146,12 @@ class ReadJSShifts(plugin.InputPreparationPlugin, TimeSupportMixin):
#create default pattern for all operators (10 days long) #create default pattern for all operators (10 days long)
timeStartList = [] timeStartList = []
timeEndList = [] timeEndList = []
for dayNumber in range(0,20): for dayNumber in range(0,20):
# check the day, if it is weekend do not create shift entry
dayDate=now+datetime.timedelta(days=dayNumber)
if dayDate.weekday() in [5,6]:
continue
startTime = "08:00" startTime = "08:00"
endTime = "18:00" endTime = "18:00"
upDate = now.date()+datetime.timedelta(days=dayNumber) upDate = now.date()+datetime.timedelta(days=dayNumber)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment