Fixes to microtemplate feature
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
index 74a9628..55e3247 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -14,6 +14,10 @@
 from erpnext.controllers.buying_controller import BuyingController
 from erpnext.accounts.party import get_party_account, get_due_date
 
+form_grid_templates = {
+	"entries": "templates/form_grid/item_grid.html"
+}
+
 class PurchaseInvoice(BuyingController):
 	tname = 'Purchase Invoice Item'
 	fname = 'entries'
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.html b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.html
index 3305d42..cccd38a 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.html
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.html
@@ -10,7 +10,7 @@
 				{% if(frappe.datetime.get_diff(doc.due_date) < 0) { %}
 				<span class="label label-danger filterable"
 					title="{%= doc.get_formatted("due_date")%}"
-					data-filter="outstanding_amount,>,0|due,<,Today">
+					data-filter="outstanding_amount,>,0|due_date,<,Today">
 						{%= __("Overdue: ") + comment_when(doc.due_date) %}
 				</span>
 				{% } else { %}
@@ -38,6 +38,8 @@
 		{% include "templates/form_grid/includes/progress.html" %}
 	</div>
 	<div class="col-xs-2 text-right">
-		{%= doc.get_formatted("grand_total") %}
+		<div class="text-ellipsis" title="{%= doc.get_formatted('grand_total_import') %}">
+			{%= doc.get_formatted("grand_total_import") %}
+		</div>
 	</div>
 </div>
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.html b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.html
index de8451e..47fadb5 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.html
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.html
@@ -38,6 +38,8 @@
 		{% include "templates/form_grid/includes/progress.html" %}
 	</div>
 	<div class="col-xs-2 text-right">
-		{%= doc.get_formatted("grand_total") %}
+		<div class="text-ellipsis" title="{%= doc.get_formatted("grand_total_export") %}">
+			{%= doc.get_formatted("grand_total_export") %}
+		</div>
 	</div>
 </div>
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order_list.html b/erpnext/buying/doctype/purchase_order/purchase_order_list.html
index 4806cfb..a2031c0 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order_list.html
+++ b/erpnext/buying/doctype/purchase_order/purchase_order_list.html
@@ -32,6 +32,8 @@
 		{% include "templates/form_grid/includes/progress.html" %}
 	</div>
 	<div class="col-xs-2 text-right">
-		{%= doc.get_formatted("grand_total") %}
+		<div class="text-ellipsis" title="{%= doc.get_formatted('grand_total_import') %}">
+			{%= doc.get_formatted("grand_total_import") %}
+		</div>
 	</div>
 </div>
diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json
index 752f342..6a34e7d 100644
--- a/erpnext/buying/doctype/supplier/supplier.json
+++ b/erpnext/buying/doctype/supplier/supplier.json
@@ -186,7 +186,7 @@
  ], 
  "icon": "icon-user", 
  "idx": 1, 
- "modified": "2014-05-27 03:49:20.060872", 
+ "modified": "2014-08-07 06:57:15.274795", 
  "modified_by": "Administrator", 
  "module": "Buying", 
  "name": "Supplier", 
@@ -231,5 +231,6 @@
    "role": "Accounts User"
   }
  ], 
- "search_fields": "supplier_name,supplier_type"
+ "search_fields": "supplier_name,supplier_type", 
+ "title_field": "supplier_name"
 }
\ No newline at end of file
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation_list.html b/erpnext/buying/doctype/supplier_quotation/supplier_quotation_list.html
index bd833c3..9aa9d5b 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation_list.html
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation_list.html
@@ -15,6 +15,8 @@
 		</div>
 	</div>
 	<div class="col-xs-2 text-right">
-		{%= doc.get_formatted("grand_total") %}
+		<div class="text-ellipsis" title="{%= doc.get_formatted('grand_total_import') %}">
+			{%= doc.get_formatted("grand_total_import") %}
+		</div>
 	</div>
 </div>
diff --git a/erpnext/manufacturing/doctype/production_order/production_order_list.html b/erpnext/manufacturing/doctype/production_order/production_order_list.html
index 4cdaa54..a856a0e 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order_list.html
+++ b/erpnext/manufacturing/doctype/production_order/production_order_list.html
@@ -17,14 +17,14 @@
 				</span>
 				{% } else { %}
 				<span class="label label-warning filterable"
