| 14450 |
amit.gupta |
1 |
'''
|
|
|
2 |
Created on Mar 13, 2015
|
|
|
3 |
|
|
|
4 |
@author: amit
|
|
|
5 |
'''
|
|
|
6 |
from datetime import date, datetime, timedelta
|
| 14524 |
amit.gupta |
7 |
from dtr.storage.Mysql import getOrdersAfterDate, \
|
|
|
8 |
getOrdersByTag
|
| 14450 |
amit.gupta |
9 |
from email import encoders
|
|
|
10 |
from email.mime.base import MIMEBase
|
|
|
11 |
from email.mime.multipart import MIMEMultipart
|
|
|
12 |
from email.mime.text import MIMEText
|
|
|
13 |
from pymongo.mongo_client import MongoClient
|
| 14460 |
amit.gupta |
14 |
from xlrd import open_workbook
|
| 14524 |
amit.gupta |
15 |
from xlutils.copy import copy
|
| 14460 |
amit.gupta |
16 |
from xlwt.Workbook import Workbook
|
| 14450 |
amit.gupta |
17 |
import MySQLdb
|
|
|
18 |
import smtplib
|
|
|
19 |
import time
|
|
|
20 |
import xlwt
|
| 14460 |
amit.gupta |
21 |
#from xlwt import
|
| 14450 |
amit.gupta |
22 |
|
|
|
23 |
client = MongoClient('mongodb://localhost:27017/')
|
|
|
24 |
|
|
|
25 |
SENDER = "cnc.center@shop2020.in"
|
|
|
26 |
PASSWORD = "5h0p2o2o"
|
|
|
27 |
SUBJECT = "DTR User Segmentation report for " + date.today().isoformat()
|
|
|
28 |
SMTP_SERVER = "smtp.gmail.com"
|
|
|
29 |
SMTP_PORT = 587
|
|
|
30 |
|
| 14460 |
amit.gupta |
31 |
XLS_FILENAME = "dtrsourcesreco.xls"
|
|
|
32 |
boldStyle = xlwt.XFStyle()
|
|
|
33 |
f = xlwt.Font()
|
|
|
34 |
f.bold = True
|
|
|
35 |
boldStyle.font = f
|
|
|
36 |
i = -1
|
| 14450 |
amit.gupta |
37 |
def generateFlipkartReco():
|
| 14508 |
amit.gupta |
38 |
global i
|
|
|
39 |
i = -1
|
| 14460 |
amit.gupta |
40 |
curs = getOrdersAfterDate(datetime.now() - timedelta(days=30), 2)
|
|
|
41 |
db = client.Dtr
|
|
|
42 |
rb = open_workbook(XLS_FILENAME)
|
|
|
43 |
wb = copy(rb)
|
|
|
44 |
#wb = xlwt.Workbook()
|
|
|
45 |
row = 0
|
|
|
46 |
worksheet = wb.add_sheet("Flipkart")
|
|
|
47 |
worksheet.write(row, inc(), 'Order Id', boldStyle)
|
|
|
48 |
worksheet.write(row, inc(), 'User Id', boldStyle)
|
| 14474 |
amit.gupta |
49 |
worksheet.write(row, inc(), 'Username', boldStyle)
|
| 14460 |
amit.gupta |
50 |
worksheet.write(row, inc(), 'Merchant Order Id', boldStyle)
|
|
|
51 |
worksheet.write(row, inc(), 'Product Title', boldStyle)
|
|
|
52 |
worksheet.write(row, inc(), 'Price', boldStyle)
|
|
|
53 |
worksheet.write(row, inc(), 'Quantity', boldStyle)
|
|
|
54 |
worksheet.write(row, inc(), 'Status', boldStyle)
|
|
|
55 |
worksheet.write(row, inc(), 'Detailed Status', boldStyle)
|
|
|
56 |
worksheet.write(row, inc(), 'Cashback Status', boldStyle)
|
|
|
57 |
worksheet.write(row, inc(), 'Our CashBack', boldStyle)
|
|
|
58 |
worksheet.write(row, inc(), 'Sale Date', boldStyle)
|
|
|
59 |
worksheet.write(row, inc(), 'SubtagId', boldStyle)
|
|
|
60 |
worksheet.write(row, inc(), 'Category', boldStyle)
|
|
|
61 |
worksheet.write(row, inc(), 'Aff PayOut', boldStyle)
|
|
|
62 |
worksheet.write(row, inc(), 'Aff Sale Amount', boldStyle)
|
|
|
63 |
worksheet.write(row, inc(), 'Aff Sale Date', boldStyle)
|
|
|
64 |
for row1 in curs:
|
|
|
65 |
orderId = row1[0]
|
|
|
66 |
order = db.merchantOrder.find_one({"orderId":orderId})
|
|
|
67 |
if order is None:
|
|
|
68 |
continue
|
|
|
69 |
saleTime = int(time.mktime(datetime.strptime(order['placedOn'], "%d %B, %Y %I:%M %p").replace(hour=0, minute=0, second=0, microsecond=0).timetuple()))
|
|
|
70 |
#saleTime1 = int(time.mktime((datetime.strptime(order['placedOn'], "%b %d, %Y %I:%M %p") + timedelta(seconds=-60)).timetuple()))
|
|
|
71 |
|
|
|
72 |
for subOrder in order['subOrders']:
|
| 14489 |
amit.gupta |
73 |
affs = list(db.flipkartOrderAffiliateInfo.find({"subOrders.productCode":subOrder.get("productCode"), "saleDateInt":saleTime}))
|
| 14460 |
amit.gupta |
74 |
row += 1
|
|
|
75 |
i=-1
|
|
|
76 |
worksheet.write(row, inc(), orderId)
|
|
|
77 |
worksheet.write(row, inc(), row1[1])
|
| 14474 |
amit.gupta |
78 |
worksheet.write(row, inc(), row1[-1])
|
| 14460 |
amit.gupta |
79 |
worksheet.write(row, inc(), order['merchantOrderId'])
|
|
|
80 |
worksheet.write(row, inc(), subOrder['productTitle'])
|
|
|
81 |
worksheet.write(row, inc(), subOrder['amountPaid'])
|
|
|
82 |
worksheet.write(row, inc(), subOrder['quantity'])
|
|
|
83 |
worksheet.write(row, inc(), subOrder['status'])
|
|
|
84 |
worksheet.write(row, inc(), subOrder['detailedStatus'])
|
|
|
85 |
worksheet.write(row, inc(), subOrder['cashBackStatus'])
|
|
|
86 |
worksheet.write(row, inc(), subOrder['cashBackAmount'])
|
|
|
87 |
worksheet.write(row, inc(), subOrder['placedOn'])
|
|
|
88 |
worksheet.write(row, inc(), order['subTagId'])
|
|
|
89 |
for aff in affs:
|
| 14487 |
amit.gupta |
90 |
if aff['subTagId']== subOrder['subTagId']:
|
| 14460 |
amit.gupta |
91 |
worksheet.write(row, inc(), aff['category'])
|
|
|
92 |
worksheet.write(row, inc(), aff['payOut'])
|
|
|
93 |
worksheet.write(row, inc(), aff['saleAmount'])
|
|
|
94 |
worksheet.write(row, inc(), aff['saleDate'])
|
|
|
95 |
break
|
|
|
96 |
|
|
|
97 |
|
|
|
98 |
wb.save(XLS_FILENAME)
|
| 14450 |
amit.gupta |
99 |
def generateSnapDealReco():
|
| 14524 |
amit.gupta |
100 |
global i
|
| 14460 |
amit.gupta |
101 |
curs = getOrdersAfterDate(datetime.now() - timedelta(days=30), 3)
|
| 14450 |
amit.gupta |
102 |
db = client.Dtr
|
| 14524 |
amit.gupta |
103 |
notReconciled = {}
|
| 14487 |
amit.gupta |
104 |
matchedList = []
|
| 14450 |
amit.gupta |
105 |
workbook = xlwt.Workbook()
|
| 14501 |
amit.gupta |
106 |
worksheet = workbook.add_sheet("Snapdeal Reconciled")
|
|
|
107 |
worksheet1 = workbook.add_sheet("Snapdeal Reconciled All")
|
| 14508 |
amit.gupta |
108 |
worksheet2 = workbook.add_sheet("Snapdeal Orders not reconciled")
|
|
|
109 |
affNotReconciledSheet = workbook.add_sheet("Snapdeal Aff not reconciled")
|
|
|
110 |
setHeaders(worksheet, worksheet1, worksheet2, affNotReconciledSheet)
|
| 14450 |
amit.gupta |
111 |
row = 0
|
| 14501 |
amit.gupta |
112 |
anotherrow = 0
|
| 14508 |
amit.gupta |
113 |
row2 = 0
|
| 14450 |
amit.gupta |
114 |
for row1 in curs:
|
|
|
115 |
orderId = row1[0]
|
|
|
116 |
order = db.merchantOrder.find_one({"orderId":orderId})
|
|
|
117 |
if order is None:
|
|
|
118 |
continue
|
| 14496 |
amit.gupta |
119 |
#saleTime = int(time.mktime(datetime.strptime(order['placedOn'], "%b %d, %Y, %I:%M %p").timetuple()))
|
| 14450 |
amit.gupta |
120 |
aff = list(db.snapdealOrderAffiliateInfo.find({"subTagId":order["subTagId"]}))
|
| 14501 |
amit.gupta |
121 |
anotherrow += 1
|
| 14524 |
amit.gupta |
122 |
if len(aff) > 0 and order["subTagId"] not in matchedList and int(order["paidAmount"])==int(aff[0]["saleAmount"]):
|
| 14501 |
amit.gupta |
123 |
matchedList.append(order["subTagId"])
|
| 14610 |
amit.gupta |
124 |
db.snapdealOrderAffiliateInfo.update({"adId":aff[0].get("adId")}, {"$set":{"reconciled":True, "orderId":orderId}}, multi=True)
|
| 14501 |
amit.gupta |
125 |
order['reconciled'] = True
|
| 14610 |
amit.gupta |
126 |
order['adId'] = aff[0].get("adId")
|
| 14501 |
amit.gupta |
127 |
db.merchantOrder.save(order)
|
|
|
128 |
row += 1
|
|
|
129 |
i=-1
|
|
|
130 |
worksheet.write(row, inc(), orderId)
|
|
|
131 |
worksheet1.write(anotherrow, i, orderId)
|
|
|
132 |
worksheet.write(row, inc(), row1[1])
|
|
|
133 |
worksheet1.write(anotherrow, i, row1[1])
|
| 14601 |
amit.gupta |
134 |
worksheet.write(row, inc(), row1[-2])
|
|
|
135 |
worksheet1.write(anotherrow, i, row1[-2])
|
| 14501 |
amit.gupta |
136 |
worksheet.write(row, inc(), row1[-1])
|
|
|
137 |
worksheet1.write(anotherrow, i, row1[-1])
|
|
|
138 |
worksheet.write(row, inc(), order['merchantOrderId'])
|
|
|
139 |
worksheet1.write(anotherrow, i, order['merchantOrderId'])
|
|
|
140 |
worksheet.write(row, inc(), order['subTagId'])
|
|
|
141 |
worksheet1.write(anotherrow, i, order['subTagId'])
|
|
|
142 |
worksheet.write(row, inc(), order['placedOn'])
|
|
|
143 |
worksheet1.write(anotherrow, i, order['placedOn'])
|
|
|
144 |
worksheet.write(row, inc(), int(order['paidAmount']))
|
|
|
145 |
worksheet1.write(anotherrow, i, int(order['paidAmount']))
|
| 14524 |
amit.gupta |
146 |
worksheet.write(row, inc(), aff[0]['saleDate'])
|
|
|
147 |
worksheet1.write(anotherrow, i, aff[0]['saleDate'])
|
|
|
148 |
worksheet.write(row, inc(), aff[0]['saleAmount'])
|
|
|
149 |
worksheet1.write(anotherrow, i, aff[0]['saleAmount'])
|
|
|
150 |
worksheet.write(row, inc(), aff[0]['payOut'])
|
|
|
151 |
worksheet1.write(anotherrow, i, aff[0]['payOut'])
|
| 14601 |
amit.gupta |
152 |
worksheet.write(row, inc(), aff[0]['ip'])
|
|
|
153 |
worksheet1.write(anotherrow, i, aff[0]['ip'])
|
| 14501 |
amit.gupta |
154 |
k = i
|
| 14504 |
amit.gupta |
155 |
row -= 1
|
|
|
156 |
anotherrow -= 1
|
| 14501 |
amit.gupta |
157 |
for subOrder in order['subOrders']:
|
|
|
158 |
i = k
|
| 14503 |
amit.gupta |
159 |
row += 1
|
|
|
160 |
anotherrow += 1
|
| 14501 |
amit.gupta |
161 |
worksheet.write(row, inc(), subOrder['productTitle'])
|
|
|
162 |
worksheet1.write(anotherrow, i, subOrder['productTitle'])
|
|
|
163 |
worksheet.write(row, inc(), subOrder['amountPaid'])
|
|
|
164 |
worksheet1.write(anotherrow, i, subOrder['amountPaid'])
|
|
|
165 |
worksheet.write(row, inc(), subOrder['quantity'])
|
|
|
166 |
worksheet1.write(anotherrow, i, subOrder['quantity'])
|
|
|
167 |
worksheet.write(row, inc(), subOrder['status'])
|
|
|
168 |
worksheet1.write(anotherrow, i, subOrder['status'])
|
|
|
169 |
worksheet.write(row, inc(), subOrder['cashBackStatus'])
|
|
|
170 |
worksheet1.write(anotherrow, i, subOrder['cashBackStatus'])
|
|
|
171 |
worksheet.write(row, inc(), subOrder['cashBackAmount'])
|
|
|
172 |
worksheet1.write(anotherrow, i, subOrder['cashBackAmount'])
|
| 14504 |
amit.gupta |
173 |
|
| 14501 |
amit.gupta |
174 |
else:
|
| 14524 |
amit.gupta |
175 |
i=-1
|
| 14501 |
amit.gupta |
176 |
worksheet1.write(anotherrow, inc(), orderId)
|
|
|
177 |
worksheet1.write(anotherrow, inc(), row1[1])
|
| 14601 |
amit.gupta |
178 |
worksheet1.write(anotherrow, inc(), row1[-2])
|
| 14501 |
amit.gupta |
179 |
worksheet1.write(anotherrow, inc(), row1[-1])
|
|
|
180 |
worksheet1.write(anotherrow, inc(), order['merchantOrderId'])
|
|
|
181 |
worksheet1.write(anotherrow, inc(), order['subTagId'])
|
|
|
182 |
worksheet1.write(anotherrow, inc(), order['placedOn'])
|
|
|
183 |
worksheet1.write(anotherrow, inc(), int(order['paidAmount']))
|
| 14524 |
amit.gupta |
184 |
timestamp1 = int(time.mktime(datetime.strptime(order['placedOn'], "%b %d, %Y, %I:%M %p").timetuple()))
|
|
|
185 |
notReconciled[orderId] = (anotherrow, i, int(order['paidAmount']), timestamp1, order["subTagId"])
|
|
|
186 |
inc()
|
|
|
187 |
inc()
|
|
|
188 |
inc()
|
| 14501 |
amit.gupta |
189 |
k = i
|
| 14504 |
amit.gupta |
190 |
anotherrow -= 1
|
| 14501 |
amit.gupta |
191 |
for subOrder in order['subOrders']:
|
| 14503 |
amit.gupta |
192 |
anotherrow += 1
|
| 14501 |
amit.gupta |
193 |
i = k
|
| 14505 |
amit.gupta |
194 |
worksheet1.write(anotherrow, inc(), subOrder['productTitle'])
|
|
|
195 |
worksheet1.write(anotherrow, inc(), subOrder['amountPaid'])
|
|
|
196 |
worksheet1.write(anotherrow, inc(), subOrder['quantity'])
|
|
|
197 |
worksheet1.write(anotherrow, inc(), subOrder['status'])
|
|
|
198 |
worksheet1.write(anotherrow, inc(), subOrder['cashBackStatus'])
|
|
|
199 |
worksheet1.write(anotherrow, inc(), subOrder['cashBackAmount'])
|
| 14570 |
amit.gupta |
200 |
|
| 14524 |
amit.gupta |
201 |
|
|
|
202 |
last30Days = date.today() - timedelta(days=30)
|
|
|
203 |
int(time.mktime(last30Days.timetuple()))
|
|
|
204 |
row = 0
|
|
|
205 |
for offer in db.snapdealOrderAffiliateInfo.find({"reconciled":{"$exists":False},
|
|
|
206 |
"saleTime":{"$gt":int(time.mktime(last30Days.timetuple())),
|
|
|
207 |
"$lt":int(time.mktime(date.today().timetuple()))}} ):
|
|
|
208 |
subTagId = offer.get("subTagId")
|
|
|
209 |
saleTime = offer.get("saleTime")
|
|
|
210 |
orders = getOrdersByTag(subTagId, 3)
|
|
|
211 |
for order in orders:
|
|
|
212 |
if notReconciled.has_key(order[0]):
|
|
|
213 |
(roww, column, paidAmount, timestamp1, oSubTagId) = notReconciled[order[0]]
|
|
|
214 |
if paidAmount==int(offer.get("saleAmount")) and timestamp1 <= saleTime and timestamp1 + 120 >= saleTime:
|
|
|
215 |
i = column
|
| 14570 |
amit.gupta |
216 |
worksheet1.write(roww, inc(), offer.get("saleDate"))
|
| 14527 |
amit.gupta |
217 |
worksheet1.write(roww, inc(), offer.get("saleAmount"))
|
|
|
218 |
worksheet1.write(roww, inc(), offer.get("payOut"))
|
|
|
219 |
del notReconciled[order[0]]
|
| 14530 |
amit.gupta |
220 |
print "found match for user", order[1]
|
| 14610 |
amit.gupta |
221 |
db.snapdealOrderAffiliateInfo.update({"adId":offer.get("adId")}, {"$set":{"reconciled":True, "orderId":order[0]}}, multi=True)
|
|
|
222 |
db.merchantOrder.update({"orderId":order[0]}, {"$set":{"reconciled":True, "adId":offer.get("adId")}}, multi=True)
|
| 14570 |
amit.gupta |
223 |
break
|
| 14530 |
amit.gupta |
224 |
|
| 14570 |
amit.gupta |
225 |
unreconciledOrders = notReconciled.keys()
|
|
|
226 |
row2=0
|
|
|
227 |
for row1 in curs:
|
|
|
228 |
if row1[0] in unreconciledOrders:
|
|
|
229 |
for order in db.merchantOrder.find({"orderId":row1[0]}):
|
|
|
230 |
row2 += 1
|
|
|
231 |
i=-1
|
|
|
232 |
worksheet2.write(row2, inc(), order["orderId"])
|
|
|
233 |
worksheet2.write(row2, inc(), row1[1])
|
| 14605 |
amit.gupta |
234 |
worksheet2.write(row2, inc(), row1[-2])
|
| 14570 |
amit.gupta |
235 |
worksheet2.write(row2, inc(), row1[-1])
|
|
|
236 |
worksheet2.write(row2, inc(), order['merchantOrderId'])
|
|
|
237 |
worksheet2.write(row2, inc(), order['subTagId'])
|
|
|
238 |
worksheet2.write(row2, inc(), order['placedOn'])
|
|
|
239 |
worksheet2.write(row2, inc(), int(order['paidAmount']))
|
|
|
240 |
row2 -=1
|
|
|
241 |
k=i
|
|
|
242 |
for subOrder in order['subOrders']:
|
|
|
243 |
i = k
|
|
|
244 |
row2 += 1
|
|
|
245 |
worksheet2.write(row2, inc(), subOrder['productTitle'])
|
|
|
246 |
worksheet2.write(row2, inc(), subOrder['amountPaid'])
|
|
|
247 |
worksheet2.write(row2, inc(), subOrder['quantity'])
|
|
|
248 |
worksheet2.write(row2, inc(), subOrder['status'])
|
|
|
249 |
worksheet2.write(row2, inc(), subOrder['cashBackStatus'])
|
|
|
250 |
worksheet2.write(row2, inc(), subOrder['cashBackAmount'])
|
|
|
251 |
|
|
|
252 |
|
|
|
253 |
for offer in db.snapdealOrderAffiliateInfo.find({"reconciled":{"$exists":False},
|
|
|
254 |
"saleTime":{"$gt":int(time.mktime(last30Days.timetuple())),
|
|
|
255 |
"$lt":int(time.mktime(date.today().timetuple()))}} ):
|
|
|
256 |
row += 1
|
|
|
257 |
i=-1
|
|
|
258 |
affNotReconciledSheet.write(row, inc(), offer.get("adId"))
|
|
|
259 |
affNotReconciledSheet.write(row, inc(), offer.get("subTagId"))
|
|
|
260 |
affNotReconciledSheet.write(row, inc(), offer.get("saleDate"))
|
|
|
261 |
affNotReconciledSheet.write(row, inc(), offer.get("saleAmount"))
|
|
|
262 |
affNotReconciledSheet.write(row, inc(), offer.get("payOut"))
|
|
|
263 |
affNotReconciledSheet.write(row, inc(), offer.get("conversionStatus"))
|
| 14601 |
amit.gupta |
264 |
affNotReconciledSheet.write(row, inc(), offer.get("ip"))
|
| 14570 |
amit.gupta |
265 |
|
| 14460 |
amit.gupta |
266 |
workbook.save(XLS_FILENAME)
|
| 14450 |
amit.gupta |
267 |
|
|
|
268 |
def sendmail(email, message, title):
|
|
|
269 |
if email == "":
|
|
|
270 |
return
|
|
|
271 |
mailServer = smtplib.SMTP(SMTP_SERVER, SMTP_PORT)
|
|
|
272 |
mailServer.ehlo()
|
|
|
273 |
mailServer.starttls()
|
|
|
274 |
mailServer.ehlo()
|
|
|
275 |
|
|
|
276 |
# Create the container (outer) email message.
|
|
|
277 |
msg = MIMEMultipart()
|
|
|
278 |
msg['Subject'] = title
|
|
|
279 |
msg.preamble = title
|
|
|
280 |
html_msg = MIMEText(message, 'html')
|
|
|
281 |
msg.attach(html_msg)
|
|
|
282 |
|
|
|
283 |
#snapdeal more to be added here
|
|
|
284 |
snapdeal = MIMEBase('application', 'vnd.ms-excel')
|
| 14460 |
amit.gupta |
285 |
snapdeal.set_payload(file(XLS_FILENAME).read())
|
| 14450 |
amit.gupta |
286 |
encoders.encode_base64(snapdeal)
|
| 14460 |
amit.gupta |
287 |
snapdeal.add_header('Content-Disposition', 'attachment;filename=' + XLS_FILENAME)
|
| 14450 |
amit.gupta |
288 |
msg.attach(snapdeal)
|
|
|
289 |
|
|
|
290 |
|
|
|
291 |
email.append('amit.gupta@shop2020.in')
|
|
|
292 |
MAILTO = email
|
|
|
293 |
mailServer.login(SENDER, PASSWORD)
|
|
|
294 |
mailServer.sendmail(PASSWORD, MAILTO, msg.as_string())
|
|
|
295 |
|
| 14508 |
amit.gupta |
296 |
def setHeaders(worksheet, worksheet1, worksheet2, affNotReconciledSheet):
|
| 14505 |
amit.gupta |
297 |
boldStyle = xlwt.XFStyle()
|
|
|
298 |
f = xlwt.Font()
|
|
|
299 |
f.bold = True
|
|
|
300 |
boldStyle.font = f
|
| 14501 |
amit.gupta |
301 |
row = 0
|
|
|
302 |
global i
|
|
|
303 |
i=-1
|
|
|
304 |
worksheet.write(row, inc(), 'Order Id', boldStyle)
|
|
|
305 |
worksheet.write(row, inc(), 'User Id', boldStyle)
|
| 14601 |
amit.gupta |
306 |
worksheet.write(row, inc(), 'Version Code', boldStyle)
|
| 14501 |
amit.gupta |
307 |
worksheet.write(row, inc(), 'Username', boldStyle)
|
|
|
308 |
worksheet.write(row, inc(), 'Merchant Order Id', boldStyle)
|
|
|
309 |
worksheet.write(row, inc(), 'SubtagId', boldStyle)
|
|
|
310 |
worksheet.write(row, inc(), 'Sale Date', boldStyle)
|
|
|
311 |
worksheet.write(row, inc(), 'Sale Amount', boldStyle)
|
|
|
312 |
worksheet.write(row, inc(), 'Aff Sale Date', boldStyle)
|
|
|
313 |
worksheet.write(row, inc(), 'Aff Sale Amt', boldStyle)
|
|
|
314 |
worksheet.write(row, inc(), 'Aff PayOut', boldStyle)
|
| 14601 |
amit.gupta |
315 |
worksheet.write(row, inc(), 'IP', boldStyle)
|
| 14501 |
amit.gupta |
316 |
worksheet.write(row, inc(), 'Product Title', boldStyle)
|
|
|
317 |
worksheet.write(row, inc(), 'Price', boldStyle)
|
|
|
318 |
worksheet.write(row, inc(), 'Quantity', boldStyle)
|
|
|
319 |
worksheet.write(row, inc(), 'Status', boldStyle)
|
|
|
320 |
worksheet.write(row, inc(), 'Cashback Status', boldStyle)
|
|
|
321 |
worksheet.write(row, inc(), 'CashBack', boldStyle)
|
|
|
322 |
|
| 14505 |
amit.gupta |
323 |
i = -1
|
| 14501 |
amit.gupta |
324 |
worksheet1.write(row, inc(), 'Order Id', boldStyle)
|
|
|
325 |
worksheet1.write(row, inc(), 'User Id', boldStyle)
|
| 14601 |
amit.gupta |
326 |
worksheet1.write(row, inc(), 'Version Code', boldStyle)
|
| 14501 |
amit.gupta |
327 |
worksheet1.write(row, inc(), 'Username', boldStyle)
|
|
|
328 |
worksheet1.write(row, inc(), 'Merchant Order Id', boldStyle)
|
|
|
329 |
worksheet1.write(row, inc(), 'SubtagId', boldStyle)
|
|
|
330 |
worksheet1.write(row, inc(), 'Sale Date', boldStyle)
|
|
|
331 |
worksheet1.write(row, inc(), 'Sale Amount', boldStyle)
|
|
|
332 |
worksheet1.write(row, inc(), 'Aff Sale Date', boldStyle)
|
|
|
333 |
worksheet1.write(row, inc(), 'Aff Sale Amt', boldStyle)
|
|
|
334 |
worksheet1.write(row, inc(), 'Aff PayOut', boldStyle)
|
| 14601 |
amit.gupta |
335 |
worksheet1.write(row, inc(), 'IP', boldStyle)
|
| 14501 |
amit.gupta |
336 |
worksheet1.write(row, inc(), 'Product Title', boldStyle)
|
|
|
337 |
worksheet1.write(row, inc(), 'Price', boldStyle)
|
|
|
338 |
worksheet1.write(row, inc(), 'Quantity', boldStyle)
|
|
|
339 |
worksheet1.write(row, inc(), 'Status', boldStyle)
|
|
|
340 |
worksheet1.write(row, inc(), 'Cashback Status', boldStyle)
|
|
|
341 |
worksheet1.write(row, inc(), 'CashBack', boldStyle)
|
| 14508 |
amit.gupta |
342 |
|
|
|
343 |
i = -1
|
|
|
344 |
worksheet2.write(row, inc(), 'Order Id', boldStyle)
|
|
|
345 |
worksheet2.write(row, inc(), 'User Id', boldStyle)
|
| 14605 |
amit.gupta |
346 |
worksheet2.write(row, inc(), 'Version Code', boldStyle)
|
| 14508 |
amit.gupta |
347 |
worksheet2.write(row, inc(), 'Username', boldStyle)
|
|
|
348 |
worksheet2.write(row, inc(), 'Merchant Order Id', boldStyle)
|
|
|
349 |
worksheet2.write(row, inc(), 'SubtagId', boldStyle)
|
|
|
350 |
worksheet2.write(row, inc(), 'Sale Date', boldStyle)
|
|
|
351 |
worksheet2.write(row, inc(), 'Sale Amount', boldStyle)
|
|
|
352 |
worksheet2.write(row, inc(), 'Product Title', boldStyle)
|
|
|
353 |
worksheet2.write(row, inc(), 'Price', boldStyle)
|
|
|
354 |
worksheet2.write(row, inc(), 'Quantity', boldStyle)
|
|
|
355 |
worksheet2.write(row, inc(), 'Status', boldStyle)
|
|
|
356 |
worksheet2.write(row, inc(), 'Cashback Status', boldStyle)
|
|
|
357 |
worksheet2.write(row, inc(), 'CashBack', boldStyle)
|
| 14450 |
amit.gupta |
358 |
|
| 14508 |
amit.gupta |
359 |
i =-1
|
|
|
360 |
affNotReconciledSheet.write(row, inc(), 'AdId', boldStyle)
|
|
|
361 |
affNotReconciledSheet.write(row, inc(), 'subTagId', boldStyle)
|
|
|
362 |
affNotReconciledSheet.write(row, inc(), 'Sale Date', boldStyle)
|
|
|
363 |
affNotReconciledSheet.write(row, inc(), 'Sale Amount', boldStyle)
|
|
|
364 |
affNotReconciledSheet.write(row, inc(), 'Pay Out', boldStyle)
|
|
|
365 |
affNotReconciledSheet.write(row, inc(), 'Status', boldStyle)
|
| 14601 |
amit.gupta |
366 |
affNotReconciledSheet.write(row, inc(), 'IP', boldStyle)
|
| 14524 |
amit.gupta |
367 |
|
|
|
368 |
def getUserAmountReconciled():
|
|
|
369 |
pass
|
|
|
370 |
|
|
|
371 |
|
| 14460 |
amit.gupta |
372 |
def inc():
|
|
|
373 |
global i
|
|
|
374 |
i+=1
|
|
|
375 |
return i
|
|
|
376 |
|
| 14450 |
amit.gupta |
377 |
def main():
|
|
|
378 |
generateSnapDealReco()
|
| 14524 |
amit.gupta |
379 |
#generateFlipkartReco()
|
| 14604 |
amit.gupta |
380 |
sendmail(["amit.gupta@shop2020.in"], "", "DTR Affiliate Reco")
|
| 14450 |
amit.gupta |
381 |
|
|
|
382 |
if __name__ == '__main__':
|
| 14460 |
amit.gupta |
383 |
main()
|
|
|
384 |
|