| Line 50... |
Line 50... |
| 50 |
self.productName= productName
|
50 |
self.productName= productName
|
| 51 |
self.amountPaid = amountPaid
|
51 |
self.amountPaid = amountPaid
|
| 52 |
self.quantity = quantity
|
52 |
self.quantity = quantity
|
| 53 |
self.unitPrice = unitPrice
|
53 |
self.unitPrice = unitPrice
|
| 54 |
self.status = status
|
54 |
self.status = status
|
| - |
|
55 |
if createdTime is not None:
|
| 55 |
self.createdTime = to_py_date(createdTime)
|
56 |
self.createdTime = to_py_date(createdTime)
|
| - |
|
57 |
else:
|
| - |
|
58 |
self.createdTime = None
|
| 56 |
self.userId = userId
|
59 |
self.userId = userId
|
| 57 |
|
60 |
|
| 58 |
def getAndStoreMerchantSubOrders():
|
61 |
def getAndStoreMerchantSubOrders():
|
| 59 |
db = client.Dtr
|
62 |
db = client.Dtr
|
| 60 |
collection = db.merchantOrder
|
63 |
collection = db.merchantOrder
|
| Line 65... |
Line 68... |
| 65 |
if order.has_key('subOrders'):
|
68 |
if order.has_key('subOrders'):
|
| 66 |
orderId = order['orderId']
|
69 |
orderId = order['orderId']
|
| 67 |
merchantOrderId = order['merchantOrderId']
|
70 |
merchantOrderId = order['merchantOrderId']
|
| 68 |
storeId = order['storeId']
|
71 |
storeId = order['storeId']
|
| 69 |
userId = order['userId']
|
72 |
userId = order['userId']
|
| - |
|
73 |
createdOnInt = None
|
| - |
|
74 |
if order.has_key('createdOnInt'):
|
| - |
|
75 |
createdOnInt = order['createdOnInt']
|
| 70 |
subOrders = order['subOrders']
|
76 |
subOrders = order['subOrders']
|
| 71 |
for subOrder in subOrders:
|
77 |
for subOrder in subOrders:
|
| 72 |
merchantSubOrder = MerchantSubOrder(orderId, merchantOrderId, subOrder['merchantSubOrderId'], storeId, userId, subOrder['productCode'], subOrder['productTitle'], subOrder['amountPaid'], subOrder['quantity'], subOrder['status'], order['createdOnInt'])
|
78 |
merchantSubOrder = MerchantSubOrder(orderId, merchantOrderId, subOrder['merchantSubOrderId'], storeId, userId, subOrder['productCode'], subOrder['productTitle'], subOrder['amountPaid'], subOrder['quantity'], subOrder['status'], createdOnInt)
|
| 73 |
product = None
|
79 |
product = None
|
| 74 |
if storeId in (1,2,4,5):
|
80 |
if storeId in (1,2,4,5):
|
| 75 |
product = list(masterDataCollection.find({'identifier':subOrder['productCode'].strip(), 'source_id':storeId}))
|
81 |
product = list(masterDataCollection.find({'identifier':subOrder['productCode'].strip(), 'source_id':storeId}))
|
| 76 |
elif storeId == 3:
|
82 |
elif storeId == 3:
|
| 77 |
product = list(masterDataCollection.find({'secondaryIdentifier':subOrder['productCode'].strip(), 'source_id':storeId}))
|
83 |
product = list(masterDataCollection.find({'secondaryIdentifier':subOrder['productCode'].strip(), 'source_id':storeId}))
|