Subversion Repositories SmartDukaan

Rev

Rev 14504 | Rev 14506 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14504 Rev 14505
Line 160... Line 160...
160
                worksheet1.write(anotherrow, i, subOrder['status'])
160
                worksheet1.write(anotherrow, i, subOrder['status'])
161
                worksheet.write(row, inc(), subOrder['cashBackStatus'])
161
                worksheet.write(row, inc(), subOrder['cashBackStatus'])
162
                worksheet1.write(anotherrow, i, subOrder['cashBackStatus'])
162
                worksheet1.write(anotherrow, i, subOrder['cashBackStatus'])
163
                worksheet.write(row, inc(), subOrder['cashBackAmount'])
163
                worksheet.write(row, inc(), subOrder['cashBackAmount'])
164
                worksheet1.write(anotherrow, i, subOrder['cashBackAmount'])
164
                worksheet1.write(anotherrow, i, subOrder['cashBackAmount'])
165
            row += 1
-
 
166
            anotherrow += 1
-
 
167
 
165
 
168
        else:
166
        else:
169
            i=-1 
167
            i=-1 
170
            worksheet1.write(anotherrow, inc(), orderId)
168
            worksheet1.write(anotherrow, inc(), orderId)
171
            worksheet1.write(anotherrow, inc(), row1[1])
169
            worksheet1.write(anotherrow, inc(), row1[1])
Line 175... Line 173...
175
            worksheet1.write(anotherrow, inc(), order['placedOn'])
173
            worksheet1.write(anotherrow, inc(), order['placedOn'])
176
            worksheet1.write(anotherrow, inc(), int(order['paidAmount']))
174
            worksheet1.write(anotherrow, inc(), int(order['paidAmount']))
177
            worksheet1.write(anotherrow, inc(), "")
175
            worksheet1.write(anotherrow, inc(), "")
178
            worksheet1.write(anotherrow, inc(), "")
176
            worksheet1.write(anotherrow, inc(), "")
179
            worksheet1.write(anotherrow, inc(), "")
177
            worksheet1.write(anotherrow, inc(), "")
180
            worksheet1.write(anotherrow, inc(), 'Product Title', boldStyle)
-
 
181
            worksheet1.write(anotherrow, inc(), 'Price', boldStyle)
-
 
182
            worksheet1.write(anotherrow, inc(), 'Amoun Paid', boldStyle)
-
 
183
            worksheet1.write(anotherrow, inc(), 'Status', boldStyle)
-
 
184
            worksheet1.write(anotherrow, inc(), 'Cashback Status', boldStyle)
-
 
185
            worksheet1.write(anotherrow, inc(), 'CashBack', boldStyle)
-
 
186
            k = i
178
            k = i
187
            anotherrow -= 1
179
            anotherrow -= 1
188
            for subOrder in order['subOrders']:
180
            for subOrder in order['subOrders']:
189
                anotherrow += 1
181
                anotherrow += 1
190
                i = k
182
                i = k
191
                worksheet.write(anotherrow, inc(), subOrder['productTitle'])
183
                worksheet1.write(anotherrow, inc(), subOrder['productTitle'])
192
                worksheet.write(anotherrow, inc(), subOrder['amountPaid'])
184
                worksheet1.write(anotherrow, inc(), subOrder['amountPaid'])
193
                worksheet.write(anotherrow, inc(), subOrder['quantity'])
185
                worksheet1.write(anotherrow, inc(), subOrder['quantity'])
194
                worksheet.write(anotherrow, inc(), subOrder['status'])
186
                worksheet1.write(anotherrow, inc(), subOrder['status'])
195
                worksheet.write(anotherrow, inc(), subOrder['cashBackStatus'])
187
                worksheet1.write(anotherrow, inc(), subOrder['cashBackStatus'])
196
                worksheet.write(anotherrow, inc(), subOrder['cashBackAmount'])
188
                worksheet1.write(anotherrow, inc(), subOrder['cashBackAmount'])
197
            anotherrow += 1
-
 
198
        
189
        
199
            
190
            
200
        workbook.save(XLS_FILENAME)
191
        workbook.save(XLS_FILENAME)
201
            
192
            
202
def sendmail(email, message, title):
193
def sendmail(email, message, title):
Line 226... Line 217...
226
    MAILTO = email 
217
    MAILTO = email 
227
    mailServer.login(SENDER, PASSWORD)
218
    mailServer.login(SENDER, PASSWORD)
228
    mailServer.sendmail(PASSWORD, MAILTO, msg.as_string())
219
    mailServer.sendmail(PASSWORD, MAILTO, msg.as_string())
229
 
220
 
230
def setHeaders(worksheet, worksheet1):
221
def setHeaders(worksheet, worksheet1):
-
 
222
    boldStyle = xlwt.XFStyle()
-
 
223
    f = xlwt.Font()
-
 
224
    f.bold = True
-
 
225
    boldStyle.font = f
231
    row = 0
226
    row = 0
232
    global i
227
    global i
233
    i=-1    
228
    i=-1    
234
    worksheet.write(row, inc(), 'Order Id', boldStyle)
229
    worksheet.write(row, inc(), 'Order Id', boldStyle)
235
    worksheet.write(row, inc(), 'User Id', boldStyle)
230
    worksheet.write(row, inc(), 'User Id', boldStyle)
Line 246... Line 241...
246
    worksheet.write(row, inc(), 'Quantity', boldStyle)
241
    worksheet.write(row, inc(), 'Quantity', boldStyle)
247
    worksheet.write(row, inc(), 'Status', boldStyle)
242
    worksheet.write(row, inc(), 'Status', boldStyle)
248
    worksheet.write(row, inc(), 'Cashback Status', boldStyle)
243
    worksheet.write(row, inc(), 'Cashback Status', boldStyle)
249
    worksheet.write(row, inc(), 'CashBack', boldStyle)
244
    worksheet.write(row, inc(), 'CashBack', boldStyle)
250
 
245
 
-
 
246
    i = -1
251
    worksheet1.write(row, inc(), 'Order Id', boldStyle)
247
    worksheet1.write(row, inc(), 'Order Id', boldStyle)
252
    worksheet1.write(row, inc(), 'User Id', boldStyle)
248
    worksheet1.write(row, inc(), 'User Id', boldStyle)
253
    worksheet1.write(row, inc(), 'Username', boldStyle)
249
    worksheet1.write(row, inc(), 'Username', boldStyle)
254
    worksheet1.write(row, inc(), 'Merchant Order Id', boldStyle)
250
    worksheet1.write(row, inc(), 'Merchant Order Id', boldStyle)
255
    worksheet1.write(row, inc(), 'SubtagId', boldStyle)
251
    worksheet1.write(row, inc(), 'SubtagId', boldStyle)
Line 272... Line 268...
272
    return i
268
    return i
273
    
269
    
274
def main():
270
def main():
275
    generateSnapDealReco()
271
    generateSnapDealReco()
276
    generateFlipkartReco()
272
    generateFlipkartReco()
277
    sendmail(["amit.gupta@shop2020.in"], "", "DTR Affiliate Reco")
273
    #sendmail(["amit.gupta@shop2020.in"], "", "DTR Affiliate Reco")
278
 
274
 
279
if __name__ == '__main__':
275
if __name__ == '__main__':
280
    main()
276
    main()
281
    
277
    
282
278