-					data-filter="produced_qty,<,qty|status,!=,Stopped"
+					data-filter="produced_qty,<,{%= doc.qty %}|status,!=,Stopped"
 					title="{%= __("Pending") %}">
 					{%= doc.get_formatted("expected_delivery_date")%}</span>
 				{% } %}
 			{% } %}
 			{% if(per == 100 && doc.status!=="Stopped") { %}
 				<span class="filterable text-muted"
-					data-filter="produced_qty,=,qty|status,!=,Stopped">
+					data-filter="produced_qty,=,{%= doc.qty %}|status,!=,Stopped">
 					<i class="icon-ok-sign"></i></span>
 			{% } %}
 			{% if(doc.status==="Stopped") { %}
diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py
index 7ca502d..8d63f12 100644
--- a/erpnext/projects/doctype/task/task.py
+++ b/erpnext/projects/doctype/task/task.py
@@ -63,13 +63,12 @@
 	data = frappe.db.sql("""select name, exp_start_date, exp_end_date,
 		subject, status, project from `tabTask`
 		where ((ifnull(exp_start_date, '0000-00-00')!= '0000-00-00') \
-				and (exp_start_date between '%(start)s' and '%(end)s') \
+				and (exp_start_date between %(start)s and %(end)s) \
 			or ((ifnull(exp_start_date, '0000-00-00')!= '0000-00-00') \
-				and exp_end_date between '%(start)s' and '%(end)s'))
-		%(conditions)s""" % {
+				and exp_end_date between %(start)s and %(end)s))
+		{conditions}""".format(conditions=conditions), {
 			"start": start,
-			"end": end,
-			"conditions": conditions
+			"end": end
 		}, as_dict=True, update={"allDay": 0})
 
 	return data
diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch_list.js b/erpnext/projects/doctype/time_log_batch/time_log_batch_list.js
index a0825a2..cc6746e 100644
--- a/erpnext/projects/doctype/time_log_batch/time_log_batch_list.js
+++ b/erpnext/projects/doctype/time_log_batch/time_log_batch_list.js
@@ -1,4 +1,3 @@
 frappe.listview_settings['Time Log Batch'] = {
-	add_fields: ["status", "total_hours", "rate"],
-	filters:[["status","in", "Draft,Submitted"]]
+	add_fields: ["status", "total_hours", "rate"]
 };
diff --git a/erpnext/selling/doctype/customer/customer.json b/erpnext/selling/doctype/customer/customer.json
index 794b763..ef71d56 100644
--- a/erpnext/selling/doctype/customer/customer.json
+++ b/erpnext/selling/doctype/customer/customer.json
@@ -282,7 +282,7 @@
  ], 
  "icon": "icon-user", 
  "idx": 1, 
- "modified": "2014-05-27 03:49:09.208254", 
+ "modified": "2014-08-07 06:57:25.248707", 
  "modified_by": "Administrator", 
  "module": "Selling", 
  "name": "Customer", 
@@ -332,5 +332,6 @@
    "write": 1
   }
  ], 
- "search_fields": "customer_name,customer_group,territory"
+ "search_fields": "customer_name,customer_group,territory", 
+ "title_field": "customer_name"
 }
\ No newline at end of file
diff --git a/erpnext/selling/doctype/quotation/quotation_list.html b/erpnext/selling/doctype/quotation/quotation_list.html
index afdce25..2126b52 100644
--- a/erpnext/selling/doctype/quotation/quotation_list.html
+++ b/erpnext/selling/doctype/quotation/quotation_list.html
@@ -24,6 +24,8 @@
 		</div>
 	</div>
 	<div class="col-xs-2 text-right">
-		{%= doc.get_formatted("grand_total") %}
+		<div class="text-ellipsis" title="{%= doc.get_formatted('grand_total_export') %}">
+			{%= doc.get_formatted("grand_total_export") %}
+		</div>
 	</div>
 </div>
diff --git a/erpnext/selling/doctype/sales_order/sales_order_list.html b/erpnext/selling/doctype/sales_order/sales_order_list.html
index ffa3c01..4079b2a 100644
--- a/erpnext/selling/doctype/sales_order/sales_order_list.html
+++ b/erpnext/selling/doctype/sales_order/sales_order_list.html
@@ -41,6 +41,8 @@
 		{% include "templates/form_grid/includes/progress.html" %}
 	</div>
 	<div class="col-xs-2 text-right">
-		{%= doc.get_formatted("grand_total") %}
+		<div class="text-ellipsis" title="{%= doc.get_formatted('grand_total_export') %}">
+			{%= doc.get_formatted("grand_total_export") %}
+		</div>
 	</div>
 </div>
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note_list.html b/erpnext/stock/doctype/delivery_note/delivery_note_list.html
index c4df5de..de0af97 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note_list.html
+++ b/erpnext/stock/doctype/delivery_note/delivery_note_list.html
@@ -24,6 +24,8 @@
 		{% include "templates/form_grid/includes/progress.html" %}
 	</div>
 	<div class="col-xs-2 text-right">
-		{%= doc.get_formatted("grand_total") %}
+		<div class="text-ellipsis" title="{%= doc.get_formatted('grand_total_export') %}">
+			{%= doc.get_formatted("grand_total_export") %}
+		</div>
 	</div>
 </div>
diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.json b/erpnext/stock/doctype/material_request_item/material_request_item.json
index 61b03f8..56d4121 100644
--- a/erpnext/stock/doctype/material_request_item/material_request_item.json
+++ b/erpnext/stock/doctype/material_request_item/material_request_item.json
@@ -109,7 +109,7 @@
    "allow_on_submit": 0, 
    "fieldname": "schedule_date", 
    "fieldtype": "Date", 
-   "in_list_view": 1, 
+   "in_list_view": 0, 
    "label": "Required Date", 
    "no_copy": 0, 
    "oldfieldname": "schedule_date", 
@@ -234,7 +234,7 @@
  ], 
  "idx": 1, 
  "istable": 1, 
- "modified": "2014-07-18 01:04:18.470761", 
+ "modified": "2014-08-07 07:12:47.994668", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Material Request Item", 
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.html b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.html
index 89baea5..558b160 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.html
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.html
@@ -27,6 +27,8 @@
 		</div>
 	</div>
 	<div class="col-xs-2 text-right">
-		{%= doc.get_formatted("grand_total") %}
+		<div class="text-ellipsis" title="{%= doc.get_formatted('grand_total_import') %}">
+			{%= doc.get_formatted("grand_total_import") %}
+		</div>
 	</div>
 </div>
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry_list.html b/erpnext/stock/doctype/stock_entry/stock_entry_list.html
index cff7fe5..21794cf 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry_list.html
+++ b/erpnext/stock/doctype/stock_entry/stock_entry_list.html
@@ -22,7 +22,9 @@
 					{%= doc.from_warehouse %}
 				</span>
 			{% } %}
-			<i class="icon-arrow-right text-muted"></i>
+			{% if(doc.from_warehouse || doc.to_warehouse) { %}
+				<i class="icon-arrow-right text-muted"></i>
+			{% } %}
 			{% if(doc.to_warehouse) { %}
 				<span class="label label-primary filterable"
 					data-filter="to_warehouse,=,{%= doc.to_warehouse %}">
diff --git a/erpnext/templates/form_grid/material_request_grid.html b/erpnext/templates/form_grid/material_request_grid.html
index 6b709d4..c30cf58 100644
--- a/erpnext/templates/form_grid/material_request_grid.html
+++ b/erpnext/templates/form_grid/material_request_grid.html
@@ -1,5 +1,5 @@
 {% var visible_columns = row.get_visible_columns(["item_code", "warehouse",
-	"item_name", "description", "amount", "stock_uom", "uom", "qty"]); %}
+	"item_name", "description", "amount", "stock_uom", "uom", "qty", "schedule_date"]); %}
 
 {% if(!doc) { %}
 	<div class="row">
@@ -16,7 +16,7 @@
 			{% include "templates/form_grid/includes/visible_cols.html" %}
 			{% if(doc.schedule_date) { %}
 			<br><span title="{%= __("Reqd By Date") %}" class="label {%=
-				(frappe.datetime.get_diff(doc.schedule_date) < 0
+				(frappe.datetime.get_diff(doc.schedule_date, frappe.datetime.get_today()) < 0
 					&& doc.ordered_qty < doc.qty)
 					? "label-danger" : "label-default" %}">
 					{%= doc.get_formatted("schedule_date") %}</span>