Merge branch 'master' of github.com:webnotes/erpnext
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 0fb9747..a43f8ca 100644
--- a/accounts/doctype/journal_voucher/journal_voucher.py
+++ b/accounts/doctype/journal_voucher/journal_voucher.py
@@ -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 f224c35..60f73b5 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/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/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..f4fb2f3 100644
--- a/buying/utils.py
+++ b/buying/utils.py
@@ -89,12 +89,15 @@
 	
 	# 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:
+			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 * args.plc_conversion_rate / args.conversion_rate)
 		
diff --git a/controllers/accounts_controller.py b/controllers/accounts_controller.py
index eb71f21..1247e66 100644
--- a/controllers/accounts_controller.py
+++ b/controllers/accounts_controller.py
@@ -59,13 +59,13 @@
 		
 		# TODO - change this, since price list now has only one currency allowed
 		if self.meta.get_field(fieldname) and self.doc.fields.get(fieldname):
-			if not self.doc.price_list_currency:
-				self.doc.fields.update(get_price_list_currency(self.doc.fields.get(fieldname)))
+			self.doc.fields.update(get_price_list_currency(self.doc.fields.get(fieldname)))
 				
 			if self.doc.price_list_currency:
 				if self.doc.price_list_currency == company_currency:
 					self.doc.plc_conversion_rate = 1.0
-				elif not self.doc.plc_conversion_rate:
+				elif not self.doc.plc_conversion_rate or \
+						(flt(self.doc.plc_conversion_rate)==1 and company_currency!= self.doc.price_list_currency):
 					exchange = self.doc.price_list_currency + "-" + company_currency
 					self.doc.plc_conversion_rate = flt(webnotes.conn.get_value("Currency Exchange",
 						exchange, "exchange_rate"))
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/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/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/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/patch_list.py b/patches/patch_list.py
index b57efcb..e747993 100644
--- a/patches/patch_list.py
+++ b/patches/patch_list.py
@@ -121,7 +121,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",
@@ -263,5 +262,6 @@
 	"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.september_2013.p03_update_stock_uom_in_sle",
 ]
\ No newline at end of file
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..f29f8f5
--- /dev/null
+++ b/patches/september_2013/p03_modify_item_price_include_in_price_list.py
@@ -0,0 +1,18 @@
+# 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.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/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/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/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/utils.py b/selling/utils.py
index ca99512..224944d 100644
--- a/selling/utils.py
+++ b/selling/utils.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/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/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/stock/doctype/item_price/item_price.py b/setup/doctype/item_price/item_price.py
similarity index 69%
rename from stock/doctype/item_price/item_price.py
rename to setup/doctype/item_price/item_price.py
index 26d0f76..3256c80 100644
--- a/stock/doctype/item_price/item_price.py
+++ b/setup/doctype/item_price/item_price.py
@@ -1,5 +1,7 @@
 # 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
 
 from __future__ import unicode_literals
 import webnotes
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/setup_control/setup_control.py b/setup/doctype/setup_control/setup_control.py
index 54c0e28..0bc2f24 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()
@@ -135,6 +134,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/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 2c702a6..2522d68 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()
@@ -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 """
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/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.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/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/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 4383d32..a526c2a 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()
@@ -377,6 +378,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"])
@@ -400,7 +404,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]
 	
@@ -410,4 +414,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)
\ No newline at end of file
diff --git a/website/helpers/product.py b/website/helpers/product.py
index 031339a..33c617d 100644
--- a/website/helpers/product.py
+++ b/website/helpers/product.py
@@ -27,8 +27,9 @@
 	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.ref_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