Subversion Repositories SmartDukaan

Rev

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

Rev 8006 Rev 8020
Line 475... Line 475...
475
                    content += "<h2>Note 1: If this discount price is approved then reply 'Approved' otherwise 'Not Approved' without changing anythig in the Mail.</h2>"  
475
                    content += "<h2>Note 1: If this discount price is approved then reply 'Approved' otherwise 'Not Approved' without changing anythig in the Mail.</h2>"  
476
                    content += "<h2>Note 2: For Quick approval using browser <a href='http://support.shop2020.in:8080/Support/price-approval?xszbg=" + base64.b64encode(str(order.id))  + "'>Click Here</a></h2>"
476
                    content += "<h2>Note 2: For Quick approval using browser <a href='http://support.shop2020.in:8080/Support/price-approval?xszbg=" + base64.b64encode(str(order.id))  + "'>Click Here</a></h2>"
477
                    content += "<br><br></body></html>"
477
                    content += "<br><br></body></html>"
478
                    store = get_hotspot_store(order.storeId, "")
478
                    store = get_hotspot_store(order.storeId, "")
479
                    helper_client = HelperClient().get_client()
479
                    helper_client = HelperClient().get_client()
480
                    helper_client.saveUserEmailForSending(store.approvalEmail.split(';'), "", "Price approval requested for " + str(order.lineitems[0]) + " order Id " + str(order.id) + " in store " + store.hotspotId , content, str(transaction_id), "PriceApproval", [], [])
480
                    helper_client.saveUserEmailForSending(store.approvalEmail.split(';'), "", "Price approval requested for " + str(order.lineitems[0]) + " order Id " + str(order.id) + " in store " + store.hotspotId , content, str(transaction_id), "PriceApproval", [], [], order.source)
481
                    session.commit()
481
                    session.commit()
482
            else:
482
            else:
483
                order.otg = False
483
                order.otg = False
484
        except Exception as e:
484
        except Exception as e:
485
            print "Error inserting transaction Id: " + str(transaction_id) + " due to " + str(e)
485
            print "Error inserting transaction Id: " + str(transaction_id) + " due to " + str(e)
Line 739... Line 739...
739
    email_header = Template(html_header).substitute(dict(order_date = formated_order_date, customer_name = customer_name, source_url = source_url, otgLink = otgLink, saddress = saddress))
739
    email_header = Template(html_header).substitute(dict(order_date = formated_order_date, customer_name = customer_name, source_url = source_url, otgLink = otgLink, saddress = saddress))
740
    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, amount_string = amount_string))
740
    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, amount_string = amount_string))
741
 
741
 
742
    try:
742
    try:
743
        helper_client = HelperClient().get_client()
743
        helper_client = HelperClient().get_client()
744
        helper_client.saveUserEmailForSending([user_email], "", subject, email_header + html_table + email_footer, str(transaction_id), "TransactionInfo", [], bcc)
744
        helper_client.saveUserEmailForSending([user_email], "", subject, email_header + html_table + email_footer, str(transaction_id), "TransactionInfo", [], bcc, orders[0].source)
745
         
745
         
746
        return True
746
        return True
747
    except Exception as e:
747
    except Exception as e:
748
        print e
748
        print e
749
        return False
749
        return False
Line 854... Line 854...
854
    email_header = Template(html_header).substitute(dict(order_date = formated_order_date, customer_name = customer_name, order_expiry_date = formated_order_expiry_date, source_url = source_url, source_name = source_name))
854
    email_header = Template(html_header).substitute(dict(order_date = formated_order_date, customer_name = customer_name, order_expiry_date = formated_order_expiry_date, source_url = source_url, source_name = source_name))
855
    email_footer = Template(html_footer).substitute(dict(total_amount = "%.2f" % total_amount, net_amount = "%.2f" % (total_amount-order.netAmount), secret_code = random_text, store_address = store_address, order_expiry_date = formated_order_expiry_date, source_url = source_url, source_name = source_name))
855
    email_footer = Template(html_footer).substitute(dict(total_amount = "%.2f" % total_amount, net_amount = "%.2f" % (total_amount-order.netAmount), secret_code = random_text, store_address = store_address, order_expiry_date = formated_order_expiry_date, source_url = source_url, source_name = source_name))
856
    
856
    
857
    try:
857
    try:
858
        helper_client = HelperClient(host_key = "helper_service_server_host_prod").get_client()
858
        helper_client = HelperClient(host_key = "helper_service_server_host_prod").get_client()
859
        helper_client.saveUserEmailForSending([user_email], "", subject, email_header + html_table + email_footer, str(order.id), "ReceivedAtStore", [], [])
859
        helper_client.saveUserEmailForSending([user_email], "", subject, email_header + html_table + email_footer, str(order.id), "ReceivedAtStore", [], [], order.source)
