| Line 27... |
Line 27... |
| 27 |
PASSWORD = "5h0p2o2o"
|
27 |
PASSWORD = "5h0p2o2o"
|
| 28 |
SUBJECT = "DTR User Segmentation report for " + date.today().isoformat()
|
28 |
SUBJECT = "DTR User Segmentation report for " + date.today().isoformat()
|
| 29 |
SMTP_SERVER = "smtp.gmail.com"
|
29 |
SMTP_SERVER = "smtp.gmail.com"
|
| 30 |
SMTP_PORT = 587
|
30 |
SMTP_PORT = 587
|
| 31 |
|
31 |
|
| 32 |
XLS_FILENAME = "dtrsourcesreco.xls"
|
32 |
XLS_FILENAME = "snapdealaffiliatereco.xls"
|
| 33 |
XLS_O_FILENAME = "allorders.xls"
|
33 |
XLS_O_FILENAME = "allorders.xls"
|
| - |
|
34 |
XLS_F_FILENAME = "flipkartaffiliatereco.xls"
|
| 34 |
boldStyle = xlwt.XFStyle()
|
35 |
boldStyle = xlwt.XFStyle()
|
| 35 |
f = xlwt.Font()
|
36 |
f = xlwt.Font()
|
| 36 |
f.bold = True
|
37 |
f.bold = True
|
| 37 |
boldStyle.font = f
|
38 |
boldStyle.font = f
|
| 38 |
i = -1
|
39 |
i = -1
|
| Line 43... |
Line 44... |
| 43 |
def generateFlipkartReco():
|
44 |
def generateFlipkartReco():
|
| 44 |
global i
|
45 |
global i
|
| 45 |
i = -1
|
46 |
i = -1
|
| 46 |
curs = getOrdersAfterDate(datetime.now() - timedelta(days=30), 2)
|
47 |
curs = getOrdersAfterDate(datetime.now() - timedelta(days=30), 2)
|
| 47 |
db = client.Dtr
|
48 |
db = client.Dtr
|
| - |
|
49 |
wb = xlwt.Workbook()
|
| 48 |
rb = open_workbook(XLS_FILENAME)
|
50 |
#rb = open_workbook(XLS_F_FILENAME)
|
| 49 |
wb = copy(rb)
|
51 |
#wb = copy(rb)
|
| 50 |
#wb = xlwt.Workbook()
|
52 |
#wb = xlwt.Workbook()
|
| 51 |
row = 0
|
53 |
row = 0
|
| - |
|
54 |
row2 = 0
|
| - |
|
55 |
row3 = 0
|
| - |
|
56 |
row4 = 0
|
| 52 |
worksheet = wb.add_sheet("Flipkart")
|
57 |
worksheet = wb.add_sheet("All Orders")
|
| - |
|
58 |
worksheet1 = wb.add_sheet("Orders Reconciled")
|
| - |
|
59 |
worksheet2 = wb.add_sheet("Orders not Reconciled")
|
| - |
|
60 |
worksheet3 = wb.add_sheet("Aff not Reconciled")
|
| 53 |
worksheet.write(row, inc(), 'Order Id', boldStyle)
|
61 |
worksheet.write(row, inc(), 'Order Id', boldStyle)
|
| - |
|
62 |
worksheet1.write(row, i, 'Order Id', boldStyle)
|
| - |
|
63 |
worksheet2.write(row, i, 'Order Id', boldStyle)
|
| 54 |
worksheet.write(row, inc(), 'User Id', boldStyle)
|
64 |
worksheet.write(row, inc(), 'User Id', boldStyle)
|
| - |
|
65 |
worksheet1.write(row, i, 'User Id', boldStyle)
|
| - |
|
66 |
worksheet2.write(row, i, 'User Id', boldStyle)
|
| 55 |
worksheet.write(row, inc(), 'Username', boldStyle)
|
67 |
worksheet.write(row, inc(), 'Username', boldStyle)
|
| - |
|
68 |
worksheet1.write(row, i, 'Username', boldStyle)
|
| - |
|
69 |
worksheet2.write(row, i, 'Username', boldStyle)
|
| 56 |
worksheet.write(row, inc(), 'Merchant Order Id', boldStyle)
|
70 |
worksheet.write(row, inc(), 'Merchant Order Id', boldStyle)
|
| - |
|
71 |
worksheet1.write(row, i, 'Merchant Order Id', boldStyle)
|
| - |
|
72 |
worksheet2.write(row, i, 'Merchant Order Id', boldStyle)
|
| 57 |
worksheet.write(row, inc(), 'Product Title', boldStyle)
|
73 |
worksheet.write(row, inc(), 'Product Title', boldStyle)
|
| - |
|
74 |
worksheet1.write(row, i, 'Product Title', boldStyle)
|
| - |
|
75 |
worksheet2.write(row, i, 'Product Title', boldStyle)
|
| 58 |
worksheet.write(row, inc(), 'Price', boldStyle)
|
76 |
worksheet.write(row, inc(), 'Price', boldStyle)
|
| - |
|
77 |
worksheet1.write(row, i, 'Price', boldStyle)
|
| - |
|
78 |
worksheet2.write(row, i, 'Price', boldStyle)
|
| 59 |
worksheet.write(row, inc(), 'Quantity', boldStyle)
|
79 |
worksheet.write(row, inc(), 'Quantity', boldStyle)
|
| - |
|
80 |
worksheet1.write(row, i, 'Quantity', boldStyle)
|
| - |
|
81 |
worksheet2.write(row, i, 'Quantity', boldStyle)
|
| 60 |
worksheet.write(row, inc(), 'Status', boldStyle)
|
82 |
worksheet.write(row, inc(), 'Status', boldStyle)
|
| - |
|
83 |
worksheet1.write(row, i, 'Status', boldStyle)
|
| - |
|
84 |
worksheet2.write(row, i, 'Status', boldStyle)
|
| 61 |
worksheet.write(row, inc(), 'Detailed Status', boldStyle)
|
85 |
worksheet.write(row, inc(), 'Detailed Status', boldStyle)
|
| - |
|
86 |
worksheet1.write(row, i, 'Detailed Status', boldStyle)
|
| - |
|
87 |
worksheet2.write(row, i, 'Detailed Status', boldStyle)
|
| 62 |
worksheet.write(row, inc(), 'Cashback Status', boldStyle)
|
88 |
worksheet.write(row, inc(), 'Cashback Status', boldStyle)
|
| - |
|
89 |
worksheet1.write(row, i, 'Cashback Status', boldStyle)
|
| - |
|
90 |
worksheet2.write(row, i, 'Cashback Status', boldStyle)
|
| 63 |
worksheet.write(row, inc(), 'Our CashBack', boldStyle)
|
91 |
worksheet.write(row, inc(), 'Our CashBack', boldStyle)
|
| - |
|
92 |
worksheet1.write(row, i, 'Our CashBack', boldStyle)
|
| - |
|
93 |
worksheet2.write(row, i, 'Our CashBack', boldStyle)
|
| 64 |
worksheet.write(row, inc(), 'Sale Date', boldStyle)
|
94 |
worksheet.write(row, inc(), 'Sale Date', boldStyle)
|
| - |
|
95 |
worksheet1.write(row, i, 'Sale Date', boldStyle)
|
| - |
|
96 |
worksheet2.write(row, i, 'Sale Date', boldStyle)
|
| 65 |
worksheet.write(row, inc(), 'SubtagId', boldStyle)
|
97 |
worksheet.write(row, inc(), 'SubtagId', boldStyle)
|
| - |
|
98 |
worksheet1.write(row, i, 'SubtagId', boldStyle)
|
| - |
|
99 |
worksheet2.write(row, i, 'SubtagId', boldStyle)
|
| 66 |
worksheet.write(row, inc(), 'Category', boldStyle)
|
100 |
worksheet.write(row, inc(), 'Category', boldStyle)
|
| - |
|
101 |
worksheet1.write(row, i, 'Category', boldStyle)
|
| 67 |
worksheet.write(row, inc(), 'Aff PayOut', boldStyle)
|
102 |
worksheet.write(row, inc(), 'Aff PayOut', boldStyle)
|
| - |
|
103 |
worksheet1.write(row, i, 'Aff PayOut', boldStyle)
|
| 68 |
worksheet.write(row, inc(), 'Aff Sale Amount', boldStyle)
|
104 |
worksheet.write(row, inc(), 'Aff Sale Amount', boldStyle)
|
| - |
|
105 |
worksheet1.write(row, i, 'Aff Sale Amount', boldStyle)
|
| 69 |
worksheet.write(row, inc(), 'Aff Sale Date', boldStyle)
|
106 |
worksheet.write(row, inc(), 'Aff Sale Date', boldStyle)
|
| - |
|
107 |
worksheet1.write(row, i, 'Aff Sale Date', boldStyle)
|
| 70 |
for row1 in curs:
|
108 |
for row1 in curs:
|
| 71 |
orderId = row1[0]
|
109 |
orderId = row1[0]
|
| 72 |
order = db.merchantOrder.find_one({"orderId":orderId})
|
110 |
order = db.merchantOrder.find_one({"orderId":orderId})
|
| 73 |
if order is None:
|
111 |
if order is None:
|
| 74 |
continue
|
112 |
continue
|
| 75 |
saleTime = int(time.mktime(datetime.strptime(order['placedOn'], "%d %B, %Y %I:%M %p").replace(hour=0, minute=0, second=0, microsecond=0).timetuple()))
|
113 |
saleTime = int(time.mktime(datetime.strptime(order['placedOn'], "%d %B, %Y %I:%M %p").replace(hour=0, minute=0, second=0, microsecond=0).timetuple()))
|
| 76 |
#saleTime1 = int(time.mktime((datetime.strptime(order['placedOn'], "%b %d, %Y %I:%M %p") + timedelta(seconds=-60)).timetuple()))
|
114 |
#saleTime1 = int(time.mktime((datetime.strptime(order['placedOn'], "%b %d, %Y %I:%M %p") + timedelta(seconds=-60)).timetuple()))
|
| 77 |
|
115 |
reconciled_affiliates = []
|
| 78 |
for subOrder in order['subOrders']:
|
116 |
for subOrder in order['subOrders']:
|
| 79 |
affs = list(db.flipkartOrderAffiliateInfo.find({"subOrders.productCode":subOrder.get("productCode"), "saleDateInt":saleTime}))
|
117 |
affs = list(db.flipkartOrderAffiliateInfo.find({"productCode":subOrder.get("productCode"), "saleDateInt":saleTime}))
|
| 80 |
row += 1
|
118 |
row += 1
|
| 81 |
i=-1
|
119 |
i=-1
|
| 82 |
worksheet.write(row, inc(), orderId)
|
120 |
worksheet.write(row, inc(), orderId)
|
| 83 |
worksheet.write(row, inc(), row1[1])
|
121 |
worksheet.write(row, inc(), row1[1])
|
| 84 |
worksheet.write(row, inc(), row1[-1])
|
122 |
worksheet.write(row, inc(), row1[-1])
|
| Line 91... |
Line 129... |
| 91 |
worksheet.write(row, inc(), subOrder['cashBackStatus'])
|
129 |
worksheet.write(row, inc(), subOrder['cashBackStatus'])
|
| 92 |
worksheet.write(row, inc(), subOrder['cashBackAmount'])
|
130 |
worksheet.write(row, inc(), subOrder['cashBackAmount'])
|
| 93 |
worksheet.write(row, inc(), subOrder['placedOn'])
|
131 |
worksheet.write(row, inc(), subOrder['placedOn'])
|
| 94 |
worksheet.write(row, inc(), order['subTagId'])
|
132 |
worksheet.write(row, inc(), order['subTagId'])
|
| 95 |
for aff in affs:
|
133 |
for aff in affs:
|
| - |
|
134 |
if aff["_id"] not in reconciled_affiliates and aff['subTagId']== order['subTagId']:
|
| - |
|
135 |
reconciled_affiliates.append(aff["_id"])
|
| - |
|
136 |
row2 += 1
|
| - |
|
137 |
i = -1
|
| - |
|
138 |
worksheet1.write(row2, inc(), orderId)
|
| - |
|
139 |
worksheet1.write(row2, inc(), row1[1])
|
| - |
|
140 |
worksheet1.write(row2, inc(), row1[-1])
|
| - |
|
141 |
worksheet1.write(row2, inc(), order['merchantOrderId'])
|
| - |
|
142 |
worksheet1.write(row2, inc(), subOrder['productTitle'])
|
| - |
|
143 |
worksheet1.write(row2, inc(), subOrder['amountPaid'])
|
| - |
|
144 |
worksheet1.write(row2, inc(), subOrder['quantity'])
|
| - |
|
145 |
worksheet1.write(row2, inc(), subOrder['status'])
|
| - |
|
146 |
worksheet1.write(row2, inc(), subOrder['detailedStatus'])
|
| - |
|
147 |
worksheet1.write(row2, inc(), subOrder['cashBackStatus'])
|
| - |
|
148 |
worksheet1.write(row2, inc(), subOrder['cashBackAmount'])
|
| - |
|
149 |
worksheet1.write(row2, inc(), subOrder['placedOn'])
|
| 96 |
if aff['subTagId']== subOrder['subTagId']:
|
150 |
worksheet1.write(row2, inc(), order['subTagId'])
|
| - |
|
151 |
db.flipkartOrderAffiliateInfo.update(
|
| - |
|
152 |
{"productCode":subOrder.get("productCode"), "saleDateInt":saleTime, "subTagId":aff['subTagId']},
|
| - |
|
153 |
{"$set":{"reconciled":True}})
|
| - |
|
154 |
db.merchantOrder.update({"merchantOrderId":order["merchantOrderId"]},
|
| - |
|
155 |
{"$set":{"reconciled":True}})
|
| 97 |
worksheet.write(row, inc(), aff['category'])
|
156 |
worksheet.write(row, inc(), aff['category'])
|
| - |
|
157 |
worksheet1.write(row2, i, aff['category'])
|
| 98 |
worksheet.write(row, inc(), aff['payOut'])
|
158 |
worksheet.write(row, inc(), aff['payOut'])
|
| - |
|
159 |
worksheet1.write(row2, i, aff['payOut'])
|
| 99 |
worksheet.write(row, inc(), aff['saleAmount'])
|
160 |
worksheet.write(row, inc(), aff['saleAmount'])
|
| - |
|
161 |
worksheet1.write(row2, i, aff['saleAmount'])
|
| 100 |
worksheet.write(row, inc(), aff['saleDate'])
|
162 |
worksheet.write(row, inc(), aff['saleDate'])
|
| - |
|
163 |
worksheet1.write(row2, i, aff['saleDate'])
|
| 101 |
break
|
164 |
break
|
| - |
|
165 |
row3 += 1
|
| - |
|
166 |
i=-1
|
| - |
|
167 |
worksheet2.write(row3, inc(), orderId)
|
| - |
|
168 |
worksheet2.write(row3, inc(), row1[1])
|
| - |
|
169 |
worksheet2.write(row3, inc(), row1[-1])
|
| - |
|
170 |
worksheet2.write(row3, inc(), order['merchantOrderId'])
|
| - |
|
171 |
worksheet2.write(row3, inc(), subOrder['productTitle'])
|
| - |
|
172 |
worksheet2.write(row3, inc(), subOrder['amountPaid'])
|
| - |
|
173 |
worksheet2.write(row3, inc(), subOrder['quantity'])
|
| - |
|
174 |
worksheet2.write(row3, inc(), subOrder['status'])
|
| - |
|
175 |
worksheet2.write(row3, inc(), subOrder['detailedStatus'])
|
| - |
|
176 |
worksheet2.write(row3, inc(), subOrder['cashBackStatus'])
|
| - |
|
177 |
worksheet2.write(row3, inc(), subOrder['cashBackAmount'])
|
| - |
|
178 |
worksheet2.write(row3, inc(), subOrder['placedOn'])
|
| - |
|
179 |
worksheet2.write(row3, inc(), order['subTagId'])
|
| - |
|
180 |
|
| - |
|
181 |
i=-1
|
| - |
|
182 |
worksheet3.write(0, inc(), "category",boldStyle)
|
| - |
|
183 |
worksheet3.write(0, inc(), "conversionStatus",boldStyle)
|
| - |
|
184 |
worksheet3.write(0, inc(), "Product Title",boldStyle)
|
| - |
|
185 |
worksheet3.write(0, inc(), "price",boldStyle)
|
| - |
|
186 |
worksheet3.write(0, inc(), "quantity",boldStyle)
|
| - |
|
187 |
worksheet3.write(0, inc(), "payOut",boldStyle)
|
| - |
|
188 |
worksheet3.write(0, inc(), "saleDate",boldStyle)
|
| - |
|
189 |
worksheet3.write(0, inc(), "subTagId",boldStyle)
|
| - |
|
190 |
for aff in db.flipkartOrderAffiliateInfo.find({"reconciled":{"$exists":False}}):
|
| - |
|
191 |
row4 += 1
|
| - |
|
192 |
i =-1
|
| - |
|
193 |
worksheet3.write(row4, inc(), aff["category"])
|
| - |
|
194 |
worksheet3.write(row4, inc(), aff["conversionStatus"])
|
| - |
|
195 |
skuData = getSkuData(2, aff["productCode"])
|
| 102 |
|
196 |
if skuData is None:
|
| - |
|
197 |
worksheet3.write(row4, inc(), aff["productTitle"])
|
| - |
|
198 |
else:
|
| - |
|
199 |
worksheet3.write(row4, inc(), skuData["product_name"])
|
| - |
|
200 |
worksheet3.write(row4, inc(), aff['price'])
|
| - |
|
201 |
worksheet3.write(row4, inc(), aff['quantity'])
|
| - |
|
202 |
worksheet3.write(row4, inc(), aff['payOut'])
|
| - |
|
203 |
worksheet3.write(row4, inc(), aff['saleDate'])
|
| - |
|
204 |
worksheet3.write(row4, inc(), aff['subTagId'])
|
| - |
|
205 |
|
| - |
|
206 |
|
| 103 |
|
207 |
|
| 104 |
wb.save(XLS_FILENAME)
|
208 |
wb.save(XLS_F_FILENAME)
|
| 105 |
def generateSnapDealReco():
|
209 |
def generateSnapDealReco():
|
| 106 |
global i
|
210 |
global i
|
| 107 |
curs = getOrdersAfterDate(datetime.now() - timedelta(days=30), 3)
|
211 |
curs = getOrdersAfterDate(datetime.now() - timedelta(days=30), 3)
|
| 108 |
db = client.Dtr
|
212 |
db = client.Dtr
|
| 109 |
notReconciled = {}
|
213 |
notReconciled = {}
|
| Line 269... |
Line 373... |
| 269 |
affNotReconciledSheet.write(row, inc(), offer.get("conversionStatus"))
|
373 |
affNotReconciledSheet.write(row, inc(), offer.get("conversionStatus"))
|
| 270 |
affNotReconciledSheet.write(row, inc(), offer.get("ip"))
|
374 |
affNotReconciledSheet.write(row, inc(), offer.get("ip"))
|
| 271 |
|
375 |
|
| 272 |
workbook.save(XLS_FILENAME)
|
376 |
workbook.save(XLS_FILENAME)
|
| 273 |
|
377 |
|
| 274 |
def sendmail(email, message, title, fileName):
|
378 |
def sendmail(email, message, title, *varargs):
|
| 275 |
if email == "":
|
379 |
if email == "":
|
| 276 |
return
|
380 |
return
|
| 277 |
mailServer = smtplib.SMTP(SMTP_SERVER, SMTP_PORT)
|
381 |
mailServer = smtplib.SMTP(SMTP_SERVER, SMTP_PORT)
|
| 278 |
mailServer.ehlo()
|
382 |
mailServer.ehlo()
|
| 279 |
mailServer.starttls()
|
383 |
mailServer.starttls()
|
| Line 285... |
Line 389... |
| 285 |
msg.preamble = title
|
389 |
msg.preamble = title
|
| 286 |
html_msg = MIMEText(message, 'html')
|
390 |
html_msg = MIMEText(message, 'html')
|
| 287 |
msg.attach(html_msg)
|
391 |
msg.attach(html_msg)
|
| 288 |
|
392 |
|
| 289 |
#snapdeal more to be added here
|
393 |
#snapdeal more to be added here
|
| - |
|
394 |
for fileName in varargs:
|
| 290 |
snapdeal = MIMEBase('application', 'vnd.ms-excel')
|
395 |
snapdeal = MIMEBase('application', 'vnd.ms-excel')
|
| 291 |
snapdeal.set_payload(file(fileName).read())
|
396 |
snapdeal.set_payload(file(fileName).read())
|
| 292 |
encoders.encode_base64(snapdeal)
|
397 |
encoders.encode_base64(snapdeal)
|
| 293 |
snapdeal.add_header('Content-Disposition', 'attachment;filename=' + fileName)
|
398 |
snapdeal.add_header('Content-Disposition', 'attachment;filename=' + fileName)
|
| 294 |
msg.attach(snapdeal)
|
399 |
msg.attach(snapdeal)
|
| 295 |
|
400 |
|
| 296 |
|
401 |
|
| 297 |
email.append('amit.gupta@shop2020.in')
|
402 |
email.append('amit.gupta@shop2020.in')
|
| 298 |
MAILTO = email
|
403 |
MAILTO = email
|
| 299 |
mailServer.login(SENDER, PASSWORD)
|
404 |
mailServer.login(SENDER, PASSWORD)
|
| Line 452... |
Line 557... |
| 452 |
sh1.write(row3, inc(), morder.get("merchantOrderId"))
|
557 |
sh1.write(row3, inc(), morder.get("merchantOrderId"))
|
| 453 |
sh1.write(row3, inc(), subOrder.get("productTitle"))
|
558 |
sh1.write(row3, inc(), subOrder.get("productTitle"))
|
| 454 |
inc()
|
559 |
inc()
|
| 455 |
if int(subOrder.get("quantity")) > 0:
|
560 |
if int(subOrder.get("quantity")) > 0:
|
| 456 |
sh1.write(row3, i, int(subOrder.get("amountPaid"))/int(subOrder.get("quantity")))
|
561 |
sh1.write(row3, i, int(subOrder.get("amountPaid"))/int(subOrder.get("quantity")))
|
| - |
|
562 |
skuData = getSkuData(morder.get("storeId"), subOrder.get("productCode"))
|
| 457 |
if morder.get("storeId") in (1,2,4,5):
|
563 |
if morder.get("storeId") in (1,2,4,5):
|
| 458 |
skuData = db1.MasterData.find_one({'identifier':subOrder.get("productCode").strip(), 'source_id':morder.get("storeId")})
|
564 |
skuData = db1.MasterData.find_one({'identifier':subOrder.get("productCode").strip(), 'source_id':morder.get("storeId")})
|
| 459 |
elif morder.get("storeId") == 3:
|
565 |
elif morder.get("storeId") == 3:
|
| 460 |
skuData = db1.MasterData.find_one({'secondaryIdentifier':subOrder.get("productCode").strip(), 'source_id':morder.get("storeId")})
|
566 |
skuData = db1.MasterData.find_one({'secondaryIdentifier':subOrder.get("productCode").strip(), 'source_id':morder.get("storeId")})
|
| 461 |
if skuData is not None:
|
567 |
if skuData is not None:
|
| 462 |
sh1.write(row3, inc(), skuData.get("brand"))
|
568 |
sh1.write(row3, inc(), skuData.get("brand"))
|
| 463 |
sh1.write(row3, inc(), skuData.get("model_name"))
|
569 |
sh1.write(row3, inc(), skuData.get("model_name"))
|
| 464 |
sh1.write(row3, inc(), skuData.get("category"))
|
570 |
sh1.write(row3, inc(), skuData.get("category"))
|
| 465 |
if subOrder.get("cashBackStatus") == Store.CB_APPROVED or subOrder.get("cashBackStatus") == Store.CB_PENDING:
|
571 |
if subOrder.get("cashBackStatus") == Store.CB_APPROVED or subOrder.get("cashBackStatus") == Store.CB_PENDING:
|
| Line 507... |
Line 613... |
| 507 |
print "Could not find", morder.get("adId"), "that is reconcired for order", morder.get("orderId")
|
613 |
print "Could not find", morder.get("adId"), "that is reconcired for order", morder.get("orderId")
|
| 508 |
|
614 |
|
| 509 |
|
615 |
|
| 510 |
wb.save(XLS_FILENAME)
|
616 |
wb.save(XLS_FILENAME)
|
| 511 |
workbook.save(XLS_O_FILENAME)
|
617 |
workbook.save(XLS_O_FILENAME)
|
| - |
|
618 |
|
| - |
|
619 |
def getSkuData(storeId, identifier):
|
| - |
|
620 |
if storeId in (1,2,4,5):
|
| - |
|
621 |
skuData = client.Catalog.MasterData.find_one({'identifier':identifier, 'source_id':storeId})
|
| - |
|
622 |
elif storeId == 3:
|
| - |
|
623 |
skuData = client.Catalog.MasterData.find_one({'secondaryIdentifier':identifier, 'source_id':storeId})
|
| - |
|
624 |
return skuData
|
| - |
|
625 |
|
| 512 |
def inc():
|
626 |
def inc():
|
| 513 |
global i
|
627 |
global i
|
| 514 |
i+=1
|
628 |
i+=1
|
| 515 |
return i
|
629 |
return i
|
| 516 |
|
630 |
|
| 517 |
def addHeaders(sheet):
|
631 |
def addHeaders(sheet):
|
| 518 |
global i
|
632 |
global i
|
| 519 |
i = 0
|
633 |
i = 0
|
| 520 |
sheet.write(0, inc(), )
|
634 |
sheet.write(0, inc(), )
|
| 521 |
def main():
|
635 |
def main():
|
| - |
|
636 |
|
| 522 |
generateSnapDealReco()
|
637 |
generateSnapDealReco()
|
| - |
|
638 |
generateFlipkartReco()
|
| 523 |
getUserOrders()
|
639 |
getUserOrders()
|
| 524 |
sendmail(["amit.gupta@shop2020.in", "rajneesh.arora@saholic.com"], "", "DTR Affiliate Reco", XLS_FILENAME)
|
640 |
sendmail(["amit.gupta@shop2020.in", "rajneesh.arora@saholic.com"], "", "Affiliate Reco", XLS_FILENAME, XLS_O_FILENAME)
|
| 525 |
sendmail(["amit.gupta@shop2020.in", "rajneesh.arora@saholic.com", "chaitnaya.vats@saholic.com", "manoj.kumar@saholic.com"], "", "All DTR Orders", XLS_O_FILENAME)
|
641 |
sendmail(["amit.gupta@shop2020.in", "rajneesh.arora@saholic.com", "chaitnaya.vats@saholic.com", "manoj.kumar@saholic.com"], "", "All DTR Orders", XLS_O_FILENAME)
|
| 526 |
|
642 |
|
| 527 |
if __name__ == '__main__':
|
643 |
if __name__ == '__main__':
|
| 528 |
main()
|
644 |
main()
|
| 529 |
|
645 |
|
| 530 |
|
646 |
|