Merge pull request #1949 from anandpdoshi/anand-july-17

Fix in Stock Entry test case
diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html
index 91e07ab..1a401f5 100644
--- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html
+++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html
@@ -1,3 +1,6 @@
+<div style="margin-bottom: 7px;" class="text-center">
+	{%= frappe.boot.letter_heads[frappe.defaults.get_default("letter_head")] %}
+</div>
 <h2 class="text-center">{%= __("Bank Reconciliation Statement") %}</h2>
 <h4 class="text-center">{%= filters.account %}</h3>
 <hr>
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.html b/erpnext/accounts/report/general_ledger/general_ledger.html
index 63cd1a1..190d455 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.html
+++ b/erpnext/accounts/report/general_ledger/general_ledger.html
@@ -1,5 +1,13 @@
+<div style="margin-bottom: 7px;" class="text-center">
+	{%= frappe.boot.letter_heads[frappe.defaults.get_default("letter_head")] %}
+</div>
 <h2 class="text-center">{%= __("Statement of Account") %}</h2>
-<h4 class="text-center">{%= filters.account || "General Ledger" %}</h3>
+<h4 class="text-center">{%= filters.account || "General Ledger" %}</h4>
+<h5 class="text-center">
+	{%= dateutil.str_to_user(filters.from_date) %}
+	{%= __("to") %}
+	{%= dateutil.str_to_user(filters.to_date) %}
+</h5>
 <hr>
 <table class="table table-bordered">
 	<thead>
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index b7fc5e7..1a903de 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -68,3 +68,4 @@
 erpnext.patches.v4_1.fix_jv_remarks
 erpnext.patches.v4_1.fix_sales_order_delivered_status
 erpnext.patches.v4_1.fix_delivery_and_billing_status
+execute:frappe.db.sql("update `tabAccount` set root_type='Liability' where root_type='Income' and report_type='Balance Sheet'")
\ No newline at end of file
diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py
index d24c7e7..f8e043a 100644
--- a/erpnext/setup/doctype/company/company.py
+++ b/erpnext/setup/doctype/company/company.py
@@ -241,7 +241,7 @@
 					[_('Sales'),_('Direct Income'),'Ledger','Income Account','Profit and Loss', None, 'Income'],
 					[_('Service'),_('Direct Income'),'Ledger','Income Account','Profit and Loss', None, 'Income'],
 				[_('Indirect Income'),_('Income'),'Group','Income Account','Profit and Loss', None, 'Income'],
-			[_('Source of Funds (Liabilities)'), None,'Group', None,'Balance Sheet', None, 'Income'],
+			[_('Source of Funds (Liabilities)'), None,'Group', None,'Balance Sheet', None, 'Liability'],
 				[_('Capital Account'),_('Source of Funds (Liabilities)'),'Group', None,'Balance Sheet', None, 'Liability'],
 					[_('Reserves and Surplus'),_('Capital Account'),'Ledger', None,'Balance Sheet', None, 'Liability'],
 					[_('Shareholders Funds'),_('Capital Account'),'Ledger', None,'Balance Sheet', None, 'Liability'],
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 2609ff5..7629c3c 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -676,9 +676,9 @@
 
 	batch_nos = None
 	args = {
-		'item_code': filters['item_code'],
-		's_warehouse': filters['s_warehouse'],
-		'posting_date': filters['posting_date'],
+		'item_code': filters.get("item_code"),
+		's_warehouse': filters.get('s_warehouse'),
+		'posting_date': filters.get('posting_date'),
 		'txt': "%%%s%%" % txt,
 		'mcond':get_match_cond(doctype),
 		"start": start,