| Line 562... |
Line 562... |
| 562 |
tprint(result)
|
562 |
tprint(result)
|
| 563 |
|
563 |
|
| 564 |
else:
|
564 |
else:
|
| 565 |
subOrdersList = self.parseMultiSubOrders(soup, order['orderTrackingUrl'].split('email_id=')[1])
|
565 |
subOrdersList = self.parseMultiSubOrders(soup, order['orderTrackingUrl'].split('email_id=')[1])
|
| 566 |
for subOrderObj in subOrdersList:
|
566 |
for subOrderObj in subOrdersList:
|
| - |
|
567 |
subbulk1 = self.db.merchantOrder.initialize_ordered_bulk_op()
|
| 567 |
subOrder = self._isSubOrderActive(order, subOrderObj.merchantSubOrderId)
|
568 |
subOrder = self._isSubOrderActive(order, subOrderObj.merchantSubOrderId)
|
| 568 |
if subOrder is None:
|
569 |
if subOrder is None:
|
| 569 |
self.db.merchantOrder.update({"orderId":order['orderId']},{'$push':{"subOrders":{"$each":todict([subOrderObj])}}})
|
570 |
self.db.merchantOrder.update({"orderId":order['orderId']},{'$push':{"subOrders":{"$each":todict([subOrderObj])}}})
|
| 570 |
print "Added new suborders to Order id - ", order['orderId']
|
571 |
print "Added new suborders to Order id - ", order['orderId']
|
| 571 |
closed = False
|
572 |
closed = False
|
| Line 589... |
Line 590... |
| 589 |
elif status == Store.ORDER_CANCELLED:
|
590 |
elif status == Store.ORDER_CANCELLED:
|
| 590 |
if subOrder.get("cashBackStatus") == Store.CB_PENDING:
|
591 |
if subOrder.get("cashBackStatus") == Store.CB_PENDING:
|
| 591 |
updateMap["subOrders.$.cashBackStatus"] = Store.CB_CANCELLED
|
592 |
updateMap["subOrders.$.cashBackStatus"] = Store.CB_CANCELLED
|
| 592 |
else:
|
593 |
else:
|
| 593 |
closed = False
|
594 |
closed = False
|
| 594 |
subbulk.find(findMap).update({'$set' : updateMap})
|
595 |
subbulk1.find(findMap).update({'$set' : updateMap})
|
| 595 |
subresult = subbulk.execute()
|
596 |
subresult1 = subbulk1.execute()
|
| 596 |
tprint(subresult)
|
597 |
tprint(subresult1)
|
| 597 |
bulk.find({'orderId': order['orderId']}).update({'$set':{'closed': closed,"parseError":False}})
|
598 |
bulk.find({'orderId': order['orderId']}).update({'$set':{'closed': closed,"parseError":False}})
|
| 598 |
result = bulk.execute()
|
599 |
result = bulk.execute()
|
| 599 |
tprint(result)
|
600 |
tprint(result)
|
| 600 |
else:
|
601 |
else:
|
| 601 |
print 'Soup Object not found for this Order', order['orderId'], order['orderTrackingUrl']
|
602 |
print 'Soup Object not found for this Order', order['orderId'], order['orderTrackingUrl']
|