| Line 62... |
Line 62... |
| 62 |
MStore.ORDER_DELIVERED : ['has been delivered'],
|
62 |
MStore.ORDER_DELIVERED : ['has been delivered'],
|
| 63 |
MStore.ORDER_SHIPPED : ['has been shipped', 'has been dispatched'],
|
63 |
MStore.ORDER_SHIPPED : ['has been shipped', 'has been dispatched'],
|
| 64 |
MStore.ORDER_CANCELLED : ['has been cancelled', 'has been rejected','is returned back to us']
|
64 |
MStore.ORDER_CANCELLED : ['has been cancelled', 'has been rejected','is returned back to us']
|
| 65 |
}
|
65 |
}
|
| 66 |
|
66 |
|
| - |
|
67 |
OrderStatusShownMap = {
|
| - |
|
68 |
"Under Process" : ['expect the order to reach', 'received your payment'],
|
| - |
|
69 |
"Order Delivered" : ['has been delivered'],
|
| - |
|
70 |
"Order Shipped" : ['has been shipped', 'has been dispatched'],
|
| - |
|
71 |
"Order Cancelled" : ['has been cancelled', 'has been rejected','is returned back to us']
|
| - |
|
72 |
}
|
| - |
|
73 |
|
| 67 |
CONF_CB_AMOUNT = MStore.CONF_CB_DISCOUNTED_PRICE
|
74 |
CONF_CB_AMOUNT = MStore.CONF_CB_DISCOUNTED_PRICE
|
| 68 |
|
75 |
|
| 69 |
|
76 |
|
| 70 |
def __init__(self,store_id):
|
77 |
def __init__(self,store_id):
|
| 71 |
super(Store, self).__init__(store_id)
|
78 |
super(Store, self).__init__(store_id)
|
| Line 111... |
Line 118... |
| 111 |
if value in detailedStatus.lower():
|
118 |
if value in detailedStatus.lower():
|
| 112 |
return key
|
119 |
return key
|
| 113 |
print "Detailed Status need to be mapped", detailedStatus, self.store_id
|
120 |
print "Detailed Status need to be mapped", detailedStatus, self.store_id
|
| 114 |
return None
|
121 |
return None
|
| 115 |
|
122 |
|
| - |
|
123 |
def _getDisplayStatusFromDetailedStatus(self, detailedStatus):
|
| - |
|
124 |
for key, value in Store.OrderStatusShownMap.iteritems():
|
| - |
|
125 |
if value in detailedStatus.lower():
|
| - |
|
126 |
return key
|
| - |
|
127 |
print "Display Status need to be mapped", detailedStatus, self.store_id
|
| - |
|
128 |
return None
|
| - |
|
129 |
|
| 116 |
def updateCashbackInSubOrders(self, subOrders):
|
130 |
def updateCashbackInSubOrders(self, subOrders):
|
| 117 |
for subOrder in subOrders:
|
131 |
for subOrder in subOrders:
|
| 118 |
cashbackStatus = Store.CB_NA
|
132 |
cashbackStatus = Store.CB_NA
|
| 119 |
cashbackAmount = 0
|
133 |
cashbackAmount = 0
|
| 120 |
percentage = 0
|
134 |
percentage = 0
|
| Line 225... |
Line 239... |
| 225 |
elif subOrder['closed']:
|
239 |
elif subOrder['closed']:
|
| 226 |
continue
|
240 |
continue
|
| 227 |
else:
|
241 |
else:
|
| 228 |
findMap = {"orderId": order['orderId'], "subOrders.merchantSubOrderId": str(subOrderId)}
|
242 |
findMap = {"orderId": order['orderId'], "subOrders.merchantSubOrderId": str(subOrderId)}
|
| 229 |
updateMap = {}
|
243 |
updateMap = {}
|
| 230 |
updateMap["subOrders.$.detailedStatus"] = subOrderStatus
|
244 |
displayStatus = self._getDisplayStatusFromDetailedStatus(subOrderStatus)
|
| 231 |
status = self._getStatusFromDetailedStatus(subOrderStatus)
|
245 |
status = self._getStatusFromDetailedStatus(subOrderStatus)
|
| - |
|
246 |
if displayStatus is not None:
|
| - |
|
247 |
updateMap["subOrders.$.detailedStatus"] = displayStatus
|
| 232 |
closedStatus = status in [Store.ORDER_DELIVERED, Store.ORDER_CANCELLED]
|
248 |
closedStatus = status in [Store.ORDER_DELIVERED, Store.ORDER_CANCELLED]
|
| 233 |
if status is not None:
|
249 |
if status is not None:
|
| 234 |
updateMap["subOrders.$.status"] = status
|
250 |
updateMap["subOrders.$.status"] = status
|
| 235 |
if closedStatus:
|
251 |
if closedStatus:
|
| 236 |
#if status is closed then change the paybackStatus accordingly
|
252 |
#if status is closed then change the paybackStatus accordingly
|