Fieldname changed in Features Setup
diff --git a/erpnext/patches/patch.py b/erpnext/patches/patch.py
index 2f826d5..195c457 100644
--- a/erpnext/patches/patch.py
+++ b/erpnext/patches/patch.py
@@ -1,7 +1,7 @@
 # REMEMBER to update this
 # ========================
 
-last_patch = 374
+last_patch = 376
 
 #-------------------------------------------
 
@@ -386,3 +386,37 @@
 		reload_doc('accounts', 'doctype', 'internal_reconciliation')
 		reload_doc('accounts', 'doctype', 'ir_payment_detail')
 		reload_doc('accounts', 'Module Def', 'Accounts')
+	elif patch_no == 375:
+		from webnotes.modules.module_manager import reload_doc
+
+		reload_doc('setup', 'doctype','features_setup')
+		flds = ['page_break', 'projects', 'packing_details', 'discounts', 'brands', 'item_batch_nos', 'after_sales_installations', 'item_searial_nos', 'item_group_in_details', 'exports', 'imports', 'item_advanced', 'sales_extras', 'more_info', 'quality', 'manufacturing', 'pos', 'item_serial_nos']
+
+		for f in flds:
+			val = sql("select value from tabSingles where field = '%s' and doctype = 'Features Setup'" % f)
+			val = val and val[0][0] or 0
+			sql("update `tabSingles` set `value` = %s where `field` = '%s' and doctype = 'Features Setup'" % (val, '__'+f))
+
+		st = "'"+"', '".join(flds)+"'"
+		sql("delete from `tabDocField` where fieldname in (%s) and parent = 'Features Setup'" % st)
+		sql("delete from `tabDefaultValue` where defkey in (%s) and parent = 'Control Panel'" % st)
+
+		get_obj('Features Setup', 'Features Setup').doc.save()
+		
+	elif patch_no == 376:
+		from webnotes.modules.module_manager import reload_doc
+
+		reload_doc('setup', 'doctype','features_setup')
+		flds = ['page_break', 'projects', 'packing_details', 'discounts', 'brands', 'item_batch_nos', 'after_sales_installations', 'item_searial_nos', 'item_group_in_details', 'exports', 'imports', 'item_advanced', 'sales_extras', 'more_info', 'quality', 'manufacturing', 'pos', 'item_serial_nos']
+
+		for f in flds:
+			val = sql("select value from tabSingles where field = '%s' and doctype = 'Features Setup'" % f)
+			val = val and val[0][0] or 0
+			sql("update `tabSingles` set `value` = %s where `field` = '%s' and doctype = 'Features Setup'" % (val, 'fs_'+f))
+
+		st = "'__"+"', '__".join(flds)+"'"
+		
+		sql("delete from `tabDocField` where fieldname in (%s) and parent = 'Features Setup'" % st)
+		sql("delete from `tabDefaultValue` where defkey in (%s) and parent = 'Control Panel'" % st)
+
+		get_obj('Features Setup', 'Features Setup').doc.save()
diff --git a/erpnext/setup/doctype/features_setup/features_setup.txt b/erpnext/setup/doctype/features_setup/features_setup.txt
index 224d175..909882e 100644
--- a/erpnext/setup/doctype/features_setup/features_setup.txt
+++ b/erpnext/setup/doctype/features_setup/features_setup.txt
@@ -3,17 +3,18 @@
 
 	# These values are common in all dictionaries
 	{
-		'creation': '2011-08-25 16:53:56',
+		'creation': '2011-09-07 11:59:05',
 		'docstatus': 0,
-		'modified': '2011-08-31 15:05:53',
+		'modified': '2011-10-05 10:50:17',
 		'modified_by': 'Administrator',
 		'owner': 'Administrator'
 	},
 
 	# These values are common for all DocType
 	{
-		'_last_update': '1314783102',
+		'_last_update': '1317790484',
 		'colour': 'White:FFF',
+		'default_print_format': 'Standard',
 		'doctype': 'DocType',
 		'issingle': 1,
 		'module': 'Setup',
@@ -21,7 +22,7 @@
 		'name_case': 'Title Case',
 		'section_style': 'Simple',
 		'show_in_menu': 1,
-		'version': 16
+		'version': 21
 	},
 
 	# These values are common for all DocField
