order preview through customer login
diff --git a/portal/templates/sale.html b/portal/templates/sale.html
index 5dc72c7..c0996cc 100644
--- a/portal/templates/sale.html
+++ b/portal/templates/sale.html
@@ -10,9 +10,9 @@
     	<li class="active"><i class="icon-file icon-fixed-width"></i> {{ doc.name }}</li>
     </ul>
 	<h3><i class="icon-file icon-fixed-width"></i> {{ doc.name }}</h3>
-	{% if doc.name == "Not Allowed" -%}
+	{% if session_user == "Guest" -%}
 		<script>ask_to_login();</script>
-	{% else %}
+	{% elif doc.name != "Not Allowed"%}
 	<hr>
 	<div>
 	<div class="row">
diff --git a/portal/utils.py b/portal/utils.py
index 89800f3..e210f1a 100644
--- a/portal/utils.py
+++ b/portal/utils.py
@@ -41,21 +41,23 @@
 	}
 
 def get_transaction_context(doctype, name):
+	context = {"session_user": webnotes.session.user}
+	
 	customer = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user}, 
 		"customer")
 		
 	bean = webnotes.bean(doctype, name)
 	if bean.doc.customer != customer:
-		return {
-			"doc": {"name": "Not Allowed"}
-		}
+		context.update({"doc": {"name": "Not Allowed"}})
 	else:
-		return {
+		context.update({
 			"doc": bean.doc,
 			"doclist": bean.doclist,
 			"webnotes": webnotes,
 			"utils": webnotes.utils
-		}
+		})
+	
+	return context
 
 @webnotes.whitelist(allow_guest=True)
 def send_message(subject="Website Query", message="", sender="", status="Open"):