예제 #1
0
def nextDayTasks(rT):
    rT.setCount()
    rT.counter -= 1
    sT = rT.subTask + 1
    today = datetime.datetime.today()
    current = datetime.datetime(today.year, today.month, today.day)
    targetDate = (current + timedelta(days=29))
    nextDueDate = (targetDate + timedelta(hours=rT.frequency))
    tempCount = adjCount(rT)
    while (tempCount > 0):
        taskNew = Task(rT.taskID, rT.clientName, rT.taskName, rT.catSkillID,
                       rT.startDate, rT.endDate, rT.freqType, rT.frequency,
                       rT.totalTime, rT.status, rT.SLA, rT.specialNotes,
                       rT.counter, rT.subTask)
        if ((nextDueDate > (targetDate + timedelta(days=1)))
                or (nextDueDate > rT.endDate)):
            tempCount = 0
        else:
            taskNew.startDate = nextDueDate
            nextDueDate += timedelta(hours=rT.frequency)
            tempCount -= 1
            rT.counter -= 1
            taskNew.subTask = sT
            sT += 1
            taskNew.count = rT.counter
            taskList.append(taskNew)
예제 #2
0
def nextDayTasks(rT):
    rT.setCount()
    rT.counter -= 1
    sT = rT.subTask + 1
    today = datetime.datetime.today()
    current = datetime.datetime(today.year, today.month, today.day,
                                rT.startDate.hour)
    targetDate = (current + timedelta(days=29))
    nextDueDate = (targetDate)
    dateDiff = nextDueDate - rT.startDate
    #print dateDiff
    if (dateDiff.days % 7) == 0:
        tempCount = 1
    else:
        tempCount = 0
    while (tempCount > 0):
        taskNew = Task(rT.taskID, rT.clientName, rT.taskName, rT.catSkillID,
                       rT.startDate, rT.endDate, rT.freqType, rT.frequency,
                       rT.startTime, rT.stopTime, rT.totalTime, rT.status,
                       rT.SLA, rT.specialNotes, rT.counter, rT.subTask)
        taskNew.startDate = nextDueDate
        nextDueDate += timedelta(days=rT.frequency)
        tempCount -= 1
        rT.counter -= 1
        taskNew.subTask = sT
        sT += 1
        taskNew.count = rT.counter
        taskList.append(taskNew)
예제 #3
0
def nextDayTasks(rT):
    rT.setCount()
    rT.counter -= 1
    sT = rT.subTask + 1
    today = datetime.datetime.today()
    current = datetime.datetime(today.year, today.month, today.day,
                                rT.startDate.hour)
    targetDate = current + relativedelta(months=+1)
    nextDueDate = (targetDate)
    if ((rT.startDate + relativedelta(months=+1)) == targetDate):
        tempCount = 1
    else:
        tempCount = 0
    while (tempCount > 0):
        taskNew = Task(rT.taskID, rT.clientName, rT.taskName, rT.catSkillID,
                       rT.startDate, rT.endDate, rT.freqType, rT.frequency,
                       rT.totalTime, rT.status, rT.SLA, rT.specialNotes,
                       rT.counter, rT.subTask)
        taskNew.startDate = nextDueDate
        nextDueDate += relativedelta(months=+1)
        tempCount -= 1
        rT.counter -= 1
        taskNew.subTask = sT
        sT += 1
        taskNew.count = rT.counter
        taskList.append(taskNew)
예제 #4
0
def nextDayTasks(rT):
    rT.setCount()
    targetDate = (datetime.datetime(2018,04,03) + timedelta(days=29))
    nextDueDate = (targetDate +  timedelta(minutes=rT.freq))
    tempCount = adjCount(rT)
    while (tempCount > 0):
        taskNew = Task(rT.taskName, rT.startDate, rT.endDate, rT.freqType, rT.freq, rT.count)
        if ((nextDueDate > (targetDate + timedelta(days=1))) or (nextDueDate > rT.endDate)):
            tempCount = 0
        else:
            taskNew.startDate = nextDueDate
            nextDueDate += timedelta(minutes=rT.freq)
            tempCount -= 1
            rT.count -= 1
            taskNew.count = rT.count
            tNStr = taskNew.display()
            #print tNStr
            outfile.write((str(tNStr))+"\n")
예제 #5
0
def nextDayTasks(rT):
    rT.setCount()
    today = datetime.datetime.today()
    current = datetime.datetime(today.year, today.month, today.day)
    targetDate = (current + timedelta(days=29))
    nextDueDate = (targetDate + timedelta(hours=rT.freq))
    tempCount = adjCount(rT)
    while (tempCount > 0):
        taskNew = Task(rT.taskName, rT.startDate, rT.endDate, rT.freqType,
                       rT.freq, rT.count)
        if ((nextDueDate > (targetDate + timedelta(days=1)))
                or (nextDueDate > rT.endDate)):
            tempCount = 0
        else:
            taskNew.startDate = nextDueDate
            nextDueDate += timedelta(hours=rT.freq)
            tempCount -= 1
            rT.count -= 1
            taskNew.count = rT.count
            tNStr = taskNew.display()
            outfile.write((str(tNStr)) + "\n")
예제 #6
0
def nextDayTasks(rT):
    rT.setCount()
    today = datetime.datetime.today()
    current = datetime.datetime(today.year, today.month, today.day,
                                rT.startDate.hour)
    targetDate = current + relativedelta(months=+1)
    nextDueDate = (targetDate)
    if ((rT.startDate + relativedelta(months=+1)) == targetDate):
        tempCount = 1
    else:
        tempCount = 0
    while (tempCount > 0):
        taskNew = Task(rT.taskName, rT.startDate, rT.endDate, rT.freqType,
                       rT.freq, rT.count)
        taskNew.startDate = nextDueDate
        nextDueDate += relativedelta(months=+1)
        tempCount -= 1
        rT.count -= 1
        taskNew.count = rT.count
        tNStr = taskNew.display()
        #print tNStr
        outfile.write((str(tNStr)) + "\n")
예제 #7
0
def nextDayTasks(rT):
    rT.setCount()
    today = datetime.datetime.today()
    current = datetime.datetime(today.year, today.month, today.day,
                                rT.startDate.hour)
    targetDate = (current + timedelta(days=29))
    nextDueDate = (targetDate)
    dateDiff = nextDueDate - rT.startDate
    print dateDiff
    if (dateDiff.days % 7) == 0:
        tempCount = 1
    else:
        tempCount = 0
    while (tempCount > 0):
        taskNew = Task(rT.taskName, rT.startDate, rT.endDate, rT.freqType,
                       rT.freq, rT.count)
        taskNew.startDate = nextDueDate
        nextDueDate += timedelta(days=rT.freq)
        tempCount -= 1
        rT.count -= 1
        taskNew.count = rT.count
        tNStr = taskNew.display()
        outfile.write((str(tNStr)) + "\n")