@@ -77,7 +78,7 @@
 		'colour': 'White:FFF',
 		'description': 'To track item in sales and purchase documents based on their serial nos. This is can also used to track warranty details of the product.',
 		'doctype': 'DocField',
-		'fieldname': 'item_searial_nos',
+		'fieldname': 'fs_item_serial_nos',
 		'fieldtype': 'Check',
 		'label': 'Item Serial Nos'
 	},
@@ -87,7 +88,7 @@
 		'colour': 'White:FFF',
 		'description': 'To track items in sales and purchase documents with batch nos<br><b>Preferred Industry: Chemicals etc</b>',
 		'doctype': 'DocField',
-		'fieldname': 'item_batch_nos',
+		'fieldname': 'fs_item_batch_nos',
 		'fieldtype': 'Check',
 		'label': 'Item Batch Nos'
 	},
@@ -97,7 +98,7 @@
 		'colour': 'White:FFF',
 		'description': 'To track brand name in the following documents<br>\nDelivery Note, Enuiry, Indent, Item, Purchase Order, Purchase Voucher, Purchaser Receipt, Quotation, Receivable Voucher, Sales BOM, Sales Order, Serial No',
 		'doctype': 'DocField',
-		'fieldname': 'brands',
+		'fieldname': 'fs_brands',
 		'fieldtype': 'Check',
 		'label': 'Brands'
 	},
@@ -113,7 +114,7 @@
 		'colour': 'White:FFF',
 		'description': '1. To maintain the customer wise item code and to make them searchable based on their code use this option',
 		'doctype': 'DocField',
-		'fieldname': 'item_advanced',
+		'fieldname': 'fs_item_advanced',
 		'fieldtype': 'Check',
 		'label': 'Item Advanced'
 	},
@@ -123,7 +124,7 @@
 		'colour': 'White:FFF',
 		'description': 'If Sale BOM is defined, the actual BOM of the Pack is displayed as table.\nAvailable in Delivery Note and Sales Order',
 		'doctype': 'DocField',
-		'fieldname': 'packing_details',
+		'fieldname': 'fs_packing_details',
 		'fieldtype': 'Check',
 		'label': 'Packing Detials'
 	},
@@ -133,7 +134,7 @@
 		'colour': 'White:FFF',
 		'description': 'To get Item Group in details table',
 		'doctype': 'DocField',
-		'fieldname': 'item_group_in_details',
+		'fieldname': 'fs_item_group_in_details',
 		'fieldtype': 'Check',
 		'label': 'Item Groups in Details'
 	},
@@ -150,7 +151,7 @@
 		'colour': 'White:FFF',
 		'description': 'All export related fields like currency, conversion rate, export total, export grand total etc are available in <br>\nDelivery Note, POS, Quotation, Sales Invoice, Sales Order etc.',
 		'doctype': 'DocField',
-		'fieldname': 'exports',
+		'fieldname': 'fs_exports',
 		'fieldtype': 'Check',
 		'label': 'Exports'
 	},
@@ -160,7 +161,7 @@
 		'colour': 'White:FFF',
 		'description': 'All import related fields like currency, conversion rate, import total, import grand total etc are available in <br>\nPurchase Receipt, Supplier Quotation, Purchase Invoice, Purchase Order etc.',
 		'doctype': 'DocField',
-		'fieldname': 'imports',
+		'fieldname': 'fs_imports',
 		'fieldtype': 'Check',
 		'label': 'Imports'
 	},
@@ -176,7 +177,7 @@
 		'colour': 'White:FFF',
 		'description': 'Field available in Delivery Note, Quotation, Receivable Voucher, Sales Order',
 		'doctype': 'DocField',
-		'fieldname': 'discounts',
+		'fieldname': 'fs_discounts',
 		'fieldtype': 'Check',
 		'label': 'Discounts'
 	},
@@ -186,7 +187,7 @@
 		'colour': 'White:FFF',
 		'description': 'To track any installation or commissioning related work after sales',
 		'doctype': 'DocField',
-		'fieldname': 'after_sales_installations',
+		'fieldname': 'fs_after_sales_installations',
 		'fieldtype': 'Check',
 		'label': 'After Sale Installations'
 	},
