| Line 749... |
Line 749... |
| 749 |
max_discount = min(max_discount, order.lineitems[0].unit_price/10)
|
749 |
max_discount = min(max_discount, order.lineitems[0].unit_price/10)
|
| 750 |
discount = min(max_discount,delayedDays*50)
|
750 |
discount = min(max_discount,delayedDays*50)
|
| 751 |
promotion_client = PromotionClient().get_client()
|
751 |
promotion_client = PromotionClient().get_client()
|
| 752 |
endOn = order.delivery_timestamp + datetime.timedelta(days = 30)
|
752 |
endOn = order.delivery_timestamp + datetime.timedelta(days = 30)
|
| 753 |
endOn = to_java_date(endOn)
|
753 |
endOn = to_java_date(endOn)
|
| 754 |
otgCoupon = promotion_client.createCouponWithPrefix(27, endOn, order.customer_email, discount, False, 1, "otg")
|
754 |
otgCoupon = promotion_client.createCoupon(27, endOn, order.customer_email, discount, False, 1, "otg")
|
| 755 |
thank_you_html = '$prodName ordered by you has been delivered. We apologise for a delay of $delayedDays days. As per our <b>On Time Gaurantee</b> you have won a Gift Voucher worth <b>Rs.$discount</b>. Your unique Gift Voucher Code is <b>$otgCoupon</b>. You can use the same to buy any Mobile, Camera, Laptop, Tablet or Accessory from our website.'
|
755 |
thank_you_html = '$prodName ordered by you has been delivered. We apologise for a delay of $delayedDays days. As per our <b>On Time Gaurantee</b> you have won a Gift Voucher worth <b>Rs.$discount</b>. Your unique Gift Voucher Code is <b>$otgCoupon</b>. You can use the same to buy any Mobile, Camera, Laptop, Tablet or Accessory from our website.'
|
| 756 |
thank_you_html = Template(thank_you_html).substitute(dict(prodName=order.lineitems[0], delayedDays = delayedDays, discount = discount, otgCoupon = otgCoupon))
|
756 |
thank_you_html = Template(thank_you_html).substitute(dict(prodName=order.lineitems[0], delayedDays = delayedDays, discount = discount, otgCoupon = otgCoupon))
|
| 757 |
elif fda:
|
757 |
elif fda:
|
| 758 |
fdaFormattedString = order.first_dlvyatmp_timestamp.strftime("%A, %d. %B %Y")
|
758 |
fdaFormattedString = order.first_dlvyatmp_timestamp.strftime("%A, %d. %B %Y")
|
| 759 |
thank_you_html = str(order.lineitems[0]) + """ ordered by you has been delivered. The First Delivery attempt was made on """+ fdaFormattedString +""" , within our commited estimated time for delivery."""
|
759 |
thank_you_html = str(order.lineitems[0]) + """ ordered by you has been delivered. The First Delivery attempt was made on """+ fdaFormattedString +""" , within our commited estimated time for delivery."""
|