Subversion Repositories SmartDukaan

Rev

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

Rev 14489 Rev 14493
Line 134... Line 134...
134
        saleTime = int(time.mktime(datetime.strptime(order['placedOn'], "%b %d, %Y, %I:%M %p").timetuple()))
134
        saleTime = int(time.mktime(datetime.strptime(order['placedOn'], "%b %d, %Y, %I:%M %p").timetuple()))
135
        aff = list(db.snapdealOrderAffiliateInfo.find({"subTagId":order["subTagId"]}))
135
        aff = list(db.snapdealOrderAffiliateInfo.find({"subTagId":order["subTagId"]}))
136
        gotCashBack = False
136
        gotCashBack = False
137
        if len(aff) > 0 and order["subTagId"] not in matchedList: 
137
        if len(aff) > 0 and order["subTagId"] not in matchedList: 
138
            gotCashBack = True
138
            gotCashBack = True
139
                
139
        once = True        
140
        for subOrder in order['subOrders']:
140
        for subOrder in order['subOrders']:
141
            i=-1 
141
            i=-1 
142
            row += 1
142
            row += 1
143
            worksheet.write(row, inc(), orderId)
143
            worksheet.write(row, inc(), orderId)
144
            worksheet.write(row, inc(), row1[1])
144
            worksheet.write(row, inc(), row1[1])
Line 152... Line 152...
152
            worksheet.write(row, inc(), subOrder['cashBackStatus'])
152
            worksheet.write(row, inc(), subOrder['cashBackStatus'])
153
            worksheet.write(row, inc(), subOrder['cashBackAmount'])
153
            worksheet.write(row, inc(), subOrder['cashBackAmount'])
154
            worksheet.write(row, inc(), subOrder['placedOn'])
154
            worksheet.write(row, inc(), subOrder['placedOn'])
155
            worksheet.write(row, inc(), order['subTagId'])
155
            worksheet.write(row, inc(), order['subTagId'])
156
            if gotCashBack:
156
            if gotCashBack:
157
                print saleTime -aff[0]['saleTime'] 
-
 
158
                worksheet.write(row, inc(), aff[0]['adId'])
157
                worksheet.write(row, inc(), aff[0]['adId'])
159
                worksheet.write(row, inc(), aff[0]['payOut'])
158
                worksheet.write(row, inc(), aff[0]['payOut'])
-
 
159
                if once:
160
                worksheet.write(row, inc(), aff[0]['saleAmount'])
160
                    worksheet.write(row, inc(), aff[0]['saleAmount'])
161
                worksheet.write(row, inc(), aff[0]['saleDate'])
161
                    worksheet.write(row, inc(), aff[0]['saleDate'])
-
 
162
                    once = False
162
        workbook.save(XLS_FILENAME)
163
        workbook.save(XLS_FILENAME)
163
            
164
            
164
def sendmail(email, message, title):
165
def sendmail(email, message, title):
165
    if email == "":
166
    if email == "":
166
        return
167
        return