Subversion Repositories SmartDukaan

Rev

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

Rev 4078 Rev 4088
Line 282... Line 282...
282
    start_date = start_time.date()
282
    start_date = start_time.date()
283
    end_date = start_date + datetime.timedelta(days = delivery_days)
283
    end_date = start_date + datetime.timedelta(days = delivery_days)
284
    holidays = __get_holidays(start_time)
284
    holidays = __get_holidays(start_time)
285
    
285
    
286
    while start_date <= end_date:
286
    while start_date <= end_date:
287
        start_date = start_date + datetime.timedelta(days = 1)
-
 
288
        if start_date.weekday() == 6 or start_date in holidays:
287
        if start_date.weekday() == 6 or start_date in holidays:
289
            delivery_days = delivery_days + 1
288
            delivery_days = delivery_days + 1
290
            end_date = end_date + datetime.timedelta(days = 1)
289
            end_date = end_date + datetime.timedelta(days = 1)
-
 
290
        start_date = start_date + datetime.timedelta(days = 1)
291
    
291
    
292
    return delivery_days
292
    return delivery_days
293
 
293
 
294
def enqueue_transaction_info_email(transaction_id):
294
def enqueue_transaction_info_email(transaction_id):
295
    transaction = get_transaction(transaction_id)
295
    transaction = get_transaction(transaction_id)