@@ -195,7 +196,7 @@
 	{
 		'description': 'Available in \nBill Of Materials, Delivery Note, Payable Voucher, Production Order, Purchase Order, Purchase Receipt, Receivable Voucher, Sales Order, Stock Entry, Timesheet',
 		'doctype': 'DocField',
-		'fieldname': 'projects',
+		'fieldname': 'fs_projects',
 		'fieldtype': 'Check',
 		'label': 'Projects'
 	},
@@ -205,7 +206,7 @@
 		'colour': 'White:FFF',
 		'description': 'If you have Sales Team and Sale Partners (Channel Partners)  they can be tagged and maintain their contribution in the sales activity',
 		'doctype': 'DocField',
-		'fieldname': 'sales_extras',
+		'fieldname': 'fs_sales_extras',
 		'fieldtype': 'Check',
 		'label': 'Sales Extras'
 	},
@@ -222,7 +223,7 @@
 		'colour': 'White:FFF',
 		'description': 'If you involve in manufacturing activity<br>\nEnables item <b>Is Manufactured</b>',
 		'doctype': 'DocField',
-		'fieldname': 'manufacturing',
+		'fieldname': 'fs_manufacturing',
 		'fieldtype': 'Check',
 		'label': 'Manufacturing'
 	},
@@ -238,7 +239,7 @@
 		'colour': 'White:FFF',
 		'description': 'If you follow Quality Inspection<br>\nEnables item QA Required and QA No in Purchase Receipt',
 		'doctype': 'DocField',
-		'fieldname': 'quality',
+		'fieldname': 'fs_quality',
 		'fieldtype': 'Check',
 		'label': 'Quality'
 	},
@@ -248,7 +249,7 @@
 		'colour': 'White:FFF',
 		'description': 'To enable <b>Point of Sale</b> features',
 		'doctype': 'DocField',
-		'fieldname': 'pos',
+		'fieldname': 'fs_pos',
 		'fieldtype': 'Check',
 		'label': 'Point of Sale'
 	},
@@ -265,7 +266,7 @@
 		'colour': 'White:FFF',
 		'description': 'If you have long print formats, this feature can be used to split the page to be printed on multiple pages with all headers and footers on each page',
 		'doctype': 'DocField',
-		'fieldname': 'page_break',
+		'fieldname': 'fs_page_break',
 		'fieldtype': 'Check',
 		'label': 'Page Break'
 	},
@@ -281,7 +282,7 @@
 		'colour': 'White:FFF',
 		'description': 'Enables <b>More Info.</b> in all documents',
 		'doctype': 'DocField',
-		'fieldname': 'more_info',
+		'fieldname': 'fs_more_info',
 		'fieldtype': 'Check',
 		'label': 'More Info'
 	}
diff --git a/erpnext/startup/startup.js b/erpnext/startup/startup.js
index a6bc594..a0661ae 100644
--- a/erpnext/startup/startup.js
+++ b/erpnext/startup/startup.js
@@ -43,7 +43,18 @@
 	// ------------------
 	$dh(page_body.footer);
 
-	pscript.startup_setup_toolbar();
+	// for logout and payment
+	var callback = function(r,rt) {
+		if(r.message){
+			login_file = 'http://' + r.message;
+		}
+		else if(pscript.is_erpnext_saas) {
+			login_file = 'https://www.erpnext.com';
+		}
+		// setup toolbar
+		pscript.startup_setup_toolbar();
+	}
+	$c_obj('Home Control', 'get_login_url', '', callback);
 }
 
 // ====================================================================
