Merge branch 'shf_rename' of github.com:webnotes/erpnext into shf_rename
diff --git a/css/all-app.css b/css/all-app.css
index 2208e82..b8ffbc5 100644
--- a/css/all-app.css
+++ b/css/all-app.css
@@ -2100,6 +2100,9 @@
 	header .container, .content {
 		width: 1100px;
 	}
+	div#body_div {
+		min-height: 600px;
+	}
 }
 
 div.no_script {
diff --git a/css/all-web.css b/css/all-web.css
index ae241e2..cf2152d 100644
--- a/css/all-web.css
+++ b/css/all-web.css
@@ -1961,6 +1961,9 @@
 	header .container, .content {
 		width: 1100px;
 	}
+	div#body_div {
+		min-height: 600px;
+	}
 }
 
 div.no_script {
diff --git a/erpnext/projects/doctype/project/listview.js b/erpnext/projects/doctype/project/listview.js
new file mode 100644
index 0000000..0ed42ca
--- /dev/null
+++ b/erpnext/projects/doctype/project/listview.js
@@ -0,0 +1,53 @@
+// render
+wn.doclistviews['Project'] = wn.views.ListView.extend({
+	init: function(d) {
+		this._super(d);
+		this.fields = this.fields.concat([
+			'`tabProject`.project_name',
+			'`tabProject`.status',
+			'`tabProject`.is_active',
+			'`tabProject`.priority',
+			'IFNULL(`tabProject`.project_value, 0) as project_value',
+			'IFNULL(`tabProject`.per_gross_margin, 0) as per_gross_margin',
+			'`tabProject`.completion_date',
+		]);
+		//this.stats = this.stats.concat(['company']);
+	},
+
+	prepare_data: function(data) {
+		this._super(data);
+		data.completion_date = wn.datetime.str_to_user(data.completion_date);
+	},
+
+	columns: [
+		{width: '3%', content: 'check'},
+		{width: '3%', content: 'docstatus'},
+		{width: '15%', content: 'name'},
+		{width: '22%', content: 'project_name+tags'},
+		{
+			width: '20%',
+			content: function(parent, data) {
+				$(parent).html(data.status + " [" + data.priority + "] " 
+					+ (data.is_active=='No'?" [Inactive]":""));
+			},
+		},
+		{
+			width: '15%', 
+			content: function(parent, data) {
+				$(parent).html(sys_defaults.currency + " " 
+					+ fmt_money(data.project_value));
+			},
+			css: {'text-align': 'right'},
+		},
+		{
+			width: '10%', 
+			content: function(parent, data) {
+				$(parent).html(fmt_money(data.per_gross_margin) + " %");
+			},
+			css: {'text-align': 'right'},
+		},
+		{width: '12%', content:'completion_date', css: {
+			'text-align': 'right', 'color':'#777'
+		}},
+	]
+});
diff --git a/erpnext/projects/doctype/task/listview.js b/erpnext/projects/doctype/task/listview.js
new file mode 100644
index 0000000..468f1f3
--- /dev/null
+++ b/erpnext/projects/doctype/task/listview.js
@@ -0,0 +1,38 @@
+// render
+wn.doclistviews['Task'] = wn.views.ListView.extend({
+	init: function(d) {
+		this._super(d);
+		this.fields = this.fields.concat([
+			'`tabTask`.subject',
+			'`tabTask`.status',
+			'`tabTask`.opening_date',
+			'`tabTask`.priority',
+			'`tabTask`.allocated_to',
+		]);
+	},
+
+	prepare_data: function(data) {
+		this._super(data);
+		data.opening_date = wn.datetime.str_to_user(data.opening_date);
+	},
+
+	columns: [
+		{width: '3%', content: 'check'},
+		{width: '5%', content: 'avatar'},
+		{width: '3%', content: 'docstatus'},
+		{width: '12%', content: 'name'},
+		{width: '30%', content: 'subject+tags'},
+		{
+			width: '15%',
+			content: function(parent, data) {
+				$(parent).html(data.status + 
+					(data.priority ? " [" + data.priority + "]" : "")
+				);
+			},
+		},
+		{width: '20%', content: 'allocated_to'},
+		{width: '12%', content:'opening_date', css: {
+			'text-align': 'right', 'color':'#777'
+		}},
+	]
+});
diff --git a/erpnext/projects/doctype/timesheet/listview.js b/erpnext/projects/doctype/timesheet/listview.js
new file mode 100644
index 0000000..66e4e5d
--- /dev/null
+++ b/erpnext/projects/doctype/timesheet/listview.js
@@ -0,0 +1,35 @@
+// render
+wn.doclistviews['Timesheet'] = wn.views.ListView.extend({
+	init: function(d) {
+		this._super(d);
+		this.fields = this.fields.concat([
+			'`tabTimesheet`.status',
+			'`tabTimesheet`.timesheet_date',
+			'`tabTimesheet`.owner',
+			'`tabTimesheet`.notes',
+			
+		]);
+	},
+
+	prepare_data: function(data) {
+		this._super(data);
+		data.timesheet_date = wn.datetime.str_to_user(data.timesheet_date);
+		if(data.notes && data.notes.length > 50) {
+			data.notes = '<span title="'+data.notes+'">' + 
+				data.notes.substr(0,50) + '...</span>';
+		}
+	},
+
+	columns: [
+		{width: '3%', content: 'check'},
+		{width: '5%', content: 'avatar'},
+		{width: '3%', content: 'docstatus'},
+		{width: '18%', content: 'name'},
+		{width: '12%', content: 'status'},
+		{width: '27%', content: 'notes+tags', css: {'color': '#777'}},
+		{width: '20%', content: 'owner'},
+		{width: '12%', content:'timesheet_date', css: {
+			'text-align': 'right', 'color':'#777'
+		}},
+	]
+});
diff --git a/erpnext/stock/doctype/batch/listview.js b/erpnext/stock/doctype/batch/listview.js
new file mode 100644
index 0000000..d8e19b3
--- /dev/null
+++ b/erpnext/stock/doctype/batch/listview.js
@@ -0,0 +1,28 @@
+// render
+wn.doclistviews['Batch'] = wn.views.ListView.extend({
+	init: function(d) {
+		this._super(d)
+		this.fields = this.fields.concat([
+			"`tabBatch`.item",
+			"`tabBatch`.description",
+		]);
+		this.stats = this.stats.concat(['company']);
+	},
+
+	prepare_data: function(data) {
+		this._super(data);
+		if(data.description && data.description.length > 50) {
+			data.description = '<span title="'+data.description+'">' + 
+				data.description.substr(0,50) + '...</span>';
+		}
+	},
+	
+	columns: [
+		{width: '3%', content:'check'},
+		{width: '5%', content:'avatar'},
+		{width: '15%', content:'name'},
+		{width: '15%', content:'item'},
+		{width: '50%', content:'tags+description'},
+		{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
+	]
+});
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/listview.js b/erpnext/stock/doctype/item/listview.js
index a483e35..28510ff 100644
--- a/erpnext/stock/doctype/item/listview.js
+++ b/erpnext/stock/doctype/item/listview.js
@@ -13,7 +13,8 @@
 		this._super(data);
 		data.description = repl("%(item_name)s | %(description)s", data);
 		if(data.description && data.description.length > 50) {
-			data.description = '<span title="'+data.description+'">' + data.description.substr(0,50) + '...</span>';
+			data.description = '<span title="'+data.description+'">' + 
+				data.description.substr(0,50) + '...</span>';
 		}
 	},
 	
diff --git a/erpnext/stock/doctype/serial_no/listview.js b/erpnext/stock/doctype/serial_no/listview.js
new file mode 100644
index 0000000..8d9a3e6
--- /dev/null
+++ b/erpnext/stock/doctype/serial_no/listview.js
@@ -0,0 +1,28 @@
+// render
+wn.doclistviews['Serial No'] = wn.views.ListView.extend({
+	init: function(d) {
+		this._super(d)
+		this.fields = this.fields.concat([
+			"`tabSerial No`.item_code",
+			"`tabSerial No`.item_name",
+			"`tabSerial No`.status",
+			"`tabSerial No`.warehouse",
+		]);
+		this.stats = this.stats.concat(['company']);
+	},
+
+	prepare_data: function(data) {
+		this._super(data);
+		data.item_name = data.item_name ? data.item_name : data.item_code;
+	},
+	
+	columns: [
+		{width: '3%', content:'check'},
+		{width: '5%', content:'avatar'},
+		{width: '15%', content:'name'},
+		{width: '30%', content:'item_name+tags'},
+		{width: '15%', content:'status'},
+		{width: '20%', content:'warehouse', css: {'color': '#777'}},
+		{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
+	]
+});
\ No newline at end of file
diff --git a/erpnext/stock/doctype/warehouse/listview.js b/erpnext/stock/doctype/warehouse/listview.js
new file mode 100644
index 0000000..00b1e2e
--- /dev/null
+++ b/erpnext/stock/doctype/warehouse/listview.js
@@ -0,0 +1,35 @@
+// render
+wn.doclistviews['Warehouse'] = wn.views.ListView.extend({
+	init: function(d) {
+		this._super(d)
+		this.fields = this.fields.concat([
+			"`tabWarehouse`.warehouse_type",
+			"`tabWarehouse`.address_line_1",
+			"`tabWarehouse`.address_line_2",
+			"`tabWarehouse`.city",
+			"`tabWarehouse`.state",
+			"`tabWarehouse`.pin",
+		]);
+		this.stats = this.stats.concat(['company']);
+	},
+
+	prepare_data: function(data) {
+		this._super(data);
+		var concat_list = [];
+		data.address_line_1 && concat_list.push(data.address_line_1);
+		data.address_line_2 && concat_list.push(data.address_line_2);
+		data.city && concat_list.push(data.city);
+		data.state && concat_list.push(data.state);
+		data.pin && concat_list.push(data.pin);
+		data.address = concat_list.join(", ");
+	},
+	
+	columns: [
+		{width: '3%', content:'check'},
+		{width: '5%', content:'avatar'},
+		{width: '20%', content:'name'},
+		{width: '15%', content:'warehouse_type'},
+		{width: '45%', content:'tags+address'},
+		{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
+	]
+});
\ No newline at end of file
diff --git a/erpnext/stock/doctype/warehouse/warehouse.txt b/erpnext/stock/doctype/warehouse/warehouse.txt
index 2deacf0..16bf59d 100644
--- a/erpnext/stock/doctype/warehouse/warehouse.txt
+++ b/erpnext/stock/doctype/warehouse/warehouse.txt
@@ -3,9 +3,9 @@
 
 	# These values are common in all dictionaries
 	{
-		'creation': '2012-04-11 13:18:57',
+		'creation': '2012-05-15 12:15:13',
 		'docstatus': 0,
-		'modified': '2012-04-11 17:47:35',
+		'modified': '2012-05-21 18:02:46',
 		'modified_by': u'Administrator',
 		'owner': u'Administrator'
 	},
@@ -25,7 +25,7 @@
 		'section_style': u'Tabbed',
 		'server_code_error': u' ',
 		'show_in_menu': 0,
-		'version': 59
+		'version': 1
 	},
 
 	# These values are common for all DocField
@@ -321,19 +321,6 @@
 
 	# DocField
 	{
-		'colour': u'White:FFF',
-		'doctype': u'DocField',
-		'fieldname': u'state',
-		'fieldtype': u'Select',
-		'label': u'State',
-		'oldfieldname': u'state',
-		'oldfieldtype': u'Select',
-		'options': u'\nSelect country first',
-		'permlevel': 0
-	},
-
-	# DocField
-	{
 		'doctype': u'DocField',
 		'fieldname': u'city',
 		'fieldtype': u'Data',
@@ -346,6 +333,19 @@
 
 	# DocField
 	{
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'state',
+		'fieldtype': u'Data',
+		'label': u'State',
+		'oldfieldname': u'state',
+		'oldfieldtype': u'Select',
+		'options': u'Suggest',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
 		'doctype': u'DocField',
 		'fieldname': u'pin',
 		'fieldtype': u'Int',
diff --git a/erpnext/support/doctype/customer_issue/listview.js b/erpnext/support/doctype/customer_issue/listview.js
new file mode 100644
index 0000000..43e6125
--- /dev/null
+++ b/erpnext/support/doctype/customer_issue/listview.js
@@ -0,0 +1,60 @@
+// render
+wn.doclistviews['Customer Issue'] = wn.views.ListView.extend({
+	me: this,
+
+	init: function(d) {
+		this._super(d)
+		this.fields = this.fields.concat([
+			"`tabCustomer Issue`.customer",
+			"`tabCustomer Issue`.serial_no",
+			"`tabCustomer Issue`.item_name",
+			"`tabCustomer Issue`.complaint",
+			"`tabCustomer Issue`.status",
+		]);
+		this.stats = this.stats.concat(['status', 'company']);
+		//this.show_hide_check_column();
+	},
+	
+	prepare_data: function(data) {
+		this._super(data);
+		if(data.status=='Open') {
+			data.label_type = 'important';
+		} else if(data.status=='Closed') {
+			data.label_type = 'success';
+		} else if(data.status=='Cancelled') {
+			data.label_type = 'info';
+		} else if(data.status=='Work In Progress') {
+			data.label_type = 'info';
+			data.status = 'WIP';
+		}
+		
+		data.status_html = repl(
+			'<span class="label label-%(label_type)s">%(status)s</span>', data);
+		var a = $(data.status_html).click(function() {
+			me.set_filter('status', $(this).text());
+		});
+		
+		var concat_list = [data.customer];
+		data.serial_no && concat_list.push(data.serial_no);
+		data.complaint && concat_list.push(data.complaint);
+		data.complaint = concat_list.join(" | ");
+		
+		// description
+		if(data.complaint && data.complaint.length > 50) {
+			data.complaint = '<span title="'+data.complaint+'">' + 
+				data.complaint.substr(0,50) + '...</span>';
+		}
+	},
+	
+	columns: [
+		{width: '3%', content: 'check'},
+		{width: '5%', content: 'avatar'},
+		{width: '3%', content: 'docstatus'},
+		{width: '20%', content: 'name'},
+		{width: '10%', content: 'status_html'},
+		{width: '47%', content: 'tags+complaint', css: {color:'#777'}},
+		{width: '12%', content: 'modified',
+			css: {'text-align': 'right', 'color':'#777'}}
+	]
+
+});
diff --git a/erpnext/support/doctype/maintenance_schedule/listview.js b/erpnext/support/doctype/maintenance_schedule/listview.js
new file mode 100644
index 0000000..a471c3e
--- /dev/null
+++ b/erpnext/support/doctype/maintenance_schedule/listview.js
@@ -0,0 +1,24 @@
+// render
+wn.doclistviews['Maintenance Schedule'] = wn.views.ListView.extend({
+	me: this,
+
+	init: function(d) {
+		this._super(d)
+		this.fields = this.fields.concat([
+			"`tabMaintenance Schedule`.customer",			
+		]);
+		this.stats = this.stats.concat(['company']);
+		//this.show_hide_check_column();
+	},
+	
+	columns: [
+		{width: '3%', content: 'check'},
+		{width: '5%', content: 'avatar'},
+		{width: '3%', content: 'docstatus'},
+		{width: '20%', content: 'name'},
+		{width: '55%', content: 'customer+tags'},
+		{width: '14%', content: 'modified',
+			css: {'text-align': 'right', 'color':'#777'}}
+	]
+
+});
diff --git a/erpnext/support/doctype/maintenance_visit/listview.js b/erpnext/support/doctype/maintenance_visit/listview.js
new file mode 100644
index 0000000..654f455
--- /dev/null
+++ b/erpnext/support/doctype/maintenance_visit/listview.js
@@ -0,0 +1,41 @@
+// render
+wn.doclistviews['Maintenance Visit'] = wn.views.ListView.extend({
+	me: this,
+
+	init: function(d) {
+		this._super(d)
+		this.fields = this.fields.concat([
+			"`tabMaintenance Visit`.customer_name",
+			"`tabMaintenance Visit`.mntc_date",
+			"`tabMaintenance Visit`.mntc_time",
+			"`tabMaintenance Visit`.maintenance_type",
+			"`tabMaintenance Visit`.completion_status",
+			
+		]);
+		this.stats = this.stats.concat(['completion_status', 'company']);
+		//this.show_hide_check_column();
+	},
+	
+	prepare_data: function(data) {
+		this._super(data);
+		data.mntc_date = wn.datetime.str_to_user(data.mntc_date);
+		data.mntc_time = wn.datetime.time_to_ampm(data.mntc_time);
+		data.date_time = "on " + data.mntc_date + " at " + 
+			data.mntc_time[0] + ":" + data.mntc_time[1] + " " + data.mntc_time[2];
+		data.customer_name = data.customer_name + " " + data.date_time;
+		data.completion_status = data.completion_status + 
+			(data.maintenance_type ? " [" + data.maintenance_type + "]": "");
+	},
+	
+	columns: [
+		{width: '3%', content: 'check'},
+		{width: '5%', content: 'avatar'},
+		{width: '3%', content: 'docstatus'},
+		{width: '15%', content: 'name'},
+		{width: '40%', content: 'customer_name+tags'},
+		{width: '20%', content: 'completion_status'},
+		{width: '14%', content: 'modified',
+			css: {'text-align': 'right', 'color':'#777'}}
+	]
+
+});