Subversion Repositories SmartDukaan

Rev

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

Rev 4254 Rev 4279
Line 27... Line 27...
27
                "BittooN.EXCHNET@bluedart.com","AmitT.EXCHNET@bluedart.com","sandeep.sachdeva@shop2020.in"]
27
                "BittooN.EXCHNET@bluedart.com","AmitT.EXCHNET@bluedart.com","sandeep.sachdeva@shop2020.in"]
28
from_user = "cnc.center@shop2020.in"
28
from_user = "cnc.center@shop2020.in"
29
from_pwd = "5h0p2o2o"
29
from_pwd = "5h0p2o2o"
30
 
30
 
31
def send_report(warehouseId, warehouseName, providerId, isCod):
31
def send_report(warehouseId, warehouseName, providerId, isCod):
32
    today = datetime.date.today().strftime("%Y-%m-%d")
32
    today = datetime.date.today()
-
 
33
    datestr = str(today.year) + "-" + str(today.month) + "-" + str(today.day)
33
    filename = "/CourierDetailReports/courier-details-"
34
    filename = "/CourierDetailReports/courier-details-"
34
    if isCod:
35
    if isCod:
35
        subject = "Saholic: COD Soft Data - " + warehouseName + " - Date:" + today
36
        subject = "Saholic: COD Soft Data - " + warehouseName + " - Date:" + datestr
36
        text = "Find attached file for COD data" 
37
        text = "Find attached file for COD data" 
37
        filename = filename + "cod"
38
        filename = filename + "cod"
38
    else:
39
    else:
39
        subject = "Saholic: Prepaid Soft Data - " + warehouseName + " - Date:" + today
40
        subject = "Saholic: Prepaid Soft Data - " + warehouseName + " - Date:" + datestr
40
        text = "Find attached file for Prepaid data"
41
        text = "Find attached file for Prepaid data"
41
        filename = filename + "prepaid"
42
        filename = filename + "prepaid"
42
    
43
    
43
    
44
    
44
    filename = filename + "-" + str(warehouseId) + "-" + str(providerId) + "-" + today + ".xls";
45
    filename = filename + "-" + str(warehouseId) + "-" + str(providerId) + "-" + datestr + ".xls";
45
    
46
    
46
    print filename
47
    print filename
47
    if os.path.exists(filename):
48
    if os.path.exists(filename):
48
        mail(from_user, from_pwd, to_addresses, subject, text, [get_attachment_part(filename)])
49
        mail(from_user, from_pwd, to_addresses, subject, text, [get_attachment_part(filename)])
49
 
50