예제 #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,
                                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)
예제 #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)
    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)
예제 #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)