[grid reports] now show by wn.route_options
diff --git a/accounts/doctype/account/account.js b/accounts/doctype/account/account.js
index 252b708..c12c2d6 100644
--- a/accounts/doctype/account/account.js
+++ b/accounts/doctype/account/account.js
@@ -92,7 +92,12 @@
 			function() { cur_frm.cscript.convert_to_group(); }, 'icon-retweet')
 			
 		cur_frm.add_custom_button('View Ledger', function() {
-			wn.set_route("general-ledger", "account=" + doc.name);
+			wn.route_options = {
+				"account": doc.name,
+				"from_date": sys_defaults.year_start_date,
+				"to_date": sys_defaults.year_end_date
+			};
+			wn.set_route("general-ledger");
 		});
 	}
 }
diff --git a/accounts/doctype/journal_voucher/journal_voucher.js b/accounts/doctype/journal_voucher/journal_voucher.js
index c2fa21a..f00ab1f 100644
--- a/accounts/doctype/journal_voucher/journal_voucher.js
+++ b/accounts/doctype/journal_voucher/journal_voucher.js
@@ -23,7 +23,14 @@
 	erpnext.hide_naming_series();
 	cur_frm.cscript.voucher_type(doc);
 	if(doc.docstatus==1) { 
-		cur_frm.add_custom_button('View Ledger', cur_frm.cscript.view_ledger_entry);
+		cur_frm.add_custom_button('View Ledger', function() {
+			wn.route_options = {
+				"voucher_no": doc.name,
+				"from_date": doc.posting_date,
+				"to_date": doc.posting_date,
+			};
+			wn.set_route("general-ledger");
+		});
 	}
 }
 
@@ -131,11 +138,6 @@
 		cur_frm.pformat.print_heading = "Journal Voucher";
 }
 
-cur_frm.cscript.view_ledger_entry = function(doc,cdt,cdn){
-	wn.set_route('Report', 'GL Entry', 'General Ledger', 'Voucher No='+cur_frm.doc.name);	
-}
-
-
 cur_frm.cscript.voucher_type = function(doc, cdt, cdn) {
 	cur_frm.set_df_property("cheque_no", "reqd", doc.voucher_type=="Bank Voucher");
 	cur_frm.set_df_property("cheque_date", "reqd", doc.voucher_type=="Bank Voucher");
diff --git a/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt b/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt
index 68019cb..9946bfb 100644
--- a/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt
+++ b/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt
@@ -2,7 +2,7 @@
  {
   "creation": "2013-02-22 01:27:39", 
   "docstatus": 0, 
-  "modified": "2013-04-17 14:05:18", 
+  "modified": "2013-07-01 13:53:33", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -74,11 +74,12 @@
  {
   "doctype": "DocField", 
   "fieldname": "balance", 
-  "fieldtype": "Data", 
+  "fieldtype": "Currency", 
   "label": "Account Balance", 
   "no_copy": 1, 
   "oldfieldname": "balance", 
   "oldfieldtype": "Data", 
+  "options": "Company:company:default_currency", 
   "read_only": 1
  }, 
  {
diff --git a/accounts/doctype/purchase_invoice/purchase_invoice.js b/accounts/doctype/purchase_invoice/purchase_invoice.js
index 665fbb7..cf308e3 100644
--- a/accounts/doctype/purchase_invoice/purchase_invoice.js
+++ b/accounts/doctype/purchase_invoice/purchase_invoice.js
@@ -42,7 +42,14 @@
 			this.frm.add_custom_button('Make Payment Entry', this.make_bank_voucher);
 
 		if(doc.docstatus==1) { 
-			this.frm.add_custom_button('View Ledger', this.view_ledger_entry);
+			cur_frm.add_custom_button('View Ledger', function() {
+				wn.route_options = {
+					"voucher_no": doc.name,
+					"from_date": doc.posting_date,
+					"to_date": doc.posting_date,
+				};
+				wn.set_route("general-ledger");
+			});
 		}
 		
 		this.is_opening(doc);
@@ -226,8 +233,4 @@
 	}
 	else
 		cur_frm.pformat.print_heading = "Purchase Invoice";
-}
-
-cur_frm.cscript.view_ledger_entry = function(){
-	wn.set_route('Report', 'GL Entry', 'General Ledger', 'Voucher No='+cur_frm.doc.name);
-}
+}
\ No newline at end of file
diff --git a/accounts/doctype/sales_invoice/sales_invoice.js b/accounts/doctype/sales_invoice/sales_invoice.js
index ab10534..ca4ca92 100644
--- a/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/accounts/doctype/sales_invoice/sales_invoice.js
@@ -45,7 +45,15 @@
 		cur_frm.cscript.is_opening(doc, dt, dn);
 
 		if(doc.docstatus==1) {
-			cur_frm.add_custom_button('View Ledger', cur_frm.cscript.view_ledger_entry);
+			cur_frm.add_custom_button('View Ledger', function() {
+				wn.route_options = {
+					"voucher_no": doc.name,
+					"from_date": doc.posting_date,
+					"to_date": doc.posting_date,
+				};
+				wn.set_route("general-ledger");
+			});
+
 			cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
 
 			if(doc.is_pos==1 && doc.update_stock!=1)
@@ -381,11 +389,6 @@
 }
 
 
