Subversion Repositories SmartDukaan

Rev

Rev 6663 | Rev 6666 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6663 Rev 6665
Line 431... Line 431...
431
    Returns business dates between two dates
431
    Returns business dates between two dates
432
    '''
432
    '''
433
    start_date = start_time.date()
433
    start_date = start_time.date()
434
    end_date  = end_time.date()
434
    end_date  = end_time.date()
435
    diff = (end_date - start_date).days + 1
435
    diff = (end_date - start_date).days + 1
436
    sundays = diff/7 + 1 if (start_date.weekday()==6) else 0 
436
    sundays = diff/7 + 1 if (start_date.weekday() + (diff%7) > 6) else diff/7 
437
    '''holidays = __get_holidays(start_time, end_time)'''
437
    '''holidays = __get_holidays(start_time, end_time)'''
438
    logistics_client = LogisticsClient().get_client()
438
    logistics_client = LogisticsClient().get_client()
439
    #TODO: This list should be cached after the first call.
439
    #TODO: This list should be cached after the first call.
440
    #Calling logistics server is also unnecessary.
440
    #Calling logistics server is also unnecessary.
441
    holidays = logistics_client.getHolidays(to_java_date(start_time), to_java_date(end_time))
441
    holidays = logistics_client.getHolidays(to_java_date(start_time), to_java_date(end_time))