Subversion Repositories SmartDukaan

Rev

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

Rev 14529 Rev 14530
Line 212... Line 212...
212
    int(time.mktime(last30Days.timetuple()))
212
    int(time.mktime(last30Days.timetuple()))
213
    row = 0
213
    row = 0
214
    for offer in db.snapdealOrderAffiliateInfo.find({"reconciled":{"$exists":False}, 
214
    for offer in db.snapdealOrderAffiliateInfo.find({"reconciled":{"$exists":False}, 
215
                                                     "saleTime":{"$gt":int(time.mktime(last30Days.timetuple())),
215
                                                     "saleTime":{"$gt":int(time.mktime(last30Days.timetuple())),
216
                                                                 "$lt":int(time.mktime(date.today().timetuple()))}} ):
216
                                                                 "$lt":int(time.mktime(date.today().timetuple()))}} ):
217
        row += 1
-
 
218
        i=-1
-
 
219
        affNotReconciledSheet.write(row, inc(), offer.get("adId")) 
-
 
220
        affNotReconciledSheet.write(row, inc(), offer.get("subTagId")) 
-
 
221
        affNotReconciledSheet.write(row, inc(), offer.get("saleDate")) 
-
 
222
        affNotReconciledSheet.write(row, inc(), offer.get("saleAmount")) 
-
 
223
        affNotReconciledSheet.write(row, inc(), offer.get("payOut")) 
-
 
224
        affNotReconciledSheet.write(row, inc(), offer.get("conversionStatus"))
-
 
225
        
-
 
226
        subTagId = offer.get("subTagId")
217
        subTagId = offer.get("subTagId")
227
        saleTime = offer.get("saleTime")
218
        saleTime = offer.get("saleTime")
228
        orders = getOrdersByTag(subTagId, 3)
219
        orders = getOrdersByTag(subTagId, 3)
229
        for order in orders:
220
        for order in orders:
230
            if notReconciled.has_key(order[0]):
221
            if notReconciled.has_key(order[0]):
Line 233... Line 224...
233
                    i = column
224
                    i = column
234
                    worksheet1.write(roww, inc(), subTagId)        
225
                    worksheet1.write(roww, inc(), subTagId)        
235
                    worksheet1.write(roww, inc(), offer.get("saleAmount"))        
226
                    worksheet1.write(roww, inc(), offer.get("saleAmount"))        
236
                    worksheet1.write(roww, inc(), offer.get("payOut"))
227
                    worksheet1.write(roww, inc(), offer.get("payOut"))
237
                    del notReconciled[order[0]]
228
                    del notReconciled[order[0]]
238
                    print "found match for user", order[1] 
229
                    print "found match for user", order[1]
-
 
230
                else:
-
 
231
                    row += 1
-
 
232
                    i=-1
-
 
233
                    affNotReconciledSheet.write(row, inc(), offer.get("adId")) 
-
 
234
                    affNotReconciledSheet.write(row, inc(), offer.get("subTagId")) 
-
 
235
                    affNotReconciledSheet.write(row, inc(), offer.get("saleDate")) 
-
 
236
                    affNotReconciledSheet.write(row, inc(), offer.get("saleAmount")) 
-
 
237
                    affNotReconciledSheet.write(row, inc(), offer.get("payOut")) 
-
 
238
                    affNotReconciledSheet.write(row, inc(), offer.get("conversionStatus"))
-
 
239
 
239
        
240
        
240
         
241
         
241
        workbook.save(XLS_FILENAME)
242
        workbook.save(XLS_FILENAME)
242
            
243
            
243
def sendmail(email, message, title):
244
def sendmail(email, message, title):