-/****************** Get Accounting Entry *****************/
-cur_frm.cscript.view_ledger_entry = function(){	
-	wn.set_route('Report', 'GL Entry', 'General Ledger', 'Voucher No='+cur_frm.doc.name);
-}
-
 cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
 	if(cint(wn.boot.notification_settings.sales_invoice)) {
 		cur_frm.email_doc(wn.boot.notification_settings.sales_invoice_message);
diff --git a/accounts/page/general_ledger/general_ledger.js b/accounts/page/general_ledger/general_ledger.js
index 1f8618f..3985507 100644
--- a/accounts/page/general_ledger/general_ledger.js
+++ b/accounts/page/general_ledger/general_ledger.js
@@ -110,7 +110,7 @@
 		// filter accounts options by company
 		this.filter_inputs.company.change(function() {
 			me.setup_account_filter(this);
-			me.set_route()
+			me.refresh()
 		});
 		
 		this.filter_inputs.account.change(function() {
@@ -220,13 +220,15 @@
 					}
 				}
 				
-				if(date < from_date || item.is_opening=="Yes") {
+				if(!me.voucher_no && (date < from_date || item.is_opening=="Yes")) {
 					opening.debit += item.debit;
 					opening.credit += item.credit;
 
 					grouped_ledgers[item.account].opening.debit += item.debit;
 					grouped_ledgers[item.account].opening.credit += item.credit;
+
 				} else if(date <= to_date) {
+
 					totals.debit += item.debit;
 					totals.credit += item.credit;
 
@@ -242,7 +244,7 @@
 						+ item.voucher_no][(item.debit > 0 ? "credits" : "debits")].join(", ");
 				}
 
-				if(me.apply_filters(item) && item.is_opening=="No") {
+				if(me.apply_filters(item) && (me.voucher_no || item.is_opening=="No")) {
 					out.push(item);
 					grouped_ledgers[item.account].entries.push(item);
 					
diff --git a/stock/doctype/stock_reconciliation/stock_reconciliation.js b/stock/doctype/stock_reconciliation/stock_reconciliation.js
index cf6821e..dd49683 100644
--- a/stock/doctype/stock_reconciliation/stock_reconciliation.js
+++ b/stock/doctype/stock_reconciliation/stock_reconciliation.js
@@ -48,8 +48,6 @@
 				return {
 					"query": "accounts.utils.get_account_list", 
 					"filters": {
-						"is_pl_account": "Yes",
-						"debit_or_credit": "Debit",
 						"company": me.frm.doc.company
 					}
 				}