| Line 56... |
Line 56... |
| 56 |
|
56 |
|
| 57 |
'''
|
57 |
'''
|
| 58 |
OrderStatusMap = {
|
58 |
OrderStatusMap = {
|
| 59 |
MStore.ORDER_PLACED : ['in progress', 'pending for verification', 'not available', 'in process',
|
59 |
MStore.ORDER_PLACED : ['in progress', 'pending for verification', 'not available', 'in process',
|
| 60 |
'processing', 'processed', 'under verification', 'readying for dispatch',
|
60 |
'processing', 'processed', 'under verification', 'readying for dispatch',
|
| 61 |
'waiting for courier to pick up', ''],
|
61 |
'waiting for courier to pick up', 'processing initiated'],
|
| 62 |
MStore.ORDER_DELIVERED : ['delivered','delivered successfully!'],
|
62 |
MStore.ORDER_DELIVERED : ['delivered','delivered successfully!'],
|
| 63 |
MStore.ORDER_SHIPPED : ['in transit', 'dispatched', 'handed over to courier', 'undelivered. update delivery details!'],
|
63 |
MStore.ORDER_SHIPPED : ['in transit', 'dispatched', 'handed over to courier', 'undelivered. update delivery details!','out for delivery','undelivered. edit delivery details!'],
|
| 64 |
MStore.ORDER_CANCELLED : ['closed for vendor reallocation', 'cancelled', 'product returned by courier', 'returned', 'n/a', 'courier returned',
|
64 |
MStore.ORDER_CANCELLED : ['closed for vendor reallocation', 'cancelled', 'product returned by courier', 'returned', 'n/a', 'courier returned',
|
| 65 |
'a new order placed with a different seller', 'closed', 'cancellation in progress', 'verification failed. order cancelled',
|
65 |
'a new order placed with a different seller', 'closed', 'cancellation in progress', 'verification failed. order cancelled',
|
| - |
|
66 |
'cancelled. payment refunded','closed. new order placed','cancelling','cancelling order','order cancelled','payment failed. order cancelled',
|
| 66 |
'cancelled. payment refunded','closed. new order placed']
|
67 |
'returned to snapdeal','pickup sent','refund approved','refund successful!']
|
| 67 |
}
|
68 |
}
|
| 68 |
|
69 |
|
| 69 |
CONF_CB_AMOUNT = MStore.CONF_CB_DISCOUNTED_PRICE
|
70 |
CONF_CB_AMOUNT = MStore.CONF_CB_DISCOUNTED_PRICE
|
| 70 |
def __init__(self,store_id):
|
71 |
def __init__(self,store_id):
|
| 71 |
super(Store, self).__init__(store_id)
|
72 |
super(Store, self).__init__(store_id)
|
| Line 578... |
Line 579... |
| 578 |
if elpq("#trackLink").attr("href"):
|
579 |
if elpq("#trackLink").attr("href"):
|
| 579 |
suborder.trackingUrl = elpq("#trackLink").attr("href")
|
580 |
suborder.trackingUrl = elpq("#trackLink").attr("href")
|
| 580 |
if elpq('span.subOrdStatusText').text():
|
581 |
if elpq('span.subOrdStatusText').text():
|
| 581 |
suborder.estimatedDeliveryDate=elpq('span.subOrdStatusText').text().strip()
|
582 |
suborder.estimatedDeliveryDate=elpq('span.subOrdStatusText').text().strip()
|
| 582 |
suborder.detailedStatus = elpq("div.orderStatus span").text().strip()
|
583 |
suborder.detailedStatus = elpq("div.orderStatus span").text().strip()
|
| 583 |
if suborder.detailedStatus == 'Closed. New Order Placed':
|
584 |
if suborder.detailedStatus in ['Closed. New Order Placed','Closed. Placing New Order'] :
|
| 584 |
closedForReco[suborder.merchantSubOrderId] = suborder
|
585 |
closedForReco[suborder.merchantSubOrderId] = suborder
|
| 585 |
suborder.status = self._getStatusFromDetailedStatus(suborder.detailedStatus)
|
586 |
suborder.status = self._getStatusFromDetailedStatus(suborder.detailedStatus)
|
| 586 |
|
587 |
|
| 587 |
if len(closedForReco) == len(subOrderStatusMap) and len(closedForReco)>0:
|
588 |
if len(closedForReco) == len(subOrderStatusMap) and len(closedForReco)>0:
|
| 588 |
productCode = ''
|
589 |
productCode = ''
|
| Line 954... |
Line 955... |
| 954 |
if isinstance(b, (list, tuple)):
|
955 |
if isinstance(b, (list, tuple)):
|
| 955 |
setattr(self, a, [obj(x) if isinstance(x, dict) else x for x in b])
|
956 |
setattr(self, a, [obj(x) if isinstance(x, dict) else x for x in b])
|
| 956 |
else:
|
957 |
else:
|
| 957 |
setattr(self, a, obj(b) if isinstance(b, dict) else b)
|
958 |
setattr(self, a, obj(b) if isinstance(b, dict) else b)
|
| 958 |
|
959 |
|
| 959 |
|
960 |
|
| 960 |
def todict(obj, classkey=None):
|
961 |
def todict(obj, classkey=None):
|
| 961 |
if isinstance(obj, dict):
|
962 |
if isinstance(obj, dict):
|
| 962 |
data = {}
|
963 |
data = {}
|
| 963 |
for (k, v) in obj.items():
|
964 |
for (k, v) in obj.items():
|
| 964 |
data[k] = todict(v, classkey)
|
965 |
data[k] = todict(v, classkey)
|