Merge pull request #4650 from RicardoJohann/patch-2

Accounts - Bank reconciliation - Workflow and labeling improvements
diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py
index 3c280bd..d720081 100644
--- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py
+++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py
@@ -26,7 +26,7 @@
 				t2.parent = t1.name and t2.account = %s
 				and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1
 				and ifnull(t1.is_opening, 'No') = 'No' %s
-				order by t1.posting_date""" %
+				order by t1.posting_date DESC, t1.name DESC""" %
 				('%s', '%s', '%s', condition), (self.bank_account, self.from_date, self.to_date), as_dict=1)
 
 		self.set('journal_entries', [])
diff --git a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json
index 5d74c3f..d770a93 100644
--- a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json
+++ b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json
@@ -16,7 +16,7 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "in_filter": 0, 
-   "in_list_view": 0, 
+   "in_list_view": 1, 
    "label": "Voucher ID", 
    "length": 0, 
    "no_copy": 0, 
@@ -31,7 +31,8 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
-   "unique": 0
+   "unique": 0, 
+   "width": "50"
   }, 
   {
    "allow_on_submit": 0, 
@@ -56,7 +57,8 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
-   "unique": 0
+   "unique": 0, 
+   "width": "15"
   }, 
   {
    "allow_on_submit": 0, 
@@ -67,7 +69,7 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "in_filter": 0, 
-   "in_list_view": 1, 
+   "in_list_view": 0, 
    "label": "Debit", 
    "length": 0, 
    "no_copy": 0, 
@@ -93,7 +95,7 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "in_filter": 0, 
-   "in_list_view": 1, 
+   "in_list_view": 0, 
    "label": "Credit", 
    "length": 0, 
    "no_copy": 0, 
@@ -143,7 +145,7 @@
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "in_filter": 0, 
-   "in_list_view": 0, 
+   "in_list_view": 1, 
    "label": "Posting Date", 
    "length": 0, 
    "no_copy": 0, 
@@ -268,7 +270,7 @@
  "istable": 1, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2015-12-04 11:01:24.286320", 
+ "modified": "2016-01-19 12:06:17.568428", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Bank Reconciliation Detail", 
@@ -277,4 +279,4 @@
  "read_only": 0, 
  "read_only_onload": 0, 
  "version": 0
-}
\ No newline at end of file
+}
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 ee77085..dd1609a 100644
--- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html
+++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html
@@ -1,8 +1,8 @@
-<div style="margin-bottom: 7px;" class="text-center">
+<div style="margin-bottom: 7px;">
 	{%= 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 %}</h4>
+<h4 class="text-center">{%= filters.account && (filters.account + ", "+filters.report_date)  || "" %} {%= filters.company %}</h4>
 <hr>
 <table class="table table-bordered">
 	<thead>
diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py
index 6ff1eea..581a7c8 100644
--- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py
+++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py
@@ -39,18 +39,18 @@
 		+ amounts_not_reflected_in_system
 
 	data += [
-		get_balance_row(_("System Balance"), balance_as_per_system, account_currency),
+		get_balance_row(_("Bank Statement balance as per General Ledger"), balance_as_per_system, account_currency),
 		{},
 		{
-			"journal_entry": '"' + _("Amounts not reflected in bank") + '"',
+			"journal_entry": _("Outstanding Cheques and Deposits to clear"),
 			"debit": total_debit,
 			"credit": total_credit,
 			"account_currency": account_currency
 		},
-		get_balance_row(_("Amounts not reflected in system"), amounts_not_reflected_in_system, 
+		get_balance_row(_("Cheques and Deposits incorrectly cleared"), amounts_not_reflected_in_system, 
 			account_currency),
 		{},
-		get_balance_row(_("Expected balance as per bank"), bank_bal, account_currency)
+		get_balance_row(_("Calculated Bank Statement balance"), bank_bal, account_currency)
 	]
 
 	return columns, data
@@ -129,22 +129,22 @@
 			and jvd.account = %(account)s and jv.posting_date <= %(report_date)s
 			and ifnull(jv.clearance_date, '4000-01-01') > %(report_date)s
 			and ifnull(jv.is_opening, 'No') = 'No'
-		order by jv.name DESC""", filters, as_dict=1)
+		order by jv.posting_date DESC,jv.name DESC""", filters, as_dict=1)
 
 	return entries
 
 def get_balance_row(label, amount, account_currency):
 	if amount > 0:
 		return {
-			"journal_entry": '"' + label + '"',
+			"journal_entry": label,
 			"debit": amount,
 			"credit": 0,
 			"account_currency": account_currency
 		}
 	else:
 		return {
-			"journal_entry": '"' + label + '"',
+			"journal_entry": label,
 			"debit": 0,
 			"credit": abs(amount),
 			"account_currency": account_currency
-		}
\ No newline at end of file
+		}