[minor] fixed conflict while merging perpetual branch into master
diff --git a/accounts/doctype/account/account.js b/accounts/doctype/account/account.js
index 99d8d58..9ccb16b 100644
--- a/accounts/doctype/account/account.js
+++ b/accounts/doctype/account/account.js
@@ -18,12 +18,22 @@
 	cur_frm.toggle_display('account_name', doc.__islocal);
 	
 	// hide fields if group
-	cur_frm.toggle_display(['account_type', 'master_type', 'master_name', 'freeze_account', 
+	cur_frm.toggle_display(['account_type', 'master_type', 'master_name', 
 		'credit_days', 'credit_limit', 'tax_rate'], doc.group_or_ledger=='Ledger')	
 		
 	// disable fields
 	cur_frm.toggle_enable(['account_name', 'debit_or_credit', 'group_or_ledger', 
 		'is_pl_account', 'company'], false);
+	
+	if(doc.group_or_ledger=='Ledger') {
+		wn.model.with_doc("Accounts Settings", "Accounts Settings", function (name) {
+			var accounts_settings = wn.model.get_doc("Accounts Settings", name);
+			var display = accounts_settings["frozen_accounts_modifier"] 
+				&& in_list(user_roles, accounts_settings["frozen_accounts_modifier"]);
+			
+			cur_frm.toggle_display('freeze_account', display);
+		});
+	}
 
 	// read-only for root accounts
 	if(!doc.parent_account) {
diff --git a/accounts/doctype/account/account.py b/accounts/doctype/account/account.py
index 3d305d3..fb1d416 100644
--- a/accounts/doctype/account/account.py
+++ b/accounts/doctype/account/account.py
@@ -36,6 +36,17 @@
 		if not self.doc.parent_account:
 			self.doc.parent_account = ''
 		
+	def validate(self): 
+		self.validate_master_name()
+		self.validate_parent()
+		self.validate_duplicate_account()
+		self.validate_root_details()
+		self.validate_mandatory()
+		self.validate_frozen_accounts_modifier()
+	
+		if not self.doc.parent_account:
+			self.doc.parent_account = ''
+		
 	def validate_master_name(self):
 		"""Remind to add master name"""
 		if (self.doc.master_type == 'Customer' or self.doc.master_type == 'Supplier') \
@@ -83,6 +94,15 @@
 		if webnotes.conn.exists("Account", self.doc.name):
 			if not webnotes.conn.get_value("Account", self.doc.name, "parent_account"):
 				webnotes.msgprint("Root cannot be edited.", raise_exception=1)
+				
+	def validate_frozen_accounts_modifier(self):
+		old_value = webnotes.conn.get_value("Account", self.doc.name, "freeze_account")
+		if old_value != self.doc.freeze_account:
+			frozen_accounts_modifier = webnotes.conn.get_value( 'Accounts Settings', None, 
+				'frozen_accounts_modifier')
+			if not frozen_accounts_modifier or \
+				frozen_accounts_modifier not in webnotes.user.get_roles():
+					webnotes.throw(_("You are not authorized to set Frozen value"))
 			
 	def convert_group_to_ledger(self):
 		if self.check_if_child_exists():
@@ -141,7 +161,6 @@
 			webnotes.throw(_("Stock transactions exist against warehouse ") + warehouse + 
 				_(" .You can not assign / modify / remove Master Name"))
 
-
 	def update_nsm_model(self):
 		"""update lft, rgt indices for nested set model"""
 		import webnotes
diff --git a/accounts/doctype/account/account.txt b/accounts/doctype/account/account.txt
index 87006f3..459e102 100644
--- a/accounts/doctype/account/account.txt
+++ b/accounts/doctype/account/account.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-01-30 12:49:46", 
   "docstatus": 0, 
-  "modified": "2013-09-16 12:21:10", 
+  "modified": "2013-09-24 11:22:18", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -23,7 +23,8 @@
   "name": "__common__", 
   "parent": "Account", 
   "parentfield": "fields", 
-  "parenttype": "DocType"
+  "parenttype": "DocType", 
+  "permlevel": 0
  }, 
  {
   "amend": 0, 
@@ -45,14 +46,12 @@
   "fieldname": "properties", 
   "fieldtype": "Section Break", 
   "label": "Account Details", 
-  "oldfieldtype": "Section Break", 
-  "permlevel": 0
+  "oldfieldtype": "Section Break"
  }, 
  {
   "doctype": "DocField", 
   "fieldname": "column_break0", 
   "fieldtype": "Column Break", 
-  "permlevel": 0, 
   "width": "50%"
  }, 
  {
@@ -64,7 +63,6 @@
   "no_copy": 1, 
   "oldfieldname": "account_name", 
   "oldfieldtype": "Data", 
-  "permlevel": 0, 
   "read_only": 1, 
   "reqd": 1, 
   "search_index": 1
@@ -77,7 +75,6 @@
   "label": "Level", 
   "oldfieldname": "level", 
   "oldfieldtype": "Int", 
-  "permlevel": 0, 
   "print_hide": 1, 
   "read_only": 1
  }, 
@@ -91,7 +88,6 @@
   "oldfieldname": "group_or_ledger", 
   "oldfieldtype": "Select", 
   "options": "\nLedger\nGroup", 
-  "permlevel": 0, 
   "read_only": 1, 
   "reqd": 1, 
   "search_index": 1
@@ -104,7 +100,6 @@
   "label": "Debit or Credit", 
   "oldfieldname": "debit_or_credit", 
   "oldfieldtype": "Data", 
-  "permlevel": 0, 
   "read_only": 1, 
   "search_index": 1
  }, 
@@ -117,7 +112,6 @@
   "oldfieldname": "is_pl_account", 
   "oldfieldtype": "Select", 
   "options": "Yes\nNo", 
-  "permlevel": 0, 
   "read_only": 1, 
   "search_index": 1
  }, 
@@ -130,7 +124,6 @@
   "oldfieldname": "company", 
   "oldfieldtype": "Link", 
   "options": "Company", 
-  "permlevel": 0, 
   "read_only": 1, 
   "reqd": 1, 
   "search_index": 1
@@ -139,7 +132,6 @@
   "doctype": "DocField", 
   "fieldname": "column_break1", 
   "fieldtype": "Column Break", 
-  "permlevel": 0, 
   "width": "50%"
  }, 
  {
@@ -150,7 +142,6 @@
   "oldfieldname": "parent_account", 
   "oldfieldtype": "Link", 
   "options": "Account", 
-  "permlevel": 0, 
   "search_index": 1
  }, 
  {
@@ -175,19 +166,17 @@
   "label": "Rate", 
   "oldfieldname": "tax_rate", 
   "oldfieldtype": "Currency", 
-  "permlevel": 0, 
   "reqd": 0
  }, 
  {
-  "description": "If the account is frozen, entries are allowed for the \"Account Manager\" only.", 
+  "description": "If the account is frozen, entries are allowed to restricted users.", 
   "doctype": "DocField", 
   "fieldname": "freeze_account", 
   "fieldtype": "Select", 
   "label": "Frozen", 
   "oldfieldname": "freeze_account", 
   "oldfieldtype": "Select", 
-  "options": "No\nYes", 
-  "permlevel": 2
+  "options": "No\nYes"
  }, 
  {
   "doctype": "DocField", 
@@ -197,7 +186,6 @@
   "label": "Credit Days", 
   "oldfieldname": "credit_days", 
   "oldfieldtype": "Int", 
-  "permlevel": 0, 
   "print_hide": 1
  }, 
  {
@@ -209,7 +197,6 @@
   "oldfieldname": "credit_limit", 
   "oldfieldtype": "Currency", 
   "options": "Company:company:default_currency", 
-  "permlevel": 0, 
   "print_hide": 1
  }, 
  {
@@ -220,8 +207,7 @@
   "label": "Master Type", 
   "oldfieldname": "master_type", 
   "oldfieldtype": "Select", 
-  "options": "\nSupplier\nCustomer\nEmployee", 
-  "permlevel": 0
+  "options": "\nSupplier\nCustomer\nEmployee"
  }, 
  {
   "doctype": "DocField", 
@@ -230,8 +216,7 @@
   "label": "Master Name", 
   "oldfieldname": "master_name", 
   "oldfieldtype": "Link", 
-  "options": "[Select]", 
-  "permlevel": 0
+  "options": "[Select]"
  }, 
  {
   "default": "1", 
@@ -239,8 +224,7 @@
   "doctype": "DocField", 
   "fieldname": "allow_negative_balance", 
   "fieldtype": "Check", 
-  "label": "Allow Negative Balance", 
-  "permlevel": 0
+  "label": "Allow Negative Balance"
  }, 
  {
   "doctype": "DocField", 
@@ -248,7 +232,6 @@
   "fieldtype": "Int", 
   "hidden": 1, 
   "label": "Lft", 
-  "permlevel": 0, 
   "print_hide": 1, 
   "read_only": 1
  }, 
@@ -258,7 +241,6 @@
   "fieldtype": "Int", 
   "hidden": 1, 
   "label": "Rgt", 
-  "permlevel": 0, 
   "print_hide": 1, 
   "read_only": 1
  }, 
@@ -268,7 +250,6 @@
   "fieldtype": "Data", 
   "hidden": 1, 
   "label": "Old Parent", 
-  "permlevel": 0, 
   "print_hide": 1, 
   "read_only": 1
  }, 
diff --git a/accounts/doctype/accounts_settings/accounts_settings.txt b/accounts/doctype/accounts_settings/accounts_settings.txt
index 868b660..3ee35c8 100644
--- a/accounts/doctype/accounts_settings/accounts_settings.txt
+++ b/accounts/doctype/accounts_settings/accounts_settings.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-06-24 15:49:57", 
   "docstatus": 0, 
-  "modified": "2013-09-16 14:24:39", 
+  "modified": "2013-09-24 11:52:57", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -54,11 +54,19 @@
   "label": "Accounts Frozen Upto"
  }, 
  {
-  "description": "Users with this role are allowed to do / modify accounting entry before frozen date", 
+  "description": "Users with this role are allowed to create / modify accounting entry before frozen date", 
   "doctype": "DocField", 
   "fieldname": "bde_auth_role", 
   "fieldtype": "Link", 
-  "label": "Allow Editing of Frozen Accounts For", 
+  "label": "Allowed Role to Edit Entries Before Frozen Date", 
+  "options": "Role"
+ }, 
+ {
+  "description": "Users with this role are allowed to set frozen accounts and create / modify accounting entries against frozen accounts", 
+  "doctype": "DocField", 
+  "fieldname": "frozen_accounts_modifier", 
+  "fieldtype": "Link", 
+  "label": "Frozen Accounts Modifier", 
   "options": "Role"
  }, 
  {
diff --git a/accounts/doctype/gl_entry/gl_entry.py b/accounts/doctype/gl_entry/gl_entry.py
index e97c4c3..8338a5b1 100644
--- a/accounts/doctype/gl_entry/gl_entry.py
+++ b/accounts/doctype/gl_entry/gl_entry.py
@@ -22,7 +22,7 @@
 
 	def on_update_with_args(self, adv_adj, update_outstanding = 'Yes'):
 		self.validate_account_details(adv_adj)
-		validate_freezed_account(self.doc.account, adv_adj)
+		validate_frozen_account(self.doc.account, adv_adj)
 		check_freezing_date(self.doc.posting_date, adv_adj)
 		check_negative_balance(self.doc.account, adv_adj)
 
@@ -169,4 +169,18 @@
 	if freezed_account == 'Yes' and not adv_adj \
 		and 'Accounts Manager' not in webnotes.user.get_roles():
 			webnotes.throw(_("Account") + ": " + account + _(" has been freezed. \
-			Only Accounts Manager can do transaction against this account"))
\ No newline at end of file
+			Only Accounts Manager can do transaction against this account"))
+
+def validate_frozen_account(account, adv_adj):
+	frozen_account = webnotes.conn.get_value("Account", account, "freeze_account")
+	if frozen_account == 'Yes' and not adv_adj:
+		frozen_accounts_modifier = webnotes.conn.get_value( 'Accounts Settings', None, 
+			'frozen_accounts_modifier')
+		if not frozen_accounts_modifier:
+			webnotes.throw(account + _(" is a frozen account. \
+				Either make the account active or assign role in Accounts Settings \
+				who can create / modify entries against this account"))
+		elif frozen_accounts_modifier not in webnotes.user.get_roles():
+			webnotes.throw(account + _(" is a frozen account. ") + 
+				_("To create / edit transactions against this account, you need role") + ": " +  
+				frozen_accounts_modifier)
\ No newline at end of file
diff --git a/accounts/doctype/journal_voucher/journal_voucher.js b/accounts/doctype/journal_voucher/journal_voucher.js
index eb08166..a3aa6f1 100644
--- a/accounts/doctype/journal_voucher/journal_voucher.js
+++ b/accounts/doctype/journal_voucher/journal_voucher.js
@@ -79,6 +79,10 @@
 	}
 }
 
+cur_frm.cscript.company = function(doc, cdt, cdn) {
+	cur_frm.refresh_fields();
+}
+
 cur_frm.cscript.is_opening = function(doc, cdt, cdn) {
 	hide_field('aging_date');
 	if (doc.is_opening == 'Yes') unhide_field('aging_date');
diff --git a/accounts/doctype/journal_voucher/journal_voucher.py b/accounts/doctype/journal_voucher/journal_voucher.py
index e438b7d..ed4a0d7 100644
--- a/accounts/doctype/journal_voucher/journal_voucher.py
+++ b/accounts/doctype/journal_voucher/journal_voucher.py
@@ -7,7 +7,7 @@
 from webnotes.utils import cint, cstr, flt, fmt_money, formatdate, getdate
 from webnotes.model.doc import addchild
 from webnotes.model.bean import getlist
-from webnotes import msgprint
+from webnotes import msgprint, _
 from setup.utils import get_company_currency
 
 from controllers.accounts_controller import AccountsController
@@ -178,7 +178,7 @@
 			if account_type == 'Bank or Cash':
 				company_currency = get_company_currency(self.doc.company)
 				amt = flt(d.debit) and d.debit or d.credit	
-				self.doc.total_amount = company_currency +' '+ cstr(amt)
+				self.doc.total_amount = company_currency + ' ' + cstr(amt)
 				from webnotes.utils import money_in_words
 				self.doc.total_amount_in_words = money_in_words(amt, company_currency)
 
diff --git a/accounts/doctype/sales_invoice/pos.js b/accounts/doctype/sales_invoice/pos.js
index f04328f..8837aed 100644
--- a/accounts/doctype/sales_invoice/pos.js
+++ b/accounts/doctype/sales_invoice/pos.js
@@ -193,7 +193,7 @@
 							</div>', 
 						{
 							item_code: obj.name,
-							item_price: format_currency(obj.ref_rate, obj.ref_currency),
+							item_price: format_currency(obj.ref_rate, obj.currency),
 							item_name: obj.name===obj.item_name ? "" : obj.item_name,
 							item_image: image
 						})).appendTo($wrap);
diff --git a/accounts/doctype/sales_invoice/pos.py b/accounts/doctype/sales_invoice/pos.py
index 1b867cb..08340f7 100644
--- a/accounts/doctype/sales_invoice/pos.py
+++ b/accounts/doctype/sales_invoice/pos.py
@@ -15,11 +15,14 @@
 	if item:
 		condition = "and i.name='%s'" % item
 
-	return webnotes.conn.sql("""select 
-		i.name, i.item_name, i.image, ip.ref_rate, ip.ref_currency 
-		from `tabItem` i LEFT JOIN `tabItem Price` ip 
-			ON ip.parent=i.name 
-			and ip.price_list=%s 
+	return webnotes.conn.sql("""select i.name, i.item_name, i.image, 
+		pl_items.ref_rate, pl_items.currency 
+		from `tabItem` i LEFT JOIN 
+			(select ip.item_code, ip.ref_rate, pl.currency from 
+				`tabItem Price` ip, `tabPrice List` pl 
+				where ip.parent=%s and ip.parent = pl.name) pl_items
+		ON
+			pl_items.item_code=i.name
 		where
 			i.is_sales_item='Yes'%s""" % ('%s', condition), (price_list), as_dict=1)
 
diff --git a/accounts/doctype/sales_invoice/sales_invoice.js b/accounts/doctype/sales_invoice/sales_invoice.js
index e317ae9..aeae28c 100644
--- a/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/accounts/doctype/sales_invoice/sales_invoice.js
@@ -73,45 +73,14 @@
 				if(!from_delivery_note)
 					cur_frm.add_custom_button('Make Delivery', cur_frm.cscript['Make Delivery Note']);
 			}
-				
 
 			if(doc.outstanding_amount!=0)
 				cur_frm.add_custom_button('Make Payment Entry', cur_frm.cscript.make_bank_voucher);
 		}
 
 		if (doc.docstatus===0) {
-			cur_frm.add_custom_button(wn._('From Sales Order'), 
-				function() {
-					wn.model.map_current_doc({
-						method: "selling.doctype.sales_order.sales_order.make_sales_invoice",
-						source_doctype: "Sales Order",
-						get_query_filters: {
-							docstatus: 1,
-							status: ["!=", "Stopped"],
-							per_billed: ["<", 99.99],
-							customer: cur_frm.doc.customer || undefined,
-							company: cur_frm.doc.company
-						}
-					})
-				});
-
-			cur_frm.add_custom_button(wn._('From Delivery Note'), 
-				function() {
-					wn.model.map_current_doc({
-						method: "stock.doctype.delivery_note.delivery_note.make_sales_invoice",
-						source_doctype: "Delivery Note",
-						get_query: function() {
-							var filters = {
-								company: cur_frm.doc.company
-							};
-							if(cur_frm.doc.customer) filters["customer"] = cur_frm.doc.customer;
-							return {
-								query: "controllers.queries.get_delivery_notes_to_be_billed",
-								filters: filters
-							};
-						}
-					});
-				});
+			cur_frm.cscript.sales_order_btn();
+			cur_frm.cscript.delivery_note_btn();
 		}
 		
 		// Show POS button only if it enabled from features setup
@@ -119,6 +88,43 @@
 			cur_frm.cscript.pos_btn();
 	},
 
+	sales_order_btn: function() {
+		this.$sales_order_btn = cur_frm.add_custom_button(wn._('From Sales Order'), 
+			function() {
+				wn.model.map_current_doc({
+					method: "selling.doctype.sales_order.sales_order.make_sales_invoice",
+					source_doctype: "Sales Order",
+					get_query_filters: {
+						docstatus: 1,
+						status: ["!=", "Stopped"],
+						per_billed: ["<", 99.99],
+						customer: cur_frm.doc.customer || undefined,
+						company: cur_frm.doc.company
+					}
+				})
+			});
+	},
+
+	delivery_note_btn: function() {
+		this.$delivery_note_btn = cur_frm.add_custom_button(wn._('From Delivery Note'), 
+			function() {
+				wn.model.map_current_doc({
+					method: "stock.doctype.delivery_note.delivery_note.make_sales_invoice",
+					source_doctype: "Delivery Note",
+					get_query: function() {
+						var filters = {
+							company: cur_frm.doc.company
+						};
+						if(cur_frm.doc.customer) filters["customer"] = cur_frm.doc.customer;
+						return {
+							query: "controllers.queries.get_delivery_notes_to_be_billed",
+							filters: filters
+						};
+					}
+				});
+			});
+	},
+
 	pos_btn: function() {
 		if(cur_frm.$pos_btn) 
 			cur_frm.$pos_btn.remove();
@@ -126,9 +132,17 @@
 		if(!cur_frm.pos_active) {
 			var btn_label = wn._("POS View"),
 				icon = "icon-desktop";
+
+			cur_frm.cscript.sales_order_btn();
+			cur_frm.cscript.delivery_note_btn();
 		} else {
 			var btn_label = wn._("Invoice View"),
 				icon = "icon-file-text";
+
+			if (cur_frm.doc.docstatus===0) {
+				this.$delivery_note_btn.remove();
+				this.$sales_order_btn.remove();
+			}
 		}
 
 		cur_frm.$pos_btn = cur_frm.add_custom_button(btn_label, function() {
diff --git a/accounts/doctype/sales_invoice/sales_invoice.py b/accounts/doctype/sales_invoice/sales_invoice.py
index c8eea1b..12deed7 100644
--- a/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/accounts/doctype/sales_invoice/sales_invoice.py
@@ -9,7 +9,7 @@
 	get_first_day, get_last_day
 
 from webnotes.utils.email_lib import sendmail
-from webnotes.utils import comma_and
+from webnotes.utils import comma_and, get_url
 from webnotes.model.doc import make_autoname
 from webnotes.model.bean import getlist
 from webnotes.model.code import get_obj
@@ -147,6 +147,9 @@
 		self.validate_recurring_invoice()
 		self.convert_to_recurring()
 		
+	def get_portal_page(self):
+		return "invoice" if self.doc.docstatus==1 else None
+		
 	def set_missing_values(self, for_validate=False):
 		self.set_pos_fields(for_validate)
 		
@@ -888,7 +891,7 @@
 		Regards,
 		Administrator
 		
-	""" % (inv, website.get_site_address(), inv)
+	""" % (inv, get_url(), inv)
 	subj = "[Urgent] Error while creating recurring invoice from %s" % inv
 
 	from webnotes.profile import get_system_managers
diff --git a/website/doctype/about_us_settings/__init__.py b/accounts/doctype/sales_invoice/templates/__init__.py
similarity index 100%
rename from website/doctype/about_us_settings/__init__.py
rename to accounts/doctype/sales_invoice/templates/__init__.py
diff --git a/website/doctype/about_us_settings/__init__.py b/accounts/doctype/sales_invoice/templates/pages/__init__.py
similarity index 100%
copy from website/doctype/about_us_settings/__init__.py
copy to accounts/doctype/sales_invoice/templates/pages/__init__.py
diff --git a/accounts/doctype/sales_invoice/templates/pages/invoice.html b/accounts/doctype/sales_invoice/templates/pages/invoice.html
new file mode 100644
index 0000000..db6e009
--- /dev/null
+++ b/accounts/doctype/sales_invoice/templates/pages/invoice.html
@@ -0,0 +1,5 @@
+{% extends "app/portal/templates/sale.html" %}
+
+{% block status -%}
+	{% if doc.status %}{{ doc.status }}{% endif %}
+{%- endblock %}
\ No newline at end of file
diff --git a/accounts/doctype/sales_invoice/templates/pages/invoice.py b/accounts/doctype/sales_invoice/templates/pages/invoice.py
new file mode 100644
index 0000000..8fc8913
--- /dev/null
+++ b/accounts/doctype/sales_invoice/templates/pages/invoice.py
@@ -0,0 +1,30 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# 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 portal.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/accounts/doctype/sales_invoice/templates/pages/invoices.html b/accounts/doctype/sales_invoice/templates/pages/invoices.html
new file mode 100644
index 0000000..f108683
--- /dev/null
+++ b/accounts/doctype/sales_invoice/templates/pages/invoices.html
@@ -0,0 +1 @@
+{% extends "app/portal/templates/sales_transactions.html" %}
\ No newline at end of file
diff --git a/accounts/doctype/sales_invoice/templates/pages/invoices.py b/accounts/doctype/sales_invoice/templates/pages/invoices.py
new file mode 100644
index 0000000..59e53a0
--- /dev/null
+++ b/accounts/doctype/sales_invoice/templates/pages/invoices.py
@@ -0,0 +1,28 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+no_cache = True
+
+def get_context():
+	from portal.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 portal.utils import get_transaction_list
+	from 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/accounts/general_ledger.py b/accounts/general_ledger.py
index 05c52db..995fdc0 100644
--- a/accounts/general_ledger.py
+++ b/accounts/general_ledger.py
@@ -105,7 +105,7 @@
 		adv_adj=False, update_outstanding="Yes"):
 	
 	from accounts.doctype.gl_entry.gl_entry import check_negative_balance, \
-		check_freezing_date, update_outstanding_amt, validate_freezed_account
+		check_freezing_date, update_outstanding_amt, validate_frozen_account
 		
 	if not gl_entries:
 		gl_entries = webnotes.conn.sql("""select * from `tabGL Entry` 
@@ -117,7 +117,7 @@
 		(voucher_type or gl_entries[0]["voucher_type"], voucher_no or gl_entries[0]["voucher_no"]))
 	
 	for entry in gl_entries:
-		validate_freezed_account(entry["account"], adv_adj)
+		validate_frozen_account(entry["account"], adv_adj)
 		check_negative_balance(entry["account"], adv_adj)
 		validate_expense_against_budget(entry)
 		
diff --git a/accounts/page/voucher_import_tool/voucher_import_tool.py b/accounts/page/voucher_import_tool/voucher_import_tool.py
index 416cf0e..9425afc 100644
--- a/accounts/page/voucher_import_tool/voucher_import_tool.py
+++ b/accounts/page/voucher_import_tool/voucher_import_tool.py
@@ -104,7 +104,7 @@
 		
 		if account.master_name:
 			map_fields(["against_sales_invoice:against_invoice", 
-				"against_purhase_invoice:against_voucher", 
+				"against_purchase_invoice:against_voucher", 
 				"against_journal_voucher:against_jv"], d, detail.fields)
 	
 	webnotes.conn.commit()
diff --git a/buying/doctype/purchase_common/purchase_common.js b/buying/doctype/purchase_common/purchase_common.js
index 5785b1a..2dfe655 100644
--- a/buying/doctype/purchase_common/purchase_common.js
+++ b/buying/doctype/purchase_common/purchase_common.js
@@ -24,16 +24,6 @@
 					filters: { 'buying_or_selling': "Buying" }
 				}
 			});
-			
-			this.frm.set_query("price_list_currency", function() {
-				return{
-					query: "controllers.queries.get_price_list_currency",
-					filters: {
-						'price_list': me.frm.doc.buying_price_list,
-						'buying_or_selling': "Buying"
-					}					
-				}
-			});
 		}
 		
 		$.each([["supplier", "supplier"], 
@@ -152,7 +142,7 @@
 	},
 	
 	buying_price_list: function() {
-		this.get_price_list_currency("buying");
+		this.get_price_list_currency("Buying");
 	},
 	
 	import_ref_rate: function(doc, cdt, cdn) {
diff --git a/buying/doctype/quality_inspection/quality_inspection.js b/buying/doctype/quality_inspection/quality_inspection.js
index 8c7c932..f3517b4 100644
--- a/buying/doctype/quality_inspection/quality_inspection.js
+++ b/buying/doctype/quality_inspection/quality_inspection.js
@@ -1,11 +1,6 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
 // License: GNU General Public License v3. See license.txt
 
-cur_frm.cscript.item_code = function(doc, cdt, cdn) {
-	if (doc.item_code)
-		return get_server_fields('get_purchase_receipt_item_details','','',doc,cdt,cdn,1);
-}
-
 cur_frm.cscript.inspection_type = function(doc, cdt, cdn) {
 	if(doc.inspection_type == 'Incoming'){
 		doc.delivery_note_no = '';
@@ -30,13 +25,22 @@
 
 // item code based on GRN/DN
 cur_frm.fields_dict['item_code'].get_query = function(doc, cdt, cdn) {
-	var filter = {};
-	if (doc.purchase_receipt_no) filter['parent'] = doc.purchase_receipt_no;
-		
-	else if (doc.delivery_note_no) filter['parent'] =  doc.delivery_note_no;
-
-	return{
-		filters: filter
+	if (doc.purchase_receipt_no) {
+		return {
+			query: "buying.doctype.quality_inspection.quality_inspection.item_query",
+			filters: {
+				"from": "Purchase Receipt Item",
+				"parent": doc.purchase_receipt_no
+			}
+		}
+	} else if (doc.delivery_note_no) {
+		return {
+			query: "buying.doctype.quality_inspection.quality_inspection.item_query",
+			filters: {
+				"from": "Delivery Note Item",
+				"parent": doc.delivery_note_no
+			}
+		}
 	}
 }
 
diff --git a/buying/doctype/quality_inspection/quality_inspection.py b/buying/doctype/quality_inspection/quality_inspection.py
index 19b2d2a..3380bd6 100644
--- a/buying/doctype/quality_inspection/quality_inspection.py
+++ b/buying/doctype/quality_inspection/quality_inspection.py
@@ -33,3 +33,17 @@
 			webnotes.conn.sql("update `tabPurchase Receipt Item` t1, `tabPurchase Receipt` t2 set t1.qa_no = '', t2.modified = '%s' \
 				where t1.parent = '%s' and t1.item_code = '%s' and t1.parent = t2.name" \
 				% (self.doc.modified, self.doc.purchase_receipt_no, self.doc.item_code))
+
+
+def item_query(doctype, txt, searchfield, start, page_len, filters):
+	if filters.get("from"):
+		from webnotes.widgets.reportview import get_match_cond
+		filters.update({
+			"txt": txt,
+			"mcond": get_match_cond(filters["from"], searchfield),
+			"start": start,
+			"page_len": page_len
+		})
+		return webnotes.conn.sql("""select item_code from `tab%(from)s` 
+			where parent='%(parent)s' and docstatus < 2 and item_code like '%%%(txt)s%%' %(mcond)s
+			order by item_code limit %(start)s, %(page_len)s""" % filters)
\ No newline at end of file
diff --git a/buying/doctype/supplier/supplier.py b/buying/doctype/supplier/supplier.py
index ccdeae9..15e1d62 100644
--- a/buying/doctype/supplier/supplier.py
+++ b/buying/doctype/supplier/supplier.py
@@ -147,7 +147,6 @@
 	def on_trash(self):
 		self.delete_supplier_address()
 		self.delete_supplier_contact()
-		self.delete_supplier_communication()
 		self.delete_supplier_account()
 		
 	def on_rename(self, new, old, merge=False):
diff --git a/buying/utils.py b/buying/utils.py
index 33326d9..ce81b6b 100644
--- a/buying/utils.py
+++ b/buying/utils.py
@@ -89,14 +89,17 @@
 	
 	# try fetching from price list
 	if args.buying_price_list and args.price_list_currency:
-		price_list_rate = item_bean.doclist.get({
-			"parentfield": "ref_rate_details", 
-			"price_list": args.buying_price_list, 
-			"ref_currency": args.price_list_currency,
-			"buying_or_selling": "Buying"})
+		price_list_rate = webnotes.conn.sql("""select ip.ref_rate from `tabItem Price` ip, 
+		`tabPrice List` pl where ip.parent = pl.name and ip.parent=%s and 
+		ip.item_code=%s and pl.buying_or_selling='Buying'""", 
+		(args.buying_price_list, args.item_code), as_dict=1)
+		
 		if price_list_rate:
-			out.import_ref_rate = \
-				flt(price_list_rate[0].ref_rate * args.plc_conversion_rate / args.conversion_rate)
+			from utilities.transaction_base import validate_currency
+			validate_currency(args, item_bean.doc, meta)
+				
+			out.import_ref_rate = flt(price_list_rate[0].ref_rate) * \
+				flt(args.plc_conversion_rate) / flt(args.conversion_rate)
 		
 	# if not found, fetch from last purchase transaction
 	if not out.import_ref_rate:
diff --git a/config.json b/config.json
index e0f98d8..17b01ed 100644
--- a/config.json
+++ b/config.json
@@ -1,5 +1,6 @@
 {
 	"app_name": "ERPNext",
+	"base_template": "app/portal/templates/base.html",
 	"modules": {
 		"Selling": {
 			"link": "selling-home",
@@ -43,12 +44,6 @@
 			"color": "#7f8c8d",
 			"icon": "icon-cogs"
 		},
-		"Website": {
-			"type": "module",
-			"link": "website-home",
-			"color": "#16a085",
-			"icon": "icon-globe"
-		},
 		"HR": {
 			"type": "module",
 			"link": "hr-home",
@@ -77,138 +72,5 @@
 			"label": "Notes",
 			"icon": "icon-file-alt"
 		}
-	},
-	"web": {
-		"pages": {
-			"about": {
-				"template": "app/website/templates/pages/about",
-				"args_method": "website.doctype.about_us_settings.about_us_settings.get_args"
-			},
-			"account": {
-				"no_cache": true,
-				"template": "app/website/templates/pages/account"
-			},
-			"blog": {
-				"template": "app/website/templates/pages/blog",
-				"args_method": "website.helpers.blog.get_blog_template_args"
-			},
-			"contact": {
-				"template": "app/website/templates/pages/contact",
-				"args_doctype": "Contact Us Settings"
-			},
-			"index": {
-				"template": "app/website/templates/pages/index"
-			},
-			"order": {
-				"no_cache": true,
-				"template": "app/website/templates/pages/sale",
-				"args_method": "website.helpers.transaction.get_order_args",
-				"portal": {
-					"doctype": "Sales Order",
-					"conditions": {
-						"docstatus": 1
-					}
-				}
-			},
-			"orders": {
-				"no_cache": true,
-				"template": "app/website/templates/pages/sales_transactions",
-				"args_method": "website.helpers.transaction.order_list_args"
-			},
-			"invoice": {
-				"no_cache": true,
-				"template": "app/website/templates/pages/sale",
-				"args_method": "website.helpers.transaction.get_invoice_args",
-				"portal": {
-					"doctype": "Sales Invoice",
-					"conditions": {
-						"docstatus": 1
-					}
-				}
-			},
-			"invoices": {
-				"no_cache": true,
-				"template": "app/website/templates/pages/sales_transactions",
-				"args_method": "website.helpers.transaction.invoice_list_args"
-			},
-			"shipment": {
-				"no_cache": true,
-				"template": "app/website/templates/pages/sale",
-				"args_method": "website.helpers.transaction.get_shipment_args",
-				"portal": {
-					"doctype": "Delivery Note",
-					"conditions": {
-						"docstatus": 1
-					}
-				}
-			},
-			"shipments": {
-				"no_cache": true,
-				"template": "app/website/templates/pages/sales_transactions",
-				"args_method": "website.helpers.transaction.shipment_list_args"
-			},
-			"product_search": {
-				"template": "app/website/templates/pages/product_search"
-			},
-			"ticket": {
-				"no_cache": true,
-				"template": "app/website/templates/pages/ticket",
-				"args_method": "support.doctype.support_ticket.support_ticket.get_website_args",
-				"portal": {
-					"doctype": "Support Ticket"
-				}
-			},
-			"tickets": {
-				"template": "app/website/templates/pages/tickets",
-				"args_method": "website.helpers.transaction.ticket_list_args"
-			},
-			"address": {
-				"no_cache": true,
-				"template": "app/website/templates/pages/address",
-				"args_method": "utilities.doctype.address.address.get_website_args"
-			},
-			"addresses": {
-				"template": "app/website/templates/pages/addresses"
-			},
-			"writers": {
-				"template": "app/website/templates/pages/writers",
-				"args_method": "website.doctype.blogger.blogger.get_writers_args"
-			},
-			"profile": {
-				"no_cache": true,
-				"template": "app/website/templates/pages/profile",
-				"args_method": "startup.webutils.get_profile_args"
-			},
-			"cart": {
-				"no_cache": true,
-				"template": "app/website/templates/pages/cart.html"
-			},
-			"partners": {
-				"template": "app/website/templates/pages/partners",
-				"args_method": "website.helpers.partner.get_partner_args"
-			}
-		},
-		"generators": {
-			"Web Page": {
-				"template": "app/website/templates/html/web_page.html",
-				"condition_field": "published"
-			},
-			"Blog Post": {
-				"template": "app/website/templates/html/blog_page.html",
-				"condition_field": "published"
-			},
-			"Item": {
-				"template": "app/website/templates/html/product_page.html",
-				"condition_field": "show_in_website"
-			},
-			"Item Group":{
-				"template": "app/website/templates/html/product_group.html",
-				"condition_field": "show_in_website"
-			},
-			"Sales Partner": {
-				"template": "app/website/templates/html/partner_page.html",
-				"condition_field": "show_in_website"
-			}
-		}
 	}
 }
\ No newline at end of file
diff --git a/controllers/accounts_controller.py b/controllers/accounts_controller.py
index a75fb62..927b249 100644
--- a/controllers/accounts_controller.py
+++ b/controllers/accounts_controller.py
@@ -66,6 +66,7 @@
 				
 				if self.doc.price_list_currency == company_currency:
 					self.doc.plc_conversion_rate = 1.0
+
 				elif not self.doc.plc_conversion_rate:
 					self.doc.plc_conversion_rate = self.get_exchange_rate(
 						self.doc.price_list_currency, company_currency)
diff --git a/controllers/queries.py b/controllers/queries.py
index 02c992b..637d5e1 100644
--- a/controllers/queries.py
+++ b/controllers/queries.py
@@ -157,14 +157,6 @@
 		order by `tabProject`.name asc 
 		limit %(start)s, %(page_len)s """ % {'cond': cond,'txt': "%%%s%%" % txt, 
 		'mcond':get_match_cond(doctype, searchfield),'start': start, 'page_len': page_len})
-		
-def get_price_list_currency(doctype, txt, searchfield, start, page_len, filters):
-	return webnotes.conn.sql("""select ref_currency from `tabItem Price` 
-		where price_list = %s and buying_or_selling = %s
-		and `%s` like %s order by ref_currency asc limit %s, %s""" %
-		("%s", "%s", searchfield, "%s", "%s", "%s"), 
-		(filters["price_list"], filters['buying_or_selling'], "%%%s%%" % txt, 
-			start, page_len))
 			
 def get_delivery_notes_to_be_billed(doctype, txt, searchfield, start, page_len, filters):
 	return webnotes.conn.sql("""select `tabDelivery Note`.name, `tabDelivery Note`.customer_name
diff --git a/docs/user/stock/docs.user.stock.accounting_for_stock.md b/docs/user/stock/docs.user.stock.accounting_for_stock.md
new file mode 100644
index 0000000..8348c80
--- /dev/null
+++ b/docs/user/stock/docs.user.stock.accounting_for_stock.md
@@ -0,0 +1,42 @@
+---
+{
+	"_label": "Accounting of Inventory / Stock"
+}
+---
+
+The value of available inventory is treated as an Asset in company's Chart of Accounts. Depending on the type of items, it can be treated as Fixed Asset or Current Asset. To prepare Balance Sheet, you should make the accounting entries for those assets. 
+There are generally two different methods of accounting for inventory:
+
+
+### **Auto / Perpetual Inventory**
+
+In this process, for each stock transactions, the system posts relevant accounting entries to sync stock balance and accounting balance. This is the default setting in ERPNext for new accounts.
+
+When you buy and receive items, those items are booked as the company’s assets (stock-in-hand / fixed-assets). When you sell and deliver those items, an expense (cost-of-goods-sold) equal to the buying cost of the items is booked. General Ledger entries are made after every stock transaction.  As a result, the value as per Stock Ledger always remains same with the relevant account balance. This improves accuracy of Balance Sheet and Profit and Loss statement.
+
+To check accounting entries for a particular stock transaction, please check [**examples**](docs.user.stock.perpetual_inventory.html)
+
+#### **Advantages**
+
+Perpetual Inventory system will make it easier for you to maintain accuracy of company's asset and expense values. Stock balances will always be synced with relevant account balances, so no more periodic manual entry has to be done to balance them.
+
+In case of new back-dated stock transactions or cancellation/amendment of an existing transaction, all the future Stock Ledger entries and GL Entries will be recalculated for all items of that transaction.
+The same is applicable if any cost is added to the submitted Purchase Receipt, later through the Landed Cost Wizard.
+
+>Note: Perpetual Inventory totally depends upon the item valuation rate. Hence, you have to be more careful entering valuation rate while making any incoming stock transactions like Purchase Receipt, Material Receipt, or Manufacturing / Repack.
+
+-
+
+### **Periodic Inventory**
+
+In this method, accounting entries are manually created periodically, to sync stock balance and relevant account balance. The system does not create accounting entries automatically for assets, at the time of material purchases or sales.
+
+In an accounting period, when you buy and receive items, an expense is booked in your accounting system. You sell and deliver some of these items.
+
+At the end of an accounting period, the total value of items to be sold, need to be booked as the company’s assets, often known as stock-in-hand. 
+
+The difference between the value of the items remaining to be sold and the previous period’s stock-in-hand value can be positive or negative. If positive, this value is removed from expenses (cost-of-goods-sold) and is added to assets (stock-in-hand / fixed-assets). If negative, a reverse entry is passed. 
+
+This complete process is called Periodic Inventory.
+
+If you are an existing user using Periodic Inventory and want to use Perpetual Inventory, you have to follow some steps to migrate. For details, check [**Migration From Periodic Inventory**](docs.user.stock.periodic_to_perpetual.html)
diff --git a/docs/user/stock/docs.user.stock.perpetual_inventory.md b/docs/user/stock/docs.user.stock.perpetual_inventory.md
new file mode 100644
index 0000000..eb10326
--- /dev/null
+++ b/docs/user/stock/docs.user.stock.perpetual_inventory.md
@@ -0,0 +1,313 @@
+---
+{
+	"_label": "Perpetual Inventory"
+}
+---
+
+In perpetual inventory, system creates accounting entries for each stock transactions, so that stock and account balance will always remain same. The account balance will be posted against their respective account heads for each Warehouse. On saving of a Warehouse, the system will automatically create an account head with the same name as warehouse. As account balance is maintained for each Warehouse, you should create Warehouses, based on the type of items (Current / Fixed Assets) it stores.
+
+At the time of items received in a particular warehouse, the balance of asset account (linked to that warehouse) will be increased. Similarly when you deliver some items from that warehouse, an expense will be booked and the asset account will be reduced, based on the valuation amount of those items.
+
+
+## **Activation**
+
+1. Setup the following default accounts for each Company 
+	- Stock Received But Not Billed
+	- Stock Adjustment Account
+	- Expenses Included In Valuation
+	- Cost Center
+	
+2. In perpetual inventory, the system will maintain seperate account balance for each warehouse under separate account head. To create that account head, enter "Create Account Under" in Warehouse master.
+
+3. Activate Perpetual Inventory
+> Setup > Accounts Settings > Make Accounting Entry For Every Stock Movement
+
+
+-
+
+## **Example**
+
+Consider following Chart of Accounts and Warehouse setup for your company:
+
+#### Chart of Accounts
+
+- Assets (Dr)
+  - Current Assets
+    - Accounts Receivable
+      - Jane Doe
+    - Stock Assets
+      - Stores
+      - Finished Goods
+      - Work In Progress
+    - Tax Assets
+      - VAT
+  - Fixed Assets
+    - Fixed Asset Warehouse
+- Liabilities (Cr)
+  - Current Liabilities
+    - Accounts Payable
+      - East Wind Inc.
+    - Stock Liabilities
+      - Stock Received But Not Billed
+    - Tax Liabilities
+      - Service Tax
+- Income (Cr)
+  - Direct Income
+    - Sales Account
+- Expenses (Dr)
+  - Direct Expenses
+    - Stock Expenses
+      - Cost of Goods Sold
+      - Expenses Included In Valuation
+      - Stock Adjustment
+      - Shipping Charges
+      - Customs Duty
+  
+#### Warehouse - Account Configuration
+
+- Stores
+- Work In Progress
+- Finished Goods
+- Fixed Asset Warehouse
+
+### **Purchase Receipt**
+
+Suppose you have purchased *10 nos* of item "RM0001" at *$200* and *5 nos* of item "Desktop" at **$100** from supplier "East Wind Inc". Following are the details of Purchase Receipt:
+
+<b>Supplier:</b> East Wind Inc.
+
+<b>Items:</b>
+<table class="table table-bordered">
+	<thead>
+		<tr>
+			<th>Item</th><th>Warehouse</th><th>Qty</th>
+			<th>Rate</th><th>Amount</th><th>Valuation Amount</th>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td>RM0001</td><td>Stores</td><td>10</td><td>200</td><td>2000</td><td>2200</td>
+		</tr>
+		<tr>
+			<td>Desktop</td><td>Fixed Asset Warehouse</td>
+			<td>5</td><td>100</td><td>500</td><td>550</td>
+		</tr>
+	</tbody>
+</table>
+	
+**Taxes:**
+
+<table class="table table-bordered">
+	<thead>
+		<tr><th>Account</th><th>Amount</th><th>Category</th></tr>
+	</thead>
+	<tbody>
+		<tr><td>Shipping Charges</td><td>100</td><td>Total and Valuation</td></tr>
+		<tr><td>VAT</td><td>120</td><td>Total</td></tr>
+		<tr><td>Customs Duty</td><td>150</td><td>Valuation</td></tr>
+	</tbody>
+</table>
+
+**Stock Ledger**
+
+![pr_stock_ledger](img/accounting-for-stock-2.png)
+
+**General Ledger**
+
+![pr_general_ledger](img/accounting-for-stock-3.png)
+
+As stock balance increases through Purchase Receipt, "Store" and "Fixed Asset Warehouse" accounts are debited and a temporary account "Stock Receipt But Not Billed" account is credited, to maintain double entry accounting system.
+
+
+--
+
+### **Purchase Invoice**
+
+On receiving Bill from supplier, for the above Purchase Receipt, you will make Purchase Invoice for the same. The general ledger entries are as follows:
+
+**General Ledger**
+
+![pi_general_ledger](img/accounting-for-stock-4.png)
+
+
+Here "Stock Received But Not Billed" account is debited and nullified the effect of Purchase Receipt. "Expenses Included In Valuation" account has been credited which ensures the valuation expense accounts are not booked (debited) twice (in Purchase Invoice and Delivery Note).
+
+--
+
+### **Delivery Note**
+
+Lets say, you have an order from "Jane Doe" to deliver 5 nos of item "RM0001" at $300. Following are the details of Delivery Note:
+
+**Customer:** Jane Doe
+
+**Items:**
+<table class="table table-bordered">
+	<thead>
+		<tr><th>Item</th><th>Warehouse</th><th>Qty</th><th>Rate</th><th>Amount</th></tr>
+	</thead>
+	<tbody>
+		<tr><td>RM0001</td><td>Stores</td><td>5</td><td>300</td><td>1500</td></tr>
+	</tbody>
+</table>
+	
+**Taxes:**
+
+<table class="table table-bordered">
+	<thead>
+		<tr><th>Account</th><th>Amount</th></tr>
+	</thead>
+	<tbody>
+		<tr><td>Service Tax</td><td>150</td></tr>
+		<tr><td>VAT</td><td>100</td></tr>
+	</tbody>
+</table>
+
+
+**Stock Ledger**
+
+![dn_stock_ledger](img/accounting-for-stock-5.png)
+
+**General Ledger**
+
+![dn_general_ledger](img/accounting-for-stock-6.png)
+
+As item is delivered from "Stores" warehouse, "Stores" account is credited and equal amount is debited to the expense account "Cost of Goods Sold". The debit/credit amount is equal to the total valuation amount (buying cost) of the selling items. And valuation amount is calculated based on your prefferred valuation method (FIFO / Moving Average) or actual cost of serialized items.
+<pre>
+	<code>
+In this example, we have considered valuation method as FIFO. 
+Valuation Rate 	= Purchase Rate + Charges Included in Valuation 
+				= 200 + (250 * (2000 / 2500) / 10) 
+				= 220
+Total Valuation Amount 	= 220 * 5 
+						= 1100
+	</code>
+</pre>
+
+--
+
+### **Sales Invoice with Update Stock**
+
+Lets say, you did not make Delivery Note against the above order and instead you have made Sales Invoice directly, with "Update Stock" options.  The details of the Sales Invoice are same as the above Delivery Note.
+
+**Stock Ledger**
+
+![si_stock_ledger](img/accounting-for-stock-7.png)
+
+**General Ledger**
+
+![si_general_ledger](img/accounting-for-stock-8.png)
+
+Here, apart from normal account entries for invoice, "Stores" and "Cost of Goods Sold" accounts are also affected based on the valuation amount.
+
+--
+
+### **Stock Entry (Material Receipt)**
+
+**Items:**
+<table class="table table-bordered">
+	<thead>
+		<tr><th>Item</th><th>Target Warehouse</th><th>Qty</th><th>Rate</th><th>Amount</th></tr>
+	</thead>
+	<tbody>
+		<tr><td>RM0001</td><td>Stores</td><td>50</td><td>220</td><td>11000</td></tr>
+	</tbody>
+</table>
+
+**Stock Ledger**
+
+![mr_stock_ledger](img/accounting-for-stock-9.png)
+
+**General Ledger**
+
+![mr_stock_ledger](img/accounting-for-stock-10.png)
+ 
+--
+
+### **Stock Entry (Material Issue)**
+
+**Items:**
+<table class="table table-bordered">
+	<thead>
+		<tr><th>Item</th><th>Source Warehouse</th><th>Qty</th><th>Rate</th><th>Amount</th></tr>
+	</thead>
+	<tbody>
+		<tr><td>RM0001</td><td>Stores</td><td>10</td><td>220</td><td>2200</td></tr>
+	</tbody>
+</table>
+
+**Stock Ledger**
+
+![mi_stock_ledger](img/accounting-for-stock-11.png)
+
+**General Ledger**
+
+![mi_stock_ledger](img/accounting-for-stock-12.png)
+
+--
+
+### **Stock Entry (Material Transfer)**
+
+**Items:**
+<table class="table table-bordered">
+	<thead>
+		<tr><th>Item</th><th>Source Warehouse</th><th>Target Warehouse</th>
+		<th>Qty</th><th>Rate</th><th>Amount</th></tr>
+	</thead>
+	<tbody>
+		<tr><td>RM0001</td><td>Stores</td><td>Work In Progress</td>
+		<td>10</td><td>220</td><td>2200</td></tr>
+	</tbody>
+</table>
+
+**Stock Ledger**
+
+![mtn_stock_ledger](img/accounting-for-stock-13.png)
+
+**General Ledger**
+
+![mtn_general_ledger](img/accounting-for-stock-14.png)
+
+--
+
+### **Stock Entry (Sales Return - Sales Invoice booked)**
+
+**Items:**
+<table class="table table-bordered">
+	<thead>
+		<tr><th>Item</th><th>Target Warehouse</th><th>Qty</th><th>Rate</th><th>Amount</th></tr>
+	</thead>
+	<tbody>
+		<tr><td>RM0001</td><td>Stores</td><td>2</td><td>200</td><td>400</td></tr>
+	</tbody>
+</table>
+
+**Stock Ledger**
+
+![sret_stock_ledger](img/accounting-for-stock-15.png)
+
+**General Ledger**
+
+![sret_general_ledger](img/accounting-for-stock-16.png)
+
+
+--
+
+### **Stock Entry (Purchase Return)**
+
+**Items:**
+<table class="table table-bordered">
+	<thead>
+		<tr><th>Item</th><th>Source Warehouse</th><th>Qty</th><th>Rate</th><th>Amount</th></tr>
+	</thead>
+	<tbody>
+		<tr><td>RM0001</td><td>Stores</td><td>4</td><td>220</td><td>880</td></tr>
+	</tbody>
+</table>
+
+**Stock Ledger**
+
+![pret_stock_ledger](img/accounting-for-stock-17.png)
+
+**General Ledger**
+
+![pret_general_ledger](img/accounting-for-stock-18.png)
diff --git a/hr/doctype/leave_application/test_leave_application.py b/hr/doctype/leave_application/test_leave_application.py
index 5888eae..c89f7c4 100644
--- a/hr/doctype/leave_application/test_leave_application.py
+++ b/hr/doctype/leave_application/test_leave_application.py
@@ -106,13 +106,12 @@
 		add_role("test1@example.com", "Leave Approver")
 		add_role("test2@example.com", "Leave Approver")
 		
-		self._test_leave_approval_basic_case_1()
-		self._test_leave_approval_basic_case_2()
+		self._test_leave_approval_basic_case()
 		self._test_leave_approval_invalid_leave_approver_insert()
 		self._test_leave_approval_invalid_leave_approver_submit()
 		self._test_leave_approval_valid_leave_approver_insert()
 		
-	def _test_leave_approval_basic_case_1(self):
+	def _test_leave_approval_basic_case(self):
 		self._clear_applications()
 		
 		# create leave application as Employee
@@ -128,19 +127,6 @@
 		self.assertEqual(webnotes.conn.get_value("Leave Application", application.doc.name,
 			"docstatus"), 1)
 		
-	def _test_leave_approval_basic_case_2(self):
-		self._clear_applications()
-		
-		# create leave application by any leave approver, 
-		# when no leave approver specified in employee's leave approvers list
-		application = self.get_application(test_records[1])
-		application.doc.leave_approver = "test1@example.com"
-		application.insert()
-		application.doc.status = "Approved"
-		application.submit()
-		self.assertEqual(webnotes.conn.get_value("Leave Application", application.doc.name,
-			"docstatus"), 1)
-		
 	def _test_leave_approval_invalid_leave_approver_insert(self):
 		from hr.doctype.leave_application.leave_application import InvalidLeaveApproverError
 		
@@ -186,11 +172,13 @@
 		original_department = webnotes.conn.get_value("Employee", "_T-Employee-0001", "department")
 		webnotes.conn.set_value("Employee", "_T-Employee-0001", "department", None)
 		
-		# change to valid leave approver and try to create and submit leave application
-		webnotes.session.user = "test2@example.com"
+		webnotes.session.user = "test@example.com"
 		application = self.get_application(test_records[1])
 		application.doc.leave_approver = "test2@example.com"
 		application.insert()
+
+		# change to valid leave approver and try to submit leave application
+		webnotes.session.user = "test2@example.com"
 		application.doc.status = "Approved"
 		application.submit()
 		self.assertEqual(webnotes.conn.get_value("Leave Application", application.doc.name,
diff --git a/install_erpnext.py b/install_erpnext.py
index 70cc2aa..79f79d7 100644
--- a/install_erpnext.py
+++ b/install_erpnext.py
@@ -289,7 +289,7 @@
 		RewriteCond %%{REQUEST_FILENAME} !-f
 		RewriteCond %%{REQUEST_FILENAME} !-d
 		RewriteCond %%{REQUEST_FILENAME} !-l
-		RewriteRule ^([^/]+)$ /web.py?page=$1 [QSA,L]		
+		RewriteRule ^([^/]+)$ /web.py?page=$1 [QSA,L]
 	</Directory>
 </VirtualHost>""" % (install_path, install_path)
 	
diff --git a/manufacturing/doctype/bom/bom.py b/manufacturing/doctype/bom/bom.py
index cb4b8c5..9a56612 100644
--- a/manufacturing/doctype/bom/bom.py
+++ b/manufacturing/doctype/bom/bom.py
@@ -121,8 +121,8 @@
 			elif self.doc.rm_cost_as_per == "Price List":
 				if not self.doc.buying_price_list:
 					webnotes.throw(_("Please select Price List"))
-				rate = webnotes.conn.get_value("Item Price", {"price_list": self.doc.buying_price_list, 
-					"parent": arg["item_code"]}, "ref_rate") or 0
+				rate = webnotes.conn.get_value("Item Price", {"parent": self.doc.buying_price_list, 
+					"item_code": arg["item_code"]}, "ref_rate") or 0
 			elif self.doc.rm_cost_as_per == 'Standard Rate':
 				rate = arg['standard_rate']
 
diff --git a/patches/april_2012/__init__.py b/patches/april_2012/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/patches/april_2012/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/patches/april_2012/after_sync_cleanup.py b/patches/april_2012/after_sync_cleanup.py
deleted file mode 100644
index 5e93ce1..0000000
--- a/patches/april_2012/after_sync_cleanup.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	from webnotes.model import delete_doc
-	webnotes.conn.sql("update `tabDocType` set module = 'Utilities' where name in ('Question', 'Answer')")
-	delete_doc('Module Def', 'Knowledge Base')
diff --git a/patches/april_2012/delete_about_contact.py b/patches/april_2012/delete_about_contact.py
deleted file mode 100644
index 2655e3c..0000000
--- a/patches/april_2012/delete_about_contact.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	from webnotes.model import delete_doc
-	delete_doc('DocType', 'About Us Team')
-	delete_doc('DocType', 'About Us Settings')
-	delete_doc('DocType', 'Contact Us Settings')
\ No newline at end of file
diff --git a/patches/april_2012/naming_series_patch.py b/patches/april_2012/naming_series_patch.py
deleted file mode 100644
index 8b086f7..0000000
--- a/patches/april_2012/naming_series_patch.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	from webnotes.model.code import get_obj
-	ns_list = webnotes.conn.sql("""\
-		SELECT `tabDocField`.`parent`, `tabDocField`.`options`
-		FROM `tabDocField`, `tabDocType`
-		WHERE `tabDocField`.`fieldname` = 'naming_series'
-		AND `tabDocType`.name=`tabDocField`.parent""")
-	ns_obj = get_obj('Naming Series')
-	for ns in ns_list:
-		if ns[0] and isinstance(ns[1], basestring):			
-			ns_obj.set_series_for(ns[0], ns[1].split("\n"))
diff --git a/patches/april_2012/reload_c_form.py b/patches/april_2012/reload_c_form.py
deleted file mode 100644
index afb8b6a..0000000
--- a/patches/april_2012/reload_c_form.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	from webnotes.modules import reload_doc
-	reload_doc('accounts', 'doctype', 'c_form')
diff --git a/patches/april_2012/remove_default_from_rv_detail.py b/patches/april_2012/remove_default_from_rv_detail.py
deleted file mode 100644
index 7716e6c..0000000
--- a/patches/april_2012/remove_default_from_rv_detail.py
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.conn.sql("update `tabDocField` set `default` = '' where fieldname = 'cost_center' and parent = 'RV Detail' and `default` = 'Purchase - TC'")
diff --git a/patches/april_2012/repost_stock_for_posting_time.py b/patches/april_2012/repost_stock_for_posting_time.py
deleted file mode 100644
index 0626205..0000000
--- a/patches/april_2012/repost_stock_for_posting_time.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	res = webnotes.conn.sql("""select distinct item_code, warehouse from `tabStock Ledger Entry`
-	 	where posting_time > '00:00:00' and posting_time < '00:01:00'""", as_dict=1)
-	webnotes.conn.sql("update `tabStock Ledger Entry` set posting_time = '00:00:00' where posting_time > '00:00:00' and posting_time < '00:01:00'")
-
-	from stock.stock_ledger import update_entries_after
-	for d in res:
-		update_entries_after({
-			"item_code": d.item_code,
-			"warehouse": d.warehouse,
-		})
diff --git a/patches/april_2012/update_appraisal_permission.py b/patches/april_2012/update_appraisal_permission.py
deleted file mode 100644
index 1c07822..0000000
--- a/patches/april_2012/update_appraisal_permission.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	from webnotes.model.doc import addchild
-	from webnotes.model.code import get_obj
-	
-	webnotes.conn.sql("delete from `tabDocPerm` where role = 'All' and permlevel = 0 and parent in ('Appraisal', 'Ticket', 'Project')")
-
-	appr = get_obj('DocType', 'Appraisal', with_children=1)
-	ch = addchild(appr.doc, 'permissions', 'DocPerm')
-	ch.permlevel = 0
-	ch.role = 'Employee'
-	ch.read = 1
-	ch.write = 1
-	ch.save()
diff --git a/patches/april_2012/update_permlevel_in_address.py b/patches/april_2012/update_permlevel_in_address.py
deleted file mode 100644
index a4b84de..0000000
--- a/patches/april_2012/update_permlevel_in_address.py
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.conn.sql("update `tabDocPerm` set permlevel = 0 where parent = 'Address'")
diff --git a/patches/april_2012/update_role_in_address.py b/patches/april_2012/update_role_in_address.py
deleted file mode 100644
index 33fecbe..0000000
--- a/patches/april_2012/update_role_in_address.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	from webnotes.model.doc import addchild
-	from webnotes.model.code import get_obj
-
-	webnotes.conn.sql("delete from `tabDocPerm` where role = 'All' and parent = 'Address'")
-
-	role1 = ['Sales User', 'Purchase User', 'Accounts User', 'Maintenance User']
-	role2 = ['Sales Manager', 'Sales Master Manager', 'Purchase Manager', 'Purchase Master Manager', 'Accounts Manager', 'Maintenance Manager']
-
-	addr = get_obj('DocType', 'Address', with_children=1)
-	for d in role1+role2:
-		ch = addchild(addr.doc, 'permissions', 'DocPerm')
-		ch.role = d
-		ch.read = 1
-		ch.write = 1
-		ch.create = 1
-		if d in role2:
-			ch.cancel = 1
-
-		ch.save()
diff --git a/patches/august_2012/__init__.py b/patches/august_2012/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/patches/august_2012/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/patches/august_2012/change_profile_permission.py b/patches/august_2012/change_profile_permission.py
deleted file mode 100644
index 5944c03..0000000
--- a/patches/august_2012/change_profile_permission.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	import webnotes.model.doc
-	webnotes.conn.sql("delete from `tabDocPerm` where parent='Profile' and permlevel=1")
-	new_perms = [
-		{
-			'parent': 'Profile',
-			'parentfield': 'permissions',
-			'parenttype': 'DocType',
-			'role': 'Administrator',			
-			'permlevel': 1,
-			'read': 1,
-			'write': 1
-		},
-		{
-			'parent': 'Profile',
-			'parentfield': 'permissions',
-			'parenttype': 'DocType',
-			'role': 'System Manager',
-			'permlevel': 1,
-			'read': 1,
-			'write': 1
-		},
-		
-	]
-	for perms in new_perms:
-		doc = webnotes.model.doc.Document('DocPerm')
-		doc.fields.update(perms)
-		doc.save()
-	webnotes.conn.commit()
-	webnotes.conn.begin()
-	
-	webnotes.reload_doc('core', 'doctype', 'profile')
\ No newline at end of file
diff --git a/patches/august_2012/repost_billed_amt.py b/patches/august_2012/repost_billed_amt.py
deleted file mode 100644
index b545c2e..0000000
--- a/patches/august_2012/repost_billed_amt.py
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	from webnotes.model.code import get_obj
-	from selling.doctype.sales_common.sales_common import StatusUpdater
-	
-	invoices = webnotes.conn.sql("select name from `tabSales Invoice` where docstatus = 1")
-	for inv in invoices:
-		inv_obj = get_obj('Sales Invoice', inv[0], with_children=1)
-		StatusUpdater(inv_obj, 1).update_all_qty()
\ No newline at end of file
diff --git a/patches/august_2012/task_allocated_to_assigned.py b/patches/august_2012/task_allocated_to_assigned.py
deleted file mode 100644
index 5d736bf..0000000
--- a/patches/august_2012/task_allocated_to_assigned.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-
-def execute():
-	from webnotes.widgets.form.assign_to import add
-	for t in webnotes.conn.sql("""select * from tabTask 
-		where ifnull(allocated_to, '')!=''""", as_dict=1):
-		add({
-			'doctype': "Task",
-			'name': t['name'],
-			'assign_to': t['allocated_to'],
-			'assigned_by': t['owner'],
-			'description': t['subject'],
-			'date': t['creation'],
-			"no_notification": True
-		})
\ No newline at end of file
diff --git a/patches/august_2013/p02_rename_price_list.py b/patches/august_2013/p02_rename_price_list.py
index 0b1c4d0..41efb27 100644
--- a/patches/august_2013/p02_rename_price_list.py
+++ b/patches/august_2013/p02_rename_price_list.py
@@ -5,7 +5,7 @@
 import webnotes
 
 def execute():
-	webnotes.reload_doc("website", "doctype", "shopping_cart_price_list")
+	webnotes.reload_doc("selling", "doctype", "shopping_cart_price_list")
 	
 	for t in [
 			("Supplier Quotation", "price_list_name", "buying_price_list"),
diff --git a/patches/january_2013/purchase_price_list.py b/patches/january_2013/purchase_price_list.py
deleted file mode 100644
index 89509cf..0000000
--- a/patches/january_2013/purchase_price_list.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-import webnotes
-
-def execute():
-	webnotes.reload_doc("stock", "doctype", "item_price")
-	
-	# check for selling
-	webnotes.conn.sql("""update `tabItem Price` set buying_or_selling = "Selling"
-		where ifnull(buying_or_selling, '')=''""")
-	
\ No newline at end of file
diff --git a/patches/july_2012/__init__.py b/patches/july_2012/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/patches/july_2012/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/patches/july_2012/address_contact_perms.py b/patches/july_2012/address_contact_perms.py
deleted file mode 100644
index 8c41dbc..0000000
--- a/patches/july_2012/address_contact_perms.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.conn.sql("""\
-		delete from `tabDocPerm`
-		where parent in ('Address', 'Contact')""")
-	webnotes.conn.commit()
-	
-	webnotes.reload_doc('utilities', 'doctype', 'address')
-	webnotes.reload_doc('utilities', 'doctype', 'contact')
-	webnotes.conn.begin()
\ No newline at end of file
diff --git a/patches/july_2012/auth_table.py b/patches/july_2012/auth_table.py
deleted file mode 100644
index 718243d6..0000000
--- a/patches/july_2012/auth_table.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-def execute():
-	webnotes.conn.commit()
-	
-	from webnotes.install_lib.install import Installer
-	Installer(None, None).create_auth_table()
-
-	webnotes.conn.begin()
-	
-	for user, password in webnotes.conn.sql("""select name, password from tabProfile"""):
-		if password:
-			webnotes.conn.sql("""insert into __Auth (user, `password`) values (%s, %s)""",
-				(user, password))
diff --git a/patches/july_2012/bin_permission.py b/patches/july_2012/bin_permission.py
deleted file mode 100644
index 3f9b65c..0000000
--- a/patches/july_2012/bin_permission.py
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.conn.sql("update `tabDocPerm` set permlevel = 0 where parent = 'Bin'")
\ No newline at end of file
diff --git a/patches/july_2012/default_freeze_account.py b/patches/july_2012/default_freeze_account.py
deleted file mode 100644
index 5255aa0..0000000
--- a/patches/july_2012/default_freeze_account.py
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.conn.sql("""update tabAccount set freeze_account='No' where freeze_account is null""")
-	webnotes.conn.sql("""update `tabPurchase Taxes and Charges` 
-		set category='Valuation and Total' where category='For Both'""")
-	webnotes.conn.sql("""update `tabPurchase Taxes and Charges` 
-		set category='Valuation' where category='For Valuation'""")
-	webnotes.conn.sql("""update `tabPurchase Taxes and Charges` 
-		set category='Total' where category='For Total'""")	
\ No newline at end of file
diff --git a/patches/july_2012/deprecate_bulk_rename.py b/patches/july_2012/deprecate_bulk_rename.py
deleted file mode 100644
index 5cb25a7..0000000
--- a/patches/july_2012/deprecate_bulk_rename.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	from webnotes.model import delete_doc
-	delete_doc('DocType', 'Bulk Rename Tool')
-	webnotes.conn.commit()
-	webnotes.conn.sql("drop table `tabBulk Rename Tool`")
-	webnotes.conn.begin()
\ No newline at end of file
diff --git a/patches/july_2012/deprecate_import_data_control.py b/patches/july_2012/deprecate_import_data_control.py
deleted file mode 100644
index f060587..0000000
--- a/patches/july_2012/deprecate_import_data_control.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	"""
-		deprecate:
-		* doctype - import data control
-		* page - import data (old)
-	"""
-	import webnotes
-	from webnotes.model import delete_doc
-	delete_doc('DocType', 'Import Data Control')
-	delete_doc('Page', 'Import Data')
\ No newline at end of file
diff --git a/patches/july_2012/packing_list_cleanup_and_serial_no.py b/patches/july_2012/packing_list_cleanup_and_serial_no.py
deleted file mode 100644
index d508aa3..0000000
--- a/patches/july_2012/packing_list_cleanup_and_serial_no.py
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	from webnotes.utils import flt
-	wrong_plist = webnotes.conn.sql("""
-	    select dnpi.name, dnpi.parent, dnpi.docstatus, dnpi.serial_no
-		from `tabDelivery Note Packing Item` dnpi
-		where ifnull(dnpi.parent, '') != '' 
-		and ifnull(dnpi.parent, '') not like 'old_par%'
-		and dnpi.parenttype = 'Delivery Note' 
-		and not exists (
-			select * from `tabDelivery Note Item` dni
-			where dni.item_code = dnpi.parent_item and
-			dni.name = dnpi.parent_detail_docname and
-			dni.parent = dnpi.parent
-		)
-	""", as_dict=1)
-
-	for d in wrong_plist:
-		if d['docstatus'] == 2 and d['serial_no']:
-			for s in d['serial_no'].splitlines():
-				sle = webnotes.conn.sql("""
-					select actual_qty, warehouse, voucher_no
-					from `tabStock Ledger Entry`
-					where (
-						serial_no like '%s\n%%' 
-						or serial_no like '%%\n%s' 
-						or serial_no like '%%\n%s\n%%' 
-						or serial_no = '%s'
-					)
-					and voucher_no != '%s'
-					and ifnull(is_cancelled, 'No') = 'No'
-					order by name desc
-					limit 1
-				"""% (s, s, s, s, d['parent']), as_dict=1)
-
-				status = 'Not Available'
-				if sle and flt(sle[0]['actual_qty']) > 0:
-					status = 'Available'
-				elif sle and flt(sle[0]['actual_qty']) < 0:
-					status = 'Delivered'
-				
-				webnotes.conn.sql("update `tabSerial No` set status = %s, warehouse = %s where name = %s", (status, sle[0]['warehouse'], s))
-				
-		webnotes.conn.sql("delete from `tabDelivery Note Packing Item` where name = %s", d['name'])
\ No newline at end of file
diff --git a/patches/july_2012/project_patch_repeat.py b/patches/july_2012/project_patch_repeat.py
deleted file mode 100644
index c17e9c4..0000000
--- a/patches/july_2012/project_patch_repeat.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.conn.sql("""update `tabPurchase Order Item` t1, `tabPurchase Order` t2
-		set t1.project_name = t2.project_name where t1.parent = t2.name
-		and ifnull(t1.project_name, '') = ''""")
-	webnotes.conn.sql("""update `tabPurchase Invoice Item` t1, `tabPurchase Invoice` t2
-		set t1.project_name = t2.project_name where t1.parent = t2.name
-		and ifnull(t1.project_name, '') = ''""")
-	webnotes.conn.sql("""update `tabPurchase Receipt Item` t1, `tabPurchase Receipt` t2
-		set t1.project_name = t2.project_name where t1.parent = t2.name
-		and ifnull(t1.project_name, '') = ''""")
-	
-	webnotes.conn.commit()
-	webnotes.reload_doc("buying", "doctype", "purchase_order")
-	webnotes.reload_doc("accounts", "doctype", "purchase_invoice")
-	webnotes.conn.begin()
\ No newline at end of file
diff --git a/patches/july_2012/remove_event_role_owner_match.py b/patches/july_2012/remove_event_role_owner_match.py
deleted file mode 100644
index cd5f489..0000000
--- a/patches/july_2012/remove_event_role_owner_match.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.conn.sql("""\
-		update `tabDocPerm` set `match`=NULL
-		where parent='Event' and role='All' and permlevel=0""")
\ No newline at end of file
diff --git a/patches/july_2012/repost_stock_due_to_wrong_packing_list.py b/patches/july_2012/repost_stock_due_to_wrong_packing_list.py
deleted file mode 100644
index 315b4ed..0000000
--- a/patches/july_2012/repost_stock_due_to_wrong_packing_list.py
+++ /dev/null
@@ -1,100 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-from stock.stock_ledger import update_entries_after
-
-def execute():
-	# add index
-	webnotes.conn.commit()
-	try:
-		webnotes.conn.sql("""alter table `tabDelivery Note Packing Item`
-			add index item_code_warehouse (item_code, warehouse)""")
-	except:
-		pass
-	webnotes.conn.begin()
-
-	webnotes.conn.auto_commit_on_many_writes = 1
-	repost_reserved_qty()
-	cleanup_wrong_sle()
-	webnotes.conn.auto_commit_on_many_writes = 0
-
-def repost_reserved_qty():
-	from webnotes.utils import flt
-	bins = webnotes.conn.sql("select item_code, warehouse, name, reserved_qty from `tabBin`")
-	i = 0
-	for d in bins:
-		i += 1
-		reserved_qty = webnotes.conn.sql("""
-			select 
-				sum((dnpi_qty / so_item_qty) * (so_item_qty - so_item_delivered_qty))
-			from 
-				(
-					select
-						qty as dnpi_qty,
-						(
-							select qty from `tabSales Order Item`
-							where name = dnpi.parent_detail_docname
-						) as so_item_qty,
-						(
-							select ifnull(delivered_qty, 0) from `tabSales Order Item`
-							where name = dnpi.parent_detail_docname
-						) as so_item_delivered_qty
-					from 
-					(
-						select qty, parent_detail_docname
-						from `tabDelivery Note Packing Item` dnpi_in
-						where item_code = %s and warehouse = %s
-						and parenttype="Sales Order"
-						and exists (select * from `tabSales Order` so
-						where name = dnpi_in.parent and docstatus = 1 and status != 'Stopped')
-					) dnpi
-				) tab 
-			where 
-				so_item_qty >= so_item_delivered_qty
-		""", (d[0], d[1]))
-
-		if flt(d[3]) != flt(reserved_qty[0][0]):
-			webnotes.conn.sql("""
-				update `tabBin` set reserved_qty = %s where name = %s
-			""", (reserved_qty and reserved_qty[0][0] or 0, d[2]))
-		
-def cleanup_wrong_sle():
-	sle = webnotes.conn.sql("""
-		select item_code, warehouse, voucher_no, name
-		from `tabStock Ledger Entry` sle
-		where voucher_type = 'Delivery Note'
-		and not exists(
-			select name from `tabDelivery Note Packing Item` 
-			where item_code = sle.item_code 
-			and qty = abs(sle.actual_qty)
-			and parent = sle.voucher_no
-		) and not exists (
-			select name from `tabDelivery Note Item` 
-			where item_code = sle.item_code 
-			and qty = abs(sle.actual_qty)
-			and parent = sle.voucher_no
-		)
-	""")
-	if sle:
-		for d in sle:
-			webnotes.conn.sql("update `tabStock Ledger Entry` set is_cancelled = 'Yes' where name = %s", d[3])
-			create_comment(d[3])
-			update_entries_after({
-				"item_code": d[0],
-				"warehouse": d[1],
-				"posting_date": "2012-07-01",
-				"posting_time": "12:05"
-			})
-			
-def create_comment(dn):
-	from webnotes.model.doc import Document
-	cmt = Document('Comment')
-	cmt.comment = 'Cancelled by administrator due to wrong entry in packing list'
-	cmt.comment_by = 'Administrator'
-	cmt.comment_by_fullname = 'Administrator'
-	cmt.comment_doctype = 'Stock Ledger Entry'
-	cmt.comment_docname = dn
-	cmt.save(1)
-	
\ No newline at end of file
diff --git a/patches/july_2012/unicode_conf.py b/patches/july_2012/unicode_conf.py
deleted file mode 100644
index cbbe5da..0000000
--- a/patches/july_2012/unicode_conf.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-
-def execute():
-	"""appends from __future__ import unicode_literals to py files if necessary"""
-	import wnf
-	wnf.append_future_import()
\ No newline at end of file
diff --git a/patches/july_2012/update_purchase_tax.py b/patches/july_2012/update_purchase_tax.py
deleted file mode 100644
index 28f2ca7..0000000
--- a/patches/july_2012/update_purchase_tax.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.conn.sql("""update `tabPurchase Taxes and Charges` 
-		set category='Valuation and Total' where category='For Both'""")
-	webnotes.conn.sql("""update `tabPurchase Taxes and Charges` 
-		set category='Valuation' where category='For Valuation'""")
-	webnotes.conn.sql("""update `tabPurchase Taxes and Charges` 
-		set category='Total' where category='For Total'""")
\ No newline at end of file
diff --git a/patches/june_2012/__init__.py b/patches/june_2012/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/patches/june_2012/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/patches/june_2012/alter_tabsessions.py b/patches/june_2012/alter_tabsessions.py
deleted file mode 100644
index 29ae177..0000000
--- a/patches/june_2012/alter_tabsessions.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.conn.commit()
-	webnotes.conn.sql("alter table `tabSessions` modify user varchar(180)")
-	webnotes.conn.begin()
\ No newline at end of file
diff --git a/patches/june_2012/barcode_in_feature_setup.py b/patches/june_2012/barcode_in_feature_setup.py
deleted file mode 100644
index 630f50f..0000000
--- a/patches/june_2012/barcode_in_feature_setup.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	from webnotes.model.code import get_obj
-	fs = get_obj('Features Setup')
-	fs.doc.fs_item_barcode = 0
-	fs.doc.save()
-	fs.validate()
\ No newline at end of file
diff --git a/patches/june_2012/cms2.py b/patches/june_2012/cms2.py
deleted file mode 100644
index a9171d7..0000000
--- a/patches/june_2012/cms2.py
+++ /dev/null
@@ -1,89 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	
-	# sync doctypes required for the patch
-	webnotes.reload_doc('website', 'doctype', 'web_page')
-	webnotes.reload_doc('website', 'doctype', 'website_settings')
-	webnotes.reload_doc('stock', 'doctype', 'item')
-
-	cleanup()
-
-	save_pages()
-	
-	save_website_settings()
-	
-def cleanup():
-	import webnotes
-		
-	# delete pages from `tabPage` of module Website or of type Webpage
-	webnotes.conn.sql("""\
-		delete from `tabPage`
-		where module='Website' and ifnull(web_page, 'No') = 'Yes'""")
-	
-	# change show_in_website value in item table to 0 or 1
-	webnotes.conn.sql("""\
-		update `tabItem`
-		set show_in_website = if(show_in_website = 'Yes', 1, 0)
-		where show_in_website is not null""")
-		
-	# move comments from comment_doctype Page to Blog
-	webnotes.conn.sql("""\
-		update `tabComment` comm, `tabBlog` blog
-		set comm.comment_doctype = 'Blog', comm.comment_docname = blog.name
-		where comm.comment_docname = blog.page_name""")
-		
-	# delete deprecated pages
-	import webnotes.model
-	for page in ['products', 'contact', 'blog', 'about']:
-		try:
-			webnotes.model.delete_doc('Page', page)
-		except Exception, e:
-			webnotes.modules.patch_handler.log(unicode(e))
-
-	import os
-	import conf
-	# delete other html files
-	exception_list = ['app.html', 'unsupported.html', 'blank.html']
-	conf_dir = os.path.dirname(os.path.abspath(conf.__file__))
-	public_path = os.path.join(conf_dir, 'public')
-	for f in os.listdir(public_path):
-		if f.endswith('.html') and f not in exception_list:
-			os.remove(os.path.join(public_path, f))
-
-def save_pages():
-	"""save all web pages, blogs to create content"""
-	query_map = {
-		'Web Page': """select name from `tabWeb Page` where docstatus=0""",
-		'Blog': """\
-			select name from `tabBlog`
-			where docstatus = 0 and ifnull(published, 0) = 1""",
-		'Item': """\
-			select name from `tabItem`
-			where docstatus = 0 and ifnull(show_in_website, 0) = 1""",
-	}
-
-	import webnotes
-	from webnotes.model.bean import Bean
-	import webnotes.modules.patch_handler
-
-	for dt in query_map:
-		for result in webnotes.conn.sql(query_map[dt], as_dict=1):
-			try:
-				Bean(dt, result['name'].encode('utf-8')).save()
-			except Exception, e:
-				webnotes.modules.patch_handler.log(unicode(e))
-			
-def save_website_settings():
-	from webnotes.model.code import get_obj
-	
-	# rewrite pages
-	get_obj('Website Settings').on_update()
-	
-	ss = get_obj('Style Settings')
-	ss.validate()
-	ss.doc.save()
-	ss.on_update()
\ No newline at end of file
diff --git a/patches/june_2012/copy_uom_for_pur_inv_item.py b/patches/june_2012/copy_uom_for_pur_inv_item.py
deleted file mode 100644
index 947d110..0000000
--- a/patches/june_2012/copy_uom_for_pur_inv_item.py
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	
-	webnotes.reload_doc('buying', 'doctype', 'purchase_order_item')
-	webnotes.reload_doc('accounts', 'doctype', 'purchase_invoice_item')
-	webnotes.reload_doc('stock', 'doctype', 'purchase_receipt_item')
-	
-	webnotes.conn.sql("update `tabPurchase Invoice Item` t1, `tabPurchase Order Item` t2 set t1.uom = t2.uom where ifnull(t1.po_detail, '') != '' and t1.po_detail = t2.name")
-	webnotes.conn.sql("update `tabPurchase Invoice Item` t1, `tabPurchase Receipt Item` t2 set t1.uom = t2.uom where ifnull(t1.pr_detail, '') != '' and t1.pr_detail = t2.name")
\ No newline at end of file
diff --git a/patches/june_2012/delete_old_parent_entries.py b/patches/june_2012/delete_old_parent_entries.py
deleted file mode 100644
index 384df77..0000000
--- a/patches/june_2012/delete_old_parent_entries.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	"""delete entries of child table having parent like old_par%% or ''"""
-	import webnotes
-	res = webnotes.conn.sql("""\
-		select dt.name from `tabDocType` dt
-		where ifnull(dt.istable, 0)=1 and
-		exists (
-			select * from `tabDocField` df
-			where df.fieldtype='Table' and
-			df.options=dt.name
-		)""")
-	for r in res:
-		if r[0]:
-			webnotes.conn.sql("""\
-				delete from `tab%s`
-				where (ifnull(parent, '')='' or parent like "old_par%%") and
-				ifnull(parenttype, '')!=''""" % r[0])
\ No newline at end of file
diff --git a/patches/june_2012/fetch_organization_from_lead.py b/patches/june_2012/fetch_organization_from_lead.py
deleted file mode 100644
index 85b1436..0000000
--- a/patches/june_2012/fetch_organization_from_lead.py
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.conn.sql("update `tabQuotation` t1, `tabLead` t2 set t1.organization = t2.company_name where ifnull(t1.lead, '') != ''  and t1.quotation_to = 'Lead' and ifnull(t1.organization, '') = '' and t1.lead = t2.name")
\ No newline at end of file
diff --git a/patches/june_2012/reports_list_permission.py b/patches/june_2012/reports_list_permission.py
deleted file mode 100644
index c70b659..0000000
--- a/patches/june_2012/reports_list_permission.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	"""allow read permission to all for report list"""
-	import webnotes
-	webnotes.conn.sql("""\
-		delete from `tabDocPerm`
-		where parent in ('Report', 'Search Criteria')""")
-	
-	webnotes.reload_doc('core', 'doctype', 'report')
diff --git a/patches/june_2012/series_unique_patch.py b/patches/june_2012/series_unique_patch.py
deleted file mode 100644
index 4bea9f0..0000000
--- a/patches/june_2012/series_unique_patch.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	"""add unique constraint to series table's name column"""
-	import webnotes
-	webnotes.conn.commit()
-	webnotes.conn.sql("alter table `tabSeries` add unique (name)")
-	webnotes.conn.begin()
\ No newline at end of file
diff --git a/patches/june_2012/set_recurring_type.py b/patches/june_2012/set_recurring_type.py
deleted file mode 100644
index c7d4d63..0000000
--- a/patches/june_2012/set_recurring_type.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.reload_doc('accounts', 'doctype', 'sales_invoice')
-	
-	webnotes.conn.sql("update `tabSales Invoice` set recurring_type = 'Monthly' where ifnull(convert_into_recurring_invoice, 0) = 1")
\ No newline at end of file
diff --git a/patches/june_2012/support_ticket_autoreply.py b/patches/june_2012/support_ticket_autoreply.py
deleted file mode 100644
index a9c8d82..0000000
--- a/patches/june_2012/support_ticket_autoreply.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	"""New Send Autoreply checkbox in Email Settings"""
-	import webnotes
-	import webnotes.utils
-	
-	webnotes.conn.commit()
-	webnotes.reload_doc('setup', 'doctype', 'email_settings')
-	webnotes.conn.begin()
-	
-	sync_support_mails = webnotes.utils.cint(webnotes.conn.get_value('Email Settings',
-							None, 'sync_support_mails'))
-							
-	if sync_support_mails:
-		webnotes.conn.set_value('Email Settings', None, 'send_autoreply', 1)
\ No newline at end of file
diff --git a/patches/june_2013/p03_buying_selling_for_price_list.py b/patches/june_2013/p03_buying_selling_for_price_list.py
index 931517e..ead97ab 100644
--- a/patches/june_2013/p03_buying_selling_for_price_list.py
+++ b/patches/june_2013/p03_buying_selling_for_price_list.py
@@ -8,7 +8,7 @@
 
 def execute():
 	webnotes.reload_doc("setup", "doctype", "price_list")
-	webnotes.reload_doc("stock", "doctype", "item_price")
+	webnotes.reload_doc("setup", "doctype", "item_price")
 	
 	try:
 		for price_list in webnotes.conn.sql_list("""select name from `tabPrice List`"""):
@@ -20,10 +20,9 @@
 		
 			buying_or_selling = "Selling" if selling else "Buying"
 			webnotes.conn.set_value("Price List", price_list, "buying_or_selling", buying_or_selling)
-			webnotes.conn.sql("""update `tabItem Price` set buying_or_selling=%s 
-				where price_list_name=%s""", (buying_or_selling, price_list))
 	except MySQLdb.OperationalError, e:
 		if e.args[0] == 1054:
-			webnotes.conn.sql("""update `tabItem Price` set buying_or_selling="Selling" """)
+			webnotes.conn.sql("""update `tabPrice List` set buying_or_selling='Selling' 
+				where ifnull(buying_or_selling, '')='' """)
 		else:
-			raise e
+			raise e
\ No newline at end of file
diff --git a/patches/june_2013/p08_shopping_cart_settings.py b/patches/june_2013/p08_shopping_cart_settings.py
index 9378c38..479a696 100644
--- a/patches/june_2013/p08_shopping_cart_settings.py
+++ b/patches/june_2013/p08_shopping_cart_settings.py
@@ -4,7 +4,7 @@
 import webnotes
 
 def execute():
-	webnotes.reload_doc("website", "doctype", "shopping_cart_settings")
+	webnotes.reload_doc("selling", "doctype", "shopping_cart_settings")
 	
 	# create two default territories, one for home country and one named Rest of the World
 	from setup.doctype.setup_control.setup_control import create_territories
diff --git a/patches/mar_2012/__init__.py b/patches/mar_2012/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/patches/mar_2012/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/patches/mar_2012/add_fieldnames.py b/patches/mar_2012/add_fieldnames.py
deleted file mode 100644
index 52cf6b7..0000000
--- a/patches/mar_2012/add_fieldnames.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-# do not run this patch
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	import webnotes.modules
-	forbidden = ['%', "'", '"', '#', '*', '?', '`', '(', ')', '<', '>', '-',
-	'\\', '/', '.', '&', '!', '@', '$', '^', '+']
-	doctype_list = webnotes.conn.sql("SELECT name, module FROM `tabDocType`")
-	for doctype, module in doctype_list:
-		docfield_list = webnotes.conn.sql("""\
-				SELECT name, label, fieldtype FROM `tabDocField`
-				WHERE parent = %s AND IFNULL(fieldname, '') = ''""", doctype)
-		field_type_count = {}
-		count = 0
-		for name, label, fieldtype in docfield_list:
-			fieldname = None
-			if label:
-				temp_label = label
-				if len(temp_label)==1:
-					temp_label = fieldtype + temp_label
-				
-				fieldname = temp_label.lower().replace(' ', '_')
-				if "<" in fieldname:
-					count = field_type_count.setdefault(fieldtype, 0)
-					fieldname = fieldtype.lower().replace(' ', '_') + str(count)
-					field_type_count[fieldtype] = count + 1
-			elif fieldtype:
-				count = field_type_count.setdefault(fieldtype, 0)
-				fieldname = fieldtype.lower().replace(' ', '_') + str(count)
-				field_type_count[fieldtype] = count + 1
-
-			if fieldname:
-				for f in forbidden: fieldname = fieldname.replace(f, '')
-				fieldname = fieldname.replace('__', '_')
-				if fieldname.endswith('_'):
-					fieldname = fieldname[:-1]
-				if fieldname.startswith('_'):
-					fieldname = fieldname[1:]
-				#print fieldname
-				webnotes.conn.sql("""\
-						UPDATE `tabDocField` SET fieldname = %s
-						WHERE name = %s""", (fieldname, name))
-		webnotes.modules.export_doc('DocType', doctype)
diff --git a/patches/mar_2012/clean_property_setter.py b/patches/mar_2012/clean_property_setter.py
deleted file mode 100644
index b4ad909..0000000
--- a/patches/mar_2012/clean_property_setter.py
+++ /dev/null
@@ -1,81 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-
-def execute():
-	"""
-		* Remove unnecessary doctype properties
-		* Remove docfield property setters if fieldname doesn't exist
-		* Remove prev_field properties if value fieldname doesn't exist
-	"""
-	change_property_setter_fieldnames()
-	clean_doctype_properties()
-	clean_docfield_properties()
-
-def change_property_setter_fieldnames():
-	webnotes.reload_doc('core', 'doctype', 'property_setter')
-	docfield_list = webnotes.conn.sql("""\
-		SELECT name, fieldname FROM `tabDocField`""", as_list=1)
-	custom_field_list = webnotes.conn.sql("""\
-		SELECT name, fieldname FROM `tabCustom Field`""", as_list=1)
-	field_list = docfield_list + custom_field_list
-	property_setter_list = webnotes.conn.sql("""\
-		SELECT name, doc_name, value, property
-		FROM `tabProperty Setter`
-		WHERE doctype_or_field='DocField'""")
-	field_dict = dict(field_list)
-	for name, doc_name, value, prop in property_setter_list:
-		if doc_name in field_dict:
-			webnotes.conn.sql("""\
-				UPDATE `tabProperty Setter`
-				SET field_name = %s
-				WHERE name = %s""", (field_dict.get(doc_name), name))
-		if value in field_dict and prop=='previous_field':
-			webnotes.conn.sql("""\
-				UPDATE `tabProperty Setter`
-				SET value = %s
-				WHERE name = %s""", (field_dict.get(value), name))
-
-def clean_doctype_properties():
-	desc = webnotes.conn.sql("DESC `tabDocType`", as_dict=1)
-	property_list = '", "'.join([d.get('Field') for d in desc])
-	webnotes.conn.sql("""\
-		DELETE FROM `tabProperty Setter`
-		WHERE doctype_or_field = 'DocType'
-		AND property NOT IN ("%s")""" % property_list)
-	
-def clean_docfield_properties():
-	delete_list_1 = webnotes.conn.sql("""\
-		SELECT name FROM `tabProperty Setter` ps
-		WHERE doctype_or_field = 'DocField'
-		AND NOT EXISTS (
-			SELECT fieldname FROM `tabDocField` df
-			WHERE df.parent = ps.doc_type
-			AND df.fieldname = ps.field_name
-		) AND NOT EXISTS (
-			SELECT fieldname FROM `tabCustom Field` cf
-			WHERE cf.dt = ps.doc_type
-			AND cf.fieldname = ps.field_name
-		)""")
-	
-	delete_list_2 = webnotes.conn.sql("""\
-		SELECT name FROM `tabProperty Setter` ps
-		WHERE doctype_or_field = 'DocField'
-		AND property = 'previous_field'
-		AND NOT EXISTS (
-			SELECT fieldname FROM `tabDocField` df
-			WHERE df.parent = ps.doc_type
-			AND df.fieldname = ps.value
-		) AND NOT EXISTS (
-			SELECT fieldname FROM `tabCustom Field` cf
-			WHERE cf.dt = ps.doc_type
-			AND cf.fieldname = ps.value
-		)""")
-
-	delete_list = [d[0] for d in delete_list_1] + [d[0] for d in delete_list_2]
-
-	webnotes.conn.sql("""\
-		DELETE FROM `tabProperty Setter`
-		WHERE NAME IN ("%s")""" % '", "'.join(delete_list))
diff --git a/patches/mar_2012/cleanup_control_panel.py b/patches/mar_2012/cleanup_control_panel.py
deleted file mode 100644
index 6692bc4..0000000
--- a/patches/mar_2012/cleanup_control_panel.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-def execute():
-	webnotes.conn.sql("""\
-		DELETE FROM `tabSingles`
-		WHERE doctype = 'Control Panel'
-		AND field IN ("sync_with_gateway", "mail_password", "auto_email_id",
-		"mail_port", "outgoing_mail_server", "mail_login", "use_ssl")""")
diff --git a/patches/mar_2012/create_custom_fields.py b/patches/mar_2012/create_custom_fields.py
deleted file mode 100644
index b9fe2f0..0000000
--- a/patches/mar_2012/create_custom_fields.py
+++ /dev/null
@@ -1,118 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-# do not run this patch
-from __future__ import unicode_literals
-field_list = [
-['Contact', 'notes'],
-['Contact', 'birthday'],
-['Contact', 'anniversary'],
-['Customer', 'state_tax_type'],
-['Customer', 'tin_no'],
-['Customer', 'excise_registration_number'],
-['Customer', 'customer_discount_details'],
-['Customer', 'notes'],
-['Customer', 'follow_up_section'],
-['Customer', 'follow_up'],
-['Delivery Note', 'shipping_contact_no'],
-['Delivery Note', 'shipping_tin_no'],
-['Delivery Note', 'shipping_excise_no'],
-['Delivery Note', 'tin_no'],
-['Delivery Note', 'excise_no'],
-['Delivery Note Detail', 'cetsh_number'],
-['Item', 'base_material'],
-['Item', 'tool_type'],
-['Item', 'no_of_flutes'],
-['Item', 'special_treatment'],
-['Item', 'length'],
-['Item', 'width'],
-['Item', 'height_dia'],
-['Item', 'pl_item'],
-['Item', 'cetsh_number'],
-['Item', 'stock_maintained'],
-['Item', 'is_rm'],
-['Journal Voucher Detail', 'line_remarks'],
-['Lead', 'designation'],
-['Purchase Order', 'challan_number'],
-['Quotation', 'cust_enq_no'],
-['Quotation', 'enq_date'],
-['Quotation', 'quote_valid'],
-['Quotation', 'due_date'],
-['Receivable Voucher', 'voucher_time'],
-['Receivable Voucher', 'removal_time'],
-['Receivable Voucher', 'removal_date'],
-['Receivable Voucher', 'shipping_address'],
-['Receivable Voucher', 'shipping_location'],
-['Receivable Voucher', 'ship_to'],
-['Receivable Voucher', 'shipping_contact_no'],
-['Receivable Voucher', 'shipping_excise_no'],
-['Receivable Voucher', 'shipping_tin_no'],
-['Receivable Voucher', 'po_no'],
-['Receivable Voucher', 'po_date'],
-['Receivable Voucher', 'lr_no'],
-['Receivable Voucher', 'transporters'],
-['Receivable Voucher', 'ship_terms'],
-['Receivable Voucher', 'tin_no'],
-['Receivable Voucher', 'excise_no'],
-['RV Detail', 'cetsh_number'],
-['Sales Order', 'shipping_contact_no'],
-['Sales Order', 'shipping_tin_no'],
-['Sales Order', 'shipping_excise_no'],
-['Sales Order', 'tin_no'],
-['Sales Order', 'excise_number'],
-['Sales Order Detail', 'cetsh_number'],
-['Sales Order Detail', 'prd_notes'],
-['Shipping Address', 'phone_no'],
-['Shipping Address', 'tin_no'],
-['Shipping Address', 'excise_no'],
-['Stock Entry', 'process_custom'],
-['Stock Entry', 'city'],
-['Stock Entry', 'address_line_2'],
-['Stock Entry', 'address_line_1'],
-['Stock Entry', 'comp_other'],
-['Stock Entry', 'mobile_no'],
-['Stock Entry', 'phone_no'],
-['Stock Entry', 'country'],
-['Stock Entry', 'state'],
-['Stock Entry', 'challan_number'],
-['Stock Entry Detail', 'machine'],
-['Stock Entry Detail', 'worker'],
-['Supplier', 'notes'],
-['Supplier', 'purchase_other_charges'],
-['Supplier', 'tax_details'],
-['Supplier', 'tin_number'],
-['Supplier', 'excise_regd_number'],
-['Supplier', 'service_tax_regd_number'],
-['Warehouse', 'comp_other'],
-['Warehouse', 'process'],
-['Warehouse', 'country'],
-['Warehouse', 'tax_registration_number'],
-['Warehouse Type', 'process'],
-['Workstation', 'maintenance_data'],
-]
-
-
-import webnotes
-from webnotes.model.code import get_obj
-from webnotes.model.doc import Document
-
-def execute():
-	webnotes.reload_doc('core', 'doctype', 'custom_field')	
-	for f in field_list:
-		res = webnotes.conn.sql("""SELECT name FROM `tabCustom Field`
-				WHERE dt=%s AND fieldname=%s""", (f[0], f[1]))
-		if res: continue
-		docfield = webnotes.conn.sql("""SELECT * FROM `tabDocField`
-			WHERE parent=%s AND fieldname=%s""", (f[0], f[1]), as_dict=1)
-		if not docfield: continue
-		custom_field = docfield[0]
-
-		# scrub custom field dict
-		custom_field['dt'] = custom_field['parent']
-		del custom_field['parent']
-		
-		d = Document('Custom Field', fielddata=custom_field)
-		d.name = custom_field['dt'] + '-' + custom_field['fieldname']
-		d.save(1, ignore_fields=1)
-		#obj = get_obj(doc=d)
-		#obj.on_update()
diff --git a/patches/mar_2012/delete_docformat.py b/patches/mar_2012/delete_docformat.py
deleted file mode 100644
index b6ee2eb..0000000
--- a/patches/mar_2012/delete_docformat.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.conn.sql("DELETE FROM `tabDocField` WHERE options='DocFormat'")
-	webnotes.conn.sql("DELETE FROM `tabDocField` WHERE parent='DocFormat'")
-	webnotes.conn.sql("DELETE FROM `tabDocType` WHERE name='DocFormat'")
-	webnotes.conn.commit()
-	webnotes.conn.sql("DROP TABLE `tabDocFormat`")
-	webnotes.conn.begin()
diff --git a/patches/mar_2012/doctype_get_refactor.py b/patches/mar_2012/doctype_get_refactor.py
deleted file mode 100644
index 0900b9b..0000000
--- a/patches/mar_2012/doctype_get_refactor.py
+++ /dev/null
@@ -1,147 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-def execute():
-	"""
-		* Custom Field changes
-		* Add file_list to required tables
-		* Change floats/currency to decimal(18, 6)
-		* Remove DocFormat from DocType's fields
-		* Remove 'no_column' from DocField
-		* Drop table DocFormat
-	"""
-	import webnotes.model.sync
-	webnotes.model.sync.sync_all(force=1)
-	
-	handle_custom_fields()
-	create_file_list()
-
-	# do at last - needs commit due to DDL statements
-	change_to_decimal()
-
-def handle_custom_fields():
-	"""
-		* Assign idx to custom fields
-		* Create property setter entry of previous field
-		* Remove custom fields from tabDocField
-	"""
-	cf = get_cf()
-	assign_idx(cf)
-	create_prev_field_prop_setter(cf)
-	remove_custom_from_docfield(cf)
-
-def get_cf():
-	return webnotes.conn.sql("""\
-		SELECT * FROM `tabCustom Field`
-		WHERE docstatus < 2""", as_dict=1)
-
-def assign_idx(cf):
-	from webnotes.model.doctype import get
-	from webnotes.utils import cint
-	#print len(cf)
-	for f in cf:
-		#print f.get('dt'), f.get('name')
-		if f.get('idx'): continue
-		temp_doclist = get(f.get('dt'), form=0)
-		#print len(temp_doclist)
-		max_idx = max(d.idx for d in temp_doclist if d.doctype=='DocField')
-		if not max_idx: continue
-		webnotes.conn.sql("""\
-			UPDATE `tabCustom Field` SET idx=%s
-			WHERE name=%s""", (cint(max_idx)+1, f.get('name')))
-
-def create_prev_field_prop_setter(cf):
-	from webnotes.model.doc import Document
-	from core.doctype.custom_field.custom_field import get_fields_label
-	for f in cf:
-		idx_label_list, field_list = get_fields_label(f.get('dt'), 0)
-		temp_insert_after = (f.get('insert_after') or '').split(" - ")
-		if len(temp_insert_after)<=1: continue
-		similar_idx_label = [il for il in idx_label_list \
-			if temp_insert_after[0] in il]
-		if not similar_idx_label: continue
-		label_index = idx_label_list.index(similar_idx_label[0])
-		if label_index==-1: return
-
-		webnotes.conn.sql("""\
-			UPDATE `tabCustom Field`
-			SET insert_after = %s
-			WHERE name = %s""", (similar_idx_label[0], f.get('name')))
-
-		prev_field = field_list[label_index]
-		res = webnotes.conn.sql("""\
-			SELECT name FROM `tabProperty Setter`
-			WHERE doc_type = %s
-			AND field_name = %s
-			AND property = 'previous_field'""", (f.get('dt'), f.get('fieldname')))
-
-		if not res:
-			ps = Document('Property Setter', fielddata = {
-				'doctype_or_field': 'DocField',
-				'doc_type': f.get('dt'),
-				'field_name': f.get('fieldname'),
-				'property': 'previous_field',
-				'value': prev_field,
-				'property_type': 'Data',
-				'select_doctype': f.get('dt')
-			})
-			ps.save(1)
-
-def remove_custom_from_docfield(cf):
-	for f in cf:
-		webnotes.conn.sql("""\
-			DELETE FROM `tabDocField`
-			WHERE parent=%s AND fieldname=%s""", (f.get('dt'),
-			f.get('fieldname')))
-
-def create_file_list():
-	should_exist = ['Website Settings', 'Web Page', 'Timesheet', 'Task',
-		'Support Ticket', 'Supplier', 'Style Settings', 'Stock Reconciliation',
-		'Stock Entry', 'Serial No', 'Sales Order', 'Sales Invoice',
-		'Quotation', 'Question', 'Purchase Receipt', 'Purchase Order',
-		'Project', 'Profile', 'Production Order', 'Product', 'Print Format',
-		'Price List', 'Purchase Invoice', 'Page', 
-		'Maintenance Visit', 'Maintenance Schedule', 'Letter Head',
-		'Leave Application', 'Lead', 'Journal Voucher', 'Item', 'Material Request',
-		'Expense Claim', 'Opportunity', 'Employee', 'Delivery Note',
-		'Customer Issue', 'Customer', 'Contact Us Settings', 'Company',
-		'Bulk Rename Tool', 'Blog', 'BOM', 'About Us Settings']
-
-	from webnotes.model.code import get_obj
-
-	for dt in should_exist:
-		obj = get_obj('DocType', dt, with_children=1)
-		obj.doc.allow_attach = 1
-		obj.doc.save()
-		obj.make_file_list()
-		from webnotes.model.db_schema import updatedb
-		updatedb(obj.doc.name)
-
-		webnotes.clear_cache(doctype=obj.doc.name)
-
-def change_to_decimal():
-	webnotes.conn.commit()
-	tables = webnotes.conn.sql("SHOW TABLES")
-	alter_tables_list = []
-	for tab in tables:
-		if not tab: continue
-		desc = webnotes.conn.sql("DESC `%s`" % tab[0], as_dict=1)
-		flist = []
-		for d in desc:
-			if d.get('Type')=='decimal(14,2)':
-				flist.append(d.get('Field'))
-		if flist:
-			#print tab[0], flist
-			statements = ("MODIFY `%s` decimal(18,6)" % f for f in flist)
-			statements = ", \n".join(statements)
-			alter_tables_list.append("ALTER TABLE `%s` \n%s\n" % (tab[0],
-				statements))
-	
-	#print "\n\n".join(alter_tables_list)
-	for at in alter_tables_list:
-		webnotes.conn.sql(at)
-
-	webnotes.conn.begin()
-
diff --git a/patches/mar_2012/earning_deduction_type_patch.py b/patches/mar_2012/earning_deduction_type_patch.py
deleted file mode 100644
index 43a1433..0000000
--- a/patches/mar_2012/earning_deduction_type_patch.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.conn.sql("""
-		UPDATE `tabDocField`
-		SET fieldtype = 'Link', options = 'Deduction Type'
-		WHERE parent = 'Deduction Detail'
-		AND fieldname = 'd_type'
-		""")
-	webnotes.conn.sql("""
-		UPDATE `tabDocField`
-		SET fieldtype = 'Link', options = 'Earning Type'
-		WHERE parent = 'Earning Detail'
-		AND fieldname = 'e_type'
-		""")
diff --git a/patches/mar_2012/is_submittable_patch.py b/patches/mar_2012/is_submittable_patch.py
deleted file mode 100644
index b2da16c..0000000
--- a/patches/mar_2012/is_submittable_patch.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-# dont run this patch
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	import webnotes.model.doctype
-	from webnotes.utils import cint
-	from webnotes.model.doc import Document
-	from webnotes.model.code import get_obj
-	doctype_list = webnotes.conn.sql("SELECT name FROM `tabDocType`")
-	for dt in doctype_list:
-		doclist = webnotes.model.doctype.get(dt[0], form=0)
-		is_submittable = 0
-		for d in doclist:
-			if d.doctype == 'DocPerm' and d.fields.get('permlevel') == 0 \
-				and cint(d.fields.get('submit')) == 1:
-					is_submittable = 1
-					break
-		if is_submittable:
-			dt_doc = Document('DocType', doclist[0].name)
-			dt_doc.is_submittable = 1
-			dt_doc.save()
-			obj = get_obj(doc=dt_doc)
-			obj.make_amendable()
-			obj.on_update()
diff --git a/patches/mar_2012/pos_invoice_fix.py b/patches/mar_2012/pos_invoice_fix.py
deleted file mode 100644
index 148b373..0000000
--- a/patches/mar_2012/pos_invoice_fix.py
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	from webnotes.modules import reload_doc
-	reload_doc('accounts', 'Print Format', 'POS Invoice')
diff --git a/patches/mar_2012/usertags.py b/patches/mar_2012/usertags.py
deleted file mode 100644
index 4cb9b14..0000000
--- a/patches/mar_2012/usertags.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	doctype_list = webnotes.conn.sql("""SELECT name FROM `tabDocType`
-		WHERE docstatus<2 AND IFNULL(issingle, 0)=0
-		AND IFNULL(istable, 0)=0""")
-	webnotes.conn.commit()
-	for d in doctype_list:
-		add_col = True
-		desc = webnotes.conn.sql("DESC `tab%s`" % d[0], as_dict=1)
-		for td in desc:
-			if td.get('Field')=='_user_tags':
-				add_col = False		
-
-		if add_col:
-			webnotes.conn.sql("alter table `tab%s` add column `_user_tags` varchar(180)" % d[0])
-	webnotes.conn.begin()		
-
diff --git a/patches/may_2012/__init__.py b/patches/may_2012/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/patches/may_2012/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/patches/may_2012/cleanup_notification_control.py b/patches/may_2012/cleanup_notification_control.py
deleted file mode 100644
index 054f7ec..0000000
--- a/patches/may_2012/cleanup_notification_control.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.conn.sql("""
-		delete from `tabSingles`
-		where doctype='Notification Control'
-		and field in (
-			'payable_voucher',
-			'payment_received_message',
-			'payment_sent_message',
-			'enquiry')
-	""")
-	ren_list = [
-		['expense_voucher', 'expense_claim'],
-		['receivable_voucher', 'sales_invoice'],
-		['enquiry', 'opportunity'],
-	]
-	for r in ren_list:
-		webnotes.conn.sql("""
-			update `tabSingles`
-			set field=%s
-			where field=%s
-			and doctype='Notification Control'
-		""", (r[1], r[0]))
-	
-	webnotes.conn.commit()
-	webnotes.conn.begin()
-	webnotes.reload_doc('setup', 'doctype', 'notification_control')
\ No newline at end of file
diff --git a/patches/may_2012/cleanup_property_setter.py b/patches/may_2012/cleanup_property_setter.py
deleted file mode 100644
index b793e9d..0000000
--- a/patches/may_2012/cleanup_property_setter.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.conn.sql("delete from `tabProperty Setter` where property in ('width', 'previous_field')")
-
-	webnotes.conn.sql("delete from `tabSingles` where field = 'footer_font_color' and doctype = 'Style Settings'")
diff --git a/patches/may_2012/create_report_manager_role.py b/patches/may_2012/create_report_manager_role.py
deleted file mode 100644
index 56f2aa9..0000000
--- a/patches/may_2012/create_report_manager_role.py
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	from webnotes.model.doc import Document
-	
-	if not webnotes.conn.sql("select name from `tabRole` where name = 'Report Manager'"):
-		r = Document('Role')
-		r.role_name = 'Report Manager'
-		r.module = 'Core'
-		r.save()
\ No newline at end of file
diff --git a/patches/may_2012/cs_server_readonly.py b/patches/may_2012/cs_server_readonly.py
deleted file mode 100644
index 378a73d..0000000
--- a/patches/may_2012/cs_server_readonly.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	"""Make server custom script readonly for system manager"""
-	import webnotes.model.doc
-	new_perms = [
-		{
-			'parent': 'Custom Script',
-			'parentfield': 'permissions',
-			'parenttype': 'DocType',
-			'role': 'System Manager',			
-			'permlevel': 1,
-			'read': 1,
-		},
-		{
-			'parent': 'Custom Script',
-			'parentfield': 'permissions',
-			'parenttype': 'DocType',
-			'role': 'Administrator',			
-			'permlevel': 1,
-			'read': 1,
-			'write': 1
-		},
-	]
-	for perms in new_perms:
-		doc = webnotes.model.doc.Document('DocPerm')
-		doc.fields.update(perms)
-		doc.save()
-	webnotes.conn.commit()
-	webnotes.conn.begin()
-	webnotes.reload_doc('core', 'doctype', 'custom_script')
\ No newline at end of file
diff --git a/patches/may_2012/customize_form_cleanup.py b/patches/may_2012/customize_form_cleanup.py
deleted file mode 100644
index ab86f05..0000000
--- a/patches/may_2012/customize_form_cleanup.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.conn.sql("delete from `tabCustomize Form Field`")
-	webnotes.conn.sql("""delete from `tabSingles`
-		where doctype='Customize Form'""")
\ No newline at end of file
diff --git a/patches/may_2012/page_role_series_fix.py b/patches/may_2012/page_role_series_fix.py
deleted file mode 100644
index c2b18f4..0000000
--- a/patches/may_2012/page_role_series_fix.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	sr = webnotes.conn.sql("select max(name) from `tabPage Role`")
-	if sr and sr[0][0].startswith('PR'):
-		webnotes.conn.sql("update tabSeries set current = %s where name = 'PR'", int(sr[0][0][2:]))	
diff --git a/patches/may_2012/profile_perm_patch.py b/patches/may_2012/profile_perm_patch.py
deleted file mode 100644
index 26fc1ab..0000000
--- a/patches/may_2012/profile_perm_patch.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	"""Make profile readonly for role All"""
-	import webnotes.model.doc
-	webnotes.conn.sql("delete from `tabDocPerm` where parent='Profile' and role='All'")
-	new_perms = [
-		{
-			'parent': 'Profile',
-			'parentfield': 'permissions',
-			'parenttype': 'DocType',
-			'role': 'All',			
-			'permlevel': 0,
-			'read': 1,
-		},
-	]
-	for perms in new_perms:
-		doc = webnotes.model.doc.Document('DocPerm')
-		doc.fields.update(perms)
-		doc.save()
-	webnotes.conn.commit()
-	webnotes.conn.begin()
-	webnotes.reload_doc('core', 'doctype', 'profile')
\ No newline at end of file
diff --git a/patches/may_2012/reload_sales_invoice_pf.py b/patches/may_2012/reload_sales_invoice_pf.py
deleted file mode 100644
index 72a8e41..0000000
--- a/patches/may_2012/reload_sales_invoice_pf.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	import webnotes.modules
-	res = webnotes.conn.sql("""\
-		select module, name, standard from `tabPrint Format`
-		where name like 'Sales Invoice%'""", as_dict=1)
-	for r in res:
-		if r.get('standard')=='Yes' and \
-				r.get('name') in [
-					'Sales Invoice Classic',
-					'Sales Invoice Spartan',
-					'Sales Invoice Modern'
-				]:
-			webnotes.modules.reload_doc(r.get('module'), 'Print Format', r.get('name'))		
-			
\ No newline at end of file
diff --git a/patches/may_2012/remove_communication_log.py b/patches/may_2012/remove_communication_log.py
deleted file mode 100644
index 0c06f8d..0000000
--- a/patches/may_2012/remove_communication_log.py
+++ /dev/null
@@ -1,110 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.reload_doc('support', 'doctype', 'communication')
-	webnotes.conn.commit()
-	webnotes.conn.begin()
-	
-	# change doctype property setter and custom fields, and save them
-	move_customizations()
-	
-	try:
-		remove_communication_log()
-	except Exception, e:
-		if e.args[0] != 1146:
-			raise e
-
-def move_customizations():
-	import webnotes.model.doc
-	import webnotes.model.doctype
-
-	res = webnotes.conn.sql("""\
-		delete from `tabProperty Setter`
-		where property='previous_field'
-		and doc_type = 'Communication Log'""")
-	
-	res = webnotes.conn.sql("""\
-		select name from `tabCustom Field`
-		where dt='Communication Log'""")
-	for r in res:
-		d = webnotes.model.doc.Document('Custom Field', r[0])
-		d.dt = 'Communication'
-		d.save()
-	from webnotes.model.db_schema import updatedb
-	updatedb('Communication')
-
-	res = webnotes.conn.sql("""\
-		select field_name from `tabProperty Setter`
-		where doc_type='Communication Log' and field_name is not null""")
-	
-	doclist = webnotes.model.doctype.get('Communication', 0)
-	field_list = [d.fieldname for d in doclist if d.doctype=='DocField']
-	for r in res:
-		if r[0] in field_list:
-			webnotes.conn.sql("""\
-				update `tabProperty Setter`
-				set doc_type = 'Communication'
-				where field_name=%s and doc_type='Communication Log'""", r[0])
-				
-	webnotes.conn.sql("""\
-		delete from `tabProperty Setter`
-		where doc_type='Communication Log'""")
-
-	webnotes.clear_cache(doctype="Communication")
-
-def remove_communication_log():
-	import webnotes
-	import webnotes.model
-	import webnotes.model.doc
-	import webnotes.model.doctype
-	
-	webnotes.conn.auto_commit_on_many_writes = True
-	
-	# get all communication log records
-	comm_log_list = webnotes.conn.sql("select * from `tabCommunication Log`",
-						as_dict=1)
-	
-	field_list = [d.fieldname for d in \
-		webnotes.model.doctype.get('Communication', 0) \
-		if d.doctype=='DocField']
-	
-	# copy it to communication
-	for comm_log in comm_log_list:
-		d = webnotes.model.doc.Document('Communication')
-		
-		for key in comm_log.keys():
-			if key not in webnotes.model.default_fields:
-				d.fields[key] = comm_log[key]
-		
-		parenttype = (comm_log.get('parenttype') or '').lower()
-		if parenttype in field_list:
-			d.fields[parenttype] = comm_log.get('parent')
-		
-		d.naming_series = 'COMM-'
-		d.subject = 'Follow Up'
-		d.content = comm_log.get('notes') or ''
-		d.medium = comm_log.get('follow_up_type') or ''
-		d.sales_person = comm_log.get('follow_up_by')
-		d.communication_date = comm_log.get('date')
-		d.category = 'Miscellaneous'
-		d.action = 'No Action'
-		d.save(ignore_fields=1)
-	
-	# delete records with parent type "Customer", "Lead", "Supplier"
-	webnotes.conn.sql("""\
-		delete from `tabCommunication Log`
-		where parenttype in ('Customer', 'Lead', 'Supplier', 
-			'Opportunity', 'Quotation')""")
-	
-	# if all records deleted, drop table communication log
-	# and delete doctype communication log
-	# if for some reason, records remain, dont drop table and dont delete doctype
-	count = webnotes.conn.sql("select count(*) from `tabCommunication Log`")[0][0]
-	if not count:
-		webnotes.model.delete_doc('DocType', 'Communication Log')
-		webnotes.conn.commit()
-		webnotes.conn.sql("drop table `tabCommunication Log`")
-		webnotes.conn.begin()
\ No newline at end of file
diff --git a/patches/may_2012/remove_euro_currency.py b/patches/may_2012/remove_euro_currency.py
deleted file mode 100644
index 02e439b..0000000
--- a/patches/may_2012/remove_euro_currency.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	"""
-		* Replace EURO with EUR
-		* Delete EURO from tabCurrency
-	"""
-	import webnotes
-	tables = webnotes.conn.sql("show tables")
-	for (tab,) in tables:
-		desc = webnotes.conn.sql("desc `%s`" % tab, as_dict=1)
-		for d in desc:
-			if "currency" in d.get('Field'):
-				field = d.get('Field')
-				webnotes.conn.sql("""\
-					update `%s` set `%s`='EUR'
-					where `%s`='EURO'""" % (tab, field, field))
-	webnotes.conn.sql("update `tabSingles` set value='EUR' where value='EURO'")
-	webnotes.conn.sql("delete from `tabCurrency` where name='EURO'")
\ No newline at end of file
diff --git a/patches/may_2012/rename_prev_doctype.py b/patches/may_2012/rename_prev_doctype.py
deleted file mode 100644
index 81a2578..0000000
--- a/patches/may_2012/rename_prev_doctype.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	dt_list = webnotes.conn.sql("select parent, fieldname from `tabDocField` where fieldname in ('against_doctype', 'prevdoc_doctype')")
-	
-	ren_dt = {
-		'Indent' : 'Material Request',
-		'Enquiry' : 'Opportunity',
-		'Receivable Voucher' : 'Sales Invoice',
-		'Payable Voucher' : 'Purchase Invoice'
-	}
-
-	for d in ren_dt:
-		for dt in dt_list: 
-			webnotes.conn.sql("update `tab%s` set %s = '%s' where %s = '%s'" % (dt[0], dt[1], ren_dt[d], dt[1], d))
diff --git a/patches/may_2012/same_purchase_rate_patch.py b/patches/may_2012/same_purchase_rate_patch.py
deleted file mode 100644
index edb135f..0000000
--- a/patches/may_2012/same_purchase_rate_patch.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	from webnotes.model.code import get_obj
-	gd = get_obj('Global Defaults')
-	gd.doc.maintain_same_rate = 1
-	gd.doc.save()
-	gd.on_update()
-	
\ No newline at end of file
diff --git a/patches/may_2012/std_pf_readonly.py b/patches/may_2012/std_pf_readonly.py
deleted file mode 100644
index f2e7261..0000000
--- a/patches/may_2012/std_pf_readonly.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	"""Make standard print formats readonly for system manager"""
-	import webnotes.model.doc
-	new_perms = [
-		{
-			'parent': 'Print Format',
-			'parentfield': 'permissions',
-			'parenttype': 'DocType',
-			'role': 'System Manager',			
-			'permlevel': 1,
-			'read': 1,
-		},
-		{
-			'parent': 'Print Format',
-			'parentfield': 'permissions',
-			'parenttype': 'DocType',
-			'role': 'Administrator',			
-			'permlevel': 1,
-			'read': 1,
-			'write': 1
-		},
-	]
-	for perms in new_perms:
-		doc = webnotes.model.doc.Document('DocPerm')
-		doc.fields.update(perms)
-		doc.save()
-	webnotes.conn.commit()
-	webnotes.conn.begin()
-	webnotes.reload_doc('core', 'doctype', 'print_format')
\ No newline at end of file
diff --git a/patches/may_2012/stock_reco_patch.py b/patches/may_2012/stock_reco_patch.py
deleted file mode 100644
index a3c702f..0000000
--- a/patches/may_2012/stock_reco_patch.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-def execute():
-	import webnotes
-	from webnotes.modules import reload_doc
-	reload_doc('stock', 'doctype', 'stock_reconciliation')
-
-	sr = webnotes.conn.sql("select name, file_list from `tabStock Reconciliation` where docstatus = 1")
-	for d in sr:
-		if d[1]:
-			filename = d[1].split(',')[1]
-		
-			from webnotes.utils import file_manager
-			fn, content = file_manager.get_file(filename)
-		
-			if not isinstance(content, basestring) and hasattr(content, 'tostring'):
-				content = content.tostring()
-
-			webnotes.conn.sql("update `tabStock Reconciliation` set diff_info = %s where name = %s and ifnull(diff_info, '') = ''", (content, d[0]))
diff --git a/patches/patch_list.py b/patches/patch_list.py
index 52b3495..5f0b9cf 100644
--- a/patches/patch_list.py
+++ b/patches/patch_list.py
@@ -10,60 +10,6 @@
 	"execute:webnotes.reload_doc('core', 'doctype', 'docperm') #2013-07-16",
 	"execute:webnotes.reload_doc('core', 'doctype', 'page') #2013-07-16",
 	"execute:webnotes.reload_doc('core', 'doctype', 'report') #2013-07-16",
-	"patches.mar_2012.clean_property_setter", 
-	"patches.april_2012.naming_series_patch", 
-	"patches.mar_2012.cleanup_control_panel", 
-	"patches.mar_2012.doctype_get_refactor", 
-	"patches.mar_2012.delete_docformat", 
-	"patches.mar_2012.usertags", 
-	"patches.april_2012.reload_c_form", 
-	"patches.april_2012.after_sync_cleanup", 
-	"patches.april_2012.remove_default_from_rv_detail", 
-	"patches.april_2012.update_role_in_address", 
-	"patches.april_2012.update_permlevel_in_address", 
-	"patches.april_2012.update_appraisal_permission", 
-	"patches.april_2012.repost_stock_for_posting_time", 
-	"patches.may_2012.cleanup_property_setter", 
-	"patches.may_2012.rename_prev_doctype", 
-	"patches.may_2012.cleanup_notification_control", 
-	"patches.may_2012.stock_reco_patch", 
-	"patches.may_2012.page_role_series_fix", 
-	"patches.may_2012.reload_sales_invoice_pf", 
-	"patches.may_2012.std_pf_readonly", 
-	"patches.may_2012.customize_form_cleanup", 
-	"patches.may_2012.cs_server_readonly", 
-	"patches.may_2012.clear_session_cache", 
-	"patches.may_2012.same_purchase_rate_patch", 
-	"patches.may_2012.create_report_manager_role", 
-	"patches.may_2012.profile_perm_patch", 
-	"patches.may_2012.remove_euro_currency", 
-	"patches.may_2012.remove_communication_log", 
-	"patches.june_2012.barcode_in_feature_setup", 
-	"patches.june_2012.copy_uom_for_pur_inv_item", 
-	"patches.june_2012.fetch_organization_from_lead", 
-	"patches.june_2012.reports_list_permission", 
-	"patches.june_2012.support_ticket_autoreply", 
-	"patches.june_2012.series_unique_patch", 
-	"patches.june_2012.set_recurring_type", 
-	"patches.june_2012.alter_tabsessions", 
-	"patches.june_2012.delete_old_parent_entries", 
-	"patches.april_2012.delete_about_contact", 
-	"patches.july_2012.reload_pr_po_mapper", 
-	"patches.july_2012.address_contact_perms", 
-	"patches.july_2012.packing_list_cleanup_and_serial_no", 
-	"patches.july_2012.deprecate_import_data_control", 
-	"patches.july_2012.default_freeze_account", 
-	"patches.july_2012.update_purchase_tax", 
-	"patches.june_2012.cms2", 
-	"patches.july_2012.auth_table", 
-	"patches.july_2012.remove_event_role_owner_match", 
-	"patches.july_2012.deprecate_bulk_rename", 
-	"patches.july_2012.bin_permission", 
-	"patches.july_2012.project_patch_repeat", 
-	"patches.july_2012.repost_stock_due_to_wrong_packing_list", 
-	"patches.august_2012.task_allocated_to_assigned", 
-	"patches.august_2012.change_profile_permission", 
-	"patches.august_2012.repost_billed_amt", 
 	"patches.september_2012.stock_report_permissions_for_accounts", 
 	"patches.september_2012.communication_delete_permission", 
 	"patches.september_2012.all_permissions_patch", 
@@ -121,7 +67,6 @@
 	"patches.january_2013.update_country_info",
 	"patches.january_2013.remove_tds_entry_from_gl_mapper",
 	"patches.january_2013.update_number_format",
-	"patches.january_2013.purchase_price_list",
 	"execute:webnotes.reload_doc('core', 'doctype', 'print_format') #2013-01",
 	"execute:webnotes.reload_doc('accounts','Print Format','Payment Receipt Voucher')",
 	"patches.january_2013.update_fraction_for_usd",
@@ -258,14 +203,18 @@
 	"execute:webnotes.delete_doc('DocType', 'Stock Ledger')",
 	"patches.august_2013.p06_deprecate_is_cancelled",
 	"patches.august_2013.p06_fix_sle_against_stock_entry",
-	"execute:webnotes.bean('Style Settings').save() #2013-08-20",
 	"patches.september_2013.p01_add_user_defaults_from_pos_setting",
 	"execute:webnotes.reload_doc('accounts', 'Print Format', 'POS Invoice') # 2013-09-02",
 	"patches.september_2013.p01_fix_buying_amount_gl_entries",
 	"patches.september_2013.p01_update_communication",
 	"execute:webnotes.reload_doc('setup', 'doctype', 'features_setup') # 2013-09-05",
 	"patches.september_2013.p02_fix_serial_no_status",
+	"patches.september_2013.p03_modify_item_price_include_in_price_list",
 	"patches.august_2013.p06_deprecate_is_cancelled",
 	"execute:webnotes.delete_doc('DocType', 'Budget Control')",
 	"patches.september_2013.p03_update_stock_uom_in_sle",
+	"patches.september_2013.p03_move_website_to_framework",
+	"execute:webnotes.bean('Style Settings').save() #2013-09-19",
+	"execute:webnotes.reload_doc('accounts', 'doctype', 'accounts_settings') # 2013-09-24"
+	"execute:webnotes.conn.set_value('Accounts Settings', None, 'frozen_accounts_modifier', 'Accounts Manager') # 2013-09-24",
 ]
\ No newline at end of file
diff --git a/patches/september_2013/p02_fix_serial_no_status.py b/patches/september_2013/p02_fix_serial_no_status.py
index 714cd7a..58c2957 100644
--- a/patches/september_2013/p02_fix_serial_no_status.py
+++ b/patches/september_2013/p02_fix_serial_no_status.py
@@ -17,7 +17,7 @@
 		serial_nos = d.serial_no.split("\n")
 		for sr in serial_nos:
 			serial_no = sr.strip()
-			if serial_no:
+			if serial_no and webnotes.conn.exists("Serial No", serial_no):
 				serial_bean = webnotes.bean("Serial No", serial_no)
 				if serial_bean.doc.status == "Not Available":
 					latest_sle = webnotes.conn.sql("""select voucher_no from `tabStock Ledger Entry`
diff --git a/patches/september_2013/p03_modify_item_price_include_in_price_list.py b/patches/september_2013/p03_modify_item_price_include_in_price_list.py
new file mode 100644
index 0000000..8ca6d76
--- /dev/null
+++ b/patches/september_2013/p03_modify_item_price_include_in_price_list.py
@@ -0,0 +1,20 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+def execute():
+	webnotes.reload_doc("setup", "doctype", "price_list")
+	webnotes.reload_doc("setup", "doctype", "item_price")
+	webnotes.reload_doc("stock", "doctype", "item")
+	
+	webnotes.conn.sql("""update `tabItem Price` set parenttype='Price List', 
+		parentfield='item_prices', `item_code`=`parent`""")
+	
+	# re-arranging idx of items
+	webnotes.conn.sql("""update `tabItem Price` set `parent`=`price_list`, idx=0""")
+	for pl in webnotes.conn.sql("""select name from `tabPrice List`"""):
+		webnotes.conn.sql("""set @name=0""")
+		webnotes.conn.sql("""update `tabItem Price` set idx = @name := IF(ISNULL( @name ), 0, @name + 1) 
+			where idx=0 and parent=%s""", pl[0])
\ No newline at end of file
diff --git a/patches/september_2013/p03_move_website_to_framework.py b/patches/september_2013/p03_move_website_to_framework.py
new file mode 100644
index 0000000..9c15bcc
--- /dev/null
+++ b/patches/september_2013/p03_move_website_to_framework.py
@@ -0,0 +1,17 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+from webnotes.utils import get_base_path
+import os, shutil
+
+def execute():
+	# remove pyc files
+	utils_pyc = os.path.join(get_base_path(), "app", "selling", "utils.pyc")
+	if os.path.exists(utils_pyc):
+		os.remove(utils_pyc)
+	
+	old_path = os.path.join(get_base_path(), "app", "website")
+	if os.path.exists(old_path):
+		shutil.rmtree(old_path)
\ No newline at end of file
diff --git a/website/doctype/blogger/__init__.py b/portal/__init__.py
similarity index 100%
rename from website/doctype/blogger/__init__.py
rename to portal/__init__.py
diff --git a/website/helpers/__init__.py b/portal/templates/__init__.py
similarity index 100%
rename from website/helpers/__init__.py
rename to portal/templates/__init__.py
diff --git a/portal/templates/base.html b/portal/templates/base.html
new file mode 100644
index 0000000..bc6fb97
--- /dev/null
+++ b/portal/templates/base.html
@@ -0,0 +1,3 @@
+{% extends "lib/website/templates/base.html" %}
+
+{% block footer %}{% include "app/portal/templates/includes/footer.html" %}{% endblock %}
\ No newline at end of file
diff --git a/website/templates/js/cart.js b/portal/templates/includes/cart.js
similarity index 82%
rename from website/templates/js/cart.js
rename to portal/templates/includes/cart.js
index 20090ca..5ff6e3f 100644
--- a/website/templates/js/cart.js
+++ b/portal/templates/includes/cart.js
@@ -4,33 +4,33 @@
 // js inside blog page
 
 $(document).ready(function() {
-	wn.cart.bind_events();
+	erpnext.cart.bind_events();
 	return wn.call({
 		type: "POST",
-		method: "website.helpers.cart.get_cart_quotation",
+		method: "selling.utils.cart.get_cart_quotation",
 		callback: function(r) {
 			console.log(r);
 			$("#cart-container").removeClass("hide");
 			$(".progress").remove();
 			if(r.exc) {
 				if(r.exc.indexOf("WebsitePriceListMissingError")!==-1) {
-					wn.cart.show_error("Oops!", "Price List not configured.");
+					erpnext.cart.show_error("Oops!", "Price List not configured.");
 				} else if(r["403"]) {
-					wn.cart.show_error("Hey!", "You need to be logged in to view your cart.");
+					erpnext.cart.show_error("Hey!", "You need to be logged in to view your cart.");
 				} else {
-					wn.cart.show_error("Oops!", "Something went wrong.");
+					erpnext.cart.show_error("Oops!", "Something went wrong.");
 				}
 			} else {
-				wn.cart.set_cart_count();
-				wn.cart.render(r.message);
+				erpnext.cart.set_cart_count();
+				erpnext.cart.render(r.message);
 			}
 		}
 	});
 });
 
 // shopping cart
-if(!wn.cart) wn.cart = {};
-$.extend(wn.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>');
 	},
@@ -39,14 +39,14 @@
 		// bind update button
 		$(document).on("click", ".item-update-cart button", function() {
 			var item_code = $(this).attr("data-item-code");
-			wn.cart.update_cart({
+			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) {
-						wn.cart.render(r.message);
+						erpnext.cart.render(r.message);
 						var $button = $('button[data-item-code="'+item_code+'"]').addClass("btn-success");
 						setTimeout(function() { $button.removeClass("btn-success"); }, 1000);
 					}
@@ -63,7 +63,7 @@
 		});
 		
 		$(".btn-place-order").on("click", function() {
-			wn.cart.place_order();
+			erpnext.cart.place_order(this);
 		});
 	},
 	
@@ -79,7 +79,7 @@
 		
 		var no_items = $.map(doclist, function(d) { return d.item_code || null;}).length===0;
 		if(no_items) {
-			wn.cart.show_error("Empty :-(", "Go ahead and add something to your cart.");
+			erpnext.cart.show_error("Empty :-(", "Go ahead and add something to your cart.");
 			$("#cart-addresses").toggle(false);
 			return;
 		}
@@ -89,14 +89,14 @@
 		var shipping_rule_labels = $.map(out.shipping_rules || [], function(rule) { return rule[1]; });
 		$.each(doclist, function(i, doc) {
 			if(doc.doctype === "Quotation Item") {
-				wn.cart.render_item_row($cart_items, doc);
+				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;
-						wn.cart.render_tax_row($cart_taxes, doc, out.shipping_rules);
+						erpnext.cart.render_tax_row($cart_taxes, doc, out.shipping_rules);
 				} else {
-					wn.cart.render_tax_row($cart_taxes, doc);
+					erpnext.cart.render_tax_row($cart_taxes, doc);
 				}
 				
 				taxes_exist = true;
@@ -104,7 +104,7 @@
 		});
 		
 		if(out.shipping_rules && out.shipping_rules.length && !shipping_rule_added) {
-			wn.cart.render_tax_row($cart_taxes, {description: "", formatted_tax_amount: ""},
+			erpnext.cart.render_tax_row($cart_taxes, {description: "", formatted_tax_amount: ""},
 				out.shipping_rules);
 			taxes_exist = true;
 		}
@@ -112,7 +112,7 @@
 		if(taxes_exist)
 			$('<hr>').appendTo($cart_taxes);
 			
-		wn.cart.render_tax_row($cart_totals, {
+		erpnext.cart.render_tax_row($cart_totals, {
 			description: "<strong>Total</strong>", 
 			formatted_tax_amount: "<strong>" + doclist[0].formatted_grand_total_export + "</strong>"
 		});
@@ -120,15 +120,15 @@
 		if(!(addresses && addresses.length)) {
 			$cart_shipping_address.html('<div class="well">Hey! Go ahead and add an address</div>');
 		} else {
-			wn.cart.render_address($cart_shipping_address, addresses, doclist[0].shipping_address_name);
-			wn.cart.render_address($cart_billing_address, addresses, doclist[0].customer_address);
+			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.image ?
 			'<div style="height: 120px; overflow: hidden;"><img src="' + doc.image + '" /></div>' :
-			'{% include "app/website/templates/html/product_missing_image.html" %}';
+			'{% include "app/stock/doctype/item/templates/includes/product_missing_image.html" %}';
 			
 		if(doc.description === doc.item_name) doc.description = "";
 		
@@ -185,7 +185,7 @@
 				}
 			});
 			$tax_row.find('select').on("change", function() {
-				wn.cart.apply_shipping_rule($(this).val(), this);
+				erpnext.cart.apply_shipping_rule($(this).val(), this);
 			});
 		}
 	},
@@ -194,11 +194,11 @@
 		return wn.call({
 			btn: btn,
 			type: "POST",
-			method: "website.helpers.cart.apply_shipping_rule",
+			method: "selling.utils.cart.apply_shipping_rule",
 			args: { shipping_rule: rule },
 			callback: function(r) {
 				if(!r.exc) {
-					wn.cart.render(r.message);
+					erpnext.cart.render(r.message);
 				}
 			}
 		});
@@ -242,14 +242,14 @@
 				
 				return wn.call({
 					type: "POST",
-					method: "website.helpers.cart.update_cart_address",
+					method: "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) {
-							wn.cart.render(r.message);
+							erpnext.cart.render(r.message);
 						}
 					}
 				});
@@ -270,10 +270,11 @@
 			.collapse("show");
 	},
 	
-	place_order: function() {
+	place_order: function(btn) {
 		return wn.call({
 			type: "POST",
-			method: "website.helpers.cart.place_order",
+			method: "selling.utils.cart.place_order",
+			btn: btn,
 			callback: function(r) {
 				if(r.exc) {
 					var msg = "";
diff --git a/portal/templates/includes/footer.html b/portal/templates/includes/footer.html
new file mode 100644
index 0000000..6963175
--- /dev/null
+++ b/portal/templates/includes/footer.html
@@ -0,0 +1,40 @@
+{% extends "lib/website/templates/includes/footer.html" %}
+
+{% block powered %}<a style="font-size: 90%; color: #aaa;" href="http://erpnext.org">ERPNext Powered</a>{% endblock %}
+
+{% block extension %}
+<br>
+<div class="input-group col-md-6 col-md-offset-3">
+	<input class="form-control" type="text" id="footer-subscribe-email" placeholder="Your email address...">
+	<span class="input-group-btn">
+		<button class="btn btn-default" type="button" id="footer-subscribe-button">Stay Updated</button>
+	</span>
+</div>
+<br>
+<script>
+	$("#footer-subscribe-button").click(function() {
+
+		$("#footer-subscribe-email").attr('disabled', true);
+		$("#footer-subscribe-button").html("Sending...")
+			.attr("disabled", true);
+
+		if($("#footer-subscribe-email").val()) {
+			erpnext.send_message({
+				subject:"Subscribe me",
+				sender: $("#footer-subscribe-email").val(),
+				message: "Subscribe to newsletter (via website footer).",
+				callback: function(r) {
+					if(!r.exc) {
+						$("#footer-subscribe-button").html("Thank You :)")
+							.addClass("btn-success").attr("disabled", true);
+					} else {
+						$("#footer-subscribe-button").html("Error :( Not a valid id?")
+							.addClass("btn-danger").attr("disabled", false);
+						$("#footer-subscribe-email").val("").attr('disabled', false);
+					}
+				}
+			});
+		}
+	});
+</script>
+{% endblock %}
diff --git a/website/templates/html/transactions.html b/portal/templates/includes/transactions.html
similarity index 87%
rename from website/templates/html/transactions.html
rename to portal/templates/includes/transactions.html
index 1e61124..036a77c 100644
--- a/website/templates/html/transactions.html
+++ b/portal/templates/includes/transactions.html
@@ -1,12 +1,13 @@
-{% extends "app/website/templates/html/page.html" %}
+{% extends base_template %}
 
 {% block content -%}
 <div class="col-md-12">
     <ul class="breadcrumb">
     	<li><a href="index">Home</a></li>
-    	<li><a href="account">My Account</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>
@@ -19,6 +20,7 @@
 {%- endblock %}
 
 {% block javascript -%}
+<script>
 $(document).ready(function() {
 	window.start = 0;
 	window.$list = $(".transaction-list");
@@ -35,7 +37,6 @@
 		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()) {
@@ -53,7 +54,7 @@
 		}
 	})
 };
+</script>
 
-// var render = function(doc) { };
-
+<!-- // var render = function(doc) { }; -->
 {% endblock %}
\ No newline at end of file
diff --git a/website/helpers/__init__.py b/portal/templates/pages/__init__.py
similarity index 100%
copy from website/helpers/__init__.py
copy to portal/templates/pages/__init__.py
diff --git a/website/templates/pages/cart.html b/portal/templates/pages/cart.html
similarity index 83%
rename from website/templates/pages/cart.html
rename to portal/templates/pages/cart.html
index 6708ad3..8b648e5 100644
--- a/website/templates/pages/cart.html
+++ b/portal/templates/pages/cart.html
@@ -1,7 +1,7 @@
-{% extends "app/website/templates/html/page.html" %}
+{% extends base_template %}
 
 {% block javascript %}
-	{% include "app/website/templates/js/cart.js" %}
+<script>{% include "app/portal/templates/includes/cart.js" %}</script>
 {% endblock %}
 
 {% set title="Shopping Cart" %}
@@ -13,7 +13,7 @@
 		<div class="progress-bar progress-bar-info" style="width: 100%;"></div>
 	</div>
 	<div id="cart-container" class="hide">
-		<button class="btn btn-success pull-right btn-place-order" type="button">Place Order</button>
+		<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>
@@ -51,7 +51,7 @@
 			</div>
 			<hr>
 		</div>
-		<button class="btn btn-success pull-right btn-place-order" type="button">Place Order</button>
+		<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/patches/may_2012/clear_session_cache.py b/portal/templates/pages/cart.py
similarity index 65%
rename from patches/may_2012/clear_session_cache.py
rename to portal/templates/pages/cart.py
index 3e63c3b..24b474a 100644
--- a/patches/may_2012/clear_session_cache.py
+++ b/portal/templates/pages/cart.py
@@ -2,6 +2,5 @@
 # License: GNU General Public License v3. See license.txt
 
 from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.conn.sql("delete from __SessionCache")
\ No newline at end of file
+
+no_cache = True
\ No newline at end of file
diff --git a/website/templates/pages/profile.html b/portal/templates/pages/profile.html
similarity index 79%
rename from website/templates/pages/profile.html
rename to portal/templates/pages/profile.html
index 4c03b40..fe9ded5 100644
--- a/website/templates/pages/profile.html
+++ b/portal/templates/pages/profile.html
@@ -1,4 +1,4 @@
-{% extends "app/website/templates/html/page.html" %}
+{% extends base_template %}
 
 {% set title="My Profile" %}
 
@@ -6,20 +6,15 @@
 <div class="col-md-12">
     <ul class="breadcrumb">
     	<li><a href="index">Home</a></li>
-    	<li><a href="account">My Account</a></li>
     	<li class="active"><i class="icon-user icon-fixed-width"></i> My Profile</li>
     </ul>
-	<div class="alert" id="message" style="display: none;"></div>
+	<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>Password</label>
-			<input class="form-control" type="password" id="password" placeholder="Password">
-		</fieldset>
-		<fieldset>
 			<label>Company Name</label>
 			<input class="form-control" type="text" id="company_name" placeholder="Company Name" value="{{ company_name }}">
 		</fieldset>
@@ -39,11 +34,10 @@
 	$("#fullname").val(getCookie("full_name") || "");
 	$("#update_profile").click(function() {
 		wn.call({
-			method: "startup.webutils.update_profile",
+			method: "portal.templates.pages.profile.update_profile",
 			type: "POST",
 			args: {
 				fullname: $("#fullname").val(),
-				password: $("#password").val(),
 				company_name: $("#company_name").val(),
 				mobile_no: $("#mobile_no").val(),
 				phone: $("#phone").val()
diff --git a/portal/templates/pages/profile.py b/portal/templates/pages/profile.py
new file mode 100644
index 0000000..8edd830
--- /dev/null
+++ b/portal/templates/pages/profile.py
@@ -0,0 +1,39 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# 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
+
+def get_context():
+	from 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 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.add_cookies["full_name"] = fullname
+	
+	return _("Updated")
+	
\ No newline at end of file
diff --git a/website/templates/pages/sale.html b/portal/templates/sale.html
similarity index 92%
rename from website/templates/pages/sale.html
rename to portal/templates/sale.html
index 1c03da2..2a7c603 100644
--- a/website/templates/pages/sale.html
+++ b/portal/templates/sale.html
@@ -1,4 +1,4 @@
-{% extends "app/website/templates/html/page.html" %}
+{% extends base_template %}
 
 {% set title=doc.name %}
 
@@ -6,7 +6,6 @@
 <div class="col-md-12">
     <ul class="breadcrumb">
     	<li><a href="index">Home</a></li>
-    	<li><a href="account">My Account</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>
@@ -18,7 +17,7 @@
 	<div>
 	<div class="row">
 		<div class="col-xs-6">
-			{% if doc.status -%}<div class="label label-default">{{ doc.status }}</div>{%- endif %}
+			{% block status -%}{%- endblock %}
 		</div>
 		<div class="col-xs-6">
 			<span class="pull-right">{{ utils.formatdate(doc.posting_date or doc.transaction_date) }}</span>
diff --git a/portal/templates/sales_transactions.html b/portal/templates/sales_transactions.html
new file mode 100644
index 0000000..f4fd5d1
--- /dev/null
+++ b/portal/templates/sales_transactions.html
@@ -0,0 +1,32 @@
+{% extends "app/portal/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/portal/utils.py b/portal/utils.py
new file mode 100644
index 0000000..f72c01f
--- /dev/null
+++ b/portal/utils.py
@@ -0,0 +1,72 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+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"):
+	from website.doctype.contact_us_settings.templates.pages.contact \
+		import send_message as website_send_message
+	
+	if not website_send_message(subject, message, sender):
+		return
+	
+	# make lead / communication
+	from selling.doctype.lead.get_leads import add_sales_communication
+	add_sales_communication(subject or "Website Query", message, sender, sender, 
+		mail=None, status=status)
+	
\ No newline at end of file
diff --git a/projects/page/projects_home/projects_home.js b/projects/page/projects_home/projects_home.js
index f958f74..179ac0d 100644
--- a/projects/page/projects_home/projects_home.js
+++ b/projects/page/projects_home/projects_home.js
@@ -40,7 +40,7 @@
 		icon: "icon-wrench",
 		items: [
 			{
-				page: "Projects",
+				route: "Gantt/Task",
 				label: wn._("Gantt Chart"),
 				"description":wn._("Gantt chart of all tasks.")
 			},
diff --git a/public/build.json b/public/build.json
index b8d7dd4..77ad4dd 100644
--- a/public/build.json
+++ b/public/build.json
@@ -1,7 +1,6 @@
 {
 	"public/css/all-web.css": [
 		"app/public/js/startup.css",
-		"app/website/css/website.css"	
 	],
 	"public/css/all-app.css": [
 		"app/public/js/startup.css"
diff --git a/public/js/transaction.js b/public/js/transaction.js
index 0ff957a..3871404 100644
--- a/public/js/transaction.js
+++ b/public/js/transaction.js
@@ -149,6 +149,7 @@
 	},
 	
 	price_list_currency: function() {
+		var me=this;
 		this.set_dynamic_labels();
 		
 		var company_currency = this.get_company_currency();
@@ -156,7 +157,7 @@
 			this.get_exchange_rate(this.frm.doc.price_list_currency, company_currency, 
 				function(exchange_rate) {
 					if(exchange_rate) {
-						me.frm.set_value("price_list_currency", exchange_rate);
+						me.frm.set_value("plc_conversion_rate", exchange_rate);
 						me.plc_conversion_rate();
 					}
 				});
@@ -348,8 +349,6 @@
 			}
 		});
 		
-		console.log(distinct_items);
-		
 		var rows = $.map(distinct_items, function(item) {
 			var item_tax_record = item_tax[item.item_code || item.item_name];
 			if(!item_tax_record) { return null; }
@@ -419,10 +418,10 @@
 			(this.frm.doc.currency != company_currency && this.frm.doc.conversion_rate != 1.0)) :
 			false;
 		
-		if(!valid_conversion_rate) {
-			wn.throw(wn._("Please enter valid") + " " + wn._(conversion_rate_label) + 
-				" 1 " + this.frm.doc.currency + " = [?] " + company_currency);
-		}
+		// if(!valid_conversion_rate) {
+		// 	wn.throw(wn._("Please enter valid") + " " + wn._(conversion_rate_label) + 
+		// 		" 1 " + this.frm.doc.currency + " = [?] " + company_currency);
+		// }
 	},
 	
 	calculate_taxes_and_totals: function() {
diff --git a/public/js/website_utils.js b/public/js/website_utils.js
index 9b78326..06bbe59 100644
--- a/public/js/website_utils.js
+++ b/public/js/website_utils.js
@@ -2,200 +2,40 @@
 // License: GNU General Public License v3. See license.txt
 
 if(!window.erpnext) erpnext = {};
-if(!window.wn) wn = {};
 
 // Add / update a new Lead / Communication
 // subject, sender, description
-erpnext.send_message = function(opts) {
+wn.send_message = function(opts, btn) {
 	return wn.call({
 		type: "POST",
-		method: "website.helpers.contact.send_message",
+		method: "portal.utils.send_message",
+		btn: btn,
 		args: opts,
 		callback: opts.callback
 	});
-}
+};
 
-wn.call = function(opts) {
-	if(opts.btn) {
-		$(opts.btn).prop("disabled", true);
-	}
-	
-	if(opts.msg) {
-		$(opts.msg).toggle(false);
-	}
-	
-	if(!opts.args) opts.args = {};
-	
-	// get or post?
-	if(!opts.args._type) {
-		opts.args._type = opts.type || "GET";
-	}
-
-	// method
-	if(opts.method) {
-		opts.args.cmd = opts.method;
-	}
-
-	// stringify
-	$.each(opts.args, function(key, val) {
-		if(typeof val != "string") {
-			opts.args[key] = JSON.stringify(val);
-		}
-	});
-	
-	$.ajax({
-		type: "POST",
-		url: "server.py",
-		data: opts.args,
-		dataType: "json",
-		success: function(data) {
-			if(opts.btn) {
-				$(opts.btn).prop("disabled", false);
-			}
-			if(data.exc) {
-				if(opts.btn) {
-					$(opts.btn).addClass("btn-danger");
-					setTimeout(function() { $(opts.btn).removeClass("btn-danger"); }, 1000);
-				}
-				try {
-					var err = JSON.parse(data.exc);
-					if($.isArray(err)) {
-						err = err.join("\n");
-					}
-					console.error ? console.error(err) : console.log(err);
-				} catch(e) {
-					console.log(data.exc);
-				}
-			} else{
-				if(opts.btn) {
-					$(opts.btn).addClass("btn-success");
-					setTimeout(function() { $(opts.btn).removeClass("btn-success"); }, 1000);
-				}
-			}
-			if(opts.msg && data.message) {
-				$(opts.msg).html(data.message).toggle(true);
-			}
-			if(opts.callback)
-				opts.callback(data);
-		},
-		error: function(response) {
-			console.error ? console.error(response) : console.log(response);
-		}
-	});
-	
-	return false;
-}
+// for backward compatibility
+erpnext.send_message = wn.send_message;
 
 // Setup the user tools
 //
 $(document).ready(function() {
 	// update login
-	var full_name = getCookie("full_name");
+	erpnext.cart.set_cart_count();
+	
+	// update profile
 	if(full_name) {
-		$("#user-tools").addClass("hide");
-		$("#user-tools-post-login").removeClass("hide");
-		$("#user-full-name").text(full_name);
+		$('.navbar li[data-label="Profile"] a')
+			.html('<i class="icon-fixed-width icon-user"></i> ' + full_name);
 	}
 	
-	wn.cart.set_cart_count();
-	
-	$("#user-tools a").tooltip({"placement":"bottom"});
-	$("#user-tools-post-login a").tooltip({"placement":"bottom"});
 });
 
-// Utility functions
-
-function valid_email(id) { 
-	if(id.toLowerCase().search("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?")==-1) 
-		return 0; else return 1; }
-
-var validate_email = valid_email;
-
-function get_url_arg(name) {
-	name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
-	var regexS = "[\\?&]"+name+"=([^&#]*)";
-	var regex = new RegExp( regexS );
-	var results = regex.exec( window.location.href );
-	if(results == null)
-		return "";
-	else
-		return decodeURIComponent(results[1]);		
-}
-
-function make_query_string(obj) {
-	var query_params = [];
-	$.each(obj, function(k, v) { query_params.push(encodeURIComponent(k) + "=" + encodeURIComponent(v)); });
-	return "?" + query_params.join("&");
-}
-
-function repl(s, dict) {
-	if(s==null)return '';
-	for(key in dict) {
-		s = s.split("%("+key+")s").join(dict[key]);
-	}
-	return s;
-}
-
-function replace_all(s, t1, t2) {
-	return s.split(t1).join(t2);
-}
-
-function getCookie(name) {
-	return getCookies()[name];
-}
-
-function getCookies() {
-	var c = document.cookie, v = 0, cookies = {};
-	if (document.cookie.match(/^\s*\$Version=(?:"1"|1);\s*(.*)/)) {
-		c = RegExp.$1;
-		v = 1;
-	}
-	if (v === 0) {
-		c.split(/[,;]/).map(function(cookie) {
-			var parts = cookie.split(/=/, 2),
-				name = decodeURIComponent(parts[0].trimLeft()),
-				value = parts.length > 1 ? decodeURIComponent(parts[1].trimRight()) : null;
-			if(value && value.charAt(0)==='"') {
-				value = value.substr(1, value.length-2);
-			}
-			cookies[name] = value;
-		});
-	} else {
-		c.match(/(?:^|\s+)([!#$%&'*+\-.0-9A-Z^`a-z|~]+)=([!#$%&'*+\-.0-9A-Z^`a-z|~]*|"(?:[\x20-\x7E\x80\xFF]|\\[\x00-\x7F])*")(?=\s*[,;]|$)/g).map(function($0, $1) {
-			var name = $0,
-				value = $1.charAt(0) === '"'
-						  ? $1.substr(1, -1).replace(/\\(.)/g, "$1")
-						  : $1;
-			cookies[name] = value;
-		});
-	}
-	return cookies;
-}
-
-if (typeof String.prototype.trimLeft !== "function") {
-	String.prototype.trimLeft = function() {
-		return this.replace(/^\s+/, "");
-	};
-}
-if (typeof String.prototype.trimRight !== "function") {
-	String.prototype.trimRight = function() {
-		return this.replace(/\s+$/, "");
-	};
-}
-if (typeof Array.prototype.map !== "function") {
-	Array.prototype.map = function(callback, thisArg) {
-		for (var i=0, n=this.length, a=[]; i<n; i++) {
-			if (i in this) a[i] = callback.call(thisArg, this[i]);
-		}
-		return a;
-	};
-}
-
 // shopping cart
-if(!wn.cart) wn.cart = {};
-var full_name = getCookie("full_name");
+if(!erpnext.cart) erpnext.cart = {};
 
-$.extend(wn.cart, {
+$.extend(erpnext.cart, {
 	update_cart: function(opts) {
 		if(!full_name) {
 			if(localStorage) {
@@ -206,7 +46,7 @@
 		} else {
 			return wn.call({
 				type: "POST",
-				method: "website.helpers.cart.update_cart",
+				method: "selling.utils.cart.update_cart",
 				args: {
 					item_code: opts.item_code,
 					qty: opts.qty,
@@ -217,7 +57,7 @@
 					if(opts.callback)
 						opts.callback(r);
 					
-					wn.cart.set_cart_count();
+					erpnext.cart.set_cart_count();
 				}
 			});
 		}
@@ -225,29 +65,22 @@
 	
 	set_cart_count: function() {
 		var cart_count = getCookie("cart_count");
-		if(cart_count)
-			$(".cart-count").html("( "+ cart_count +" )")
-	}
-});
-
-function remove_script_and_style(txt) {
-	return (!txt || (txt.indexOf("<script>")===-1 && txt.indexOf("<style>")===-1)) ? txt :
-		$("<div></div>").html(txt).find("script,noscript,style,title,meta").remove().end().html();
-}
-
-function is_html(txt) {
-	if(txt.indexOf("<br>")==-1 && txt.indexOf("<p")==-1 
-		&& txt.indexOf("<img")==-1 && txt.indexOf("<div")==-1) {
-		return false;
-	}
-	return true;
-}
-
-function ask_to_login() {
-	if(!full_name) {
-		if(localStorage) {
-			localStorage.setItem("last_visited", window.location.href.split("/").slice(-1)[0]);
+		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();
 		}
-		window.location.href = "login";
 	}
-}
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/selling/doctype/customer/test_customer.py b/selling/doctype/customer/test_customer.py
index 9ed821a..7c90f6a 100644
--- a/selling/doctype/customer/test_customer.py
+++ b/selling/doctype/customer/test_customer.py
@@ -57,6 +57,8 @@
 		# check that old name doesn't exist
 		self.assertEqual(webnotes.conn.exists("Customer", "_Test Customer"), ())
 		self.assertEqual(webnotes.conn.exists("Account", "_Test Customer - _TC"), ())
+
+test_ignore = ["Price List"]
 			
 test_records = [
 	[{
diff --git a/selling/doctype/lead/lead.txt b/selling/doctype/lead/lead.txt
index a429c96..d96880b 100644
--- a/selling/doctype/lead/lead.txt
+++ b/selling/doctype/lead/lead.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-04-10 11:45:37", 
   "docstatus": 0, 
-  "modified": "2013-09-10 10:52:20", 
+  "modified": "2013-09-19 10:38:58", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -158,11 +158,78 @@
   "doctype": "DocField", 
   "fieldname": "communication_history", 
   "fieldtype": "Section Break", 
-  "label": "Communication History", 
+  "label": "Communication", 
   "options": "icon-comments", 
   "print_hide": 1
  }, 
  {
+  "default": "__user", 
+  "doctype": "DocField", 
+  "fieldname": "lead_owner", 
+  "fieldtype": "Link", 
+  "in_filter": 1, 
+  "label": "Lead Owner", 
+  "oldfieldname": "lead_owner", 
+  "oldfieldtype": "Link", 
+  "options": "Profile", 
+  "search_index": 1
+ }, 
+ {
+  "depends_on": "eval:!doc.__islocal", 
+  "description": "Date on which the lead was last contacted", 
+  "doctype": "DocField", 
+  "fieldname": "last_contact_date", 
+  "fieldtype": "Date", 
+  "label": "Last Contact Date", 
+  "no_copy": 1, 
+  "oldfieldname": "last_contact_date", 
+  "oldfieldtype": "Date", 
+  "print_hide": 1, 
+  "read_only": 1
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "col_break123", 
+  "fieldtype": "Column Break", 
+  "width": "50%"
+ }, 
+ {
+  "allow_on_submit": 0, 
+  "description": "Your sales person who will contact the lead in future", 
+  "doctype": "DocField", 
+  "fieldname": "contact_by", 
+  "fieldtype": "Link", 
+  "hidden": 0, 
+  "in_filter": 1, 
+  "label": "Next Contact By", 
+  "oldfieldname": "contact_by", 
+  "oldfieldtype": "Link", 
+  "options": "Profile", 
+  "print_hide": 0, 
+  "reqd": 0, 
+  "width": "100px"
+ }, 
+ {
+  "allow_on_submit": 0, 
+  "description": "Your sales person will get a reminder on this date to contact the lead", 
+  "doctype": "DocField", 
+  "fieldname": "contact_date", 
+  "fieldtype": "Date", 
+  "in_filter": 1, 
+  "label": "Next Contact Date", 
+  "no_copy": 1, 
+  "oldfieldname": "contact_date", 
+  "oldfieldtype": "Date", 
+  "reqd": 0, 
+  "width": "100px"
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "sec_break123", 
+  "fieldtype": "Section Break", 
+  "options": "Simple"
+ }, 
+ {
   "allow_on_submit": 0, 
   "doctype": "DocField", 
   "fieldname": "communication_html", 
@@ -275,18 +342,6 @@
   "options": "\nClient\nChannel Partner\nConsultant"
  }, 
  {
-  "default": "__user", 
-  "doctype": "DocField", 
-  "fieldname": "lead_owner", 
-  "fieldtype": "Link", 
-  "in_filter": 1, 
-  "label": "Lead Owner", 
-  "oldfieldname": "lead_owner", 
-  "oldfieldtype": "Link", 
-  "options": "Profile", 
-  "search_index": 1
- }, 
- {
   "doctype": "DocField", 
   "fieldname": "market_segment", 
   "fieldtype": "Select", 
@@ -348,49 +403,6 @@
   "options": "Quotation Lost Reason"
  }, 
  {
-  "allow_on_submit": 0, 
-  "description": "Your sales person who will contact the lead in future", 
-  "doctype": "DocField", 
-  "fieldname": "contact_by", 
-  "fieldtype": "Link", 
-  "hidden": 0, 
-  "in_filter": 1, 
-  "label": "Next Contact By", 
-  "oldfieldname": "contact_by", 
-  "oldfieldtype": "Link", 
-  "options": "Profile", 
-  "print_hide": 0, 
-  "reqd": 0, 
-  "width": "100px"
- }, 
- {
-  "allow_on_submit": 0, 
-  "description": "Your sales person will get a reminder on this date to contact the lead", 
-  "doctype": "DocField", 
-  "fieldname": "contact_date", 
-  "fieldtype": "Date", 
-  "in_filter": 1, 
-  "label": "Next Contact Date", 
-  "no_copy": 1, 
-  "oldfieldname": "contact_date", 
-  "oldfieldtype": "Date", 
-  "reqd": 0, 
-  "width": "100px"
- }, 
- {
-  "depends_on": "eval:!doc.__islocal", 
-  "description": "Date on which the lead was last contacted", 
-  "doctype": "DocField", 
-  "fieldname": "last_contact_date", 
-  "fieldtype": "Date", 
-  "label": "Last Contact Date", 
-  "no_copy": 1, 
-  "oldfieldname": "last_contact_date", 
-  "oldfieldtype": "Date", 
-  "print_hide": 1, 
-  "read_only": 1
- }, 
- {
   "doctype": "DocField", 
   "fieldname": "company", 
   "fieldtype": "Link", 
diff --git a/selling/doctype/sales_bom/sales_bom.py b/selling/doctype/sales_bom/sales_bom.py
index 15d8fd1..2e56f2a 100644
--- a/selling/doctype/sales_bom/sales_bom.py
+++ b/selling/doctype/sales_bom/sales_bom.py
@@ -31,13 +31,9 @@
 	def get_item_details(self, name):
 		det = webnotes.conn.sql("""select description, stock_uom from `tabItem` 
 			where name = %s""", name)
-		rate = webnotes.conn.sql("""select ref_rate from `tabItem Price` 
-			where price_list = %s and parent = %s 
-			and ref_currency = %s""", (self.doc.price_list, name, self.doc.currency))
 		return {
 			'description' : det and det[0][0] or '', 
-			'uom': det and det[0][1] or '', 
-			'rate': rate and flt(rate[0][0]) or 0.00
+			'uom': det and det[0][1] or ''
 		}
 
 	def check_duplicate(self, finder=0):
diff --git a/selling/doctype/sales_bom_item/sales_bom_item.txt b/selling/doctype/sales_bom_item/sales_bom_item.txt
index 1bd456b..9e880bc 100644
--- a/selling/doctype/sales_bom_item/sales_bom_item.txt
+++ b/selling/doctype/sales_bom_item/sales_bom_item.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-05-23 16:55:51", 
   "docstatus": 0, 
-  "modified": "2013-07-10 14:54:19", 
+  "modified": "2013-09-09 15:47:56", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -53,17 +53,18 @@
   "label": "Description", 
   "oldfieldname": "description", 
   "oldfieldtype": "Text", 
-  "print_width": "300px", 
-  "width": "300px"
+  "print_width": "300px"
  }, 
  {
   "doctype": "DocField", 
   "fieldname": "rate", 
   "fieldtype": "Float", 
-  "in_list_view": 1, 
+  "hidden": 1, 
+  "in_list_view": 0, 
   "label": "Rate", 
   "oldfieldname": "rate", 
-  "oldfieldtype": "Currency"
+  "oldfieldtype": "Currency", 
+  "print_hide": 1
  }, 
  {
   "doctype": "DocField", 
diff --git a/selling/doctype/sales_common/sales_common.js b/selling/doctype/sales_common/sales_common.js
index 0308dfc..dc58377 100644
--- a/selling/doctype/sales_common/sales_common.js
+++ b/selling/doctype/sales_common/sales_common.js
@@ -49,16 +49,6 @@
 			this.frm.set_query("selling_price_list", function() {
 				return { filters: { buying_or_selling: "Selling" } };
 			});
-		
-			this.frm.set_query("price_list_currency", function() {
-				return {
-					query: "controllers.queries.get_price_list_currency",
-					filters: {
-						price_list: me.frm.doc.selling_price_list,
-						buying_or_selling: "Selling"
-					}					
-				};
-			});
 		}
 			
 		if(!this.fname) {
diff --git a/selling/doctype/sales_order/sales_order.py b/selling/doctype/sales_order/sales_order.py
index eac4236..1ccccdd 100644
--- a/selling/doctype/sales_order/sales_order.py
+++ b/selling/doctype/sales_order/sales_order.py
@@ -288,6 +288,9 @@
 	def on_update(self):
 		pass
 		
+	def get_portal_page(self):
+		return "order" if self.doc.docstatus==1 else None
+		
 def set_missing_values(source, target):
 	bean = webnotes.bean(target)
 	bean.run_method("onload_post_render")
diff --git a/website/doctype/about_us_settings/__init__.py b/selling/doctype/sales_order/templates/__init__.py
similarity index 100%
copy from website/doctype/about_us_settings/__init__.py
copy to selling/doctype/sales_order/templates/__init__.py
diff --git a/website/doctype/about_us_settings/__init__.py b/selling/doctype/sales_order/templates/pages/__init__.py
similarity index 100%
copy from website/doctype/about_us_settings/__init__.py
copy to selling/doctype/sales_order/templates/pages/__init__.py
diff --git a/selling/doctype/sales_order/templates/pages/order.html b/selling/doctype/sales_order/templates/pages/order.html
new file mode 100644
index 0000000..db6e009
--- /dev/null
+++ b/selling/doctype/sales_order/templates/pages/order.html
@@ -0,0 +1,5 @@
+{% extends "app/portal/templates/sale.html" %}
+
+{% block status -%}
+	{% if doc.status %}{{ doc.status }}{% endif %}
+{%- endblock %}
\ No newline at end of file
diff --git a/selling/doctype/sales_order/templates/pages/order.py b/selling/doctype/sales_order/templates/pages/order.py
new file mode 100644
index 0000000..88a4d46
--- /dev/null
+++ b/selling/doctype/sales_order/templates/pages/order.py
@@ -0,0 +1,32 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# 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 portal.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/selling/doctype/sales_order/templates/pages/orders.html b/selling/doctype/sales_order/templates/pages/orders.html
new file mode 100644
index 0000000..f108683
--- /dev/null
+++ b/selling/doctype/sales_order/templates/pages/orders.html
@@ -0,0 +1 @@
+{% extends "app/portal/templates/sales_transactions.html" %}
\ No newline at end of file
diff --git a/selling/doctype/sales_order/templates/pages/orders.py b/selling/doctype/sales_order/templates/pages/orders.py
new file mode 100644
index 0000000..150a20f
--- /dev/null
+++ b/selling/doctype/sales_order/templates/pages/orders.py
@@ -0,0 +1,30 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+no_cache = True
+
+def get_context():
+	from portal.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 portal.utils import get_transaction_list
+	from 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/website/doctype/shopping_cart_price_list/__init__.py b/selling/doctype/shopping_cart_price_list/__init__.py
similarity index 100%
rename from website/doctype/shopping_cart_price_list/__init__.py
rename to selling/doctype/shopping_cart_price_list/__init__.py
diff --git a/website/doctype/shopping_cart_price_list/shopping_cart_price_list.py b/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.py
similarity index 100%
rename from website/doctype/shopping_cart_price_list/shopping_cart_price_list.py
rename to selling/doctype/shopping_cart_price_list/shopping_cart_price_list.py
diff --git a/website/doctype/shopping_cart_price_list/shopping_cart_price_list.txt b/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.txt
similarity index 90%
rename from website/doctype/shopping_cart_price_list/shopping_cart_price_list.txt
rename to selling/doctype/shopping_cart_price_list/shopping_cart_price_list.txt
index 361edf6..1737c65 100644
--- a/website/doctype/shopping_cart_price_list/shopping_cart_price_list.txt
+++ b/selling/doctype/shopping_cart_price_list/shopping_cart_price_list.txt
@@ -2,14 +2,14 @@
  {
   "creation": "2013-06-20 16:00:18", 
   "docstatus": 0, 
-  "modified": "2013-08-09 14:47:12", 
+  "modified": "2013-08-09 14:47:15", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
  {
   "doctype": "DocType", 
   "istable": 1, 
-  "module": "Website", 
+  "module": "Selling", 
   "name": "__common__"
  }, 
  {
diff --git a/website/doctype/shopping_cart_settings/__init__.py b/selling/doctype/shopping_cart_settings/__init__.py
similarity index 100%
rename from website/doctype/shopping_cart_settings/__init__.py
rename to selling/doctype/shopping_cart_settings/__init__.py
diff --git a/website/doctype/shopping_cart_settings/shopping_cart_settings.js b/selling/doctype/shopping_cart_settings/shopping_cart_settings.js
similarity index 100%
rename from website/doctype/shopping_cart_settings/shopping_cart_settings.js
rename to selling/doctype/shopping_cart_settings/shopping_cart_settings.js
diff --git a/website/doctype/shopping_cart_settings/shopping_cart_settings.py b/selling/doctype/shopping_cart_settings/shopping_cart_settings.py
similarity index 96%
rename from website/doctype/shopping_cart_settings/shopping_cart_settings.py
rename to selling/doctype/shopping_cart_settings/shopping_cart_settings.py
index 74cc217..f395458 100644
--- a/website/doctype/shopping_cart_settings/shopping_cart_settings.py
+++ b/selling/doctype/shopping_cart_settings/shopping_cart_settings.py
@@ -94,6 +94,11 @@
 		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()
diff --git a/website/doctype/shopping_cart_settings/shopping_cart_settings.txt b/selling/doctype/shopping_cart_settings/shopping_cart_settings.txt
similarity index 97%
rename from website/doctype/shopping_cart_settings/shopping_cart_settings.txt
rename to selling/doctype/shopping_cart_settings/shopping_cart_settings.txt
index 21e6ee3..531f8da 100644
--- a/website/doctype/shopping_cart_settings/shopping_cart_settings.txt
+++ b/selling/doctype/shopping_cart_settings/shopping_cart_settings.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-06-19 15:57:32", 
   "docstatus": 0, 
-  "modified": "2013-07-15 17:33:05", 
+  "modified": "2013-07-15 17:33:15", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -11,7 +11,7 @@
   "doctype": "DocType", 
   "icon": "icon-shopping-cart", 
   "issingle": 1, 
-  "module": "Website", 
+  "module": "Selling", 
   "name": "__common__"
  }, 
  {
diff --git a/website/doctype/shopping_cart_settings/test_shopping_cart_settings.py b/selling/doctype/shopping_cart_settings/test_shopping_cart_settings.py
similarity index 97%
rename from website/doctype/shopping_cart_settings/test_shopping_cart_settings.py
rename to selling/doctype/shopping_cart_settings/test_shopping_cart_settings.py
index 3417cec..77c7e23 100644
--- a/website/doctype/shopping_cart_settings/test_shopping_cart_settings.py
+++ b/selling/doctype/shopping_cart_settings/test_shopping_cart_settings.py
@@ -6,7 +6,7 @@
 from __future__ import unicode_literals
 import webnotes
 import unittest
-from website.doctype.shopping_cart_settings.shopping_cart_settings import ShoppingCartSetupError
+from selling.doctype.shopping_cart_settings.shopping_cart_settings import ShoppingCartSetupError
 
 class TestShoppingCartSettings(unittest.TestCase):
 	def setUp(self):
diff --git a/website/doctype/shopping_cart_shipping_rule/__init__.py b/selling/doctype/shopping_cart_shipping_rule/__init__.py
similarity index 100%
rename from website/doctype/shopping_cart_shipping_rule/__init__.py
rename to selling/doctype/shopping_cart_shipping_rule/__init__.py
diff --git a/website/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.py b/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.py
similarity index 100%
rename from website/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.py
rename to selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.py
diff --git a/website/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.txt b/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.txt
similarity index 90%
rename from website/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.txt
rename to selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.txt
index 302b0ae..8c9c34a 100644
--- a/website/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.txt
+++ b/selling/doctype/shopping_cart_shipping_rule/shopping_cart_shipping_rule.txt
@@ -2,14 +2,14 @@
  {
   "creation": "2013-07-03 13:15:34", 
   "docstatus": 0, 
-  "modified": "2013-07-10 14:54:23", 
+  "modified": "2013-07-10 14:54:25", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
  {
   "doctype": "DocType", 
   "istable": 1, 
-  "module": "Website", 
+  "module": "Selling", 
   "name": "__common__"
  }, 
  {
diff --git a/website/doctype/shopping_cart_taxes_and_charges_master/__init__.py b/selling/doctype/shopping_cart_taxes_and_charges_master/__init__.py
similarity index 100%
rename from website/doctype/shopping_cart_taxes_and_charges_master/__init__.py
rename to selling/doctype/shopping_cart_taxes_and_charges_master/__init__.py
diff --git a/website/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.py b/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.py
similarity index 100%
rename from website/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.py
rename to selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.py
diff --git a/website/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.txt b/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.txt
similarity index 91%
rename from website/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.txt
rename to selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.txt
index f00a23d..a61f8db 100644
--- a/website/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.txt
+++ b/selling/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.txt
@@ -2,14 +2,14 @@
  {
   "creation": "2013-06-20 16:57:03", 
   "docstatus": 0, 
-  "modified": "2013-07-10 14:54:23", 
+  "modified": "2013-07-10 14:54:25", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
  {
   "doctype": "DocType", 
   "istable": 1, 
-  "module": "Website", 
+  "module": "Selling", 
   "name": "__common__"
  }, 
  {
diff --git a/selling/page/selling_home/selling_home.js b/selling/page/selling_home/selling_home.js
index 4860d42..9697ccf 100644
--- a/selling/page/selling_home/selling_home.js
+++ b/selling/page/selling_home/selling_home.js
@@ -66,6 +66,12 @@
 				"description": "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/selling/utils.py b/selling/utils/__init__.py
similarity index 94%
rename from selling/utils.py
rename to selling/utils/__init__.py
index ca99512..224944d 100644
--- a/selling/utils.py
+++ b/selling/utils/__init__.py
@@ -141,20 +141,19 @@
 	return out
 	
 def _get_price_list_rate(args, item_bean, meta):
-	base_ref_rate = item_bean.doclist.get({
-		"parentfield": "ref_rate_details",
-		"price_list": args.selling_price_list, 
-		"ref_currency": args.price_list_currency,
-		"buying_or_selling": "Selling"})
+	ref_rate = webnotes.conn.sql("""select ip.ref_rate from `tabItem Price` ip, 
+		`tabPrice List` pl where ip.parent = pl.name and ip.parent=%s and 
+		ip.item_code=%s and pl.buying_or_selling='Selling'""", 
+		(args.selling_price_list, args.item_code), as_dict=1)
 
-	if not base_ref_rate:
+	if not ref_rate:
 		return {}
 	
 	# found price list rate - now we can validate
 	from utilities.transaction_base import validate_currency
 	validate_currency(args, item_bean.doc, meta)
 	
-	return {"ref_rate": flt(base_ref_rate[0].ref_rate) * flt(args.plc_conversion_rate) / flt(args.conversion_rate)}
+	return {"ref_rate": flt(ref_rate[0].ref_rate) * flt(args.plc_conversion_rate) / flt(args.conversion_rate)}
 	
 def _get_item_discount(item_group, customer):
 	parent_item_groups = [x[0] for x in webnotes.conn.sql("""SELECT parent.name 
diff --git a/website/helpers/cart.py b/selling/utils/cart.py
similarity index 100%
rename from website/helpers/cart.py
rename to selling/utils/cart.py
diff --git a/website/helpers/product.py b/selling/utils/product.py
similarity index 81%
rename from website/helpers/product.py
rename to selling/utils/product.py
index 031339a..3432170 100644
--- a/website/helpers/product.py
+++ b/selling/utils/product.py
@@ -4,9 +4,9 @@
 from __future__ import unicode_literals
 
 import webnotes
-from webnotes.utils import cstr, cint, fmt_money
-from webnotes.webutils import build_html, delete_page_cache
-from website.helpers.cart import _get_cart_quotation
+from webnotes.utils import cstr, cint, fmt_money, get_base_path
+from webnotes.webutils import delete_page_cache
+from selling.utils.cart import _get_cart_quotation
 
 @webnotes.whitelist(allow_guest=True)
 def get_product_info(item_code):
@@ -27,18 +27,19 @@
 	else:
 		in_stock = -1
 		
-	price = price_list and webnotes.conn.sql("""select ref_rate, ref_currency from
-		`tabItem Price` where parent=%s and price_list=%s""", 
+	price = price_list and webnotes.conn.sql("""select ip.ref_rate, pl.currency from
+		`tabItem Price` ip, `tabPrice List` pl where ip.parent = pl.name and 
+		ip.item_code=%s and ip.parent=%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["ref_currency"])
+		price["formatted_price"] = fmt_money(price["ref_rate"], currency=price["currency"])
 		
-		price["ref_currency"] = not cint(webnotes.conn.get_default("hide_currency_symbol")) \
-			and (webnotes.conn.get_value("Currency", price.ref_currency, "symbol") or price.ref_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":
@@ -106,10 +107,12 @@
 			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(r):
-	scrub_item_for_list(r)
-	r.template = "app/website/templates/html/product_in_grid.html"
-	return build_html(r)
+def get_item_for_list_in_html(context):
+	from jinja2 import Environment, FileSystemLoader
+	scrub_item_for_list(context)
+	jenv = Environment(loader = FileSystemLoader(get_base_path()))
+	template = jenv.get_template("app/stock/doctype/item/templates/includes/product_in_grid.html")
+	return template.render(context)
 
 def scrub_item_for_list(r):
 	if not r.website_description:
diff --git a/setup/doctype/currency_exchange/currency_exchange.js b/setup/doctype/currency_exchange/currency_exchange.js
index 5fd4305..bf9c516 100644
--- a/setup/doctype/currency_exchange/currency_exchange.js
+++ b/setup/doctype/currency_exchange/currency_exchange.js
@@ -23,8 +23,6 @@
 	set_exchange_rate_label: function() {
 		if(cur_frm.doc.from_currency && cur_frm.doc.to_currency) {
 			var default_label = wn._(wn.meta.docfield_map[cur_frm.doctype]["exchange_rate"].label);
-			console.log(default_label + 
-				repl(" (1 %(from_currency)s = [?] %(to_currency)s)", cur_frm.doc));
 			cur_frm.fields_dict.exchange_rate.set_label(default_label + 
 				repl(" (1 %(from_currency)s = [?] %(to_currency)s)", cur_frm.doc));
 		}
diff --git a/setup/doctype/customer_group/test_customer_group.py b/setup/doctype/customer_group/test_customer_group.py
index 14233af..11140d6 100644
--- a/setup/doctype/customer_group/test_customer_group.py
+++ b/setup/doctype/customer_group/test_customer_group.py
@@ -1,6 +1,9 @@
 # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
 # License: GNU General Public License v3. See license.txt
 
+test_ignore = ["Price List"]
+
+
 test_records = [
 	[{
 		"doctype": "Customer Group",
diff --git a/setup/doctype/item_group/item_group.py b/setup/doctype/item_group/item_group.py
index 81f6903..5eae4d1 100644
--- a/setup/doctype/item_group/item_group.py
+++ b/setup/doctype/item_group/item_group.py
@@ -18,7 +18,7 @@
 		
 		self.validate_name_with_item()
 		
-		from website.helpers.product import invalidate_cache_for
+		from selling.utils.product import invalidate_cache_for
 		
 		if self.doc.show_in_website:
 			from webnotes.webutils import update_page_name
@@ -44,8 +44,8 @@
 			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 prepare_template_args(self):
-		from website.helpers.product import get_product_list_for_group, \
+	def get_context(self):
+		from selling.utils.product import get_product_list_for_group, \
 			get_parent_item_groups, get_group_item_count
 
 		self.doc.sub_groups = webnotes.conn.sql("""select name, page_name
@@ -60,6 +60,6 @@
 		self.doc.title = self.doc.name
 
 		if self.doc.slideshow:
-			from website.helpers.slideshow import get_slideshow
+			from website.doctype.website_slideshow.website_slideshow import get_slideshow
 			get_slideshow(self)
 		
\ No newline at end of file
diff --git a/website/doctype/about_us_settings/__init__.py b/setup/doctype/item_group/templates/__init__.py
similarity index 100%
copy from website/doctype/about_us_settings/__init__.py
copy to setup/doctype/item_group/templates/__init__.py
diff --git a/website/doctype/about_us_settings/__init__.py b/setup/doctype/item_group/templates/generators/__init__.py
similarity index 100%
copy from website/doctype/about_us_settings/__init__.py
copy to setup/doctype/item_group/templates/generators/__init__.py
diff --git a/setup/doctype/item_group/templates/generators/item_group.html b/setup/doctype/item_group/templates/generators/item_group.html
new file mode 100644
index 0000000..48db596
--- /dev/null
+++ b/setup/doctype/item_group/templates/generators/item_group.html
@@ -0,0 +1,42 @@
+{% extends base_template %}
+
+{% block content %}
+{% include 'app/stock/doctype/item/templates/includes/product_search_box.html' %}
+{% include 'app/stock/doctype/item/templates/includes/product_breadcrumbs.html' %}
+<div class="col-md-12">
+	{% if slideshow %}<!-- slideshow -->
+	{% include "lib/website/doctype/website_slideshow/templates/includes/slideshow.html" %}
+	{% endif %}
+	{% if description %}<!-- description -->
+	<div>{{ description or ""}}</div>
+	{% else %}
+	<h3>{{ name }}</h3>
+	{% endif %}
+</div>
+<div class="col-md-12">
+	{% 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>
+
+{% endblock %}
\ No newline at end of file
diff --git a/setup/doctype/item_group/templates/generators/item_group.py b/setup/doctype/item_group/templates/generators/item_group.py
new file mode 100644
index 0000000..12ef513
--- /dev/null
+++ b/setup/doctype/item_group/templates/generators/item_group.py
@@ -0,0 +1,2 @@
+doctype = "Item Group"
+condition_field = "show_in_website"
\ No newline at end of file
diff --git a/stock/doctype/item_price/README.md b/setup/doctype/item_price/README.md
similarity index 100%
rename from stock/doctype/item_price/README.md
rename to setup/doctype/item_price/README.md
diff --git a/stock/doctype/item_price/__init__.py b/setup/doctype/item_price/__init__.py
similarity index 100%
rename from stock/doctype/item_price/__init__.py
rename to setup/doctype/item_price/__init__.py
diff --git a/website/doctype/about_us_team_member/about_us_team_member.py b/setup/doctype/item_price/item_price.py
similarity index 79%
rename from website/doctype/about_us_team_member/about_us_team_member.py
rename to setup/doctype/item_price/item_price.py
index 784339d..3256c80 100644
--- a/website/doctype/about_us_team_member/about_us_team_member.py
+++ b/setup/doctype/item_price/item_price.py
@@ -1,5 +1,5 @@
 # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
+# MIT License. See license.txt
 
 # For license information, please see license.txt
 
diff --git a/setup/doctype/item_price/item_price.txt b/setup/doctype/item_price/item_price.txt
new file mode 100644
index 0000000..4ff5124
--- /dev/null
+++ b/setup/doctype/item_price/item_price.txt
@@ -0,0 +1,53 @@
+[
+ {
+  "creation": "2013-05-02 16:29:48", 
+  "docstatus": 0, 
+  "modified": "2013-09-13 11:50:02", 
+  "modified_by": "Administrator", 
+  "owner": "Administrator"
+ }, 
+ {
+  "autoname": "RFD/.#####", 
+  "doctype": "DocType", 
+  "in_create": 0, 
+  "istable": 1, 
+  "module": "Setup", 
+  "name": "__common__", 
+  "read_only": 0
+ }, 
+ {
+  "doctype": "DocField", 
+  "in_filter": 1, 
+  "in_list_view": 1, 
+  "name": "__common__", 
+  "parent": "Item Price", 
+  "parentfield": "fields", 
+  "parenttype": "DocType", 
+  "permlevel": 0, 
+  "reqd": 1
+ }, 
+ {
+  "doctype": "DocType", 
+  "name": "Item Price"
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "item_code", 
+  "fieldtype": "Link", 
+  "label": "Item Code", 
+  "oldfieldname": "price_list_name", 
+  "oldfieldtype": "Select", 
+  "options": "Item", 
+  "search_index": 1
+ }, 
+ {
+  "doctype": "DocField", 
+  "fieldname": "ref_rate", 
+  "fieldtype": "Currency", 
+  "label": "Rate", 
+  "oldfieldname": "ref_rate", 
+  "oldfieldtype": "Currency", 
+  "options": "currency", 
+  "search_index": 0
+ }
+]
\ No newline at end of file
diff --git a/setup/doctype/price_list/price_list.js b/setup/doctype/price_list/price_list.js
index 5de8da5..f3adc72 100644
--- a/setup/doctype/price_list/price_list.js
+++ b/setup/doctype/price_list/price_list.js
@@ -3,44 +3,6 @@
 
 $.extend(cur_frm.cscript, {
 	onload: function() {
-		cur_frm.cscript.show_item_prices();
 		erpnext.add_for_territory();
 	},
-	
-	refresh: function(doc) {
-		cur_frm.set_intro("");
-		if(doc.__islocal) {
-			cur_frm.toggle_display("item_prices_section", false);
-			cur_frm.set_intro("Save this list to begin.");
-			return;
-		} else {
-			cur_frm.cscript.show_item_prices();
-		}
-	},
-	
-	show_item_prices: function() {
-		var item_price = wn.model.get("Item Price", {price_list: cur_frm.doc.name});
-	
-		var show = item_price && item_price.length;
-	
-		cur_frm.toggle_display("item_prices_section", show);
-		$(cur_frm.fields_dict.item_prices.wrapper).empty();
-		if (!show) return;
-	
-		var out = '<table class="table table-striped table-bordered">\
-			<thead><tr>\
-				<th>' + wn._("Item Code") + '</th>\
-				<th>' + wn._("Price") + '</th>\
-			</tr></thead>\
-			<tbody>'
-			+ $.map(item_price.sort(function(a, b) { return a.parent.localeCompare(b.parent); }), function(d) {
-				return '<tr>'
-					+ '<td><a href="#Form/Item/' + encodeURIComponent(d.parent) +'">' + d.parent + '</a></td>'
-					+ '<td style="text-align: right;">' + format_currency(d.ref_rate, d.ref_currency) + '</td>'
-					+ '</tr>'
-			}).join("\n")
-			+ '</tbody>\
-		</table>';
-		$(out).appendTo($(cur_frm.fields_dict.item_prices.wrapper));
-	}
 });
\ No newline at end of file
diff --git a/setup/doctype/price_list/price_list.py b/setup/doctype/price_list/price_list.py
index 112ce95..2fcaf21 100644
--- a/setup/doctype/price_list/price_list.py
+++ b/setup/doctype/price_list/price_list.py
@@ -8,11 +8,9 @@
 from webnotes.model.controller import DocListController
 import webnotes.defaults
 
+class PriceListDuplicateItem(Exception): pass
+
 class DocType(DocListController):
-	def onload(self):
-		self.doclist.extend(webnotes.conn.sql("""select * from `tabItem Price` 
-			where price_list=%s""", self.doc.name, as_dict=True, update={"doctype": "Item Price"}))
-	
 	def validate(self):
 		if self.doc.buying_or_selling not in ["Buying", "Selling"]:
 			msgprint(_(self.meta.get_label("buying_or_selling")) + " " + _("must be one of") + " " +
@@ -29,17 +27,24 @@
 			else:
 				# at least one territory
 				self.validate_table_has_rows("valid_for_territories")
+
+		# check for duplicate items
+		self.check_duplicate_items()
 		
 	def on_update(self):
 		self.set_default_if_missing()
 		cart_settings = webnotes.get_obj("Shopping Cart Settings")
 		if cint(cart_settings.doc.enabled):
 			cart_settings.validate_price_lists()
+
+	def check_duplicate_items(self):
+		item_codes = []
+		for d in self.doclist.get({"parentfield": "item_prices"}):
+			if d.item_code not in item_codes:
+				item_codes.append(d.item_code)
+			else:
+				msgprint(_("Duplicate Item ") + ": " + d.item_code, raise_exception=PriceListDuplicateItem)
 				
-	def on_trash(self):
-		webnotes.conn.sql("""delete from `tabItem Price` where price_list = %s""", 
-			self.doc.name)
-			
 	def set_default_if_missing(self):
 		if self.doc.buying_or_selling=="Selling":
 			if not webnotes.conn.get_value("Selling Settings", None, "selling_price_list"):
@@ -47,4 +52,5 @@
 
 		elif self.doc.buying_or_selling=="Buying":
 			if not webnotes.conn.get_value("Buying Settings", None, "buying_price_list"):
-				webnotes.set_value("Buying Settings", "Buying Settings", "buying_price_list", self.doc.name)
\ No newline at end of file
+				webnotes.set_value("Buying Settings", "Buying Settings", "buying_price_list", self.doc.name)
+
diff --git a/setup/doctype/price_list/price_list.txt b/setup/doctype/price_list/price_list.txt
index febf471..46905a6 100644
--- a/setup/doctype/price_list/price_list.txt
+++ b/setup/doctype/price_list/price_list.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-01-25 11:35:09", 
   "docstatus": 0, 
-  "modified": "2013-07-26 11:19:06", 
+  "modified": "2013-09-06 15:03:38", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -94,28 +94,9 @@
  {
   "doctype": "DocField", 
   "fieldname": "item_prices", 
-  "fieldtype": "HTML", 
-  "label": "Item Prices"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "column_break_10", 
-  "fieldtype": "Column Break"
- }, 
- {
-  "depends_on": "eval:!doc.__islocal", 
-  "doctype": "DocField", 
-  "fieldname": "section_break_1", 
-  "fieldtype": "Section Break", 
-  "label": "How to upload"
- }, 
- {
-  "depends_on": "eval:!doc.__islocal", 
-  "doctype": "DocField", 
-  "fieldname": "how_to_upload", 
-  "fieldtype": "HTML", 
-  "label": "How to upload", 
-  "options": "<div class=\"well\">Use the <a href=\"#data-import-tool\">Data Import Tool</a> to upload, update Item Prices in bulk:\n<ol> \n<li>Go to Data Import Tool.\n<li>Select \"Item\"\n<li>Check on \"With Data\"\n<li>Download \"Item Price\" from Child Tables.\n<li>Update the prices required and add new rows if required.\n<li>Check on \"Overwrite\"\n<li>Upload the modified sheet.\n</div>\n"
+  "fieldtype": "Table", 
+  "label": "Item Prices", 
+  "options": "Item Price"
  }, 
  {
   "amend": 0, 
diff --git a/setup/doctype/price_list/test_price_list.py b/setup/doctype/price_list/test_price_list.py
index bfa64ec..b1174d3 100644
--- a/setup/doctype/price_list/test_price_list.py
+++ b/setup/doctype/price_list/test_price_list.py
@@ -1,6 +1,20 @@
 # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
 # License: GNU General Public License v3. See license.txt
 
+from __future__ import unicode_literals
+import unittest
+import webnotes
+from setup.doctype.price_list.price_list import PriceListDuplicateItem
+
+class TestItem(unittest.TestCase):
+	def test_duplicate_item(self):
+		price_list = webnotes.bean(copy=test_records[0])
+		item_price = price_list.doclist.get({"doctype": "Item Price"})[0]
+		price_list.doclist.append(webnotes.doc(item_price.fields.copy()))
+		self.assertRaises(PriceListDuplicateItem, price_list.insert)
+
+# test_ignore = ["Item"]
+
 test_records = [
 	[
 		{
@@ -13,6 +27,12 @@
 			"doctype": "For Territory",
 			"parentfield": "valid_for_territories",
 			"territory": "All Territories"
+		},
+		{
+			"doctype": "Item Price",
+			"parentfield": "item_prices",
+			"item_code": "_Test Item",
+			"ref_rate": 100
 		}
 	],
 	[
diff --git a/setup/doctype/sales_partner/sales_partner.py b/setup/doctype/sales_partner/sales_partner.py
index 2c39e67..0d7e12d 100644
--- a/setup/doctype/sales_partner/sales_partner.py
+++ b/setup/doctype/sales_partner/sales_partner.py
@@ -29,7 +29,7 @@
 		else:
 			return ''
 			
-	def prepare_template_args(self):
+	def get_context(self):
 		address = webnotes.conn.get_value("Address", 
 			{"sales_partner": self.doc.name, "is_primary_address": 1}, 
 			"*", as_dict=True)
@@ -42,4 +42,4 @@
 				"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/website/doctype/about_us_settings/__init__.py b/setup/doctype/sales_partner/templates/__init__.py
similarity index 100%
copy from website/doctype/about_us_settings/__init__.py
copy to setup/doctype/sales_partner/templates/__init__.py
diff --git a/website/doctype/about_us_settings/__init__.py b/setup/doctype/sales_partner/templates/generators/__init__.py
similarity index 100%
copy from website/doctype/about_us_settings/__init__.py
copy to setup/doctype/sales_partner/templates/generators/__init__.py
diff --git a/website/templates/html/partner_page.html b/setup/doctype/sales_partner/templates/generators/partner.html
similarity index 93%
rename from website/templates/html/partner_page.html
rename to setup/doctype/sales_partner/templates/generators/partner.html
index e5aac35..eb1481b 100644
--- a/website/templates/html/partner_page.html
+++ b/setup/doctype/sales_partner/templates/generators/partner.html
@@ -1,4 +1,4 @@
-{% extends "app/website/templates/html/page.html" %}
+{% extends base_template %}
 
 {% block content %}
 	<div class="col-md-12" itemscope itemtype="http://schema.org/Organization">
diff --git a/setup/doctype/sales_partner/templates/generators/partner.py b/setup/doctype/sales_partner/templates/generators/partner.py
new file mode 100644
index 0000000..2229f03
--- /dev/null
+++ b/setup/doctype/sales_partner/templates/generators/partner.py
@@ -0,0 +1,2 @@
+doctype = "Sales Partner"
+condition_field = "show_in_website"
\ No newline at end of file
diff --git a/website/doctype/about_us_settings/__init__.py b/setup/doctype/sales_partner/templates/pages/__init__.py
similarity index 100%
copy from website/doctype/about_us_settings/__init__.py
copy to setup/doctype/sales_partner/templates/pages/__init__.py
diff --git a/website/templates/pages/partners.html b/setup/doctype/sales_partner/templates/pages/partners.html
similarity index 93%
rename from website/templates/pages/partners.html
rename to setup/doctype/sales_partner/templates/pages/partners.html
index 50a095d..14c72ae 100644
--- a/website/templates/pages/partners.html
+++ b/setup/doctype/sales_partner/templates/pages/partners.html
@@ -1,4 +1,4 @@
-{% extends "app/website/templates/html/page.html" %}
+{% extends base_template %}
 
 {% set title="Partners" %}
 
diff --git a/setup/doctype/sales_partner/templates/pages/partners.py b/setup/doctype/sales_partner/templates/pages/partners.py
new file mode 100644
index 0000000..5245ec0
--- /dev/null
+++ b/setup/doctype/sales_partner/templates/pages/partners.py
@@ -0,0 +1,7 @@
+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/setup/doctype/setup_control/setup_control.py b/setup/doctype/setup_control/setup_control.py
index 3f09ff1..b78bfcc 100644
--- a/setup/doctype/setup_control/setup_control.py
+++ b/setup/doctype/setup_control/setup_control.py
@@ -101,7 +101,6 @@
 			'default_currency': args.get('currency'),
 			'default_company':args.get('company_name'),
 			'date_format': webnotes.conn.get_value("Country", args.get("country"), "date_format"),
-			'emp_created_by':'Naming Series',
 			"float_precision": 4
 		})
 		global_defaults.save()
@@ -136,6 +135,10 @@
 		notification_control.doc.purchase_order = 1
 		notification_control.save()
 
+		hr_settings = webnotes.bean("HR Settings")
+		hr_settings.doc.emp_created_by = "Naming Series"
+		hr_settings.save()
+
 		# control panel
 		cp = webnotes.doc("Control Panel", "Control Panel")
 		for k in ['country', 'timezone', 'company_name']:
diff --git a/website/doctype/website_item_group/README.md b/setup/doctype/website_item_group/README.md
similarity index 100%
rename from website/doctype/website_item_group/README.md
rename to setup/doctype/website_item_group/README.md
diff --git a/website/doctype/website_item_group/__init__.py b/setup/doctype/website_item_group/__init__.py
similarity index 100%
rename from website/doctype/website_item_group/__init__.py
rename to setup/doctype/website_item_group/__init__.py
diff --git a/website/doctype/website_item_group/website_item_group.py b/setup/doctype/website_item_group/website_item_group.py
similarity index 80%
rename from website/doctype/website_item_group/website_item_group.py
rename to setup/doctype/website_item_group/website_item_group.py
index 784339d..3256c80 100644
--- a/website/doctype/website_item_group/website_item_group.py
+++ b/setup/doctype/website_item_group/website_item_group.py
@@ -1,5 +1,5 @@
 # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
+# MIT License. See license.txt
 
 # For license information, please see license.txt
 
diff --git a/website/doctype/website_item_group/website_item_group.txt b/setup/doctype/website_item_group/website_item_group.txt
similarity index 91%
rename from website/doctype/website_item_group/website_item_group.txt
rename to setup/doctype/website_item_group/website_item_group.txt
index 3d26e85..5753fcf 100644
--- a/website/doctype/website_item_group/website_item_group.txt
+++ b/setup/doctype/website_item_group/website_item_group.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-02-22 01:28:09", 
   "docstatus": 0, 
-  "modified": "2013-07-10 14:54:25", 
+  "modified": "2013-07-10 14:54:30", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -11,7 +11,7 @@
   "doctype": "DocType", 
   "document_type": "Other", 
   "istable": 1, 
-  "module": "Website", 
+  "module": "Setup", 
   "name": "__common__"
  }, 
  {
diff --git a/startup/__init__.py b/startup/__init__.py
index dd46cbe..227846c 100644
--- a/startup/__init__.py
+++ b/startup/__init__.py
@@ -40,14 +40,3 @@
 		return 999999
 	else:
 		return 500
-
-def get_url():
-	from webnotes.utils import get_request_site_address
-	url = get_request_site_address()
-	if not url or "localhost" in url:
-		subdomain = webnotes.conn.get_value("Website Settings", "Website Settings",
-			"subdomain")
-		if subdomain:
-			if "http" not in subdomain:
-				url = "http://" + subdomain
-	return url
diff --git a/startup/event_handlers.py b/startup/event_handlers.py
index fa08962..57345f3 100644
--- a/startup/event_handlers.py
+++ b/startup/event_handlers.py
@@ -31,7 +31,7 @@
 		webnotes.conn.commit()
 		
 	if webnotes.conn.get_value("Profile", webnotes.session.user, "user_type") == "Website User":
-		from website.helpers.cart import set_cart_count
+		from selling.utils.cart import set_cart_count
 		set_cart_count()
 		
 def on_logout(login_manager):
@@ -65,7 +65,7 @@
 	raise webnotes.AuthenticationError
 
 def on_build():
-	from website.helpers.make_web_include_files import make
+	from website.doctype.website_settings.make_web_include_files import make
 	make()
 	
 	from home.page.latest_updates import latest_updates
diff --git a/startup/install.py b/startup/install.py
index 655573f..d795594 100644
--- a/startup/install.py
+++ b/startup/install.py
@@ -5,44 +5,6 @@
 
 import webnotes
 
-def pre_import():
-	webnotes.conn.begin()
-	make_modules()
-	make_roles()
-	webnotes.conn.commit()
-	
-def make_modules():
-	modules = [
-		"Home", "System", "Utilities", "Website", "Setup",
-		"Selling", "Buying", "Projects", "Accounts", "Stock",
-		"Support", "HR", "Manufacturing"]
-	
-	for m in modules:
-		doc = webnotes.doc(fielddata = {
-			"doctype": "Module Def",
-			"module_name": m,
-		})
-		doc.insert()
-	
-def make_roles():
-	roles = [
-		"Accounts Manager", "Accounts User", "Analytics", "Auditor",
-		"Blogger", "Customer", "Employee", "Expense Approver",
-		"HR Manager", "HR User", "Leave Approver", "Maintenance Manager",
-		"Maintenance User", "Manufacturing Manager", "Manufacturing User",
-		"Material Manager", "Material Master Manager", "Material User",
-		"Partner", "Projects User", "Projects Manager", "Purchase Manager", "Purchase Master Manager",
-		"Purchase User", "Quality Manager", "Sales Manager",
-		"Sales Master Manager", "Sales User", "Supplier", "Support Manager",
-		"Support Team", "Website Manager"]
-		
-	for r in roles:
-		doc = webnotes.doc(fielddata = {
-			"doctype":"Role",
-			"role_name": r
-		})
-		doc.insert()
-
 def post_import():
 	webnotes.conn.begin()
 
diff --git a/startup/webutils.py b/startup/webutils.py
index eab4948..218741b 100644
--- a/startup/webutils.py
+++ b/startup/webutils.py
@@ -1,94 +1,26 @@
 # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
 # License: GNU General Public License v3. See license.txt
 
-import webnotes, conf, os
-from webnotes.utils import cint, cstr, encode
+import webnotes
+from webnotes.utils import cint
 
-def get_templates_path():
-	return os.path.join(os.path.dirname(conf.__file__), "app", "website", "templates")
-
-def get_home_page():
-	doc_name = webnotes.conn.get_value('Website Settings', None, 'home_page')
-	if doc_name:
-		page_name = webnotes.conn.get_value('Web Page', doc_name, 'page_name')
-	else:
-		page_name = 'login'
-
-	return page_name
-
-def update_template_args(page_name, args):
-	
-	from webnotes.utils import get_request_site_address
-	from urllib import quote
-	
-	all_top_items = webnotes.conn.sql("""\
-		select * from `tabTop Bar Item`
-		where parent='Website Settings' and parentfield='top_bar_items'
-		order by idx asc""", as_dict=1)
-	
-	top_items = [d for d in all_top_items if not d['parent_label']]
-	
-	# attach child items to top bar
-	for d in all_top_items:
-		if d['parent_label']:
-			for t in top_items:
-				if t['label']==d['parent_label']:
-					if not 'child_items' in t:
-						t['child_items'] = []
-					t['child_items'].append(d)
-					break
-			
-	ret = webnotes._dict({
-		'top_bar_items': top_items,
-		'footer_items': webnotes.conn.sql("""\
-			select * from `tabTop Bar Item`
-			where parent='Website Settings' and parentfield='footer_items'
-			order by idx asc""", as_dict=1),
-			
-		'int':int,
-		"webnotes": webnotes,
-		"utils": webnotes.utils
-	})
-	
-	args.update(ret)
-	
-	settings = webnotes.doc("Website Settings", "Website Settings")
-	for k in ["banner_html", "brand_html", "copyright", "address", "twitter_share_via",
-		"favicon", "facebook_share", "google_plus_one", "twitter_share", "linked_in_share",
-		"disable_signup"]:
-		if k in settings.fields:
-			args[k] = settings.fields.get(k)
-
-	for k in ["facebook_share", "google_plus_one", "twitter_share", "linked_in_share",
-		"disable_signup"]:
-		args[k] = cint(args.get(k) or 0)
-	
-	args.url = quote(str(get_request_site_address(full_address=True)), str(""))
-	args.encoded_title = quote(encode(args.title or ""), str(""))
-	args.shopping_cart_enabled = cint(webnotes.conn.get_default("shopping_cart_enabled"))
-	
-	return args
-	
-@webnotes.whitelist()
-def update_profile(fullname, password=None, company_name=None, mobile_no=None, phone=None):
-	from website.helpers.cart import update_party
-	update_party(fullname, company_name, mobile_no, phone)
-	
-	from core.doctype.profile import profile
-	return profile.update_profile(fullname, password)
-	
-def get_profile_args():
-	from website.helpers.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"])
+def get_website_settings(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"}]
 		
-	return {
-		"company_name": cstr(party.customer_name if party.doctype == "Customer" else party.company_name),
-		"mobile_no": cstr(mobile_no),
-		"phone": cstr(phone)
-	}
\ No newline at end of file
+	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", [])
+	})
\ No newline at end of file
diff --git a/stock/doctype/delivery_note/delivery_note.py b/stock/doctype/delivery_note/delivery_note.py
index f95b4a0..e5e412e 100644
--- a/stock/doctype/delivery_note/delivery_note.py
+++ b/stock/doctype/delivery_note/delivery_note.py
@@ -39,6 +39,9 @@
 		if billed_qty:
 			total_qty = sum((item.qty for item in self.doclist.get({"parentfield": "delivery_note_details"})))
 			self.doc.fields["__billing_complete"] = billed_qty[0][0] == total_qty
+			
+	def get_portal_page(self):
+		return "shipment" if self.doc.docstatus==1 else None
 		
 	def get_contact_details(self):
 		return get_obj('Sales Common').get_contact_details(self,0)
diff --git a/website/doctype/about_us_settings/__init__.py b/stock/doctype/delivery_note/templates/__init__.py
similarity index 100%
copy from website/doctype/about_us_settings/__init__.py
copy to stock/doctype/delivery_note/templates/__init__.py
diff --git a/website/doctype/about_us_settings/__init__.py b/stock/doctype/delivery_note/templates/pages/__init__.py
similarity index 100%
copy from website/doctype/about_us_settings/__init__.py
copy to stock/doctype/delivery_note/templates/pages/__init__.py
diff --git a/stock/doctype/delivery_note/templates/pages/shipment.html b/stock/doctype/delivery_note/templates/pages/shipment.html
new file mode 100644
index 0000000..376e5df
--- /dev/null
+++ b/stock/doctype/delivery_note/templates/pages/shipment.html
@@ -0,0 +1 @@
+{% extends "app/portal/templates/sale.html" %}
\ No newline at end of file
diff --git a/stock/doctype/delivery_note/templates/pages/shipment.py b/stock/doctype/delivery_note/templates/pages/shipment.py
new file mode 100644
index 0000000..a33203b
--- /dev/null
+++ b/stock/doctype/delivery_note/templates/pages/shipment.py
@@ -0,0 +1,16 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+no_cache = True
+
+def get_context():
+	from portal.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/stock/doctype/delivery_note/templates/pages/shipments.html b/stock/doctype/delivery_note/templates/pages/shipments.html
new file mode 100644
index 0000000..f108683
--- /dev/null
+++ b/stock/doctype/delivery_note/templates/pages/shipments.html
@@ -0,0 +1 @@
+{% extends "app/portal/templates/sales_transactions.html" %}
\ No newline at end of file
diff --git a/stock/doctype/delivery_note/templates/pages/shipments.py b/stock/doctype/delivery_note/templates/pages/shipments.py
new file mode 100644
index 0000000..8b29149
--- /dev/null
+++ b/stock/doctype/delivery_note/templates/pages/shipments.py
@@ -0,0 +1,24 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+no_cache = True
+
+def get_context():
+	from portal.utils import get_currency_context
+	context = get_currency_context()
+	context.update({
+		"title": "Shipments",
+		"method": "portal.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 portal.utils import get_transaction_list
+	return get_transaction_list("Delivery Note", start)
diff --git a/stock/doctype/item/item.js b/stock/doctype/item/item.js
index abf1e9e..a83032e 100644
--- a/stock/doctype/item/item.js
+++ b/stock/doctype/item/item.js
@@ -1,26 +1,6 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
 // License: GNU General Public License v3. See license.txt
 
-wn.provide("erpnext.stock");
-
-erpnext.stock.Item = wn.ui.form.Controller.extend({
-	onload: function() {
-		this.frm.add_fetch("price_list", "currency", "ref_currency");
-		this.frm.add_fetch("price_list", "buying_or_selling", "buying_or_selling");
-	},
-	
-	ref_rate_details_add: function(doc, cdt, cdn) {
-		var row = wn.model.get_doc(cdt, cdn);
-		if(row.price_list && !row.ref_currency) {
-			// execute fetch
-			var df = wn.meta.get_docfield(row.doctype, "price_list", row.parent);
-			this.frm.script_manager.validate_link_and_fetch(df, row.name, row.price_list);
-		}
-	}
-});
-
-cur_frm.script_manager.make(erpnext.stock.Item);
-
 cur_frm.cscript.refresh = function(doc) {
 	// make sensitive fields(has_serial_no, is_stock_item, valuation_method)
 	// read only if any stock ledger entry exists
diff --git a/stock/doctype/item/item.py b/stock/doctype/item/item.py
index 391e4d5..7d6ecff 100644
--- a/stock/doctype/item/item.py
+++ b/stock/doctype/item/item.py
@@ -11,7 +11,6 @@
 
 from webnotes.model.controller import DocListController
 
-class PriceListCurrencyMismatch(Exception): pass
 class WarehouseNotSet(Exception): pass
 
 class DocType(DocListController):
@@ -32,9 +31,8 @@
 		self.check_stock_uom_with_bin()
 		self.add_default_uom_in_conversion_factor_table()
 		self.validate_conversion_factor()
-		self.valiadte_item_type()
+		self.validate_item_type()
 		self.check_for_active_boms()
-		self.validate_price_lists()
 		self.fill_customer_code()
 		self.check_item_tax()
 		self.validate_barcode()
@@ -77,8 +75,8 @@
 				bin_list = webnotes.conn.sql("select * from tabBin where item_code=%s", 
 					self.doc.item_code, as_dict=1)
 				for bin in bin_list:
-					if bin.reserved_qty > 0 or bin.ordered_qty > 0 or bin.indented_qty > 0 \
-						or bin.planned_qty > 0 and cstr(bin.stock_uom) != cstr(self.doc.stock_uom):
+					if (bin.reserved_qty > 0 or bin.ordered_qty > 0 or bin.indented_qty > 0 \
+						or bin.planned_qty > 0) and cstr(bin.stock_uom) != cstr(self.doc.stock_uom):
 							matched = False
 							break
 						
@@ -109,7 +107,7 @@
 					As UOM: %s is not Stock UOM of Item: %s""" % 
 					(d.uom, d.uom, self.doc.name)), raise_exception=1)
 					
-	def valiadte_item_type(self):
+	def validate_item_type(self):
 		if cstr(self.doc.is_manufactured_item) == "No":
 			self.doc.is_pro_applicable = "No"
 
@@ -147,22 +145,7 @@
 					'is_pro_applicable'		 :'Allow Production Order'}
 			for d in fl:
 				if cstr(self.doc.fields.get(d)) != 'Yes':
-					_check_for_active_boms(fl[d])
-			
-	def validate_price_lists(self):
-		price_lists=[]
-		for d in getlist(self.doclist,'ref_rate_details'):
-			if d.price_list in price_lists:
-				msgprint(_("Cannot have two prices for same Price List") + ": " + d.price_list,
-					raise_exception= webnotes.DuplicateEntryError)
-			else:
-				price_list_currency = webnotes.conn.get_value("Price List", d.price_list, "currency")
-				if price_list_currency and d.ref_currency != price_list_currency:
-					msgprint(_("Currency does not match Price List Currency for Price List") \
-						+ ": " + d.price_list, raise_exception=PriceListCurrencyMismatch)
-				
-				price_lists.append(d.price_list)
-			
+					_check_for_active_boms(fl[d])			
 					
 	def fill_customer_code(self):
 		""" Append all the customer codes and insert into "customer_code" field of item table """
@@ -227,7 +210,7 @@
 
 	def update_website(self):
 		def _invalidate_cache():
-			from website.helpers.product import invalidate_cache_for
+			from selling.utils.product import invalidate_cache_for
 			
 			invalidate_cache_for(self.doc.item_group)
 
@@ -257,13 +240,13 @@
 	def get_tax_rate(self, tax_type):
 		return { "tax_rate": webnotes.conn.get_value("Account", tax_type, "tax_rate") }
 
-	def prepare_template_args(self):
-		from website.helpers.product import get_parent_item_groups
+	def get_context(self):
+		from 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 website.helpers.slideshow import get_slideshow
+			from website.doctype.website_slideshow.website_slideshow import get_slideshow
 			get_slideshow(self)								
 
 	def get_file_details(self, arg = ''):
diff --git a/stock/doctype/item/item.txt b/stock/doctype/item/item.txt
index eb05503..c70b991 100644
--- a/stock/doctype/item/item.txt
+++ b/stock/doctype/item/item.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-05-03 10:45:46", 
   "docstatus": 0, 
-  "modified": "2013-08-30 16:21:38", 
+  "modified": "2013-09-11 11:50:10", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -627,25 +627,6 @@
  }, 
  {
   "doctype": "DocField", 
-  "fieldname": "price_list_section", 
-  "fieldtype": "Section Break", 
-  "label": "Price Lists and Rates", 
-  "options": "icon-money", 
-  "read_only": 0
- }, 
- {
-  "description": "Create a price list from Price List master and enter standard ref rates against each of them. On selection of a price list in Quotation, Sales Order or Delivery Note, corresponding ref rate will be fetched for this item.", 
-  "doctype": "DocField", 
-  "fieldname": "ref_rate_details", 
-  "fieldtype": "Table", 
-  "label": "Item Prices", 
-  "oldfieldname": "ref_rate_details", 
-  "oldfieldtype": "Table", 
-  "options": "Item Price", 
-  "read_only": 0
- }, 
- {
-  "doctype": "DocField", 
   "fieldname": "inspection_criteria", 
   "fieldtype": "Section Break", 
   "label": "Inspection Criteria", 
diff --git a/website/doctype/about_us_settings/__init__.py b/stock/doctype/item/templates/__init__.py
similarity index 100%
copy from website/doctype/about_us_settings/__init__.py
copy to stock/doctype/item/templates/__init__.py
diff --git a/website/doctype/about_us_settings/__init__.py b/stock/doctype/item/templates/generators/__init__.py
similarity index 100%
copy from website/doctype/about_us_settings/__init__.py
copy to stock/doctype/item/templates/generators/__init__.py
diff --git a/website/templates/html/product_page.html b/stock/doctype/item/templates/generators/item.html
similarity index 77%
rename from website/templates/html/product_page.html
rename to stock/doctype/item/templates/generators/item.html
index 5ac0b48..7056068 100644
--- a/website/templates/html/product_page.html
+++ b/stock/doctype/item/templates/generators/item.html
@@ -1,28 +1,32 @@
-{% extends "app/website/templates/html/page.html" %}
+{% extends base_template %}
 
 {% block javascript %}
-	{% include "app/website/templates/js/product_page.js" %}
+<script>
+	{% include "app/stock/doctype/item/templates/includes/product_page.js" %}
+</script>
 {% endblock %}
 
 {% block css %}
-	{% include "app/website/templates/css/product_page.css" %}
+<style>
+	{% include "app/stock/doctype/item/templates/includes/product_page.css" %}
+</style>
 {% endblock %}
 
 {% block content %}
-	{% include 'app/website/templates/html/product_search_box.html' %}
-	{% include 'app/website/templates/html/product_breadcrumbs.html' %}
+	{% include 'app/stock/doctype/item/templates/includes/product_search_box.html' %}
+	{% include 'app/stock/doctype/item/templates/includes/product_breadcrumbs.html' %}
 	<div class="col-md-12 product-page-content" itemscope itemtype="http://schema.org/Product">
 		<div class="row">
 			<div class="col-md-6">
 				{% if slideshow %}
-					{% include "app/website/templates/html/slideshow.html" %}
+					{% include "lib/website/doctype/website_slideshow/templates/includes/slideshow.html" %}
 				{% else %}
 					{% if website_image %}
 					<image itemprop="image" class="item-main-image"
 						src="{{ website_image }}" />
 					{% else %}
 					<div class="img-area">
-						{% include 'app/website/templates/html/product_missing_image.html' %}
+		{% include 'app/stock/doctype/item/templates/includes/product_missing_image.html' %}
 					</div>
 					{% endif %}
 				{% endif %}
diff --git a/stock/doctype/item/templates/generators/item.py b/stock/doctype/item/templates/generators/item.py
new file mode 100644
index 0000000..c9146d1
--- /dev/null
+++ b/stock/doctype/item/templates/generators/item.py
@@ -0,0 +1,2 @@
+doctype = "Item"
+condition_field = "show_in_website"
\ No newline at end of file
diff --git a/website/templates/html/product_breadcrumbs.html b/stock/doctype/item/templates/includes/product_breadcrumbs.html
similarity index 82%
rename from website/templates/html/product_breadcrumbs.html
rename to stock/doctype/item/templates/includes/product_breadcrumbs.html
index 6d26748..f073e6f 100644
--- a/website/templates/html/product_breadcrumbs.html
+++ b/stock/doctype/item/templates/includes/product_breadcrumbs.html
@@ -1,4 +1,4 @@
-{% if obj.parent_groups and len(obj.parent_groups) > 1 %}
+{% if obj.parent_groups and (obj.parent_groups|length) > 1 %}
 <div class="col-md-12">
 	<div class="clearfix">
 		<ul class="breadcrumb">
diff --git a/website/templates/html/product_in_grid.html b/stock/doctype/item/templates/includes/product_in_grid.html
similarity index 82%
rename from website/templates/html/product_in_grid.html
rename to stock/doctype/item/templates/includes/product_in_grid.html
index adb2f74..4271aaa 100644
--- a/website/templates/html/product_in_grid.html
+++ b/stock/doctype/item/templates/includes/product_in_grid.html
@@ -4,7 +4,7 @@
 		{%- if website_image -%}
 		<img class="product-image" style="width: 80%; margin: auto;" src="{{ website_image }}">
 		{%- else -%}
-		{% include 'app/website/templates/html/product_missing_image.html' %}
+		{% include 'app/stock/doctype/item/templates/includes/product_missing_image.html' %}
 		{%- endif -%}
 		</a>
 	</div>
diff --git a/website/templates/html/product_in_list.html b/stock/doctype/item/templates/includes/product_in_list.html
similarity index 100%
rename from website/templates/html/product_in_list.html
rename to stock/doctype/item/templates/includes/product_in_list.html
diff --git a/website/templates/js/product_list.js b/stock/doctype/item/templates/includes/product_list.js
similarity index 95%
rename from website/templates/js/product_list.js
rename to stock/doctype/item/templates/includes/product_list.js
index 729499c..2856bde 100644
--- a/website/templates/js/product_list.js
+++ b/stock/doctype/item/templates/includes/product_list.js
@@ -15,7 +15,7 @@
 		url: "server.py",
 		dataType: "json",
 		data: {
-			cmd: "website.helpers.product.get_product_list",
+			cmd: "selling.utils.product.get_product_list",
 			start: window.start,
 			search: window.search,
 			product_group: window.product_group
diff --git a/website/templates/html/product_missing_image.html b/stock/doctype/item/templates/includes/product_missing_image.html
similarity index 100%
rename from website/templates/html/product_missing_image.html
rename to stock/doctype/item/templates/includes/product_missing_image.html
diff --git a/website/templates/css/product_page.css b/stock/doctype/item/templates/includes/product_page.css
similarity index 100%
rename from website/templates/css/product_page.css
rename to stock/doctype/item/templates/includes/product_page.css
diff --git a/website/templates/js/product_page.js b/stock/doctype/item/templates/includes/product_page.js
similarity index 90%
rename from website/templates/js/product_page.js
rename to stock/doctype/item/templates/includes/product_page.js
index b8c65ec..6caa71d 100644
--- a/website/templates/js/product_page.js
+++ b/stock/doctype/item/templates/includes/product_page.js
@@ -2,12 +2,12 @@
 // License: GNU General Public License v3. See license.txt
 
 $(document).ready(function() {
-	var item_code = $('[itemscope] [itemprop="name"]').text().trim();
+	var item_code = $('[itemscope] [itemprop="productID"]').text().trim();
 	var qty = 0;
 	
 	wn.call({
 		type: "POST",
-		method: "website.helpers.product.get_product_info",
+		method: "selling.utils.product.get_product_info",
 		args: {
 			item_code: "{{ name }}"
 		},
@@ -36,7 +36,7 @@
 	})
 	
 	$("#item-add-to-cart button").on("click", function() {
-		wn.cart.update_cart({
+		erpnext.cart.update_cart({
 			item_code: item_code,
 			qty: 1,
 			callback: function(r) {
@@ -50,7 +50,7 @@
 	});
 	
 	$("#item-update-cart button").on("click", function() {
-		wn.cart.update_cart({
+		erpnext.cart.update_cart({
 			item_code: item_code,
 			qty: $("#item-update-cart input").val(),
 			btn: this,
diff --git a/website/templates/html/product_search_box.html b/stock/doctype/item/templates/includes/product_search_box.html
similarity index 95%
rename from website/templates/html/product_search_box.html
rename to stock/doctype/item/templates/includes/product_search_box.html
index d808bf6..b4fa3e8 100644
--- a/website/templates/html/product_search_box.html
+++ b/stock/doctype/item/templates/includes/product_search_box.html
@@ -1,4 +1,4 @@
-<div class="col-md-12 clearfix">
+<div class="row clearfix">
 	<div class="pull-right" style="margin-top: 15px; margin-bottom: 15px;">
 		<form class="form-search">
 			<div class="input-group col-md-4 col-md-offset-8">
diff --git a/website/doctype/about_us_settings/__init__.py b/stock/doctype/item/templates/pages/__init__.py
similarity index 100%
copy from website/doctype/about_us_settings/__init__.py
copy to stock/doctype/item/templates/pages/__init__.py
diff --git a/website/templates/pages/product_search.html b/stock/doctype/item/templates/pages/product_search.html
similarity index 75%
rename from website/templates/pages/product_search.html
rename to stock/doctype/item/templates/pages/product_search.html
index e969f75..9c6eeab 100644
--- a/website/templates/pages/product_search.html
+++ b/stock/doctype/item/templates/pages/product_search.html
@@ -1,9 +1,9 @@
-{% extends "app/website/templates/html/page.html" %}
+{% extends base_template %}
 
 {% set title="Product Search" %}
 
 {% block javascript %}
-{% include "app/website/templates/js/product_list.js" %}
+<script>{% include "app/stock/doctype/item/templates/includes/product_list.js" %}</script>
 {% endblock %}
 
 {% block content %}
@@ -17,7 +17,7 @@
 });
 </script>
 
-{% include 'app/website/templates/html/product_search_box.html' %}
+{% include "app/stock/doctype/item/templates/includes/product_search_box.html" %}
 <div class="col-md-12">
 	<h3 class="search-results">Search Results</h3>
 	<div id="search-list" class="row">
diff --git a/patches/may_2012/clear_session_cache.py b/stock/doctype/item/templates/pages/product_search.py
similarity index 65%
copy from patches/may_2012/clear_session_cache.py
copy to stock/doctype/item/templates/pages/product_search.py
index 3e63c3b..24b474a 100644
--- a/patches/may_2012/clear_session_cache.py
+++ b/stock/doctype/item/templates/pages/product_search.py
@@ -2,6 +2,5 @@
 # License: GNU General Public License v3. See license.txt
 
 from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.conn.sql("delete from __SessionCache")
\ No newline at end of file
+
+no_cache = True
\ No newline at end of file
diff --git a/stock/doctype/item/test_item.py b/stock/doctype/item/test_item.py
index 7be6ea5..12bb4e0 100644
--- a/stock/doctype/item/test_item.py
+++ b/stock/doctype/item/test_item.py
@@ -9,20 +9,6 @@
 test_dependencies = ["Warehouse"]
 
 class TestItem(unittest.TestCase):
-	def test_duplicate_price_list(self):
-		item = webnotes.bean(copy=test_records[0])
-		item.doc.item_code = "_Test Item 10"
-		item_price = item.doclist.get({"doctype": "Item Price"})[0]
-		item.doclist.append(webnotes.doc(item_price.fields.copy()))
-		self.assertRaises(webnotes.DuplicateEntryError, item.insert)
-
-	def test_price_list_mismatch(self):
-		from stock.doctype.item.item import PriceListCurrencyMismatch
-		item = webnotes.bean(copy=test_records[0])
-		item.doc.item_code = "_Test Item 11"
-		item_price = item.doclist.get({"doctype": "Item Price"})[0].ref_currency="USD"
-		self.assertRaises(PriceListCurrencyMismatch, item.insert)
-
 	def test_default_warehouse(self):
 		from stock.doctype.item.item import WarehouseNotSet
 		item = webnotes.bean(copy=test_records[0])
@@ -57,14 +43,7 @@
 		"warehouse_reorder_level": 20,
 		"warehouse_reorder_qty": 20,
 		"material_request_type": "Purchase"
-	}, {
-		"doctype": "Item Price",
-		"parentfield": "ref_rate_details",
-		"price_list": "_Test Price List",
-		"ref_rate": 100,
-		"ref_currency": "INR",
-		"buying_or_selling": "Selling"
-	}
+	},
 	],
 	[{
 		"doctype": "Item",
diff --git a/stock/doctype/item_price/item_price.py b/stock/doctype/item_price/item_price.py
deleted file mode 100644
index 26d0f76..0000000
--- a/stock/doctype/item_price/item_price.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. 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/stock/doctype/item_price/item_price.txt b/stock/doctype/item_price/item_price.txt
deleted file mode 100644
index 3a73a00..0000000
--- a/stock/doctype/item_price/item_price.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-[
- {
-  "creation": "2013-05-02 16:29:48", 
-  "docstatus": 0, 
-  "modified": "2013-08-09 14:46:58", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "autoname": "RFD/.#####", 
-  "doctype": "DocType", 
-  "in_create": 0, 
-  "istable": 1, 
-  "module": "Stock", 
-  "name": "__common__", 
-  "read_only": 0
- }, 
- {
-  "doctype": "DocField", 
-  "in_list_view": 1, 
-  "name": "__common__", 
-  "parent": "Item Price", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0
- }, 
- {
-  "doctype": "DocType", 
-  "name": "Item Price"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "price_list", 
-  "fieldtype": "Link", 
-  "in_filter": 1, 
-  "label": "Price List Name", 
-  "oldfieldname": "price_list_name", 
-  "oldfieldtype": "Select", 
-  "options": "Price List", 
-  "reqd": 1, 
-  "search_index": 1
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "ref_rate", 
-  "fieldtype": "Currency", 
-  "in_filter": 1, 
-  "label": "Ref Rate", 
-  "oldfieldname": "ref_rate", 
-  "oldfieldtype": "Currency", 
-  "options": "ref_currency", 
-  "reqd": 1, 
-  "search_index": 0
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "ref_currency", 
-  "fieldtype": "Link", 
-  "in_filter": 1, 
-  "label": "Currency", 
-  "oldfieldname": "ref_currency", 
-  "oldfieldtype": "Select", 
-  "options": "Currency", 
-  "read_only": 1, 
-  "reqd": 0, 
-  "search_index": 1
- }, 
- {
-  "default": "Selling", 
-  "doctype": "DocField", 
-  "fieldname": "buying_or_selling", 
-  "fieldtype": "Select", 
-  "label": "Valid for Buying or Selling?", 
-  "options": "Buying\nSelling", 
-  "read_only": 1, 
-  "reqd": 1
- }
-]
\ No newline at end of file
diff --git a/stock/doctype/stock_entry/stock_entry.py b/stock/doctype/stock_entry/stock_entry.py
index b1fbe81..f9de0b5 100644
--- a/stock/doctype/stock_entry/stock_entry.py
+++ b/stock/doctype/stock_entry/stock_entry.py
@@ -854,7 +854,8 @@
 			"account": r.get("account"),
 			"against_invoice": r.get("against_invoice"),
 			"against_voucher": r.get("against_voucher"),
-			"balance": get_balance_on(r.get("account"), se.doc.posting_date)
+			"balance": get_balance_on(r.get("account"), se.doc.posting_date) \
+				if r.get("account") else 0
 		})
 		
 	return jv_list
diff --git a/stock/report/item_prices/item_prices.py b/stock/report/item_prices/item_prices.py
index 0a6b29a..70c0677 100644
--- a/stock/report/item_prices/item_prices.py
+++ b/stock/report/item_prices/item_prices.py
@@ -23,8 +23,8 @@
 			item_map[item]["description"], item_map[item]["stock_uom"], 
 			flt(last_purchase_rate.get(item, 0), precision), 
 			flt(val_rate_map.get(item, 0), precision), 
-			pl.get(item, {}).get("selling"), 
-			pl.get(item, {}).get("buying"), 
+			pl.get(item, {}).get("Selling"), 
+			pl.get(item, {}).get("Buying"), 
 			flt(bom_rate.get(item, 0), precision), 
 			flt(item_map[item]["standard_rate"], precision)
 		])
@@ -56,24 +56,21 @@
 	"""Get selling & buying price list of every item"""
 
 	rate = {}
-	
-	price_list = webnotes.conn.sql("""select parent, selling, buying, 
-		concat(price_list, " - ", ref_currency, " ", ref_rate) as price
-		from `tabItem Price` where docstatus<2""", as_dict=1)
+
+	price_list = webnotes.conn.sql("""select ip.item_code, pl.buying_or_selling, 
+		concat(pl.name, " - ", pl.currency, " ", ip.ref_rate) as price 
+		from `tabItem Price` ip, `tabPrice List` pl where 
+		ip.parent = pl.name and pl.docstatus<2""", as_dict=1)
 
 	for j in price_list:
 		if j.price:
-			if j.selling:
-				rate.setdefault(j.parent, {}).setdefault("selling", []).append(j.price)
-			if j.buying:
-				rate.setdefault(j.parent, {}).setdefault("buying", []).append(j.price)
-
+			rate.setdefault(j.item_code, {}).setdefault(j.buying_or_selling, []).append(j.price)
 	item_rate_map = {}
 	
 	for item in rate:
-		item_rate_map.setdefault(item, {}).setdefault("selling", 
-			", ".join(rate[item].get("selling", [])))
-		item_rate_map[item]["buying"] = ", ".join(rate[item].get("buying", []))
+		for buying_or_selling in rate[item]:
+			item_rate_map.setdefault(item, {}).setdefault(buying_or_selling, 
+				", ".join(rate[item].get(buying_or_selling, [])))
 	
 	return item_rate_map
 
diff --git a/stock/report/item_wise_price_list/item_wise_price_list.txt b/stock/report/item_wise_price_list/item_wise_price_list.txt
index 2d5996a..b3d5717 100644
--- a/stock/report/item_wise_price_list/item_wise_price_list.txt
+++ b/stock/report/item_wise_price_list/item_wise_price_list.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-02-22 18:01:55", 
   "docstatus": 0, 
-  "modified": "2013-05-07 11:52:00", 
+  "modified": "2013-09-10 15:50:26", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -10,7 +10,7 @@
   "doctype": "Report", 
   "is_standard": "Yes", 
   "name": "__common__", 
-  "query": "select\n  item.name as \"ID:Link/Item:120\", \n  item.item_name as \"Item Name::120\", \n  item_price.price_list as \"Price List::80\",\n  item_price.ref_currency as \"Currency::40\", \n  item_price.ref_rate as \"Rate:Float:80\",\n  item.description as \"Description::160\",\n  item.item_group as \"Item Group:Link/Item Group:100\",\n  item.brand as \"Brand::100\"\nfrom `tabItem` item, `tabItem Price` item_price\nwhere\n  item_price.parent = item.name", 
+  "query": "select\n    item.name as \"ID:Link/Item:120\", \n    item.item_name as \"Item Name::120\", \n    item_price.parent as \"Price List::80\",\n    price_list.currency as \"Currency::40\", \n    item_price.ref_rate as \"Rate:Float:80\",\n    item.description as \"Description::160\",\n    item.item_group as \"Item Group:Link/Item Group:100\",\n    item.brand as \"Brand::100\"\nfrom `tabItem` item, `tabItem Price` item_price, `tabPrice List` price_list\nwhere\n    item_price.item_code = item.name and\n    item_price.parent = price_list.name", 
   "ref_doctype": "Item", 
   "report_name": "Item-Wise Price List", 
   "report_type": "Query Report"
diff --git a/support/doctype/support_ticket/get_support_mails.py b/support/doctype/support_ticket/get_support_mails.py
index fa4f304..4dcb59e 100644
--- a/support/doctype/support_ticket/get_support_mails.py
+++ b/support/doctype/support_ticket/get_support_mails.py
@@ -3,7 +3,7 @@
 
 from __future__ import unicode_literals
 import webnotes
-from webnotes.utils import cstr, cint, decode_dict
+from webnotes.utils import cstr, cint, decode_dict, today
 from webnotes.utils.email_lib import sendmail		
 from webnotes.utils.email_lib.receive import POP3Mailbox
 from core.doctype.communication.communication import make
@@ -22,32 +22,13 @@
 		if mail.from_email == self.email_settings.fields.get('support_email'):
 			return
 		thread_id = mail.get_thread_id()
-		ticket = None
 		new_ticket = False
 
-		if thread_id and webnotes.conn.exists("Support Ticket", thread_id):
-			ticket = webnotes.bean("Support Ticket", thread_id)
-			ticket.doc.status = 'Open'
-			ticket.doc.save()
-				
-		else:
-			ticket = webnotes.bean([decode_dict({
-				"doctype":"Support Ticket",
-				"description": mail.content,
-				"subject": mail.subject,
-				"raised_by": mail.from_email,
-				"content_type": mail.content_type,
-				"status": "Open",
-			})])
-						
-			ticket.insert()
+		if not (thread_id and webnotes.conn.exists("Support Ticket", thread_id)):
 			new_ticket = True
-
-		mail.save_attachments_in_doc(ticket.doc)
-				
-		make(content=mail.content, sender=mail.from_email, subject = ticket.doc.subject,
-			doctype="Support Ticket", name=ticket.doc.name,
-			date=mail.date)
+		
+		ticket = add_support_communication(mail.subject, mail.content, mail.from_email,
+			docname=None if new_ticket else thread_id, mail=mail)
 			
 		if new_ticket and cint(self.email_settings.send_autoreply) and \
 			"mailer-daemon" not in mail.from_email.lower():
@@ -78,4 +59,31 @@
 
 def get_support_mails():
 	if cint(webnotes.conn.get_value('Email Settings', None, 'sync_support_mails')):
-		SupportMailbox()
\ No newline at end of file
+		SupportMailbox()
+		
+def add_support_communication(subject, content, sender, docname=None, mail=None):
+	if docname:
+		ticket = webnotes.bean("Support Ticket", docname)
+		ticket.doc.status = 'Open'
+		ticket.ignore_permissions = True
+		ticket.doc.save()
+	else:
+		ticket = webnotes.bean([decode_dict({
+			"doctype":"Support Ticket",
+			"description": content,
+			"subject": subject,
+			"raised_by": sender,
+			"content_type": mail.content_type if mail else None,
+			"status": "Open",
+		})])
+		ticket.ignore_permissions = True
+		ticket.insert()
+	
+	make(content=content, sender=sender, subject = subject,
+		doctype="Support Ticket", name=ticket.doc.name,
+		date=mail.date if mail else today())
+
+	if mail:
+		mail.save_attachments_in_doc(ticket.doc)
+		
+	return ticket
\ No newline at end of file
diff --git a/support/doctype/support_ticket/support_ticket.py b/support/doctype/support_ticket/support_ticket.py
index 5c38cc1..bf2a9fb 100644
--- a/support/doctype/support_ticket/support_ticket.py
+++ b/support/doctype/support_ticket/support_ticket.py
@@ -24,6 +24,9 @@
 		if signature:
 			content += '<p>' + signature + '</p>'
 		return content
+		
+	def get_portal_page(self):
+		return "ticket"
 	
 	def validate(self):
 		self.update_status()
@@ -72,18 +75,4 @@
 def set_status(name, status):
 	st = webnotes.bean("Support Ticket", name)
 	st.doc.status = status
-	st.save()
-
-def get_website_args():
-	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
-		}
+	st.save()
\ No newline at end of file
diff --git a/website/doctype/about_us_settings/__init__.py b/support/doctype/support_ticket/templates/__init__.py
similarity index 100%
copy from website/doctype/about_us_settings/__init__.py
copy to support/doctype/support_ticket/templates/__init__.py
diff --git a/website/doctype/about_us_settings/__init__.py b/support/doctype/support_ticket/templates/pages/__init__.py
similarity index 100%
copy from website/doctype/about_us_settings/__init__.py
copy to support/doctype/support_ticket/templates/pages/__init__.py
diff --git a/support/doctype/support_ticket/templates/pages/ticket.html b/support/doctype/support_ticket/templates/pages/ticket.html
new file mode 100644
index 0000000..4b41dc2
--- /dev/null
+++ b/support/doctype/support_ticket/templates/pages/ticket.html
@@ -0,0 +1,121 @@
+{% extends base_template %}
+
+{% set title=doc.name %}
+
+{% set status_label = {
+	"Open": "label-success",
+	"To Reply": "label-danger",
+	"Closed": "label-default"
+} %}
+
+{% block content %}
+<div class="col-md-12">
+    <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/support/doctype/support_ticket/templates/pages/ticket.py b/support/doctype/support_ticket/templates/pages/ticket.py
new file mode 100644
index 0000000..ce3100f
--- /dev/null
+++ b/support/doctype/support_ticket/templates/pages/ticket.py
@@ -0,0 +1,37 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# 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 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/support/doctype/support_ticket/templates/pages/tickets.html b/support/doctype/support_ticket/templates/pages/tickets.html
new file mode 100644
index 0000000..d99e614
--- /dev/null
+++ b/support/doctype/support_ticket/templates/pages/tickets.html
@@ -0,0 +1,87 @@
+{% extends "app/portal/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/support/doctype/support_ticket/templates/pages/tickets.py b/support/doctype/support_ticket/templates/pages/tickets.py
new file mode 100644
index 0000000..dd2e52e
--- /dev/null
+++ b/support/doctype/support_ticket/templates/pages/tickets.py
@@ -0,0 +1,38 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# 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 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/utilities/demo/demo_control_panel.py b/utilities/demo/demo_control_panel.py
index c70913e..1f381d5 100644
--- a/utilities/demo/demo_control_panel.py
+++ b/utilities/demo/demo_control_panel.py
@@ -1,13 +1,13 @@
 
   def on_login(self):
     from webnotes.utils import validate_email_add
-	import conf
-	if hasattr(conf, "demo_notify_url"):
+    import conf
+    if hasattr(conf, "demo_notify_url"):
       if webnotes.form_dict.lead_email and validate_email_add(webnotes.form_dict.lead_email):
         import requests
         response = requests.post(conf.demo_notify_url, data={
-          "cmd":"website.helpers.contact.send_message",
+          "cmd":"portal.utils.send_message",
           "subject":"Logged into Demo",
           "sender": webnotes.form_dict.lead_email,
           "message": "via demo.erpnext.com"
-        })
+        })
\ No newline at end of file
diff --git a/utilities/demo/demo_docs/BOM.csv b/utilities/demo/demo_docs/BOM.csv
index 446fc2e..ab0d6f5 100644
--- a/utilities/demo/demo_docs/BOM.csv
+++ b/utilities/demo/demo_docs/BOM.csv
@@ -1,47 +1,47 @@
-Data Import Template,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-Table:,BOM,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-Notes:,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-Please do not change the template headings.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-First data column must be blank.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-"If you are uploading new records, leave the ""name"" (ID) column blank.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-"If you are uploading new records, ""Naming Series"" becomes mandatory, if present.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-"For updating, you can update only selective columns.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-DocType:,BOM,,,,,,,,,,,,,,,,-,BOM Operation,bom_operations,,,,,,-,BOM Item,bom_materials,,,,,,,,,-,BOM Explosion Item,flat_bom_details,,,,,,

-Column Labels:,ID,Last Updated On,Item,Quantity,Is Active,Is Default,With Operations,Rate Of Materials Based On,Price List,Total Cost,Total Raw Material Cost,Total Operating Cost,Item UOM,Project Name,Item Desription,Amended From,-,ID,Operation No,Operation Description,Workstation,Hour Rate,Operation Time (mins),Operating Cost,-,ID,Item Code,Qty,Stock UOM,Operation No,BOM No,Rate,Amount,Scrap %,Item Description,-,ID,Item Code,Description,Qty,Rate,Amount,Stock UOM,Qty Consumed Per Unit

-Column Name:,name,modified,item,quantity,is_active,is_default,with_operations,rm_cost_as_per,buying_price_list,total_cost,raw_material_cost,operating_cost,uom,project_name,description,amended_from,-,name,operation_no,opn_description,workstation,hour_rate,time_in_mins,operating_cost,-,name,item_code,qty,stock_uom,operation_no,bom_no,rate,amount,scrap,description,-,name,item_code,description,qty,rate,amount,stock_uom,qty_consumed_per_unit

-Mandatory:,Yes,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No,No,No,No,-,Yes,Yes,Yes,No,No,No,No,-,Yes,Yes,Yes,Yes,No,No,No,No,No,No,-,Yes,No,No,No,No,No,No,No

-Type:,Data (text),Data,Link,Float,Check,Check,Check,Select,Link,Float,Float,Float,Select,Link,Small Text,Link,-,Data,Data,Text,Link,Float,Float,Float,-,Data,Link,Float,Link,Select,Link,Float,Float,Float,Text,-,Data,Link,Text,Float,Float,Float,Link,Float

-Info:,,Don't change!,Valid Item,,0 or 1,0 or 1,0 or 1,"One of: Valuation Rate, Last Purchase Rate, Price List",Valid Price List,,,,Valid UOM,Valid Project,,Valid BOM,-,Leave blank for new records,,,Valid Workstation,,,,-,Leave blank for new records,Valid Item,,Valid UOM,,Valid BOM,,,,,-,Leave blank for new records,Valid Item,,,,,Valid UOM,

-Start entering data below this line,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-,BOM/Bearing Assembly/001,"""2013-08-07 16:58:00""",Bearing Assembly,1.0,1,1,,Price List,Standard Buying,130.0,130.0,0.0,Nos,,Bearing Assembly,,,,,,,,,,,183,Base Bearing Plate,1.0,Nos,,,15.0,15.0,,1/4 in. x 6 in. x 6 in. Mild Steel Plate,,FBD/000039,Bearing Pipe,1.5 in. Diameter x 36 in. Mild Steel Tubing,1.0,15.0,15.0,Nos,1.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,184,Bearing Block,1.0,Nos,,,10.0,10.0,,"CAST IRON, MCMASTER PART NO. 3710T13",,FBD/000040,Bearing Collar,1 in. x 3 in. x 1 ft. Multipurpose Al Alloy Bar,2.0,20.0,40.0,Nos,2.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,185,Bearing Collar,2.0,Nos,,,20.0,40.0,,1 in. x 3 in. x 1 ft. Multipurpose Al Alloy Bar,,FBD/000041,Bearing Block,"CAST IRON, MCMASTER PART NO. 3710T13",1.0,10.0,10.0,Nos,1.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,186,Bearing Pipe,1.0,Nos,,,15.0,15.0,,1.5 in. Diameter x 36 in. Mild Steel Tubing,,FBD/000042,Upper Bearing Plate,3/16 in. x 6 in. x 6 in. Low Carbon Steel Plate,1.0,50.0,50.0,Nos,1.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,187,Upper Bearing Plate,1.0,Nos,,,50.0,50.0,,3/16 in. x 6 in. x 6 in. Low Carbon Steel Plate,,FBD/000043,Base Bearing Plate,1/4 in. x 6 in. x 6 in. Mild Steel Plate,1.0,15.0,15.0,Nos,1.0

-,BOM/Wind Mill A Series/001,"""2013-08-07 16:47:02""",Wind Mill A Series,1.0,1,1,,Price List,Standard Buying,223.0,223.0,0.0,Nos,,Wind Mill A Series for Home Use 9ft,,,,,,,,,,,163,Base Bearing Plate,1.0,Nos,,,15.0,15.0,,1/4 in. x 6 in. x 6 in. Mild Steel Plate,,FBD/000008,Shaft,1.25 in. Diameter x 6 ft. Mild Steel Tubing,1.0,30.0,30.0,Nos,1.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,164,Base Plate,1.0,Nos,,,20.0,20.0,,3/4 in. x 2 ft. x 4 ft. Pine Plywood,,FBD/000009,Base Bearing Plate,1/4 in. x 6 in. x 6 in. Mild Steel Plate,1.0,15.0,15.0,Nos,1.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,165,Bearing Block,1.0,Nos,,,10.0,10.0,,"CAST IRON, MCMASTER PART NO. 3710T13",,FBD/000010,External Disc,15/32 in. x 4 ft. x 8 ft. 3-Ply Rtd Sheathing,1.0,45.0,45.0,Nos,1.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,166,Bearing Pipe,1.0,Nos,,,15.0,15.0,,1.5 in. Diameter x 36 in. Mild Steel Tubing,,FBD/000011,Bearing Pipe,1.5 in. Diameter x 36 in. Mild Steel Tubing,1.0,15.0,15.0,Nos,1.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,167,External Disc,1.0,Nos,,,45.0,45.0,,15/32 in. x 4 ft. x 8 ft. 3-Ply Rtd Sheathing,,FBD/000012,Wing Sheet,1/32 in. x 24 in. x 47 in. HDPE Opaque Sheet,4.0,22.0,88.0,Nos,4.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,168,Shaft,1.0,Nos,,,30.0,30.0,,1.25 in. Diameter x 6 ft. Mild Steel Tubing,,FBD/000013,Base Plate,3/4 in. x 2 ft. x 4 ft. Pine Plywood,1.0,20.0,20.0,Nos,1.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,169,Wing Sheet,4.0,Nos,,,22.0,88.0,,1/32 in. x 24 in. x 47 in. HDPE Opaque Sheet,,FBD/000014,Bearing Block,"CAST IRON, MCMASTER PART NO. 3710T13",1.0,10.0,10.0,Nos,1.0

-,BOM/Wind MIll C Series/001,"""2013-08-07 16:58:51""",Wind MIll C Series,1.0,1,1,,Price List,Standard Buying,314.0,314.0,0.0,Nos,,Wind Mill C Series for Commercial Use 18ft,,,,,,,,,,,176,Base Plate,2.0,Nos,,,20.0,40.0,,3/4 in. x 2 ft. x 4 ft. Pine Plywood,,FBD/000061,Base Bearing Plate,1/4 in. x 6 in. x 6 in. Mild Steel Plate,1.0,15.0,15.0,Nos,1.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,178,Internal Disc,1.0,Nos,,,33.0,33.0,,For Bearing Collar,,FBD/000062,Bearing Collar,1 in. x 3 in. x 1 ft. Multipurpose Al Alloy Bar,2.0,20.0,40.0,Nos,2.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,179,External Disc,1.0,Nos,,,45.0,45.0,,15/32 in. x 4 ft. x 8 ft. 3-Ply Rtd Sheathing,,FBD/000063,Base Plate,3/4 in. x 2 ft. x 4 ft. Pine Plywood,2.0,20.0,40.0,Nos,2.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,188,Bearing Assembly,1.0,Nos,,BOM/Bearing Assembly/001,130.0,130.0,,Bearing Assembly,,FBD/000064,Bearing Pipe,1.5 in. Diameter x 36 in. Mild Steel Tubing,1.0,15.0,15.0,Nos,1.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,189,Wing Sheet,3.0,Nos,,,22.0,66.0,,1/32 in. x 24 in. x 47 in. HDPE Opaque Sheet,,FBD/000065,Internal Disc,For Bearing Collar,1.0,33.0,33.0,Nos,1.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,FBD/000066,Upper Bearing Plate,3/16 in. x 6 in. x 6 in. Low Carbon Steel Plate,1.0,50.0,50.0,Nos,1.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,FBD/000067,Wing Sheet,1/32 in. x 24 in. x 47 in. HDPE Opaque Sheet,3.0,22.0,66.0,Nos,3.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,FBD/000068,External Disc,15/32 in. x 4 ft. x 8 ft. 3-Ply Rtd Sheathing,1.0,45.0,45.0,Nos,1.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,FBD/000069,Bearing Block,"CAST IRON, MCMASTER PART NO. 3710T13",1.0,10.0,10.0,Nos,1.0

-,BOM/Wind Turbine/001,"""2013-08-07 16:51:56""",Wind Turbine,1.0,1,1,,Price List,Standard Buying,139.0,139.0,0.0,Nos,,Small Wind Turbine for Home Use,,,,,,,,,,,170,Base Bearing Plate,1.0,Nos,,,15.0,15.0,,1/4 in. x 6 in. x 6 in. Mild Steel Plate,,FBD/000021,Shaft,1.25 in. Diameter x 6 ft. Mild Steel Tubing,1.0,30.0,30.0,Nos,1.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,171,Base Plate,1.0,Nos,,,20.0,20.0,,3/4 in. x 2 ft. x 4 ft. Pine Plywood,,FBD/000022,Bearing Collar,1 in. x 3 in. x 1 ft. Multipurpose Al Alloy Bar,1.0,20.0,20.0,Nos,1.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,172,Bearing Collar,1.0,Nos,,,20.0,20.0,,1 in. x 3 in. x 1 ft. Multipurpose Al Alloy Bar,,FBD/000023,Base Plate,3/4 in. x 2 ft. x 4 ft. Pine Plywood,1.0,20.0,20.0,Nos,1.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,173,Blade Rib,1.0,Nos,,,10.0,10.0,,1/2 in. x 2 ft. x 4 ft. Pine Plywood,,FBD/000024,Base Bearing Plate,1/4 in. x 6 in. x 6 in. Mild Steel Plate,1.0,15.0,15.0,Nos,1.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,174,Shaft,1.0,Nos,,,30.0,30.0,,1.25 in. Diameter x 6 ft. Mild Steel Tubing,,FBD/000025,Blade Rib,1/2 in. x 2 ft. x 4 ft. Pine Plywood,1.0,10.0,10.0,Nos,1.0

-,,,,,,,,,,,,,,,,,,,,,,,,,,175,Wing Sheet,2.0,Nos,,,22.0,44.0,,1/32 in. x 24 in. x 47 in. HDPE Opaque Sheet,,FBD/000026,Wing Sheet,1/32 in. x 24 in. x 47 in. HDPE Opaque Sheet,2.0,22.0,44.0,Nos,2.0
\ No newline at end of file
+Data Import Template,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+Table:,BOM,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+Notes:,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+Please do not change the template headings.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+First data column must be blank.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+"If you are uploading new records, leave the ""name"" (ID) column blank.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+"If you are uploading new records, ""Naming Series"" becomes mandatory, if present.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+"For updating, you can update only selective columns.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+DocType:,BOM,,,,,,,,,,,,,,,~,BOM Operation,bom_operations,,,,,,~,BOM Item,bom_materials,,,,,,,,,~,BOM Explosion Item,flat_bom_details,,,,,,
+Column Labels:,ID,Item,Quantity,Is Active,Is Default,With Operations,Rate Of Materials Based On,Price List,Total Cost,Total Raw Material Cost,Total Operating Cost,Item UOM,Project Name,Item Desription,Amended From,,ID,Operation No,Operation Description,Workstation,Hour Rate,Operation Time (mins),Operating Cost,,ID,Item Code,Qty,Stock UOM,Operation No,BOM No,Rate,Amount,Scrap %,Item Description,,ID,Item Code,Description,Qty,Rate,Amount,Stock UOM,Qty Consumed Per Unit
+Column Name:,name,item,quantity,is_active,is_default,with_operations,rm_cost_as_per,buying_price_list,total_cost,raw_material_cost,operating_cost,uom,project_name,description,amended_from,~,name,operation_no,opn_description,workstation,hour_rate,time_in_mins,operating_cost,~,name,item_code,qty,stock_uom,operation_no,bom_no,rate,amount,scrap,description,~,name,item_code,description,qty,rate,amount,stock_uom,qty_consumed_per_unit
+Mandatory:,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No,No,No,No,,Yes,Yes,Yes,No,No,No,No,,Yes,Yes,Yes,Yes,No,No,No,No,No,No,,Yes,No,No,No,No,No,No,No
+Type:,Data (text),Link,Float,Check,Check,Check,Select,Link,Float,Float,Float,Select,Link,Small Text,Link,,Data,Data,Text,Link,Float,Float,Float,,Data,Link,Float,Link,Select,Link,Float,Float,Float,Text,,Data,Link,Text,Float,Float,Float,Link,Float
+Info:,,Valid Item,,0 or 1,0 or 1,0 or 1,"One of: Valuation Rate, Last Purchase Rate, Price List",Valid Price List,,,,Valid UOM,Valid Project,,Valid BOM,,Leave blank for new records,,,Valid Workstation,,,,,Leave blank for new records,Valid Item,,Valid UOM,,Valid BOM,,,,,,Leave blank for new records,Valid Item,,,,,Valid UOM,
+Start entering data below this line,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+,BOM/Bearing Assembly/001,Bearing Assembly,1,1,1,,Price List,Standard Buying,130,130,0,Nos,,Bearing Assembly,,,,,,,,,,,,Base Bearing Plate,1,Nos,,,15,15,,1/4 in. x 6 in. x 6 in. Mild Steel Plate,,,Bearing Pipe,1.5 in. Diameter x 36 in. Mild Steel Tubing,1,15,15,Nos,1
+,,,,,,,,,,,,,,,,,,,,,,,,,,Bearing Block,1,Nos,,,10,10,,"CAST IRON, MCMASTER PART NO. 3710T13",,,Bearing Collar,1 in. x 3 in. x 1 ft. Multipurpose Al Alloy Bar,2,20,40,Nos,2
+,,,,,,,,,,,,,,,,,,,,,,,,,,Bearing Collar,2,Nos,,,20,40,,1 in. x 3 in. x 1 ft. Multipurpose Al Alloy Bar,,,Bearing Block,"CAST IRON, MCMASTER PART NO. 3710T13",1,10,10,Nos,1
+,,,,,,,,,,,,,,,,,,,,,,,,,,Bearing Pipe,1,Nos,,,15,15,,1.5 in. Diameter x 36 in. Mild Steel Tubing,,,Upper Bearing Plate,3/16 in. x 6 in. x 6 in. Low Carbon Steel Plate,1,50,50,Nos,1
+,,,,,,,,,,,,,,,,,,,,,,,,,,Upper Bearing Plate,1,Nos,,,50,50,,3/16 in. x 6 in. x 6 in. Low Carbon Steel Plate,,,Base Bearing Plate,1/4 in. x 6 in. x 6 in. Mild Steel Plate,1,15,15,Nos,1
+,BOM/Wind Mill A Series/001,Wind Mill A Series,1,1,1,,Price List,Standard Buying,223,223,0,Nos,,Wind Mill A Series for Home Use 9ft,,,,,,,,,,,,Base Bearing Plate,1,Nos,,,15,15,,1/4 in. x 6 in. x 6 in. Mild Steel Plate,,,Shaft,1.25 in. Diameter x 6 ft. Mild Steel Tubing,1,30,30,Nos,1
+,,,,,,,,,,,,,,,,,,,,,,,,,,Base Plate,1,Nos,,,20,20,,3/4 in. x 2 ft. x 4 ft. Pine Plywood,,,Base Bearing Plate,1/4 in. x 6 in. x 6 in. Mild Steel Plate,1,15,15,Nos,1
+,,,,,,,,,,,,,,,,,,,,,,,,,,Bearing Block,1,Nos,,,10,10,,"CAST IRON, MCMASTER PART NO. 3710T13",,,External Disc,15/32 in. x 4 ft. x 8 ft. 3-Ply Rtd Sheathing,1,45,45,Nos,1
+,,,,,,,,,,,,,,,,,,,,,,,,,,Bearing Pipe,1,Nos,,,15,15,,1.5 in. Diameter x 36 in. Mild Steel Tubing,,,Bearing Pipe,1.5 in. Diameter x 36 in. Mild Steel Tubing,1,15,15,Nos,1
+,,,,,,,,,,,,,,,,,,,,,,,,,,External Disc,1,Nos,,,45,45,,15/32 in. x 4 ft. x 8 ft. 3-Ply Rtd Sheathing,,,Wing Sheet,1/32 in. x 24 in. x 47 in. HDPE Opaque Sheet,4,22,88,Nos,4
+,,,,,,,,,,,,,,,,,,,,,,,,,,Shaft,1,Nos,,,30,30,,1.25 in. Diameter x 6 ft. Mild Steel Tubing,,,Base Plate,3/4 in. x 2 ft. x 4 ft. Pine Plywood,1,20,20,Nos,1
+,,,,,,,,,,,,,,,,,,,,,,,,,,Wing Sheet,4,Nos,,,22,88,,1/32 in. x 24 in. x 47 in. HDPE Opaque Sheet,,,Bearing Block,"CAST IRON, MCMASTER PART NO. 3710T13",1,10,10,Nos,1
+,BOM/Wind MIll C Series/001,Wind MIll C Series,1,1,1,,Price List,Standard Buying,314,314,0,Nos,,Wind Mill C Series for Commercial Use 18ft,,,,,,,,,,,,Base Plate,2,Nos,,,20,40,,3/4 in. x 2 ft. x 4 ft. Pine Plywood,,,Base Bearing Plate,1/4 in. x 6 in. x 6 in. Mild Steel Plate,1,15,15,Nos,1
+,,,,,,,,,,,,,,,,,,,,,,,,,,Internal Disc,1,Nos,,,33,33,,For Bearing Collar,,,Bearing Collar,1 in. x 3 in. x 1 ft. Multipurpose Al Alloy Bar,2,20,40,Nos,2
+,,,,,,,,,,,,,,,,,,,,,,,,,,External Disc,1,Nos,,,45,45,,15/32 in. x 4 ft. x 8 ft. 3-Ply Rtd Sheathing,,,Base Plate,3/4 in. x 2 ft. x 4 ft. Pine Plywood,2,20,40,Nos,2
+,,,,,,,,,,,,,,,,,,,,,,,,,,Bearing Assembly,1,Nos,,BOM/Bearing Assembly/001,130,130,,Bearing Assembly,,,Bearing Pipe,1.5 in. Diameter x 36 in. Mild Steel Tubing,1,15,15,Nos,1
+,,,,,,,,,,,,,,,,,,,,,,,,,,Wing Sheet,3,Nos,,,22,66,,1/32 in. x 24 in. x 47 in. HDPE Opaque Sheet,,,Internal Disc,For Bearing Collar,1,33,33,Nos,1
+,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Upper Bearing Plate,3/16 in. x 6 in. x 6 in. Low Carbon Steel Plate,1,50,50,Nos,1
+,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Wing Sheet,1/32 in. x 24 in. x 47 in. HDPE Opaque Sheet,3,22,66,Nos,3
+,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,External Disc,15/32 in. x 4 ft. x 8 ft. 3-Ply Rtd Sheathing,1,45,45,Nos,1
+,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Bearing Block,"CAST IRON, MCMASTER PART NO. 3710T13",1,10,10,Nos,1
+,BOM/Wind Turbine/001,Wind Turbine,1,1,1,,Price List,Standard Buying,139,139,0,Nos,,Small Wind Turbine for Home Use,,,,,,,,,,,,Base Bearing Plate,1,Nos,,,15,15,,1/4 in. x 6 in. x 6 in. Mild Steel Plate,,,Shaft,1.25 in. Diameter x 6 ft. Mild Steel Tubing,1,30,30,Nos,1
+,,,,,,,,,,,,,,,,,,,,,,,,,,Base Plate,1,Nos,,,20,20,,3/4 in. x 2 ft. x 4 ft. Pine Plywood,,,Bearing Collar,1 in. x 3 in. x 1 ft. Multipurpose Al Alloy Bar,1,20,20,Nos,1
+,,,,,,,,,,,,,,,,,,,,,,,,,,Bearing Collar,1,Nos,,,20,20,,1 in. x 3 in. x 1 ft. Multipurpose Al Alloy Bar,,,Base Plate,3/4 in. x 2 ft. x 4 ft. Pine Plywood,1,20,20,Nos,1
+,,,,,,,,,,,,,,,,,,,,,,,,,,Blade Rib,1,Nos,,,10,10,,1/2 in. x 2 ft. x 4 ft. Pine Plywood,,,Base Bearing Plate,1/4 in. x 6 in. x 6 in. Mild Steel Plate,1,15,15,Nos,1
+,,,,,,,,,,,,,,,,,,,,,,,,,,Shaft,1,Nos,,,30,30,,1.25 in. Diameter x 6 ft. Mild Steel Tubing,,,Blade Rib,1/2 in. x 2 ft. x 4 ft. Pine Plywood,1,10,10,Nos,1
+,,,,,,,,,,,,,,,,,,,,,,,,,,Wing Sheet,2,Nos,,,22,44,,1/32 in. x 24 in. x 47 in. HDPE Opaque Sheet,,,Wing Sheet,1/32 in. x 24 in. x 47 in. HDPE Opaque Sheet,2,22,44,Nos,2
diff --git a/utilities/demo/demo_docs/Item.csv b/utilities/demo/demo_docs/Item.csv
index ff61c5f..eeb18c5 100644
--- a/utilities/demo/demo_docs/Item.csv
+++ b/utilities/demo/demo_docs/Item.csv
@@ -1,50 +1,37 @@
-Data Import Template,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-Table:,Item,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-Notes:,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-Please do not change the template headings.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-First data column must be blank.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-"If you are uploading new records, leave the ""name"" (ID) column blank.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-"If you are uploading new records, ""Naming Series"" becomes mandatory, if present.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-"For updating, you can update only selective columns.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-DocType:,Item,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,-,Item Reorder,item_reorder,,,,-,UOM Conversion Detail,uom_conversion_details,,-,Item Supplier,item_supplier_details,,-,Item Customer Detail,item_customer_details,,-,Item Tax,item_tax,,-,Item Price,ref_rate_details,,,,-,Item Quality Inspection Parameter,item_specification_details,,-,Website Item Group,website_item_groups,-,Item Website Specification,item_website_specifications,

-Column Labels:,ID,Last Updated On,Item Name,Item Group,Default Unit of Measure,Description,Is Stock Item,Is Asset Item,Has Batch No,Has Serial No,Is Purchase Item,Is Sales Item,Is Service Item,Inspection Required,Allow Bill of Materials,Allow Production Order,Is Sub Contracted Item,Document Numbering Series,Item Code,Brand,Barcode,Image,Description HTML,Default Warehouse,Allowance Percent,Valuation Method,Minimum Order Qty,Serial Number Series,Warranty Period (in days),End of Life,Net Weight,Weight UOM,Re-Order Level,Re-Order Qty,Default Supplier,Lead Time Days,Default Expense Account,Default Cost Center,Last Purchase Rate,Standard Rate,Manufacturer,Manufacturer Part Number,Max Discount (%),Default Income Account,Cost Center,Default BOM,Show in Website,Page Name,Weightage,Slideshow,Image,Website Warehouse,Website Description,-,ID,Warehouse,Re-order Level,Material Request Type,Re-order Qty,-,ID,UOM,Conversion Factor,-,ID,Supplier,Supplier Part Number,-,ID,Customer Name,Ref Code,-,ID,Tax,Tax Rate,-,ID,Price List Name,Ref Rate,Valid for Buying or Selling?,Currency,-,ID,Parameter,Acceptance Criteria,-,ID,Item Group,-,ID,Label,Description

-Column Name:,name,modified,item_name,item_group,stock_uom,description,is_stock_item,is_asset_item,has_batch_no,has_serial_no,is_purchase_item,is_sales_item,is_service_item,inspection_required,is_manufactured_item,is_pro_applicable,is_sub_contracted_item,naming_series,item_code,brand,barcode,image,description_html,default_warehouse,tolerance,valuation_method,min_order_qty,serial_no_series,warranty_period,end_of_life,net_weight,weight_uom,re_order_level,re_order_qty,default_supplier,lead_time_days,purchase_account,cost_center,last_purchase_rate,standard_rate,manufacturer,manufacturer_part_no,max_discount,default_income_account,default_sales_cost_center,default_bom,show_in_website,page_name,weightage,slideshow,website_image,website_warehouse,web_long_description,-,name,warehouse,warehouse_reorder_level,material_request_type,warehouse_reorder_qty,-,name,uom,conversion_factor,-,name,supplier,supplier_part_no,-,name,customer_name,ref_code,-,name,tax_type,tax_rate,-,name,price_list,ref_rate,buying_or_selling,ref_currency,-,name,specification,value,-,name,item_group,-,name,label,description

-Mandatory:,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,-,Yes,Yes,Yes,Yes,No,-,Yes,No,No,-,Yes,No,No,-,Yes,Yes,Yes,-,Yes,Yes,No,-,Yes,Yes,Yes,Yes,No,-,Yes,Yes,No,-,Yes,No,-,Yes,No,No

-Type:,Data (text),Data,Data,Link,Link,Small Text,Select,Select,Select,Select,Select,Select,Select,Select,Select,Select,Select,Select,Data,Link,Data,Select,Small Text,Link,Float,Select,Float,Data,Data,Date,Float,Link,Float,Float,Link,Int,Link,Link,Float,Float,Data,Data,Float,Link,Link,Link,Check,Data,Int,Link,Select,Link,Text Editor,-,Data,Link,Float,Select,Float,-,Data,Link,Float,-,Data,Link,Data,-,Data,Link,Data,-,Data,Link,Float,-,Data,Link,Currency,Select,Link,-,Data,Data,Data,-,Data,Link,-,Data,Data,Text

-Info:,,Don't change!,,Valid Item Group,Valid UOM,,"One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No",One of: ITEM,,Valid Brand,,One of: attach_files:,,Valid Warehouse,,"One of: FIFO, Moving Average",,,,,,Valid UOM,,,Valid Supplier,Integer,Valid Account,Valid Cost Center,,,,,,Valid Account,Valid Cost Center,Valid BOM,0 or 1,,Integer,Valid Website Slideshow,One of: attach_files:,Valid Warehouse,,-,Leave blank for new records,Valid Warehouse,,"One of: Purchase, Transfer",,-,Leave blank for new records,Valid UOM,,-,Leave blank for new records,Valid Supplier,,-,Leave blank for new records,Valid Customer,,-,Leave blank for new records,Valid Account,,-,Leave blank for new records,Valid Price List,,"One of: Buying, Selling",Valid Currency,-,Leave blank for new records,,,-,Leave blank for new records,Valid Item Group,-,Leave blank for new records,,

-Start entering data below this line,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-,Base Bearing Plate,"""2013-08-20 11:11:53""",Base Bearing Plate,Raw Material,Nos,1/4 in. x 6 in. x 6 in. Mild Steel Plate,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Base Bearing Plate,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,Eagle Hardware,0,,,15.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00001,Nos,1.0,,,,,,,,,,,,,,RFD/00001,Standard Buying,15.0,Buying,USD,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00017,Standard Selling,21.0,Selling,USD,,,,,,,,,,,

-,Base Plate,"""2013-08-20 11:11:53""",Base Plate,Raw Material,Nos,3/4 in. x 2 ft. x 4 ft. Pine Plywood,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Base Plate,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,HomeBase,0,,,20.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00002,Nos,1.0,,,,,,,,,,,,,,RFD/00002,Standard Buying,20.0,Buying,USD,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00018,Standard Selling,28.0,Selling,USD,,,,,,,,,,,

-,Bearing Assembly,"""2013-08-20 11:11:55""",Bearing Assembly,Sub Assemblies,Nos,Bearing Assembly,Yes,No,No,No,No,Yes,No,No,Yes,Yes,No,,Bearing Assembly,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,Asiatic Solutions,0,,,0.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00003,Nos,1.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

-,Bearing Block,"""2013-08-20 11:11:54""",Bearing Block,Raw Material,Nos,"CAST IRON, MCMASTER PART NO. 3710T13",Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Bearing Block,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,Nan Duskin,0,,,10.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00004,Nos,1.0,,,,,,,,,,,,,,RFD/00003,Standard Buying,10.0,Buying,USD,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00019,Standard Selling,14.0,Selling,USD,,,,,,,,,,,

-,Bearing Collar,"""2013-08-20 11:11:54""",Bearing Collar,Raw Material,Nos,1 in. x 3 in. x 1 ft. Multipurpose Al Alloy Bar,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Bearing Collar,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,Eagle Hardware,0,,,20.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00005,Nos,1.0,,,,,,,,,,,,,,RFD/00004,Standard Buying,20.0,Buying,USD,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00020,Standard Selling,28.0,Selling,USD,,,,,,,,,,,

-,Bearing Pipe,"""2013-08-20 11:11:54""",Bearing Pipe,Raw Material,Nos,1.5 in. Diameter x 36 in. Mild Steel Tubing,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Bearing Pipe,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,HomeBase,0,,,15.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00006,Nos,1.0,,,,,,,,,,,,,,RFD/00005,Standard Buying,15.0,Buying,USD,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00021,Standard Selling,21.0,Selling,USD,,,,,,,,,,,

-,Blade Rib,"""2013-08-20 11:11:54""",Blade Rib,Raw Material,Nos,1/2 in. x 2 ft. x 4 ft. Pine Plywood,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Blade Rib,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,Ks Merchandise,0,,,0.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00007,Nos,1.0,,,,,,,,,,,,,,RFD/00006,Standard Buying,10.0,Buying,USD,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00022,Standard Selling,14.0,Selling,USD,,,,,,,,,,,

-,Disc Collars,"""2013-08-20 11:11:54""",Disc Collars,Raw Material,Nos,For Upper Bearing,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Disc Collars,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,Asiatic Solutions,0,,,0.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00008,Nos,1.0,,,,,,,,,,,,,,RFD/00007,Standard Buying,74.0,Buying,USD,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00023,Standard Selling,103.6,Selling,USD,,,,,,,,,,,

-,External Disc,"""2013-08-20 11:11:54""",External Disc,Raw Material,Nos,15/32 in. x 4 ft. x 8 ft. 3-Ply Rtd Sheathing,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,External Disc,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,HomeBase,0,,,45.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00009,Nos,1.0,,,,,,,,,,,,,,RFD/00008,Standard Buying,45.0,Buying,USD,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00024,Standard Selling,63.0,Selling,USD,,,,,,,,,,,

-,Internal Disc,"""2013-08-20 11:11:54""",Internal Disc,Raw Material,Nos,For Bearing Collar,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Internal Disc,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,HomeBase,0,,,33.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00010,Nos,1.0,,,,,,,,,,,,,,RFD/00009,Standard Buying,33.0,Buying,USD,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00025,Standard Selling,46.2,Selling,USD,,,,,,,,,,,

-,Shaft,"""2013-08-20 11:11:54""",Shaft,Raw Material,Nos,1.25 in. Diameter x 6 ft. Mild Steel Tubing,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Shaft,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,Eagle Hardware,0,,,30.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00011,Nos,1.0,,,,,,,,,,,,,,RFD/00010,Standard Buying,30.0,Buying,USD,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00026,Standard Selling,42.0,Selling,USD,,,,,,,,,,,

-,Stand,"""2013-08-20 11:11:54""",Stand,Raw Material,Nos,N/A,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Stand,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,Scott Ties,0,,,0.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00012,Nos,1.0,,,,,,,,,,,,,,RFD/00011,Standard Buying,40.0,Buying,USD,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00027,Standard Selling,56.0,Selling,USD,,,,,,,,,,,

-,Upper Bearing Plate,"""2013-08-20 11:11:54""",Upper Bearing Plate,Raw Material,Nos,3/16 in. x 6 in. x 6 in. Low Carbon Steel Plate,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Upper Bearing Plate,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,Eagle Hardware,0,,,50.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00013,Nos,1.0,,,,,,,,,,,,,,RFD/00012,Standard Buying,50.0,Buying,USD,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00028,Standard Selling,70.0,Selling,USD,,,,,,,,,,,

-,Wind Mill A Series,"""2013-08-20 11:27:46""",Wind Mill A Series,Products,Nos,Wind Mill A Series for Home Use 9ft,Yes,No,No,Yes,No,Yes,Yes,No,Yes,Yes,No,,Wind Mill A Series,,,,,Finished Goods - WP,0.0,,0.0,WMA,,,0.0,,0.0,0.0,,0,,,0.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00014,Nos,1.0,,,,,,,,,,,,,,RFD/00015,Standard Selling,340.0,Selling,USD,,,,,,,,,,,

-,Wind MIll C Series,"""2013-08-20 11:27:27""",Wind MIll C Series,Products,Nos,Wind Mill C Series for Commercial Use 18ft,Yes,No,No,Yes,No,Yes,Yes,No,Yes,Yes,No,,Wind MIll C Series,,,,,Finished Goods - WP,0.0,,0.0,WMC,,,0.0,,0.0,0.0,,0,,,0.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00015,Nos,1.0,,,,,,,,,,,,,,RFD/00016,Standard Selling,400.0,Selling,USD,,,,,,,,,,,

-,Wind Turbine,"""2013-08-20 11:29:26""",Wind Turbine,Products,Nos,Small Wind Turbine for Home Use,Yes,No,No,Yes,No,Yes,Yes,No,Yes,Yes,No,,Wind Turbine,,,,,Finished Goods - WP,0.0,,0.0,WTU,,,0.0,,0.0,0.0,,0,,,0.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00016,Nos,1.0,,,,,,,,,,,,,,RFD/00014,Standard Selling,300.0,Selling,USD,,,,,,,,,,,

-,Wing Sheet,"""2013-08-20 11:11:55""",Wing Sheet,Raw Material,Nos,1/32 in. x 24 in. x 47 in. HDPE Opaque Sheet,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Wing Sheet,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,New World Realty,0,,,22.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00017,Nos,1.0,,,,,,,,,,,,,,RFD/00013,Standard Buying,22.0,Buying,USD,,,,,,,,,,,

-,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00029,Standard Selling,30.8,Selling,USD,,,,,,,,,,,
\ No newline at end of file
+Data Import Template,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+Table:,Item,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+Notes:,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+Please do not change the template headings.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+First data column must be blank.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+"If you are uploading new records, leave the ""name"" (ID) column blank.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+"If you are uploading new records, ""Naming Series"" becomes mandatory, if present.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+"For updating, you can update only selective columns.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+DocType:,Item,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,~,Item Reorder,item_reorder,,,,~,UOM Conversion Detail,uom_conversion_details,,~,Item Supplier,item_supplier_details,,~,Item Customer Detail,item_customer_details,,~,Item Tax,item_tax,,~,Item Quality Inspection Parameter,item_specification_details,,~,Website Item Group,website_item_groups,~,Item Website Specification,item_website_specifications,
+Column Labels:,ID,Item Name,Item Group,Default Unit of Measure,Description,Is Stock Item,Is Asset Item,Has Batch No,Has Serial No,Is Purchase Item,Is Sales Item,Is Service Item,Inspection Required,Allow Bill of Materials,Allow Production Order,Is Sub Contracted Item,Document Numbering Series,Item Code,Brand,Barcode,Image,Description HTML,Default Warehouse,Allowance Percent,Valuation Method,Minimum Order Qty,Serial Number Series,Warranty Period (in days),End of Life,Net Weight,Weight UOM,Re-Order Level,Re-Order Qty,Default Supplier,Lead Time Days,Default Expense Account,Default Cost Center,Last Purchase Rate,Standard Rate,Manufacturer,Manufacturer Part Number,Max Discount (%),Default Income Account,Cost Center,Default BOM,Show in Website,Page Name,Weightage,Slideshow,Image,Website Warehouse,Website Description,,ID,Warehouse,Re-order Level,Material Request Type,Re-order Qty,,ID,UOM,Conversion Factor,,ID,Supplier,Supplier Part Number,,ID,Customer Name,Ref Code,,ID,Tax,Tax Rate,,ID,Parameter,Acceptance Criteria,,ID,Item Group,,ID,Label,Description
+Column Name:,name,item_name,item_group,stock_uom,description,is_stock_item,is_asset_item,has_batch_no,has_serial_no,is_purchase_item,is_sales_item,is_service_item,inspection_required,is_manufactured_item,is_pro_applicable,is_sub_contracted_item,naming_series,item_code,brand,barcode,image,description_html,default_warehouse,tolerance,valuation_method,min_order_qty,serial_no_series,warranty_period,end_of_life,net_weight,weight_uom,re_order_level,re_order_qty,default_supplier,lead_time_days,purchase_account,cost_center,last_purchase_rate,standard_rate,manufacturer,manufacturer_part_no,max_discount,default_income_account,default_sales_cost_center,default_bom,show_in_website,page_name,weightage,slideshow,website_image,website_warehouse,web_long_description,~,name,warehouse,warehouse_reorder_level,material_request_type,warehouse_reorder_qty,~,name,uom,conversion_factor,~,name,supplier,supplier_part_no,~,name,customer_name,ref_code,~,name,tax_type,tax_rate,~,name,specification,value,~,name,item_group,~,name,label,description
+Mandatory:,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,,Yes,Yes,Yes,Yes,No,,Yes,No,No,,Yes,No,No,,Yes,Yes,Yes,,Yes,Yes,No,,Yes,Yes,No,,Yes,No,,Yes,No,No
+Type:,Data (text),Data,Link,Link,Small Text,Select,Select,Select,Select,Select,Select,Select,Select,Select,Select,Select,Select,Data,Link,Data,Select,Small Text,Link,Float,Select,Float,Data,Data,Date,Float,Link,Float,Float,Link,Int,Link,Link,Float,Float,Data,Data,Float,Link,Link,Link,Check,Data,Int,Link,Select,Link,Text Editor,,Data,Link,Float,Select,Float,,Data,Link,Float,,Data,Link,Data,,Data,Link,Data,,Data,Link,Float,,Data,Data,Data,,Data,Link,,Data,Data,Text
+Info:,,,Valid Item Group,Valid UOM,,"One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No",One of: ITEM,,Valid Brand,,One of: attach_files:,,Valid Warehouse,,"One of: FIFO, Moving Average",,,,,,Valid UOM,,,Valid Supplier,Integer,Valid Account,Valid Cost Center,,,,,,Valid Account,Valid Cost Center,Valid BOM,0 or 1,,Integer,Valid Website Slideshow,One of: attach_files:,Valid Warehouse,,,Leave blank for new records,Valid Warehouse,,"One of: Purchase, Transfer",,,Leave blank for new records,Valid UOM,,,Leave blank for new records,Valid Supplier,,,Leave blank for new records,Valid Customer,,,Leave blank for new records,Valid Account,,,Leave blank for new records,,,,Leave blank for new records,Valid Item Group,,Leave blank for new records,,
+Start entering data below this line,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+,Base Bearing Plate,Base Bearing Plate,Raw Material,Nos,1/4 in. x 6 in. x 6 in. Mild Steel Plate,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Base Bearing Plate,,,,,Stores - WP,0,,0,,,,0,,0,0,Eagle Hardware,0,,,15,0,,,0,,,,0,,0,,,,,,,,,,,,,Nos,1,,,,,,,,,,,,,,,,,,,,,,,
+,Base Plate,Base Plate,Raw Material,Nos,3/4 in. x 2 ft. x 4 ft. Pine Plywood,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Base Plate,,,,,Stores - WP,0,,0,,,,0,,0,0,HomeBase,0,,,20,0,,,0,,,,0,,0,,,,,,,,,,,,,Nos,1,,,,,,,,,,,,,,,,,,,,,,,
+,Bearing Assembly,Bearing Assembly,Sub Assemblies,Nos,Bearing Assembly,Yes,No,No,No,No,Yes,No,No,Yes,Yes,No,,Bearing Assembly,,,,,Stores - WP,0,,0,,,,0,,0,0,Asiatic Solutions,0,,,0,0,,,0,,,,0,,0,,,,,,,,,,,,,Nos,1,,,,,,,,,,,,,,,,,,,,,,,
+,Bearing Block,Bearing Block,Raw Material,Nos,"CAST IRON, MCMASTER PART NO. 3710T13",Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Bearing Block,,,,,Stores - WP,0,,0,,,,0,,0,0,Nan Duskin,0,,,10,0,,,0,,,,0,,0,,,,,,,,,,,,,Nos,1,,,,,,,,,,,,,,,,,,,,,,,
+,Bearing Collar,Bearing Collar,Raw Material,Nos,1 in. x 3 in. x 1 ft. Multipurpose Al Alloy Bar,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Bearing Collar,,,,,Stores - WP,0,,0,,,,0,,0,0,Eagle Hardware,0,,,20,0,,,0,,,,0,,0,,,,,,,,,,,,,Nos,1,,,,,,,,,,,,,,,,,,,,,,,
+,Bearing Pipe,Bearing Pipe,Raw Material,Nos,1.5 in. Diameter x 36 in. Mild Steel Tubing,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Bearing Pipe,,,,,Stores - WP,0,,0,,,,0,,0,0,HomeBase,0,,,15,0,,,0,,,,0,,0,,,,,,,,,,,,,Nos,1,,,,,,,,,,,,,,,,,,,,,,,
+,Blade Rib,Blade Rib,Raw Material,Nos,1/2 in. x 2 ft. x 4 ft. Pine Plywood,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Blade Rib,,,,,Stores - WP,0,,0,,,,0,,0,0,Ks Merchandise,0,,,0,0,,,0,,,,0,,0,,,,,,,,,,,,,Nos,1,,,,,,,,,,,,,,,,,,,,,,,
+,Disc Collars,Disc Collars,Raw Material,Nos,For Upper Bearing,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Disc Collars,,,,,Stores - WP,0,,0,,,,0,,0,0,Asiatic Solutions,0,,,0,0,,,0,,,,0,,0,,,,,,,,,,,,,Nos,1,,,,,,,,,,,,,,,,,,,,,,,
+,External Disc,External Disc,Raw Material,Nos,15/32 in. x 4 ft. x 8 ft. 3-Ply Rtd Sheathing,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,External Disc,,,,,Stores - WP,0,,0,,,,0,,0,0,HomeBase,0,,,45,0,,,0,,,,0,,0,,,,,,,,,,,,,Nos,1,,,,,,,,,,,,,,,,,,,,,,,
+,Internal Disc,Internal Disc,Raw Material,Nos,For Bearing Collar,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Internal Disc,,,,,Stores - WP,0,,0,,,,0,,0,0,HomeBase,0,,,33,0,,,0,,,,0,,0,,,,,,,,,,,,,Nos,1,,,,,,,,,,,,,,,,,,,,,,,
+,Shaft,Shaft,Raw Material,Nos,1.25 in. Diameter x 6 ft. Mild Steel Tubing,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Shaft,,,,,Stores - WP,0,,0,,,,0,,0,0,Eagle Hardware,0,,,30,0,,,0,,,,0,,0,,,,,,,,,,,,,Nos,1,,,,,,,,,,,,,,,,,,,,,,,
+,Stand,Stand,Raw Material,Nos,N/A,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Stand,,,,,Stores - WP,0,,0,,,,0,,0,0,Scott Ties,0,,,0,0,,,0,,,,0,,0,,,,,,,,,,,,,Nos,1,,,,,,,,,,,,,,,,,,,,,,,
+,Upper Bearing Plate,Upper Bearing Plate,Raw Material,Nos,3/16 in. x 6 in. x 6 in. Low Carbon Steel Plate,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Upper Bearing Plate,,,,,Stores - WP,0,,0,,,,0,,0,0,Eagle Hardware,0,,,50,0,,,0,,,,0,,0,,,,,,,,,,,,,Nos,1,,,,,,,,,,,,,,,,,,,,,,,
+,Wind Mill A Series,Wind Mill A Series,Products,Nos,Wind Mill A Series for Home Use 9ft,Yes,No,No,Yes,No,Yes,Yes,No,Yes,Yes,No,,Wind Mill A Series,,,,,Finished Goods - WP,0,,0,WMA,,,0,,0,0,,0,,,0,0,,,0,,,,0,,0,,,,,,,,,,,,,Nos,1,,,,,,,,,,,,,,,,,,,,,,,
+,Wind MIll C Series,Wind MIll C Series,Products,Nos,Wind Mill C Series for Commercial Use 18ft,Yes,No,No,Yes,No,Yes,Yes,No,Yes,Yes,No,,Wind MIll C Series,,,,,Finished Goods - WP,0,,0,WMC,,,0,,0,0,,0,,,0,0,,,0,,,,0,,0,,,,,,,,,,,,,Nos,1,,,,,,,,,,,,,,,,,,,,,,,
+,Wind Turbine,Wind Turbine,Products,Nos,Small Wind Turbine for Home Use,Yes,No,No,Yes,No,Yes,Yes,No,Yes,Yes,No,,Wind Turbine,,,,,Finished Goods - WP,0,,0,WTU,,,0,,0,0,,0,,,0,0,,,0,,,,0,,0,,,,,,,,,,,,,Nos,1,,,,,,,,,,,,,,,,,,,,,,,
+,Wing Sheet,Wing Sheet,Raw Material,Nos,1/32 in. x 24 in. x 47 in. HDPE Opaque Sheet,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,,Wing Sheet,,,,,Stores - WP,0,,0,,,,0,,0,0,New World Realty,0,,,22,0,,,0,,,,0,,0,,,,,,,,,,,,,Nos,1,,,,,,,,,,,,,,,,,,,,,,,
diff --git a/utilities/demo/demo_docs/Item_Price.csv b/utilities/demo/demo_docs/Item_Price.csv
deleted file mode 100644
index c1bc7ad..0000000
--- a/utilities/demo/demo_docs/Item_Price.csv
+++ /dev/null
@@ -1,50 +0,0 @@
-Data Import Template,,,,,

-Table:,Item Price,,,,

-Parent Table:,Item,,,,

-,,,,,

-Notes:,,,,,

-Please do not change the template headings.,,,,,

-First data column must be blank.,,,,,

-Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,

-"For updating, you can update only selective columns.",,,,,

-"If you are uploading new records, leave the ""name"" (ID) column blank.",,,,,

-"If you are uploading new records, ""Naming Series"" becomes mandatory, if present.",,,,,

-You can only upload upto 5000 records in one go. (may be less in some cases),,,,,

-"""Parent"" signifies the parent table in which this row must be added",,,,,

-"If you are updating, please select ""Overwrite"" else existing rows will not be deleted.",,,,,

-,,,,,

-Column Labels,ID,Price List Name,Valid for Buying or Selling?,Ref Rate,Currency

-Column Name:,parent,price_list,buying_or_selling,ref_rate,ref_currency

-Mandatory:,Yes,Yes,Yes,No,No

-Type:,Data (text),Link,Select,Currency,Link

-Info:,,Valid Price List,"One of: Buying, Selling",,Valid Currency

-Start entering data below this line,,,,,

-,Base Bearing Plate,Standard Buying,Buying,15,USD

-,Base Plate,Standard Buying,Buying,20,USD

-,Bearing Block,Standard Buying,Buying,10,USD

-,Bearing Collar,Standard Buying,Buying,20,USD

-,Bearing Pipe,Standard Buying,Buying,15,USD

-,Blade Rib,Standard Buying,Buying,10,USD

-,Disc Collars,Standard Buying,Buying,74,USD

-,External Disc,Standard Buying,Buying,45,USD

-,Internal Disc,Standard Buying,Buying,33,USD

-,Shaft,Standard Buying,Buying,30,USD

-,Stand,Standard Buying,Buying,40,USD

-,Upper Bearing Plate,Standard Buying,Buying,50,USD

-,Wing Sheet,Standard Buying,Buying,22,USD

-,Wind Turbine,Standard Selling,Selling,300,USD

-,Wind Mill A Series,Standard Selling,Selling,340,USD

-,Wind MIll C Series,Standard Selling,Selling,400,USD

-,Base Bearing Plate,Standard Selling,Selling,21,USD

-,Base Plate,Standard Selling,Selling,28,USD

-,Bearing Block,Standard Selling,Selling,14,USD

-,Bearing Collar,Standard Selling,Selling,28,USD

-,Bearing Pipe,Standard Selling,Selling,21,USD

-,Blade Rib,Standard Selling,Selling,14,USD

-,Disc Collars,Standard Selling,Selling,103.6,USD

-,External Disc,Standard Selling,Selling,63,USD

-,Internal Disc,Standard Selling,Selling,46.2,USD

-,Shaft,Standard Selling,Selling,42,USD

-,Stand,Standard Selling,Selling,56,USD

-,Upper Bearing Plate,Standard Selling,Selling,70,USD

-,Wing Sheet,Standard Selling,Selling,30.8,USD
\ No newline at end of file
diff --git a/utilities/demo/demo_docs/Price_List.csv b/utilities/demo/demo_docs/Price_List.csv
new file mode 100644
index 0000000..fb41239
--- /dev/null
+++ b/utilities/demo/demo_docs/Price_List.csv
@@ -0,0 +1,49 @@
+Data Import Template,,,,,,,,,,,
+Table:,Price List,,,,,,,,,,
+,,,,,,,,,,,
+,,,,,,,,,,,
+Notes:,,,,,,,,,,,
+Please do not change the template headings.,,,,,,,,,,,
+First data column must be blank.,,,,,,,,,,,
+"If you are uploading new records, leave the ""name"" (ID) column blank.",,,,,,,,,,,
+"If you are uploading new records, ""Naming Series"" becomes mandatory, if present.",,,,,,,,,,,
+Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,,,,,,,
+"For updating, you can update only selective columns.",,,,,,,,,,,
+You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,,
+,,,,,,,,,,,
+DocType:,Price List,,,,~,For Territory,valid_for_territories,~,Item Price,item_prices,
+Column Labels:,ID,Price List Name,Currency,Valid for Buying or Selling?,,ID,Territory,,ID,Item Code,Rate
+Column Name:,name,price_list_name,currency,buying_or_selling,~,name,territory,~,name,item_code,ref_rate
+Mandatory:,Yes,Yes,Yes,Yes,,Yes,Yes,,Yes,Yes,Yes
+Type:,Data (text),Data,Link,Select,,Data,Link,,Data,Link,Currency
+Info:,,,Valid Currency,"One of: Buying, Selling",,Leave blank for new records,Valid Territory,,Leave blank for new records,Valid Item,
+Start entering data below this line,,,,,,,,,,,
+,Standard Buying,Standard Buying,USD,Buying,,,United States,,,Base Bearing Plate,15
+,,,,,,,,,,Base Plate,20
+,,,,,,,,,,Bearing Block,10
+,,,,,,,,,,Bearing Collar,20
+,,,,,,,,,,Bearing Pipe,15
+,,,,,,,,,,Blade Rib,10
+,,,,,,,,,,Disc Collars,74
+,,,,,,,,,,External Disc,45
+,,,,,,,,,,Internal Disc,33
+,,,,,,,,,,Shaft,30
+,,,,,,,,,,Stand,40
+,,,,,,,,,,Upper Bearing Plate,50
+,,,,,,,,,,Wing Sheet,22
+,Standard Selling,Standard Selling,USD,Selling,,,United States,,,Wind Turbine,21
+,,,,,,,,,,Wind Mill A Series,28
+,,,,,,,,,,Wind MIll C Series,14
+,,,,,,,,,,Base Bearing Plate,28
+,,,,,,,,,,Base Plate,21
+,,,,,,,,,,Bearing Block,14
+,,,,,,,,,,Bearing Collar,103.6
+,,,,,,,,,,Bearing Pipe,63
+,,,,,,,,,,Blade Rib,46.2
+,,,,,,,,,,Disc Collars,42
+,,,,,,,,,,External Disc,56
+,,,,,,,,,,Internal Disc,70
+,,,,,,,,,,Shaft,340
+,,,,,,,,,,Stand,400
+,,,,,,,,,,Upper Bearing Plate,300
+,,,,,,,,,,Wing Sheet,30.8
diff --git a/utilities/demo/demo_docs/Salary_Structure.csv b/utilities/demo/demo_docs/Salary_Structure.csv
index 07d95be..a74de90 100644
--- a/utilities/demo/demo_docs/Salary_Structure.csv
+++ b/utilities/demo/demo_docs/Salary_Structure.csv
@@ -1,25 +1,24 @@
-"Data Import Template"

-"Table:","Salary Structure"

-""

-""

-"Notes:"

-"Please do not change the template headings."

-"First data column must be blank."

-"If you are uploading new records, leave the ""name"" (ID) column blank."

-"If you are uploading new records, ""Naming Series"" becomes mandatory, if present."

-"Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish."

-"For updating, you can update only selective columns."

-"You can only upload upto 5000 records in one go. (may be less in some cases)"

-""

-"DocType:","Salary Structure","","","","","","","","","","","","","","","-","Salary Structure Earning","earning_details","","","-","Salary Structure Deduction","deduction_details","",""

-"Column Labels:","ID","Last Updated On","Employee","Is Active","From Date","Company","Employee Name","Branch","Designation","Department","Grade","To Date","Total Earning","Total Deduction","Net Pay","-","ID","Type","Amount","Reduce Earning for Leave Without Pay (LWP)","-","ID","Type","Amount","Reduce Deduction for Leave Without Pay (LWP)"

-"Column Name:","name","modified","employee","is_active","from_date","company","employee_name","branch","designation","department","grade","to_date","total_earning","total_deduction","net_pay","-","name","e_type","modified_value","depend_on_lwp","-","name","d_type","d_modified_amt","depend_on_lwp"

-"Mandatory:","Yes","Yes","Yes","Yes","Yes","Yes","No","No","No","No","No","No","No","No","No","-","Yes","Yes","No","No","-","Yes","Yes","No","No"

-"Type:","Data (text)","Data","Link","Select","Date","Select","Data","Select","Select","Select","Select","Date","Currency","Currency","Currency","-","Data","Link","Currency","Check","-","Data","Link","Currency","Check"

-"Info:","","Don't change!","Valid Employee","One of: Yes, No","","Valid Company","","Valid Branch","Valid Designation","Valid Department","Valid Grade","","","","","-","Leave blank for new records","Valid Earning Type","","0 or 1","-","Leave blank for new records","Valid Deduction Type","","0 or 1"

-"Start entering data below this line"

-"","EMP/0001/SST/00001","""2013-08-06 17:07:22""","EMP/0001","Yes","2013-08-06","Wind Power LLC","Dikman Shervashidze Shervashidze","","","","","",5000.0,400.0,4600.0,"","000000154","Basic",5000.0,"","","000000155","Income Tax",400.0,""

-"","EMP/0002/SST/00001","""2013-08-06 17:07:43""","EMP/0002","Yes","2013-08-06","Wind Power LLC","Zukutakitoteka","","","","","",6700.0,400.0,6300.0,"","000000156","Basic",6700.0,"","","000000157","Income Tax",400.0,""

-"","EMP/0003/SST/00001","""2013-08-06 17:08:02""","EMP/0003","Yes","2013-08-06","Wind Power LLC","Hatsue Kashiwagi","","","","","",3400.0,400.0,3000.0,"","000000158","Basic",3400.0,"","","000000159","Income Tax",400.0,""

-"","EMP/0004/SST/00001","""2013-08-06 17:14:39""","EMP/0004","Yes","2013-08-06","Wind Power LLC","Nuran Verkleij","","","","","",6990.0,566.0,6424.0,"","000000160","Basic",6990.0,"","","000000161","Income Tax",566.0,""

-
+Data Import Template,,,,,,,,,,,,,,,,,,,,,,,,
+Table:,Salary Structure,,,,,,,,,,,,,,,,,,,,,,,
+,,,,,,,,,,,,,,,,,,,,,,,,
+,,,,,,,,,,,,,,,,,,,,,,,,
+Notes:,,,,,,,,,,,,,,,,,,,,,,,,
+Please do not change the template headings.,,,,,,,,,,,,,,,,,,,,,,,,
+First data column must be blank.,,,,,,,,,,,,,,,,,,,,,,,,
+"If you are uploading new records, leave the ""name"" (ID) column blank.",,,,,,,,,,,,,,,,,,,,,,,,
+"If you are uploading new records, ""Naming Series"" becomes mandatory, if present.",,,,,,,,,,,,,,,,,,,,,,,,
+Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,,,,,,,,,,,,,,,,,,,,
+"For updating, you can update only selective columns.",,,,,,,,,,,,,,,,,,,,,,,,
+You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,,,,,,,,,,,,,,,
+,,,,,,,,,,,,,,,,,,,,,,,,
+DocType:,Salary Structure,,,,,,,,,,,,,,~,Salary Structure Earning,earning_details,,,~,Salary Structure Deduction,deduction_details,,
+Column Labels:,ID,Employee,Is Active,From Date,Company,Employee Name,Branch,Designation,Department,Grade,To Date,Total Earning,Total Deduction,Net Pay,,ID,Type,Amount,Reduce Earning for Leave Without Pay (LWP),,ID,Type,Amount,Reduce Deduction for Leave Without Pay (LWP)
+Column Name:,name,employee,is_active,from_date,company,employee_name,branch,designation,department,grade,to_date,total_earning,total_deduction,net_pay,~,name,e_type,modified_value,depend_on_lwp,~,name,d_type,d_modified_amt,depend_on_lwp
+Mandatory:,Yes,Yes,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No,,Yes,Yes,No,No,,Yes,Yes,No,No
+Type:,Data (text),Link,Select,Date,Select,Data,Select,Select,Select,Select,Date,Currency,Currency,Currency,,Data,Link,Currency,Check,,Data,Link,Currency,Check
+Info:,,Valid Employee,"One of: Yes, No",,Valid Company,,Valid Branch,Valid Designation,Valid Department,Valid Grade,,,,,,Leave blank for new records,Valid Earning Type,,0 or 1,,Leave blank for new records,Valid Deduction Type,,0 or 1
+Start entering data below this line,,,,,,,,,,,,,,,,,,,,,,,,
+,,EMP/0001,Yes,2013-08-06,Wind Power LLC,Dikman Shervashidze Shervashidze,,,,,,5000,400,4600,,,Basic,5000,,,,Income Tax,400,
+,,EMP/0002,Yes,2013-08-06,Wind Power LLC,Zukutakitoteka,,,,,,6700,400,6300,,,Basic,6700,,,,Income Tax,400,
+,,EMP/0003,Yes,2013-08-06,Wind Power LLC,Hatsue Kashiwagi,,,,,,3400,400,3000,,,Basic,3400,,,,Income Tax,400,
+,,EMP/0004,Yes,2013-08-06,Wind Power LLC,Nuran Verkleij,,,,,,6990,566,6424,,,Basic,6990,,,,Income Tax,566,
diff --git a/utilities/demo/make_demo.py b/utilities/demo/make_demo.py
index 9527b48..046e81a 100644
--- a/utilities/demo/make_demo.py
+++ b/utilities/demo/make_demo.py
@@ -44,6 +44,7 @@
 	complete_setup()
 	make_customers_suppliers_contacts()
 	make_items()
+	make_price_lists()
 	make_users_and_employees()
 	make_bank_account()
 	# make_opening_stock()
@@ -379,6 +380,9 @@
 def make_items():
 	import_data("Item")
 	import_data("BOM", submit=True)
+
+def make_price_lists():
+	import_data("Price_List", overwrite=True)
 	
 def make_customers_suppliers_contacts():
 	import_data(["Customer", "Supplier", "Contact", "Address", "Lead"])
@@ -402,7 +406,7 @@
 	webnotes.set_value("Company", company, "default_bank_account", ba.doc.name)
 	webnotes.conn.commit()
 
-def import_data(dt, submit=False):
+def import_data(dt, submit=False, overwrite=False):
 	if not isinstance(dt, (tuple, list)):
 		dt = [dt]
 	
@@ -412,4 +416,4 @@
 		if submit:
 			webnotes.form_dict["params"] = json.dumps({"_submit": 1})
 		webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", doctype+".csv")
-		upload()
\ No newline at end of file
+		upload(overwrite=overwrite)
diff --git a/utilities/demo/make_erpnext_demo.py b/utilities/demo/make_erpnext_demo.py
index 9e56839..766da26 100644
--- a/utilities/demo/make_erpnext_demo.py
+++ b/utilities/demo/make_erpnext_demo.py
@@ -19,7 +19,7 @@
 	roles = ["Accounts Manager", "Analytics", "Expense Approver", "Accounts User", 
 		"Leave Approver", "Blogger", "Customer", "Sales Manager", "Employee", "Support Manager", 
 		"HR Manager", "HR User", "Maintenance Manager", "Maintenance User", "Material Manager", 
-		"Material Master Manager", "Material User", "Partner", "Manufacturing Manager", 
+		"Material Master Manager", "Material User", "Manufacturing Manager", 
 		"Manufacturing User", "Projects User", "Purchase Manager", "Purchase Master Manager", 
 		"Purchase User", "Quality Manager", "Report Manager", "Sales Master Manager", 
 		"Sales User", "Supplier", "Support Team"]
diff --git a/utilities/doctype/address/address.py b/utilities/doctype/address/address.py
index 7ffb911..69e81b8 100644
--- a/utilities/doctype/address/address.py
+++ b/utilities/doctype/address/address.py
@@ -51,25 +51,3 @@
 				webnotes.conn.sql("""update `tabAddress` set `%s`=0 where `%s`=%s and name!=%s""" %
 					(is_address_type, fieldname, "%s", "%s"), (self.doc.fields[fieldname], self.doc.name))
 				break
-				
-def get_website_args():
-	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/website/doctype/about_us_settings/__init__.py b/utilities/doctype/address/templates/__init__.py
similarity index 100%
copy from website/doctype/about_us_settings/__init__.py
copy to utilities/doctype/address/templates/__init__.py
diff --git a/website/doctype/about_us_settings/__init__.py b/utilities/doctype/address/templates/pages/__init__.py
similarity index 100%
copy from website/doctype/about_us_settings/__init__.py
copy to utilities/doctype/address/templates/pages/__init__.py
diff --git a/website/templates/pages/address.html b/utilities/doctype/address/templates/pages/address.html
similarity index 95%
rename from website/templates/pages/address.html
rename to utilities/doctype/address/templates/pages/address.html
index 6544b12..f02d687 100644
--- a/website/templates/pages/address.html
+++ b/utilities/doctype/address/templates/pages/address.html
@@ -1,4 +1,4 @@
-{% extends "app/website/templates/html/page.html" %}
+{% extends base_template %}
 
 {% set title=doc and doc.name or "New Address" %}
 {% set docname=(doc and doc.name or "") %}
@@ -40,7 +40,6 @@
 <div class="col-md-12">
     <ul class="breadcrumb">
     	<li><a href="index">Home</a></li>
-    	<li><a href="account">My Account</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>
@@ -89,7 +88,7 @@
 			wn.call({
 				btn: $(this),
 				type: "POST",
-				method: "website.helpers.cart.save_address",
+				method: "selling.utils.cart.save_address",
 				args: { fields: fields, address_fieldname: get_url_arg("address_fieldname") },
 				callback: function(r) {
 					if(r.exc) {
diff --git a/utilities/doctype/address/templates/pages/address.py b/utilities/doctype/address/templates/pages/address.py
new file mode 100644
index 0000000..d968c92
--- /dev/null
+++ b/utilities/doctype/address/templates/pages/address.py
@@ -0,0 +1,30 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# 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/website/templates/pages/addresses.html b/utilities/doctype/address/templates/pages/addresses.html
similarity index 88%
rename from website/templates/pages/addresses.html
rename to utilities/doctype/address/templates/pages/addresses.html
index 04fc47b..d56c734 100644
--- a/website/templates/pages/addresses.html
+++ b/utilities/doctype/address/templates/pages/addresses.html
@@ -1,4 +1,4 @@
-{% extends "app/website/templates/html/page.html" %}
+{% extends base_template %}
 
 {% set title="My Addresses" %}
 
@@ -6,7 +6,6 @@
 <div class="col-md-12">
     <ul class="breadcrumb">
     	<li><a href="index">Home</a></li>
-    	<li><a href="account">My Account</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>
@@ -26,7 +25,7 @@
 	
 	var fetch_addresses = function() {
 		wn.call({
-			method: "website.helpers.cart.get_addresses",
+			method: "selling.utils.cart.get_addresses",
 			callback: function(r) {
 				$("#address-list .progress").remove();
 				var $list = $("#address-list");
diff --git a/patches/may_2012/clear_session_cache.py b/utilities/doctype/address/templates/pages/addresses.py
similarity index 65%
copy from patches/may_2012/clear_session_cache.py
copy to utilities/doctype/address/templates/pages/addresses.py
index 3e63c3b..24b474a 100644
--- a/patches/may_2012/clear_session_cache.py
+++ b/utilities/doctype/address/templates/pages/addresses.py
@@ -2,6 +2,5 @@
 # License: GNU General Public License v3. See license.txt
 
 from __future__ import unicode_literals
-def execute():
-	import webnotes
-	webnotes.conn.sql("delete from __SessionCache")
\ No newline at end of file
+
+no_cache = True
\ No newline at end of file
diff --git a/utilities/transaction_base.py b/utilities/transaction_base.py
index ea807c2..2535db7 100644
--- a/utilities/transaction_base.py
+++ b/utilities/transaction_base.py
@@ -243,7 +243,8 @@
 			
 	def delete_events(self):
 		webnotes.delete_doc("Event", webnotes.conn.sql_list("""select name from `tabEvent` 
-			where ref_type=%s and ref_name=%s""", (self.doc.doctype, self.doc.name)))
+			where ref_type=%s and ref_name=%s""", (self.doc.doctype, self.doc.name)), 
+			ignore_permissions=True)
 			
 	def _add_calendar_event(self, opts):
 		opts = webnotes._dict(opts)
diff --git a/website/README.md b/website/README.md
deleted file mode 100644
index 8ad3903..0000000
--- a/website/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-Module for website management.
-
-Contains:
-
-- DocTypes for Web Page, Blogs
-- Templates
-- Settings
-- Generators for Item, Blog Post, Item Group
\ No newline at end of file
diff --git a/website/__init__.py b/website/__init__.py
deleted file mode 100644
index aace68b..0000000
--- a/website/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-from __future__ import unicode_literals
-install_docs = [
-	{"doctype":"Role", "role_name":"Blogger", "name":"Blogger"},
-	{"doctype":"Role", "role_name":"Website Manager", "name":"Website Manager"},
-]
-
-import webnotes
-
-	
-def get_site_address():
-	from webnotes.utils import get_request_site_address
-	url = get_request_site_address()
-
-	if not url or url=='http://localhost':
-		new_url = webnotes.conn.get_value('Website Settings', 'Website Settings',
-			'subdomain')
-		if new_url:
-			url = "http://" + new_url
-			
-	return url
\ No newline at end of file
diff --git a/website/css/website.css b/website/css/website.css
deleted file mode 100644
index 4cd7ac7..0000000
--- a/website/css/website.css
+++ /dev/null
@@ -1,204 +0,0 @@
-.container {
-	max-width: 728px !important;
-}
-
-h1, h2, h3, h4, h5 {
-	font-weight: bold;
-}
-
-a {
-	cursor: pointer;
-}
-
-img {
-	max-width: 100%;
-}
-
-.content {
-	padding-bottom: 30px;
-}
-
-.banner {
-	margin-top: 20px;
-	padding: 0px 20px;
-}
-
-.missing-image {
-	background-color: #eee;
-	padding: 40px;
-	width: 112px;
-	font-size: 32px;
-	color: #888;
-}
-
-.social-icons {
-	font-size: 120%;
-	float: right;
-	text-align: right;
-}
-.social-icons a:hover {
-	text-decoration: none;
-}
-.social-icons a i:hover {
-	text-decoration: none;
-}
-.social-icons i {
-	margin-left: 5px;
-}
-
-div.web-footer {
-	padding-top: 10px;
-	padding-bottom: 20px;
-}
-
-.web-footer-menu ul {
-	list-style: none;
-	margin: 0px;
-	padding: 0px;
-}
-
-.web-footer-menu ul li {
-	display: inline;
-	padding: 2px 14px 2px 0px;
-	margin: 0px;
-}
-
-.avatar {
-	display: inline-block; 
-	vertical-align: middle;
-	overflow: hidden;
-	background-color: #ddd;
-	border: 1px solid #eee;
-}
-
-.avatar-small {
-	margin-right: 5px;
-	width: 30px;
-	height: 30px;
-	border-radius: 30px;
-	-moz-border-radius: 30px;
-	-webkit-border-radius: 30px;
-}
-.avatar-small img {
-	width: 30px; 
-}
-
-.avatar-medium {
-	margin-right: 5px;
-	width: 48px;
-	height: 48px;
-	border-radius: 48px;
-	-moz-border-radius: 48px;
-	-webkit-border-radius: 48px;
-}
-.avatar-medium img {
-	width: 48px; 
-}
-
-.avatar-large {
-	margin-right: 10px;
-	width: 72px;
-	height: 72px;
-	border-radius: 72px;
-	-moz-border-radius: 72px;
-	-webkit-border-radius: 72px;
-}
-.avatar-large img {
-	width: 72px; 
-}
-
-.avatar-x-large {
-	margin-right: 10px;
-	width: 100px;
-	height: 100px;
-	border-radius: 100px;
-	-moz-border-radius: 100px;
-	-webkit-border-radius: 100px;
-}
-.avatar-x-large img {
-	width: 100px; 
-}
-
-.carousel-control .icon {
-  position: absolute;
-  top: 50%;
-  left: 50%;
-  z-index: 5;
-  display: inline-block;
-  width: 20px;
-  height: 20px;
-  margin-top: -10px;
-  margin-left: -10px;
-}
-
-.hidden-sm-inline {
-	display: none;
-}
-
-@media (min-width: 768px) {
-	.hidden-sm-inline {
-		display: inline;
-	}
-}
-
-.panel-heading, 
-.panel-body {
-	padding-left: 15px;
-}
-
-
-.breadcrumb {
-	margin: 0px -20px;
-	margin-bottom: 20px;
-}
-
-fieldset {
-	margin-bottom: 20px;
-}
-
-/* buttons */
-
-.btn-default {
-  color: #ffffff;
-  background-color: #a7a9aa;
-  border-color: #a7a9aa;
-}
-
-.dropup .btn-default .caret,
-.btn-default .caret {
-	border-bottom-color: #ffffff;
-	border-top-color: #ffffff;
-}
-
-.btn-default:hover,
-.btn-default:focus,
-.btn-default:active,
-.btn-default.active,
-.open .dropdown-toggle.btn-default {
-  background-color: #9a9c9d;
-  border-color: #8d9091;
-  color: #ffffff;
-}
-
-.btn-default.disabled,
-.btn-default[disabled],
-fieldset[disabled] .btn-default,
-.btn-default.disabled:hover,
-.btn-default[disabled]:hover,
-fieldset[disabled] .btn-default:hover,
-.btn-default.disabled:focus,
-.btn-default[disabled]:focus,
-fieldset[disabled] .btn-default:focus,
-.btn-default.disabled:active,
-.btn-default[disabled]:active,
-fieldset[disabled] .btn-default:active,
-.btn-default.disabled.active,
-.btn-default[disabled].active,
-fieldset[disabled] .btn-default.active {
-  background-color: #a7a9aa;
-  border-color: #a7a9aa;
-}
-
-.label {
-	padding-top: 0.3em;
-}
\ No newline at end of file
diff --git a/website/doctype/__init__.py b/website/doctype/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/website/doctype/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/website/doctype/about_us_settings/README.md b/website/doctype/about_us_settings/README.md
deleted file mode 100644
index 977a7a3..0000000
--- a/website/doctype/about_us_settings/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Configuration for "About" page in the website that shows company, history and team.
\ No newline at end of file
diff --git a/website/doctype/about_us_settings/about_us_settings.py b/website/doctype/about_us_settings/about_us_settings.py
deleted file mode 100644
index 139abc2..0000000
--- a/website/doctype/about_us_settings/about_us_settings.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# 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
-			
-	def on_update(self):
-		from webnotes.webutils import clear_cache
-		clear_cache("about")
-		
-def get_args():
-	obj = webnotes.get_obj("About Us Settings")
-	return {
-		"obj": obj
-	}
\ No newline at end of file
diff --git a/website/doctype/about_us_settings/about_us_settings.txt b/website/doctype/about_us_settings/about_us_settings.txt
deleted file mode 100644
index 0e34d67..0000000
--- a/website/doctype/about_us_settings/about_us_settings.txt
+++ /dev/null
@@ -1,110 +0,0 @@
-[
- {
-  "creation": "2013-03-19 12:02:15", 
-  "docstatus": 0, 
-  "modified": "2013-07-05 14:23:27", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "allow_attach": 1, 
-  "description": "Settings for the About Us Page", 
-  "doctype": "DocType", 
-  "document_type": "Other", 
-  "icon": "icon-group", 
-  "issingle": 1, 
-  "module": "Website", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "name": "__common__", 
-  "parent": "About Us Settings", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0, 
-  "read_only": 0
- }, 
- {
-  "create": 1, 
-  "doctype": "DocPerm", 
-  "name": "__common__", 
-  "parent": "About Us Settings", 
-  "parentfield": "permissions", 
-  "parenttype": "DocType", 
-  "permlevel": 0, 
-  "read": 1, 
-  "report": 0, 
-  "role": "Website Manager", 
-  "submit": 0, 
-  "write": 1
- }, 
- {
-  "doctype": "DocType", 
-  "name": "About Us Settings"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "help", 
-  "fieldtype": "HTML", 
-  "label": "Help", 
-  "options": "<div class=\"alert\">Link for About Us Page is \"/about\"</div>"
- }, 
- {
-  "description": "Introduce your company to the website visitor.", 
-  "doctype": "DocField", 
-  "fieldname": "company_introduction", 
-  "fieldtype": "Text Editor", 
-  "label": "Company Introduction"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "sb0", 
-  "fieldtype": "Section Break", 
-  "label": "Company History"
- }, 
- {
-  "description": "\"Company History\"", 
-  "doctype": "DocField", 
-  "fieldname": "company_history_heading", 
-  "fieldtype": "Data", 
-  "label": "Company History Heading"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "company_history", 
-  "fieldtype": "Table", 
-  "label": "Company History", 
-  "options": "Company History"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "sb1", 
-  "fieldtype": "Section Break", 
-  "label": "Team Members"
- }, 
- {
-  "description": "\"Team Members\" or \"Management\"", 
-  "doctype": "DocField", 
-  "fieldname": "team_members_heading", 
-  "fieldtype": "Data", 
-  "label": "Team Members Heading"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "team_members", 
-  "fieldtype": "Table", 
-  "label": "Team Members", 
-  "options": "About Us Team Member"
- }, 
- {
-  "description": "More content for the bottom of the page.", 
-  "doctype": "DocField", 
-  "fieldname": "footer", 
-  "fieldtype": "Text Editor", 
-  "label": "Footer"
- }, 
- {
-  "doctype": "DocPerm"
- }
-]
\ No newline at end of file
diff --git a/website/doctype/about_us_team_member/README.md b/website/doctype/about_us_team_member/README.md
deleted file mode 100644
index 98b794f..0000000
--- a/website/doctype/about_us_team_member/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Details of team member for About Us page.
\ No newline at end of file
diff --git a/website/doctype/about_us_team_member/__init__.py b/website/doctype/about_us_team_member/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/website/doctype/about_us_team_member/__init__.py
+++ /dev/null
diff --git a/website/doctype/about_us_team_member/about_us_team_member.txt b/website/doctype/about_us_team_member/about_us_team_member.txt
deleted file mode 100644
index c5e6d16..0000000
--- a/website/doctype/about_us_team_member/about_us_team_member.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-[
- {
-  "creation": "2013-03-07 11:55:11", 
-  "docstatus": 0, 
-  "modified": "2013-07-10 14:54:03", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "doctype": "DocType", 
-  "istable": 1, 
-  "module": "Website", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "in_list_view": 1, 
-  "name": "__common__", 
-  "parent": "About Us Team Member", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0
- }, 
- {
-  "doctype": "DocType", 
-  "name": "About Us Team Member"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "full_name", 
-  "fieldtype": "Data", 
-  "label": "Full Name", 
-  "reqd": 1, 
-  "width": "150px"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "image_link", 
-  "fieldtype": "Select", 
-  "label": "Image Link", 
-  "options": "attach_files:", 
-  "width": "150px"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "bio", 
-  "fieldtype": "Small Text", 
-  "label": "Bio", 
-  "reqd": 1, 
-  "width": "200px"
- }
-]
\ No newline at end of file
diff --git a/website/doctype/blog_category/README.md b/website/doctype/blog_category/README.md
deleted file mode 100644
index af14b5d..0000000
--- a/website/doctype/blog_category/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Blog category.
\ No newline at end of file
diff --git a/website/doctype/blog_category/__init__.py b/website/doctype/blog_category/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/website/doctype/blog_category/__init__.py
+++ /dev/null
diff --git a/website/doctype/blog_category/blog_category.py b/website/doctype/blog_category/blog_category.py
deleted file mode 100644
index 7d99e2a..0000000
--- a/website/doctype/blog_category/blog_category.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# 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
-		
-	def on_update(self):
-		# for blog footer
-		from webnotes.webutils import clear_cache
-		clear_cache()
-		
\ No newline at end of file
diff --git a/website/doctype/blog_category/blog_category.txt b/website/doctype/blog_category/blog_category.txt
deleted file mode 100644
index b986c44..0000000
--- a/website/doctype/blog_category/blog_category.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-[
- {
-  "creation": "2013-03-08 09:41:11", 
-  "docstatus": 0, 
-  "modified": "2013-07-05 14:27:02", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "autoname": "field:category_name", 
-  "doctype": "DocType", 
-  "document_type": "Master", 
-  "icon": "icon-tag", 
-  "module": "Website", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "category_name", 
-  "fieldtype": "Data", 
-  "label": "Category Name", 
-  "name": "__common__", 
-  "parent": "Blog Category", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0, 
-  "reqd": 1
- }, 
- {
-  "doctype": "DocPerm", 
-  "name": "__common__", 
-  "parent": "Blog Category", 
-  "parentfield": "permissions", 
-  "parenttype": "DocType", 
-  "permlevel": 0, 
-  "read": 1
- }, 
- {
-  "doctype": "DocType", 
-  "name": "Blog Category"
- }, 
- {
-  "doctype": "DocField"
- }, 
- {
-  "cancel": 1, 
-  "create": 1, 
-  "doctype": "DocPerm", 
-  "role": "Website Manager", 
-  "write": 1
- }, 
- {
-  "doctype": "DocPerm", 
-  "role": "Blogger"
- }
-]
\ No newline at end of file
diff --git a/website/doctype/blog_post/README.md b/website/doctype/blog_post/README.md
deleted file mode 100644
index 63d3c0f..0000000
--- a/website/doctype/blog_post/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Blog post for "Blogs" section of website.
\ No newline at end of file
diff --git a/website/doctype/blog_post/__init__.py b/website/doctype/blog_post/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/website/doctype/blog_post/__init__.py
+++ /dev/null
diff --git a/website/doctype/blog_post/blog_post.js b/website/doctype/blog_post/blog_post.js
deleted file mode 100644
index af4dcc9..0000000
--- a/website/doctype/blog_post/blog_post.js
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-// License: GNU General Public License v3. See license.txt
-
-cur_frm.cscript.refresh = function(doc) {
-	if(!doc.__islocal && doc.published && !doc.email_sent) {
-		cur_frm.add_custom_button('Email Subscribers', function() {
-			$c_obj(make_doclist(doc.doctype, doc.name), 'send_emails', '', function(r) {
-				cur_frm.refresh();
-			});
-		})
-	}
-}
\ No newline at end of file
diff --git a/website/doctype/blog_post/blog_post.py b/website/doctype/blog_post/blog_post.py
deleted file mode 100644
index 48b3206..0000000
--- a/website/doctype/blog_post/blog_post.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-
-import webnotes
-import webnotes.webutils
-from webnotes import _
-
-class DocType:
-	def __init__(self, d, dl):
-		self.doc, self.doclist = d, dl
-
-	def autoname(self):
-		from webnotes.webutils import page_name
-		self.doc.name = page_name(self.doc.title)
-
-	def validate(self):
-		if self.doc.blog_intro:
-			self.doc.blog_intro = self.doc.blog_intro[:140]
-
-		# update posts
-		webnotes.conn.sql("""update tabBlogger set posts=(select count(*) from `tabBlog Post` 
-			where ifnull(blogger,'')=tabBlogger.name)
-			where name=%s""", self.doc.blogger)
-
-	def on_update(self):
-		webnotes.webutils.update_page_name(self.doc, self.doc.title)
-		webnotes.webutils.delete_page_cache("writers")
-
-	def prepare_template_args(self):
-		import webnotes.utils
-		import markdown2
-		
-		# this is for double precaution. usually it wont reach this code if not published
-		if not webnotes.utils.cint(self.doc.published):
-			raise Exception, "This blog has not been published yet!"
-		
-		# temp fields
-		from webnotes.utils import global_date_format, get_fullname
-		self.doc.full_name = get_fullname(self.doc.owner)
-		self.doc.updated = global_date_format(self.doc.published_on)
-		self.doc.content_html = self.doc.content
-		
-		if self.doc.blogger:
-			self.doc.blogger_info = webnotes.doc("Blogger", self.doc.blogger).fields
-		
-		self.doc.description = self.doc.blog_intro or self.doc.content[:140]
-		self.doc.meta_description = self.doc.description
-		
-		self.doc.categories = webnotes.conn.sql_list("select name from `tabBlog Category` order by name")
-		
-		self.doc.texts = {
-			"comments": _("Comments"),
-			"first_comment": _("Be the first one to comment"),
-			"add_comment": _("Add Comment"),
-			"submit": _("Submit"),
-			"all_posts_by": _("All posts by"),
-		}
-
-		comment_list = webnotes.conn.sql("""\
-			select comment, comment_by_fullname, creation
-			from `tabComment` where comment_doctype="Blog Post"
-			and comment_docname=%s order by creation""", self.doc.name, as_dict=1)
-		
-		self.doc.comment_list = comment_list or []
-		for comment in self.doc.comment_list:
-			comment['comment_date'] = webnotes.utils.global_date_format(comment['creation'])
-			comment['comment'] = markdown2.markdown(comment['comment'])
diff --git a/website/doctype/blog_post/blog_post.txt b/website/doctype/blog_post/blog_post.txt
deleted file mode 100644
index 79c1aee..0000000
--- a/website/doctype/blog_post/blog_post.txt
+++ /dev/null
@@ -1,135 +0,0 @@
-[
- {
-  "creation": "2013-03-28 10:35:30", 
-  "docstatus": 0, 
-  "modified": "2013-07-05 15:08:30", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "allow_attach": 1, 
-  "allow_import": 1, 
-  "doctype": "DocType", 
-  "icon": "icon-quote-left", 
-  "max_attachments": 5, 
-  "module": "Website", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "name": "__common__", 
-  "parent": "Blog Post", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0
- }, 
- {
-  "doctype": "DocPerm", 
-  "name": "__common__", 
-  "parent": "Blog Post", 
-  "parentfield": "permissions", 
-  "parenttype": "DocType", 
-  "permlevel": 0, 
-  "read": 1, 
-  "report": 1, 
-  "submit": 0
- }, 
- {
-  "doctype": "DocType", 
-  "name": "Blog Post"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "title", 
-  "fieldtype": "Data", 
-  "label": "Title", 
-  "reqd": 1
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "published", 
-  "fieldtype": "Check", 
-  "label": "Published"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "published_on", 
-  "fieldtype": "Date", 
-  "label": "Published On"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "column_break_3", 
-  "fieldtype": "Column Break"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "blogger", 
-  "fieldtype": "Link", 
-  "in_list_view": 1, 
-  "label": "Blogger", 
-  "options": "Blogger", 
-  "reqd": 1
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "blog_category", 
-  "fieldtype": "Link", 
-  "in_list_view": 1, 
-  "label": "Blog Category", 
-  "options": "Blog Category"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "section_break_5", 
-  "fieldtype": "Section Break"
- }, 
- {
-  "description": "Description for listing page, in plain text, only a couple of lines. (max 140 characters)", 
-  "doctype": "DocField", 
-  "fieldname": "blog_intro", 
-  "fieldtype": "Small Text", 
-  "in_list_view": 1, 
-  "label": "Blog Intro", 
-  "reqd": 1
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "content", 
-  "fieldtype": "Text Editor", 
-  "label": "Content", 
-  "reqd": 1
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "page_name", 
-  "fieldtype": "Data", 
-  "hidden": 1, 
-  "label": "Page Name", 
-  "read_only": 1
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "email_sent", 
-  "fieldtype": "Check", 
-  "hidden": 1, 
-  "label": "Email Sent"
- }, 
- {
-  "create": 1, 
-  "doctype": "DocPerm", 
-  "role": "Website Manager", 
-  "write": 1
- }, 
- {
-  "create": 1, 
-  "doctype": "DocPerm", 
-  "role": "Blogger", 
-  "write": 1
- }, 
- {
-  "doctype": "DocPerm", 
-  "role": "Guest", 
-  "write": 0
- }
-]
\ No newline at end of file
diff --git a/website/doctype/blog_settings/README.md b/website/doctype/blog_settings/README.md
deleted file mode 100644
index 0a76d4e..0000000
--- a/website/doctype/blog_settings/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Blog titles and introduction texts.
\ No newline at end of file
diff --git a/website/doctype/blog_settings/__init__.py b/website/doctype/blog_settings/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/website/doctype/blog_settings/__init__.py
+++ /dev/null
diff --git a/website/doctype/blog_settings/blog_settings.py b/website/doctype/blog_settings/blog_settings.py
deleted file mode 100644
index 784339d..0000000
--- a/website/doctype/blog_settings/blog_settings.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# 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/website/doctype/blog_settings/blog_settings.txt b/website/doctype/blog_settings/blog_settings.txt
deleted file mode 100644
index 27fa563..0000000
--- a/website/doctype/blog_settings/blog_settings.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-[
- {
-  "creation": "2013-03-11 17:48:16", 
-  "docstatus": 0, 
-  "modified": "2013-07-05 14:27:31", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "description": "Blog Settings", 
-  "doctype": "DocType", 
-  "icon": "icon-cog", 
-  "issingle": 1, 
-  "module": "Website", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "name": "__common__", 
-  "parent": "Blog Settings", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0
- }, 
- {
-  "create": 1, 
-  "doctype": "DocPerm", 
-  "name": "__common__", 
-  "parent": "Blog Settings", 
-  "parentfield": "permissions", 
-  "parenttype": "DocType", 
-  "permlevel": 0, 
-  "read": 1, 
-  "role": "Website Manager", 
-  "write": 1
- }, 
- {
-  "doctype": "DocType", 
-  "name": "Blog Settings"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "blog_title", 
-  "fieldtype": "Data", 
-  "label": "Blog Title"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "blog_introduction", 
-  "fieldtype": "Small Text", 
-  "label": "Blog Introduction"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "writers_introduction", 
-  "fieldtype": "Small Text", 
-  "label": "Writers Introduction"
- }, 
- {
-  "doctype": "DocPerm"
- }
-]
\ No newline at end of file
diff --git a/website/doctype/blogger/README.md b/website/doctype/blogger/README.md
deleted file mode 100644
index 13ddecd..0000000
--- a/website/doctype/blogger/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Profile of blog writer in "Blog" section.
\ No newline at end of file
diff --git a/website/doctype/blogger/blogger.py b/website/doctype/blogger/blogger.py
deleted file mode 100644
index 9cb4a44..0000000
--- a/website/doctype/blogger/blogger.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# 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 _
-
-class DocType:
-	def __init__(self, d, dl):
-		self.doc, self.doclist = d, dl
-		
-	def on_update(self):
-		"if profile is set, then update all older blogs"
-		
-		from website.helpers.blog import clear_blog_cache
-		clear_blog_cache()
-		
-		if self.doc.profile:
-			for blog in webnotes.conn.sql_list("""select name from `tabBlog Post` where owner=%s 
-				and ifnull(blogger,'')=''""", self.doc.profile):
-				b = webnotes.bean("Blog Post", blog)
-				b.doc.blogger = self.doc.name
-				b.save()
-				
-def get_writers_args():
-	bloggers = webnotes.conn.sql("""select * from `tabBlogger` 
-	 	where ifnull(posts,0) > 0 and ifnull(disabled,0)=0 
-		order by posts desc""", as_dict=1)
-		
-	args = {
-		"bloggers": bloggers,
-		"texts": {
-			"all_posts_by": _("All posts by")
-		},
-		"categories": webnotes.conn.sql_list("select name from `tabBlog Category` order by name")
-	}
-	
-	args.update(webnotes.doc("Blog Settings", "Blog Settings").fields)
-	return args
\ No newline at end of file
diff --git a/website/doctype/blogger/blogger.txt b/website/doctype/blogger/blogger.txt
deleted file mode 100644
index 1486c01..0000000
--- a/website/doctype/blogger/blogger.txt
+++ /dev/null
@@ -1,102 +0,0 @@
-[
- {
-  "creation": "2013-03-25 16:00:51", 
-  "docstatus": 0, 
-  "modified": "2013-08-30 16:35:24", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "allow_attach": 1, 
-  "autoname": "field:short_name", 
-  "description": "Profile of a Blogger", 
-  "doctype": "DocType", 
-  "document_type": "Master", 
-  "icon": "icon-user", 
-  "max_attachments": 1, 
-  "module": "Website", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "name": "__common__", 
-  "parent": "Blogger", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0
- }, 
- {
-  "doctype": "DocPerm", 
-  "name": "__common__", 
-  "parent": "Blogger", 
-  "parentfield": "permissions", 
-  "parenttype": "DocType", 
-  "permlevel": 0, 
-  "read": 1, 
-  "write": 1
- }, 
- {
-  "doctype": "DocType", 
-  "name": "Blogger"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "disabled", 
-  "fieldtype": "Check", 
-  "label": "Disabled"
- }, 
- {
-  "description": "Will be used in url (usually first name).", 
-  "doctype": "DocField", 
-  "fieldname": "short_name", 
-  "fieldtype": "Data", 
-  "label": "Short Name", 
-  "reqd": 1
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "full_name", 
-  "fieldtype": "Data", 
-  "in_list_view": 1, 
-  "label": "Full Name", 
-  "reqd": 1
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "profile", 
-  "fieldtype": "Link", 
-  "label": "Profile", 
-  "options": "Profile"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "bio", 
-  "fieldtype": "Small Text", 
-  "label": "Bio"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "avatar", 
-  "fieldtype": "Select", 
-  "label": "Avatar", 
-  "options": "attach_files:"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "posts", 
-  "fieldtype": "Int", 
-  "in_list_view": 1, 
-  "label": "Posts", 
-  "read_only": 1
- }, 
- {
-  "create": 1, 
-  "doctype": "DocPerm", 
-  "role": "Website Manager"
- }, 
- {
-  "doctype": "DocPerm", 
-  "match": "owner:profile", 
-  "role": "Blogger"
- }
-]
\ No newline at end of file
diff --git a/website/doctype/company_history/README.md b/website/doctype/company_history/README.md
deleted file mode 100644
index 482c8d3..0000000
--- a/website/doctype/company_history/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Company history detail for "About Us" section.
\ No newline at end of file
diff --git a/website/doctype/company_history/__init__.py b/website/doctype/company_history/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/website/doctype/company_history/__init__.py
+++ /dev/null
diff --git a/website/doctype/company_history/company_history.py b/website/doctype/company_history/company_history.py
deleted file mode 100644
index 784339d..0000000
--- a/website/doctype/company_history/company_history.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# 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/website/doctype/company_history/company_history.txt b/website/doctype/company_history/company_history.txt
deleted file mode 100644
index c0f230c..0000000
--- a/website/doctype/company_history/company_history.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-[
- {
-  "creation": "2013-02-22 01:28:08", 
-  "docstatus": 0, 
-  "modified": "2013-07-10 14:54:06", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "doctype": "DocType", 
-  "istable": 1, 
-  "module": "Website", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "in_list_view": 1, 
-  "name": "__common__", 
-  "parent": "Company History", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0
- }, 
- {
-  "doctype": "DocType", 
-  "name": "Company History"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "year", 
-  "fieldtype": "Data", 
-  "label": "Year"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "highlight", 
-  "fieldtype": "Text", 
-  "label": "Highlight", 
-  "print_width": "300px", 
-  "width": "300px"
- }
-]
\ No newline at end of file
diff --git a/website/doctype/contact_us_settings/README.md b/website/doctype/contact_us_settings/README.md
deleted file mode 100644
index 61f589f..0000000
--- a/website/doctype/contact_us_settings/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Settings, introduction for "Contact Us" section.
\ No newline at end of file
diff --git a/website/doctype/contact_us_settings/__init__.py b/website/doctype/contact_us_settings/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/website/doctype/contact_us_settings/__init__.py
+++ /dev/null
diff --git a/website/doctype/contact_us_settings/contact_us_settings.py b/website/doctype/contact_us_settings/contact_us_settings.py
deleted file mode 100644
index 37df106..0000000
--- a/website/doctype/contact_us_settings/contact_us_settings.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# 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
-
-	def onload(self):
-		"""load address"""
-		if self.doc.query_options:
-			self.query_options = filter(None, self.doc.query_options.replace(",", "\n").split())
-		else:
-			self.query_options = ["Sales", "Support", "General"]
-		if self.doc.address:
-			self.address = webnotes.bean("Address", self.doc.address).doc
-			
-	def on_update(self):
-		from webnotes.webutils import clear_cache
-		clear_cache("contact")
\ No newline at end of file
diff --git a/website/doctype/contact_us_settings/contact_us_settings.txt b/website/doctype/contact_us_settings/contact_us_settings.txt
deleted file mode 100644
index 21db27e..0000000
--- a/website/doctype/contact_us_settings/contact_us_settings.txt
+++ /dev/null
@@ -1,82 +0,0 @@
-[
- {
-  "creation": "2013-02-21 20:12:42", 
-  "docstatus": 0, 
-  "modified": "2013-07-05 14:32:24", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "description": "Settings for Contact Us Page", 
-  "doctype": "DocType", 
-  "icon": "icon-cog", 
-  "issingle": 1, 
-  "module": "Website", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "name": "__common__", 
-  "parent": "Contact Us Settings", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0
- }, 
- {
-  "create": 1, 
-  "doctype": "DocPerm", 
-  "name": "__common__", 
-  "parent": "Contact Us Settings", 
-  "parentfield": "permissions", 
-  "parenttype": "DocType", 
-  "permlevel": 0, 
-  "read": 1, 
-  "report": 0, 
-  "role": "Website Manager", 
-  "submit": 0, 
-  "write": 1
- }, 
- {
-  "doctype": "DocType", 
-  "name": "Contact Us Settings"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "help", 
-  "fieldtype": "HTML", 
-  "label": "Help", 
-  "options": "<div class=\"alert\">Link for Contact Page is \"/contact\"</div>"
- }, 
- {
-  "description": "Address to be displayed on the Contact Page", 
-  "doctype": "DocField", 
-  "fieldname": "address", 
-  "fieldtype": "Link", 
-  "label": "Address", 
-  "options": "Address"
- }, 
- {
-  "description": "Default: \"Contact Us\"", 
-  "doctype": "DocField", 
-  "fieldname": "heading", 
-  "fieldtype": "Data", 
-  "label": "Heading"
- }, 
- {
-  "description": "Introductory information for the Contact Us Page", 
-  "doctype": "DocField", 
-  "fieldname": "introduction", 
-  "fieldtype": "Text Editor", 
-  "label": "Introduction"
- }, 
- {
-  "description": "Contact options, like \"Sales Query, Support Query\" etc each on a new line or separated by commas.", 
-  "doctype": "DocField", 
-  "fieldname": "query_options", 
-  "fieldtype": "Small Text", 
-  "label": "Query Options"
- }, 
- {
-  "doctype": "DocPerm"
- }
-]
\ No newline at end of file
diff --git a/website/doctype/style_settings/README.md b/website/doctype/style_settings/README.md
deleted file mode 100644
index de9d0cd..0000000
--- a/website/doctype/style_settings/README.md
+++ /dev/null
@@ -1,6 +0,0 @@
-Style settings for website. Includes settings for:
-
-- Site colours (background, toolbars)
-- Fonts (family and size)
-- Background (image if any)
-- Custom CSS
\ No newline at end of file
diff --git a/website/doctype/style_settings/__init__.py b/website/doctype/style_settings/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/website/doctype/style_settings/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/website/doctype/style_settings/custom_template.css b/website/doctype/style_settings/custom_template.css
deleted file mode 100644
index 7abdb4b..0000000
--- a/website/doctype/style_settings/custom_template.css
+++ /dev/null
@@ -1,235 +0,0 @@
-{% if doc.at_import %}
-{{ doc.at_import }}
-{% endif %}
-
-body {
-{% if doc.background_image %}
-	background: url("../{{ doc.background_image }}") repeat;
-{% elif doc.background_color %}
-	background-color: #{{ doc.background_color }};
-	background-image: none;
-{% else %}
-	background-color: #ffffff;
-{% endif %}	
-{% if doc.font or doc.google_web_font_for_text %}
-	font-family: '{{ doc.google_web_font_for_text or doc.font }}', 'Helvetica Neue', Arial, Sans !important;
-{% endif %}
-	{% if doc.font_size %}font-size: {{ doc.font_size }} !important;{% endif %}
-	{% if doc.page_text %}color: #{{ doc.page_text }};{% endif %}
-}
-
-{% if doc.page_links %}a, a:hover {
-	color: #{{ doc.page_links }};
-}{% endif %}
-
-{% if doc.font_size %}
-.small {
-	font-size: {{ doc.small_font_size }} !important;
-}
-{% endif %}
-
-div.outer {
-	background-color: #{{ doc.page_background }};
-}
-
-{% if doc.google_web_font_for_heading or doc.heading_font %}h1, h2, h3, h4, h5 {
-	font-family: '{{ doc.google_web_font_for_heading or doc.heading_font }}', 'Helvetica Neue', Arial !important;
-}{% endif %}
-
-{% if doc.heading_text_style %}h1, h2, h3, h4, h5 {
-	text-transform: {{ doc.heading_text_style }};
-}{% endif %}
-
-{% if doc.page_headings %}h1, h2, h3, h4, h5 {
-	color: #{{ doc.page_headings }};
-}{% endif %}
-
-{% if doc.page_border %}
-/* Page Border*/
-div.outer {
-	box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
-	-moz-box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
-	-webkibox-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
-}
-{% else %}
-{% if doc.background_color.lower() == doc.page_background.lower() %}
-div.web-footer {
-	border-top: 1px solid #{{ get_hex_shade(doc.page_background, 15) }};
-	padding-top: 10px;
-}
-{% endif %}
-{% endif %}
-
-div.web-footer, div.web-footer a {
-	font-size: 90%;
-	color: #{{ get_hex_shade(doc.background_color, 70) }};
-}
-
-/* Bootstrap Navbar */
-.navbar-default {
-	border: 0px;
-}
-
-.navbar {
-	box-shadow: none;
-	border-radius: 0px;
-    background-color: #{{ doc.top_bar_background}};
-    background-repeat: repeat-x;
-	background-image: none;
-	border-bottom: 1px solid {% if doc.top_bar_background.lower() == doc.page_background.lower() -%}
-		#{{ get_hex_shade(doc.page_background, 15) }};
-	{%- else -%}
-		transparent;
-	{%- endif %}
-}
-
-.navbar .navbar-brand,
-.navbar .navbar-brand:hover,
-.navbar .navbar-brand:focus,
-.navbar .nav > li > a {
-  color: #{{ doc.top_bar_foreground }};
-  text-shadow: none;
-}
-
-.navbar .nav > li > a:hover,
-.navbar .nav > li > a:focus {
-  color: #{{ doc.top_bar_foreground }};
-  background-color: transparent;
-}
-
-.navbar .navbar-text {
-  color: #999999;
-}
-
-.navbar .nav .active > a,
-.navbar .nav .active > a:hover,
-.navbar .nav .active > a:focus {
-  color: #{{ doc.top_bar_foreground }};
-  background-color: transparent;
-}
-
-.navbar .navbar-link {
-  color: #444444;
-}
-
-.navbar .navbar-link:hover,
-.navbar .navbar-link:focus {
-  color: #{{ doc.top_bar_foreground}};
-}
-
-.navbar-fixed-top,
-.navbar-static-top {
-  -webkit-box-shadow: none;
-     -moz-box-shadow: none;
-          box-shadow: none;
-        
-}
-.navbar .nav > .active > a,
-.navbar .nav > .active > a:hover,
-.navbar .nav > .active > a:focus {
-  color: #424242;
-  text-decoration: none;
-  background-color: transparent;
-  -webkit-box-shadow: none;
-     -moz-box-shadow: none;
-          box-shadow: none;
-}
-
-.navbar .nav li.dropdown > .dropdown-toggle .caret, 
-.navbar .nav li.dropdown > .dropdown-toggle:hover .caret {
-	border-top-color: #{{ doc.top_bar_foreground}};
-	border-bottom-color: #{{ doc.top_bar_foreground}};
-}
-
-.navbar .nav li.dropdown.open > .dropdown-toggle .caret,
-.navbar .nav li.dropdown.open > .dropdown-toggle:hover .caret {
-	border-top-color: #{{ doc.top_bar_background}};
-	border-bottom-color: #{{ doc.top_bar_background}};
-}
-
-.navbar .nav li.dropdown.open > .dropdown-toggle {
-  color: #{{ doc.top_bar_background}};
-  background-color: #{{ doc.top_bar_foreground}};
-}
-
-@media (max-width: 800px) {
-  .navbar .nav-collapse .nav > li > a,
-  .navbar .nav-collapse .dropdown-menu a {
-    background-color: #{{ doc.top_bar_background}};
-    color: #{{ doc.top_bar_foreground}};
-  }
-  .navbar .nav-collapse .nav > li > a:hover, 
-  .navbar .nav-collapse .dropdown-menu a:hover {
-    background-color: #{{ doc.top_bar_foreground}};
-    color: #{{ doc.top_bar_background}};
-  }
-
-  .navbar .nav li.dropdown > .dropdown-toggle .caret {
-    border-top-color: #{{ doc.top_bar_foreground }};
-    border-bottom-color: #{{ doc.top_bar_foreground }};	
-  }
-
-  .navbar .nav li.dropdown > .dropdown-toggle:hover .caret {
-    border-top-color: #{{ doc.top_bar_foreground }};
-    border-bottom-color: #{{ doc.top_bar_foreground }};
-  }
-
-  .navbar .nav li.dropdown.open > .dropdown-toggle .caret,
-  .navbar .nav li.dropdown.open > .dropdown-toggle:hover .caret {
-    border-top-color: #{{ doc.top_bar_background }};
-    border-bottom-color: #{{ doc.top_bar_background }};	
-  }
-
-}
-
-.navbar-default .navbar-toggle .icon-bar {
-	background-color: #{{ doc.top_bar_foreground }};
-}
-
-.breadcrumb {
-	background-color: #{{ get_hex_shade(doc.page_background, 5) }};
-}
-
-.breadcrumb > li {
-  text-shadow: none;
-}
-
-
-.table-striped tbody > tr:nth-child(odd) > td,
-.table-striped tbody > tr:nth-child(odd) > th {
-	background-color: #{{ get_hex_shade(doc.page_background, 5) }};
-}
-
-.table-hover tbody tr:hover td,
-.table-hover tbody tr:hover th {
-	background-color: #{{ get_hex_shade(doc.page_background, 10) }};
-}
-
-.table-bordered {
-	border: 1px solid #{{ get_hex_shade(doc.page_background, 15) }};
-}
-
-.table th,
-.table td {
-  border-top: 1px solid #{{ get_hex_shade(doc.page_background, 15) }};
-}
-
-.table-bordered th,
-.table-bordered td {
-	border-left: 1px solid #{{ get_hex_shade(doc.page_background, 15) }};
-}
-
-
-
-.hero-unit {
-	background-color: #{{ get_hex_shade(doc.page_background, 15) }};
-}
-
-pre, code {
-	background-color: #{{ get_hex_shade(doc.page_background, 5) }};
-}
-
-hr {
-	border-top: 1px solid #{{ get_hex_shade(doc.page_background, 15) }};
-	border-bottom: 1px solid #{{ get_hex_shade(doc.page_background, 5) }};	
-}
diff --git a/website/doctype/style_settings/style_settings.js b/website/doctype/style_settings/style_settings.js
deleted file mode 100644
index f94246d..0000000
--- a/website/doctype/style_settings/style_settings.js
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-// License: GNU General Public License v3. See license.txt
-
-
-cur_frm.cscript.onload_post_render = function() {
-	wn.require('lib/public/js/lib/jscolor/jscolor.js');
-	$.each(["background_color", "page_background", "page_text", "page_links", 
-		"top_bar_background", "top_bar_foreground", "page_headings"], function(i, v) {
-		$(cur_frm.fields_dict[v].input).addClass('color');
-	})
-	jscolor.bind();
-}
\ No newline at end of file
diff --git a/website/doctype/style_settings/style_settings.py b/website/doctype/style_settings/style_settings.py
deleted file mode 100644
index 7efe861..0000000
--- a/website/doctype/style_settings/style_settings.py
+++ /dev/null
@@ -1,98 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-
-from webnotes.utils import cint, cstr
-from webnotes import _
-
-class DocType:
-	def __init__(self, d, dl):
-		self.doc, self.doclist = d, dl
-		
-	def validate(self):
-		"""make custom css"""
-		from jinja2 import Template
-		from webnotes.webutils import get_hex_shade
-		import os
-		
-		default_colours = {
-			"background_color": "FFFFFF",
-			"page_background": "FFFFFF",
-			"top_bar_background": "FFFFFF",
-			"top_bar_foreground": "444444",
-			"page_headings": "222222",
-			"page_text": "000000"
-		}
-		
-		for d in default_colours:
-			if not self.doc.fields.get(d):
-				self.doc.fields[d] = default_colours[d]
-		
-		self.validate_colors()
-		
-		with open(os.path.join(
-				os.path.dirname(os.path.abspath(__file__)), 
-				'custom_template.css'), 'r') as f:
-			temp = Template(f.read())
-		
-		self.prepare()
-		
-		self.doc.custom_css = temp.render(doc = self.doc, get_hex_shade=get_hex_shade)
-		if self.doc.add_css:
-			self.doc.custom_css += '\n\n/* User CSS */\n\n' + self.doc.add_css
-		
-		from webnotes.sessions import clear_cache
-		clear_cache('Guest')
-
-		from webnotes.webutils import clear_cache
-		clear_cache()
-		
-		for f in ["small_font_size", "at_import", "heading_text_style"]:
-			if f in self.doc.fields:
-				del self.doc.fields[f]
-	
-	def validate_colors(self):
-		if (self.doc.page_background or self.doc.page_text) and \
-			self.doc.page_background==self.doc.page_text:
-				webnotes.msgprint(_("Page text and background is same color. Please change."),
-					raise_exception=1)
-
-		if (self.doc.top_bar_background or self.doc.top_bar_foreground) and \
-			self.doc.top_bar_background==self.doc.top_bar_foreground:
-				webnotes.msgprint(_("Top Bar text and background is same color. Please change."),
-					raise_exception=1)
-
-	
-	def prepare(self):
-		if not self.doc.font_size:
-			self.doc.font_size = '13px'
-			
-		self.doc.small_font_size = cstr(cint(self.doc.font_size[:-2])-2) + 'px'
-		self.doc.page_border = cint(self.doc.page_border)
-		
-		fonts = []
-		if self.doc.google_web_font_for_heading:
-			fonts.append(self.doc.google_web_font_for_heading)
-		if self.doc.google_web_font_for_text:
-			fonts.append(self.doc.google_web_font_for_text)
-			
-		fonts = list(set(fonts))
-		
-		if self.doc.heading_text_as:
-			self.doc.heading_text_style = {
-				"UPPERCASE": "uppercase",
-				"Title Case":"capitalize",
-				"lowercase": "lowercase"
-			}.get(self.doc.heading_text_as) or ""
-		
-		self.doc.at_import = ""
-		for f in fonts:
-			self.doc.at_import += "\n@import url(https://fonts.googleapis.com/css?family=%s:400,700);" % f.replace(" ", "+")
-
-	
-	def on_update(self):
-		"""rebuild pages"""
-		from website.helpers.make_web_include_files import make
-		make()
\ No newline at end of file
diff --git a/website/doctype/style_settings/style_settings.txt b/website/doctype/style_settings/style_settings.txt
deleted file mode 100644
index 7119d2c..0000000
--- a/website/doctype/style_settings/style_settings.txt
+++ /dev/null
@@ -1,201 +0,0 @@
-[
- {
-  "creation": "2013-03-25 16:01:33", 
-  "docstatus": 0, 
-  "modified": "2013-07-05 14:57:01", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "allow_attach": 1, 
-  "description": "Set your background color, font and image (tiled)", 
-  "doctype": "DocType", 
-  "icon": "icon-cog", 
-  "issingle": 1, 
-  "max_attachments": 1, 
-  "module": "Website", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "name": "__common__", 
-  "parent": "Style Settings", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0
- }, 
- {
-  "doctype": "DocPerm", 
-  "name": "__common__", 
-  "parent": "Style Settings", 
-  "parentfield": "permissions", 
-  "parenttype": "DocType", 
-  "read": 1, 
-  "report": 0, 
-  "role": "Website Manager", 
-  "submit": 0
- }, 
- {
-  "doctype": "DocType", 
-  "name": "Style Settings"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "color", 
-  "fieldtype": "Section Break", 
-  "label": "Color"
- }, 
- {
-  "description": "If image is selected, color will be ignored (attach first)", 
-  "doctype": "DocField", 
-  "fieldname": "background_image", 
-  "fieldtype": "Select", 
-  "label": "Background Image", 
-  "options": "attach_files:"
- }, 
- {
-  "description": "Solid background color (default light gray)", 
-  "doctype": "DocField", 
-  "fieldname": "background_color", 
-  "fieldtype": "Data", 
-  "label": "Background Color"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "page_background", 
-  "fieldtype": "Data", 
-  "label": "Page Background"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "page_border", 
-  "fieldtype": "Check", 
-  "label": "Page Border"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "page_headings", 
-  "fieldtype": "Data", 
-  "label": "Page Headings"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "page_text", 
-  "fieldtype": "Data", 
-  "label": "Page Text"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "page_links", 
-  "fieldtype": "Data", 
-  "label": "Page Links"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "cb0", 
-  "fieldtype": "Column Break", 
-  "label": "Top Bar", 
-  "print_width": "50%", 
-  "width": "50%"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "top_bar_background", 
-  "fieldtype": "Data", 
-  "label": "Top Bar Background"
- }, 
- {
-  "description": "000 is black, fff is white", 
-  "doctype": "DocField", 
-  "fieldname": "top_bar_foreground", 
-  "fieldtype": "Data", 
-  "label": "Top Bar Text"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "fonts", 
-  "fieldtype": "Section Break", 
-  "label": "Fonts"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "heading_font", 
-  "fieldtype": "Select", 
-  "label": "Font (Heading)", 
-  "options": "\nHelvetica Neue\nLucida Grande\nVerdana\nArial\nGeorgia\nTahoma\nLato\nOpen Sans"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "font", 
-  "fieldtype": "Select", 
-  "label": "Font (Text)", 
-  "options": "\nHelvetica Neue\nLucida Grande\nVerdana\nArial\nGeorgia\nTahoma"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "font_size", 
-  "fieldtype": "Select", 
-  "label": "Font Size (Text)", 
-  "options": "\n12px\n13px\n14px\n15px\n16px"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "heading_text_as", 
-  "fieldtype": "Select", 
-  "label": "Heading Text As", 
-  "options": "\nUPPERCASE\nTitle Case\nlowercase"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "column_break_13", 
-  "fieldtype": "Column Break"
- }, 
- {
-  "description": "Add the name of <a href=\"http://google.com/webfonts\" target=\"_blank\">Google Web Font</a> e.g. \"Open Sans\"", 
-  "doctype": "DocField", 
-  "fieldname": "google_web_font_for_heading", 
-  "fieldtype": "Data", 
-  "label": "Google Web Font (Heading)"
- }, 
- {
-  "description": "Add the name of <a href=\"http://google.com/webfonts\" target=\"_blank\">Google Web Font</a> e.g. \"Open Sans\"", 
-  "doctype": "DocField", 
-  "fieldname": "google_web_font_for_text", 
-  "fieldtype": "Data", 
-  "label": "Google Web Font (Text)"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "css", 
-  "fieldtype": "Section Break", 
-  "label": "CSS"
- }, 
- {
-  "description": "add your own CSS (careful!)", 
-  "doctype": "DocField", 
-  "fieldname": "add_css", 
-  "fieldtype": "Code", 
-  "label": "Add CSS"
- }, 
- {
-  "description": "Auto generated", 
-  "doctype": "DocField", 
-  "fieldname": "custom_css", 
-  "fieldtype": "Code", 
-  "label": "Custom CSS", 
-  "read_only": 1
- }, 
- {
-  "create": 1, 
-  "doctype": "DocPerm", 
-  "permlevel": 0, 
-  "write": 1
- }, 
- {
-  "amend": 0, 
-  "cancel": 0, 
-  "create": 0, 
-  "doctype": "DocPerm", 
-  "permlevel": 1
- }
-]
\ No newline at end of file
diff --git a/website/doctype/top_bar_item/README.md b/website/doctype/top_bar_item/README.md
deleted file mode 100644
index 3300367..0000000
--- a/website/doctype/top_bar_item/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Link in the header or footer of the website.
\ No newline at end of file
diff --git a/website/doctype/top_bar_item/__init__.py b/website/doctype/top_bar_item/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/website/doctype/top_bar_item/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/website/doctype/top_bar_item/top_bar_item.py b/website/doctype/top_bar_item/top_bar_item.py
deleted file mode 100644
index 26d0f76..0000000
--- a/website/doctype/top_bar_item/top_bar_item.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. 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/website/doctype/top_bar_item/top_bar_item.txt b/website/doctype/top_bar_item/top_bar_item.txt
deleted file mode 100644
index 58d101e..0000000
--- a/website/doctype/top_bar_item/top_bar_item.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-[
- {
-  "creation": "2013-02-22 01:28:08", 
-  "docstatus": 0, 
-  "modified": "2013-07-10 14:54:25", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "doctype": "DocType", 
-  "istable": 1, 
-  "module": "Website", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "in_list_view": 1, 
-  "name": "__common__", 
-  "parent": "Top Bar Item", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0
- }, 
- {
-  "doctype": "DocType", 
-  "name": "Top Bar Item"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "label", 
-  "fieldtype": "Data", 
-  "label": "Label", 
-  "print_width": "120px", 
-  "width": "120px"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "url", 
-  "fieldtype": "Data", 
-  "label": "URL", 
-  "print_width": "200px", 
-  "width": "200px"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "target", 
-  "fieldtype": "Select", 
-  "label": "Target", 
-  "options": "\ntarget = \"_blank\""
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "parent_label", 
-  "fieldtype": "Select", 
-  "label": "Parent Label"
- }
-]
\ No newline at end of file
diff --git a/website/doctype/web_page/README.md b/website/doctype/web_page/README.md
deleted file mode 100644
index 1ef179b..0000000
--- a/website/doctype/web_page/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Static (HTML / JS / CSS) page created by the user for the website.
\ No newline at end of file
diff --git a/website/doctype/web_page/__init__.py b/website/doctype/web_page/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/website/doctype/web_page/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/website/doctype/web_page/web_page.js b/website/doctype/web_page/web_page.js
deleted file mode 100644
index 9e52360..0000000
--- a/website/doctype/web_page/web_page.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-// License: GNU General Public License v3. See license.txt
-
-$.extend(cur_frm.cscript, {
-	layout: function(doc) {
-		if(!doc.__islocal) {
-			if(doc.insert_code) {
-				if(!doc.javascript) {
-					cur_frm.set_value("javascript", 
-						'wn.pages["'+doc.name+'"].onload = function(wrapper) { }');
-				}
-			}
-			if(doc.insert_style) {
-				if(!doc.css) {
-					cur_frm.set_value("css", '#page-'+doc.name+' { }');	
-				}
-			}
-		}
-	},
-	refresh: function(doc) {
-		cur_frm.cscript.layout(doc);
-	},
-	insert_style: function(doc) {
-		cur_frm.cscript.layout(doc);		
-	},
-	insert_code: function(doc) {
-		cur_frm.cscript.layout(doc);		
-	}
-})
\ No newline at end of file
diff --git a/website/doctype/web_page/web_page.py b/website/doctype/web_page/web_page.py
deleted file mode 100644
index dbcd68e..0000000
--- a/website/doctype/web_page/web_page.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-
-class DocType():
-	def __init__(self, d, dl):
-		self.doc, self.doclist = d, dl
-
-	def autoname(self):
-		from webnotes.webutils import page_name
-		self.doc.name = page_name(self.doc.title)
-
-	def on_update(self):
-		from webnotes.webutils import update_page_name
-		update_page_name(self.doc, self.doc.title)
-		self.if_home_clear_cache()
-
-	def if_home_clear_cache(self):
-		"""if home page, clear cache"""
-		if webnotes.conn.get_value("Website Settings", None, "home_page")==self.doc.name:
-			from webnotes.sessions import clear_cache
-			clear_cache('Guest')
-			
-			from webnotes.webutils import clear_cache
-			clear_cache(self.doc.page_name)
-			clear_cache('index')
-			
-	def prepare_template_args(self):
-		if self.doc.slideshow:
-			from website.helpers.slideshow import get_slideshow
-			get_slideshow(self)
-			
-		self.doc.meta_description = self.doc.description
diff --git a/website/doctype/web_page/web_page.txt b/website/doctype/web_page/web_page.txt
deleted file mode 100644
index 34fa266..0000000
--- a/website/doctype/web_page/web_page.txt
+++ /dev/null
@@ -1,154 +0,0 @@
-[
- {
-  "creation": "2013-03-28 10:35:30", 
-  "docstatus": 0, 
-  "modified": "2013-07-05 15:02:45", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "allow_attach": 1, 
-  "description": "Page to show on the website\n", 
-  "doctype": "DocType", 
-  "document_type": "Transaction", 
-  "icon": "icon-file-alt", 
-  "max_attachments": 20, 
-  "module": "Website", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "name": "__common__", 
-  "parent": "Web Page", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0
- }, 
- {
-  "doctype": "DocPerm", 
-  "name": "__common__", 
-  "parent": "Web Page", 
-  "parentfield": "permissions", 
-  "parenttype": "DocType", 
-  "read": 1, 
-  "role": "Website Manager", 
-  "submit": 0
- }, 
- {
-  "doctype": "DocType", 
-  "name": "Web Page"
- }, 
- {
-  "description": "Title / headline of your page", 
-  "doctype": "DocField", 
-  "fieldname": "title", 
-  "fieldtype": "Data", 
-  "label": "Title", 
-  "reqd": 1
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "cb1", 
-  "fieldtype": "Column Break", 
-  "width": "50%"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "published", 
-  "fieldtype": "Check", 
-  "label": "Published"
- }, 
- {
-  "description": "Page url name (auto-generated) (add \".html\")", 
-  "doctype": "DocField", 
-  "fieldname": "page_name", 
-  "fieldtype": "Data", 
-  "in_list_view": 1, 
-  "label": "Page Name", 
-  "read_only": 1
- }, 
- {
-  "description": "Page content", 
-  "doctype": "DocField", 
-  "fieldname": "sb1", 
-  "fieldtype": "Section Break", 
-  "label": "Content"
- }, 
- {
-  "description": "Begin this page with a slideshow of images", 
-  "doctype": "DocField", 
-  "fieldname": "slideshow", 
-  "fieldtype": "Link", 
-  "label": "Slideshow", 
-  "options": "Website Slideshow"
- }, 
- {
-  "description": "Description for page header.", 
-  "doctype": "DocField", 
-  "fieldname": "description", 
-  "fieldtype": "Small Text", 
-  "label": "Description"
- }, 
- {
-  "description": "Content in markdown format that appears on the main side of your page", 
-  "doctype": "DocField", 
-  "fieldname": "main_section", 
-  "fieldtype": "Text Editor", 
-  "label": "Main Section"
- }, 
- {
-  "description": "Link to other pages in the side bar and next section", 
-  "doctype": "DocField", 
-  "fieldname": "sb2", 
-  "fieldtype": "Section Break", 
-  "label": "More"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "text_align", 
-  "fieldtype": "Select", 
-  "label": "Text Align", 
-  "options": "Left\nCenter\nRight"
- }, 
- {
-  "description": "Add code as &lt;script&gt;", 
-  "doctype": "DocField", 
-  "fieldname": "insert_code", 
-  "fieldtype": "Check", 
-  "label": "Insert Code"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "javascript", 
-  "fieldtype": "Code", 
-  "label": "Javascript", 
-  "options": "Javascript"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "insert_style", 
-  "fieldtype": "Check", 
-  "label": "Insert Style"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "css", 
-  "fieldtype": "Code", 
-  "label": "CSS", 
-  "options": "CSS"
- }, 
- {
-  "create": 1, 
-  "doctype": "DocPerm", 
-  "permlevel": 0, 
-  "report": 1, 
-  "write": 1
- }, 
- {
-  "amend": 0, 
-  "cancel": 0, 
-  "create": 0, 
-  "doctype": "DocPerm", 
-  "permlevel": 1
- }
-]
\ No newline at end of file
diff --git a/website/doctype/website_script/README.md b/website/doctype/website_script/README.md
deleted file mode 100644
index 65af2a1..0000000
--- a/website/doctype/website_script/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Custom javascript to be appended at the end of the page. Used to include 3rd party tracking / analytics tools.
\ No newline at end of file
diff --git a/website/doctype/website_script/__init__.py b/website/doctype/website_script/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/website/doctype/website_script/__init__.py
+++ /dev/null
diff --git a/website/doctype/website_script/website_script.py b/website/doctype/website_script/website_script.py
deleted file mode 100644
index 2a5b9e2..0000000
--- a/website/doctype/website_script/website_script.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# 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
-		
-	def on_update(self):
-		# make js and css
-		from website.helpers.make_web_include_files import make
-		make()
\ No newline at end of file
diff --git a/website/doctype/website_script/website_script.txt b/website/doctype/website_script/website_script.txt
deleted file mode 100644
index ae22a34..0000000
--- a/website/doctype/website_script/website_script.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-[
- {
-  "creation": "2012-12-27 11:51:24", 
-  "docstatus": 0, 
-  "modified": "2013-07-05 15:02:48", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "description": "Script to attach to all web pages.", 
-  "doctype": "DocType", 
-  "document_type": "Other", 
-  "icon": "icon-code", 
-  "issingle": 1, 
-  "module": "Website", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "javascript", 
-  "fieldtype": "Code", 
-  "label": "Javascript", 
-  "name": "__common__", 
-  "options": "Javascript", 
-  "parent": "Website Script", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0
- }, 
- {
-  "create": 1, 
-  "doctype": "DocPerm", 
-  "name": "__common__", 
-  "parent": "Website Script", 
-  "parentfield": "permissions", 
-  "parenttype": "DocType", 
-  "permlevel": 0, 
-  "read": 1, 
-  "role": "Website Manager", 
-  "write": 1
- }, 
- {
-  "doctype": "DocType", 
-  "name": "Website Script"
- }, 
- {
-  "doctype": "DocField"
- }, 
- {
-  "doctype": "DocPerm"
- }
-]
\ No newline at end of file
diff --git a/website/doctype/website_settings/README.md b/website/doctype/website_settings/README.md
deleted file mode 100644
index 8e654fc..0000000
--- a/website/doctype/website_settings/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Overall website settings. Including banners, items appearing in the top and bottom menus, tracking code for Google Analytics etc.
\ No newline at end of file
diff --git a/website/doctype/website_settings/__init__.py b/website/doctype/website_settings/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/website/doctype/website_settings/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/website/doctype/website_settings/website_settings.js b/website/doctype/website_settings/website_settings.js
deleted file mode 100644
index 21b55be..0000000
--- a/website/doctype/website_settings/website_settings.js
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-// License: GNU General Public License v3. See license.txt
-
-// update parent select
-
-$.extend(cur_frm.cscript, {
-	refresh: function(doc) {
-		cur_frm.add_custom_button("Auto Build Website", function() {
-			cur_frm.call({
-				doc: cur_frm.doc,
-				method: "make_website"
-			})
-		}, 'icon-magic')
-	},
-	onload_post_render: function(doc) {
-		this.set_parent_label_options();
-	},
-	
-	label: function(doc, cdt, cdn) {
-		var item = wn.model.get_doc(cdt, cdn);
-		if(item.parentfield === "top_bar_items") {
-			this.set_parent_label_options();
-		}
-	},
-	
-	parent_label: function(doc, cdt, cdn) {
-		this.label(doc, cdt, cdn);
-	},
-	
-	url: function(doc, cdt, cdn) {
-		this.label(doc, cdt, cdn);
-	},
-	
-	set_parent_label_options: function() {
-		wn.meta.get_docfield("Top Bar Item", "parent_label", cur_frm.docname).options = 
-			this.get_parent_options("top_bar_items");
-		
-		if($(cur_frm.fields_dict.top_bar_items.grid.wrapper).find(".grid-row-open")) {
-			cur_frm.fields_dict.top_bar_items.grid.refresh();
-		}
-	},
-	
-	// get labels of parent items
-	get_parent_options: function(table_field) {
-		var items = getchildren('Top Bar Item', cur_frm.doc.name, table_field);
-		var main_items = [''];
-		for(var i in items) {
-			var d = items[i];
-			if(!d.parent_label && !d.url && d.label) {
-				main_items.push(d.label);
-			}
-		}
-		return main_items.join('\n');
-	}
-});
-
-cur_frm.cscript.set_banner_from_image = function(doc) {
-	if(!doc.banner_image) {
-		msgprint(wn._("Select a Banner Image first."));
-	}
-	var src = doc.banner_image;
-	cur_frm.set_value("banner_html", "<a href='/'><img src='"+ src
-		+"' style='max-width: 200px;'></a>");
-}
\ No newline at end of file
diff --git a/website/doctype/website_settings/website_settings.py b/website/doctype/website_settings/website_settings.py
deleted file mode 100644
index 5d6c874..0000000
--- a/website/doctype/website_settings/website_settings.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-from webnotes import _, msgprint
-
-class DocType:
-	def __init__(self, d, dl):
-		self.doc, self.doclist = d, dl
-		
-	def validate(self):
-		self.set_home_page()
-		self.validate_top_bar_items()
-		self.validate_footer_items()
-		
-	def make_website(self):
-		# set item pages
-		for name in webnotes.conn.sql_list("""select name from tabItem where 
-			ifnull(show_in_website, 0)=0 and is_sales_item ='Yes' """):
-			webnotes.msgprint("Setting 'Show in Website' for:" + name)
-			item = webnotes.bean("Item", name)
-			item.doc.show_in_website = 1
-			item.doc.website_warehouse = item.doc.default_warehouse
-			item.doc.website_image = item.doc.image
-			item.save()
-		
-		# set item group pages
-		for name in webnotes.conn.sql_list("""select name from `tabItem Group` where 
-			ifnull(show_in_website, 0)=0 and exists (select name from tabItem where 
-				ifnull(show_in_website, 0)=1)"""):
-			webnotes.msgprint("Setting 'Show in Website' for:" + name)
-			item_group = webnotes.bean("Item Group", name)
-			item_group.doc.show_in_website = 1
-			item_group.save()
-			
-	def validate_top_bar_items(self):
-		"""validate url in top bar items"""
-		for top_bar_item in self.doclist.get({"parentfield": "top_bar_items"}):
-			if top_bar_item.parent_label:
-				parent_label_item = self.doclist.get({"parentfield": "top_bar_items", 
-					"label": top_bar_item.parent_label})
-				
-				if not parent_label_item:
-					# invalid item
-					msgprint(_(self.meta.get_label("parent_label", parentfield="top_bar_items")) +
-						(" \"%s\": " % top_bar_item.parent_label) + _("does not exist"), raise_exception=True)
-				
-				elif not parent_label_item[0] or parent_label_item[0].url:
-					# parent cannot have url
-					msgprint(_("Top Bar Item") + (" \"%s\": " % top_bar_item.parent_label) +
-						_("cannot have a URL, because it has child item(s)"), raise_exception=True)
-	
-	def validate_footer_items(self):
-		"""clear parent label in footer"""
-		for footer_item in self.doclist.get({"parentfield": "footer_items"}):
-			footer_item.parent_label = None
-
-	def on_update(self):
-		# make js and css
-		from website.helpers.make_web_include_files import make
-		make()
-		
-		# clear web cache (for menus!)
-		from webnotes.webutils import clear_cache
-		clear_cache()
-
-	def set_home_page(self):
-		from webnotes.model.doc import Document
-		webnotes.conn.sql("""delete from `tabDefault Home Page` where role='Guest'""")
-		
-		d = Document('Default Home Page')
-		d.parent = 'Control Panel'
-		d.parenttype = 'Control Panel'
-		d.parentfield = 'default_home_pages'
-		d.role = 'Guest'
-		d.home_page = self.doc.home_page
-		d.save()
\ No newline at end of file
diff --git a/website/doctype/website_settings/website_settings.txt b/website/doctype/website_settings/website_settings.txt
deleted file mode 100644
index f8ceafe..0000000
--- a/website/doctype/website_settings/website_settings.txt
+++ /dev/null
@@ -1,249 +0,0 @@
-[
- {
-  "creation": "2013-04-30 12:58:46", 
-  "docstatus": 0, 
-  "modified": "2013-07-10 20:37:38", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "allow_attach": 1, 
-  "doctype": "DocType", 
-  "document_type": "Other", 
-  "icon": "icon-cog", 
-  "issingle": 1, 
-  "max_attachments": 10, 
-  "module": "Website", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "name": "__common__", 
-  "parent": "Website Settings", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0
- }, 
- {
-  "doctype": "DocPerm", 
-  "name": "__common__", 
-  "parent": "Website Settings", 
-  "parentfield": "permissions", 
-  "parenttype": "DocType", 
-  "read": 1, 
-  "report": 0, 
-  "submit": 0
- }, 
- {
-  "doctype": "DocType", 
-  "name": "Website Settings"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "sb0", 
-  "fieldtype": "Section Break", 
-  "label": "Landing Page"
- }, 
- {
-  "description": "The \"Web Page\" that is the website home page", 
-  "doctype": "DocField", 
-  "fieldname": "home_page", 
-  "fieldtype": "Link", 
-  "label": "Home Page", 
-  "options": "Web Page", 
-  "reqd": 0
- }, 
- {
-  "description": "The name of your company / website as you want to appear on browser title bar. All pages will have this as the prefix to the title.", 
-  "doctype": "DocField", 
-  "fieldname": "title_prefix", 
-  "fieldtype": "Data", 
-  "label": "Title Prefix"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "cb4", 
-  "fieldtype": "Column Break"
- }, 
- {
-  "description": "If checked, the Home page will be the default Item Group for the website.", 
-  "doctype": "DocField", 
-  "fieldname": "home_page_is_products", 
-  "fieldtype": "Check", 
-  "label": "Home Page is Products"
- }, 
- {
-  "description": "Add a banner to the site. (small banners are usually good)", 
-  "doctype": "DocField", 
-  "fieldname": "banner", 
-  "fieldtype": "Section Break", 
-  "label": "Banner"
- }, 
- {
-  "description": "Select an image of approx width 150px with a transparent background for best results.", 
-  "doctype": "DocField", 
-  "fieldname": "banner_image", 
-  "fieldtype": "Select", 
-  "label": "Banner Image", 
-  "options": "attach_files:"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "set_banner_from_image", 
-  "fieldtype": "Button", 
-  "label": "Set Banner from Image"
- }, 
- {
-  "description": "Banner is above the Top Menu Bar.", 
-  "doctype": "DocField", 
-  "fieldname": "banner_html", 
-  "fieldtype": "Small Text", 
-  "label": "Banner HTML"
- }, 
- {
-  "description": "Menu items in the Top Bar. For setting the color of the Top Bar, go to <a href=\"#Form/Style Settings\">Style Settings</a>", 
-  "doctype": "DocField", 
-  "fieldname": "top_bar", 
-  "fieldtype": "Section Break", 
-  "label": "Top Bar"
- }, 
- {
-  "description": "Brand is what appears on the top-right of the toolbar. If it is an image, make sure it\nhas a transparent background and use the &lt;img /&gt; tag. Keep size as 200px x 30px", 
-  "doctype": "DocField", 
-  "fieldname": "brand_html", 
-  "fieldtype": "Small Text", 
-  "label": "Brand HTML"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "top_bar_items", 
-  "fieldtype": "Table", 
-  "label": "Top Bar Items", 
-  "options": "Top Bar Item"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "footer", 
-  "fieldtype": "Section Break", 
-  "label": "Footer"
- }, 
- {
-  "description": "Address and other legal information you may want to put in the footer.", 
-  "doctype": "DocField", 
-  "fieldname": "address", 
-  "fieldtype": "Text Editor", 
-  "label": "Address"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "copyright", 
-  "fieldtype": "Data", 
-  "label": "Copyright"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "footer_items", 
-  "fieldtype": "Table", 
-  "label": "Footer Items", 
-  "options": "Top Bar Item"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "integrations", 
-  "fieldtype": "Section Break", 
-  "label": "Integrations"
- }, 
- {
-  "description": "Add Google Analytics ID: eg. UA-89XXX57-1. Please search help on Google Analytics for more information.", 
-  "doctype": "DocField", 
-  "fieldname": "google_analytics_id", 
-  "fieldtype": "Data", 
-  "label": "Google Analytics ID"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "column_break_17", 
-  "fieldtype": "Column Break"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "google_plus_one", 
-  "fieldtype": "Check", 
-  "label": "Google Plus One"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "facebook_share", 
-  "fieldtype": "Check", 
-  "label": "Facebook Share"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "linked_in_share", 
-  "fieldtype": "Check", 
-  "label": "Linked In Share"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "twitter_share", 
-  "fieldtype": "Check", 
-  "label": "Twitter Share"
- }, 
- {
-  "description": "Tweet will be shared via your user account (if specified)", 
-  "doctype": "DocField", 
-  "fieldname": "twitter_share_via", 
-  "fieldtype": "Data", 
-  "label": "Twitter Share via"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "misc_section", 
-  "fieldtype": "Section Break", 
-  "label": "Misc"
- }, 
- {
-  "description": "An icon file with .ico extension. Should be 16 x 16 px. Generated using a favicon generator. [<a href=\"http://favicon-generator.org/\" target=\"_blank\">favicon-generator.org</a>]", 
-  "doctype": "DocField", 
-  "fieldname": "favicon", 
-  "fieldtype": "Select", 
-  "label": "FavIcon", 
-  "options": "attach_files:"
- }, 
- {
-  "description": "Sub-domain provided by erpnext.com", 
-  "doctype": "DocField", 
-  "fieldname": "subdomain", 
-  "fieldtype": "Text", 
-  "label": "Subdomain", 
-  "read_only": 1, 
-  "reqd": 0
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "column_break_28", 
-  "fieldtype": "Column Break"
- }, 
- {
-  "description": "Disable Customer Signup link in Login page", 
-  "doctype": "DocField", 
-  "fieldname": "disable_signup", 
-  "fieldtype": "Check", 
-  "label": "Disable Signup"
- }, 
- {
-  "create": 1, 
-  "doctype": "DocPerm", 
-  "permlevel": 0, 
-  "role": "Website Manager", 
-  "write": 1
- }, 
- {
-  "amend": 0, 
-  "cancel": 0, 
-  "create": 0, 
-  "doctype": "DocPerm", 
-  "permlevel": 1, 
-  "role": "All"
- }
-]
\ No newline at end of file
diff --git a/website/doctype/website_slideshow/README.md b/website/doctype/website_slideshow/README.md
deleted file mode 100644
index e6afaed..0000000
--- a/website/doctype/website_slideshow/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Image slide show for Web Page, Product (Item) page, Item Group page.
\ No newline at end of file
diff --git a/website/doctype/website_slideshow/__init__.py b/website/doctype/website_slideshow/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/website/doctype/website_slideshow/__init__.py
+++ /dev/null
diff --git a/website/doctype/website_slideshow/website_slideshow.js b/website/doctype/website_slideshow/website_slideshow.js
deleted file mode 100644
index a28e1c7..0000000
--- a/website/doctype/website_slideshow/website_slideshow.js
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-// License: GNU General Public License v3. See license.txt
-
-cur_frm.cscript.refresh = function(doc) {
-	cur_frm.set_intro("");
-	if(doc.__islocal) {
-		cur_frm.set_intro("First set the name and save the record.");
-	}
-	else {
-		cur_frm.set_intro("Attach files / urls and add in table.");
-	}
-}
\ No newline at end of file
diff --git a/website/doctype/website_slideshow/website_slideshow.py b/website/doctype/website_slideshow/website_slideshow.py
deleted file mode 100644
index 8bc0447..0000000
--- a/website/doctype/website_slideshow/website_slideshow.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# 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
-		
-	def on_update(self):
-		# a slide show can be in use and any change in it should get reflected
-		from webnotes.webutils import clear_cache
-		clear_cache()
\ No newline at end of file
diff --git a/website/doctype/website_slideshow/website_slideshow.txt b/website/doctype/website_slideshow/website_slideshow.txt
deleted file mode 100644
index e8ca08e..0000000
--- a/website/doctype/website_slideshow/website_slideshow.txt
+++ /dev/null
@@ -1,82 +0,0 @@
-[
- {
-  "creation": "2013-03-07 15:53:15", 
-  "docstatus": 0, 
-  "modified": "2013-07-05 15:03:30", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "allow_attach": 1, 
-  "autoname": "field:slideshow_name", 
-  "description": "Slideshow like display for the website", 
-  "doctype": "DocType", 
-  "document_type": "Transaction", 
-  "icon": "icon-play", 
-  "max_attachments": 10, 
-  "module": "Website", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "name": "__common__", 
-  "parent": "Website Slideshow", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0
- }, 
- {
-  "cancel": 1, 
-  "create": 1, 
-  "doctype": "DocPerm", 
-  "name": "__common__", 
-  "parent": "Website Slideshow", 
-  "parentfield": "permissions", 
-  "parenttype": "DocType", 
-  "permlevel": 0, 
-  "read": 1, 
-  "report": 1, 
-  "role": "Website Manager", 
-  "submit": 0, 
-  "write": 1
- }, 
- {
-  "doctype": "DocType", 
-  "name": "Website Slideshow"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "slideshow_name", 
-  "fieldtype": "Data", 
-  "label": "Slideshow Name", 
-  "read_only": 0, 
-  "reqd": 1
- }, 
- {
-  "depends_on": "eval:!doc.__islocal", 
-  "description": "Note: For best results, images must be of the same size and width must be greater than height.", 
-  "doctype": "DocField", 
-  "fieldname": "sb0", 
-  "fieldtype": "Section Break", 
-  "label": "Slideshow Items"
- }, 
- {
-  "depends_on": "eval:!doc.__islocal", 
-  "doctype": "DocField", 
-  "fieldname": "slideshow_items", 
-  "fieldtype": "Table", 
-  "label": "Slideshow Items", 
-  "options": "Website Slideshow Item"
- }, 
- {
-  "depends_on": "eval:!doc.__islocal", 
-  "description": "This goes above the slideshow.", 
-  "doctype": "DocField", 
-  "fieldname": "header", 
-  "fieldtype": "Text Editor", 
-  "label": "Header"
- }, 
- {
-  "doctype": "DocPerm"
- }
-]
\ No newline at end of file
diff --git a/website/doctype/website_slideshow_item/README.md b/website/doctype/website_slideshow_item/README.md
deleted file mode 100644
index 2f52d24..0000000
--- a/website/doctype/website_slideshow_item/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Slide (image) details for Website Slideshow.
\ No newline at end of file
diff --git a/website/doctype/website_slideshow_item/__init__.py b/website/doctype/website_slideshow_item/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/website/doctype/website_slideshow_item/__init__.py
+++ /dev/null
diff --git a/website/doctype/website_slideshow_item/website_slideshow_item.py b/website/doctype/website_slideshow_item/website_slideshow_item.py
deleted file mode 100644
index 784339d..0000000
--- a/website/doctype/website_slideshow_item/website_slideshow_item.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# 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/website/doctype/website_slideshow_item/website_slideshow_item.txt b/website/doctype/website_slideshow_item/website_slideshow_item.txt
deleted file mode 100644
index c6fd78c..0000000
--- a/website/doctype/website_slideshow_item/website_slideshow_item.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-[
- {
-  "creation": "2013-03-07 12:26:33", 
-  "docstatus": 0, 
-  "modified": "2013-07-10 14:54:25", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "allow_attach": 0, 
-  "doctype": "DocType", 
-  "istable": 1, 
-  "max_attachments": 10, 
-  "module": "Website", 
-  "name": "__common__"
- }, 
- {
-  "doctype": "DocField", 
-  "in_list_view": 1, 
-  "name": "__common__", 
-  "parent": "Website Slideshow Item", 
-  "parentfield": "fields", 
-  "parenttype": "DocType", 
-  "permlevel": 0
- }, 
- {
-  "doctype": "DocType", 
-  "name": "Website Slideshow Item"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "image", 
-  "fieldtype": "Select", 
-  "label": "Image", 
-  "options": "attach_files:"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "heading", 
-  "fieldtype": "Data", 
-  "label": "Heading", 
-  "print_width": "200px", 
-  "width": "200px"
- }, 
- {
-  "doctype": "DocField", 
-  "fieldname": "description", 
-  "fieldtype": "Text", 
-  "label": "Description", 
-  "print_width": "200px", 
-  "width": "200px"
- }
-]
\ No newline at end of file
diff --git a/website/helpers/blog.py b/website/helpers/blog.py
deleted file mode 100644
index 3f6d94f..0000000
--- a/website/helpers/blog.py
+++ /dev/null
@@ -1,121 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-import webnotes.webutils
-from webnotes import _
-
-def clear_blog_cache():
-	for blog in webnotes.conn.sql_list("""select page_name from 
-		`tabBlog Post` where ifnull(published,0)=1"""):
-		webnotes.webutils.delete_page_cache(blog)
-	
-	webnotes.webutils.delete_page_cache("writers")
-
-@webnotes.whitelist(allow_guest=True)
-def get_blog_list(start=0, by=None, category=None):
-	import webnotes
-	condition = ""
-	if by:
-		condition = " and t1.blogger='%s'" % by.replace("'", "\'")
-	if category:
-		condition += " and t1.blog_category='%s'" % category.replace("'", "\'")
-	query = """\
-		select
-			t1.title, t1.name, t1.page_name, t1.published_on as creation, 
-				ifnull(t1.blog_intro, t1.content) as content, 
-				t2.full_name, t2.avatar, t1.blogger,
-				(select count(name) from `tabComment` where
-					comment_doctype='Blog Post' and comment_docname=t1.name) as comments
-		from `tabBlog Post` t1, `tabBlogger` t2
-		where ifnull(t1.published,0)=1
-		and t1.blogger = t2.name
-		%(condition)s
-		order by published_on desc, name asc
-		limit %(start)s, 20""" % {"start": start, "condition": condition}
-		
-	result = webnotes.conn.sql(query, as_dict=1)
-
-	# strip html tags from content
-	import webnotes.utils
-	
-	for res in result:
-		from webnotes.utils import global_date_format
-		res['published'] = global_date_format(res['creation'])
-		if not res['content']:
-			res['content'] = webnotes.webutils.get_html(res['page_name'])
-		res['content'] = res['content'][:140]
-		
-	return result
-
-@webnotes.whitelist(allow_guest=True)
-def add_comment(args=None):
-	"""
-		args = {
-			'comment': '',
-			'comment_by': '',
-			'comment_by_fullname': '',
-			'comment_doctype': '',
-			'comment_docname': '',
-			'page_name': '',
-		}
-	"""
-	import webnotes
-	import webnotes.utils, markdown2
-	
-	if not args: args = webnotes.form_dict
-	args['comment'] = unicode(markdown2.markdown(args.get('comment') or ''))
-	args['doctype'] = "Comment"
-	
-	page_name = args.get("page_name")
-	if "page_name" in args:
-		del args["page_name"]
-	if "cmd" in args:
-		del args["cmd"]
-		
-	comment = webnotes.bean(args)
-	comment.ignore_permissions = True
-	comment.insert()
-	
-	# since comments are embedded in the page, clear the web cache
-	webnotes.webutils.clear_cache(page_name)
-	
-	args['comment_date'] = webnotes.utils.global_date_format(comment.doc.creation)
-	template_args = { 'comment_list': [args], 'template': 'app/website/templates/html/comment.html' }
-	
-	# get html of comment row
-	comment_html = webnotes.webutils.build_html(template_args)
-	
-	# notify commentors 
-	commentors = [d[0] for d in webnotes.conn.sql("""select comment_by from tabComment where
-		comment_doctype='Blog Post' and comment_docname=%s and
-		ifnull(unsubscribed, 0)=0""", args.get('comment_docname'))]
-	
-	blog = webnotes.doc("Blog Post", args.get("comment_docname"))
-	blogger_profile = webnotes.conn.get_value("Blogger", blog.blogger, "profile")
-	blogger_email = webnotes.conn.get_value("Profile", blogger_profile, "email")
-	
-	from webnotes.utils.email_lib.bulk import send
-	send(recipients=list(set(commentors + [blogger_email])), 
-		doctype='Comment', 
-		email_field='comment_by', 
-		subject='New Comment on Blog: ' + blog.title, 
-		message='%(comment)s<p>By %(comment_by_fullname)s</p>' % args,
-		ref_doctype='Blog Post', ref_docname=blog.name)
-	
-	return comment_html.replace("\n", "")
-
-def get_blog_content(blog_page_name):
-	import webnotes.webutils
-	content = webnotes.webutils.get_html(blog_page_name)
-	import webnotes.utils
-	content = webnotes.utils.escape_html(content)
-	return content
-
-def get_blog_template_args():
-	args = {
-		"categories": webnotes.conn.sql_list("select name from `tabBlog Category` order by name")
-	}
-	args.update(webnotes.doc("Blog Settings", "Blog Settings").fields)
-	return args
diff --git a/website/helpers/blog_feed.py b/website/helpers/blog_feed.py
deleted file mode 100644
index 577cde6..0000000
--- a/website/helpers/blog_feed.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt 
-
-from __future__ import unicode_literals
-"""
-Generate RSS feed for blog
-"""
-
-rss = u"""<?xml version="1.0" encoding="UTF-8" ?>
-<rss version="2.0">
-<channel>
-        <title>%(title)s</title>
-        <description>%(description)s</description>
-        <link>%(link)s</link>
-        <lastBuildDate>%(modified)s</lastBuildDate>
-        <pubDate>%(modified)s</pubDate>
-        <ttl>1800</ttl>
-		%(items)s
-</channel>
-</rss>"""
-
-rss_item = u"""
-<item>
-        <title>%(title)s</title>
-        <description>%(content)s</description>
-        <link>%(link)s</link>
-        <guid>%(name)s</guid>
-        <pubDate>%(published_on)s</pubDate>
-</item>"""
-
-def generate():
-	"""generate rss feed"""
-	import os, urllib
-	import webnotes
-	from webnotes.model.doc import Document
-	from webnotes.utils import escape_html
-	
-	host = (os.environ.get('HTTPS') and 'https://' or 'http://') + os.environ.get('HTTP_HOST')
-	
-	items = ''
-	blog_list = webnotes.conn.sql("""\
-		select page_name as name, published_on, modified, title, content from `tabBlog Post` 
-		where ifnull(published,0)=1
-		order by published_on desc limit 20""", as_dict=1)
-
-	for blog in blog_list:
-		blog.link = urllib.quote(host + '/' + blog.name + '.html')
-		blog.content = escape_html(blog.content or "")
-		
-		items += rss_item % blog
-
-	modified = max((blog['modified'] for blog in blog_list))
-		
-	ws = Document('Website Settings', 'Website Settings')
-	return (rss % {
-				'title': ws.title_prefix,
-				'description': ws.description or (ws.title_prefix + ' Blog'),
-				'modified': modified,
-				'items': items,
-				'link': host + '/blog.html'
-			}).encode('utf-8', 'ignore')
diff --git a/website/helpers/contact.py b/website/helpers/contact.py
deleted file mode 100644
index 35446a3..0000000
--- a/website/helpers/contact.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-
-import webnotes
-from webnotes.utils import now
-
-max_communications_per_hour = 300
-
-@webnotes.whitelist(allow_guest=True)
-def send_message(subject="Website Query", message="", sender="", status="Open"):
-	if not message:
-		webnotes.response["message"] = 'Please write something'
-		return
-		
-	if not sender:
-		webnotes.response["message"] = 'Email Id Required'
-		return
-
-	# make lead / communication
-	from selling.doctype.lead.get_leads import add_sales_communication
-	message = add_sales_communication(subject or "Website Query", message, sender, sender, 
-		mail=None, status=status)
-	
-	# guest method, cap max writes per hour
-	if webnotes.conn.sql("""select count(*) from `tabCommunication`
-		where TIMEDIFF(%s, modified) < '01:00:00'""", now())[0][0] > max_communications_per_hour:
-		webnotes.response["message"] = "Sorry: we believe we have received an unreasonably high number of requests of this kind. Please try later"
-		return
-	
-	webnotes.response.status = "okay"
diff --git a/website/helpers/make_web_include_files.py b/website/helpers/make_web_include_files.py
deleted file mode 100644
index a9df23b..0000000
--- a/website/helpers/make_web_include_files.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-import os
-import webnotes
-
-def make():
-	from startup.webutils import get_home_page
-
-	if not webnotes.conn:
-		webnotes.connect()
-	
-	home_page = get_home_page()
-
-	fname = 'js/wn-web.js'
-	if os.path.basename(os.path.abspath('.'))!='public':
-		fname = os.path.join('public', fname)
-			
-	with open(fname, 'w') as f:
-		f.write(get_web_script())
-
-	fname = 'css/wn-web.css'
-	if os.path.basename(os.path.abspath('.'))!='public':
-		fname = os.path.join('public', fname)
-
-	# style - wn.css
-	with open(fname, 'w') as f:
-		f.write(get_web_style())
-
-def get_web_script():
-	"""returns web startup script"""
-	user_script = ""
-	
-	ws = webnotes.doc("Website Settings", "Website Settings")
-
-	if ws.google_analytics_id:
-		user_script += google_analytics_template % ws.google_analytics_id
-	
-	user_script += (webnotes.conn.get_value('Website Script', None, 'javascript') or '')
-
-	return user_script
-	
-def get_web_style():
-	"""returns web css"""
-	return webnotes.conn.get_value('Style Settings', None, 'custom_css') or ''
-
-google_analytics_template = """
-
-// Google Analytics template
-
-window._gaq = window._gaq || [];
-window._gaq.push(['_setAccount', '%s']);
-window._gaq.push(['_trackPageview']);
-
-(function() {
-    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-})();
-"""
\ No newline at end of file
diff --git a/website/helpers/partner.py b/website/helpers/partner.py
deleted file mode 100644
index 404894e..0000000
--- a/website/helpers/partner.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-
-def get_partner_args():
-	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/website/helpers/sitemap.py b/website/helpers/sitemap.py
deleted file mode 100644
index fb0d070..0000000
--- a/website/helpers/sitemap.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-
-frame_xml = """<?xml version="1.0" encoding="UTF-8"?>
-<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">%s
-</urlset>"""
-
-link_xml = """\n<url><loc>%s</loc><lastmod>%s</lastmod></url>"""
-
-# generate the sitemap XML
-def generate(domain):
-	global frame_xml, link_xml
-	import urllib, os
-	import webnotes
-	import webnotes.webutils
-	from webnotes.utils import nowdate
-
-	# settings
-	max_items = 1000
-	count = 0
-	
-	site_map = ''
-	if domain:
-		today = nowdate()
-		
-		# generated pages
-		for doctype, opts in webnotes.webutils.get_generators().items():
-			pages = webnotes.conn.sql("""select page_name, `modified`
-				from `tab%s` where ifnull(%s,0)=1
-				order by modified desc""" % (doctype, opts.get("condition_field")))
-		
-			for p in pages:
-				if count >= max_items: break
-				if p[0]:
-					page_url = os.path.join(domain, urllib.quote(p[0]))
-					modified = p[1].strftime('%Y-%m-%d')
-					site_map += link_xml % (page_url, modified)
-					count += 1
-				
-			if count >= max_items: break
-		
-		# standard pages
-		for page, opts in webnotes.get_config()["web"]["pages"].items():
-			if "no_cache" in opts:
-				continue
-			
-			if count >= max_items: break
-			page_url = os.path.join(domain, urllib.quote(page))
-			modified = today
-			site_map += link_xml % (page_url, modified)
-			count += 1
-
-	return frame_xml % site_map
diff --git a/website/helpers/slideshow.py b/website/helpers/slideshow.py
deleted file mode 100644
index 7e3c398..0000000
--- a/website/helpers/slideshow.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-import webnotes
-
-def get_slideshow(obj):
-	slideshow = webnotes.bean("Website Slideshow", obj.doc.slideshow)
-	obj.slides = slideshow.doclist.get({"doctype":"Website Slideshow Item"})
-	obj.doc.slideshow_header = slideshow.doc.header or ""
-	
\ No newline at end of file
diff --git a/website/helpers/transaction.py b/website/helpers/transaction.py
deleted file mode 100644
index 8943575..0000000
--- a/website/helpers/transaction.py
+++ /dev/null
@@ -1,139 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import webnotes
-from webnotes.utils import cint, formatdate
-import json
-
-def get_transaction_list(doctype, start):
-	# find customer id
-	customer = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user}, 
-		"customer")
-		
-	if customer:
-		transactions = webnotes.conn.sql("""select name, creation, currency, grand_total_export 
-			from `tab%s` where customer=%s and docstatus=1
-			order by creation desc
-			limit %s, 20""" % (doctype, "%s", "%s"), (customer, cint(start)), as_dict=True)
-		for doc in transactions:
-			doc.items = ", ".join(webnotes.conn.sql_list("""select item_name
-				from `tab%s Item` where parent=%s limit 5""" % (doctype, "%s"), doc.name))
-			doc.creation = formatdate(doc.creation)
-		return transactions
-	else:
-		return []
-		
-def get_common_args():
-	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""")))
-	}
-
-@webnotes.whitelist()
-def get_orders(start=0):
-	return get_transaction_list("Sales Order", start)
-		
-def order_list_args():
-	args = get_common_args()
-	args.update({
-		"title": "My Orders",
-		"method": "website.helpers.transaction.get_orders",
-		"icon": "icon-list",
-		"empty_list_message": "No Orders Yet",
-		"page": "order",
-	})
-	return args
-
-@webnotes.whitelist()
-def get_invoices(start=0):
-	return get_transaction_list("Sales Invoice", start)
-
-def invoice_list_args():
-	args = get_common_args()
-	args.update({
-		"title": "Invoices",
-		"method": "website.helpers.transaction.get_invoices",
-		"icon": "icon-file-text",
-		"empty_list_message": "No Invoices Found",
-		"page": "invoice"
-	})
-	return args
-
-@webnotes.whitelist()
-def get_shipments(start=0):
-	return get_transaction_list("Delivery Note", start)
-
-def shipment_list_args():
-	args = get_common_args()
-	args.update({
-		"title": "Shipments",
-		"method": "website.helpers.transaction.get_shipments",
-		"icon": "icon-truck",
-		"empty_list_message": "No Shipments Found",
-		"page": "shipment"
-	})
-	return args
-	
-@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
-	
-def ticket_list_args():
-	return {
-		"title": "My Tickets",
-		"method": "website.helpers.transaction.get_tickets",
-		"icon": "icon-ticket",
-		"empty_list_message": "No Tickets Raised",
-		"page": "ticket"
-	}
-	
-def get_transaction_args(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
-		}
-
-def get_order_args():	
-	args = get_transaction_args("Sales Order", webnotes.form_dict.name)
-	args.update({
-		"parent_link": "orders",
-		"parent_title": "My Orders"
-	})
-	return args
-	
-def get_invoice_args():
-	args = get_transaction_args("Sales Invoice", webnotes.form_dict.name)
-	args.update({
-		"parent_link": "invoices",
-		"parent_title": "Invoices"
-	})
-	return args
-
-def get_shipment_args():
-	args = get_transaction_args("Delivery Note", webnotes.form_dict.name)
-	args.update({
-		"parent_link": "shipments",
-		"parent_title": "Shipments"
-	})
-	return args
diff --git a/website/page/__init__.py b/website/page/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/website/page/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/website/page/website_home/__init__.py b/website/page/website_home/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/website/page/website_home/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/website/page/website_home/website_home.js b/website/page/website_home/website_home.js
deleted file mode 100644
index a197f69..0000000
--- a/website/page/website_home/website_home.js
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-// License: GNU General Public License v3. See license.txt"
-
-wn.module_page["Website"] = [
-	{
-		title: wn._("Web Content"),
-		icon: "icon-copy",
-		top: true,
-		items: [
-			{
-				label: wn._("Web Page"),
-				description: wn._("Content web page."),
-				doctype:"Web Page"
-			},
-			{
-				label: wn._("Blog Post"),
-				description: wn._("Single Post (article)."),
-				doctype:"Blog Post"
-			},
-		]
-	},
-	{
-		title: wn._("Documents"),
-		icon: "icon-edit",
-		items: [
-			{
-				label: wn._("Website Slideshow"),
-				description: wn._("Embed image slideshows in website pages."),
-				doctype:"Website Slideshow"
-			},
-			{
-				label: wn._("Blogger"),
-				description: wn._("Profile of a blog writer."),
-				doctype:"Blogger"
-			},
-			{
-				label: wn._("Blog Category"),
-				description: wn._("Categorize blog posts."),
-				doctype:"Blog Category"
-			},
-			{
-				label: wn._("Blog Settings"),
-				description: wn._("Write titles and introductions to your blog."),
-				doctype:"Blog Settings",
-				route: "Form/Blog Settings"
-			},
-		]
-	},
-
-	{
-		title: wn._("Website Overall Settings"),
-		icon: "icon-wrench",
-		right: true,
-		items: [
-			{
-				"route":"Form/Website Settings",
-				"label":wn._("Website Settings"),
-				"description":wn._("Setup of top navigation bar, footer and logo."),
-				doctype:"Website Settings"
-			},
-			{
-				"route":"Form/Style Settings",
-				"label":wn._("Style Settings"),
-				"description":wn._("Setup of fonts and background."),
-				doctype:"Style Settings"
-			},
-			{
-				"route":"Form/Shopping Cart Settings",
-				"label":wn._("Shopping Cart Settings"),
-				"description":wn._("Setup of Shopping Cart."),
-				doctype:"Shopping Cart Settings"
-			},
-		]
-	},
-	{
-		title: wn._("Special Page Settings"),
-		icon: "icon-wrench",
-		right: true,
-		items: [
-			{
-				"route":"Form/About Us Settings",
-				"label":wn._("About Us Settings"),
-				"description":wn._("Settings for About Us Page."),
-				doctype:"About Us Settings"
-			},
-			{
-				"route":"Form/Contact Us Settings",
-				"label":wn._("Contact Us Settings"),
-				"description":wn._("Settings for Contact Us Page."),
-				doctype:"Contact Us Settings"
-			},
-		]
-	},
-	{
-		title: wn._("Advanced Scripting"),
-		icon: "icon-wrench",
-		right: true,
-		items: [
-			{
-				"route":"Form/Website Script",
-				"label":wn._("Website Script"),
-				"description":wn._("Javascript to append to the head section of the page."),
-				doctype:"Website Script"
-			},
-		]
-	}
-]
-
-pscript['onload_website-home'] = function(wrapper) {
-	wn.views.moduleview.make(wrapper, "Website");
-}
\ No newline at end of file
diff --git a/website/page/website_home/website_home.txt b/website/page/website_home/website_home.txt
deleted file mode 100644
index eeede04..0000000
--- a/website/page/website_home/website_home.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-[
- {
-  "creation": "2012-02-21 13:23:51", 
-  "docstatus": 0, 
-  "modified": "2013-07-11 14:45:29", 
-  "modified_by": "Administrator", 
-  "owner": "Administrator"
- }, 
- {
-  "doctype": "Page", 
-  "icon": "icon-th", 
-  "module": "Website", 
-  "name": "__common__", 
-  "page_name": "website-home", 
-  "standard": "Yes", 
-  "title": "Website Home"
- }, 
- {
-  "doctype": "Page", 
-  "name": "website-home"
- }
-]
\ No newline at end of file
diff --git a/website/templates/__init__.py b/website/templates/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/website/templates/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/website/templates/css/blog.css b/website/templates/css/blog.css
deleted file mode 100644
index 199df1a..0000000
--- a/website/templates/css/blog.css
+++ /dev/null
@@ -1,7 +0,0 @@
-	<style>
-		h2 > a, h2 > a:link, h2 > a:visited, h2 > a:active,
-		h2 > a:hover, h2 > a:focus {
-			text-decoration: none;
-			color: inherit;
-		}
-	</style>
\ No newline at end of file
diff --git a/website/templates/css/blog_page.css b/website/templates/css/blog_page.css
deleted file mode 100644
index 8f56cd2..0000000
--- a/website/templates/css/blog_page.css
+++ /dev/null
@@ -1,13 +0,0 @@
-	<style>
-		.comment-title {
-			color:#777;
-		}
-		
-		.comment-content {
-			margin-left: 20px;
-		}
-		
-		input {
-			width: 240px;
-		}
-	</style>
\ No newline at end of file
diff --git a/website/templates/html/blog_footer.html b/website/templates/html/blog_footer.html
deleted file mode 100644
index e71b3ec..0000000
--- a/website/templates/html/blog_footer.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<div class="col-md-12">
-	<hr />
-	{% if categories %}
-	<h5>Explore posts by categories</h5>
-	<ul class="breadcrumb" style="background-color: transparent; padding-left: 20px;">
-	{% for category in categories %}
-		<li><a href="blog?category={{ category }}">{{ category }}</a> 
-	{% endfor %}
-	</ul>
-	<br><br>
-	{% endif %}
-	<p>Show posts by <a href="blog">everyone</a>. Meet the <a href="writers">writers</a> of this blog</p>
-</div>
diff --git a/website/templates/html/blog_page.html b/website/templates/html/blog_page.html
deleted file mode 100644
index 90f6a79..0000000
--- a/website/templates/html/blog_page.html
+++ /dev/null
@@ -1,58 +0,0 @@
-{% extends "app/website/templates/html/page.html" %}
-
-{% block javascript %}
-	{% include "app/website/templates/js/blog_page.js" %}
-{% endblock %}
-
-{% block css %}
-	{% include "app/website/templates/css/blog_page.css" %}
-{% endblock %}
-
-{% block content %}
-<div class="col-md-12" itemscope itemtype="http://schema.org/BlogPost">
-	<h2 itemprop="name headline">{{ title }}</h2>
-
-	<!-- begin blog content -->
-	<div class="help" style="color: #aaa">
-		<span itemprop="author">{{ blogger_info and blogger_info.full_name or full_name }}</span> / 
-		<span itemprop="dateCreated">{{ updated }}</span></div>
-	<br>
-	<div itemprop="articleBody">
-	{{ content_html }}
-	</div>
-	<!-- end blog content -->
-	{% if blogger_info %}
-	<hr />
-	{% include "app/website/templates/html/blogger.html" %}
-	{% endif %}
-	<hr>
-	<h3>{{ texts.comments }}</h3><br>
-	<div class="blog-comments">
-		
-		{% if not comment_list %}
-		<div class="no-comment">
-			<p>{{ texts.first_comment }}</p>
-		</div>
-		{% endif %}
-		
-		{% include 'app/website/templates/html/comment.html' %}
-	</div>
-	<div><button class="btn btn-default add-comment">{{ texts.add_comment }}</button></div>
-	<div style="display: none; margin-top: 10px; max-width: 400px;" 
-		id="comment-form">
-		<div class="alert" style="display:none;"></div>
-		<form>
-			<fieldset>
-				<input class="form-control" name="comment_by_fullname" placeholder="Your Name" type="text"/><br>
-				<input class="form-control" name="comment_by" 
-					placeholder="Your Email Id" type="text"/><br>
-				<textarea class="form-control" name="comment" rows=10
-					placeholder="Comment"/>
-				</textarea><br>
-				<button class="btn btn-info" id="submit-comment">{{ texts.submit }}</button>
-			</fieldset>
-		</form>
-	</div>
-</div>
-{% include 'app/website/templates/html/blog_footer.html' %}
-{% endblock %}
\ No newline at end of file
diff --git a/website/templates/html/blog_subscribe.html b/website/templates/html/blog_subscribe.html
deleted file mode 100644
index 1238d83..0000000
--- a/website/templates/html/blog_subscribe.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<h4>Subscribe</h4>
-<br>
-<p>
-<button class="btn btn-warning btn-blog-subscribe">Get Updates via Email</button>
-</p>
-<p>
-<img src="app/images/feed.png" style="margin-right: 4px; margin-bottom: -4px">
-<a href="rss.xml" target="_blank">RSS Feed</a>
-</p>
\ No newline at end of file
diff --git a/website/templates/html/blogger.html b/website/templates/html/blogger.html
deleted file mode 100644
index 90c3571..0000000
--- a/website/templates/html/blogger.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<div class="row">
-	<div class="col-md-2">
-		<div class="avatar avatar-large">
-			<img itemprop="thumbnailUrl" src="{{ blogger_info.avatar }}" />
-		</div>
-	</div>
-	<div class="col-md-10">
-		<h4>{{ blogger_info.full_name }}</h4>
-		<p style="color: #999">{{ blogger_info.bio }}</p>
-		<p><a href="blog?by={{ blogger_info.name }}&by_name={{ blogger_info.full_name }}">
-			{{ texts.all_posts_by }} {{ blogger_info.full_name }}</a></p>
-	</div>
-</div>
\ No newline at end of file
diff --git a/website/templates/html/comment.html b/website/templates/html/comment.html
deleted file mode 100644
index 27baaad..0000000
--- a/website/templates/html/comment.html
+++ /dev/null
@@ -1,17 +0,0 @@
-{#
-	this template generates comment rows for a blog
-	it is to be included in the blog/blog.html template
-#}
-
-<div itemscope itemtype="http://schema.org/UserComments">
-	{% for comment in comment_list %}
-	<div class="comment-row">
-		<div class="comment-title">
-			<span itemprop="name" class="author">{{ comment.comment_by_fullname }}</span> / 
-				<span itemprop="commentTime">{{ comment.comment_date }}</span>:
-		</div>
-		<p class="comment-content" itemprop="commentText">{{ comment.comment }}</p>
-		<hr>
-	</div>
-	{% endfor %}
-</div>
\ No newline at end of file
diff --git a/website/templates/html/footer.html b/website/templates/html/footer.html
deleted file mode 100644
index e391794..0000000
--- a/website/templates/html/footer.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<footer class="container">
-	<div class="web-footer row">
-	<div class="col-md-12">
-		{% if facebook_share or google_plus_one or twitter_share or linked_in_share %}
-		<div class="social-icons" style="">
-			<span style="font-size: 11px;">{{ share_text or "Share this page on: "}}</span>
-			{% if google_plus_one %}
-				<a href="https://plus.google.com/share?url={{ url }}"
-				 	target="_blank"><i class="icon-google-plus"></i></a>
-			{% endif %}
-			{% if twitter_share %}
-				<a href="https://twitter.com/intent/tweet?url={{ url }}&text={{ encoded_title }}"
-					target="_blank" ><i class="icon-twitter"></i></a>
-			{% endif %}
-			{% if facebook_share %}
-				<a href="https://www.facebook.com/sharer.php?u={{ url }}&t={{ encoded_title }}&via={{ twitter_share_via }}"
-					target="_blank"><i class="icon-facebook"></i></a>
-			{% endif %}
-			{% if linked_in_share %}
-				<a href="http://www.linkedin.com/shareArticle?mini=true&url={{ url }}&title={{ encoded_title }}"
-					target="_blank"><i class="icon-linkedin"></i></a>
-			{% endif %}
-		</div>
-		{% endif %}
-		<p style="float: right; clear: right;">
-			<a style="font-size: 90%; color: #888;" href="http://erpnext.org">ERPNext Powered</a>
-		</p>
-		<div class="web-footer-menu">
-			<ul>
-				{% for item in footer_items %}
-				<li><a href="{{ item.url }}" {{ item.target }}
-					data-label="{{ item.label }}">{{ item.label }}</a></li>
-				{% endfor %}
-			</ul>
-		</div>
-		{% if copyright %}
-		<div class="web-footer-copyright">&copy; {{ copyright }}</div>
-		{% endif %}
-		{% if address %}
-		{{ address }}
-		{% endif %}
-		<br>
-		<div class="input-group col-md-6 col-md-offset-3">
-			<input class="form-control" type="text" id="footer-subscribe-email" placeholder="Your email address...">
-			<span class="input-group-btn">
-				<button class="btn btn-default" type="button" id="footer-subscribe-button">Stay Updated</button>
-			</span>
-		</div>
-		<br>
-		<script>
-			$("#footer-subscribe-button").click(function() {
-
-				$("#footer-subscribe-email").attr('disabled', true);
-				$("#footer-subscribe-button").html("Sending...")
-					.attr("disabled", true);
-
-				if($("#footer-subscribe-email").val()) {
-					erpnext.send_message({
-						subject:"Subscribe me",
-						sender: $("#footer-subscribe-email").val(),
-						message: "Subscribe to newsletter (via website footer).",
-						callback: function(r) {
-							if(!r.exc) {
-								$("#footer-subscribe-button").html("Thank You :)")
-									.addClass("btn-success").attr("disabled", true);
-							} else {
-								$("#footer-subscribe-button").html("Error :( Not a valid id?")
-									.addClass("btn-danger").attr("disabled", false);
-								$("#footer-subscribe-email").val("").attr('disabled', false);
-							}
-						}
-					});
-				}
-			});
-		</script>
-		</div>
-	</div>
-	</div>
-</footer>
diff --git a/website/templates/html/navbar.html b/website/templates/html/navbar.html
deleted file mode 100644
index 9e827c4..0000000
--- a/website/templates/html/navbar.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<div class="navbar navbar-default">
-	<div class="container">
-		<div class="navbar-header">
-			<button type="button" class="navbar-toggle" data-toggle="collapse" 
-				data-target=".navbar-responsive-collapse">
-				<span class="icon-bar"></span>
-				<span class="icon-bar"></span>
-				<span class="icon-bar"></span>
-			</button>
-			<a class="navbar-brand" href="index">{{ brand_html or "<i class='icon-home'></i>"}}</a>
-		</div>
-		<div class="collapse navbar-collapse navbar-responsive-collapse">
-			<ul class="nav navbar-nav">
-				{%- for page in top_bar_items -%}
-				{% if not page.parent_label -%}
-				<li data-label="{{ page.label }}" {% if page.child_items %} class="dropdown"{% endif %}>
-					<a href="{{ page.url or '#' }}" {% if page.child_items %} class="dropdown-toggle" onclick="return false;" data-toggle="dropdown"{% endif %} {{ page.target or ''}}>
-					{{ page.label }}
-					{%- if page.child_items -%}
-						<b class="caret"></b>
-					</a>
-						<ul class="dropdown-menu">
-						{%- for child in page.child_items -%}
-							<li data-label="{{ child.label }}">
-								<a {% if child.indent %} style="padding-left: {{(int(child.indent)+1)*15 }}px"{% endif %} href="{{ child.url }}" {{ child.target or '' }}>{{ child.label }}</a>
-							</li>
-						{%- endfor -%}
-						</ul>
-					{%- else -%}
-					</a>
-					{%- endif -%}
-					</li>
-				{%- endif -%}
-				{%- endfor %}
-			</ul>
-		</div>
-	</div>
-</div>
-<script>$('.dropdown-toggle').dropdown()</script>
diff --git a/website/templates/html/outer.html b/website/templates/html/outer.html
deleted file mode 100644
index 3ecb057..0000000
--- a/website/templates/html/outer.html
+++ /dev/null
@@ -1,34 +0,0 @@
-{% extends "lib/templates/base.html" %}
-
-{% block body %}
-	{% include "app/website/templates/html/navbar.html" %}
-	<div class="container">
-		<div class="pull-right" style="margin:4px;" id="user-tools">
-			{% if shopping_cart_enabled -%}
-			<a href="cart" title="Shopping Cart"><i class="icon-shopping-cart"></i> 
-				<span class="cart-count"></span></a> |
-			{%- endif %}
-			<a id="login-link" href="login">Login</a>
-		</div>
-		<div class="pull-right hide" style="margin:4px;" id="user-tools-post-login">
-			<a href="account" title="My Account" id="user-full-name"></a> |
-			{% if shopping_cart_enabled -%}
-			<a href="cart" title="Shopping Cart"><i class="icon-shopping-cart"></i> 
-				<span class="cart-count"></span></a> |
-			{%- endif %}
-			<a href="server.py?cmd=web_logout" title="Sign Out"><i class="icon-signout"></i></a>
-		</div>
-		<div class="clearfix"></div>
-		{% if banner_html %}<div class="row banner">
-			<div class="col-md-12">{{ banner_html }}</div>
-		</div>{% endif %}
-		<div class="outer">
-			<div class="content row" id="page-{{ name }}" style="display: block;">
-			{%- block content -%}
-			{%- endblock -%}
-			</div>
-		</div>
-	</div>
-	{% include "app/website/templates/html/footer.html" %}
-
-{% endblock %}
\ No newline at end of file
diff --git a/website/templates/html/page.html b/website/templates/html/page.html
deleted file mode 100644
index c9fbec4..0000000
--- a/website/templates/html/page.html
+++ /dev/null
@@ -1,20 +0,0 @@
-{% extends "app/website/templates/html/outer.html" %}
-
-{% block title -%}{{ title }}{%- endblock %}
-
-{% block header -%}
-	{{ super() }}
-	<script>
-	{% block javascript -%}
-	{%- endblock %}
-	</script>
-	{% block css -%}
-	{% if insert_style -%}	
-	<style>{{ css }}</style>
-	{%- endif %}
-	{%- endblock %}
-{%- endblock -%}
-
-{%- block content -%}
-	{{ content }}
-{%- endblock %}
\ No newline at end of file
diff --git a/website/templates/html/product_group.html b/website/templates/html/product_group.html
deleted file mode 100644
index 4bf52c5..0000000
--- a/website/templates/html/product_group.html
+++ /dev/null
@@ -1,42 +0,0 @@
-{% extends "app/website/templates/html/page.html" %}
-
-{% block content %}
-{% include 'app/website/templates/html/product_search_box.html' %}
-{% include 'app/website/templates/html/product_breadcrumbs.html' %}
-<div class="col-md-12">
-	{% if slideshow %}<!-- slideshow -->
-	{% include "app/website/templates/html/slideshow.html" %}
-	{% endif %}
-	{% if description %}<!-- description -->
-	<div>{{ description or ""}}</div>
-	{% else %}
-	<h3>{{ name }}</h3>
-	{% endif %}
-</div>
-<div class="col-md-12">
-	{% 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 len(items)==100 %}
-			<div class="alert info">Showing top 100 items.</div>
-		{% endif %}
-	{% else %}
-		<div class="alert">No items listed.</div>
-	{% endif %}
-</div>
-
-{% endblock %}
\ No newline at end of file
diff --git a/website/templates/html/slideshow.html b/website/templates/html/slideshow.html
deleted file mode 100644
index b148cb1..0000000
--- a/website/templates/html/slideshow.html
+++ /dev/null
@@ -1,39 +0,0 @@
-{% if slideshow %}
-{{ slideshow_header }}
-
-
-<div id="the-carousel" class="carousel slide">
-	<!-- Indicators -->
-	<ol class="carousel-indicators">
-		{% for slide in obj.slides %}
-			<li data-target="#the-carousel" data-slide-to="0" 
-				{%- if loop.index==0 %}class="active"{% endif %}></li>
-		{% endfor %}
-	</ol>
-	
-	<!-- Wrapper for slides -->
-	<div class="carousel-inner">
-		{% for slide in obj.slides %}
-		<div class="{% if slide.idx==1 %}active {% endif %}item">
-			<img src="{{ slide.image }}" />
-			{% if slide.heading or slide.description %}
-			<div class="carousel-caption">
-				{% if slide.heading %}<h4>{{ slide.heading }}</h4>{% endif %}
-				{% if slide.description %}<p>{{ slide.description }}</p>{% endif %}
-			</div>
-			{% endif %}
-		</div>
-		{% endfor %}
-	</div>
-
-	<!-- Controls -->
-	<a class="left carousel-control" href="#the-carousel" data-slide="prev">
-		<span class="icon icon-chevron-left"></span>
-	</a>
-	<a class="right carousel-control" href="#the-carousel" data-slide="next">
-		<span class="icon icon-chevron-right"></span>
-	</a>
-</div>
-
-<script>$(".carousel").carousel();</script>
-{% endif %}
diff --git a/website/templates/html/web_page.html b/website/templates/html/web_page.html
deleted file mode 100644
index c857263..0000000
--- a/website/templates/html/web_page.html
+++ /dev/null
@@ -1,14 +0,0 @@
-{% extends "app/website/templates/html/page.html" %}
-
-{% block javascript %}
-	{% if insert_code %}
-		{{ javascript }}
-	{% endif %}
-{% endblock %}
-
-{% block content %}
-<div class="col-md-12" style="margin-top: 15px;">
-	{% include "app/website/templates/html/slideshow.html" %}
-	{{ main_section }}
-</div>
-{% endblock %}
\ No newline at end of file
diff --git a/website/templates/js/blog.js b/website/templates/js/blog.js
deleted file mode 100644
index 8134b63..0000000
--- a/website/templates/js/blog.js
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-// License: GNU General Public License v3. See license.txt
-
-// js inside blog page
-
-$(document).ready(function() {
-	// make list of blogs
-	blog.get_list();
-	
-	$("#next-page").click(function() {
-		blog.get_list();
-	})
-	
-	if(get_url_arg("by_name")) {
-		$("#blot-subtitle").html("Posts by " + get_url_arg("by_name")).toggle(true);
-	}
-
-	if(get_url_arg("category")) {
-		$("#blot-subtitle").html("Posts filed under " + get_url_arg("category")).toggle(true);
-	}
-
-});
-
-var blog = {
-	start: 0,
-	get_list: function() {
-		$.ajax({
-			method: "GET",
-			url: "server.py",
-			data: {
-				cmd: "website.helpers.blog.get_blog_list",
-				start: blog.start,
-				by: get_url_arg("by"),
-				category: get_url_arg("category")
-			},
-			dataType: "json",
-			success: function(data) {
-				$(".progress").toggle(false);
-				if(data.exc) console.log(data.exc);
-				blog.render(data.message);
-			}
-		});
-	},
-	render: function(data) {
-		var $wrap = $("#blog-list");
-		$.each(data, function(i, b) {
-			// comments
-			if(!b.comments) {
-				b.comment_text = 'No comments yet.'
-			} else if (b.comments===1) {
-				b.comment_text = '1 comment.'
-			} else {
-				b.comment_text = b.comments + ' comments.'
-			}
-			
-			b.page_name = encodeURIComponent(b.page_name);
-			
-			$(repl('<div class="row">\
-					<div class="col-md-1">\
-						<div class="avatar avatar-medium" style="margin-top: 6px;">\
-							<img src="%(avatar)s" />\
-						</div>\
-					</div>\
-					<div class="col-md-11">\
-						<h4><a href="%(page_name)s">%(title)s</a></h4>\
-						<p>%(content)s</p>\
-						<p style="color: #aaa; font-size: 90%">\
-							<a href="blog?by=%(blogger)s&by_name=%(full_name)s">\
-								%(full_name)s</a> wrote this on %(published)s / %(comment_text)s</p>\
-					</div>\
-				</div><hr>', b)).appendTo($wrap);
-		});
-		blog.start += (data.length || 0);
-		if(!data.length || data.length < 20) {
-			if(blog.start) {
-				$("#next-page").toggle(false)
-					.parent().append("<div class='text-muted'>Nothing more to show.</div>");	
-			} else {
-				$("#next-page").toggle(false)
-					.parent().append("<div class='alert alert-warning'>No blogs written yet.</div>");	
-			}
-		} else {
-			$("#next-page").toggle(true);
-		}
-	}
-}
\ No newline at end of file
diff --git a/website/templates/js/blog_page.js b/website/templates/js/blog_page.js
deleted file mode 100644
index ee56d90..0000000
--- a/website/templates/js/blog_page.js
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-// License: GNU General Public License v3. See license.txt
-
-// js inside blog page
-
-$(document).ready(function() {
-	var n_comments = $(".comment-row").length;
-	
-	if(n_comments) {
-		$(".no_comment").toggle(false);
-	}
-	if(n_comments > 50) {
-		$(".add-comment").toggle(false)
-			.parent().append("<div class='alert alert-warning'>Comments are closed.</div>")
-	}
-	$(".add-comment").click(function() {
-		$("#comment-form").toggle();
-		$("#comment-form input, #comment-form, textarea").val("");
-	})
-	$("#submit-comment").click(function() {
-		var args = {
-			comment_by_fullname: $("[name='comment_by_fullname']").val(),
-			comment_by: $("[name='comment_by']").val(),
-			comment: $("[name='comment']").val(),
-			cmd: "website.helpers.blog.add_comment",
-			comment_doctype: "Blog Post",
-			comment_docname: "{{ name }}",
-			page_name: "{{ page_name }}",
-			_type: "POST"
-		}
-		
-		$("#comment-form .alert").toggle(false);
-		
-		if(!args.comment_by_fullname || !args.comment_by || !args.comment) {
-			$("#comment-form .alert")
-				.html("All fields are necessary to submit the comment.")
-				.toggle(true);
-			return false;
-		}
-		
-		
-		$.ajax({
-			type: "POST",
-			url: "server.py",
-			data: args,
-			dataType: "json",
-			success: function(data) {
-				if(data.exc) {
-					$("#comment-form .alert")
-						.html(data.exc)
-						.toggle(true)
-				} else {
-					$(data.message).appendTo(".blog-comments");
-					$(".no_comment").toggle(false);
-					$(".add-comment").toggle(false);
-					$("#comment-form")
-						.replaceWith("<div class='alert alert-success'>Thank you for your comment!</div>")
-				}
-			}
-		})
-		
-		return false;
-	})
-})
\ No newline at end of file
diff --git a/website/templates/js/contact.js b/website/templates/js/contact.js
deleted file mode 100644
index dece898..0000000
--- a/website/templates/js/contact.js
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
-// License: GNU General Public License v3. See license.txt
-
-$(document).ready(function() { 
-
-	$('.btn-send').click(function() {
-		var email = $('[name="email"]').val();
-		var message = $('[name="message"]').val();
-
-		if(!(email && message)) {
-			msgprint("Please enter both your email and message so that we \
-				can get back to you. Thanks!");
-			return false;
-		}
-
-		if(!valid_email(email)) {
-				msgprint("You seem to have written your name instead of your email. \
-					Please enter a valid email address so that we can get back.");
-				$('[name="email"]').focus();
-				return false;
-		}
-
-		$("#contact-alert").toggle(false);
-		erpnext.send_message({
-			subject: $('[name="subject"]').val(),
-			sender: email,
-			message: message,
-			callback: function(r) {
-				if(r.status==="okay") {
-					msgprint(r.message || "Thank you for your message.")
-				} else {
-					msgprint("There were errors");
-					console.log(r.exc);
-				}
-				$(':input').val('');
-			}
-		});
-	return false;
-	});
-
-});
-
-var msgprint = function(txt) {
-	if(txt) $("#contact-alert").html(txt).toggle(true);
-}
diff --git a/website/templates/pages/about.html b/website/templates/pages/about.html
deleted file mode 100644
index 277f790..0000000
--- a/website/templates/pages/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-{% extends "app/website/templates/html/page.html" %}
-
-{% set title="About Us" %}
-
-{% block content %}
-<div class="col-md-12">
-	{{ obj.doc.company_introduction or "<h2>About Us</h2><p>Some Introduction about your company that you would like your website visitor to know. More people than you think will read your About page. People always like to know who the are doing business with. Be authentic and avoid using jargon like 'value added services' etc. Be sure to update your company history and list of key team members in Website > About Us Settings</p>" }}
-	{% if obj.doclist.get({"doctype":"Company History"}) %}
-	<h3>{{ obj.doc.company_history_heading or "Company History" }}</h3>
-	{% for d in obj.doclist.get({"doctype":"Company History"}) %}
-	<div class="row">
-		<span class="col-md-2"><h4 style="margin:0px;">{{ d.year }}</h4></span>
-		<span class="col-md-10"><p>{{ d.highlight }}</p></span>
-	</div>
-	{% endfor %}
-	{% endif %}
-	{% if obj.doclist.get({"doctype":"About Us Team Member"}) %}
-	<h3>{{ obj.doc.team_members_heading or "Team Members" }}</h3>
-	{% for d in obj.doclist.get({"doctype":"About Us Team Member"}) %}
-	<div class="row" itemscope itemtype="http://schema.org/Person">
-		<span class="col-md-2">
-			<div class="avatar avatar-large">
-				<img class="avatar" src="{{ d.image_link }}" style="" itemprop="image">
-			</div>
-		</span>
-		<span class="col-md-10"><h4 itemprop="name">{{ d.full_name }}</h4>
-			<p itemprop="description">{{ d.bio }}</p>
-		</span>
-	</div>
-	{% endfor %}
-	{% endif %}
-	{{ obj.doc.footer or "" }}
-</div>
-{% endblock %}
\ No newline at end of file
diff --git a/website/templates/pages/account.html b/website/templates/pages/account.html
deleted file mode 100644
index 2a5acf6..0000000
--- a/website/templates/pages/account.html
+++ /dev/null
@@ -1,27 +0,0 @@
-{% extends "app/website/templates/html/page.html" %}
-
-{% set title="My Account" %}
-
-{% block content %}
-<div class="col-md-12">
-    <ul class="breadcrumb">
-    	<li><a href="index">Home</a></li>
-    	<li class="active">My Account</li>
-    </ul>
-	<!-- <h3>My Account</h3> -->
-	<ul class="nav nav-stacked pull-left">
-		<li><a href="profile"><i class="icon-user icon-fixed-width"></i> 
-			Change my name, password</a></li>
-		<li><a href="addresses"><i class="icon-map-marker icon-fixed-width"></i> 
-			My Addresses</a></li>
-		<li><a href="orders"><i class="icon-list icon-fixed-width"></i> My Orders</a></li>
-		<li><a href="tickets"><i class="icon-tags icon-fixed-width"></i> My Tickets</a></li>
-		<li style="border-top: 1px solid #ddd"></li>
-		<li><a href="invoices"><i class="icon-file-text icon-fixed-width"></i> Invoices</a></li>
-		<li><a href="shipments"><i class="icon-truck icon-fixed-width"></i> Shipments</a></li>
-		<li style="border-top: 1px solid #ddd"></li>
-		<li><a href="server.py?cmd=web_logout"><i class="icon-signout icon-fixed-width"></i>
-			Logout</a></li>
-	</ul>
-</div>
-{% endblock %}
\ No newline at end of file
diff --git a/website/templates/pages/blog.html b/website/templates/pages/blog.html
deleted file mode 100644
index 9bd1abf..0000000
--- a/website/templates/pages/blog.html
+++ /dev/null
@@ -1,33 +0,0 @@
-{% extends "app/website/templates/html/page.html" %}
-
-{% block javascript %}
-	{% include "app/website/templates/js/blog.js" %}
-{% endblock %}
-
-{% block css %}
-	{% include "app/website/templates/css/blog.css" %}
-{% endblock %}
-
-{% set title="Blog" %}
-
-{% block content %}
-<div class="col-md-12">
-	<h2 id="blog-title">{{ blog_title }}</h2>
-	{% if blog_introduction %}
-	<p>{{ blog_introduction }}</p>
-	{% endif %}
-	<h3 id="blot-subtitle" style="display:none;"></h3>
-	<br>
-	<div class="progress progress-striped active">
-		<div class="progress-bar progress-bar-info" style="width: 100%;"></div>
-	</div>
-	<div id="blog-list">
-		<!-- blog list will be generated dynamically -->
-	</div>
-	<div style="text-align: center;">
-		<button id="next-page" class="btn btn-default" 
-			style="display:none;">More...</button>
-	</div>
-</div>
-{% include 'app/website/templates/html/blog_footer.html' %}
-{% endblock %}
\ No newline at end of file
diff --git a/website/templates/pages/contact.html b/website/templates/pages/contact.html
deleted file mode 100644
index 86be163..0000000
--- a/website/templates/pages/contact.html
+++ /dev/null
@@ -1,60 +0,0 @@
-{% extends "app/website/templates/html/page.html" %}
-
-{% block javascript %}
-	{% include "app/website/templates/js/contact.js" %}
-{% endblock %}
-
-{% set title="Contact Us" %}
-
-{% block content %}
-<div class="col-md-12">
-	<h3>{{ obj.doc.heading or "Contact Us"}}</h3>
-	<div class="row">
-		<div class="web-form col-md-8">
-			<p id="contact-alert" class="alert alert-warning" 
-				style="display: none;">&nbsp;</p>
-			<p>
-				<select name="subject" class="form-control">
-				{% for option in obj.query_options %}
-					<option value="{{ option }}">{{ option }}</option>
-				{% endfor %}
-				</select>
-			</p>
-			<p>
-				<input class="form-control" name="email" type="text" 
-				placeholder="Your Email Address" />
-			</p>
-			<p>
-				<textarea rows="10" name="message" class="form-control"></textarea>
-			</p>
-			<p>
-				<button class="btn btn-primary btn-send">Send</button>
-			</p>
-		</div>
-		{% if obj.doc.address %}
-		<div class="col-md-3 col-md-offset-1 alert alert-warning" style="margin-top: 20px;" itemscope itemtype="http://schema.org/PostalAddress">
-			<h4><i class="icon-map-marker"></i> {{ obj.address.address_title }}</h4>
-			{% if obj.address.address_line1 %}
-				<span itemprop="streetAddress">{{ obj.address.address_line1 }}</span><br>
-			{% endif %}
-			{% if obj.address.address_line2 %}
-				<span itemprop="streetAddress">{{ obj.address.address_line2 }}</span><br>
-			{% endif %}
-			{% if obj.address.city %}
-				<span itemprop="addressLocality">{{ obj.address.city }}</span><br>
-			{% endif %}
-			{% if obj.address.state %}
-				<span itemprop="addressRegion">{{ obj.address.state }}</span><br>
-			{% endif %}
-			{% if obj.address.pincode %}
-				<span itemprop="postalCode">{{ obj.address.pincode }}</span><br>
-			{% endif %}
-			{% if obj.address.country %}
-				<span itemprop="addressCountry">{{ obj.address.country }}</span><br>
-			{% endif %}
-		</div>
-		{% endif %}
-	</div>
-	{{ obj.doc.introduction }}
-</div>
-{% endblock %}
\ No newline at end of file
diff --git a/website/templates/pages/index.html b/website/templates/pages/index.html
deleted file mode 100644
index 761da0c..0000000
--- a/website/templates/pages/index.html
+++ /dev/null
@@ -1 +0,0 @@
-{% extends "app/website/templates/html/web_page.html" %}
\ No newline at end of file
diff --git a/website/templates/pages/invoice.html b/website/templates/pages/invoice.html
deleted file mode 100644
index 26ddea4..0000000
--- a/website/templates/pages/invoice.html
+++ /dev/null
@@ -1,88 +0,0 @@
-{% extends "app/website/templates/html/page.html" %}
-
-{% set title=doc.name %}
-
-{% block content %}
-<div class="col-md-12">
-    <ul class="breadcrumb">
-    	<li><a href="index">Home</a></li>
-    	<li><a href="account">My Account</a></li>
-    	<li><a href="invoices">Invoices</a></li>
-    	<li class="active"><i class="icon-file-text icon-fixed-width"></i> {{ doc.name }}</li>
-    </ul>
-	<h3><i class="icon-file icon-fixed-width"></i> {{ doc.name }}</h3>
-	<hr>
-	{%- if doc.status -%}
-	<div style="font-size: 13px;">
-	<div class="row">
-		<div class="col-md-2">
-			<div class="label">{{ doc.status }}</div>
-		</div>
-		<div class="col-md-4">
-			{{ utils.formatdate(doc.transaction_date) }}
-		</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":"Sales Order 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/website/templates/pages/messages.html b/website/templates/pages/messages.html
deleted file mode 100644
index e1ea8d0..0000000
--- a/website/templates/pages/messages.html
+++ /dev/null
@@ -1,31 +0,0 @@
-{% extends "app/website/templates/html/transactions.html" %}
-
-{% block javascript -%}
-{{ super() }}
-
-var render = function(doc) {
-	doc.sender = doc.sender ? doc.sender : "To ";
-	doc.recipients = doc.recipients ? (" to " + doc.recipients) : "";
-	doc.content = remove_script_and_style(doc.content);
-	
-	if(!is_html(doc.content)) {
-		doc.content = doc.content.replace("\n", "<br>");
-	}
-		
-	$(repl('<a class="list-group-item">\
-			<div class="row col-md-12">%(subject)s</div>\
-			<div class="row text-muted">\
-				<div class="col-md-6">%(sender)s%(recipients)s</div>\
-				<div class="col-md-6 text-right">%(creation)s</div>\
-			</div>\
-			<div class="row col-md-12 msg-content" style="display: none;"><hr>%(content)s</div>\
-		</a>', doc))
-		.appendTo($list)
-		.on("click", function() {
-			$(this).find(".msg-content").toggle();
-		});
-	
-	
-}
-
-{%- endblock %}
\ No newline at end of file
diff --git a/website/templates/pages/sales_transactions.html b/website/templates/pages/sales_transactions.html
deleted file mode 100644
index 7215339..0000000
--- a/website/templates/pages/sales_transactions.html
+++ /dev/null
@@ -1,25 +0,0 @@
-{% extends "app/website/templates/html/transactions.html" %}
-
-{% block javascript -%}
-global_number_format = "{{ global_number_format }}";
-currency = "{{ currency }}";
-wn.currency_symbols = {{ currency_symbols }};
-
-{{ super() }}
-
-var render = function(doc) {
-	doc.grand_total_export = format_currency(doc.grand_total_export, doc.currency);
-	
-	$(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>\
-				<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);
-};
-
-{%- endblock %}
\ No newline at end of file
diff --git a/website/templates/pages/ticket.html b/website/templates/pages/ticket.html
deleted file mode 100644
index 6622ed1..0000000
--- a/website/templates/pages/ticket.html
+++ /dev/null
@@ -1,67 +0,0 @@
-{% extends "app/website/templates/html/page.html" %}
-
-{% set title=doc.name %}
-
-{% set status_label = {
-	"Open": "label-success",
-	"To Reply": "label-danger",
-	"Closed": "label-default"
-} %}
-
-{% block content %}
-<div class="col-md-12">
-    <ul class="breadcrumb">
-    	<li><a href="index">Home</a></li>
-    	<li><a href="account">My Account</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 pull-right">
-			<span class="text-muted">{{ utils.formatdate(doc.creation) }}</span>
-		</div>
-	</div>
-	<br>
-	<h4>Messages</h4>
-	{%- if doclist.get({"doctype":"Communication"}) -%}
-	<div>
-		<table class="table table-bordered table-striped">
-			<tbody>
-				{%- for comm in doclist.get({"doctype":"Communication"}) %}
-				<tr>
-					<td>
-					<h5 style="text-transform: none">
-						{{ comm.sender }} on {{ utils.formatdate(doc.modified) }}</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 %}
\ No newline at end of file
diff --git a/website/templates/pages/tickets.html b/website/templates/pages/tickets.html
deleted file mode 100644
index 166dbcd..0000000
--- a/website/templates/pages/tickets.html
+++ /dev/null
@@ -1,31 +0,0 @@
-{% extends "app/website/templates/html/transactions.html" %}
-
-{% block javascript -%}
-{{ super() }}
-
-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);
-};
-{%- endblock %}
\ No newline at end of file
diff --git a/website/templates/pages/transaction_list.html b/website/templates/pages/transaction_list.html
deleted file mode 100644
index 967a6a8..0000000
--- a/website/templates/pages/transaction_list.html
+++ /dev/null
@@ -1,77 +0,0 @@
-{% extends "app/website/templates/html/page.html" %}
-
-{% block content %}
-<div class="col-md-12">
-    <ul class="breadcrumb">
-    	<li><a href="index">Home</a></li>
-    	<li><a href="account">My Account</a></li>
-    	<li class="active"><i class="{{ icon }} icon-fixed-width"></i> {{ title }}</li>
-    </ul>
-	<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" style="display: none;">More</button></div>
-</div>
-{% endblock %}
-
-{% block javascript %}
-global_number_format = "{{ global_number_format }}";
-currency = "{{ currency }}";
-wn.currency_symbols = {{ currency_symbols }};
-
-$(document).ready(function() {
-	var start = 0;
-	var $list = $(".transaction-list");
-	
-	var $show_more = $(".btn-show-more").on("click", function() {
-		get_transactions(this);
-	});
-	
-	var get_transactions = function(btn) {
-		wn.call({
-			method: "{{ method }}",
-			args: { start: start },
-			btn: btn,
-			callback: function(r) {
-				$list.find(".progress").remove();
-				$show_more.toggle(!(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);
-				});
-			}
-		})
-	};
-	
-	var render = function(doc) {
-		doc.grand_total_export = format_currency(doc.grand_total_export, doc.currency);
-		
-		var $row = $(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>\
-					<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);
-	};
-	
-	get_transactions();
-});
-{% endblock %}
\ No newline at end of file
diff --git a/website/templates/pages/writers.html b/website/templates/pages/writers.html
deleted file mode 100644
index 5b254b0..0000000
--- a/website/templates/pages/writers.html
+++ /dev/null
@@ -1,17 +0,0 @@
-{% extends "app/website/templates/html/page.html" %}
-
-{% set title="Blog Writers" %}
-
-{% block content %}
-<div class="col-md-12">
-	<h2 id="blog-title">Blog Writers</h2>
-	{% if writers_introduction %}
-	<p>{{ writers_introduction }}</p>
-	{% endif %}
-	<hr>
-	{% for blogger_info in bloggers %}
-	{% include "app/website/templates/html/blogger.html" %}	
-	{% endfor %}
-</div>
-{% include 'app/website/templates/html/blog_footer.html' %}
-{% endblock %}
\ No newline at end of file