@@ -52,15 +63,6 @@
 	$y(page_body.left_sidebar, {width:(100/6)+'%', paddingTop:'8px'});
 
 	var callback = function(r,rt) {
-		// login url
-		if(r.login_url){
-			login_file = 'http://' + r.message;
-		}
-		else if(pscript.is_erpnext_saas) {
-			login_file = 'https://www.erpnext.com';
-		}
-		
-				
 		// menu
 		var ml = r.message;
 
@@ -112,7 +114,6 @@
 var body_background = '#e2e2e2';
 
 MenuPointer = function(parent, label) {
-	var me = this;
 
 	this.wrapper = $a(parent, 'div', '', {padding:'0px', cursor:'pointer', margin:'2px 0px'});
 	$br(this.wrapper, '3px');
@@ -124,21 +125,15 @@
 
 	// triangle border (?)
 	this.tab.triangle_div = $a($td(this.tab, 0, 1), 'div','', {
-		borderColor: body_background,
+		borderColor: body_background + ' ' + body_background + ' ' + body_background + ' ' + 'transparent',
 		borderWidth:'11px', borderStyle:'solid', height:'0px', width:'0px', marginRight:'-11px'});
 
 	this.label_area = $a($td(this.tab, 0, 0), 'span', '', '', label);
 
 	$(this.wrapper)
 		.hover(
-			function() { 
-				if(!me.selected) 
-					$y(me.label_area, {'color':'#000'}); 
-			},
-			function() { 
-				if(!me.selected) 
-					$y(me.label_area, {'color':'#444'}); 
-			}
+			function() { if(!this.selected)$bg(this, '#eee'); } ,
+			function() { if(!this.selected)$bg(this, body_background); }
 		)
 
 	$y($td(this.tab, 0, 0), {borderBottom:'1px solid #ddd'});
@@ -148,8 +143,7 @@
 // ====================================================================
 
 MenuPointer.prototype.select = function(grey) {
-	$y($td(this.tab, 0, 0), {borderBottom:'0px solid #000'});
-	$y(this.label_area, {'color':'#fff'});
+	$y($td(this.tab, 0, 0), {color:'#fff', borderBottom:'0px solid #000'});
 	//$gr(this.wrapper, '#F84', '#F63');
 	$gr(this.wrapper, '#888', '#666');
 	this.selected = 1;
@@ -157,21 +151,14 @@
 	if(cur_menu_pointer && cur_menu_pointer != this)
 		cur_menu_pointer.deselect();
 
-	$y(this.tab.triangle_div, {borderColor: 
-		body_background + ' ' + body_background + ' ' + body_background + ' ' + 'transparent'})
-
 	cur_menu_pointer = this;
 }
 
 // ====================================================================
 
 MenuPointer.prototype.deselect = function() {
-	$y($td(this.tab, 0, 0), {borderBottom:'1px solid #ddd'});
-	$y(this.label_area, {'color':'#444'});
-
-
+	$y($td(this.tab, 0, 0), {color:'#444', borderBottom:'1px solid #ddd'});
 	$gr(this.wrapper, body_background, body_background);
-	$y(this.tab.triangle_div, {borderColor: body_background});
 	this.selected = 0;
 }
 
@@ -565,7 +552,7 @@
 	}
 // ====================================================================*/
 pscript.feature_dict = {
-	'projects': {
+	'fs_projects': {
 		'Bill Of Materials': {'fields':['project_name']},
 		'Delivery Note': {'fields':['project_name']},
 		'Payable Voucher': {'fields':['project_name']},
@@ -577,17 +564,17 @@
 		'Stock Entry': {'fields':['project_name']},
 		'Timesheet': {'timesheet_details':['project_name']}
 	},
-	'packing_details': {
+	'fs_packing_details': {
 		'Delivery Note': {'fields':['packing_details','print_packing_slip'],'delivery_note_details':['no_of_packs','pack_gross_wt','pack_nett_wt','pack_no','pack_unit']},
 		'Sales Order': {'fields':['packing_details']}
 	},
-	'discounts': {
+	'fs_discounts': {
 		'Delivery Note': {'delivery_note_details':['adj_rate']},
 		'Quotation': {'quotation_details':['adj_rate']},
 		'Receivable Voucher': {'entries':['adj_rate']},
 		'Sales Order': {'sales_order_details':['adj_rate','ref_rate']}
 	},
-	'brands': {
+	'fs_brands': {
 		'Delivery Note': {'delivery_note_details':['brand']},
 		'Indent': {'indent_details':['brand']},
 		'Item': {'fields':['brand']},
@@ -599,10 +586,10 @@
 		'Sales Order': {'sales_order_details':['brand']},
 		'Serial No': {'fields':['brand']}
 	},
-	'after_sales_installations': {
+	'fs_after_sales_installations': {
 		'Delivery Note': {'fields':['installation_status','per_installed'],'delivery_note_details':['installed_qty']}
 	},
-	'item_batch_nos': {
+	'fs_item_batch_nos': {
 		'Delivery Note': {'delivery_note_details':['batch_no']},
 		'Item': {'fields':['has_batch_no']},
 		'Purchase Receipt': {'purchase_receipt_details':['batch_no']},
@@ -612,7 +599,7 @@
 		'Stock Entry': {'mtn_details':['batch_no']},
 		'Stock Ledger Entry': {'fields':['batch_no']}
 	},
-	'item_serial_nos': {
+	'fs_item_serial_nos': {
 		'Customer Issue': {'fields':['serial_no']},
 		'Delivery Note': {'delivery_note_details':['serial_no'],'packing_details':['serial_no']},
 		'Installation Note': {'installed_item_details':['serial_no']},
@@ -626,7 +613,7 @@
 		'Stock Entry': {'mtn_details':['serial_no']},
 		'Stock Ledger Entry': {'fields':['serial_no']}
 	},
-	'item_group_in_details': {
+	'fs_item_group_in_details': {
 		'Delivery Note': {'delivery_note_details':['item_group']},
 		'Enquiry': {'enquiry_details':['item_group']},
 		'Indent': {'indent_details':['item_group']},
@@ -644,7 +631,7 @@
 		'Sales Person': {'target_details':['item_group']},
 		'Territory': {'target_details':['item_group']}
 	},
-	'page_break': {
+	'fs_page_break': {
 		'Delivery Note': {'delivery_note_details':['page_break'],'packing_details':['page_break']},
 		'Indent': {'indent_details':['page_break']},
 		'Purchase Order': {'po_details':['page_break']},
@@ -654,7 +641,7 @@
 		'Receivable Voucher': {'entries':['page_break']},
 		'Sales Order': {'sales_order_details':['page_break']}
 	},
-	'exports': {
+	'fs_exports': {
 		'Delivery Note': {'fields':['Note','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'delivery_note_details':['base_ref_rate','export_amount','export_rate']},
 		'POS Setting': {'fields':['conversion_rate','currency']},
 		'Quotation': {'fields':['Note HTML','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'quotation_details':['base_ref_rate','export_amount','export_rate']},
@@ -663,16 +650,16 @@
 		'Sales BOM': {'fields':['currency']},
 		'Sales Order': {'fields':['Note1','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'sales_order_details':['base_ref_rate','export_amount','export_rate']}
 	},
-	'imports': {
+	'fs_imports': {
 		'Payable Voucher': {'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'entries':['import_amount','import_rate']},
 		'Purchase Order': {'fields':['Note HTML','conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'po_details':['import_amount','import_rate']},
 		'Purchase Receipt': {'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'purchase_receipt_details':['import_amount','import_rate']},
 		'Supplier Quotation': {'fields':['conversion_rate','currency']}
 	},
-	'item_advanced': {
+	'fs_item_advanced': {
 		'Item': {'fields':['item_customer_details']}
 	},
-	'sales_extras': {
+	'fs_sales_extras': {
 		'Address': {'fields':['sales_partner']},
 		'Contact': {'fields':['sales_partner']},
 		'Customer': {'fields':['sales_team']},
@@ -681,7 +668,7 @@
 		'Receivable Voucher': {'fields':['sales_team']},
 		'Sales Order': {'fields':['sales_team','Packing List']}
 	},
-	'more_info': {
+	'fs_more_info': {
 		'Customer': {'fields':['More Info']},
 		'Delivery Note': {'fields':['More Info']},
 		'Enquiry': {'fields':['More Info']},
@@ -696,14 +683,14 @@
 		'Serial No': {'fields':['More Info']},
 		'Supplier': {'fields':['More Info']}
 	},
-	'quality': {
+	'fs_quality': {
 		'Item': {'fields':['Item Inspection Criteria','inspection_required']},
 		'Purchase Receipt': {'purchase_receipt_details':['qa_no']}
 	},
-	'manufacturing': {
+	'fs_manufacturing': {
 		'Item': {'fields':['Manufacturing']}
 	},
-	'pos': {
+	'fs_pos': {
 		'Receivable Voucher': {'fields':['is_pos']}
 	}
 }