| Line 209... |
Line 209... |
| 209 |
order.orderType = orderType
|
209 |
order.orderType = orderType
|
| 210 |
#After we got payment success, we will set logistics info also
|
210 |
#After we got payment success, we will set logistics info also
|
| 211 |
logistics_client = LogisticsClient().get_client()
|
211 |
logistics_client = LogisticsClient().get_client()
|
| 212 |
#FIXME line item is only one now. If multiple will come, need to fix.
|
212 |
#FIXME line item is only one now. If multiple will come, need to fix.
|
| 213 |
item_id = order.lineitems[0].item_id
|
213 |
item_id = order.lineitems[0].item_id
|
| 214 |
logistics_info = logistics_client.getLogisticsInfo(order.customer_pincode, item_id, DeliveryType.PREPAID)
|
214 |
logistics_info = logistics_client.getLogisticsInfo(order.customer_pincode, item_id, DeliveryType.PREPAID, pickUp)
|
| 215 |
|
215 |
|
| 216 |
current_time = datetime.datetime.now()
|
216 |
current_time = datetime.datetime.now()
|
| 217 |
logistics_info.deliveryTime = adjust_delivery_time(current_time, logistics_info.deliveryTime)
|
217 |
logistics_info.deliveryTime = adjust_delivery_time(current_time, logistics_info.deliveryTime)
|
| 218 |
logistics_info.shippingTime = adjust_delivery_time(current_time, logistics_info.shippingTime)
|
218 |
logistics_info.shippingTime = adjust_delivery_time(current_time, logistics_info.shippingTime)
|
| 219 |
|
219 |
|
| Line 233... |
Line 233... |
| 233 |
try:
|
233 |
try:
|
| 234 |
item_pricing = catalog_client.getItemPricing(item_id, -1)
|
234 |
item_pricing = catalog_client.getItemPricing(item_id, -1)
|
| 235 |
order.lineitems[0].transfer_price = item_pricing.transferPrice
|
235 |
order.lineitems[0].transfer_price = item_pricing.transferPrice
|
| 236 |
except:
|
236 |
except:
|
| 237 |
print "Not able to get transfer price. Skipping"
|
237 |
print "Not able to get transfer price. Skipping"
|
| 238 |
|
- |
|
| 239 |
if pickUp == PickUpType.SELF or pickUp == PickUpType.RUNNER:
|
- |
|
| 240 |
logisticsClient = LogisticsClient().get_client()
|
- |
|
| 241 |
order.logistics_provider_id = logisticsClient.getProviderForPickupType(pickUp)
|
- |
|
| 242 |
order.airwaybill_no = PickUpType._VALUES_TO_NAMES.get(pickUp)
|
- |
|
| 243 |
order.tracking_id = order.airwaybill_no
|
- |
|
| 244 |
|
238 |
|
| 245 |
voucherAmount = catalog_client.getVoucherAmount(item_id, VoucherType.SPICEDECK_MOBILE)
|
239 |
voucherAmount = catalog_client.getVoucherAmount(item_id, VoucherType.SPICEDECK_MOBILE)
|
| 246 |
if voucherAmount:
|
240 |
if voucherAmount:
|
| 247 |
__create_recharge_voucher_tracker(order, voucherAmount, VoucherType.SPICEDECK_MOBILE)
|
241 |
__create_recharge_voucher_tracker(order, voucherAmount, VoucherType.SPICEDECK_MOBILE)
|
| 248 |
|
242 |
|
| 249 |
elif new_status == TransactionStatus.COD_IN_PROCESS:
|
243 |
elif new_status == TransactionStatus.COD_IN_PROCESS:
|
| Line 255... |
Line 249... |
| 255 |
#After we got payment success, we will set logistics info also
|
249 |
#After we got payment success, we will set logistics info also
|
| 256 |
logistics_client = LogisticsClient().get_client()
|
250 |
logistics_client = LogisticsClient().get_client()
|
| 257 |
#FIXME line item is only one now. If multiple will come, need to fix.
|
251 |
#FIXME line item is only one now. If multiple will come, need to fix.
|
| 258 |
item_id = order.lineitems[0].item_id
|
252 |
item_id = order.lineitems[0].item_id
|
| 259 |
if order.pickupStoreId:
|
253 |
if order.pickupStoreId:
|
| 260 |
logistics_info = logistics_client.getLogisticsInfo(order.customer_pincode, item_id, DeliveryType.PREPAID)
|
254 |
logistics_info = logistics_client.getLogisticsInfo(order.customer_pincode, item_id, DeliveryType.PREPAID, pickUp)
|
| 261 |
else:
|
255 |
else:
|
| 262 |
logistics_info = logistics_client.getLogisticsInfo(order.customer_pincode, item_id, DeliveryType.COD)
|
256 |
logistics_info = logistics_client.getLogisticsInfo(order.customer_pincode, item_id, DeliveryType.COD, pickUp)
|
| 263 |
current_time = datetime.datetime.now()
|
257 |
current_time = datetime.datetime.now()
|
| 264 |
logistics_info.deliveryTime = adjust_delivery_time(current_time, logistics_info.deliveryTime)
|
258 |
logistics_info.deliveryTime = adjust_delivery_time(current_time, logistics_info.deliveryTime)
|
| 265 |
logistics_info.shippingTime = adjust_delivery_time(current_time, logistics_info.shippingTime)
|
259 |
logistics_info.shippingTime = adjust_delivery_time(current_time, logistics_info.shippingTime)
|
| 266 |
|
260 |
|
| 267 |
order.warehouse_id = logistics_info.warehouseId
|
261 |
order.warehouse_id = logistics_info.warehouseId
|
| Line 2011... |
Line 2005... |
| 2011 |
address = address + order.customer_state + "\n"
|
2005 |
address = address + order.customer_state + "\n"
|
| 2012 |
address = address + "PIN " + order.customer_pincode + "\n"
|
2006 |
address = address + "PIN " + order.customer_pincode + "\n"
|
| 2013 |
address = address + "Phone: " + order.customer_mobilenumber
|
2007 |
address = address + "Phone: " + order.customer_mobilenumber
|
| 2014 |
return address
|
2008 |
return address
|
| 2015 |
|
2009 |
|
| - |
|
2010 |
def __get_store_address(store):
|
| - |
|
2011 |
address = store.name + "\n" + store.line1 + "\n"
|
| - |
|
2012 |
if store.line2:
|
| - |
|
2013 |
address = address + store.line2 + "\n"
|
| - |
|
2014 |
address = address + store.city + "\n"
|
| - |
|
2015 |
address = address + store.state + "\n"
|
| - |
|
2016 |
address = address + "PIN " + store.pin + "\n"
|
| - |
|
2017 |
address = address + "Phone: " + store.phone
|
| - |
|
2018 |
return address
|
| - |
|
2019 |
|
| 2016 |
def __generate_return_advice(order, warehouse, provider, filename):
|
2020 |
def __generate_return_advice(order, warehouse, provider, filename):
|
| 2017 |
if warehouse.id == 7:
|
2021 |
if warehouse.id == 7:
|
| 2018 |
executive = 'Amit Kumar'
|
2022 |
executive = 'Amit Kumar'
|
| 2019 |
else:
|
2023 |
else:
|
| 2020 |
executive = 'Dinesh Kumar'
|
2024 |
executive = 'Dinesh Kumar'
|