Subversion Repositories SmartDukaan

Rev

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

Rev 7428 Rev 7429
Line 525... Line 525...
525
    transaction = get_transaction(transaction_id)
525
    transaction = get_transaction(transaction_id)
526
    subject = source_name + " - Order Details"
526
    subject = source_name + " - Order Details"
527
    orders = transaction.orders
527
    orders = transaction.orders
528
    advance_amount = orders[0].advanceAmount
528
    advance_amount = orders[0].advanceAmount
529
    saddress = ""
529
    saddress = ""
-
 
530
    bcc = []
530
    if advance_amount  > 0:
531
    if advance_amount  > 0:
-
 
532
        store = get_hotspot_store(orders[0].storeId)
-
 
533
        bcc = bcc + [store.email, store.approvalEmail.split(';'), "rajveer.singh@shop2020.in", "rajneesh.arora@shop2020.in", "anupam.singh@shop2020.in", "amit.sirohi@shop2020.in", ]
531
        saddress += " at" + __get_hotspot_store_address_html(get_hotspot_store(orders[0].storeId, ""))
534
        saddress += " at" + __get_hotspot_store_address_html(store, "")
532
    otgLink = ""
535
    otgLink = ""
533
    inOrderOtg = "<div>On Time Guarantee<br><span style=color:red>We pay if we delay</span></div>"
536
    inOrderOtg = "<div>On Time Guarantee<br><span style=color:red>We pay if we delay</span></div>"
534
    if len(transaction.orders) == 1:
537
    if len(transaction.orders) == 1:
535
        inOrderOtg = ""
538
        inOrderOtg = ""
536
        if transaction.orders[0].otg :
539
        if transaction.orders[0].otg :
Line 695... Line 698...
695
    sdt = datetime.datetime.strptime(str(orders[0].expected_delivery_time), "%Y-%m-%d %H:%M:%S")
698
    sdt = datetime.datetime.strptime(str(orders[0].expected_delivery_time), "%Y-%m-%d %H:%M:%S")
696
    store_delivery_date = sdt.strftime("%A, %d %B %Y")
699
    store_delivery_date = sdt.strftime("%A, %d %B %Y")
697
 
700
 
698
    email_header = Template(html_header).substitute(dict(order_date = formated_order_date, customer_name = customer_name, source_url = source_url, otgLink = otgLink, saddress = saddress))
701
    email_header = Template(html_header).substitute(dict(order_date = formated_order_date, customer_name = customer_name, source_url = source_url, otgLink = otgLink, saddress = saddress))
699
    email_footer = Template(html_footer).substitute(dict(total_amount = "%.2f" % total_amount, emi_amount = "%.2f" % emi_amount, advance_amount = "%.2f" % advance_amount, net_amount = "%.2f" % (total_amount-order.gvAmount), secret_code = random_text, store_address = store_address, store_delivery_date = store_delivery_date, source_url = source_url, source_name = source_name))
702
    email_footer = Template(html_footer).substitute(dict(total_amount = "%.2f" % total_amount, emi_amount = "%.2f" % emi_amount, advance_amount = "%.2f" % advance_amount, net_amount = "%.2f" % (total_amount-order.gvAmount), secret_code = random_text, store_address = store_address, store_delivery_date = store_delivery_date, source_url = source_url, source_name = source_name))
700
    
703
 
701
    try:
704
    try:
702
        helper_client = HelperClient().get_client()
705
        helper_client = HelperClient().get_client()
703
        helper_client.saveUserEmailForSending([user_email], "", subject, email_header + html_table + email_footer, str(transaction_id), "TransactionInfo", [], [])
706
        helper_client.saveUserEmailForSending([user_email], "", subject, email_header + html_table + email_footer, str(transaction_id), "TransactionInfo", [], bcc)
704
         
707
         
705
        return True
708
        return True
706
    except Exception as e:
709
    except Exception as e:
707
        print e
710
        print e
708
        return False
711
        return False