Subversion Repositories SmartDukaan

Rev

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

Rev 6665 Rev 6666
Line 3387... Line 3387...
3387
    logistics_info = lclient.getLogisticsEstimation(order.lineitems[0].item_id, order.customer_pincode, DeliveryType.PREPAID)
3387
    logistics_info = lclient.getLogisticsEstimation(order.lineitems[0].item_id, order.customer_pincode, DeliveryType.PREPAID)
3388
    dt = datetime.datetime.strptime(str(order.shipping_timestamp), "%Y-%m-%d %H:%M:%S")
3388
    dt = datetime.datetime.strptime(str(order.shipping_timestamp), "%Y-%m-%d %H:%M:%S")
3389
    shipping_date = dt.strftime("%A, %d %B %Y %I:%M%p")
3389
    shipping_date = dt.strftime("%A, %d %B %Y %I:%M%p")
3390
    product = "%s %s %s" % (order.lineitems[0].brand, order.lineitems[0].model_name, order.lineitems[0].model_number)
3390
    product = "%s %s %s" % (order.lineitems[0].brand, order.lineitems[0].model_name, order.lineitems[0].model_number)
3391
    new_expected_delivery_timestamp = datetime.datetime.now() + timedelta(adjust_delivery_time(datetime.datetime.now(), (logistics_info.deliveryTime - logistics_info.shippingTime)))
3391
    new_expected_delivery_timestamp = datetime.datetime.now() + timedelta(adjust_delivery_time(datetime.datetime.now(), (logistics_info.deliveryTime - logistics_info.shippingTime)))
-
 
3392
    #update new expected timestamp
-
 
3393
    if order.cod:
-
 
3394
        new_expected_delivery_timestamp = new_expected_delivery_timestamp.replace(hour=COD_SHIPPING_CUTOFF_TIME, minute=0, second=0)
-
 
3395
    else:
-
 
3396
        new_expected_delivery_timestamp = new_expected_delivery_timestamp.replace(hour=PREPAID_SHIPPING_CUTOFF_TIME, minute=0, second=0)
-
 
3397
    order.expected_delivery_time = new_expected_delivery_timestamp
-
 
3398
    session.commit()
-
 
3399
    
3392
    new_expected_delivery_date = new_expected_delivery_timestamp.strftime("%A, %d %B %Y")
3400
    new_expected_delivery_date = new_expected_delivery_timestamp.strftime("%A, %d %B %Y")
3393
    otg_text = ""
3401
    otg_text = ""
3394
    if order.otg:
3402
    if order.otg:
3395
        promised_delivery_date = order.promised_delivery_time.strftime("%A, %d %B %Y")
3403
        promised_delivery_date = order.promised_delivery_time.strftime("%A, %d %B %Y")
3396
        if order.cod:
-
 
3397
            new_expected_delivery_timestamp = new_expected_delivery_timestamp.replace(hour=COD_SHIPPING_CUTOFF_TIME, minute=0, second=0)
-
 
3398
        else:
-
 
3399
            new_expected_delivery_timestamp = new_expected_delivery_timestamp.replace(hour=PREPAID_SHIPPING_CUTOFF_TIME, minute=0, second=0)
-
 
3400
        if new_expected_delivery_timestamp > order.promised_delivery_time:
3404
        if new_expected_delivery_timestamp > order.promised_delivery_time:
3401
            otg_text = 'Your order is covered under our <a href="http://www.saholic.com/static/on-time-guarantee">On Time Guarantee; We Pay if we Delay.</a> We apologize in advance for the expected delay from our initial promised delivery date of ' + promised_delivery_date + '. Your will receive a Gift Voucher Code at time of delivery based on the actual delay. You can use the same to buy any Mobile, Camera, Laptop, Tablet or Accessory from our website.'
3405
            otg_text = 'Your order is covered under our <a href="http://www.saholic.com/static/on-time-guarantee">On Time Guarantee; We Pay if we Delay.</a> We apologize in advance for the expected delay from our initial promised delivery date of ' + promised_delivery_date + '. Your will receive a Gift Voucher Code at time of delivery based on the actual delay. You can use the same to buy any Mobile, Camera, Laptop, Tablet or Accessory from our website.'
3402
        elif new_expected_delivery_timestamp < order.promised_delivery_time:
3406
        elif new_expected_delivery_timestamp < order.promised_delivery_time:
3403
            otg_text = 'We are happy to inform you that we expect to deliver your order before time. Your order is covered under our <a href="http://www.saholic.com/static/on-time-guarantee">On Time Guarantee; We Pay if we Delay.</a> Please note, compensation for delay (If Any) will be computed from the initial promised delivery date of ' + promised_delivery_date + '.'
3407
            otg_text = 'We are happy to inform you that we expect to deliver your order before time. Your order is covered under our <a href="http://www.saholic.com/static/on-time-guarantee">On Time Guarantee; We Pay if we Delay.</a> Please note, compensation for delay (If Any) will be computed from the initial promised delivery date of ' + promised_delivery_date + '.'
3404
        else:            
3408
        else: