merge conflict fixed
diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py
index 4d00dfd..c9ca0c2 100644
--- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py
+++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py
@@ -42,7 +42,6 @@
 	def on_submit(self):
 		if self.doc.voucher_type in ['Bank Voucher', 'Contra Voucher', 'Journal Entry']:
 			self.check_credit_days()
-		self.check_account_against_entries()
 		self.make_gl_entries()
 		self.check_credit_limit()
 
@@ -232,14 +231,20 @@
 		for d in self.doclist.get({"parentfield": "entries"}):
 			if d.against_invoice and webnotes.conn.get_value("Sales Invoice", 
 					d.against_invoice, "debit_to") != d.account:
-				webnotes.throw(_("Credited account (Customer) is not matching with Sales Invoice"))
+				webnotes.throw(_("Row #") + cstr(d.idx) +  ": " +
+					_("Account is not matching with Debit To account of Sales Invoice"))
 			
 			if d.against_voucher and webnotes.conn.get_value("Purchase Invoice", 
-						d.against_voucher, "credit_to") != d.account:
-				webnotes.throw(_("Debited account (Supplier) is not matching with Purchase Invoice"))
+					d.against_voucher, "credit_to") != d.account:
+				webnotes.throw(_("Row #") + cstr(d.idx) + ": " +
+					_("Account is not matching with Credit To account of Purchase Invoice"))
 
 	def make_gl_entries(self, cancel=0, adv_adj=0):
 		from erpnext.accounts.general_ledger import make_gl_entries
+		
+		if not cancel:
+			self.check_account_against_entries()
+		
 		gl_map = []
 		for d in self.doclist.get({"parentfield": "entries"}):
 			if d.debit or d.credit:
diff --git a/erpnext/accounts/doctype/pos_setting/pos_setting.js b/erpnext/accounts/doctype/pos_setting/pos_setting.js
index 8c5f254..a1ebb59 100755
--- a/erpnext/accounts/doctype/pos_setting/pos_setting.js
+++ b/erpnext/accounts/doctype/pos_setting/pos_setting.js
@@ -74,5 +74,5 @@
 
 
 cur_frm.fields_dict.user.get_query = function(doc,cdt,cdn) {
-	return{	query:"core.doctype.profile.profile.profile_query"}
+	return{	query:"webnotes.core.doctype.profile.profile.profile_query"}
 }
diff --git a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt
index ad1a9eb..9ae37cf 100644
--- a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt
+++ b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-02-22 01:27:41", 
   "docstatus": 0, 
-  "modified": "2013-12-20 19:21:40", 
+  "modified": "2013-12-31 18:29:19", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -15,7 +15,6 @@
  {
   "doctype": "DocField", 
   "name": "__common__", 
-  "no_copy": 1, 
   "parent": "Sales Invoice Advance", 
   "parentfield": "fields", 
   "parenttype": "DocType", 
@@ -31,6 +30,7 @@
   "fieldtype": "Link", 
   "in_list_view": 1, 
   "label": "Journal Voucher", 
+  "no_copy": 1, 
   "oldfieldname": "journal_voucher", 
   "oldfieldtype": "Link", 
   "options": "Journal Voucher", 
@@ -40,24 +40,11 @@
  }, 
  {
   "doctype": "DocField", 
-  "fieldname": "jv_detail_no", 
-  "fieldtype": "Data", 
-  "hidden": 1, 
-  "in_list_view": 0, 
-  "label": "Journal Voucher Detail No", 
-  "oldfieldname": "jv_detail_no", 
-  "oldfieldtype": "Data", 
-  "print_hide": 1, 
-  "print_width": "120px", 
-  "read_only": 1, 
-  "width": "120px"
- }, 
- {
-  "doctype": "DocField", 
   "fieldname": "advance_amount", 
   "fieldtype": "Currency", 
   "in_list_view": 1, 
   "label": "Advance amount", 
+  "no_copy": 1, 
   "oldfieldname": "advance_amount", 
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
@@ -71,6 +58,7 @@
   "fieldtype": "Currency", 
   "in_list_view": 1, 
   "label": "Allocated amount", 
+  "no_copy": 1, 
   "oldfieldname": "allocated_amount", 
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
@@ -79,14 +67,35 @@
  }, 
  {
   "doctype": "DocField", 
+  "fieldname": "col_break1", 
+  "fieldtype": "Column Break"
+ }, 
+ {
+  "doctype": "DocField", 
   "fieldname": "remarks", 
   "fieldtype": "Small Text", 
   "in_list_view": 1, 
   "label": "Remarks", 
+  "no_copy": 1, 
   "oldfieldname": "remarks", 
   "oldfieldtype": "Small Text", 
   "print_width": "150px", 
   "read_only": 1, 
   "width": "150px"
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "jv_detail_no", 
+  "fieldtype": "Data", 
+  "hidden": 1, 
+  "in_list_view": 0, 
+  "label": "Journal Voucher Detail No", 
+  "no_copy": 1, 
+  "oldfieldname": "jv_detail_no", 
+  "oldfieldtype": "Data", 
+  "print_hide": 1, 
+  "print_width": "120px", 
+  "read_only": 1, 
+  "width": "120px"
  }
 ]
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt
index 339115d..4d7ae0c 100644
--- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt
+++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-06-04 11:02:19", 
   "docstatus": 0, 
-  "modified": "2013-12-20 19:21:40", 
+  "modified": "2013-12-31 18:27:41", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -51,16 +51,6 @@
  }, 
  {
   "doctype": "DocField", 
-  "fieldname": "customer_item_code", 
-  "fieldtype": "Data", 
-  "hidden": 1, 
-  "in_list_view": 0, 
-  "label": "Customer's Item Code", 
-  "print_hide": 1, 
-  "read_only": 1
- }, 
- {
-  "doctype": "DocField", 
   "fieldname": "item_name", 
   "fieldtype": "Data", 
   "in_filter": 0, 
@@ -75,6 +65,21 @@
  }, 
  {
   "doctype": "DocField", 
+  "fieldname": "col_break1", 
+  "fieldtype": "Column Break"
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "customer_item_code", 
+  "fieldtype": "Data", 
+  "hidden": 1, 
+  "in_list_view": 0, 
+  "label": "Customer's Item Code", 
+  "print_hide": 1, 
+  "read_only": 1
+ }, 
+ {
+  "doctype": "DocField", 
   "fieldname": "description", 
   "fieldtype": "Text", 
   "in_list_view": 1, 
@@ -106,15 +111,6 @@
  }, 
  {
   "doctype": "DocField", 
-  "fieldname": "stock_uom", 
-  "fieldtype": "Link", 
-  "in_list_view": 0, 
-  "label": "UOM", 
-  "options": "UOM", 
-  "read_only": 1
- }, 
- {
-  "doctype": "DocField", 
   "fieldname": "ref_rate", 
   "fieldtype": "Currency", 
   "in_list_view": 0, 
@@ -139,6 +135,37 @@
  }, 
  {
   "doctype": "DocField", 
+  "fieldname": "col_break2", 
+  "fieldtype": "Column Break"
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "stock_uom", 
+  "fieldtype": "Link", 
+  "in_list_view": 0, 
+  "label": "UOM", 
+  "options": "UOM", 
+  "read_only": 1
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "base_ref_rate", 
+  "fieldtype": "Currency", 
+  "in_list_view": 0, 
+  "label": "Price List Rate (Company Currency)", 
+  "oldfieldname": "base_ref_rate", 
+  "oldfieldtype": "Currency", 
+  "options": "Company:company:default_currency", 
+  "print_hide": 1, 
+  "read_only": 1
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "section_break1", 
+  "fieldtype": "Section Break"
+ }, 
+ {
+  "doctype": "DocField", 
   "fieldname": "export_rate", 
   "fieldtype": "Currency", 
   "in_list_view": 1, 
@@ -163,15 +190,8 @@
  }, 
  {
   "doctype": "DocField", 
-  "fieldname": "base_ref_rate", 
-  "fieldtype": "Currency", 
-  "in_list_view": 0, 
-  "label": "Price List Rate (Company Currency)", 
-  "oldfieldname": "base_ref_rate", 
-  "oldfieldtype": "Currency", 
-  "options": "Company:company:default_currency", 
-  "print_hide": 1, 
-  "read_only": 1
+  "fieldname": "col_break3", 
+  "fieldtype": "Column Break"
  }, 
  {
   "doctype": "DocField", 
@@ -238,6 +258,11 @@
   "width": "120px"
  }, 
  {
+  "doctype": "DocField", 
+  "fieldname": "col_break4", 
+  "fieldtype": "Column Break"
+ }, 
+ {
   "default": ":Company", 
   "doctype": "DocField", 
   "fieldname": "cost_center", 
@@ -324,6 +349,22 @@
  }, 
  {
   "doctype": "DocField", 
+  "fieldname": "item_tax_rate", 
+  "fieldtype": "Small Text", 
+  "hidden": 1, 
+  "label": "Item Tax Rate", 
+  "oldfieldname": "item_tax_rate", 
+  "oldfieldtype": "Small Text", 
+  "print_hide": 1, 
+  "read_only": 1
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "col_break5", 
+  "fieldtype": "Column Break"
+ }, 
+ {
+  "doctype": "DocField", 
   "fieldname": "actual_qty", 
   "fieldtype": "Float", 
   "label": "Available Qty at Warehouse", 
@@ -334,13 +375,11 @@
  }, 
  {
   "doctype": "DocField", 
-  "fieldname": "delivered_qty", 
-  "fieldtype": "Float", 
-  "label": "Delivered Qty", 
-  "oldfieldname": "delivered_qty", 
-  "oldfieldtype": "Currency", 
-  "print_hide": 1, 
-  "read_only": 1
+  "fieldname": "time_log_batch", 
+  "fieldtype": "Link", 
+  "label": "Time Log Batch", 
+  "options": "Time Log Batch", 
+  "read_only": 0
  }, 
  {
   "doctype": "DocField", 
@@ -400,20 +439,11 @@
  }, 
  {
   "doctype": "DocField", 
-  "fieldname": "time_log_batch", 
-  "fieldtype": "Link", 
-  "label": "Time Log Batch", 
-  "options": "Time Log Batch", 
-  "read_only": 0
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "item_tax_rate", 
-  "fieldtype": "Small Text", 
-  "hidden": 1, 
-  "label": "Item Tax Rate", 
-  "oldfieldname": "item_tax_rate", 
-  "oldfieldtype": "Small Text", 
+  "fieldname": "delivered_qty", 
+  "fieldtype": "Float", 
+  "label": "Delivered Qty", 
+  "oldfieldname": "delivered_qty", 
+  "oldfieldtype": "Currency", 
   "print_hide": 1, 
   "read_only": 1
  }, 
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt
index f3c41a6..8bb154c 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt
@@ -48,6 +48,24 @@
  }, 
  {
   "doctype": "DocField", 
+  "fieldname": "description", 
+  "fieldtype": "Small Text", 
+  "in_list_view": 1, 
+  "label": "Description", 
+  "oldfieldname": "description", 
+  "oldfieldtype": "Small Text", 
+  "print_width": "300px", 
+  "reqd": 1, 
+  "width": "300px"
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "col_break_1", 
+  "fieldtype": "Column Break", 
+  "width": "50%"
+ }, 
+ {
+  "doctype": "DocField", 
   "fieldname": "account_head", 
   "fieldtype": "Link", 
   "in_list_view": 0, 
@@ -71,36 +89,6 @@
  }, 
  {
   "doctype": "DocField", 
-  "fieldname": "description", 
-  "fieldtype": "Small Text", 
-  "in_list_view": 1, 
-  "label": "Description", 
-  "oldfieldname": "description", 
-  "oldfieldtype": "Small Text", 
-  "print_width": "300px", 
-  "reqd": 1, 
-  "width": "300px"
- }, 
- {
-  "allow_on_submit": 0, 
-  "description": "If checked, the tax amount will be considered as already included in the Print Rate / Print Amount", 
-  "doctype": "DocField", 
-  "fieldname": "included_in_print_rate", 
-  "fieldtype": "Check", 
-  "label": "Is this Tax included in Basic Rate?", 
-  "no_copy": 0, 
-  "print_hide": 1, 
-  "print_width": "150px", 
-  "report_hide": 1, 
-  "width": "150px"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "section_break_6", 
-  "fieldtype": "Section Break"
- }, 
- {
-  "doctype": "DocField", 
   "fieldname": "rate", 
   "fieldtype": "Float", 
   "in_list_view": 1, 
@@ -132,6 +120,19 @@
   "read_only": 1
  }, 
  {
+  "allow_on_submit": 0, 
+  "description": "If checked, the tax amount will be considered as already included in the Print Rate / Print Amount", 
+  "doctype": "DocField", 
+  "fieldname": "included_in_print_rate", 
+  "fieldtype": "Check", 
+  "label": "Is this Tax included in Basic Rate?", 
+  "no_copy": 0, 
+  "print_hide": 1, 
+  "print_width": "150px", 
+  "report_hide": 1, 
+  "width": "150px"
+ }, 
+ {
   "doctype": "DocField", 
   "fieldname": "tax_amount_after_discount_amount", 
   "fieldtype": "Currency", 
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py
index 64bf6c6..82412c6 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py
@@ -14,9 +14,4 @@
 				(self.doc.name, self.doc.company))
 				
 		# at least one territory
-		self.validate_table_has_rows("valid_for_territories")
-		
-	def on_update(self):
-		cart_settings = webnotes.get_obj("Shopping Cart Settings")
-		if cint(cart_settings.doc.enabled):
-			cart_settings.validate_tax_masters()
\ No newline at end of file
+		self.validate_table_has_rows("valid_for_territories")
\ No newline at end of file
diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.py b/erpnext/accounts/report/accounts_payable/accounts_payable.py
index 070148b..adb126b 100644
--- a/erpnext/accounts/report/accounts_payable/accounts_payable.py
+++ b/erpnext/accounts/report/accounts_payable/accounts_payable.py
@@ -19,8 +19,8 @@
 		for gle in get_gl_entries(filters, before_report_date=False)]
 	
 	account_supplier_type_map = get_account_supplier_type_map()
-	pi_map = get_pi_map()
-
+	voucher_detail_map = get_voucher_details()
+	
 	# Age of the invoice on this date
 	age_on = getdate(filters.get("report_date")) > getdate(nowdate()) \
 		and nowdate() or filters.get("report_date")
@@ -29,14 +29,8 @@
 	for gle in entries:
 		if cstr(gle.against_voucher) == gle.voucher_no or not gle.against_voucher \
 				or [gle.against_voucher_type, gle.against_voucher] in entries_after_report_date:
-			if gle.voucher_type == "Purchase Invoice":
-				pi_info = pi_map.get(gle.voucher_no)
-				due_date = pi_info.get("due_date")
-				bill_no = pi_info.get("bill_no")
-				bill_date = pi_info.get("bill_date")
-			else:
-				due_date = bill_no = bill_date = ""
-		
+			voucher_details = voucher_detail_map.get(gle.voucher_type, {}).get(gle.voucher_no, {})
+			
 			invoiced_amount = gle.credit > 0 and gle.credit or 0
 			outstanding_amount = get_outstanding_amount(gle, 
 				filters.get("report_date") or nowdate())
@@ -44,13 +38,15 @@
 			if abs(flt(outstanding_amount)) > 0.01:
 				paid_amount = invoiced_amount - outstanding_amount
 				row = [gle.posting_date, gle.account, account_supplier.get(gle.account, ""),
-					gle.voucher_type, gle.voucher_no, 
-					gle.remarks, account_supplier_type_map.get(gle.account), due_date, bill_no, 
-					bill_date, invoiced_amount, paid_amount, outstanding_amount]
+					gle.voucher_type, gle.voucher_no, gle.remarks, 
+					account_supplier_type_map.get(gle.account), 
+					voucher_details.get("due_date", ""), voucher_details.get("bill_no", ""), 
+					voucher_details.get("bill_date", ""), invoiced_amount, 
+					paid_amount, outstanding_amount]
 				
 				# Ageing
 				if filters.get("ageing_based_on") == "Due Date":
-					ageing_based_on_date = due_date
+					ageing_based_on_date = voucher_details.get("due_date", "")
 				else:
 					ageing_based_on_date = gle.posting_date
 					
@@ -111,14 +107,15 @@
 		
 	return account_supplier_type_map
 	
-def get_pi_map():
-	""" get due_date from sales invoice """
-	pi_map = {}
-	for t in webnotes.conn.sql("""select name, due_date, bill_no, bill_date 
-			from `tabPurchase Invoice`""", as_dict=1):
-		pi_map[t.name] = t
+def get_voucher_details():
+	voucher_details = {}
+	for dt in ["Purchase Invoice", "Journal Voucher"]:
+		voucher_details.setdefault(dt, webnotes._dict())
+		for t in webnotes.conn.sql("""select name, due_date, bill_no, bill_date 
+				from `tab%s`""" % dt, as_dict=1):
+			voucher_details[dt].setdefault(t.name, t)
 		
-	return pi_map
+	return voucher_details
 
 def get_outstanding_amount(gle, report_date):
 	payment_amount = webnotes.conn.sql("""
diff --git a/erpnext/accounts/report/accounts_payable/general_ledger/general_ledger.py b/erpnext/accounts/report/accounts_payable/general_ledger/general_ledger.py
deleted file mode 100644
index 575ccda..0000000
--- a/erpnext/accounts/report/accounts_payable/general_ledger/general_ledger.py
+++ /dev/null
@@ -1,111 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-from webnotes.utils import flt, add_days
-from webnotes import _
-from erpnext.accounts.utils import get_balance_on
-
-def execute(filters=None):
-	account_details = webnotes.conn.get_value("Account", filters["account"], 
-		["debit_or_credit", "group_or_ledger"], as_dict=True) if filters.get("account") else None
-	validate_filters(filters, account_details)
-	
-	columns = get_columns()
-	data = []
-	if filters.get("group_by"):
-		data += get_grouped_gle(filters)
-	else:
-		data += get_gl_entries(filters)
-		if data:
-			data.append(get_total_row(data))
-
-	if account_details:
-		data = [get_opening_balance_row(filters, account_details.debit_or_credit)] + data + \
-			[get_closing_balance_row(filters, account_details.debit_or_credit)]
-
-	return columns, data
-	
-def validate_filters(filters, account_details):
-	if account_details and account_details.group_or_ledger == "Ledger" \
-			and filters.get("group_by") == "Group by Account":
-		webnotes.throw(_("Can not filter based on Account, if grouped by Account"))
-		
-	if filters.get("voucher_no") and filters.get("group_by") == "Group by Voucher":
-		webnotes.throw(_("Can not filter based on Voucher No, if grouped by Voucher"))
-	
-def get_columns():
-	return ["Posting Date:Date:100", "Account:Link/Account:200", "Debit:Float:100", 
-		"Credit:Float:100", "Voucher Type::120", "Voucher No::160", "Link::20", 
-		"Cost Center:Link/Cost Center:100", "Remarks::200"]
-		
-def get_opening_balance_row(filters, debit_or_credit):
-	opening_balance = get_balance_on(filters["account"], add_days(filters["from_date"], -1))
-	return get_balance_row(opening_balance, debit_or_credit, "Opening Balance")
-	
-def get_closing_balance_row(filters, debit_or_credit):
-	closing_balance = get_balance_on(filters["account"], filters["to_date"])
-	return get_balance_row(closing_balance, debit_or_credit, "Closing Balance")
-	
-def get_balance_row(balance, debit_or_credit, balance_label):
-	if debit_or_credit == "Debit":
-		return ["", balance_label, balance, 0.0, "", "", ""]
-	else:
-		return ["", balance_label, 0.0, balance, "", "", ""]
-		
-def get_gl_entries(filters):
-	gl_entries = webnotes.conn.sql("""select 
-			posting_date, account, debit, credit, voucher_type, voucher_no, cost_center, remarks 
-		from `tabGL Entry`
-		where company=%(company)s 
-			and posting_date between %(from_date)s and %(to_date)s
-			{conditions}
-		order by posting_date, account"""\
-		.format(conditions=get_conditions(filters)), filters, as_list=1)
-		
-	for d in gl_entries:
-		icon = """<a href="%s"><i class="icon icon-share" style="cursor: pointer;"></i></a>""" \
-			% ("/".join(["#Form", d[4], d[5]]),)
-		d.insert(6, icon)
-		
-	return gl_entries
-			
-def get_conditions(filters):
-	conditions = []
-	if filters.get("account"):
-		lft, rgt = webnotes.conn.get_value("Account", filters["account"], ["lft", "rgt"])
-		conditions.append("""account in (select name from tabAccount 
-			where lft>=%s and rgt<=%s and docstatus<2)""" % (lft, rgt))
-	if filters.get("voucher_no"):
-		conditions.append("voucher_no=%(voucher_no)s")
-	
-	return "and {}".format(" and ".join(conditions)) if conditions else ""
-		
-def get_grouped_gle(filters):
-	gle_map = {}
-	gle = get_gl_entries(filters)
-	for d in gle:
-		gle_map.setdefault(d[1 if filters["group_by"]=="Group by Account" else 5], []).append(d)
-		
-	data = []
-	for entries in gle_map.values():
-		subtotal_debit = subtotal_credit = 0.0
-		for entry in entries:
-			data.append(entry)
-			subtotal_debit += flt(entry[2])
-			subtotal_credit += flt(entry[3])
-		
-		data.append(["", "Total", subtotal_debit, subtotal_credit, "", "", ""])
-	
-	if data:
-		data.append(get_total_row(gle))
-	return data
-	
-def get_total_row(gle):
-	total_debit = total_credit = 0.0
-	for d in gle:
-		total_debit += flt(d[2])
-		total_credit += flt(d[3])
-		
-	return ["", "Total Debit/Credit", total_debit, total_credit, "", "", ""]
\ No newline at end of file
diff --git a/erpnext/accounts/report/accounts_payable/general_ledger/__init__.py b/erpnext/accounts/report/general_ledger/__init__.py
similarity index 100%
rename from erpnext/accounts/report/accounts_payable/general_ledger/__init__.py
rename to erpnext/accounts/report/general_ledger/__init__.py
diff --git a/erpnext/accounts/report/accounts_payable/general_ledger/general_ledger.js b/erpnext/accounts/report/general_ledger/general_ledger.js
similarity index 67%
rename from erpnext/accounts/report/accounts_payable/general_ledger/general_ledger.js
rename to erpnext/accounts/report/general_ledger/general_ledger.js
index 7985277..96682f9 100644
--- a/erpnext/accounts/report/accounts_payable/general_ledger/general_ledger.js
+++ b/erpnext/accounts/report/general_ledger/general_ledger.js
@@ -12,26 +12,6 @@
 			"reqd": 1
 		},
 		{
-			"fieldname":"account",
-			"label": wn._("Account"),
-			"fieldtype": "Link",
-			"options": "Account"
-		},
-		{
-			"fieldname":"voucher_no",
-			"label": wn._("Voucher No"),
-			"fieldtype": "Data",
-		},
-		{
-			"fieldname":"group_by",
-			"label": wn._("Group by"),
-			"fieldtype": "Select",
-			"options": "\nGroup by Account\nGroup by Voucher"
-		},
-		{
-			"fieldtype": "Break",
-		},
-		{
 			"fieldname":"from_date",
 			"label": wn._("From Date"),
 			"fieldtype": "Date",
@@ -46,6 +26,40 @@
 			"default": wn.datetime.get_today(),
 			"reqd": 1,
 			"width": "60px"
+		},
+		{
+			"fieldtype": "Break",
+		},
+		{
+			"fieldname":"account",
+			"label": wn._("Account"),
+			"fieldtype": "Link",
+			"options": "Account",
+			"get_query": function() {
+				var company = wn.query_report.filters_by_name.company.get_value();
+				return {
+					"doctype": "Account", 
+					"filters": {
+						"company": company,
+					}
+				}
+			}
+		},
+		{
+			"fieldname":"voucher_no",
+			"label": wn._("Voucher No"),
+			"fieldtype": "Data",
+		},
+		{
+			"fieldname":"group_by_voucher",
+			"label": wn._("Group by Voucher"),
+			"fieldtype": "Check",
+			"default": 1
+		},
+		{
+			"fieldname":"group_by_account",
+			"label": wn._("Group by Account"),
+			"fieldtype": "Check",
 		}
 	]
 }
\ No newline at end of file
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py
new file mode 100644
index 0000000..acfe6a0
--- /dev/null
+++ b/erpnext/accounts/report/general_ledger/general_ledger.py
@@ -0,0 +1,172 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+from webnotes.utils import cstr, flt
+from webnotes import _
+
+def execute(filters=None):
+	account_details = {}
+	for acc in webnotes.conn.sql("""select name, debit_or_credit, group_or_ledger 
+		from tabAccount""", as_dict=1):
+			account_details.setdefault(acc.name, acc)
+	
+	validate_filters(filters, account_details)
+	
+	columns = get_columns()
+	
+	res = get_result(filters, account_details)
+
+	return columns, res
+	
+def validate_filters(filters, account_details):
+	if filters.get("account") and filters.get("group_by_account") \
+			and account_details[filters.account].group_or_ledger == "Ledger":
+		webnotes.throw(_("Can not filter based on Account, if grouped by Account"))
+		
+	if filters.get("voucher_no") and filters.get("group_by_voucher"):
+		webnotes.throw(_("Can not filter based on Voucher No, if grouped by Voucher"))
+		
+	if filters.from_date > filters.to_date:
+		webnotes.throw(_("From Date must be before To Date"))
+	
+def get_columns():
+	return ["Posting Date:Date:100", "Account:Link/Account:200", "Debit:Float:100", 
+		"Credit:Float:100", "Voucher Type::120", "Voucher No::160", "Link::20", 
+		"Against Account::120", "Cost Center:Link/Cost Center:100", "Remarks::200"]
+		
+def get_result(filters, account_details):	
+	gl_entries = get_gl_entries(filters)
+
+	data = get_data_with_opening_closing(filters, account_details, gl_entries)
+		
+	result = get_result_as_list(data)
+
+	return result
+	
+def get_gl_entries(filters):
+	group_by_condition = "group by voucher_type, voucher_no, account" \
+		if filters.get("group_by_voucher") else "group by name"
+		
+	gl_entries = webnotes.conn.sql("""select posting_date, account, 
+			sum(ifnull(debit, 0)) as debit, sum(ifnull(credit, 0)) as credit, 
+			voucher_type, voucher_no, cost_center, remarks, is_advance, against 
+		from `tabGL Entry`
+		where company=%(company)s {conditions}
+		{group_by_condition}
+		order by posting_date, account"""\
+		.format(conditions=get_conditions(filters), group_by_condition=group_by_condition), 
+		filters, as_dict=1)
+		
+	return gl_entries
+	
+def get_conditions(filters):
+	conditions = []
+	if filters.get("account"):
+		lft, rgt = webnotes.conn.get_value("Account", filters["account"], ["lft", "rgt"])
+		conditions.append("""account in (select name from tabAccount 
+			where lft>=%s and rgt<=%s and docstatus<2)""" % (lft, rgt))
+	else:
+		conditions.append("posting_date between %(from_date)s and %(to_date)s")
+		
+	if filters.get("voucher_no"):
+		conditions.append("voucher_no=%(voucher_no)s")
+	
+	return "and {}".format(" and ".join(conditions)) if conditions else ""
+
+def get_data_with_opening_closing(filters, account_details, gl_entries):
+	data = []
+	gle_map = initialize_gle_map(gl_entries)
+	
+	opening, total_debit, total_credit, gle_map = get_accountwise_gle(filters, gl_entries, gle_map)
+	
+	# Opening for filtered account
+	if filters.get("account"):
+		data += [get_balance_row("Opening", account_details[filters.account].debit_or_credit, 
+			opening), {}]
+
+	for acc, acc_dict in gle_map.items():
+		if acc_dict.entries:
+			# Opening for individual ledger, if grouped by account
+			if filters.get("group_by_account"):
+				data.append(get_balance_row("Opening", account_details[acc].debit_or_credit, 
+					acc_dict.opening))
+
+			data += acc_dict.entries
+			
+			# Totals and closing for individual ledger, if grouped by account
+			if filters.get("group_by_account"):
+				data += [{"account": "Totals", "debit": acc_dict.total_debit, 
+					"credit": acc_dict.total_credit}, 
+					get_balance_row("Closing (Opening + Totals)", 
+						account_details[acc].debit_or_credit, (acc_dict.opening 
+						+ acc_dict.total_debit - acc_dict.total_credit)), {}]
+						
+	# Total debit and credit between from and to date	
+	if total_debit or total_credit:
+		data.append({"account": "Totals", "debit": total_debit, "credit": total_credit})
+	
+	# Closing for filtered account
+	if filters.get("account"):
+		data.append(get_balance_row("Closing (Opening + Totals)", 
+			account_details[filters.account].debit_or_credit, 
+			(opening + total_debit - total_credit)))
+	
+	return data
+
+def initialize_gle_map(gl_entries):
+	gle_map = webnotes._dict()
+	for gle in gl_entries:
+		gle_map.setdefault(gle.account, webnotes._dict({
+			"opening": 0,
+			"entries": [],
+			"total_debit": 0,
+			"total_credit": 0,
+			"closing": 0
+		}))
+	return gle_map
+
+def get_accountwise_gle(filters, gl_entries, gle_map):
+	opening, total_debit, total_credit = 0, 0, 0
+	
+	for gle in gl_entries:
+		amount = flt(gle.debit) - flt(gle.credit)
+		if filters.get("account") and (gle.posting_date < filters.from_date 
+				or cstr(gle.is_advance) == "Yes"):
+			gle_map[gle.account].opening += amount
+			opening += amount
+		elif gle.posting_date < filters.to_date:
+			gle_map[gle.account].entries.append(gle)
+			gle_map[gle.account].total_debit += flt(gle.debit)
+			gle_map[gle.account].total_credit += flt(gle.credit)
+			
+			total_debit += flt(gle.debit)
+			total_credit += flt(gle.credit)
+			
+	return opening, total_debit, total_credit, gle_map
+
+def get_balance_row(label, debit_or_credit, balance):
+	return {
+		"account": label,
+		"debit": balance if debit_or_credit=="Debit" else 0,
+		"credit": -1*balance if debit_or_credit=="Credit" else 0,
+	}
+	
+def get_result_as_list(data):
+	result = []
+	for d in data:
+		result.append([d.get("posting_date"), d.get("account"), d.get("debit"), 
+			d.get("credit"), d.get("voucher_type"), d.get("voucher_no"), 
+			get_voucher_link(d.get("voucher_type"), d.get("voucher_no")), 
+			d.get("against"), d.get("cost_center"), d.get("remarks")])
+	
+	return result
+	
+def get_voucher_link(voucher_type, voucher_no):
+	icon = ""
+	if voucher_type and voucher_no:
+		icon = """<a href="%s"><i class="icon icon-share" style="cursor: pointer;">
+			</i></a>""" % ("/".join(["#Form", voucher_type, voucher_no]))
+		
+	return icon
diff --git a/erpnext/accounts/report/accounts_payable/general_ledger/general_ledger.txt b/erpnext/accounts/report/general_ledger/general_ledger.txt
similarity index 100%
rename from erpnext/accounts/report/accounts_payable/general_ledger/general_ledger.txt
rename to erpnext/accounts/report/general_ledger/general_ledger.txt
diff --git a/erpnext/hooks.txt b/erpnext/hooks.txt
index 8cda9a6..9d4291b 100644
--- a/erpnext/hooks.txt
+++ b/erpnext/hooks.txt
@@ -21,7 +21,6 @@
 mail_footer = erpnext.startup.mail_footer
 
 on_session_creation = erpnext.startup.event_handlers.on_session_creation
-on_logout = erpnext.startup.event_handlers.on_logut
 
 # Boot Events
 # -------------------------
@@ -37,7 +36,6 @@
 bean_event = Stock Entry:on_submit:erpnext.stock.doctype.material_request.material_request.update_completed_qty
 bean_event = Stock Entry:on_cancel:erpnext.stock.doctype.material_request.material_request.update_completed_qty
 
-standard_queries = Warehouse:erpnext.stock.utils.get_warehouse_list
 standard_queries = Customer:erpnext.selling.utils.get_customer_list
 
 # Schedulers
diff --git a/erpnext/hr/doctype/employee/employee.js b/erpnext/hr/doctype/employee/employee.js
index 1df6175..23d5067 100644
--- a/erpnext/hr/doctype/employee/employee.js
+++ b/erpnext/hr/doctype/employee/employee.js
@@ -5,7 +5,7 @@
 erpnext.hr.EmployeeController = wn.ui.form.Controller.extend({
 	setup: function() {
 		this.frm.fields_dict.user_id.get_query = function(doc,cdt,cdn) {
-				return { query:"core.doctype.profile.profile.profile_query"} }
+				return { query:"webnotes.core.doctype.profile.profile.profile_query"} }
 		this.frm.fields_dict.reports_to.get_query = function(doc,cdt,cdn) {	
 			return{	query: "erpnext.controllers.queries.employee_query"}	}
 	},
diff --git a/erpnext/patches/june_2013/p08_shopping_cart_settings.py b/erpnext/patches/june_2013/p08_shopping_cart_settings.py
deleted file mode 100644
index 45028c8..0000000
--- a/erpnext/patches/june_2013/p08_shopping_cart_settings.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-import webnotes
-
-def execute():
-	webnotes.reload_doc("selling", "doctype", "shopping_cart_settings")
-	
-	# create two default territories, one for home country and one named Rest of the World
-	from erpnext.setup.page.setup_wizard.setup_wizard import create_territories
-	create_territories()
-	
-	webnotes.conn.set_value("Shopping Cart Settings", None, "default_territory", "Rest of the World")
-	
\ No newline at end of file
diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py
index 3f7cf5b..002e3c7 100644
--- a/erpnext/patches/patch_list.py
+++ b/erpnext/patches/patch_list.py
@@ -161,7 +161,6 @@
 	"execute:webnotes.delete_doc('Report', 'Sales Orders Pending To Be Delivered')",
 	"patches.june_2013.p05_remove_unused_doctypes",
 	"patches.june_2013.p06_drop_unused_tables",
-	"patches.june_2013.p08_shopping_cart_settings",
 	"patches.june_2013.p09_update_global_defaults",
 	"patches.june_2013.p10_lead_address",
 	"patches.july_2013.p01_remove_doctype_mappers",
diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.py b/erpnext/projects/doctype/time_log_batch/time_log_batch.py
index ccb0a25..593dc22 100644
--- a/erpnext/projects/doctype/time_log_batch/time_log_batch.py
+++ b/erpnext/projects/doctype/time_log_batch/time_log_batch.py
@@ -28,7 +28,7 @@
 		})
 
 	def validate_time_log_is_submitted(self, tl):
-		if tl.status != "Submitted":
+		if tl.status != "Submitted" and self.doc.docstatus == 0:
 			webnotes.msgprint(_("Time Log must have status 'Submitted'") + \
 				" :" + tl.name + " (" + _(tl.status) + ")", raise_exception=True)
 	
@@ -57,7 +57,4 @@
 			tl = webnotes.bean("Time Log", d.time_log)
 			tl.doc.time_log_batch = time_log_batch
 			tl.doc.sales_invoice = self.doc.sales_invoice
-			tl.update_after_submit()
-		
-
-		
\ No newline at end of file
+			tl.update_after_submit()
\ No newline at end of file
diff --git a/erpnext/public/js/controllers/accounts.js b/erpnext/public/js/controllers/accounts.js
index 201c47e..789d72b 100644
--- a/erpnext/public/js/controllers/accounts.js
+++ b/erpnext/public/js/controllers/accounts.js
@@ -8,7 +8,7 @@
 	} else if(d.account_head && d.charge_type!=="Actual") {
 		wn.call({
 			type:"GET",
-			method: "controllers.accounts_controller.get_tax_rate", 
+			method: "erpnext.controllers.accounts_controller.get_tax_rate", 
 			args: {"account_head":d.account_head},
 			callback: function(r) {
 			  wn.model.set_value(cdt, cdn, "rate", r.message || 0);
diff --git a/erpnext/public/js/queries.js b/erpnext/public/js/queries.js
index 621e340..dbaa27d 100644
--- a/erpnext/public/js/queries.js
+++ b/erpnext/public/js/queries.js
@@ -5,7 +5,7 @@
 wn.provide("erpnext.queries");
 $.extend(erpnext.queries, {
 	profile: function() {
-		return { query: "core.doctype.profile.profile.profile_query" };
+		return { query: "webnotes.core.doctype.profile.profile.profile_query" };
 	},
 	
 	lead: function() {
diff --git a/erpnext/public/js/website_utils.js b/erpnext/public/js/website_utils.js
index fda30b8..1c797dc 100644
--- a/erpnext/public/js/website_utils.js
+++ b/erpnext/public/js/website_utils.js
@@ -1,14 +1,14 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-if(!window.erpnext) erpnext = {};
+if(!window.erpnext) window.erpnext = {};
 
 // Add / update a new Lead / Communication
 // subject, sender, description
 wn.send_message = function(opts, btn) {
 	return wn.call({
 		type: "POST",
-		method: "erpnext.portal.utils.send_message",
+		method: "erpnext.templates.utils.send_message",
 		btn: btn,
 		args: opts,
 		callback: opts.callback
@@ -16,71 +16,4 @@
 };
 
 // for backward compatibility
-erpnext.send_message = wn.send_message;
-
-// Setup the user tools
-//
-$(document).ready(function() {
-	// update login
-	erpnext.cart.set_cart_count();
-	
-	// update profile
-	if(full_name) {
-		$('.navbar li[data-label="Profile"] a')
-			.html('<i class="icon-fixed-width icon-user"></i> ' + full_name);
-	}
-	
-});
-
-// shopping cart
-if(!erpnext.cart) erpnext.cart = {};
-
-$.extend(erpnext.cart, {
-	update_cart: function(opts) {
-		if(!full_name) {
-			if(localStorage) {
-				localStorage.setItem("last_visited", window.location.href.split("/").slice(-1)[0]);
-				localStorage.setItem("pending_add_to_cart", opts.item_code);
-			}
-			window.location.href = "login";
-		} else {
-			return wn.call({
-				type: "POST",
-				method: "erpnext.selling.utils.cart.update_cart",
-				args: {
-					item_code: opts.item_code,
-					qty: opts.qty,
-					with_doclist: opts.with_doclist
-				},
-				btn: opts.btn,
-				callback: function(r) {
-					if(opts.callback)
-						opts.callback(r);
-					
-					erpnext.cart.set_cart_count();
-				}
-			});
-		}
-	},
-	
-	set_cart_count: function() {
-		var cart_count = getCookie("cart_count");
-		var $cart = $("#website-post-login").find('[data-label="Cart"]');
-		var $badge = $cart.find(".badge");
-		var $cog = $("#website-post-login").find(".dropdown-toggle");
-		var $cog_count = $cog.find(".cart-count");
-		if(cart_count) {
-			if($badge.length === 0) {
-				var $badge = $('<span class="badge pull-right"></span>').appendTo($cart.find("a"));
-			}
-			$badge.html(cart_count);
-			if($cog_count.length === 0) {
-				var $cog_count = $('<sup class="cart-count"></span>').insertAfter($cog.find(".icon-cog"));
-			}
-			$cog_count.html(cart_count);
-		} else {
-			$badge.remove();
-			$cog_count.remove();
-		}
-	}
-});
\ No newline at end of file
+erpnext.send_message = wn.send_message;
\ No newline at end of file
diff --git a/erpnext/selling/doctype/lead/lead.js b/erpnext/selling/doctype/lead/lead.js
index 4ab1067..41f679e 100644
--- a/erpnext/selling/doctype/lead/lead.js
+++ b/erpnext/selling/doctype/lead/lead.js
@@ -14,12 +14,12 @@
 	onload: function() {
 		if(cur_frm.fields_dict.lead_owner.df.options.match(/^Profile/)) {
 			cur_frm.fields_dict.lead_owner.get_query = function(doc,cdt,cdn) {
-				return { query:"core.doctype.profile.profile.profile_query" } }
+				return { query:"webnotes.core.doctype.profile.profile.profile_query" } }
 		}
 
 		if(cur_frm.fields_dict.contact_by.df.options.match(/^Profile/)) {
 			cur_frm.fields_dict.contact_by.get_query = function(doc,cdt,cdn) {
-				return { query:"core.doctype.profile.profile.profile_query" } }
+				return { query:"webnotes.core.doctype.profile.profile.profile_query" } }
 		}
 
 		if(in_list(user_roles,'System Manager')) {
diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.txt b/erpnext/selling/doctype/quotation_item/quotation_item.txt
index e669937..531f005 100644
--- a/erpnext/selling/doctype/quotation_item/quotation_item.txt
+++ b/erpnext/selling/doctype/quotation_item/quotation_item.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-03-07 11:42:57", 
   "docstatus": 0, 
-  "modified": "2013-12-20 19:23:41", 
+  "modified": "2013-12-31 18:12:09", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -71,6 +71,11 @@
  }, 
  {
   "doctype": "DocField", 
+  "fieldname": "col_break1", 
+  "fieldtype": "Column Break"
+ }, 
+ {
+  "doctype": "DocField", 
   "fieldname": "description", 
   "fieldtype": "Small Text", 
   "in_list_view": 1, 
@@ -108,21 +113,6 @@
  }, 
  {
   "doctype": "DocField", 
-  "fieldname": "stock_uom", 
-  "fieldtype": "Link", 
-  "in_list_view": 0, 
-  "label": "UOM", 
-  "oldfieldname": "stock_uom", 
-  "oldfieldtype": "Data", 
-  "options": "UOM", 
-  "print_hide": 0, 
-  "print_width": "100px", 
-  "read_only": 1, 
-  "reqd": 0, 
-  "width": "100px"
- }, 
- {
-  "doctype": "DocField", 
   "fieldname": "ref_rate", 
   "fieldtype": "Currency", 
   "in_list_view": 0, 
@@ -151,6 +141,45 @@
  }, 
  {
   "doctype": "DocField", 
+  "fieldname": "col_break2", 
+  "fieldtype": "Column Break"
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "stock_uom", 
+  "fieldtype": "Link", 
+  "in_list_view": 0, 
+  "label": "UOM", 
+  "oldfieldname": "stock_uom", 
+  "oldfieldtype": "Data", 
+  "options": "UOM", 
+  "print_hide": 0, 
+  "print_width": "100px", 
+  "read_only": 1, 
+  "reqd": 0, 
+  "width": "100px"
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "base_ref_rate", 
+  "fieldtype": "Currency", 
+  "in_list_view": 0, 
+  "label": "Price List Rate (Company Currency)", 
+  "oldfieldname": "base_ref_rate", 
+  "oldfieldtype": "Currency", 
+  "options": "Company:company:default_currency", 
+  "print_hide": 1, 
+  "print_width": "100px", 
+  "read_only": 1, 
+  "width": "100px"
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "Section_break1", 
+  "fieldtype": "Section Break"
+ }, 
+ {
+  "doctype": "DocField", 
   "fieldname": "export_rate", 
   "fieldtype": "Currency", 
   "in_filter": 0, 
@@ -185,17 +214,8 @@
  }, 
  {
   "doctype": "DocField", 
-  "fieldname": "base_ref_rate", 
-  "fieldtype": "Currency", 
-  "in_list_view": 0, 
-  "label": "Price List Rate (Company Currency)", 
-  "oldfieldname": "base_ref_rate", 
-  "oldfieldtype": "Currency", 
-  "options": "Company:company:default_currency", 
-  "print_hide": 1, 
-  "print_width": "100px", 
-  "read_only": 1, 
-  "width": "100px"
+  "fieldname": "col_break3", 
+  "fieldtype": "Column Break"
  }, 
  {
   "doctype": "DocField", 
@@ -239,6 +259,70 @@
   "label": "Reference"
  }, 
  {
+  "doctype": "DocField", 
+  "fieldname": "prevdoc_doctype", 
+  "fieldtype": "Data", 
+  "hidden": 1, 
+  "in_list_view": 0, 
+  "label": "Against Doctype", 
+  "no_copy": 1, 
+  "oldfieldname": "prevdoc_doctype", 
+  "oldfieldtype": "Data", 
+  "print_hide": 1, 
+  "print_width": "150px", 
+  "read_only": 1, 
+  "report_hide": 0, 
+  "width": "150px"
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "prevdoc_docname", 
+  "fieldtype": "Data", 
+  "in_list_view": 0, 
+  "label": "Against Docname", 
+  "no_copy": 1, 
+  "oldfieldname": "prevdoc_docname", 
+  "oldfieldtype": "Data", 
+  "print_hide": 1, 
+  "print_width": "150px", 
+  "read_only": 1, 
+  "report_hide": 0, 
+  "width": "150px"
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "item_tax_rate", 
+  "fieldtype": "Small Text", 
+  "hidden": 1, 
+  "in_list_view": 0, 
+  "label": "Item Tax Rate", 
+  "oldfieldname": "item_tax_rate", 
+  "oldfieldtype": "Small Text", 
+  "print_hide": 1, 
+  "read_only": 1, 
+  "report_hide": 1
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "col_break4", 
+  "fieldtype": "Column Break"
+ }, 
+ {
+  "allow_on_submit": 1, 
+  "doctype": "DocField", 
+  "fieldname": "page_break", 
+  "fieldtype": "Check", 
+  "hidden": 0, 
+  "in_list_view": 0, 
+  "label": "Page Break", 
+  "no_copy": 1, 
+  "oldfieldname": "page_break", 
+  "oldfieldtype": "Check", 
+  "print_hide": 1, 
+  "read_only": 0, 
+  "report_hide": 1
+ }, 
+ {
   "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", 
   "doctype": "DocField", 
   "fieldname": "item_group", 
@@ -270,64 +354,5 @@
   "read_only": 1, 
   "search_index": 1, 
   "width": "150px"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "item_tax_rate", 
-  "fieldtype": "Small Text", 
-  "hidden": 1, 
-  "in_list_view": 0, 
-  "label": "Item Tax Rate", 
-  "oldfieldname": "item_tax_rate", 
-  "oldfieldtype": "Small Text", 
-  "print_hide": 1, 
-  "read_only": 1, 
-  "report_hide": 1
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "prevdoc_docname", 
-  "fieldtype": "Data", 
-  "in_list_view": 0, 
-  "label": "Against Docname", 
-  "no_copy": 1, 
-  "oldfieldname": "prevdoc_docname", 
-  "oldfieldtype": "Data", 
-  "print_hide": 1, 
-  "print_width": "150px", 
-  "read_only": 1, 
-  "report_hide": 0, 
-  "width": "150px"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "prevdoc_doctype", 
-  "fieldtype": "Data", 
-  "hidden": 1, 
-  "in_list_view": 0, 
-  "label": "Against Doctype", 
-  "no_copy": 1, 
-  "oldfieldname": "prevdoc_doctype", 
-  "oldfieldtype": "Data", 
-  "print_hide": 1, 
-  "print_width": "150px", 
-  "read_only": 1, 
-  "report_hide": 0, 
-  "width": "150px"
- }, 
- {
-  "allow_on_submit": 1, 
-  "doctype": "DocField", 
-  "fieldname": "page_break", 
-  "fieldtype": "Check", 
-  "hidden": 0, 
-  "in_list_view": 0, 
-  "label": "Page Break", 
-  "no_copy": 1, 
-  "oldfieldname": "page_break", 
-  "oldfieldtype": "Check", 
-  "print_hide": 1, 
-  "read_only": 0, 
-  "report_hide": 1
  }
 ]
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/templates/__init__.py b/erpnext/selling/doctype/sales_order/templates/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/selling/doctype/sales_order/templates/__init__.py
+++ /dev/null
diff --git a/erpnext/selling/doctype/sales_order/templates/pages/__init__.py b/erpnext/selling/doctype/sales_order/templates/pages/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/selling/doctype/sales_order/templates/pages/__init__.py
+++ /dev/null
diff --git a/erpnext/selling/doctype/sales_order/templates/pages/order.html b/erpnext/selling/doctype/sales_order/templates/pages/order.html
deleted file mode 100644
index 45867ea..0000000
--- a/erpnext/selling/doctype/sales_order/templates/pages/order.html
+++ /dev/null
@@ -1,5 +0,0 @@
-{% extends "templates/sale.html" %}
-
-{% block status -%}
-	{% if doc.status %}{{ doc.status }}{% endif %}
-{%- endblock %}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/templates/pages/order.py b/erpnext/selling/doctype/sales_order/templates/pages/order.py
deleted file mode 100644
index e172c09..0000000
--- a/erpnext/selling/doctype/sales_order/templates/pages/order.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-from webnotes import _
-
-no_cache = True
-
-def get_context():
-	from erpnext.templates.utils import get_transaction_context
-	context = get_transaction_context("Sales Order", webnotes.form_dict.name)
-	modify_status(context.get("doc"))
-	context.update({
-		"parent_link": "orders",
-		"parent_title": "My Orders"
-	})
-	return context
-	
-def modify_status(doc):
-	doc.status = []
-	if 0 < doc.per_billed < 100:
-		doc.status.append(("label-warning", "icon-ok", _("Partially Billed")))
-	elif doc.per_billed == 100:
-		doc.status.append(("label-success", "icon-ok", _("Billed")))
-	
-	if 0 < doc.per_delivered < 100:
-		doc.status.append(("label-warning", "icon-truck", _("Partially Delivered")))
-	elif doc.per_delivered == 100:
-		doc.status.append(("label-success", "icon-truck", _("Delivered")))
-	doc.status = " " + " ".join(('<span class="label %s"><i class="icon-fixed-width %s"></i> %s</span>' % s 
-			for s in doc.status))
diff --git a/erpnext/selling/doctype/sales_order/templates/pages/orders.html b/erpnext/selling/doctype/sales_order/templates/pages/orders.html
deleted file mode 100644
index 0467f34..0000000
--- a/erpnext/selling/doctype/sales_order/templates/pages/orders.html
+++ /dev/null
@@ -1 +0,0 @@
-{% extends "templates/sales_transactions.html" %}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/templates/pages/orders.py b/erpnext/selling/doctype/sales_order/templates/pages/orders.py
deleted file mode 100644
index 5d28d5b..0000000
--- a/erpnext/selling/doctype/sales_order/templates/pages/orders.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-
-no_cache = True
-
-def get_context():
-	from erpnext.templates.utils import get_currency_context
-	context = get_currency_context()
-	context.update({
-		"title": "My Orders",
-		"method": "selling.doctype.sales_order.templates.pages.orders.get_orders",
-		"icon": "icon-list",
-		"empty_list_message": "No Orders Yet",
-		"page": "order",
-	})
-	return context
-	
-@webnotes.whitelist()
-def get_orders(start=0):
-	from erpnext.templates.utils import get_transaction_list
-	from erpnext.selling.doctype.sales_order.templates.pages.order import modify_status
-	orders = get_transaction_list("Sales Order", start, ["per_billed", "per_delivered"])
-	for d in orders:
-		modify_status(d)
-		
-	return orders
-	
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.txt b/erpnext/selling/doctype/sales_order_item/sales_order_item.txt
index eb656a6..38fb01c 100644
--- a/erpnext/selling/doctype/sales_order_item/sales_order_item.txt
+++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-03-07 11:42:58", 
   "docstatus": 0, 
-  "modified": "2013-12-20 19:21:43", 
+  "modified": "2013-12-31 18:07:50", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -67,6 +67,11 @@
  }, 
  {
   "doctype": "DocField", 
+  "fieldname": "col_break1", 
+  "fieldtype": "Column Break"
+ }, 
+ {
+  "doctype": "DocField", 
   "fieldname": "description", 
   "fieldtype": "Small Text", 
   "in_filter": 1, 
@@ -102,21 +107,6 @@
  }, 
  {
   "doctype": "DocField", 
-  "fieldname": "stock_uom", 
-  "fieldtype": "Link", 
-  "hidden": 0, 
-  "in_list_view": 0, 
-  "label": "UOM", 
-  "oldfieldname": "stock_uom", 
-  "oldfieldtype": "Data", 
-  "options": "UOM", 
-  "print_width": "70px", 
-  "read_only": 1, 
-  "reqd": 0, 
-  "width": "70px"
- }, 
- {
-  "doctype": "DocField", 
   "fieldname": "ref_rate", 
   "fieldtype": "Currency", 
   "in_list_view": 0, 
@@ -145,6 +135,45 @@
  }, 
  {
   "doctype": "DocField", 
+  "fieldname": "col_break2", 
+  "fieldtype": "Column Break"
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "stock_uom", 
+  "fieldtype": "Link", 
+  "hidden": 0, 
+  "in_list_view": 0, 
+  "label": "UOM", 
+  "oldfieldname": "stock_uom", 
+  "oldfieldtype": "Data", 
+  "options": "UOM", 
+  "print_width": "70px", 
+  "read_only": 1, 
+  "reqd": 0, 
+  "width": "70px"
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "base_ref_rate", 
+  "fieldtype": "Currency", 
+  "in_list_view": 0, 
+  "label": "Price List Rate (Company Currency)", 
+  "oldfieldname": "base_ref_rate", 
+  "oldfieldtype": "Currency", 
+  "options": "Company:company:default_currency", 
+  "print_hide": 1, 
+  "print_width": "100px", 
+  "read_only": 1, 
+  "width": "100px"
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "section_break_simple1", 
+  "fieldtype": "Section Break"
+ }, 
+ {
+  "doctype": "DocField", 
   "fieldname": "export_rate", 
   "fieldtype": "Currency", 
   "in_list_view": 1, 
@@ -174,17 +203,8 @@
  }, 
  {
   "doctype": "DocField", 
-  "fieldname": "base_ref_rate", 
-  "fieldtype": "Currency", 
-  "in_list_view": 0, 
-  "label": "Price List Rate (Company Currency)", 
-  "oldfieldname": "base_ref_rate", 
-  "oldfieldtype": "Currency", 
-  "options": "Company:company:default_currency", 
-  "print_hide": 1, 
-  "print_width": "100px", 
-  "read_only": 1, 
-  "width": "100px"
+  "fieldname": "col_break3", 
+  "fieldtype": "Column Break"
  }, 
  {
   "doctype": "DocField", 
@@ -242,6 +262,71 @@
  }, 
  {
   "doctype": "DocField", 
+  "fieldname": "prevdoc_docname", 
+  "fieldtype": "Link", 
+  "hidden": 0, 
+  "in_filter": 1, 
+  "in_list_view": 0, 
+  "label": "Quotation", 
+  "no_copy": 1, 
+  "oldfieldname": "prevdoc_docname", 
+  "oldfieldtype": "Link", 
+  "options": "Quotation", 
+  "print_hide": 1, 
+  "read_only": 1, 
+  "search_index": 1
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "brand", 
+  "fieldtype": "Link", 
+  "hidden": 1, 
+  "in_filter": 1, 
+  "in_list_view": 0, 
+  "label": "Brand Name", 
+  "oldfieldname": "brand", 
+  "oldfieldtype": "Link", 
+  "options": "Brand", 
+  "print_hide": 1, 
+  "read_only": 1, 
+  "search_index": 1
+ }, 
+ {
+  "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", 
+  "doctype": "DocField", 
+  "fieldname": "item_group", 
+  "fieldtype": "Link", 
+  "hidden": 1, 
+  "in_filter": 1, 
+  "in_list_view": 0, 
+  "label": "Item Group", 
+  "oldfieldname": "item_group", 
+  "oldfieldtype": "Link", 
+  "options": "Item Group", 
+  "print_hide": 1, 
+  "read_only": 1, 
+  "search_index": 1
+ }, 
+ {
+  "allow_on_submit": 1, 
+  "doctype": "DocField", 
+  "fieldname": "page_break", 
+  "fieldtype": "Check", 
+  "in_list_view": 0, 
+  "label": "Page Break", 
+  "oldfieldname": "page_break", 
+  "oldfieldtype": "Check", 
+  "print_hide": 1, 
+  "read_only": 0, 
+  "report_hide": 1
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "col_break4", 
+  "fieldtype": "Column Break"
+ }, 
+ {
+  "doctype": "DocField", 
   "fieldname": "projected_qty", 
   "fieldtype": "Float", 
   "hidden": 1, 
@@ -330,66 +415,6 @@
  }, 
  {
   "doctype": "DocField", 
-  "fieldname": "brand", 
-  "fieldtype": "Link", 
-  "hidden": 1, 
-  "in_filter": 1, 
-  "in_list_view": 0, 
-  "label": "Brand Name", 
-  "oldfieldname": "brand", 
-  "oldfieldtype": "Link", 
-  "options": "Brand", 
-  "print_hide": 1, 
-  "read_only": 1, 
-  "search_index": 1
- }, 
- {
-  "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", 
-  "doctype": "DocField", 
-  "fieldname": "item_group", 
-  "fieldtype": "Link", 
-  "hidden": 1, 
-  "in_filter": 1, 
-  "in_list_view": 0, 
-  "label": "Item Group", 
-  "oldfieldname": "item_group", 
-  "oldfieldtype": "Link", 
-  "options": "Item Group", 
-  "print_hide": 1, 
-  "read_only": 1, 
-  "search_index": 1
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "prevdoc_docname", 
-  "fieldtype": "Link", 
-  "hidden": 0, 
-  "in_filter": 1, 
-  "in_list_view": 0, 
-  "label": "Quotation", 
-  "no_copy": 1, 
-  "oldfieldname": "prevdoc_docname", 
-  "oldfieldtype": "Link", 
-  "options": "Quotation", 
-  "print_hide": 1, 
-  "read_only": 1, 
-  "search_index": 1
- }, 
- {
-  "allow_on_submit": 1, 
-  "doctype": "DocField", 
-  "fieldname": "page_break", 
-  "fieldtype": "Check", 
-  "in_list_view": 0, 
-  "label": "Page Break", 
-  "oldfieldname": "page_break", 
-  "oldfieldtype": "Check", 
-  "print_hide": 1, 
-  "read_only": 0, 
-  "report_hide": 1
- }, 
- {
-  "doctype": "DocField", 
   "fieldname": "item_tax_rate", 
   "fieldtype": "Small Text", 
   "hidden": 1, 
diff --git a/erpnext/selling/doctype/sales_team/sales_team.txt b/erpnext/selling/doctype/sales_team/sales_team.txt
index 9b58429..d012cb4 100644
--- a/erpnext/selling/doctype/sales_team/sales_team.txt
+++ b/erpnext/selling/doctype/sales_team/sales_team.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-04-19 13:30:51", 
   "docstatus": 0, 
-  "modified": "2013-12-20 19:21:46", 
+  "modified": "2013-12-31 19:00:14", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -65,6 +65,11 @@
  }, 
  {
   "doctype": "DocField", 
+  "fieldname": "col_break1", 
+  "fieldtype": "Column Break"
+ }, 
+ {
+  "doctype": "DocField", 
   "fieldname": "allocated_percentage", 
   "fieldtype": "Float", 
   "in_list_view": 1, 
@@ -91,6 +96,16 @@
  }, 
  {
   "doctype": "DocField", 
+  "fieldname": "incentives", 
+  "fieldtype": "Currency", 
+  "in_list_view": 1, 
+  "label": "Incentives", 
+  "oldfieldname": "incentives", 
+  "oldfieldtype": "Currency", 
+  "options": "Company:company:default_currency"
+ }, 
+ {
+  "doctype": "DocField", 
   "fieldname": "parenttype", 
   "fieldtype": "Data", 
   "hidden": 1, 
@@ -101,15 +116,5 @@
   "oldfieldtype": "Data", 
   "print_hide": 1, 
   "search_index": 1
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "incentives", 
-  "fieldtype": "Currency", 
-  "in_list_view": 1, 
-  "label": "Incentives", 
-  "oldfieldname": "incentives", 
-  "oldfieldtype": "Currency", 
-  "options": "Company:company:default_currency"
  }
 ]
\ No newline at end of file
diff --git a/erpnext/selling/doctype/shopping_cart_price_list/__init__.py b/erpnext/selling/doctype/shopping_cart_price_list/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/selling/doctype/shopping_cart_price_list/__init__.py
+++ /dev/null
diff --git a/erpnext/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.py b/erpnext/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.py
deleted file mode 100644
index e5468e5..0000000
--- a/erpnext/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-import webnotes
-
-class DocType:
-	def __init__(self, d, dl):
-		self.doc, self.doclist = d, dl
\ No newline at end of file
diff --git a/erpnext/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.txt b/erpnext/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.txt
deleted file mode 100644
index 7cd61f7..0000000
--- a/erpnext/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-[
- {
-  "creation": "2013-06-20 16:00:18", 
-  "docstatus": 0, 
-  "modified": "2013-12-20 19:21:47", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "doctype": "DocType", 
-  "istable": 1, 
-  "module": "Selling", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "selling_price_list", 
-  "fieldtype": "Link", 
-  "in_list_view": 1, 
-  "label": "Price List", 
-  "name": "__common__", 
-  "options": "Price List", 
-  "parent": "Shopping Cart Price List", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0, 
-  "reqd": 1
- }, 
- {
-  "doctype": "DocType", 
-  "name": "Shopping Cart Price List"
- }, 
- {
-  "doctype": "DocField"
- }
-]
\ No newline at end of file
diff --git a/erpnext/selling/doctype/shopping_cart_settings/__init__.py b/erpnext/selling/doctype/shopping_cart_settings/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/selling/doctype/shopping_cart_settings/__init__.py
+++ /dev/null
diff --git a/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.js b/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.js
deleted file mode 100644
index 7505dc2..0000000
--- a/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-// License: GNU General Public License v3. See license.txt
-
-$.extend(cur_frm.cscript, {
-	onload: function() {
-		if(cur_frm.doc.__quotation_series) {
-			cur_frm.fields_dict.quotation_series.df.options = cur_frm.doc.__quotation_series;
-		}
-	}
-});
\ No newline at end of file
diff --git a/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.py b/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.py
deleted file mode 100644
index 923936e..0000000
--- a/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.py
+++ /dev/null
@@ -1,154 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-import webnotes
-from webnotes import _, msgprint
-from webnotes.utils import comma_and
-from webnotes.model.controller import DocListController
-
-class ShoppingCartSetupError(webnotes.ValidationError): pass
-
-class DocType(DocListController):
-	def onload(self):
-		self.doc.fields["__quotation_series"] = webnotes.get_doctype("Quotation").get_options("naming_series")
-	
-	def validate(self):
-		if self.doc.enabled:
-			self.validate_price_lists()
-			self.validate_tax_masters()
-			self.validate_exchange_rates_exist()
-			
-	def on_update(self):
-		webnotes.conn.set_default("shopping_cart_enabled", self.doc.fields.get("enabled") or 0)
-		webnotes.conn.set_default("shopping_cart_quotation_series", self.doc.fields.get("quotation_series"))
-			
-	def validate_overlapping_territories(self, parentfield, fieldname):
-		# for displaying message
-		doctype = self.meta.get_field(parentfield).options
-		
-		# specify atleast one entry in the table
-		self.validate_table_has_rows(parentfield, raise_exception=ShoppingCartSetupError)
-		
-		territory_name_map = self.get_territory_name_map(parentfield, fieldname)
-		for territory, names in territory_name_map.items():
-			if len(names) > 1:
-				msgprint(_("Error for") + " " + _(doctype) + ": " + comma_and(names) +
-					" " + _("have a common territory") + ": " + territory,
-					raise_exception=ShoppingCartSetupError)
-					
-		return territory_name_map
-		
-	def validate_price_lists(self):
-		territory_name_map = self.validate_overlapping_territories("price_lists",
-			"selling_price_list")
-		
-		# validate that a Shopping Cart Price List exists for the root territory
-		# as a catch all!
-		from erpnext.setup.utils import get_root_of
-		root_territory = get_root_of("Territory")
-		
-		if root_territory not in territory_name_map.keys():
-			msgprint(_("Please specify a Price List which is valid for Territory") + 
-				": " + root_territory, raise_exception=ShoppingCartSetupError)
-		
-	def validate_tax_masters(self):
-		self.validate_overlapping_territories("sales_taxes_and_charges_masters", 
-			"sales_taxes_and_charges_master")
-		
-	def get_territory_name_map(self, parentfield, fieldname):
-		territory_name_map = {}
-		
-		# entries in table
-		names = [doc.fields.get(fieldname) for doc in self.doclist.get({"parentfield": parentfield})]
-		
-		if names:
-			# for condition in territory check
-			parenttype = self.meta.get_field(fieldname, parentfield=parentfield).options
-		
-			# to validate territory overlap
-			# make a map of territory: [list of names]
-			# if list against each territory has more than one element, raise exception
-			territory_name = webnotes.conn.sql("""select `territory`, `parent` 
-				from `tabApplicable Territory`
-				where `parenttype`=%s and `parent` in (%s)""" %
-				("%s", ", ".join(["%s"]*len(names))), tuple([parenttype] + names))
-		
-			for territory, name in territory_name:
-				territory_name_map.setdefault(territory, []).append(name)
-				
-				if len(territory_name_map[territory]) > 1:
-					territory_name_map[territory].sort(key=lambda val: names.index(val))
-		
-		return territory_name_map
-					
-	def validate_exchange_rates_exist(self):
-		"""check if exchange rates exist for all Price List currencies (to company's currency)"""
-		company_currency = webnotes.conn.get_value("Company", self.doc.company, "default_currency")
-		if not company_currency:
-			msgprint(_("Please specify currency in Company") + ": " + self.doc.company,
-				raise_exception=ShoppingCartSetupError)
-		
-		price_list_currency_map = webnotes.conn.get_values("Price List", 
-			[d.selling_price_list for d in self.doclist.get({"parentfield": "price_lists"})],
-			"currency")
-		
-		# check if all price lists have a currency
-		for price_list, currency in price_list_currency_map.items():
-			if not currency:
-				webnotes.throw("%s: %s" % (_("Currency is missing for Price List"), price_list))
-			
-		expected_to_exist = [currency + "-" + company_currency 
-			for currency in price_list_currency_map.values()
-			if currency != company_currency]
-			
-		if expected_to_exist:
-			exists = webnotes.conn.sql_list("""select name from `tabCurrency Exchange`
-				where name in (%s)""" % (", ".join(["%s"]*len(expected_to_exist)),),
-				tuple(expected_to_exist))
-		
-			missing = list(set(expected_to_exist).difference(exists))
-		
-			if missing:
-				msgprint(_("Missing Currency Exchange Rates for" + ": " + comma_and(missing)),
-					raise_exception=ShoppingCartSetupError)
-				
-	def get_name_from_territory(self, territory, parentfield, fieldname):
-		name = None
-		territory_name_map = self.get_territory_name_map(parentfield, fieldname)
-		
-		if territory_name_map.get(territory):
-			name = territory_name_map.get(territory)
-		else:
-			territory_ancestry = self.get_territory_ancestry(territory)
-			for ancestor in territory_ancestry:
-				if territory_name_map.get(ancestor):
-					name = territory_name_map.get(ancestor)
-					break
-		
-		return name
-				
-	def get_price_list(self, billing_territory):
-		price_list = self.get_name_from_territory(billing_territory, "price_lists", "selling_price_list")
-		return price_list and price_list[0] or None
-		
-	def get_tax_master(self, billing_territory):
-		tax_master = self.get_name_from_territory(billing_territory, "sales_taxes_and_charges_masters", 
-			"sales_taxes_and_charges_master")
-		return tax_master and tax_master[0] or None
-		
-	def get_shipping_rules(self, shipping_territory):
-		return self.get_name_from_territory(shipping_territory, "shipping_rules", "shipping_rule")
-		
-	def get_territory_ancestry(self, territory):
-		from erpnext.setup.utils import get_ancestors_of
-		
-		if not hasattr(self, "_territory_ancestry"):
-			self._territory_ancestry = {}
-			
-		if not self._territory_ancestry.get(territory):
-			self._territory_ancestry[territory] = get_ancestors_of("Territory", territory)
-
-		return self._territory_ancestry[territory]
\ No newline at end of file
diff --git a/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.txt b/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.txt
deleted file mode 100644
index f52cc60..0000000
--- a/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.txt
+++ /dev/null
@@ -1,129 +0,0 @@
-[
- {
-  "creation": "2013-06-19 15:57:32", 
-  "docstatus": 0, 
-  "modified": "2013-12-20 19:21:47", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "description": "Default settings for Shopping Cart", 
-  "doctype": "DocType", 
-  "icon": "icon-shopping-cart", 
-  "issingle": 1, 
-  "module": "Selling", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "name": "__common__", 
-  "parent": "Shopping Cart Settings", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0
- }, 
- {
-  "create": 1, 
-  "doctype": "DocPerm", 
-  "email": 1, 
-  "name": "__common__", 
-  "parent": "Shopping Cart Settings", 
-  "parentfield": "permissions", 
-  "parenttype": "DocType", 
-  "permlevel": 0, 
-  "print": 1, 
-  "read": 1, 
-  "role": "Website Manager", 
-  "write": 1
- }, 
- {
-  "doctype": "DocType", 
-  "name": "Shopping Cart Settings"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "enabled", 
-  "fieldtype": "Check", 
-  "label": "Enable Shopping Cart"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "section_break_2", 
-  "fieldtype": "Section Break"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "company", 
-  "fieldtype": "Link", 
-  "label": "Company", 
-  "options": "Company", 
-  "reqd": 1
- }, 
- {
-  "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>", 
-  "doctype": "DocField", 
-  "fieldname": "default_territory", 
-  "fieldtype": "Link", 
-  "label": "Default Territory", 
-  "options": "Territory", 
-  "reqd": 1
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "column_break_4", 
-  "fieldtype": "Column Break"
- }, 
- {
-  "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>", 
-  "doctype": "DocField", 
-  "fieldname": "default_customer_group", 
-  "fieldtype": "Link", 
-  "label": "Default Customer Group", 
-  "options": "Customer Group", 
-  "reqd": 1
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "quotation_series", 
-  "fieldtype": "Select", 
-  "label": "Quotation Series", 
-  "reqd": 1
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "section_break_6", 
-  "fieldtype": "Section Break"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "price_lists", 
-  "fieldtype": "Table", 
-  "label": "Shopping Cart Price Lists", 
-  "options": "Shopping Cart Price List", 
-  "reqd": 0
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "shipping_rules", 
-  "fieldtype": "Table", 
-  "label": "Shopping Cart Shipping Rules", 
-  "options": "Shopping Cart Shipping Rule", 
-  "reqd": 0
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "column_break_10", 
-  "fieldtype": "Column Break"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "sales_taxes_and_charges_masters", 
-  "fieldtype": "Table", 
-  "label": "Shopping Cart Taxes and Charges Masters", 
-  "options": "Shopping Cart Taxes and Charges Master", 
-  "reqd": 0
- }, 
- {
-  "doctype": "DocPerm"
- }
-]
\ No newline at end of file
diff --git a/erpnext/selling/doctype/shopping_cart_settings/test_shopping_cart_settings.py b/erpnext/selling/doctype/shopping_cart_settings/test_shopping_cart_settings.py
deleted file mode 100644
index be67f6f..0000000
--- a/erpnext/selling/doctype/shopping_cart_settings/test_shopping_cart_settings.py
+++ /dev/null
@@ -1,81 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-import webnotes
-import unittest
-from erpnext.selling.doctype.shopping_cart_settings.shopping_cart_settings import ShoppingCartSetupError
-
-class TestShoppingCartSettings(unittest.TestCase):
-	def setUp(self):
-		webnotes.conn.sql("""delete from `tabSingles` where doctype="Shipping Cart Settings" """)
-		webnotes.conn.sql("""delete from `tabShopping Cart Price List`""")
-		webnotes.conn.sql("""delete from `tabShopping Cart Taxes and Charges Master`""")
-		webnotes.conn.sql("""delete from `tabShopping Cart Shipping Rule`""")
-		
-	def get_cart_settings(self):
-		return webnotes.bean({"doctype": "Shopping Cart Settings",
-			"company": "_Test Company"})
-		
-	def test_price_list_territory_overlap(self):
-		cart_settings = self.get_cart_settings()
-		
-		def _add_price_list(price_list):
-			cart_settings.doclist.append({
-				"doctype": "Shopping Cart Price List",
-				"parentfield": "price_lists",
-				"selling_price_list": price_list
-			})
-		
-		for price_list in ("_Test Price List Rest of the World", "_Test Price List India",
-			"_Test Price List"):
-			_add_price_list(price_list)
-		
-		controller = cart_settings.make_controller()
-		controller.validate_overlapping_territories("price_lists", "selling_price_list")
-		
-		_add_price_list("_Test Price List 2")
-		
-		controller = cart_settings.make_controller()
-		self.assertRaises(ShoppingCartSetupError, controller.validate_overlapping_territories,
-			"price_lists", "selling_price_list")
-			
-		return cart_settings
-		
-	def test_taxes_territory_overlap(self):
-		cart_settings = self.get_cart_settings()
-		
-		def _add_tax_master(tax_master):
-			cart_settings.doclist.append({
-				"doctype": "Shopping Cart Taxes and Charges Master",
-				"parentfield": "sales_taxes_and_charges_masters",
-				"sales_taxes_and_charges_master": tax_master
-			})
-		
-		for tax_master in ("_Test Sales Taxes and Charges Master", "_Test India Tax Master"):
-			_add_tax_master(tax_master)
-			
-		controller = cart_settings.make_controller()
-		controller.validate_overlapping_territories("sales_taxes_and_charges_masters",
-			"sales_taxes_and_charges_master")
-			
-		_add_tax_master("_Test Sales Taxes and Charges Master 2")
-		
-		controller = cart_settings.make_controller()
-		self.assertRaises(ShoppingCartSetupError, controller.validate_overlapping_territories,
-			"sales_taxes_and_charges_masters", "sales_taxes_and_charges_master")
-		
-	def test_exchange_rate_exists(self):
-		webnotes.conn.sql("""delete from `tabCurrency Exchange`""")
-		
-		cart_settings = self.test_price_list_territory_overlap()
-		controller = cart_settings.make_controller()
-		self.assertRaises(ShoppingCartSetupError, controller.validate_exchange_rates_exist)
-		
-		from erpnext.setup.doctype.currency_exchange.test_currency_exchange import test_records as \
-			currency_exchange_records
-		webnotes.bean(currency_exchange_records[0]).insert()
-		controller.validate_exchange_rates_exist()
-		
diff --git a/erpnext/selling/doctype/shopping_cart_shipping_rule/__init__.py b/erpnext/selling/doctype/shopping_cart_shipping_rule/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/selling/doctype/shopping_cart_shipping_rule/__init__.py
+++ /dev/null
diff --git a/erpnext/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.py b/erpnext/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.py
deleted file mode 100644
index e5468e5..0000000
--- a/erpnext/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-import webnotes
-
-class DocType:
-	def __init__(self, d, dl):
-		self.doc, self.doclist = d, dl
\ No newline at end of file
diff --git a/erpnext/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.txt b/erpnext/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.txt
deleted file mode 100644
index 91b41c2..0000000
--- a/erpnext/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-[
- {
-  "creation": "2013-07-03 13:15:34", 
-  "docstatus": 0, 
-  "modified": "2013-12-20 19:21:47", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "doctype": "DocType", 
-  "istable": 1, 
-  "module": "Selling", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "shipping_rule", 
-  "fieldtype": "Link", 
-  "in_list_view": 1, 
-  "label": "Shipping Rule", 
-  "name": "__common__", 
-  "options": "Shipping Rule", 
-  "parent": "Shopping Cart Shipping Rule", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0, 
-  "reqd": 1
- }, 
- {
-  "doctype": "DocType", 
-  "name": "Shopping Cart Shipping Rule"
- }, 
- {
-  "doctype": "DocField"
- }
-]
\ No newline at end of file
diff --git a/erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/__init__.py b/erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/__init__.py
+++ /dev/null
diff --git a/erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.py b/erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.py
deleted file mode 100644
index e5468e5..0000000
--- a/erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-import webnotes
-
-class DocType:
-	def __init__(self, d, dl):
-		self.doc, self.doclist = d, dl
\ No newline at end of file
diff --git a/erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.txt b/erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.txt
deleted file mode 100644
index ba44199..0000000
--- a/erpnext/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-[
- {
-  "creation": "2013-06-20 16:57:03", 
-  "docstatus": 0, 
-  "modified": "2013-12-20 19:21:47", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "doctype": "DocType", 
-  "istable": 1, 
-  "module": "Selling", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "sales_taxes_and_charges_master", 
-  "fieldtype": "Link", 
-  "in_list_view": 1, 
-  "label": "Tax Master", 
-  "name": "__common__", 
-  "options": "Sales Taxes and Charges Master", 
-  "parent": "Shopping Cart Taxes and Charges Master", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0, 
-  "reqd": 1
- }, 
- {
-  "doctype": "DocType", 
-  "name": "Shopping Cart Taxes and Charges Master"
- }, 
- {
-  "doctype": "DocField"
- }
-]
\ No newline at end of file
diff --git a/erpnext/selling/page/selling_home/selling_home.js b/erpnext/selling/page/selling_home/selling_home.js
index a64ed48..54b4edc 100644
--- a/erpnext/selling/page/selling_home/selling_home.js
+++ b/erpnext/selling/page/selling_home/selling_home.js
@@ -66,12 +66,6 @@
 				"description": wn._("Settings for Selling Module")
 			},
 			{
-				"route":"Form/Shopping Cart Settings",
-				"label":wn._("Shopping Cart Settings"),
-				"description":wn._("Setup of Shopping Cart."),
-				doctype:"Shopping Cart Settings"
-			},
-			{
 				label: wn._("Sales Taxes and Charges Master"),
 				description: wn._("Sales taxes template."),
 				doctype:"Sales Taxes and Charges Master"
diff --git a/erpnext/selling/utils/__init__.py b/erpnext/selling/utils.py
similarity index 99%
rename from erpnext/selling/utils/__init__.py
rename to erpnext/selling/utils.py
index c73d76e..7949e47 100644
--- a/erpnext/selling/utils/__init__.py
+++ b/erpnext/selling/utils.py
@@ -207,4 +207,4 @@
 	if out.get("warehouse"):
 		out["actual_qty"] = get_available_qty(opts.item_code, out.get("warehouse")).get("actual_qty")
 	
-	return out
+	return out
\ No newline at end of file
diff --git a/erpnext/selling/utils/cart.py b/erpnext/selling/utils/cart.py
deleted file mode 100644
index f23a571..0000000
--- a/erpnext/selling/utils/cart.py
+++ /dev/null
@@ -1,462 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes, json
-from webnotes import msgprint, _
-import webnotes.defaults
-from webnotes.utils import flt, get_fullname, fmt_money, cstr
-
-class WebsitePriceListMissingError(webnotes.ValidationError): pass
-
-def set_cart_count(quotation=None):
-	if not quotation:
-		quotation = _get_cart_quotation()
-	cart_count = cstr(len(quotation.doclist.get({"parentfield": "quotation_details"})))
-	webnotes._response.set_cookie("cart_count", cart_count)
-
-@webnotes.whitelist()
-def get_cart_quotation(doclist=None):
-	party = get_lead_or_customer()
-	
-	if not doclist:
-		quotation = _get_cart_quotation(party)
-		doclist = quotation.doclist
-		set_cart_count(quotation)
-	
-	return {
-		"doclist": decorate_quotation_doclist(doclist),
-		"addresses": [{"name": address.name, "display": address.display} 
-			for address in get_address_docs(party)],
-		"shipping_rules": get_applicable_shipping_rules(party)
-	}
-	
-@webnotes.whitelist()
-def place_order():
-	quotation = _get_cart_quotation()
-	controller = quotation.make_controller()
-	for fieldname in ["customer_address", "shipping_address_name"]:
-		if not quotation.doc.fields.get(fieldname):
-			msgprint(_("Please select a") + " " + _(controller.meta.get_label(fieldname)), raise_exception=True)
-	
-	quotation.ignore_permissions = True
-	quotation.submit()
-	
-	from erpnext.selling.doctype.quotation.quotation import _make_sales_order
-	sales_order = webnotes.bean(_make_sales_order(quotation.doc.name, ignore_permissions=True))
-	sales_order.ignore_permissions = True
-	sales_order.insert()
-	sales_order.submit()
-	webnotes._response.set_cookie("cart_count", "")
-	
-	return sales_order.doc.name
-
-@webnotes.whitelist()
-def update_cart(item_code, qty, with_doclist=0):
-	quotation = _get_cart_quotation()
-	
-	qty = flt(qty)
-	if qty == 0:
-		quotation.set_doclist(quotation.doclist.get({"item_code": ["!=", item_code]}))
-		if not quotation.doclist.get({"parentfield": "quotation_details"}) and \
-			not quotation.doc.fields.get("__islocal"):
-				quotation.__delete = True
-			
-	else:
-		quotation_items = quotation.doclist.get({"item_code": item_code})
-		if not quotation_items:
-			quotation.doclist.append({
-				"doctype": "Quotation Item",
-				"parentfield": "quotation_details",
-				"item_code": item_code,
-				"qty": qty
-			})
-		else:
-			quotation_items[0].qty = qty
-	
-	apply_cart_settings(quotation=quotation)
-
-	if hasattr(quotation, "__delete"):
-		webnotes.delete_doc("Quotation", quotation.doc.name, ignore_permissions=True)
-		quotation = _get_cart_quotation()
-	else:
-		quotation.ignore_permissions = True
-		quotation.save()
-	
-	set_cart_count(quotation)
-	
-	if with_doclist:
-		return get_cart_quotation(quotation.doclist)
-	else:
-		return quotation.doc.name
-		
-@webnotes.whitelist()
-def update_cart_address(address_fieldname, address_name):
-	from erpnext.utilities.transaction_base import get_address_display
-	
-	quotation = _get_cart_quotation()
-	address_display = get_address_display(webnotes.doc("Address", address_name).fields)
-	
-	if address_fieldname == "shipping_address_name":
-		quotation.doc.shipping_address_name = address_name
-		quotation.doc.shipping_address = address_display
-		
-		if not quotation.doc.customer_address:
-			address_fieldname == "customer_address"
-	
-	if address_fieldname == "customer_address":
-		quotation.doc.customer_address = address_name
-		quotation.doc.address_display = address_display
-		
-	
-	apply_cart_settings(quotation=quotation)
-	
-	quotation.ignore_permissions = True
-	quotation.save()
-		
-	return get_cart_quotation(quotation.doclist)
-
-@webnotes.whitelist()
-def get_addresses():
-	return [d.fields for d in get_address_docs()]
-	
-@webnotes.whitelist()
-def save_address(fields, address_fieldname=None):
-	party = get_lead_or_customer()
-	fields = json.loads(fields)
-	
-	if fields.get("name"):
-		bean = webnotes.bean("Address", fields.get("name"))
-	else:
-		bean = webnotes.bean({"doctype": "Address", "__islocal": 1})
-	
-	bean.doc.fields.update(fields)
-	
-	party_fieldname = party.doctype.lower()
-	bean.doc.fields.update({
-		party_fieldname: party.name,
-		(party_fieldname + "_name"): party.fields[party_fieldname + "_name"]
-	})
-	bean.ignore_permissions = True
-	bean.save()
-	
-	if address_fieldname:
-		update_cart_address(address_fieldname, bean.doc.name)
-	
-	return bean.doc.name
-	
-def get_address_docs(party=None):
-	from webnotes.model.doclist import objectify
-	from erpnext.utilities.transaction_base import get_address_display
-	
-	if not party:
-		party = get_lead_or_customer()
-		
-	address_docs = objectify(webnotes.conn.sql("""select * from `tabAddress`
-		where `%s`=%s order by name""" % (party.doctype.lower(), "%s"), party.name, 
-		as_dict=True, update={"doctype": "Address"}))
-	
-	for address in address_docs:
-		address.display = get_address_display(address.fields)
-		address.display = (address.display).replace("\n", "<br>\n")
-		
-	return address_docs
-	
-def get_lead_or_customer():
-	customer = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user}, "customer")
-	if customer:
-		return webnotes.doc("Customer", customer)
-	
-	lead = webnotes.conn.get_value("Lead", {"email_id": webnotes.session.user})
-	if lead:
-		return webnotes.doc("Lead", lead)
-	else:
-		lead_bean = webnotes.bean({
-			"doctype": "Lead",
-			"email_id": webnotes.session.user,
-			"lead_name": get_fullname(webnotes.session.user),
-			"territory": guess_territory(),
-			"status": "Open" # TODO: set something better???
-		})
-		
-		if webnotes.session.user != "Guest":
-			lead_bean.ignore_permissions = True
-			lead_bean.insert()
-			
-		return lead_bean.doc
-		
-def guess_territory():
-	territory = None
-	geoip_country = webnotes.session.get("session_country")
-	if geoip_country:
-		territory = webnotes.conn.get_value("Territory", geoip_country)
-	
-	return territory or \
-		webnotes.conn.get_value("Shopping Cart Settings", None, "territory") or \
-		"All Territories"
-
-def decorate_quotation_doclist(doclist):
-	for d in doclist:
-		if d.item_code:
-			d.fields.update(webnotes.conn.get_value("Item", d.item_code, 
-				["website_image", "description", "page_name"], as_dict=True))
-			d.formatted_rate = fmt_money(d.export_rate, currency=doclist[0].currency)
-			d.formatted_amount = fmt_money(d.export_amount, currency=doclist[0].currency)
-		elif d.charge_type:
-			d.formatted_tax_amount = fmt_money(d.tax_amount / doclist[0].conversion_rate,
-				currency=doclist[0].currency)
-
-	doclist[0].formatted_grand_total_export = fmt_money(doclist[0].grand_total_export,
-		currency=doclist[0].currency)
-	
-	return [d.fields for d in doclist]
-
-def _get_cart_quotation(party=None):
-	if not party:
-		party = get_lead_or_customer()
-		
-	quotation = webnotes.conn.get_value("Quotation", 
-		{party.doctype.lower(): party.name, "order_type": "Shopping Cart", "docstatus": 0})
-	
-	if quotation:
-		qbean = webnotes.bean("Quotation", quotation)
-	else:
-		qbean = webnotes.bean({
-			"doctype": "Quotation",
-			"naming_series": webnotes.defaults.get_user_default("shopping_cart_quotation_series") or "QTN-CART-",
-			"quotation_to": party.doctype,
-			"company": webnotes.defaults.get_user_default("company"),
-			"order_type": "Shopping Cart",
-			"status": "Draft",
-			"docstatus": 0,
-			"__islocal": 1,
-			(party.doctype.lower()): party.name
-		})
-		
-		if party.doctype == "Customer":
-			qbean.doc.contact_person = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user,
-				"customer": party.name})
-			qbean.run_method("set_contact_fields")
-		
-		qbean.run_method("onload_post_render")
-		apply_cart_settings(party, qbean)
-	
-	return qbean
-
-def update_party(fullname, company_name=None, mobile_no=None, phone=None):
-	party = get_lead_or_customer()
-
-	if party.doctype == "Lead":
-		party.company_name = company_name
-		party.lead_name = fullname
-		party.mobile_no = mobile_no
-		party.phone = phone
-	else:
-		party.customer_name = company_name or fullname
-		party.customer_type == "Company" if company_name else "Individual"
-		
-		contact_name = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user,
-			"customer": party.name})
-		contact = webnotes.bean("Contact", contact_name)
-		contact.doc.first_name = fullname
-		contact.doc.last_name = None
-		contact.doc.customer_name = party.customer_name
-		contact.doc.mobile_no = mobile_no
-		contact.doc.phone = phone
-		contact.ignore_permissions = True
-		contact.save()
-	
-	party_bean = webnotes.bean(party.fields)
-	party_bean.ignore_permissions = True
-	party_bean.save()
-	
-	qbean = _get_cart_quotation(party)
-	if not qbean.doc.fields.get("__islocal"):
-		qbean.doc.customer_name = company_name or fullname
-		qbean.run_method("set_contact_fields")
-		qbean.ignore_permissions = True
-		qbean.save()
-
-def apply_cart_settings(party=None, quotation=None):
-	if not party:
-		party = get_lead_or_customer()
-	if not quotation:
-		quotation = _get_cart_quotation(party)
-	
-	cart_settings = webnotes.get_obj("Shopping Cart Settings")
-	
-	billing_territory = get_address_territory(quotation.doc.customer_address) or \
-		party.territory or "All Territories"
-		
-	set_price_list_and_rate(quotation, cart_settings, billing_territory)
-	
-	quotation.run_method("calculate_taxes_and_totals")
-	
-	set_taxes(quotation, cart_settings, billing_territory)
-	
-	_apply_shipping_rule(party, quotation, cart_settings)
-	
-def set_price_list_and_rate(quotation, cart_settings, billing_territory):
-	"""set price list based on billing territory"""
-	quotation.doc.selling_price_list = cart_settings.get_price_list(billing_territory)
-	
-	# reset values
-	quotation.doc.price_list_currency = quotation.doc.currency = \
-		quotation.doc.plc_conversion_rate = quotation.doc.conversion_rate = None
-	for item in quotation.doclist.get({"parentfield": "quotation_details"}):
-		item.ref_rate = item.adj_rate = item.export_rate = item.export_amount = None
-	
-	# refetch values
-	quotation.run_method("set_price_list_and_item_details")
-	
-	# set it in cookies for using in product page
-	webnotes.local._response.set_cookie("selling_price_list", quotation.doc.selling_price_list)
-	
-def set_taxes(quotation, cart_settings, billing_territory):
-	"""set taxes based on billing territory"""
-	quotation.doc.charge = cart_settings.get_tax_master(billing_territory)
-
-	# clear table
-	quotation.set_doclist(quotation.doclist.get({"parentfield": ["!=", "other_charges"]}))
-	
-	# append taxes
-	controller = quotation.make_controller()
-	controller.append_taxes_from_master("other_charges", "charge")
-	quotation.set_doclist(controller.doclist)
-
-@webnotes.whitelist()
-def apply_shipping_rule(shipping_rule):
-	quotation = _get_cart_quotation()
-	
-	quotation.doc.shipping_rule = shipping_rule
-	
-	apply_cart_settings(quotation=quotation)
-	
-	quotation.ignore_permissions = True
-	quotation.save()
-	
-	return get_cart_quotation(quotation.doclist)
-	
-def _apply_shipping_rule(party=None, quotation=None, cart_settings=None):
-	shipping_rules = get_shipping_rules(party, quotation, cart_settings)
-	
-	if not shipping_rules:
-		return
-		
-	elif quotation.doc.shipping_rule not in shipping_rules:
-		quotation.doc.shipping_rule = shipping_rules[0]
-	
-	quotation.run_method("apply_shipping_rule")
-	quotation.run_method("calculate_taxes_and_totals")
-	
-def get_applicable_shipping_rules(party=None, quotation=None):
-	shipping_rules = get_shipping_rules(party, quotation)
-	
-	if shipping_rules:
-		rule_label_map = webnotes.conn.get_values("Shipping Rule", shipping_rules, "label")
-		# we need this in sorted order as per the position of the rule in the settings page
-		return [[rule, rule_label_map.get(rule)] for rule in shipping_rules]
-		
-def get_shipping_rules(party=None, quotation=None, cart_settings=None):
-	if not party:
-		party = get_lead_or_customer()
-	if not quotation:
-		quotation = _get_cart_quotation()
-	if not cart_settings:
-		cart_settings = webnotes.get_obj("Shopping Cart Settings")
-		
-	# set shipping rule based on shipping territory	
-	shipping_territory = get_address_territory(quotation.doc.shipping_address_name) or \
-		party.territory
-	
-	shipping_rules = cart_settings.get_shipping_rules(shipping_territory)
-	
-	return shipping_rules
-	
-def get_address_territory(address_name):
-	"""Tries to match city, state and country of address to existing territory"""
-	territory = None
-
-	if address_name:
-		address_fields = webnotes.conn.get_value("Address", address_name, 
-			["city", "state", "country"])
-		for value in address_fields:
-			territory = webnotes.conn.get_value("Territory", value)
-			if territory:
-				break
-	
-	return territory
-	
-import unittest
-test_dependencies = ["Item", "Price List", "Contact", "Shopping Cart Settings"]
-
-class TestCart(unittest.TestCase):
-	def tearDown(self):
-		return
-		
-		cart_settings = webnotes.bean("Shopping Cart Settings")
-		cart_settings.ignore_permissions = True
-		cart_settings.doc.enabled = 0
-		cart_settings.save()
-	
-	def enable_shopping_cart(self):
-		return
-		if not webnotes.conn.get_value("Shopping Cart Settings", None, "enabled"):
-			cart_settings = webnotes.bean("Shopping Cart Settings")
-			cart_settings.ignore_permissions = True
-			cart_settings.doc.enabled = 1
-			cart_settings.save()
-			
-	def test_get_lead_or_customer(self):
-		webnotes.session.user = "test@example.com"
-		party1 = get_lead_or_customer()
-		party2 = get_lead_or_customer()
-		self.assertEquals(party1.name, party2.name)
-		self.assertEquals(party1.doctype, "Lead")
-		
-		webnotes.session.user = "test_contact_customer@example.com"
-		party = get_lead_or_customer()
-		self.assertEquals(party.name, "_Test Customer")
-		
-	def test_add_to_cart(self):
-		self.enable_shopping_cart()
-		webnotes.session.user = "test@example.com"
-		
-		update_cart("_Test Item", 1)
-		
-		quotation = _get_cart_quotation()
-		quotation_items = quotation.doclist.get({"parentfield": "quotation_details", "item_code": "_Test Item"})
-		self.assertTrue(quotation_items)
-		self.assertEquals(quotation_items[0].qty, 1)
-		
-		return quotation
-		
-	def test_update_cart(self):
-		self.test_add_to_cart()
-
-		update_cart("_Test Item", 5)
-		
-		quotation = _get_cart_quotation()
-		quotation_items = quotation.doclist.get({"parentfield": "quotation_details", "item_code": "_Test Item"})
-		self.assertTrue(quotation_items)
-		self.assertEquals(quotation_items[0].qty, 5)
-		
-		return quotation
-		
-	def test_remove_from_cart(self):
-		quotation0 = self.test_add_to_cart()
-		
-		update_cart("_Test Item", 0)
-		
-		quotation = _get_cart_quotation()
-		self.assertEquals(quotation0.doc.name, quotation.doc.name)
-		
-		quotation_items = quotation.doclist.get({"parentfield": "quotation_details", "item_code": "_Test Item"})
-		self.assertEquals(quotation_items, [])
-		
-	def test_place_order(self):
-		quotation = self.test_update_cart()
-		sales_order_name = place_order()
-		sales_order = webnotes.bean("Sales Order", sales_order_name)
-		self.assertEquals(sales_order.doclist.getone({"item_code": "_Test Item"}).prevdoc_docname, quotation.doc.name)
-		
\ No newline at end of file
diff --git a/erpnext/selling/utils/product.py b/erpnext/selling/utils/product.py
deleted file mode 100644
index 98b7d6a..0000000
--- a/erpnext/selling/utils/product.py
+++ /dev/null
@@ -1,128 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-
-import webnotes
-from webnotes.utils import cstr, cint, fmt_money
-from webnotes.webutils import delete_page_cache
-from erpnext.selling.utils.cart import _get_cart_quotation
-
-@webnotes.whitelist(allow_guest=True)
-def get_product_info(item_code):
-	"""get product price / stock info"""
-	if not cint(webnotes.conn.get_default("shopping_cart_enabled")):
-		return {}
-	
-	cart_quotation = _get_cart_quotation()
-	
-	price_list = webnotes.local.request.cookies.get("selling_price_list")
-
-	warehouse = webnotes.conn.get_value("Item", item_code, "website_warehouse")
-	if warehouse:
-		in_stock = webnotes.conn.sql("""select actual_qty from tabBin where
-			item_code=%s and warehouse=%s""", (item_code, warehouse))
-		if in_stock:
-			in_stock = in_stock[0][0] > 0 and 1 or 0
-	else:
-		in_stock = -1
-		
-	price = price_list and webnotes.conn.sql("""select ref_rate, currency from
-		`tabItem Price` where item_code=%s and price_list=%s""", 
-		(item_code, price_list), as_dict=1) or []
-	
-	price = price and price[0] or None
-	qty = 0
-
-	if price:
-		price["formatted_price"] = fmt_money(price["ref_rate"], currency=price["currency"])
-		
-		price["currency"] = not cint(webnotes.conn.get_default("hide_currency_symbol")) \
-			and (webnotes.conn.get_value("Currency", price.currency, "symbol") or price.currency) \
-			or ""
-		
-		if webnotes.session.user != "Guest":
-			item = cart_quotation.doclist.get({"item_code": item_code})
-			if item:
-				qty = item[0].qty
-
-	return {
-		"price": price,
-		"stock": in_stock,
-		"uom": webnotes.conn.get_value("Item", item_code, "stock_uom"),
-		"qty": qty
-	}
-
-@webnotes.whitelist(allow_guest=True)
-def get_product_list(search=None, start=0, limit=10):
-	# base query
-	query = """select name, item_name, page_name, website_image, item_group, 
-			web_long_description as website_description
-		from `tabItem` where docstatus = 0 and show_in_website = 1 """
-	
-	# search term condition
-	if search:
-		query += """and (web_long_description like %(search)s or
-				item_name like %(search)s or name like %(search)s)"""
-		search = "%" + cstr(search) + "%"
-	
-	# order by
-	query += """order by weightage desc, modified desc limit %s, %s""" % (start, limit)
-
-	data = webnotes.conn.sql(query, {
-		"search": search,
-	}, as_dict=1)
-	
-	return [get_item_for_list_in_html(r) for r in data]
-
-
-def get_product_list_for_group(product_group=None, start=0, limit=10):
-	child_groups = ", ".join(['"' + i[0] + '"' for i in get_child_groups(product_group)])
-
-	# base query
-	query = """select name, item_name, page_name, website_image, item_group, 
-			web_long_description as website_description
-		from `tabItem` where docstatus = 0 and show_in_website = 1
-		and (item_group in (%s)
-			or name in (select parent from `tabWebsite Item Group` where item_group in (%s))) """ % (child_groups, child_groups)
-	
-	query += """order by weightage desc, modified desc limit %s, %s""" % (start, limit)
-
-	data = webnotes.conn.sql(query, {"product_group": product_group}, as_dict=1)
-
-	return [get_item_for_list_in_html(r) for r in data]
-
-def get_child_groups(item_group_name):
-	item_group = webnotes.doc("Item Group", item_group_name)
-	return webnotes.conn.sql("""select name 
-		from `tabItem Group` where lft>=%(lft)s and rgt<=%(rgt)s
-			and show_in_website = 1""", item_group.fields)
-
-def get_group_item_count(item_group):
-	child_groups = ", ".join(['"' + i[0] + '"' for i in get_child_groups(item_group)])
-	return webnotes.conn.sql("""select count(*) from `tabItem` 
-		where docstatus = 0 and show_in_website = 1
-		and (item_group in (%s)
-			or name in (select parent from `tabWebsite Item Group` 
-				where item_group in (%s))) """ % (child_groups, child_groups))[0][0]
-
-def get_item_for_list_in_html(context):
-	return webnotes.get_template("templates/includes/product_in_grid.html").render(context)
-
-def scrub_item_for_list(r):
-	if not r.website_description:
-		r.website_description = "No description given"
-	if len(r.website_description.split(" ")) > 24:
-		r.website_description = " ".join(r.website_description.split(" ")[:24]) + "..."
-
-def get_parent_item_groups(item_group_name):
-	item_group = webnotes.doc("Item Group", item_group_name)
-	return webnotes.conn.sql("""select name, page_name from `tabItem Group`
-		where lft <= %s and rgt >= %s 
-		and ifnull(show_in_website,0)=1
-		order by lft asc""", (item_group.lft, item_group.rgt), as_dict=True)
-		
-def invalidate_cache_for(item_group):
-	for i in get_parent_item_groups(item_group):
-		if i.page_name:
-			delete_page_cache(i.page_name)
\ No newline at end of file
diff --git a/erpnext/setup/doctype/authorization_rule/authorization_rule.js b/erpnext/setup/doctype/authorization_rule/authorization_rule.js
index bd42618..66b14a8 100644
--- a/erpnext/setup/doctype/authorization_rule/authorization_rule.js
+++ b/erpnext/setup/doctype/authorization_rule/authorization_rule.js
@@ -69,10 +69,10 @@
 
 
 cur_frm.fields_dict.system_user.get_query = function(doc,cdt,cdn) {
-  return{ query:"core.doctype.profile.profile.profile_query" } }
+  return{ query:"webnotes.core.doctype.profile.profile.profile_query" } }
 
 cur_frm.fields_dict.approving_user.get_query = function(doc,cdt,cdn) {
-  return{ query:"core.doctype.profile.profile.profile_query" } }
+  return{ query:"webnotes.core.doctype.profile.profile.profile_query" } }
 
 cur_frm.fields_dict['approving_role'].get_query = cur_frm.fields_dict['system_role'].get_query;
 
diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py
index 6b989d5..02fe374 100644
--- a/erpnext/setup/doctype/item_group/item_group.py
+++ b/erpnext/setup/doctype/item_group/item_group.py
@@ -6,6 +6,7 @@
 
 from webnotes.utils.nestedset import DocTypeNestedSet
 from webnotes.webutils import WebsiteGenerator
+from webnotes.webutils import delete_page_cache
 
 class DocType(DocTypeNestedSet, WebsiteGenerator):
 	def __init__(self, doc, doclist=[]):
@@ -19,7 +20,6 @@
 		
 		self.validate_name_with_item()
 		
-		from erpnext.selling.utils.product import invalidate_cache_for
 		invalidate_cache_for(self.doc.name)
 				
 		self.validate_one_root()
@@ -29,22 +29,22 @@
 			webnotes.msgprint("An item exists with same name (%s), please change the \
 				item group name or rename the item" % self.doc.name, raise_exception=1)
 		
-	def get_context(self):
-		from erpnext.selling.utils.product import get_product_list_for_group, \
-			get_parent_item_groups, get_group_item_count
+def get_group_item_count(item_group):
+	child_groups = ", ".join(['"' + i[0] + '"' for i in get_child_groups(item_group)])
+	return webnotes.conn.sql("""select count(*) from `tabItem` 
+		where docstatus = 0 and show_in_website = 1
+		and (item_group in (%s)
+			or name in (select parent from `tabWebsite Item Group` 
+				where item_group in (%s))) """ % (child_groups, child_groups))[0][0]
 
-		self.doc.sub_groups = webnotes.conn.sql("""select name, page_name
-			from `tabItem Group` where parent_item_group=%s
-			and ifnull(show_in_website,0)=1""", self.doc.name, as_dict=1)
-
-		for d in self.doc.sub_groups:
-			d.count = get_group_item_count(d.name)
-			
-		self.doc.items = get_product_list_for_group(product_group = self.doc.name, limit=100)
-		self.parent_groups = get_parent_item_groups(self.doc.name)
-		self.doc.title = self.doc.name
-
-		if self.doc.slideshow:
-			from webnotes.website.doctype.website_slideshow.website_slideshow import get_slideshow
-			get_slideshow(self)
-		
\ No newline at end of file
+def get_parent_item_groups(item_group_name):
+	item_group = webnotes.doc("Item Group", item_group_name)
+	return webnotes.conn.sql("""select name, page_name from `tabItem Group`
+		where lft <= %s and rgt >= %s 
+		and ifnull(show_in_website,0)=1
+		order by lft asc""", (item_group.lft, item_group.rgt), as_dict=True)
+		
+def invalidate_cache_for(item_group):
+	for i in get_parent_item_groups(item_group):
+		if i.page_name:
+			delete_page_cache(i.page_name)
diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.py b/erpnext/setup/doctype/sales_partner/sales_partner.py
index 4ab99b1..c2309e8 100644
--- a/erpnext/setup/doctype/sales_partner/sales_partner.py
+++ b/erpnext/setup/doctype/sales_partner/sales_partner.py
@@ -26,18 +26,3 @@
 			return contact_details
 		else:
 			return ''
-			
-	def get_context(self):
-		address = webnotes.conn.get_value("Address", 
-			{"sales_partner": self.doc.name, "is_primary_address": 1}, 
-			"*", as_dict=True)
-		if address:
-			city_state = ", ".join(filter(None, [address.city, address.state]))
-			address_rows = [address.address_line1, address.address_line2,
-				city_state, address.pincode, address.country]
-				
-			self.doc.fields.update({
-				"email": address.email_id,
-				"partner_address": filter_strip_join(address_rows, "\n<br>"),
-				"phone": filter_strip_join(cstr(address.phone).split(","), "\n<br>")
-			})
\ No newline at end of file
diff --git a/erpnext/setup/doctype/sales_partner/templates/__init__.py b/erpnext/setup/doctype/sales_partner/templates/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/setup/doctype/sales_partner/templates/__init__.py
+++ /dev/null
diff --git a/erpnext/setup/doctype/sales_partner/templates/generators/__init__.py b/erpnext/setup/doctype/sales_partner/templates/generators/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/setup/doctype/sales_partner/templates/generators/__init__.py
+++ /dev/null
diff --git a/erpnext/setup/doctype/sales_partner/templates/generators/partner.html b/erpnext/setup/doctype/sales_partner/templates/generators/partner.html
deleted file mode 100644
index f0e43f0..0000000
--- a/erpnext/setup/doctype/sales_partner/templates/generators/partner.html
+++ /dev/null
@@ -1,26 +0,0 @@
-{% extends base_template %}
-
-{% block content %}
-	<div class="container content" itemscope itemtype="http://schema.org/Organization">
-		<div class="row">
-			<div class="col-md-4">
-				{% if logo -%}
-				<img itemprop="brand" src="{{ logo }}" class="partner-logo" 
-					alt="{{ partner_name }}" title="{{ partner_name }}" />
-				<br><br>
-				{%- endif %}
-				<address>
-					{% if partner_website -%}<p><a href="{{ partner_website }}" 
-						target="_blank">{{ partner_website }}</a></p>{%- endif %}
-					{% if partner_address -%}<p itemprop="address">{{ partner_address }}</p>{%- endif %}
-					{% if phone -%}<p itemprop="telephone">{{ phone }}</p>{%- endif %}
-					{% if email -%}<p itemprop="email"><span class="icon-envelope"></span> {{ email }}</p>{%- endif %}
-				</address>
-			</div>
-			<div class="col-md-8">
-				<h3 itemprop="name" style="margin-top: 0px;">{{ partner_name }}</h3>
-				<p>{{ description }}</p>
-			</div>
-		</div>
-	</div>
-{% endblock %}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/sales_partner/templates/generators/partner.py b/erpnext/setup/doctype/sales_partner/templates/generators/partner.py
deleted file mode 100644
index 2229f03..0000000
--- a/erpnext/setup/doctype/sales_partner/templates/generators/partner.py
+++ /dev/null
@@ -1,2 +0,0 @@
-doctype = "Sales Partner"
-condition_field = "show_in_website"
\ No newline at end of file
diff --git a/erpnext/setup/doctype/sales_partner/templates/pages/__init__.py b/erpnext/setup/doctype/sales_partner/templates/pages/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/setup/doctype/sales_partner/templates/pages/__init__.py
+++ /dev/null
diff --git a/erpnext/setup/doctype/sales_partner/templates/pages/partners.html b/erpnext/setup/doctype/sales_partner/templates/pages/partners.html
deleted file mode 100644
index eabceb2..0000000
--- a/erpnext/setup/doctype/sales_partner/templates/pages/partners.html
+++ /dev/null
@@ -1,30 +0,0 @@
-{% extends base_template %}
-
-{% set title="Partners" %}
-
-{% block content %}
-	<div class="container content">
-		<h2 id="blog-title">{{ title }}</h2>
-		<hr>
-		{% for partner_info in partners %}
-		<div class="row">
-			<div class="col-md-3">
-				{% if partner_info.logo -%}
-				<a href="{{ partner_info.page_name }}">
-					<img itemprop="brand" src="{{ partner_info.logo }}" class="partner-logo" 
-						alt="{{ partner_info.partner_name }}" title="{{ partner_info.partner_name }}" />
-				</a>
-				{%- endif %}
-			</div>
-			<div class="col-md-9">
-				<a href="{{ partner_info.page_name }}">
-					<h4>{{ partner_info.partner_name }}</h4>
-				</a>
-				<p style="color: #999">{{ partner_info.territory }} - {{ partner_info.partner_type }}</p>
-				<p>{{ partner_info.introduction }}</p>
-			</div>
-		</div>
-		<hr>
-		{% endfor %}
-	</div>
-{% endblock %}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/sales_partner/templates/pages/partners.py b/erpnext/setup/doctype/sales_partner/templates/pages/partners.py
deleted file mode 100644
index 5245ec0..0000000
--- a/erpnext/setup/doctype/sales_partner/templates/pages/partners.py
+++ /dev/null
@@ -1,7 +0,0 @@
-import webnotes
-
-def get_context():
-	return {
-		"partners": webnotes.conn.sql("""select * from `tabSales Partner`
-			where show_in_website=1 order by name asc""", as_dict=True),
-	}
\ No newline at end of file
diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py
index 262771d..f9723e1 100644
--- a/erpnext/startup/event_handlers.py
+++ b/erpnext/startup/event_handlers.py
@@ -29,13 +29,6 @@
 			login_manager.user=='Administrator' and '#8CA2B3' or '#1B750D')
 		webnotes.conn.commit()
 		
-	if webnotes.conn.get_value("Profile", webnotes.session.user, "user_type") == "Website User":
-		from erpnext.selling.utils.cart import set_cart_count
-		set_cart_count()
-		
-def on_logout(login_manager):
-	webnotes._response.set_cookie("cart_count", "")
-		
 def check_if_expired():
 	"""check if account is expired. If expired, do not allow login"""
 	from webnotes import conf
diff --git a/erpnext/startup/webutils.py b/erpnext/startup/webutils.py
index ef8c88b..3abd192 100644
--- a/erpnext/startup/webutils.py
+++ b/erpnext/startup/webutils.py
@@ -1,29 +1,10 @@
 # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 # License: GNU General Public License v3. See license.txt
 
+from __future__ import unicode_literals
+
 import webnotes
-from webnotes.utils import cint
 
 def update_website_context(context):
-	post_login = []
-	cart_enabled = cint(webnotes.conn.get_default("shopping_cart_enabled"))
-	if cart_enabled:
-		post_login += [{"label": "Cart", "url": "cart", "icon": "icon-shopping-cart", "class": "cart-count"},
-			{"class": "divider"}]
-		
-	post_login += [
-				{"label": "Profile", "url": "profile", "icon": "icon-user"},
-				{"label": "Addresses", "url": "addresses", "icon": "icon-map-marker"},
-				{"label": "My Orders", "url": "orders", "icon": "icon-list"},
-				{"label": "My Tickets", "url": "tickets", "icon": "icon-tags"},
-				{"label": "Invoices", "url": "invoices", "icon": "icon-file-text"},
-				{"label": "Shipments", "url": "shipments", "icon": "icon-truck"},
-				{"class": "divider"}
-			]
-	context.update({
-		"shopping_cart_enabled": cart_enabled,
-		"post_login": post_login + context.get("post_login", [])
-	})
-	
 	if not context.get("favicon"):
 		context["favicon"] = "app/images/favicon.ico"
\ No newline at end of file
diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt
index 96c01f6..7caa89d 100644
--- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt
+++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-04-22 13:15:44", 
   "docstatus": 0, 
-  "modified": "2013-12-20 19:23:08", 
+  "modified": "2013-12-31 18:23:03", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -52,16 +52,6 @@
  }, 
  {
   "doctype": "DocField", 
-  "fieldname": "customer_item_code", 
-  "fieldtype": "Data", 
-  "hidden": 1, 
-  "in_list_view": 0, 
-  "label": "Customer's Item Code", 
-  "print_hide": 1, 
-  "read_only": 1
- }, 
- {
-  "doctype": "DocField", 
   "fieldname": "item_name", 
   "fieldtype": "Data", 
   "in_list_view": 0, 
@@ -76,6 +66,21 @@
  }, 
  {
   "doctype": "DocField", 
+  "fieldname": "col_break1", 
+  "fieldtype": "Column Break"
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "customer_item_code", 
+  "fieldtype": "Data", 
+  "hidden": 1, 
+  "in_list_view": 0, 
+  "label": "Customer's Item Code", 
+  "print_hide": 1, 
+  "read_only": 1
+ }, 
+ {
+  "doctype": "DocField", 
   "fieldname": "description", 
   "fieldtype": "Small Text", 
   "in_list_view": 1, 
@@ -109,21 +114,6 @@
  }, 
  {
   "doctype": "DocField", 
-  "fieldname": "stock_uom", 
-  "fieldtype": "Link", 
-  "in_list_view": 0, 
-  "label": "UOM", 
-  "oldfieldname": "stock_uom", 
-  "oldfieldtype": "Data", 
-  "options": "UOM", 
-  "print_hide": 0, 
-  "print_width": "50px", 
-  "read_only": 1, 
-  "reqd": 1, 
-  "width": "50px"
- }, 
- {
-  "doctype": "DocField", 
   "fieldname": "ref_rate", 
   "fieldtype": "Currency", 
   "in_list_view": 0, 
@@ -153,6 +143,45 @@
  }, 
  {
   "doctype": "DocField", 
+  "fieldname": "col_break2", 
+  "fieldtype": "Column Break"
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "stock_uom", 
+  "fieldtype": "Link", 
+  "in_list_view": 0, 
+  "label": "UOM", 
+  "oldfieldname": "stock_uom", 
+  "oldfieldtype": "Data", 
+  "options": "UOM", 
+  "print_hide": 0, 
+  "print_width": "50px", 
+  "read_only": 1, 
+  "reqd": 1, 
+  "width": "50px"
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "base_ref_rate", 
+  "fieldtype": "Currency", 
+  "in_list_view": 0, 
+  "label": "Price List Rate (Company Currency)", 
+  "oldfieldname": "base_ref_rate", 
+  "oldfieldtype": "Currency", 
+  "options": "Company:company:default_currency", 
+  "print_hide": 1, 
+  "print_width": "100px", 
+  "read_only": 1, 
+  "width": "100px"
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "section_break_1", 
+  "fieldtype": "Section Break"
+ }, 
+ {
+  "doctype": "DocField", 
   "fieldname": "export_rate", 
   "fieldtype": "Currency", 
   "in_list_view": 1, 
@@ -183,17 +212,8 @@
  }, 
  {
   "doctype": "DocField", 
-  "fieldname": "base_ref_rate", 
-  "fieldtype": "Currency", 
-  "in_list_view": 0, 
-  "label": "Price List Rate (Company Currency)", 
-  "oldfieldname": "base_ref_rate", 
-  "oldfieldtype": "Currency", 
-  "options": "Company:company:default_currency", 
-  "print_hide": 1, 
-  "print_width": "100px", 
-  "read_only": 1, 
-  "width": "100px"
+  "fieldname": "col_break3", 
+  "fieldtype": "Column Break"
  }, 
  {
   "doctype": "DocField", 
@@ -272,31 +292,6 @@
   "read_only": 0
  }, 
  {
-  "doctype": "DocField", 
-  "fieldname": "expense_account", 
-  "fieldtype": "Link", 
-  "hidden": 0, 
-  "label": "Expense Account", 
-  "no_copy": 1, 
-  "options": "Account", 
-  "print_hide": 1, 
-  "read_only": 0, 
-  "width": "120px"
- }, 
- {
-  "default": ":Company", 
-  "doctype": "DocField", 
-  "fieldname": "cost_center", 
-  "fieldtype": "Link", 
-  "hidden": 0, 
-  "label": "Cost Center", 
-  "no_copy": 1, 
-  "options": "Cost Center", 
-  "print_hide": 1, 
-  "read_only": 0, 
-  "width": "120px"
- }, 
- {
   "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>", 
   "doctype": "DocField", 
   "fieldname": "item_group", 
@@ -325,6 +320,22 @@
  }, 
  {
   "doctype": "DocField", 
+  "fieldname": "item_tax_rate", 
+  "fieldtype": "Small Text", 
+  "hidden": 1, 
+  "label": "Item Tax Rate", 
+  "oldfieldname": "item_tax_rate", 
+  "oldfieldtype": "Small Text", 
+  "print_hide": 1, 
+  "read_only": 1
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "col_break4", 
+  "fieldtype": "Column Break"
+ }, 
+ {
+  "doctype": "DocField", 
   "fieldname": "actual_qty", 
   "fieldtype": "Float", 
   "label": "Available Qty at Warehouse", 
@@ -338,30 +349,44 @@
  }, 
  {
   "doctype": "DocField", 
-  "fieldname": "installed_qty", 
-  "fieldtype": "Float", 
-  "label": "Installed Qty", 
+  "fieldname": "expense_account", 
+  "fieldtype": "Link", 
+  "hidden": 0, 
+  "label": "Expense Account", 
   "no_copy": 1, 
-  "oldfieldname": "installed_qty", 
-  "oldfieldtype": "Currency", 
+  "options": "Account", 
   "print_hide": 1, 
-  "print_width": "150px", 
-  "read_only": 1, 
-  "width": "150px"
+  "read_only": 0, 
+  "width": "120px"
+ }, 
+ {
+  "default": ":Company", 
+  "doctype": "DocField", 
+  "fieldname": "cost_center", 
+  "fieldtype": "Link", 
+  "hidden": 0, 
+  "label": "Cost Center", 
+  "no_copy": 1, 
+  "options": "Cost Center", 
+  "print_hide": 1, 
+  "read_only": 0, 
+  "width": "120px"
  }, 
  {
   "doctype": "DocField", 
   "fieldname": "against_sales_order", 
   "fieldtype": "Link", 
   "label": "Against Sales Order", 
-  "options": "Sales Order"
+  "options": "Sales Order", 
+  "read_only": 1
  }, 
  {
   "doctype": "DocField", 
   "fieldname": "against_sales_invoice", 
   "fieldtype": "Link", 
   "label": "Against Sales Invoice", 
-  "options": "Sales Invoice"
+  "options": "Sales Invoice", 
+  "read_only": 1
  }, 
  {
   "doctype": "DocField", 
@@ -381,14 +406,16 @@
  }, 
  {
   "doctype": "DocField", 
-  "fieldname": "item_tax_rate", 
-  "fieldtype": "Small Text", 
-  "hidden": 1, 
-  "label": "Item Tax Rate", 
-  "oldfieldname": "item_tax_rate", 
-  "oldfieldtype": "Small Text", 
+  "fieldname": "installed_qty", 
+  "fieldtype": "Float", 
+  "label": "Installed Qty", 
+  "no_copy": 1, 
+  "oldfieldname": "installed_qty", 
+  "oldfieldtype": "Currency", 
   "print_hide": 1, 
-  "read_only": 1
+  "print_width": "150px", 
+  "read_only": 1, 
+  "width": "150px"
  }, 
  {
   "doctype": "DocField", 
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index a3ee5a3..fb6f73d 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -198,7 +198,7 @@
 				self.doc.name, raise_exception=1)
 
 	def update_website(self):
-		from erpnext.selling.utils.product import invalidate_cache_for
+		from erpnext.setup.doctype.item_group.item_group import invalidate_cache_for
 		invalidate_cache_for(self.doc.item_group)
 		[invalidate_cache_for(d.item_group) for d in \
 			self.doclist.get({"doctype":"Website Item Group"})]
@@ -221,15 +221,6 @@
 	def get_tax_rate(self, tax_type):
 		return { "tax_rate": webnotes.conn.get_value("Account", tax_type, "tax_rate") }
 
-	def get_context(self):
-		from erpnext.selling.utils.product import get_parent_item_groups
-		self.parent_groups = get_parent_item_groups(self.doc.item_group) + [{"name":self.doc.name}]
-		self.doc.title = self.doc.item_name
-
-		if self.doc.slideshow:
-			from webnotes.website.doctype.website_slideshow.website_slideshow import get_slideshow
-			get_slideshow(self)								
-
 	def get_file_details(self, arg = ''):
 		file = webnotes.conn.sql("select file_group, description from tabFile where name = %s", eval(arg)['file_name'], as_dict = 1)
 
diff --git a/erpnext/stock/doctype/item/templates/__init__.py b/erpnext/stock/doctype/item/templates/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/stock/doctype/item/templates/__init__.py
+++ /dev/null
diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.js b/erpnext/stock/doctype/packing_slip/packing_slip.js
index a0e82e7..992b00d 100644
--- a/erpnext/stock/doctype/packing_slip/packing_slip.js
+++ b/erpnext/stock/doctype/packing_slip/packing_slip.js
@@ -11,7 +11,7 @@
 cur_frm.fields_dict['item_details'].grid.get_field('item_code').get_query = 
 		function(doc, cdt, cdn) {
 			return {
-				query: "stock.doctype.packing_slip.packing_slip.item_details",
+				query: "erpnext.stock.doctype.packing_slip.packing_slip.item_details",
 				filters:{ 'delivery_note': doc.delivery_note}
 			}
 }
diff --git a/erpnext/stock/doctype/price_list/price_list.py b/erpnext/stock/doctype/price_list/price_list.py
index d0e5d2b..7644af5 100644
--- a/erpnext/stock/doctype/price_list/price_list.py
+++ b/erpnext/stock/doctype/price_list/price_list.py
@@ -29,9 +29,6 @@
 	def on_update(self):
 		self.set_default_if_missing()
 		self.update_item_price()
-		cart_settings = webnotes.get_obj("Shopping Cart Settings")
-		if cint(cart_settings.doc.enabled):
-			cart_settings.validate_price_lists()
 				
 	def set_default_if_missing(self):
 		if self.doc.buying_or_selling=="Selling":
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index ec46685..6bd9564 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -12,7 +12,7 @@
 		var me = this;
 		
 		this.frm.fields_dict.delivery_note_no.get_query = function() {
-			return { query: "stock.doctype.stock_entry.stock_entry.query_sales_return_doc" };
+			return { query: "erpnext.stock.doctype.stock_entry.stock_entry.query_sales_return_doc" };
 		};
 		
 		this.frm.fields_dict.sales_invoice_no.get_query = 
@@ -28,7 +28,7 @@
 			if(in_list(["Sales Return", "Purchase Return"], me.frm.doc.purpose) && 
 				me.get_doctype_docname()) {
 					return {
-						query: "stock.doctype.stock_entry.stock_entry.query_return_item",
+						query: "erpnext.stock.doctype.stock_entry.stock_entry.query_return_item",
 						filters: {
 							purpose: me.frm.doc.purpose,
 							delivery_note_no: me.frm.doc.delivery_note_no,
@@ -309,7 +309,7 @@
 	var d = locals[cdt][cdn];		
 	if(d.item_code) {
 		return{
-			query: "stock.doctype.stock_entry.stock_entry.get_batch_no",
+			query: "erpnext.stock.doctype.stock_entry.stock_entry.get_batch_no",
 			filters:{
 				'item_code': d.item_code,
 				's_warehouse': d.s_warehouse,
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 078b8f5..f1485f3 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -288,11 +288,12 @@
 				if not returnable_qty:
 					webnotes.throw("{item}: {item_code} {returned}".format(
 						item=_("Item"), item_code=item.item_code, 
-						returned=_("already returned though some other documents")), StockOverReturnError)
+						returned=_("already returned though some other documents")), 
+						StockOverReturnError)
 				elif item.transfer_qty > returnable_qty:
 					webnotes.throw("{item}: {item_code}, {returned}: {qty}".format(
 						item=_("Item"), item_code=item.item_code,
-						returned=_("Max Returnable Qty"), qty=returnable_qty))
+						returned=_("Max Returnable Qty"), qty=returnable_qty), StockOverReturnError)
 						
 	def get_already_returned_item_qty(self, ref_fieldname):
 		return dict(webnotes.conn.sql("""select item_code, sum(transfer_qty) as qty
diff --git a/erpnext/templates/generators/__init__.py b/erpnext/templates/generators/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/templates/generators/__init__.py
+++ /dev/null
diff --git a/erpnext/templates/generators/item.html b/erpnext/templates/generators/item.html
deleted file mode 100644
index 91ea3e4..0000000
--- a/erpnext/templates/generators/item.html
+++ /dev/null
@@ -1,87 +0,0 @@
-{% extends base_template %}
-
-{% block javascript %}
-<script>
-	{% include "templates/includes/product_page.js" %}
-	
-	$(function() {
-		if(window.logged_in && getCookie("system_user")==="yes") {
-			wn.has_permission("Item", "{{ name }}", "write", function(r) {
-				wn.require("assets/webnotes/js/wn/website/editable.js");
-				wn.make_editable($('[itemprop="description"]'), "Item", "{{ name }}", "web_long_description");
-			});
-		}
-	});
-</script>
-{% endblock %}
-
-{% block css %}
-<style>
-	{% include "templates/includes/product_page.css" %}
-</style>
-{% endblock %}
-
-{% block content %}
-	{% include 'templates/includes/product_search_box.html' %}
-	{% include 'templates/includes/product_breadcrumbs.html' %}
-	<div class="container content product-page-content" itemscope itemtype="http://schema.org/Product">
-		<div class="row">
-			<div class="col-md-6">
-				{% if slideshow %}
-					{% include "templates/includes/slideshow.html" %}
-				{% else %}
-					{% if website_image %}
-					<image itemprop="image" class="item-main-image"
-						src="{{ website_image }}" />
-					{% else %}
-					<div class="img-area">
-		{% include 'templates/includes/product_missing_image.html' %}
-					</div>
-					{% endif %}
-				{% endif %}
-			</div>
-			<div class="col-md-6">
-				<h3 itemprop="name" style="margin-top: 0px;">{{ item_name }}</h3>
-				<p class="help">Item Code: <span itemprop="productID">{{ name }}</span></p>
-				<h4>Product Description</h4>
-				<div itemprop="description">
-				{{ web_long_description or description or "[No description given]" }}
-				</div>
-				<div style="min-height: 100px; margin: 10px 0;">
-					<div class="item-price-info" style="display: none;">
-						<h4 class="item-price" itemprop="price"></h4>
-						<div class="item-stock" itemprop="availablity"></div>
-						<div id="item-add-to-cart">
-							<button class="btn btn-primary">
-								<i class="icon-shopping-cart"></i> Add to Cart</button>
-						</div>
-						<div id="item-update-cart" class="input-group col-md-4" style="display: none;
-							padding-left: 0px; padding-right: 0px;">
-							<input class="form-control" type="text">
-							<div class="input-group-btn">
-								<button class="btn btn-primary">
-									<i class="icon-ok"></i></button>
-							</div>
-						</div>
-					</div>
-				</div>
-			</div>
-		</div>
-		{% if obj.doclist.get({"doctype":"Item Website Specification"}) -%}
-		<div class="row" style="margin-top: 20px">
-			<div class="col-md-12">
-				<h4>Specifications</h4>
-				<table class="table table-bordered" style="width: 100%">
-				{% for d in obj.doclist.get(
-					{"doctype":"Item Website Specification"}) -%}
-					<tr>
-						<td style="width: 30%;">{{ d.label }}</td>
-						<td>{{ d.description }}</td>
-					</tr>
-				{%- endfor %}
-				</table>
-			</div>
-		</div>
-		{%- endif %}
-	</div>
-{% endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/generators/item.py b/erpnext/templates/generators/item.py
deleted file mode 100644
index c9146d1..0000000
--- a/erpnext/templates/generators/item.py
+++ /dev/null
@@ -1,2 +0,0 @@
-doctype = "Item"
-condition_field = "show_in_website"
\ No newline at end of file
diff --git a/erpnext/templates/generators/item_group.html b/erpnext/templates/generators/item_group.html
deleted file mode 100644
index c5fcd90..0000000
--- a/erpnext/templates/generators/item_group.html
+++ /dev/null
@@ -1,52 +0,0 @@
-{% extends base_template %}
-
-{% block content %}
-{% include 'templates/includes/product_search_box.html' %}
-{% include 'templates/includes/product_breadcrumbs.html' %}
-<div class="container content">
-	{% if slideshow %}<!-- slideshow -->
-	{% include "templates/includes/slideshow.html" %}
-	{% endif %}
-	{% if description %}<!-- description -->
-	<div itemprop="description">{{ description or ""}}</div>
-	{% else %}
-	<h3>{{ name }}</h3>
-	{% endif %}
-</div>
-<div class="container content">
-	{% if sub_groups %}
-	<hr />
-	<div class="row">
-	{% for d in sub_groups %}
-		<div class="col-md-4">
-			<a href="{{ d.page_name }}">{{ d.name }} ({{ d.count }})</a>
-		</div>
-	{% endfor %}
-	</div>
-	<hr />
-	{% endif %}
-	{% if items %}
-	<div id="search-list" class="row">
-		{% for item in items %}
-			{{ item }}
-		{% endfor %}
-	</div>
-		{% if (items|length)==100 %}
-			<div class="alert alert-info info">Showing top 100 items.</div>
-		{% endif %}
-	{% else %}
-		<div class="alert alert-warning">No items listed.</div>
-	{% endif %}
-</div>
-<script>
-$(function() {
-	if(window.logged_in && getCookie("system_user")==="yes") {
-		wn.has_permission("Item Group", "{{ name }}", "write", function(r) {
-			wn.require("assets/webnotes/js/wn/website/editable.js");
-			wn.make_editable($('[itemprop="description"]'), "Item Group", "{{ name }}", "description");
-		});
-	}
-});
-</script>
-
-{% endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/generators/item_group.py b/erpnext/templates/generators/item_group.py
deleted file mode 100644
index 12ef513..0000000
--- a/erpnext/templates/generators/item_group.py
+++ /dev/null
@@ -1,2 +0,0 @@
-doctype = "Item Group"
-condition_field = "show_in_website"
\ No newline at end of file
diff --git a/erpnext/templates/includes/cart.js b/erpnext/templates/includes/cart.js
deleted file mode 100644
index c521b6c..0000000
--- a/erpnext/templates/includes/cart.js
+++ /dev/null
@@ -1,294 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-// License: GNU General Public License v3. See license.txt
-
-// js inside blog page
-
-$(document).ready(function() {
-	erpnext.cart.bind_events();
-	return wn.call({
-		type: "POST",
-		method: "erpnext.selling.utils.cart.get_cart_quotation",
-		callback: function(r) {
-			$("#cart-container").removeClass("hide");
-			$(".progress").remove();
-			if(r.exc) {
-				if(r.exc.indexOf("WebsitePriceListMissingError")!==-1) {
-					erpnext.cart.show_error("Oops!", wn._("Price List not configured."));
-				} else if(r["403"]) {
-					erpnext.cart.show_error("Hey!", wn._("You need to be logged in to view your cart."));
-				} else {
-					erpnext.cart.show_error("Oops!", wn._("Something went wrong."));
-				}
-			} else {
-				erpnext.cart.set_cart_count();
-				erpnext.cart.render(r.message);
-			}
-		}
-	});
-});
-
-// shopping cart
-if(!erpnext.cart) erpnext.cart = {};
-$.extend(erpnext.cart, {
-	show_error: function(title, text) {
-		$("#cart-container").html('<div class="well"><h4>' + title + '</h4> ' + text + '</div>');
-	},
-	
-	bind_events: function() {
-		// bind update button
-		$(document).on("click", ".item-update-cart button", function() {
-			var item_code = $(this).attr("data-item-code");
-			erpnext.cart.update_cart({
-				item_code: item_code,
-				qty: $('input[data-item-code="'+item_code+'"]').val(),
-				with_doclist: 1,
-				btn: this,
-				callback: function(r) {
-					if(!r.exc) {
-						erpnext.cart.render(r.message);
-						var $button = $('button[data-item-code="'+item_code+'"]').addClass("btn-success");
-						setTimeout(function() { $button.removeClass("btn-success"); }, 1000);
-					}
-				},
-			});
-		});
-		
-		$("#cart-add-shipping-address").on("click", function() {
-			window.location.href = "address?address_fieldname=shipping_address_name";
-		});
-		
-		$("#cart-add-billing-address").on("click", function() {
-			window.location.href = "address?address_fieldname=customer_address";
-		});
-		
-		$(".btn-place-order").on("click", function() {
-			erpnext.cart.place_order(this);
-		});
-	},
-	
-	render: function(out) {
-		var doclist = out.doclist;
-		var addresses = out.addresses;
-		
-		var $cart_items = $("#cart-items").empty();
-		var $cart_taxes = $("#cart-taxes").empty();
-		var $cart_totals = $("#cart-totals").empty();
-		var $cart_billing_address = $("#cart-billing-address").empty();
-		var $cart_shipping_address = $("#cart-shipping-address").empty();
-		
-		var no_items = $.map(doclist, function(d) { return d.item_code || null;}).length===0;
-		if(no_items) {
-			erpnext.cart.show_error("Empty :-(", wn._("Go ahead and add something to your cart."));
-			$("#cart-addresses").toggle(false);
-			return;
-		}
-		
-		var shipping_rule_added = false;
-		var taxes_exist = false;
-		var shipping_rule_labels = $.map(out.shipping_rules || [], function(rule) { return rule[1]; });
-		$.each(doclist, function(i, doc) {
-			if(doc.doctype === "Quotation Item") {
-				erpnext.cart.render_item_row($cart_items, doc);
-			} else if (doc.doctype === "Sales Taxes and Charges") {
-				if(out.shipping_rules && out.shipping_rules.length && 
-					shipping_rule_labels.indexOf(doc.description)!==-1) {
-						shipping_rule_added = true;
-						erpnext.cart.render_tax_row($cart_taxes, doc, out.shipping_rules);
-				} else {
-					erpnext.cart.render_tax_row($cart_taxes, doc);
-				}
-				
-				taxes_exist = true;
-			}
-		});
-		
-		if(out.shipping_rules && out.shipping_rules.length && !shipping_rule_added) {
-			erpnext.cart.render_tax_row($cart_taxes, {description: "", formatted_tax_amount: ""},
-				out.shipping_rules);
-			taxes_exist = true;
-		}
-		
-		if(taxes_exist)
-			$('<hr>').appendTo($cart_taxes);
-			
-		erpnext.cart.render_tax_row($cart_totals, {
-			description: "<strong>Total</strong>", 
-			formatted_tax_amount: "<strong>" + doclist[0].formatted_grand_total_export + "</strong>"
-		});
-		
-		if(!(addresses && addresses.length)) {
-			$cart_shipping_address.html('<div class="well">'+wn._("Hey! Go ahead and add an address")+'</div>');
-		} else {
-			erpnext.cart.render_address($cart_shipping_address, addresses, doclist[0].shipping_address_name);
-			erpnext.cart.render_address($cart_billing_address, addresses, doclist[0].customer_address);
-		}
-	},
-	
-	render_item_row: function($cart_items, doc) {
-		doc.image_html = doc.website_image ?
-			'<div style="height: 120px; overflow: hidden;"><img src="' + doc.website_image + '" /></div>' :
-			'{% include "stock/doctype/item/templates/includes/product_missing_image.html" %}';
-			
-		if(doc.description === doc.item_name) doc.description = "";
-		
-		$(repl('<div class="row">\
-			<div class="col-md-9 col-sm-9">\
-				<div class="row">\
-					<div class="col-md-3">%(image_html)s</div>\
-					<div class="col-md-9">\
-						<h4><a href="%(page_name)s">%(item_name)s</a></h4>\
-						<p>%(description)s</p>\
-					</div>\
-				</div>\
-			</div>\
-			<div class="col-md-3 col-sm-3 text-right">\
-				<div class="input-group item-update-cart">\
-					<input type="text" placeholder="Qty" value="%(qty)s" \
-						data-item-code="%(item_code)s" class="text-right form-control">\
-					<div class="input-group-btn">\
-						<button class="btn btn-primary" data-item-code="%(item_code)s">\
-							<i class="icon-ok"></i></button>\
-					</div>\
-				</div>\
-				<p style="margin-top: 10px;">at %(formatted_rate)s</p>\
-				<small class="text-muted" style="margin-top: 10px;">= %(formatted_amount)s</small>\
-			</div>\
-		</div><hr>', doc)).appendTo($cart_items);
-	},
-	
-	render_tax_row: function($cart_taxes, doc, shipping_rules) {
-		var shipping_selector;
-		if(shipping_rules) {
-			shipping_selector = '<select class="form-control">' + $.map(shipping_rules, function(rule) { 
-					return '<option value="' + rule[0] + '">' + rule[1] + '</option>' }).join("\n") + 
-				'</select>';
-		}
-		
-		var $tax_row = $(repl('<div class="row">\
-			<div class="col-md-9 col-sm-9">\
-				<div class="row">\
-					<div class="col-md-9 col-md-offset-3">' +
-					(shipping_selector || '<p>%(description)s</p>') +
-					'</div>\
-				</div>\
-			</div>\
-			<div class="col-md-3 col-sm-3 text-right">\
-				<p' + (shipping_selector ? ' style="margin-top: 5px;"' : "") + '>%(formatted_tax_amount)s</p>\
-			</div>\
-		</div>', doc)).appendTo($cart_taxes);
-		
-		if(shipping_selector) {
-			$tax_row.find('select option').each(function(i, opt) {
-				if($(opt).html() == doc.description) {
-					$(opt).attr("selected", "selected");
-				}
-			});
-			$tax_row.find('select').on("change", function() {
-				erpnext.cart.apply_shipping_rule($(this).val(), this);
-			});
-		}
-	},
-	
-	apply_shipping_rule: function(rule, btn) {
-		return wn.call({
-			btn: btn,
-			type: "POST",
-			method: "erpnext.selling.utils.cart.apply_shipping_rule",
-			args: { shipping_rule: rule },
-			callback: function(r) {
-				if(!r.exc) {
-					erpnext.cart.render(r.message);
-				}
-			}
-		});
-	},
-	
-	render_address: function($address_wrapper, addresses, address_name) {
-		$.each(addresses, function(i, address) {
-			$(repl('<div class="panel panel-default"> \
-				<div class="panel-heading"> \
-					<div class="row"> \
-						<div class="col-md-10 address-title" \
-							data-address-name="%(name)s"><strong>%(name)s</strong></div> \
-						<div class="col-md-2"><input type="checkbox" \
-							data-address-name="%(name)s"></div> \
-					</div> \
-				</div> \
-				<div class="panel-collapse collapse" data-address-name="%(name)s"> \
-					<div class="panel-body">%(display)s</div> \
-				</div> \
-			</div>', address))
-				.css({"margin": "10px auto"})
-				.appendTo($address_wrapper);
-		});
-		
-		$address_wrapper.find(".panel-heading")
-			.find(".address-title")
-				.css({"cursor": "pointer"})
-				.on("click", function() {
-					$address_wrapper.find('.panel-collapse[data-address-name="'
-						+$(this).attr("data-address-name")+'"]').collapse("toggle");
-				});
-			
-		$address_wrapper.find('input[type="checkbox"]').on("click", function() {
-			if($(this).prop("checked")) {
-				var me = this;
-				$address_wrapper.find('input[type="checkbox"]').each(function(i, chk) {
-					if($(chk).attr("data-address-name")!=$(me).attr("data-address-name")) {
-						$(chk).prop("checked", false);
-					}
-				});
-				
-				return wn.call({
-					type: "POST",
-					method: "erpnext.selling.utils.cart.update_cart_address",
-					args: {
-						address_fieldname: $address_wrapper.attr("data-fieldname"),
-						address_name: $(this).attr("data-address-name")
-					},
-					callback: function(r) {
-						if(!r.exc) {
-							erpnext.cart.render(r.message);
-						}
-					}
-				});
-			} else {
-				return false;
-			}
-		});
-		
-		$address_wrapper.find('input[type="checkbox"][data-address-name="'+ address_name +'"]')
-			.prop("checked", true);
-			
-		$address_wrapper.find(".panel-collapse").collapse({
-			parent: $address_wrapper,
-			toggle: false
-		});
-		
-		$address_wrapper.find('.panel-collapse[data-address-name="'+ address_name +'"]')
-			.collapse("show");
-	},
-	
-	place_order: function(btn) {
-		return wn.call({
-			type: "POST",
-			method: "erpnext.selling.utils.cart.place_order",
-			btn: btn,
-			callback: function(r) {
-				if(r.exc) {
-					var msg = "";
-					if(r._server_messages) {
-						msg = JSON.parse(r._server_messages || []).join("<br>");
-					}
-					
-					$("#cart-error")
-						.empty()
-						.html(msg || wn._("Something went wrong!"))
-						.toggle(true);
-				} else {
-					window.location.href = "order?name=" + encodeURIComponent(r.message);
-				}
-			}
-		});
-	}
-});
\ No newline at end of file
diff --git a/erpnext/templates/includes/product_breadcrumbs.html b/erpnext/templates/includes/product_breadcrumbs.html
deleted file mode 100644
index e880364..0000000
--- a/erpnext/templates/includes/product_breadcrumbs.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{% if obj.parent_groups and (obj.parent_groups|length) > 1 %}
-<div class="container">
-	<ul class="breadcrumb">
-		{% for ig in obj.parent_groups[:-1] %}
-		<li><a href="{{ ig.page_name }}.html">{{ ig.name }}</a></li>
-		{% endfor %}
-		<li class="active">{{ obj.parent_groups[-1].name }}</li>
-	</ul>
-</div>
-{% endif %}
\ No newline at end of file
diff --git a/erpnext/templates/includes/product_in_grid.html b/erpnext/templates/includes/product_in_grid.html
deleted file mode 100644
index d99ad00..0000000
--- a/erpnext/templates/includes/product_in_grid.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<div class="col-md-3">
-	<div style="height: 120px; overflow: hidden;">
-		<a href="{{ page_name }}">
-		{%- if website_image -%}
-		<img class="product-image" style="width: 80%; margin: auto;" src="{{ website_image }}">
-		{%- else -%}
-		{% include 'stock/doctype/item/templates/includes/product_missing_image.html' %}
-		{%- endif -%}
-		</a>
-	</div>
-	<div style="height: 100px; overflow: hidden; font-size: 80%;">
-		<h4 style="margin-bottom: 2px;"><a href="{{ page_name }}">{{ item_name }}</a></h4>
-	</div>
-</div>
\ No newline at end of file
diff --git a/erpnext/templates/includes/product_in_list.html b/erpnext/templates/includes/product_in_list.html
deleted file mode 100644
index f895ab6..0000000
--- a/erpnext/templates/includes/product_in_list.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!-- TODO product listing -->
-<div class="container content">
-	<div style="height: 120px; overflow: hidden;">
-		<a href="{{ page_name }}">
-		{%- if website_image -%}
-		<img class="product-image" style="width: 80%; margin: auto;" src="{{ website_image }}">
-		{%- else -%}
-		{% include 'website/templates/html/product_missing_image.html' %}
-		{%- endif -%}
-		</a>
-	</div>
-	<div style="height: 100px; overflow: hidden; font-size: 80%;">
-		<h4 style="margin-bottom: 2px;"><a href="{{ page_name }}">{{ item_name }}</a></h4>
-	</div>
-</div>
\ No newline at end of file
diff --git a/erpnext/templates/includes/product_list.js b/erpnext/templates/includes/product_list.js
deleted file mode 100644
index ac84c00..0000000
--- a/erpnext/templates/includes/product_list.js
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-// License: GNU General Public License v3. See license.txt
-
-window.get_product_list = function() {
-	$(".more-btn .btn").click(function() {
-		window.get_product_list()
-	});
-	
-	if(window.start==undefined) {
-		throw "product list not initialized (no start)"
-	}
-	
-	$.ajax({
-		method: "GET",
-		url: "/",
-		dataType: "json",
-		data: {
-			cmd: "erpnext.selling.utils.product.get_product_list",
-			start: window.start,
-			search: window.search,
-			product_group: window.product_group
-		},
-		dataType: "json",
-		success: function(data) {
-			window.render_product_list(data.message);
-		}
-	})
-}
-
-window.render_product_list = function(data) {
-	if(data.length) {
-		var table = $("#search-list .table");
-		if(!table.length)
-			var table = $("<table class='table'>").appendTo("#search-list");
-			
-		$.each(data, function(i, d) {
-			$(d).appendTo(table);
-		});
-	}
-	if(data.length < 10) {
-		if(!table) {
-			$(".more-btn")
-				.replaceWith("<div class='alert alert-warning'>No products found.</div>");
-		} else {
-			$(".more-btn")
-				.replaceWith("<div class='text-muted'>Nothing more to show.</div>");
-		}
-	} else {
-		$(".more-btn").toggle(true)
-	}
-	window.start += (data.length || 0);
-}
diff --git a/erpnext/templates/includes/product_missing_image.html b/erpnext/templates/includes/product_missing_image.html
deleted file mode 100644
index 81b8935..0000000
--- a/erpnext/templates/includes/product_missing_image.html
+++ /dev/null
@@ -1 +0,0 @@
-<div class="missing-image"><i class="icon-camera"></i></div>
\ No newline at end of file
diff --git a/erpnext/templates/includes/product_page.css b/erpnext/templates/includes/product_page.css
deleted file mode 100644
index 457fc62..0000000
--- a/erpnext/templates/includes/product_page.css
+++ /dev/null
@@ -1,13 +0,0 @@
-	<style>
-		.item-main-image {
-			max-width: 100%;
-			margin: auto;
-		}
-		.web-long-description {
-			font-size: 18px;
-			line-height: 200%;
-		}
-		.item-stock {
-			margin-bottom: 10px !important;
-		}
-	</style>
\ No newline at end of file
diff --git a/erpnext/templates/includes/product_page.js b/erpnext/templates/includes/product_page.js
deleted file mode 100644
index 5029b90..0000000
--- a/erpnext/templates/includes/product_page.js
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-// License: GNU General Public License v3. See license.txt
-
-$(document).ready(function() {
-	var item_code = $('[itemscope] [itemprop="productID"]').text().trim();
-	var qty = 0;
-	
-	wn.call({
-		type: "POST",
-		method: "erpnext.selling.utils.product.get_product_info",
-		args: {
-			item_code: "{{ name }}"
-		},
-		callback: function(r) {
-			if(r.message && r.message.price) {
-				$(".item-price")
-					.html(r.message.price.formatted_price + " per " + r.message.uom);
-				
-				if(r.message.stock==0) {
-					$(".item-stock").html("<div class='help'>Not in stock</div>");
-				}
-				else if(r.message.stock==1) {
-					$(".item-stock").html("<div style='color: green'>\
-						<i class='icon-check'></i> Available (in stock)</div>");
-				}
-				
-				$(".item-price-info").toggle(true);
-				
-				if(r.message.qty) {
-					qty = r.message.qty;
-					toggle_update_cart(qty);
-					$("#item-update-cart input").val(qty);
-				}
-			}
-		}
-	})
-	
-	$("#item-add-to-cart button").on("click", function() {
-		erpnext.cart.update_cart({
-			item_code: item_code,
-			qty: 1,
-			callback: function(r) {
-				if(!r.exc) {
-					toggle_update_cart(1);
-					qty = 1;
-				}
-			},
-			btn: this, 
-		});
-	});
-	
-	$("#item-update-cart button").on("click", function() {
-		erpnext.cart.update_cart({
-			item_code: item_code,
-			qty: $("#item-update-cart input").val(),
-			btn: this,
-			callback: function(r) {
-				if(r.exc) {
-					$("#item-update-cart input").val(qty);
-				} else {
-					qty = $("#item-update-cart input").val();
-				}
-			},
-		});
-	});
-	
-	if(localStorage && localStorage.getItem("pending_add_to_cart") && full_name) {
-		localStorage.removeItem("pending_add_to_cart");
-		$("#item-add-to-cart button").trigger("click");
-	}
-});
-
-var toggle_update_cart = function(qty) {
-	$("#item-add-to-cart").toggle(qty ? false : true);
-	$("#item-update-cart")
-		.toggle(qty ? true : false)
-		.find("input").val(qty);
-}
\ No newline at end of file
diff --git a/erpnext/templates/includes/product_search_box.html b/erpnext/templates/includes/product_search_box.html
deleted file mode 100644
index 0f44eea..0000000
--- a/erpnext/templates/includes/product_search_box.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<div class="container" style="margin-bottom: 7px;">
-	<form class="form-inline form-search row">
-		<div class="input-group col-md-4 col-md-offset-8">
-			<input class="form-control" type="text" id="product-search" placeholder="Product Search...">
-			<span class="input-group-btn">
-				<button class="btn btn-default" type="button" id="btn-product-search">
-					<i class="icon-search"></i></button>
-			</span>
-		</div>
-	</form>
-	<script>
-		// redirect to product search page
-		$(document).ready(function() {
-			$('.dropdown-toggle').dropdown();
-			$("#btn-product-search").click(function() {
-				var txt = $("#product-search").val();
-				if(txt) {
-					window.location.href="product_search?q=" + txt;
-				}
-				return false;
-			});
-			$("#product-search").keypress(function(e) {
-				if(e.which==13) $("#btn-product-search").click();
-			});
-			$(".form-search").on("submit", function() { return false; });
-		});
-	</script>
-</div>
\ No newline at end of file
diff --git a/erpnext/templates/includes/transactions.html b/erpnext/templates/includes/transactions.html
deleted file mode 100644
index 6148f18..0000000
--- a/erpnext/templates/includes/transactions.html
+++ /dev/null
@@ -1,60 +0,0 @@
-{% extends base_template %}
-
-{% block content -%}
-<div class="container content">
-    <ul class="breadcrumb">
-    	<li><a href="index">Home</a></li>
-    	<li class="active"><i class="{{ icon }} icon-fixed-width"></i> {{ title }}</li>
-    </ul>
-	<p id="msgprint-alert" class="alert alert-danger" 
-		style="display: none;">&nbsp;</p>
-	<div class="list-group transaction-list">
-		<div class="progress progress-striped active">
-			<div class="progress-bar progress-bar-info" style="width: 100%;"></div>
-		</div>
-	</div>
-	<div class="text-center">
-		<button class="btn btn-default btn-show-more hide">More</button>
-	</div>
-</div>
-{%- endblock %}
-
-{% block javascript -%}
-<script>
-$(document).ready(function() {
-	window.start = 0;
-	window.$list = $(".transaction-list");
-	window.$show_more = $(".btn-show-more").on("click", function() { get_transactions(this); })
-	
-	get_transactions();
-});
-
-var get_transactions = function(btn) {
-	wn.call({
-		method: "{{ method }}",
-		args: { start: start },
-		btn: btn,
-		callback: function(r) {
-			$list.find(".progress").remove();
-			$show_more.toggleClass("hide", !(r.message && r.message.length===20));
-			if(!(r.message && r.message.length)) {
-				console.log("empty");
-				if(!$list.html().trim()) {
-					$list.html("<div class='alert alert-warning'>\
-						{{ empty_list_message }}</div>");
-				}
-				return;
-			}
-		
-			start += r.message.length;
-		
-			$.each(r.message, function(i, doc) {
-				render(doc);
-			});
-		}
-	})
-};
-</script>
-
-<!-- // var render = function(doc) { }; -->
-{% endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/__init__.py b/erpnext/templates/pages/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/templates/pages/__init__.py
+++ /dev/null
diff --git a/erpnext/templates/pages/address.html b/erpnext/templates/pages/address.html
deleted file mode 100644
index 5eaefd5..0000000
--- a/erpnext/templates/pages/address.html
+++ /dev/null
@@ -1,114 +0,0 @@
-{% extends base_template %}
-
-{% set title=doc and doc.name or "New Address" %}
-{% set docname=(doc and doc.name or "") %}
-
-{% macro render_fields(docfields) -%}
-{% for df in docfields -%}
-	{% if df.fieldtype in ["Data", "Link"] -%}
-	<fieldset>
-		<label>{{ df.label }}</label>
-		<input class="form-control" type="text" placeholder="Type {{ df.label }}" 
-			data-fieldname="{{ df.fieldname }}" data-fieldtype="{{ df.fieldtype }}"
-			{% if doc and doc.fields.get(df.fieldname) -%} value="{{ doc.fields[df.fieldname] }}" {%- endif %}>
-	</fieldset>
-	{% elif df.fieldtype == "Check" -%}
-	<fieldset class="checkbox">
-		<label><input type="checkbox" data-fieldname="{{ df.fieldname }}" 
-			data-fieldtype="{{ df.fieldtype }}" 
-			{% if doc and cint(doc.fields.get(df.fieldname)) -%} checked="checked" {%- endif %}> 
-			{{ df.label }}</label>
-	</fieldset>
-	{% elif df.fieldtype == "Select" -%}
-	<fieldset>
-		<label>{{ df.label }}</label>
-		<select class="form-control" data-fieldname="{{ df.fieldname }}" data-fieldtype="{{ df.fieldtype }}">
-			{% for value in df.options.split("\n") -%}
-			{% if doc and doc.fields.get(df.fieldname) == value -%}
-			<option selected="selected">{{ value }}</option>
-			{% else -%}
-			<option>{{ value }}</option>
-			{%- endif %}
-			{%- endfor %}
-		</select>
-	</fieldset>
-	{%- endif %}
-{%- endfor %}
-{%- endmacro %}
-
-{% block content %}
-<div class="container content">
-    <ul class="breadcrumb">
-    	<li><a href="index">Home</a></li>
-    	<li><a href="addresses">My Addresses</a></li>
-    	<li class="active"><i class="icon-map-marker icon-fixed-width"></i> {{ title }}</li>
-    </ul>
-	<h3><i class="icon-map-marker icon-fixed-width"></i> {{ title }}</h3>
-	<button type="button" class="btn btn-primary pull-right" id="address-save"><i class="icon-ok"></i> 
-		{{ doc and "Save" or "Insert" }}</button>
-	<div class="clearfix"></div>
-	<hr>
-	<div id="address-error" class="alert alert-danger" style="display: none;"></div>
-	<form autocomplete="on">
-		<div class="row">
-			<section class="col-md-6">
-				{{ render_fields(meta.left_fields) }}
-			</section>
-			<section class="col-md-6">
-				{{ render_fields(meta.right_fields) }}
-			</section>
-		</section>
-	</form>
-</div>
-
-<script>
-;(function() {
-	$(document).ready(function() {
-		bind_save();
-	});
-	
-	var bind_save = function() {
-		$("#address-save").on("click", function() {
-			var fields = {
-				name: "{{ docname }}"
-			};
-
-			$("form").find("[data-fieldname]").each(function(i, input) {
-				var $input = $(input);
-				var fieldname = $(input).attr("data-fieldname");
-				var fieldtype = $(input).attr("data-fieldtype");
-				
-				if(fieldtype == "Check") {
-					fields[fieldname] = $input.is(":checked") ? 1 : 0;
-				} else {
-					fields[fieldname] = $input.val();
-				}
-			});
-			
-			wn.call({
-				btn: $(this),
-				type: "POST",
-				method: "selling.utils.cart.save_address",
-				args: { fields: fields, address_fieldname: get_url_arg("address_fieldname") },
-				callback: function(r) {
-					if(r.exc) {
-						var msg = "";
-						if(r._server_messages) {
-							msg = JSON.parse(r._server_messages || []).join("<br>");
-						}
-						
-						$("#address-error")
-							.html(msg || "Something went wrong!")
-							.toggle(true);
-					} else if(get_url_arg("address_fieldname")) {
-						window.location.href = "cart";
-					} else {
-						window.location.href = "address?name=" + encodeURIComponent(r.message);
-					}
-				}
-			});
-		});
-	};
-})();
-</script>
-{% endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/address.py b/erpnext/templates/pages/address.py
deleted file mode 100644
index 9918e5f..0000000
--- a/erpnext/templates/pages/address.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-from webnotes.utils import cint
-
-no_cache = True
-
-def get_context():
-	def _get_fields(fieldnames):
-		return [webnotes._dict(zip(["label", "fieldname", "fieldtype", "options"], 
-				[df.label, df.fieldname, df.fieldtype, df.options]))
-			for df in webnotes.get_doctype("Address", processed=True).get({"fieldname": ["in", fieldnames]})]
-	
-	bean = None
-	if webnotes.form_dict.name:
-		bean = webnotes.bean("Address", webnotes.form_dict.name)
-	
-	return {
-		"doc": bean.doc if bean else None,
-		"meta": webnotes._dict({
-			"left_fields": _get_fields(["address_title", "address_type", "address_line1", "address_line2",
-				"city", "state", "pincode", "country"]),
-			"right_fields": _get_fields(["email_id", "phone", "fax", "is_primary_address",
-				"is_shipping_address"])
-		}),
-		"cint": cint
-	}
-	
diff --git a/erpnext/templates/pages/addresses.html b/erpnext/templates/pages/addresses.html
deleted file mode 100644
index 6fe36a9..0000000
--- a/erpnext/templates/pages/addresses.html
+++ /dev/null
@@ -1,51 +0,0 @@
-{% extends base_template %}
-
-{% set title="My Addresses" %}
-
-{% block content %}
-<div class="container content">
-    <ul class="breadcrumb">
-    	<li><a href="index">Home</a></li>
-    	<li class="active"><i class="icon-map-marker icon-fixed-width"></i> My Addresses</li>
-    </ul>
-	<p><a class="btn btn-default" href="address"><i class="icon-plus"> New Address</i></a></p>
-	<hr>
-	<div id="address-list">
-		<div class="progress progress-striped active">
-			<div class="progress-bar progress-bar-info" style="width: 100%;"></div>
-		</div>
-	</div>
-</div>
-
-<script>
-;(function() {
-	$(document).ready(function() {
-		fetch_addresses();
-	});
-	
-	var fetch_addresses = function() {
-		wn.call({
-			method: "selling.utils.cart.get_addresses",
-			callback: function(r) {
-				$("#address-list .progress").remove();
-				var $list = $("#address-list");
-			
-				if(!(r.message && r.message.length)) {
-					$list.html("<div class='alert'>No Addresses Found</div>");
-					return;
-				}
-			
-				$.each(r.message, function(i, address) {
-					address.url_name = encodeURIComponent(address.name);
-					$(repl('<div> \
-						<p><a href="address?name=%(url_name)s">%(name)s</a></p> \
-						<p>%(display)s</p> \
-						<hr> \
-					</div>', address)).appendTo($list);
-				});
-			}
-		});
-	};
-})();
-</script>
-{% endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/addresses.py b/erpnext/templates/pages/addresses.py
deleted file mode 100644
index 41f6b56..0000000
--- a/erpnext/templates/pages/addresses.py
+++ /dev/null
@@ -1,6 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-
-no_cache = True
\ No newline at end of file
diff --git a/erpnext/templates/pages/cart.html b/erpnext/templates/pages/cart.html
deleted file mode 100644
index 8aae9d9..0000000
--- a/erpnext/templates/pages/cart.html
+++ /dev/null
@@ -1,57 +0,0 @@
-{% extends base_template %}
-
-{% block javascript %}
-<script>{% include "templates/includes/cart.js" %}</script>
-{% endblock %}
-
-{% set title="Shopping Cart" %}
-
-{% block content %}
-<div class="container content">
-	<h2><i class="icon-shopping-cart"></i> {{ title }}</h2>
-	<div class="progress progress-striped active">
-		<div class="progress-bar progress-bar-info" style="width: 100%;"></div>
-	</div>
-	<div id="cart-container" class="hide">
-		<p class="pull-right"><button class="btn btn-success btn-place-order" type="button">Place Order</button></p>
-		<div class="clearfix"></div>
-		<div id="cart-error" class="alert alert-danger" style="display: none;"></div>
-		<hr>
-		<div class="row">
-			<div class="col-md-9 col-sm-9">
-				<div class="row">
-					<div class="col-md-9 col-md-offset-3"><h4>Item Details</h4></div>
-				</div>
-			</div>
-			<div class="col-md-3 col-sm-3 text-right"><h4>Qty, Amount</h4></div>
-		</div><hr>
-		<div id="cart-items">
-		</div>
-		<div id="cart-taxes">
-		</div>
-		<div id="cart-totals">
-		</div>
-		<hr>
-		<div id="cart-addresses">
-			<div class="row">
-				<div class="col-md-6">
-					<h4>Shipping Address</h4>
-					<div id="cart-shipping-address" class="panel-group" 
-						data-fieldname="shipping_address_name"></div>
-					<button class="btn btn-default" type="button" id="cart-add-shipping-address">
-						<span class="icon icon-plus"></span> New Shipping Address</button>
-				</div>
-				<div class="col-md-6">
-					<h4>Billing Address</h4>
-					<div id="cart-billing-address" class="panel-group"
-						data-fieldname="customer_address"></div>
-					<button class="btn btn-default" type="button" id="cart-add-billing-address">
-						<span class="icon icon-plus"></span> New Billing Address</button>
-				</div>
-			</div>
-			<hr>
-		</div>
-		<p class="pull-right"><button class="btn btn-success btn-place-order" type="button">Place Order</button></p>
-	</div>
-</div>
-{% endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/cart.py b/erpnext/templates/pages/cart.py
deleted file mode 100644
index ee55e5c..0000000
--- a/erpnext/templates/pages/cart.py
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-
-no_cache = True
-no_sitemap = True
\ No newline at end of file
diff --git a/erpnext/templates/pages/invoice.html b/erpnext/templates/pages/invoice.html
deleted file mode 100644
index 45867ea..0000000
--- a/erpnext/templates/pages/invoice.html
+++ /dev/null
@@ -1,5 +0,0 @@
-{% extends "templates/sale.html" %}
-
-{% block status -%}
-	{% if doc.status %}{{ doc.status }}{% endif %}
-{%- endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/invoice.py b/erpnext/templates/pages/invoice.py
deleted file mode 100644
index 9d6a558..0000000
--- a/erpnext/templates/pages/invoice.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-from webnotes import _
-from webnotes.utils import flt, fmt_money
-
-no_cache = True
-
-def get_context():
-	from erpnext.templates.utils import get_transaction_context
-	context = get_transaction_context("Sales Invoice", webnotes.form_dict.name)
-	modify_status(context.get("doc"))
-	context.update({
-		"parent_link": "invoices",
-		"parent_title": "Invoices"
-	})
-	return context
-	
-def modify_status(doc):
-	doc.status = ""
-	if flt(doc.outstanding_amount):
-		doc.status = '<span class="label %s"><i class="icon-fixed-width %s"></i> %s</span>' % \
-			("label-warning", "icon-exclamation-sign", 
-			_("To Pay") + " = " + fmt_money(doc.outstanding_amount, currency=doc.currency))
-	else:
-		doc.status = '<span class="label %s"><i class="icon-fixed-width %s"></i> %s</span>' % \
-			("label-success", "icon-ok", _("Paid"))
-		
\ No newline at end of file
diff --git a/erpnext/templates/pages/invoices.html b/erpnext/templates/pages/invoices.html
deleted file mode 100644
index 0467f34..0000000
--- a/erpnext/templates/pages/invoices.html
+++ /dev/null
@@ -1 +0,0 @@
-{% extends "templates/sales_transactions.html" %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/invoices.py b/erpnext/templates/pages/invoices.py
deleted file mode 100644
index 448c525..0000000
--- a/erpnext/templates/pages/invoices.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-
-no_cache = True
-
-def get_context():
-	from erpnext.templates.utils import get_currency_context
-	context = get_currency_context()
-	context.update({
-		"title": "Invoices",
-		"method": "accounts.doctype.sales_invoice.templates.pages.invoices.get_invoices",
-		"icon": "icon-file-text",
-		"empty_list_message": "No Invoices Found",
-		"page": "invoice"
-	})
-	return context
-	
-@webnotes.whitelist()
-def get_invoices(start=0):
-	from erpnext.templates.utils import get_transaction_list
-	from erpnext.accounts.doctype.sales_invoice.templates.pages.invoice import modify_status
-	invoices = get_transaction_list("Sales Invoice", start, ["outstanding_amount"])
-	for d in invoices:
-		modify_status(d)
-	return invoices
\ No newline at end of file
diff --git a/erpnext/templates/pages/product_search.html b/erpnext/templates/pages/product_search.html
deleted file mode 100644
index 02c161c..0000000
--- a/erpnext/templates/pages/product_search.html
+++ /dev/null
@@ -1,33 +0,0 @@
-{% extends base_template %}
-
-{% set title="Product Search" %}
-
-{% block javascript %}
-<script>{% include "stock/doctype/item/templates/includes/product_list.js" %}</script>
-{% endblock %}
-
-{% block content %}
-<script>
-$(document).ready(function() {
-	var txt = get_url_arg("q");
-	$(".search-results").html("Search results for: " + txt);
-	window.search = txt;
-	window.start = 0;
-	window.get_product_list();
-});
-</script>
-
-{% include "stock/doctype/item/templates/includes/product_search_box.html" %}
-<div class="container content">
-	<h3 class="search-results">Search Results</h3>
-	<div id="search-list" class="row">
-		
-	</div>
-	<div style="text-align: center;">
-		<div class="more-btn" 
-			style="display: none; text-align: center;">
-			<button class="btn">More...</button>
-		</div>
-	</div>
-</div>
-{% endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/product_search.py b/erpnext/templates/pages/product_search.py
deleted file mode 100644
index 41f6b56..0000000
--- a/erpnext/templates/pages/product_search.py
+++ /dev/null
@@ -1,6 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-
-no_cache = True
\ No newline at end of file
diff --git a/erpnext/templates/pages/profile.html b/erpnext/templates/pages/profile.html
deleted file mode 100644
index 880b8d4..0000000
--- a/erpnext/templates/pages/profile.html
+++ /dev/null
@@ -1,55 +0,0 @@
-{% extends base_template %}
-
-{% set title="My Profile" %}
-
-{% block content %}
-<div class="container content">
-    <ul class="breadcrumb">
-    	<li><a href="index">Home</a></li>
-    	<li class="active"><i class="icon-user icon-fixed-width"></i> My Profile</li>
-    </ul>
-	<div class="alert alert-warning" id="message" style="display: none;"></div>
-	<form>
-		<fieldset>
-			<label>Full Name</label>
-			<input class="form-control" type="text" id="fullname" placeholder="Your Name">
-		</fieldset>
-		<fieldset>
-			<label>Company Name</label>
-			<input class="form-control" type="text" id="company_name" placeholder="Company Name" value="{{ company_name }}">
-		</fieldset>
-		<fieldset>
-			<label>Mobile No</label>
-			<input class="form-control" type="text" id="mobile_no" placeholder="Mobile No" value="{{ mobile_no }}">
-		</fieldset>
-		<fieldset>
-			<label>Phone</label>
-			<input class="form-control" type="text" id="phone" placeholder="Phone" value="{{ phone }}">
-		</fieldset>
-		<button id="update_profile" type="submit" class="btn btn-default">Update</button>
-	</form>
-</div>
-<script>
-$(document).ready(function() {
-	$("#fullname").val(getCookie("full_name") || "");
-	$("#update_profile").click(function() {
-		wn.call({
-			method: "erpnext.templates.pages.profile.update_profile",
-			type: "POST",
-			args: {
-				fullname: $("#fullname").val(),
-				company_name: $("#company_name").val(),
-				mobile_no: $("#mobile_no").val(),
-				phone: $("#phone").val()
-			},
-			btn: this,
-			msg: $("#message"),
-			callback: function(r) {
-				if(!r.exc) $("#user-full-name").html($("#fullname").val());
-			}
-		});
-		return false;
-	})
-})
-</script>
-{% endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/profile.py b/erpnext/templates/pages/profile.py
deleted file mode 100644
index 143abef..0000000
--- a/erpnext/templates/pages/profile.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-from webnotes import _
-from webnotes.utils import cstr
-
-no_cache = True
-no_sitemap = True
-
-def get_context():
-	from erpnext.selling.utils.cart import get_lead_or_customer
-	party = get_lead_or_customer()
-	if party.doctype == "Lead":
-		mobile_no = party.mobile_no
-		phone = party.phone
-	else:
-		mobile_no, phone = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user, 
-			"customer": party.name}, ["mobile_no", "phone"])
-		
-	return {
-		"company_name": cstr(party.customer_name if party.doctype == "Customer" else party.company_name),
-		"mobile_no": cstr(mobile_no),
-		"phone": cstr(phone)
-	}
-	
-@webnotes.whitelist()
-def update_profile(fullname, password=None, company_name=None, mobile_no=None, phone=None):
-	from erpnext.selling.utils.cart import update_party
-	update_party(fullname, company_name, mobile_no, phone)
-	
-	if not fullname:
-		return _("Name is required")
-		
-	webnotes.conn.set_value("Profile", webnotes.session.user, "first_name", fullname)
-	webnotes._response.set_cookie("full_name", fullname)
-	
-	return _("Updated")
-	
\ No newline at end of file
diff --git a/erpnext/templates/pages/shipment.html b/erpnext/templates/pages/shipment.html
deleted file mode 100644
index d0aaa3e..0000000
--- a/erpnext/templates/pages/shipment.html
+++ /dev/null
@@ -1 +0,0 @@
-{% extends "templates/sale.html" %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/shipment.py b/erpnext/templates/pages/shipment.py
deleted file mode 100644
index e744685..0000000
--- a/erpnext/templates/pages/shipment.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-
-no_cache = True
-
-def get_context():
-	from erpnext.templates.utils import get_transaction_context
-	context = get_transaction_context("Delivery Note", webnotes.form_dict.name)
-	context.update({
-		"parent_link": "shipments",
-		"parent_title": "Shipments"
-	})
-	return context
\ No newline at end of file
diff --git a/erpnext/templates/pages/shipments.html b/erpnext/templates/pages/shipments.html
deleted file mode 100644
index 0467f34..0000000
--- a/erpnext/templates/pages/shipments.html
+++ /dev/null
@@ -1 +0,0 @@
-{% extends "templates/sales_transactions.html" %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/shipments.py b/erpnext/templates/pages/shipments.py
deleted file mode 100644
index 03d074a..0000000
--- a/erpnext/templates/pages/shipments.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-
-no_cache = True
-
-def get_context():
-	from erpnext.templates.utils import get_currency_context
-	context = get_currency_context()
-	context.update({
-		"title": "Shipments",
-		"method": "erpnext.templates.pages.shipments.get_shipments",
-		"icon": "icon-truck",
-		"empty_list_message": "No Shipments Found",
-		"page": "shipment"
-	})
-	return context
-	
-@webnotes.whitelist()
-def get_shipments(start=0):
-	from erpnext.templates.utils import get_transaction_list
-	return get_transaction_list("Delivery Note", start)
diff --git a/erpnext/templates/pages/ticket.html b/erpnext/templates/pages/ticket.html
deleted file mode 100644
index 1732e77..0000000
--- a/erpnext/templates/pages/ticket.html
+++ /dev/null
@@ -1,121 +0,0 @@
-{% extends base_template %}
-
-{% set title=doc.name %}
-
-{% set status_label = {
-	"Open": "label-success",
-	"To Reply": "label-danger",
-	"Closed": "label-default"
-} %}
-
-{% block content %}
-<div class="container content">
-    <ul class="breadcrumb">
-    	<li><a href="index">Home</a></li>
-    	<li><a href="tickets">My Tickets</a></li>
-    	<li class="active"><i class="icon-ticket icon-fixed-width"></i> {{ doc.name }}</li>
-    </ul>
-	<h3><i class="icon-ticket icon-fixed-width"></i> {{ doc.name }}</h3>
-	{% if doc.name == "Not Allowed" -%}
-		<script>ask_to_login();</script>
-	{% else %}
-	<hr>
-	{%- if doc.status -%}
-	{% if doc.status == "Waiting for Customer" -%}
-		{% set status = "To Reply" %}
-	{% else %}
-		{% set status = doc.status %}
-	{%- endif -%}
-	<div class="row">
-		<div class="col-md-2" style="margin-bottom: 7px;">
-			<span class="label {{ status_label.get(status) or 'label-default' }}">{{ status }}</span>
-		</div>
-		<div class="col-md-8">
-			<div class="row col-md-12">{{ doc.subject }}</div>
-		</div>
-		<div class="col-md-2">
-			<span class="text-muted pull-right">{{ utils.formatdate(doc.creation) }}</span>
-		</div>
-	</div>
-	<div class="row">
-		<h4 class="col-xs-6">Messages</h4>
-		<div class="col-xs-6">
-			 <button class="btn btn-sm btn-primary pull-right" id="ticket-reply">
-				  <i class="icon-envelope icon-fixed-width"></i> Reply</button>
-			 <button class="btn btn-sm btn-success pull-right hide" id="ticket-reply-send">
-				  <i class="icon-arrow-right icon-fixed-width"></i> Send</button>
-		</div>
-	</div>
-	<p id="ticket-alert" class="alert alert-danger" 
-		style="display: none;">&nbsp;</p>
-	{%- if doclist.get({"doctype":"Communication"}) -%}
-	<div>
-		<table class="table table-bordered table-striped" id="ticket-thread">
-			<tbody>
-				{%- for comm in 
-					(doclist.get({"doctype":"Communication"})|sort(reverse=True, attribute="creation")) %}
-				<tr>
-					<td>
-					<h5 style="text-transform: none">
-						{{ comm.sender }} on {{ utils.formatdate(comm.creation) }}</h5>
-					<hr>
-					<p>{{ webnotes.utils.is_html(comm.content) and comm.content or
-						comm.content.replace("\n", "<br>")}}</p>
-					</td>
-				</tr>
-				{% endfor -%}
-			</tbody>
-		</table>
-	</div>
-	{%- else -%}
-	<div class="alert">No messages</div>
-	{%- endif -%}
-	{%- endif -%}
-	{% endif -%}
-</div>
-{% endblock %}
-
-{% block javascript %}
-<script>
-$(document).ready(function() {
-	$("#ticket-reply").on("click", function() {
-		if(!$("#ticket-reply-editor").length) {
-			$('<tr id="ticket-reply-editor"><td>\
-				<h5 style="text-transform: none">Reply</h5>\
-				<hr>\
-				<textarea rows=10 class="form-control" style="resize: vertical;"></textarea>\
-			</td></tr>').prependTo($("#ticket-thread").find("tbody"));
-			$("#ticket-reply").addClass("hide");
-			$("#ticket-reply-send").removeClass("hide");
-		}
-	});
-	
-	$("#ticket-reply-send").on("click", function() {
-		var reply = $("#ticket-reply-editor").find("textarea").val().trim();
-		if(!reply) {
-			msgprint("Please write something in reply!");
-		} else {
-			wn.call({
-				type: "POST",
-				method: "support.doctype.support_ticket.templates.pages.ticket.add_reply",
-				btn: this,
-				args: { ticket: "{{ doc.name }}", message: reply },
-				callback: function(r) {
-					if(r.exc) {
-						msgprint(r._server_messages 
-							? JSON.parse(r._server_messages).join("<br>")
-							: "Something went wrong!");
-					} else {
-						window.location.reload();
-					}
-				}
-			})
-		}
-	});
-});
-
-var msgprint = function(txt) {
-	if(txt) $("#ticket-alert").html(txt).toggle(true);
-}
-</script>
-{% endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/ticket.py b/erpnext/templates/pages/ticket.py
deleted file mode 100644
index f9e5c88..0000000
--- a/erpnext/templates/pages/ticket.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-from webnotes import _
-from webnotes.utils import today
-
-no_cache = True
-
-def get_context():
-	bean = webnotes.bean("Support Ticket", webnotes.form_dict.name)
-	if bean.doc.raised_by != webnotes.session.user:
-		return {
-			"doc": {"name": "Not Allowed"}
-		}
-	else:
-		return {
-			"doc": bean.doc,
-			"doclist": bean.doclist,
-			"webnotes": webnotes,
-			"utils": webnotes.utils
-		}
-
-@webnotes.whitelist()
-def add_reply(ticket, message):
-	if not message:
-		raise webnotes.throw(_("Please write something"))
-	
-	bean = webnotes.bean("Support Ticket", ticket)
-	if bean.doc.raised_by != webnotes.session.user:
-		raise webnotes.throw(_("You are not allowed to reply to this ticket."), webnotes.PermissionError)
-	
-	from webnotes.core.doctype.communication.communication import make
-	make(content=message, sender=bean.doc.raised_by, subject = bean.doc.subject,
-		doctype="Support Ticket", name=bean.doc.name,
-		date=today())
\ No newline at end of file
diff --git a/erpnext/templates/pages/tickets.html b/erpnext/templates/pages/tickets.html
deleted file mode 100644
index 6942d3b..0000000
--- a/erpnext/templates/pages/tickets.html
+++ /dev/null
@@ -1,87 +0,0 @@
-{% extends "templates/includes/transactions.html" %}
-
-{% block javascript -%}
-{{ super() }}
-
-<script>
-	var status_label = {
-		"Open": "label-success",
-		"Waiting for Customer": "label-danger",
-		"Closed": "label-default"
-	}
-
-	var render = function(doc) {
-		doc.status = doc.status.trim();
-		doc.label_class = status_label[doc.status] || "label-default";
-		if(doc.status==="Waiting for Customer") doc.status = "To Reply";
-	
-		$(repl('<a href="{{ page }}?name=%(name)s" class="list-group-item">\
-				<div class="row">\
-					<div class="col-md-2" style="margin-bottom: 7px;"><span class="label %(label_class)s">\
-						%(status)s</span></div>\
-					<div class="col-md-8">\
-						<div class="row col-md-12">%(name)s</div>\
-						<div class="row col-md-12 text-muted">%(subject)s</div>\
-					</div>\
-					<div class="col-md-2 pull-right">\
-						<span class="text-muted">%(creation)s</span>\
-					</div>\
-				</div>\
-			</a>', doc)).appendTo($list);
-	};
-	
-	$(document).ready(function() {
-		if(!window.$new_ticket) {
-			window.$new_ticket = $('<div>\
-					<button class="btn btn-primary" style="margin-bottom: 15px;" id="new-ticket">\
-						<i class="icon-tag icon-fixed-width"></i> New Ticket\
-					</button>\
-					<button class="btn btn-success hide" style="margin-bottom: 15px;" id="new-ticket-send">\
-						<i class="icon-arrow-right icon-fixed-width"></i> Send\
-					</button>\
-				</div>').insertBefore(".transaction-list");
-		}
-		
-		window.$new_ticket.find("#new-ticket").on("click", function() {
-			$(this).addClass("hide");
-			$(window.$new_ticket).find("#new-ticket-send").removeClass("hide");
-			$('<div class="well" id="ticket-editor">\
-					<div class="form-group"><input class="form-control" type="data"\
-						 placeholder="Subject" data-fieldname="subject"></div>\
-					<div class="form-group"><textarea rows=10 class="form-control" \
-						 style="resize: vertical;" placeholder="Message" \
-						 data-fieldname="message"></textarea></div>\
-				</div>')
-				.insertAfter(window.$new_ticket);
-		});
-		
-		window.$new_ticket.find("#new-ticket-send").on("click", function() {
-			var subject = $("#ticket-editor").find('[data-fieldname="subject"]').val().trim();
-			var message = $("#ticket-editor").find('[data-fieldname="message"]').val().trim();
-			if(!(subject && message)) {
-				msgprint("Please write something in subject and message!");
-			} else {
-				wn.call({
-					type: "POST",
-					method: "support.doctype.support_ticket.templates.pages.tickets.make_new_ticket",
-					btn: this,
-					args: { subject: subject, message: message },
-					callback: function(r) {
-						if(r.exc) {
-							msgprint(r._server_messages 
-								? JSON.parse(r._server_messages).join("<br>")
-								: "Something went wrong!");
-						} else {
-							window.location.href = "ticket?name=" + encodeURIComponent(r.message);
-						}
-					}
-				})
-			}
-		});
-	});
-	
-	var msgprint = function(txt) {
-		if(txt) $("#msgprint-alert").html(txt).toggle(true);
-	}
-</script>
-{%- endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/tickets.py b/erpnext/templates/pages/tickets.py
deleted file mode 100644
index 7434af2..0000000
--- a/erpnext/templates/pages/tickets.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-from webnotes.utils import cint, formatdate
-
-no_cache = True
-
-def get_context():
-	return {
-		"title": "My Tickets",
-		"method": "support.doctype.support_ticket.templates.pages.tickets.get_tickets",
-		"icon": "icon-ticket",
-		"empty_list_message": "No Tickets Raised",
-		"page": "ticket"
-	}
-
-@webnotes.whitelist()
-def get_tickets(start=0):
-	tickets = webnotes.conn.sql("""select name, subject, status, creation 
-		from `tabSupport Ticket` where raised_by=%s 
-		order by modified desc
-		limit %s, 20""", (webnotes.session.user, cint(start)), as_dict=True)
-	for t in tickets:
-		t.creation = formatdate(t.creation)
-	
-	return tickets
-	
-@webnotes.whitelist()
-def make_new_ticket(subject, message):
-	if not (subject and message):
-		raise webnotes.throw(_("Please write something in subject and message!"))
-		
-	from erpnext.support.doctype.support_ticket.get_support_mails import add_support_communication
-	ticket = add_support_communication(subject, message, webnotes.session.user)
-	
-	return ticket.doc.name
\ No newline at end of file
diff --git a/erpnext/templates/sale.html b/erpnext/templates/sale.html
deleted file mode 100644
index 5dc72c7..0000000
--- a/erpnext/templates/sale.html
+++ /dev/null
@@ -1,89 +0,0 @@
-{% extends base_template %}
-
-{% set title=doc.name %}
-
-{% block content %}
-<div class="container content">
-    <ul class="breadcrumb">
-    	<li><a href="index">Home</a></li>
-    	<li><a href="{{ parent_link }}">{{ parent_title }}</a></li>
-    	<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" -%}
-		<script>ask_to_login();</script>
-	{% else %}
-	<hr>
-	<div>
-	<div class="row">
-		<div class="col-xs-6">
-			{% block status -%}{%- endblock %}
-		</div>
-		<div class="col-xs-6">
-			<span class="pull-right">{{ utils.formatdate(doc.posting_date or doc.transaction_date) }}</span>
-		</div>
-	</div>
-	<br>
-	<div class="row">
-		<div class="col-md-12">
-		<table class="table table-bordered">
-			<tbody>
-				<tr>
-					<th>Sr</th>
-					<th>Item Name</th>
-					<th>Description</th>
-					<th>Qty</th>
-					<th>UoM</th>
-					<th>Basic Rate</th>
-					<th>Amount</th>
-				</tr>
-				{%- for row in doclist.get({"doctype": doc.doctype + " Item"}) %}
-				<tr>
-					<td style="width: 3%;">{{ row.idx }}</td>
-					<td style="width: 20%;">{{ row.item_name }}</td>
-					<td style="width: 37%;">{{ row.description }}</td>
-					<td style="width: 5%; text-align: right;">{{ row.qty }}</td>
-					<td style="width: 5%;">{{ row.stock_uom }}</td>
-					<td style="width: 15%; text-align: right;">{{ utils.fmt_money(row.export_rate, currency=doc.currency) }}</td>
-					<td style="width: 15%; text-align: right;">{{ utils.fmt_money(row.export_amount, currency=doc.currency) }}</td>
-				</tr>
-				{% endfor -%}
-			</tbody>
-		</table>
-		</div>
-	</div>
-	<div class="row">
-		<div class="col-md-6"></div>
-		<div class="col-md-6">
-		<table cellspacing=0 width=100%>
-		<tbody>
-			<tr>
-				<td>Net Total</td>
-				<td width=40% style="text-align: right;">{{
-					utils.fmt_money(doc.net_total/doc.conversion_rate, currency=doc.currency)
-				}}</td>
-			</tr>
-			{%- for charge in doclist.get({"doctype":"Sales Taxes and Charges"}) -%}
-			{%- if not charge.included_in_print_rate -%}
-			<tr>
-				<td>{{ charge.description }}</td>
-				<td style="text-align: right;">{{ utils.fmt_money(charge.tax_amount / doc.conversion_rate, currency=doc.currency) }}</td>
-			</tr>
-			{%- endif -%}
-			{%- endfor -%}
-			<tr>
-				<td>Grand Total</td>
-				<td style="text-align: right;">{{ utils.fmt_money(doc.grand_total_export, currency=doc.currency) }}</td>
-			</tr>
-			<tr style='font-weight: bold'>
-				<td>Rounded Total</td>
-				<td style="text-align: right;">{{ utils.fmt_money(doc.rounded_total_export, currency=doc.currency) }}</td>
-			</tr>
-		</tbody>
-		</table>	
-		</div>
-	</div>
-	</div>
-	{%- endif %}
-</div>
-{% endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/sales_transactions.html b/erpnext/templates/sales_transactions.html
deleted file mode 100644
index 4836c12..0000000
--- a/erpnext/templates/sales_transactions.html
+++ /dev/null
@@ -1,32 +0,0 @@
-{% extends "templates/includes/transactions.html" %}
-
-{% block javascript -%}
-<script>
-$(document).ready(function() {
-	global_number_format = "{{ global_number_format }}";
-	currency = "{{ currency }}";
-	wn.currency_symbols = {{ currency_symbols }};
-});
-</script>
-
-{{ super() }}
-
-<script>
-	var render = function(doc) {
-		doc.grand_total_export = format_currency(doc.grand_total_export, doc.currency);
-		if(!doc.status) doc.status = "";
-		
-		$(repl('<a href="{{ page }}?name=%(name)s" class="list-group-item">\
-				<div class="row">\
-					<div class="col-md-6">\
-						<div class="row col-md-12">%(name)s</div>\
-						<div class="row col-md-12 text-muted">%(items)s</div>\
-						<div class="row col-md-12">%(status)s</div>\
-					</div>\
-					<div class="col-md-3 text-right">%(grand_total_export)s</div>\
-					<div class="col-md-3 text-right text-muted">%(creation)s</div>\
-				</div>\
-			</a>', doc)).appendTo($list);
-	};
-</script>
-{%- endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/utils.py b/erpnext/templates/utils.py
index 9ec5422..d75499f 100644
--- a/erpnext/templates/utils.py
+++ b/erpnext/templates/utils.py
@@ -3,59 +3,6 @@
 
 from __future__ import unicode_literals
 import webnotes
-from webnotes.utils import cint, formatdate
-import json
-
-def get_transaction_list(doctype, start, additional_fields=None):
-	# find customer id
-	customer = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user}, 
-		"customer")
-	
-	if customer:
-		if additional_fields:
-			additional_fields = ", " + ", ".join(("`%s`" % f for f in additional_fields))
-		else:
-			additional_fields = ""
-			
-		transactions = webnotes.conn.sql("""select name, creation, currency, grand_total_export
-			%s
-			from `tab%s` where customer=%s and docstatus=1
-			order by creation desc
-			limit %s, 20""" % (additional_fields, doctype, "%s", "%s"), 
-			(customer, cint(start)), as_dict=True)
-		for doc in transactions:
-			items = webnotes.conn.sql_list("""select item_name
-				from `tab%s Item` where parent=%s limit 6""" % (doctype, "%s"), doc.name)
-			doc.items = ", ".join(items[:5]) + ("..." if (len(items) > 5) else "")
-			doc.creation = formatdate(doc.creation)
-		return transactions
-	else:
-		return []
-		
-def get_currency_context():
-	return {
-		"global_number_format": webnotes.conn.get_default("number_format") or "#,###.##",
-		"currency": webnotes.conn.get_default("currency"),
-		"currency_symbols": json.dumps(dict(webnotes.conn.sql("""select name, symbol
-			from tabCurrency where ifnull(enabled,0)=1""")))
-	}
-
-def get_transaction_context(doctype, name):
-	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"}
-		}
-	else:
-		return {
-			"doc": bean.doc,
-			"doclist": bean.doclist,
-			"webnotes": webnotes,
-			"utils": webnotes.utils
-		}
 
 @webnotes.whitelist(allow_guest=True)
 def send_message(subject="Website Query", message="", sender="", status="Open"):