Subversion Repositories SmartDukaan

Rev

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

Rev 15437 Rev 15438
Line 412... Line 412...
412
    loginTime=0
412
    loginTime=0
413
    for r in result:
413
    for r in result:
414
        converted=r[0]
414
        converted=r[0]
415
        worksheet.write(24,1,r[0],center_alignment)
415
        worksheet.write(24,1,r[0],center_alignment)
416
    worksheet.write(25,1,totalVerifiedLinkSent-converted,center_alignment)
416
    worksheet.write(25,1,totalVerifiedLinkSent-converted,center_alignment)
417
    totalVerifiedLinkSent
-
 
418
    conn.close()
417
    conn.close()
419
    
418
    
420
    datesql=TOTAL_ACTIVATIONS
419
    datesql=TOTAL_ACTIVATIONS
421
    conn = getDbConnection()
420
    conn = getDbConnection()
422
    
421
    
Line 496... Line 495...
496
                    
495
                    
497
                    agentId+=1
496
                    agentId+=1
498
                    continue    
497
                    continue    
499
                else:
498
                else:
500
                    for r in result:
499
                    for r in result:
-
 
500
                        if dispositionMap.get(r[0]) == 9:
-
 
501
                            totalVerifiedLinkSent=int(r[1])
501
                        row = dispositionMap.get(r[0])+26
502
                        row = dispositionMap.get(r[0])+26
502
                        if dispositionMap.get(r[0]) == 1 or dispositionMap.get(r[0]) == 2 or dispositionMap.get(r[0]) == 3 or dispositionMap.get(r[0]) == 4:
503
                        if dispositionMap.get(r[0]) == 1 or dispositionMap.get(r[0]) == 2 or dispositionMap.get(r[0]) == 3 or dispositionMap.get(r[0]) == 4:
503
                            nonContactableData+=int(r[1])
504
                            nonContactableData+=int(r[1])
504
                        else:
505
                        else:
505
                            contactableData+=r[1] 
506
                            contactableData+=r[1] 
Line 593... Line 594...
593
                    cursor = conn.cursor()
594
                    cursor = conn.cursor()
594
                    cursor.execute(datesql)
595
                    cursor.execute(datesql)
595
                    result = cursor.fetchall()
596
                    result = cursor.fetchall()
596
                    loginTime=0
597
                    loginTime=0
597
                    for r in result:
598
                    for r in result:
-
 
599
                        #worksheet.write(25+22,columnId,r[0],center_alignment)
-
 
600
                        converted=r[0]
598
                        worksheet.write(25+22,columnId,r[0],center_alignment)
601
                        worksheet.write(25+22,columnId,r[0],center_alignment)
599
                    
602
                    worksheet.write(25+23,columnId,totalVerifiedLinkSent-converted,center_alignment)    
600
                    conn.close()
603
                    conn.close()
601
                    datesql=AGENT_FRESH_QUERY_LINKS_NOT_CONVERTED%(agentId)
604
#                     datesql=AGENT_FRESH_QUERY_LINKS_NOT_CONVERTED%(agentId)
602
                    conn = getDbConnection()
605
#                     conn = getDbConnection()
603
                    
606
#                     
604
                    cursor = conn.cursor()
607
#                     cursor = conn.cursor()
605
                    cursor.execute(datesql)
608
#                     cursor.execute(datesql)
606
                    result = cursor.fetchall()
609
#                     result = cursor.fetchall()
607
                    loginTime=0
610
#                     loginTime=0
608
                    for r in result:
611
#                     for r in result:
609
                        worksheet.write(25+23,columnId,r[0],center_alignment)    
612
#                         worksheet.write(25+23,columnId,r[0],center_alignment)    
610
                    
613
                    
611
                agentId+=1
614
                agentId+=1
612
                columnId+=1
615
                columnId+=1
613
    workbook.save(TMP_FILE)    
616
    workbook.save(TMP_FILE)    
614
    #sendmail(["manas.kapoor@shop2020.in"], "", TMP_FILE, SUBJECT)        
617
    #sendmail(["manas.kapoor@shop2020.in"], "", TMP_FILE, SUBJECT)        
Line 1194... Line 1197...
1194
    generateAgentWiseFreshCallingReport()
1197
    generateAgentWiseFreshCallingReport()
1195
    generateFollowUpCallingReport()
1198
    generateFollowUpCallingReport()
1196
    generateAgentWiseFollowupCallingReport()
1199
    generateAgentWiseFollowupCallingReport()
1197
    generateOnBoardingCallingReport()
1200
    generateOnBoardingCallingReport()
1198
    generateAgentWiseOnboardingCallingReport()
1201
    generateAgentWiseOnboardingCallingReport()
1199
    #sendmail(["manas.kapoor@shop2020.in"], "", TMP_FILE, SUBJECT)
1202
    sendmail(["manas.kapoor@shop2020.in"], "", TMP_FILE, SUBJECT)
1200
         
1203
         
1201
def sendmail(email, message, fileName, title):
1204
def sendmail(email, message, fileName, title):
1202
    if email == "":
1205
    if email == "":
1203
        return
1206
        return
1204
    mailServer = smtplib.SMTP(SMTP_SERVER, SMTP_PORT)
1207
    mailServer = smtplib.SMTP(SMTP_SERVER, SMTP_PORT)
Line 1217... Line 1220...
1217
    fileMsg.set_payload(file(TMP_FILE).read())
1220
    fileMsg.set_payload(file(TMP_FILE).read())
1218
    encoders.encode_base64(fileMsg)
1221
    encoders.encode_base64(fileMsg)
1219
    fileMsg.add_header('Content-Disposition', 'attachment;filename=' + fileName)
1222
    fileMsg.add_header('Content-Disposition', 'attachment;filename=' + fileName)
1220
    msg.attach(fileMsg)
1223
    msg.attach(fileMsg)
1221
    
1224
    
1222
    MAILTO = ['manas.kapoor@saholic.com','amit.sirohi@shop2020.in']
1225
    #MAILTO = ['manas.kapoor@saholic.com','amit.sirohi@shop2020.in']
1223
    #MAILTO = ['manas.kapoor@saholic.com']
1226
    MAILTO = ['manas.kapoor@saholic.com']
1224
    mailServer.login(SENDER, PASSWORD)
1227
    mailServer.login(SENDER, PASSWORD)
1225
    mailServer.sendmail(PASSWORD, MAILTO, msg.as_string())
1228
    mailServer.sendmail(PASSWORD, MAILTO, msg.as_string())
1226
 
1229
 
1227
if __name__ == '__main__':
1230
if __name__ == '__main__':
1228
    main()
1231
    main()