Subversion Repositories SmartDukaan

Rev

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

Rev 6660 Rev 6662
Line 3388... Line 3388...
3388
    product = "%s %s %s" % (order.lineitems[0].brand, order.lineitems[0].model_name, order.lineitems[0].model_number)
3388
    product = "%s %s %s" % (order.lineitems[0].brand, order.lineitems[0].model_name, order.lineitems[0].model_number)
3389
    new_expected_delivery_timestamp = datetime.datetime.now() + timedelta(adjust_delivery_time(datetime.datetime.now(), (logistics_info.deliveryTime - logistics_info.shippingTime)))
3389
    new_expected_delivery_timestamp = datetime.datetime.now() + timedelta(adjust_delivery_time(datetime.datetime.now(), (logistics_info.deliveryTime - logistics_info.shippingTime)))
3390
    new_expected_delivery_date = new_expected_delivery_timestamp.strftime("%A, %d %B %Y")
3390
    new_expected_delivery_date = new_expected_delivery_timestamp.strftime("%A, %d %B %Y")
3391
    otg_text = ""
3391
    otg_text = ""
3392
    if order.otg:
3392
    if order.otg:
-
 
3393
        promised_delivery_date = order.promised_delivery_time.strftime("%A, %d %B %Y")
3393
        if order.cod:
3394
        if order.cod:
3394
            new_expected_delivery_timestamp = new_expected_delivery_timestamp.replace(hour=COD_SHIPPING_CUTOFF_TIME, minute=0, second=0)
3395
            new_expected_delivery_timestamp = new_expected_delivery_timestamp.replace(hour=COD_SHIPPING_CUTOFF_TIME, minute=0, second=0)
3395
        else:
3396
        else:
3396
            new_expected_delivery_timestamp = new_expected_delivery_timestamp.replace(hour=PREPAID_SHIPPING_CUTOFF_TIME, minute=0, second=0)
3397
            new_expected_delivery_timestamp = new_expected_delivery_timestamp.replace(hour=PREPAID_SHIPPING_CUTOFF_TIME, minute=0, second=0)
3397
        if new_expected_delivery_timestamp > order.promised_delivery_time:
3398
        if new_expected_delivery_timestamp > order.promised_delivery_time:
3398
            otg_text = "Your order is covered under our On Time Guarantee; We Pay if we Delay. We apologize in advance for the expected delay from our initial promised delivery date of " + new_expected_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."
3399
            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.'
3399
        elif new_expected_delivery_timestamp < order.promised_delivery_time:
3400
        elif new_expected_delivery_timestamp < order.promised_delivery_time:
3400
            otg_text = "Your order is covered under our On Time Guarantee; We Pay if we Delay. We are happy to inform you that we expect to deliver your order before our our initial promised delivery date of " + new_expected_delivery_date + "."
3401
            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 + '.'
3401
        else:            
3402
        else:            
3402
            otg_text = "Your order is covered under our On Time Guarantee; We Pay if we Delay. We are committed to deliver your order by our initial promised delivery date of " + new_expected_delivery_date + "."
3403
            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 are committed to deliver your order by our initial promised delivery date of ' + promised_delivery_date + '.'
3403
        
3404
        
3404
         
-
 
3405
 
-
 
3406
 
-
 
3407
    info = dict(order_id = order.id, product_name = product, shipping_datetime = shipping_date, awb = order.airwaybill_no, expected_delivery_date = new_expected_delivery_date, courier_name = provider_name, courier_phone = provider_phone, source_name = source_name, otg_text = otg_text)
3405
    info = dict(order_id = order.id, product_name = product, shipping_datetime = shipping_date, awb = order.airwaybill_no, expected_delivery_date = new_expected_delivery_date, courier_name = provider_name, courier_phone = provider_phone, source_name = source_name, otg_text = otg_text)
3408
    return Template(html).substitute(info)
3406
    return Template(html).substitute(info)
3409
 
3407
 
3410
def enqueue_shipping_confirmation_email(order):
3408
def enqueue_shipping_confirmation_email(order):
3411
    # Calling helper service on production
3409
    # Calling helper service on production