860
        return True
860
        return True
861
    except Exception as e:
861
    except Exception as e:
862
        print e
862
        print e
863
        return False
863
        return False
864
 
864
 
Line 1005... Line 1005...
1005
    email_header = Template(html_header).substitute(dict(order_date = formated_order_date, customer_name = customer_name, pickup_text = pickup_text, source_url = source_url))
1005
    email_header = Template(html_header).substitute(dict(order_date = formated_order_date, customer_name = customer_name, pickup_text = pickup_text, source_url = source_url))
1006
    email_footer = Template(html_footer).substitute(dict(total_amount = "%.2f" % total_amount, source_name = source_name, freebie_text = freebie_text))
1006
    email_footer = Template(html_footer).substitute(dict(total_amount = "%.2f" % total_amount, source_name = source_name, freebie_text = freebie_text))
1007
    
1007
    
1008
    try:
1008
    try:
1009
        helper_client = HelperClient(host_key = "helper_service_server_host_prod").get_client()
1009
        helper_client = HelperClient(host_key = "helper_service_server_host_prod").get_client()
1010
        if order.insurer:
-
 
1011
            helper_client.saveUserEmailForSending([user_email], "", subject, email_header + html_table + email_footer, str(order.id), "DeliverySuccess", [], ["pramit.singh@shop2020.in ","anupam.singh@shop2020.in","rajveer.singh@shop2020.in"])
-
 
1012
        else:
-
 
1013
            helper_client.saveUserEmailForSending([user_email], "", subject, email_header + html_table + email_footer, str(order.id), "DeliverySuccess", [], [])
1010
        helper_client.saveUserEmailForSending([user_email], "", subject, email_header + html_table + email_footer, str(order.id), "DeliverySuccess", [], [], order.source)
1014
        return True
1011
        return True
1015
    except Exception as e:
1012
    except Exception as e:
1016
        print e
1013
        print e
1017
        return False
1014
        return False
1018
 
1015
 
Line 4090... Line 4087...
4090
    # Calling helper service on production
4087
    # Calling helper service on production
4091
    helperClient = HelperClient(host_key = "helper_service_server_host_prod").get_client()
4088
    helperClient = HelperClient(host_key = "helper_service_server_host_prod").get_client()
4092
    try:
4089
    try:
4093
        emailSubject = 'Shipping Details for Order ID: ' + str(order.id)
4090
        emailSubject = 'Shipping Details for Order ID: ' + str(order.id)
4094
        emailBody = get_shipping_confirmation_email_body(order)
4091
        emailBody = get_shipping_confirmation_email_body(order)
4095
        helperClient.saveUserEmailForSending([order.customer_email], None, emailSubject, emailBody, str(order.id), 'ShippingConfirmation', [], [])
4092
        helperClient.saveUserEmailForSending([order.customer_email], None, emailSubject, emailBody, str(order.id), 'ShippingConfirmation', [], [], order.source)
4096
        
4093
        
4097
    except Exception as e:
4094
    except Exception as e:
4098
        print e
4095
        print e
4099
    
4096
    
4100
def get_order_distribution_by_status(start_date, end_date):
4097
def get_order_distribution_by_status(start_date, end_date):
Line 4613... Line 4610...
4613
    email_header = Template(html_header).substitute(dict(order_id = display_order_id, order_date = formated_order_date, email = email, source_url = source_url, order_amount = recharge_order.totalAmount, order_status = status, device_number = deviceNumber, service_provider = providerName, failureReason = failureReason))
4610
    email_header = Template(html_header).substitute(dict(order_id = display_order_id, order_date = formated_order_date, email = email, source_url = source_url, order_amount = recharge_order.totalAmount, order_status = status, device_number = deviceNumber, service_provider = providerName, failureReason = failureReason))
4614
    email_footer = Template(html_footer).substitute(dict(source_url = source_url, source_name = source_name))
4611
    email_footer = Template(html_footer).substitute(dict(source_url = source_url, source_name = source_name))
4615
    
4612
    
4616
    try:
4613
    try:
4617
        helper_client = HelperClient().get_client()
4614
        helper_client = HelperClient().get_client()
4618
        helper_client.saveUserEmailForSending([email], "", source_name + " - Recharge Order Details", email_header + email_footer, str(recharge_order.id), "RechargeInfo", [], [])
4615
        helper_client.saveUserEmailForSending([email], "", source_name + " - Recharge Order Details", email_header + email_footer, str(recharge_order.id), "RechargeInfo", [], [], 1)
4619
        return True
4616
        return True
4620
    except Exception as e:
4617
    except Exception as e:
4621
        print e
4618
        print e
4622
        return False
4619
        return False
4623
 
4620