Merge pull request #21110 from nextchamp-saqib/cancel-error-hyperlink

chore: hyperlinks in cannot cancel message
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index f40b957..786b9cf 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -5,7 +5,7 @@
 from erpnext.hooks import regional_overrides
 from frappe.utils import getdate
 
-__version__ = '12.2.0'
+__version__ = '12.0.0-dev'
 
 def get_default_company(user=None):
 	'''Get default company for user'''
diff --git a/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.js b/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.js
index a36f421..3c12f85 100644
--- a/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.js
+++ b/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.js
@@ -48,12 +48,6 @@
 		frm.set_value('label', frm.doc.document_type);
 		frm.set_value('fieldname', frappe.model.scrub(frm.doc.document_type));
 
-		if (frm.is_new()){
-			let row = frappe.model.add_child(frm.doc, "Accounting Dimension Detail", "dimension_defaults");
-			row.reference_document = frm.doc.document_type;
-			frm.refresh_fields("dimension_defaults");
-		}
-
 		frappe.db.get_value('Accounting Dimension', {'document_type': frm.doc.document_type}, 'document_type', (r) => {
 			if (r && r.document_type) {
 				frm.set_df_property('document_type', 'description', "Document type is already set as dimension");
diff --git a/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.json b/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.json
index cf6dc7a..cf55d55 100644
--- a/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.json
+++ b/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.json
@@ -1,4 +1,5 @@
 {
+ "actions": [],
  "autoname": "field:label",
  "creation": "2019-05-04 18:13:37.002352",
  "doctype": "DocType",
@@ -46,7 +47,8 @@
    "options": "Accounting Dimension Detail"
   }
  ],
- "modified": "2019-07-17 16:49:31.134385",
+ "links": [],
+ "modified": "2020-03-22 20:34:39.805728",
  "modified_by": "Administrator",
  "module": "Accounts",
  "name": "Accounting Dimension",
@@ -63,9 +65,20 @@
    "role": "System Manager",
    "share": 1,
    "write": 1
+  },
+  {
+   "create": 1,
+   "delete": 1,
+   "email": 1,
+   "export": 1,
+   "print": 1,
+   "read": 1,
+   "report": 1,
+   "role": "Accounts Manager",
+   "share": 1,
+   "write": 1
   }
  ],
- "quick_entry": 1,
  "sort_field": "modified",
  "sort_order": "ASC",
  "track_changes": 1
diff --git a/erpnext/accounts/doctype/bank/bank.js b/erpnext/accounts/doctype/bank/bank.js
index 463d29c..de9498e 100644
--- a/erpnext/accounts/doctype/bank/bank.js
+++ b/erpnext/accounts/doctype/bank/bank.js
@@ -7,7 +7,20 @@
 	},
 	refresh: function(frm) {
 		add_fields_to_mapping_table(frm);
-	}
+
+		frappe.dynamic_link = { doc: frm.doc, fieldname: 'name', doctype: 'Bank' };
+
+		frm.toggle_display(['address_html','contact_html'], !frm.doc.__islocal);
+
+		if (frm.doc.__islocal) {
+			frm.set_df_property('address_and_contact', 'hidden', 1);
+			frappe.contacts.clear_address_and_contact(frm);
+		}
+		else {
+			frm.set_df_property('address_and_contact', 'hidden', 0);
+			frappe.contacts.render_address_and_contact(frm);
+		}
+	},
 });
 
 
diff --git a/erpnext/accounts/doctype/bank/bank.json b/erpnext/accounts/doctype/bank/bank.json
index 4fa0e4f..99978e6 100644
--- a/erpnext/accounts/doctype/bank/bank.json
+++ b/erpnext/accounts/doctype/bank/bank.json
@@ -1,224 +1,137 @@
 {
- "allow_copy": 0, 
- "allow_events_in_timeline": 0, 
- "allow_guest_to_view": 0, 
- "allow_import": 0, 
- "allow_rename": 0, 
- "autoname": "field:bank_name", 
- "beta": 0, 
- "creation": "2018-04-07 16:59:59.496668", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "", 
- "editable_grid": 1, 
- "engine": "InnoDB", 
+ "actions": [],
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:bank_name",
+ "creation": "2018-04-07 16:59:59.496668",
+ "doctype": "DocType",
+ "document_type": "Setup",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+  "bank_details_section",
+  "bank_name",
+  "swift_number",
+  "column_break_1",
+  "branch_code",
+  "website",
+  "address_and_contact",
+  "address_html",
+  "column_break_13",
+  "contact_html",
+  "data_import_configuration_section",
+  "bank_transaction_mapping",
+  "section_break_4",
+  "plaid_access_token"
+ ],
  "fields": [
   {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "bank_name", 
-   "fieldtype": "Data", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Bank Name", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
+   "fieldname": "bank_name",
+   "fieldtype": "Data",
+   "label": "Bank Name",
+   "reqd": 1,
    "unique": 1
-  }, 
+  },
   {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 1, 
-   "columns": 0, 
-   "fieldname": "data_import_configuration_section", 
-   "fieldtype": "Section Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Data Import Configuration", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
+   "fieldname": "bank_details_section",
+   "fieldtype": "Section Break",
+   "label": "Bank Details"
+  },
   {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "bank_transaction_mapping", 
-   "fieldtype": "Table", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Bank Transaction Mapping", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Bank Transaction Mapping", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
+   "allow_in_quick_entry": 1,
+   "fieldname": "swift_number",
+   "fieldtype": "Data",
+   "in_list_view": 1,
+   "in_standard_filter": 1,
+   "label": "SWIFT number",
+   "unique": 1
+  },
   {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "section_break_4", 
-   "fieldtype": "Section Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
+   "fieldname": "column_break_1",
+   "fieldtype": "Column Break",
+   "search_index": 1
+  },
   {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "plaid_access_token", 
-   "fieldtype": "Data", 
-   "hidden": 1, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Plaid Access Token", 
-   "length": 0, 
-   "no_copy": 1, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
+   "allow_in_quick_entry": 1,
+   "fieldname": "branch_code",
+   "fieldtype": "Data",
+   "in_list_view": 1,
+   "in_standard_filter": 1,
+   "label": "Branch Code",
+   "unique": 1
+  },
+  {
+   "fieldname": "address_and_contact",
+   "fieldtype": "Section Break",
+   "label": "Address and Contact",
+   "options": "fa fa-map-marker"
+  },
+  {
+   "fieldname": "address_html",
+   "fieldtype": "HTML",
+   "label": "Address HTML"
+  },
+  {
+   "fieldname": "website",
+   "fieldtype": "Data",
+   "label": "Website"
+  },
+  {
+   "fieldname": "column_break_13",
+   "fieldtype": "Column Break"
+  },
+  {
+   "fieldname": "contact_html",
+   "fieldtype": "HTML",
+   "label": "Contact HTML"
+  },
+  {
+   "collapsible": 1,
+   "fieldname": "data_import_configuration_section",
+   "fieldtype": "Section Break",
+   "label": "Data Import Configuration"
+  },
+  {
+   "fieldname": "bank_transaction_mapping",
+   "fieldtype": "Table",
+   "label": "Bank Transaction Mapping",
+   "options": "Bank Transaction Mapping"
+  },
+  {
+   "fieldname": "section_break_4",
+   "fieldtype": "Section Break"
+  },
+  {
+   "fieldname": "plaid_access_token",
+   "fieldtype": "Data",
+   "hidden": 1,
+   "label": "Plaid Access Token",
+   "no_copy": 1,
+   "read_only": 1
   }
- ], 
- "has_web_view": 0, 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 0, 
- "image_view": 0, 
- "in_create": 0, 
- "is_submittable": 0, 
- "issingle": 0, 
- "istable": 0, 
- "max_attachments": 0, 
- "modified": "2018-11-27 16:12:13.938776", 
- "modified_by": "Administrator", 
- "module": "Accounts", 
- "name": "Bank", 
- "name_case": "", 
- "owner": "Administrator", 
+ ],
+ "links": [],
+ "modified": "2020-03-25 21:22:33.496264",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Bank",
+ "owner": "Administrator",
  "permissions": [
   {
-   "amend": 0, 
-   "cancel": 0, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "System Manager", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 0, 
+   "create": 1,
+   "delete": 1,
+   "email": 1,
+   "export": 1,
+   "print": 1,
+   "read": 1,
+   "report": 1,
+   "role": "System Manager",
+   "share": 1,
    "write": 1
   }
- ], 
- "quick_entry": 1, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "show_name_in_global_search": 0, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "track_changes": 1, 
- "track_seen": 0, 
- "track_views": 0
+ ],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
 }
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/bank/bank.py b/erpnext/accounts/doctype/bank/bank.py
index b205d56..41aae14 100644
--- a/erpnext/accounts/doctype/bank/bank.py
+++ b/erpnext/accounts/doctype/bank/bank.py
@@ -5,6 +5,12 @@
 from __future__ import unicode_literals
 import frappe
 from frappe.model.document import Document
+from frappe.contacts.address_and_contact import load_address_and_contact, delete_contact_and_address
 
 class Bank(Document):
-	pass
+	def onload(self):
+		"""Load address and contacts in `__onload`"""
+		load_address_and_contact(self)
+
+	def on_trash(self):
+		delete_contact_and_address('Bank', self.name)
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/bank_account/bank_account.json b/erpnext/accounts/doctype/bank_account/bank_account.json
index c8ae26d..aa9c434 100644
--- a/erpnext/accounts/doctype/bank_account/bank_account.json
+++ b/erpnext/accounts/doctype/bank_account/bank_account.json
@@ -24,8 +24,6 @@
   "iban",
   "column_break_12",
   "bank_account_no",
-  "branch_code",
-  "swift_number",
   "address_and_contact",
   "address_html",
   "website",
@@ -146,17 +144,6 @@
    "length": 30
   },
   {
-   "fieldname": "branch_code",
-   "fieldtype": "Data",
-   "in_list_view": 1,
-   "label": "Branch Code"
-  },
-  {
-   "fieldname": "swift_number",
-   "fieldtype": "Data",
-   "label": "SWIFT number"
-  },
-  {
    "fieldname": "address_and_contact",
    "fieldtype": "Section Break",
    "label": "Address and Contact",
@@ -213,7 +200,7 @@
   }
  ],
  "links": [],
- "modified": "2020-01-29 20:42:26.458316",
+ "modified": "2020-01-30 20:42:26.458316",
  "modified_by": "Administrator",
  "module": "Accounts",
  "name": "Bank Account",
diff --git a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js
index 0acbe20..065d25e 100644
--- a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js
+++ b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js
@@ -4,8 +4,8 @@
 cur_frm.add_fetch('bank_account','account','account');
 cur_frm.add_fetch('bank_account','bank_account_no','bank_account_no');
 cur_frm.add_fetch('bank_account','iban','iban');
-cur_frm.add_fetch('bank_account','branch_code','branch_code');
-cur_frm.add_fetch('bank_account','swift_number','swift_number');
+cur_frm.add_fetch('bank','branch_code','branch_code');
+cur_frm.add_fetch('bank','swift_number','swift_number');
 
 frappe.ui.form.on('Bank Guarantee', {
 	setup: function(frm) {
diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.json b/erpnext/accounts/doctype/gl_entry/gl_entry.json
index e64bc9e..2214811 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.json
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.json
@@ -114,13 +114,13 @@
    "fieldname": "debit_in_account_currency",
    "fieldtype": "Currency",
    "label": "Debit Amount in Account Currency",
-   "options": "currency"
+   "options": "account_currency"
   },
   {
    "fieldname": "credit_in_account_currency",
    "fieldtype": "Currency",
    "label": "Credit Amount in Account Currency",
-   "options": "currency"
+   "options": "account_currency"
   },
   {
    "fieldname": "against",
@@ -250,7 +250,7 @@
  "icon": "fa fa-list",
  "idx": 1,
  "in_create": 1,
- "modified": "2020-02-10 04:54:57.777905",
+ "modified": "2020-03-28 16:22:33.766994",
  "modified_by": "Administrator",
  "module": "Accounts",
  "name": "GL Entry",
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js
index 968fb60..d208087 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.js
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js
@@ -33,7 +33,9 @@
 		frm.set_query("party_bank_account", function() {
 			return {
 				filters: {
-					"is_company_account":0
+					"is_company_account":0,
+					party_type: frm.doc.party_type,
+					party: frm.doc.party
 				}
 			}
 		});
diff --git a/erpnext/accounts/doctype/payment_request/payment_request.json b/erpnext/accounts/doctype/payment_request/payment_request.json
index bff995e..c1559a7 100644
--- a/erpnext/accounts/doctype/payment_request/payment_request.json
+++ b/erpnext/accounts/doctype/payment_request/payment_request.json
@@ -839,7 +839,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fetch_from": "bank_account.branch_code", 
+   "fetch_from": "bank.branch_code", 
    "fieldname": "branch_code", 
    "fieldtype": "Read Only", 
    "hidden": 0, 
@@ -873,7 +873,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fetch_from": "bank_account.swift_number", 
+   "fetch_from": "bank.swift_number", 
    "fieldname": "swift_number", 
    "fieldtype": "Read Only", 
    "hidden": 0, 
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
index 791f3f8..bb0d0a1 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
@@ -218,15 +218,15 @@
 						<td></td>
 						<td style="text-align: right"><b>{%= __("Total") %}</b></td>
 						<td style="text-align: right">
-							{%= format_currency(data[i]["invoiced"], data[i]["currency"] ) %}</td>
+							{%= format_currency(data[i]["invoiced"], data[0]["currency"] ) %}</td>
 
 						{% if(!filters.show_future_payments) { %}
 							<td style="text-align: right">
-								{%= format_currency(data[i]["paid"], data[i]["currency"]) %}</td>
-							<td style="text-align: right">{%= format_currency(data[i]["credit_note"], data[i]["currency"]) %} </td>
+								{%= format_currency(data[i]["paid"], data[0]["currency"]) %}</td>
+							<td style="text-align: right">{%= format_currency(data[i]["credit_note"], data[0]["currency"]) %} </td>
 						{% } %}
 						<td style="text-align: right">
-							{%= format_currency(data[i]["outstanding"], data[i]["currency"]) %}</td>
+							{%= format_currency(data[i]["outstanding"], data[0]["currency"]) %}</td>
 
 						{% if(filters.show_future_payments) { %}
 							{% if(report.report_name === "Accounts Receivable") { %}
@@ -234,8 +234,8 @@
 									{%= data[i]["po_no"] %}</td>
 							{% } %}
 							<td style="text-align: right">{%= data[i]["future_ref"] %}</td>
-							<td style="text-align: right">{%= format_currency(data[i]["future_amount"], data[i]["currency"]) %}</td>
-							<td style="text-align: right">{%= format_currency(data[i]["remaining_balance"], data[i]["currency"]) %}</td>
+							<td style="text-align: right">{%= format_currency(data[i]["future_amount"], data[0]["currency"]) %}</td>
+							<td style="text-align: right">{%= format_currency(data[i]["remaining_balance"], data[0]["currency"]) %}</td>
 						{% } %}
 					{% } %}
 				{% } else { %}
@@ -256,10 +256,10 @@
 						{% } else { %}
 							<td><b>{%= __("Total") %}</b></td>
 						{% } %}
-						<td style="text-align: right">{%= format_currency(data[i]["invoiced"], data[i]["currency"]) %}</td>
-						<td style="text-align: right">{%= format_currency(data[i]["paid"], data[i]["currency"]) %}</td>
-						<td style="text-align: right">{%= format_currency(data[i]["credit_note"], data[i]["currency"]) %}</td>
-						<td style="text-align: right">{%= format_currency(data[i]["outstanding"], data[i]["currency"]) %}</td>
+						<td style="text-align: right">{%= format_currency(data[i]["invoiced"], data[0]["currency"]) %}</td>
+						<td style="text-align: right">{%= format_currency(data[i]["paid"], data[0]["currency"]) %}</td>
+						<td style="text-align: right">{%= format_currency(data[i]["credit_note"], data[0]["currency"]) %}</td>
+						<td style="text-align: right">{%= format_currency(data[i]["outstanding"], data[0]["currency"]) %}</td>
 					{% } %}
 				{% } %}
 				</tr>
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py
index 8750c23..898ac13 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.py
+++ b/erpnext/accounts/report/general_ledger/general_ledger.py
@@ -131,7 +131,7 @@
 	gl_entries = frappe.db.sql(
 		"""
 		select
-			posting_date, account, party_type, party,
+			name as gl_entry, posting_date, account, party_type, party,
 			voucher_type, voucher_no, cost_center, project,
 			against_voucher_type, against_voucher, account_currency,
 			remarks, against, is_opening {select_fields}
@@ -363,6 +363,12 @@
 
 	columns = [
 		{
+			"fieldname": "gl_entry",
+			"fieldtype": "Link",
+			"options": "GL Entry",
+			"hidden": 1
+		},
+		{
 			"label": _("Posting Date"),
 			"fieldname": "posting_date",
 			"fieldtype": "Date",
diff --git a/erpnext/buying/doctype/supplier/supplier_dashboard.py b/erpnext/buying/doctype/supplier/supplier_dashboard.py
index b3b294d..d0d5b73 100644
--- a/erpnext/buying/doctype/supplier/supplier_dashboard.py
+++ b/erpnext/buying/doctype/supplier/supplier_dashboard.py
@@ -34,4 +34,4 @@
 				'items': ['Pricing Rule']
 			}
 		]
-	}
+	}
\ No newline at end of file
diff --git a/erpnext/crm/doctype/opportunity/opportunity.json b/erpnext/crm/doctype/opportunity/opportunity.json
index 0e2068a..08be34e 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.json
+++ b/erpnext/crm/doctype/opportunity/opportunity.json
@@ -1,4 +1,5 @@
 {
+ "actions": [],
  "allow_import": 1,
  "allow_rename": 1,
  "autoname": "naming_series:",
@@ -214,7 +215,8 @@
   {
    "fieldname": "opportunity_amount",
    "fieldtype": "Currency",
-   "label": "Opportunity Amount"
+   "label": "Opportunity Amount",
+   "options": "currency"
   },
   {
    "default": "0",
@@ -418,7 +420,8 @@
  ],
  "icon": "fa fa-info-sign",
  "idx": 195,
- "modified": "2019-09-30 12:58:37.385400",
+ "links": [],
+ "modified": "2020-03-20 12:28:45.228994",
  "modified_by": "Administrator",
  "module": "CRM",
  "name": "Opportunity",
diff --git a/erpnext/demo/user/fixed_asset.py b/erpnext/demo/user/fixed_asset.py
index e6d1687..dc094e1 100644
--- a/erpnext/demo/user/fixed_asset.py
+++ b/erpnext/demo/user/fixed_asset.py
@@ -6,46 +6,28 @@
 
 import frappe
 from frappe.utils.make_random import get_random
-from erpnext.assets.doctype.asset.asset import make_purchase_invoice, make_sales_invoice
+from erpnext.assets.doctype.asset.asset import make_sales_invoice
 from erpnext.assets.doctype.asset.depreciation import post_depreciation_entries, scrap_asset
 
+
 def work():
 	frappe.set_user(frappe.db.get_global('demo_accounts_user'))
 
-	asset_list = make_asset_purchase_entry()
-
-	if not asset_list:
-		# fixed_asset.work() already run
-		return
-		
 	# Enable booking asset depreciation entry automatically
 	frappe.db.set_value("Accounts Settings", None, "book_asset_depreciation_entry_automatically", 1)
-		
+
 	# post depreciation entries as on today
 	post_depreciation_entries()
-	
+
 	# scrap a random asset
 	frappe.db.set_value("Company", "Wind Power LLC", "disposal_account", "Gain/Loss on Asset Disposal - WPL")
-	
+
 	asset = get_random_asset()
 	scrap_asset(asset.name)
-	
-	# Sell a random asset
-	sell_an_asset()	
 
-def make_asset_purchase_entry():
-	asset_list = frappe.get_all("Asset", filters={"purchase_invoice": ["in", ("", None)]}, 
-		fields=["name", "item_code", "gross_purchase_amount", "company", "purchase_date"])
-				
-	# make purchase invoice
-	for asset in asset_list:
-		pi = make_purchase_invoice(asset.name, asset.item_code, asset.gross_purchase_amount, 
-			asset.company, asset.purchase_date)
-		pi.supplier = get_random("Supplier")
-		pi.save()
-		pi.submit()
-		
-	return asset_list
+	# Sell a random asset
+	sell_an_asset()
+
 
 def sell_an_asset():
 	asset = get_random_asset()
@@ -55,8 +37,9 @@
 		if asset.value_after_depreciation else asset.gross_purchase_amount * 0.9
 	si.save()
 	si.submit()
-	
+
+
 def get_random_asset():
 	return frappe.db.sql(""" select name, item_code, value_after_depreciation, gross_purchase_amount
-		from `tabAsset` 
+		from `tabAsset`
 		where docstatus=1 and status not in ("Scrapped", "Sold") order by rand() limit 1""", as_dict=1)[0]
diff --git a/erpnext/education/doctype/course/course.json b/erpnext/education/doctype/course/course.json
index 68426c3..da10db1 100644
--- a/erpnext/education/doctype/course/course.json
+++ b/erpnext/education/doctype/course/course.json
@@ -74,7 +74,7 @@
   }
  ],
  "image_field": "hero_image",
- "modified": "2019-06-12 12:34:23.748157",
+ "modified": "2020-03-29 12:50:27.677589",
  "modified_by": "Administrator",
  "module": "Education",
  "name": "Course",
@@ -103,6 +103,30 @@
    "role": "Instructor",
    "share": 1,
    "write": 1
+  },
+  {
+   "create": 1,
+   "delete": 1,
+   "email": 1,
+   "export": 1,
+   "print": 1,
+   "read": 1,
+   "report": 1,
+   "role": "Administrator",
+   "share": 1,
+   "write": 1
+  },
+  {
+   "create": 1,
+   "delete": 1,
+   "email": 1,
+   "export": 1,
+   "print": 1,
+   "read": 1,
+   "report": 1,
+   "role": "Education Manager",
+   "share": 1,
+   "write": 1
   }
  ],
  "restrict_to_domain": "Education",
diff --git a/erpnext/loan_management/doctype/loan/test_loan.py b/erpnext/loan_management/doctype/loan/test_loan.py
index c2e5685..759b0d8 100644
--- a/erpnext/loan_management/doctype/loan/test_loan.py
+++ b/erpnext/loan_management/doctype/loan/test_loan.py
@@ -273,11 +273,11 @@
 
 		penalty_amount = (accrued_interest_amount * 4 * 25) / (100 * days_in_year(get_datetime(first_date).year))
 
-		lia = frappe.get_all("Loan Interest Accrual", fields=["is_paid"],
-			filters={"loan": loan.name}, order_by="posting_date")
+		lia1 = frappe.get_value("Loan Interest Accrual", {"loan": loan.name, "is_paid": 1}, 'name')
+		lia2 = frappe.get_value("Loan Interest Accrual", {"loan": loan.name, "is_paid": 0}, 'name')
 
-		self.assertTrue(lia[0].get('is_paid'))
-		self.assertFalse(lia[1].get('is_paid'))
+		self.assertTrue(lia1)
+		self.assertTrue(lia2)
 
 	def test_security_shortfall(self):
 		pledges = []
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index b0fc7ea..8aec8bd 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -658,4 +658,5 @@
 erpnext.patches.v12_0.set_published_in_hub_tracked_item
 erpnext.patches.v12_0.set_job_offer_applicant_email
 erpnext.patches.v12_0.create_irs_1099_field_united_states
+erpnext.patches.v12_0.move_bank_account_swift_number_to_bank
 erpnext.patches.v12_0.rename_bank_reconciliation_fields # 2020-01-22
diff --git a/erpnext/patches/v12_0/move_bank_account_swift_number_to_bank.py b/erpnext/patches/v12_0/move_bank_account_swift_number_to_bank.py
new file mode 100644
index 0000000..4aad142
--- /dev/null
+++ b/erpnext/patches/v12_0/move_bank_account_swift_number_to_bank.py
@@ -0,0 +1,14 @@
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+	frappe.reload_doc('accounts', 'doctype', 'bank', force=1)
+
+	frappe.db.sql("""
+		UPDATE `tabBank` b, `tabBank Account` ba
+		SET b.swift_number = ba.swift_number, b.branch_code = ba.branch_code
+		WHERE b.name = ba.bank
+	""")
+
+	frappe.reload_doc('accounts', 'doctype', 'bank_account')
+	frappe.reload_doc('accounts', 'doctype', 'payment_request')
\ No newline at end of file
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index fea2d5e..fc4541a 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -4,7 +4,7 @@
 erpnext.TransactionController = erpnext.taxes_and_totals.extend({
 	setup: function() {
 		this._super();
-		frappe.flags.hide_serial_batch_dialog = false;
+		frappe.flags.hide_serial_batch_dialog = true;
 		frappe.ui.form.on(this.frm.doctype + " Item", "rate", function(frm, cdt, cdn) {
 			var item = frappe.get_doc(cdt, cdn);
 			var has_margin_field = frappe.meta.has_field(cdt, 'margin_type');
@@ -165,6 +165,16 @@
 				return (doc.rule_applied) ? "green" : "red";
 			});
 		}
+
+		let batch_no_field = this.frm.get_docfield("items", "batch_no");
+		if (batch_no_field) {
+			batch_no_field.get_route_options_for_new_doc = function(row) {
+				return {
+					"item": row.doc.item_code
+				}
+			};
+		}
+
 	},
 	onload: function() {
 		var me = this;
@@ -520,6 +530,15 @@
 								},
 								() => me.toggle_conversion_factor(item),
 								() => {
+									if (show_batch_dialog)
+										return frappe.db.get_value("Item", item.item_code, ["has_batch_no", "has_serial_no"])
+											.then((r) => {
+												if(r.message.has_batch_no || r.message.has_serial_no) {
+													frappe.flags.hide_serial_batch_dialog = false;
+												}
+											});
+								},
+								() => {
 									if(show_batch_dialog && !frappe.flags.hide_serial_batch_dialog) {
 										var d = locals[cdt][cdn];
 										$.each(r.message, function(k, v) {
@@ -528,7 +547,9 @@
 
 										erpnext.show_serial_batch_selector(me.frm, d, (item) => {
 											me.frm.script_manager.trigger('qty', item.doctype, item.name);
-										});
+											if (!me.frm.doc.set_warehouse)
+												me.frm.script_manager.trigger('warehouse', item.doctype, item.name);
+										}, undefined, !frappe.flags.hide_serial_batch_dialog);
 									}
 								},
 								() => me.conversion_factor(doc, cdt, cdn, true),
diff --git a/erpnext/public/js/utils/dimension_tree_filter.js b/erpnext/public/js/utils/dimension_tree_filter.js
index 8b6de0f..75c5a82 100644
--- a/erpnext/public/js/utils/dimension_tree_filter.js
+++ b/erpnext/public/js/utils/dimension_tree_filter.js
@@ -1,23 +1,25 @@
 frappe.provide('frappe.ui.form');
 
-erpnext.doctypes_with_dimensions = ["GL Entry", "Sales Invoice", "Purchase Invoice", "Payment Entry", "Asset",
+let default_dimensions = {};
+
+let doctypes_with_dimensions = ["GL Entry", "Sales Invoice", "Purchase Invoice", "Payment Entry", "Asset",
 	"Expense Claim", "Stock Entry", "Budget", "Payroll Entry", "Delivery Note", "Shipping Rule", "Loyalty Program",
 	"Fee Schedule", "Fee Structure", "Stock Reconciliation", "Travel Request", "Fees", "POS Profile", "Opening Invoice Creation Tool",
 	"Subscription", "Purchase Order", "Journal Entry", "Material Request", "Purchase Receipt", "Landed Cost Item", "Asset"];
 
-erpnext.child_docs = ["Sales Invoice Item", "Purchase Invoice Item", "Purchase Order Item", "Journal Entry Account",
+let child_docs = ["Sales Invoice Item", "Purchase Invoice Item", "Purchase Order Item", "Journal Entry Account",
 	"Material Request Item", "Delivery Note Item", "Purchase Receipt Item", "Stock Entry Detail", "Payment Entry Deduction",
 	"Landed Cost Item", "Asset Value Adjustment", "Opening Invoice Creation Tool Item", "Subscription Plan"];
 
 frappe.call({
 	method: "erpnext.accounts.doctype.accounting_dimension.accounting_dimension.get_dimension_filters",
-	callback: function(r){
+	callback: function(r) {
 		erpnext.dimension_filters = r.message[0];
-		erpnext.default_dimensions = r.message[1];
+		default_dimensions = r.message[1];
 	}
 });
 
-erpnext.doctypes_with_dimensions.forEach((doctype) => {
+doctypes_with_dimensions.forEach((doctype) => {
 	frappe.ui.form.on(doctype, {
 		onload: function(frm) {
 			erpnext.dimension_filters.forEach((dimension) => {
@@ -27,41 +29,40 @@
 							"is_group": 0
 						});
 					}
-
-					if (Object.keys(erpnext.default_dimensions).length > 0) {
-						if (frappe.meta.has_field(doctype, dimension['fieldname'])) {
-							if (frm.is_new() && frappe.meta.has_field(doctype, 'company') && frm.doc.company) {
-								frm.set_value(dimension['fieldname'], erpnext.default_dimensions[frm.doc.company][dimension['document_type']]);
-							}
-						}
-
-						if (frm.doc.items && frm.doc.items.length && frm.doc.docstatus === 0
-							&& (!frm.doc.items[0][dimension['fieldname']])) {
-							frm.doc.items[0][dimension['fieldname']] = erpnext.default_dimensions[frm.doc.company][dimension['document_type']];
-						}
-
-						if (frm.doc.accounts && frm.doc.accounts.length && frm.doc.docstatus === 0
-							&& (!frm.doc.items[0][dimension['fieldname']])) {
-							frm.doc.accounts[0][dimension['fieldname']] = erpnext.default_dimensions[frm.doc.company][dimension['document_type']];
-						}
-					}
 				});
 			});
 		},
 
 		company: function(frm) {
-			if(frm.doc.company && (Object.keys(erpnext.default_dimensions).length > 0)) {
-				erpnext.dimension_filters.forEach((dimension) => {
-					if (frappe.meta.has_field(doctype, dimension['fieldname'])) {
-						frm.set_value(dimension['fieldname'], erpnext.default_dimensions[frm.doc.company][dimension['document_type']]);
-					}
-				});
+			if(frm.doc.company && (Object.keys(default_dimensions || {}).length > 0)
+				&& default_dimensions[frm.doc.company]) {
+				frm.trigger('update_dimension');
 			}
 		},
+
+		update_dimension: function(frm) {
+			erpnext.dimension_filters.forEach((dimension) => {
+				if (frm.is_new()) {
+					if (frm.doc.company && Object.keys(default_dimensions || {}).length > 0
+						&& default_dimensions[frm.doc.company]) {
+
+						if (frappe.meta.has_field(doctype, dimension['fieldname'])) {
+							frm.set_value(dimension['fieldname'],
+								default_dimensions[frm.doc.company][dimension['document_type']]);
+						}
+
+						$.each(frm.doc.items || frm.doc.accounts || [], function(i, row) {
+							frappe.model.set_value(row.doctype, row.name, dimension['fieldname'],
+								default_dimensions[frm.doc.company][dimension['document_type']])
+						});
+					}
+				}
+			});
+		}
 	});
 });
 
-erpnext.child_docs.forEach((doctype) => {
+child_docs.forEach((doctype) => {
 	frappe.ui.form.on(doctype, {
 		items_add: function(frm, cdt, cdn) {
 			erpnext.dimension_filters.forEach((dimension) => {
@@ -77,14 +78,6 @@
 			});
 		},
 
-		company: function(frm) {
-			if(frm.doc.company) {
-				erpnext.dimension_filters.forEach((dimension) => {
-					frm.set_value(dimension['fieldname'], erpnext.default_dimensions[frm.doc.company][dimension['document_type']]);
-				});
-			}
-		},
-
 		items_add: function(frm, cdt, cdn) {
 			erpnext.dimension_filters.forEach((dimension) => {
 				var row = frappe.get_doc(cdt, cdn);
diff --git a/erpnext/public/js/utils/serial_no_batch_selector.js b/erpnext/public/js/utils/serial_no_batch_selector.js
index a240e49..d75633e 100644
--- a/erpnext/public/js/utils/serial_no_batch_selector.js
+++ b/erpnext/public/js/utils/serial_no_batch_selector.js
@@ -5,14 +5,13 @@
 		this.show_dialog = show_dialog;
 		// frm, item, warehouse_details, has_batch, oldest
 		let d = this.item;
-		if (d && d.has_batch_no && (!d.batch_no || this.show_dialog)) {
-			this.has_batch = 1;
-			this.setup();
+		this.has_batch = 0; this.has_serial_no = 0;
+
+		if (d && d.has_batch_no && (!d.batch_no || this.show_dialog)) this.has_batch = 1;
 		// !(this.show_dialog == false) ensures that show_dialog is implictly true, even when undefined
-		} else if(d && d.has_serial_no && !(this.show_dialog == false)) {
-			this.has_batch = 0;
-			this.setup();
-		}
+		if(d && d.has_serial_no && !(this.show_dialog == false)) this.has_serial_no = 1;
+
+		this.setup();
 	},
 
 	setup: function() {
@@ -36,16 +35,16 @@
 				label: __('Item Code'),
 				default: me.item_code
 			},
-			{fieldtype:'Column Break'},
 			{
 				fieldname: 'warehouse',
 				fieldtype:'Link',
 				options: 'Warehouse',
+				reqd: me.has_batch && !me.has_serial_no ? 0 : 1,
 				label: __(me.warehouse_details.type),
-				default: me.warehouse_details.name,
+				default: typeof me.warehouse_details.name == "string" ? me.warehouse_details.name : '',
 				onchange: function(e) {
 
-					if(me.has_batch) {
+					if(me.has_batch && !me.has_serial_no) {
 						fields = fields.concat(me.get_batch_fields());
 					} else {
 						fields = fields.concat(me.get_serial_no_fields());
@@ -74,15 +73,16 @@
 			{
 				fieldname: 'qty',
 				fieldtype:'Float',
-				read_only: me.has_batch,
-				label: __(me.has_batch ? 'Total Qty' : 'Qty'),
+				read_only: me.has_batch && !me.has_serial_no,
+				label: __(me.has_batch && !me.has_serial_no ? 'Total Qty' : 'Qty'),
 				default: 0
 			},
 			{
 				fieldname: 'auto_fetch_button',
 				fieldtype:'Button',
-				hidden: me.has_batch,
-				label: __('Fetch based on FIFO'),
+				hidden: me.has_batch && !me.has_serial_no,
+				label: __('Auto Fetch'),
+				description: __('Fetch Serial Numbers based on FIFO'),
 				click: () => {
 					let qty = this.dialog.fields_dict.qty.get_value();
 					let numbers = frappe.call({
@@ -90,7 +90,7 @@
 						args: {
 							qty: qty,
 							item_code: me.item_code,
-							warehouse: me.warehouse_details.name,
+							warehouse: typeof me.warehouse_details.name == "string" ? me.warehouse_details.name : '',
 							batch_no: me.item.batch_no || null
 						}
 					});
@@ -109,10 +109,12 @@
 			}
 		];
 
-		if (this.has_batch) {
+		if (this.has_batch && !this.has_serial_no) {
 			title = __("Select Batch Numbers");
 			fields = fields.concat(this.get_batch_fields());
 		} else {
+			// if only serial no OR
+			// if both batch_no & serial_no then only select serial_no and auto set batches nos
 			title = __("Select Serial Numbers");
 			fields = fields.concat(this.get_serial_no_fields());
 		}
@@ -122,25 +124,31 @@
 			fields: fields
 		});
 
-		if (this.item.serial_no) {
-			this.dialog.fields_dict.serial_no.set_value(this.item.serial_no);
-		}
-
 		this.dialog.set_primary_action(__('Insert'), function() {
 			me.values = me.dialog.get_values();
 			if(me.validate()) {
-				me.set_items();
-				me.dialog.hide();
+				frappe.run_serially([
+					() => me.update_batch_items(),
+					() => me.update_serial_no_item(),
+					() => me.update_batch_serial_no_items(),
+					() => {
+						refresh_field("items");
+						if (me.callback) {
+							return me.callback(me.item);
+						}
+					},
+					() => me.dialog.hide()
+				])
 			}
 		});
 
 		if(this.show_dialog) {
 			let d = this.item;
-			if (d.has_serial_no && d.serial_no) {
-				this.dialog.set_value('serial_no', d.serial_no);
+			if (this.item.serial_no) {
+				this.dialog.fields_dict.serial_no.set_value(this.item.serial_no);
 			}
-
-			if (d.has_batch_no && d.batch_no) {
+			
+			if (this.has_batch && !this.has_serial_no && d.batch_no) {
 				this.frm.doc.items.forEach(data => {
 					if(data.item_code == d.item_code) {
 						this.dialog.fields_dict.batches.df.data.push({
@@ -155,7 +163,7 @@
 			}
 		}
 
-		if (this.has_batch) {
+		if (this.has_batch && !this.has_serial_no) {
 			this.update_total_qty();
 		}
 
@@ -174,7 +182,7 @@
 			frappe.throw(__("Please select a warehouse"));
 			return false;
 		}
-		if(this.has_batch) {
+		if(this.has_batch && !this.has_serial_no) {
 			if(values.batches.length === 0 || !values.batches) {
 				frappe.throw(__("Please select batches for batched item "
 					+ values.item_code));
@@ -193,34 +201,23 @@
 		} else {
 			let serial_nos = values.serial_no || '';
 			if (!serial_nos || !serial_nos.replace(/\s/g, '').length) {
-				if (!this.show_dialog) {
-					frappe.throw(__("Please enter serial numbers for serialized item "
-						+ values.item_code));
-					return false;
-				}
+				frappe.throw(__("Please enter serial numbers for serialized item "
+					+ values.item_code));
+				return false;
 			}
 			return true;
 		}
 	},
 
-	set_items: function() {
-		var me = this;
-		if(this.has_batch) {
+	update_batch_items() {
+		// clones an items if muliple batches are selected.
+		if(this.has_batch && !this.has_serial_no) {
 			this.values.batches.map((batch, i) => {
 				let batch_no = batch.batch_no;
 				let row = '';
 
 				if (i !== 0 && !this.batch_exists(batch_no)) {
-					row = this.frm.add_child("items", {
-						'item_code': this.item.item_code,
-						'item_name': this.item.item_name,
-						'price_list_rate': this.item.price_list_rate,
-						'rate': this.item.rate,
-						'qty': batch.selected_qty,
-						'batch_no': batch_no,
-						'actual_qty': this.item.actual_qty,
-						'discount_percentage': this.item.discount_percentage
-					});
+					row = this.frm.add_child("items", { ...this.item });
 				} else {
 					row = this.frm.doc.items.find(i => i.batch_no === batch_no);
 				}
@@ -228,16 +225,59 @@
 				if (!row) {
 					row = this.item;
 				}
-
+				// this ensures that qty & batch no is set
 				this.map_row_values(row, batch, 'batch_no',
 					'selected_qty', this.values.warehouse);
 			});
-		} else {
+		} 
+	},
+
+	update_serial_no_item() {
+		// just updates serial no for the item
+		if(this.has_serial_no && !this.has_batch) {
 			this.map_row_values(this.item, this.values, 'serial_no', 'qty');
 		}
+	},
 
-		refresh_field("items");
-		this.callback && this.callback(this.item);
+	update_batch_serial_no_items() {
+		// if serial no selected is from different batches, adds new rows for each batch.
+		if(this.has_batch && this.has_serial_no) {
+			const selected_serial_nos = this.values.serial_no.split(/\n/g).filter(s => s);
+
+			return frappe.db.get_list("Serial No", {
+				filters: { 'name': ["in", selected_serial_nos]},
+				fields: ["batch_no", "name"]
+			}).then((data) => {
+				// data = [{batch_no: 'batch-1', name: "SR-001"}, 
+				// 	{batch_no: 'batch-2', name: "SR-003"}, {batch_no: 'batch-2', name: "SR-004"}]
+				const batch_serial_map = data.reduce((acc, d) => {
+					if (!acc[d['batch_no']]) acc[d['batch_no']] = [];
+					acc[d['batch_no']].push(d['name'])
+					return acc
+				}, {})
+				// batch_serial_map = { "batch-1": ['SR-001'], "batch-2": ["SR-003", "SR-004"]}
+				Object.keys(batch_serial_map).map((batch_no, i) => {
+					let row = '';
+					const serial_no = batch_serial_map[batch_no];
+					if (i == 0) {
+						row = this.item;
+						this.map_row_values(row, {qty: serial_no.length, batch_no: batch_no}, 'batch_no',
+							'qty', this.values.warehouse);
+					} else if (!this.batch_exists(batch_no)) {
+						row = this.frm.add_child("items", { ...this.item });
+						row.batch_no = batch_no;
+					} else {
+						row = this.frm.doc.items.find(i => i.batch_no === batch_no);
+					}
+					const values = {
+						'qty': serial_no.length,
+						'serial_no': serial_no.join('\n')
+					}
+					this.map_row_values(row, values, 'serial_no',
+						'qty', this.values.warehouse);
+				});
+			})
+		}
 	},
 
 	batch_exists: function(batch) {
@@ -287,7 +327,7 @@
 							return {
 								filters: {
 									item_code: me.item_code,
-									warehouse: me.warehouse || me.warehouse_details.name
+									warehouse: me.warehouse || typeof me.warehouse_details.name == "string" ? me.warehouse_details.name : ''
 								},
 								query: 'erpnext.controllers.queries.get_batch_no'
 							};
@@ -313,11 +353,15 @@
 								frappe.throw(__(`Batch ${val} already selected.`));
 								return;
 							}
+
+							let batch_number = me.item.batch_no ||
+								this.grid_row.on_grid_fields_dict.batch_no.get_value();
+
 							if (me.warehouse_details.name) {
 								frappe.call({
 									method: 'erpnext.stock.doctype.batch.batch.get_batch_qty',
 									args: {
-										batch_no: me.item.batch_no,
+										batch_no: batch_number,
 										warehouse: me.warehouse_details.name,
 										item_code: me.item_code
 									},
@@ -444,7 +488,7 @@
 			{
 				fieldname: 'serial_no',
 				fieldtype: 'Small Text',
-				label: __(me.has_batch ? 'Selected Batch Numbers' : 'Selected Serial Numbers'),
+				label: __(me.has_batch && !me.has_serial_no ? 'Selected Batch Numbers' : 'Selected Serial Numbers'),
 				onchange: function() {
 					me.serial_list = this.get_value()
 						.replace(/\n/g, ' ').match(/\S+/g) || [];
diff --git a/erpnext/regional/report/datev/datev.py b/erpnext/regional/report/datev/datev.py
index 7ceaf50..e9b4235 100644
--- a/erpnext/regional/report/datev/datev.py
+++ b/erpnext/regional/report/datev/datev.py
@@ -109,7 +109,7 @@
 		WHERE gl.company = %(company)s 
 		AND DATE(gl.posting_date) >= %(from_date)s
 		AND DATE(gl.posting_date) <= %(to_date)s
-		ORDER BY 'Belegdatum', gl.voucher_no""", filters, as_dict=as_dict, as_utf8=1)
+		ORDER BY 'Belegdatum', gl.voucher_no""", filters, as_dict=as_dict)
 
 	return gl_entries
 
@@ -160,7 +160,7 @@
 			and ccl.company = par.company
 
 		WHERE par.company = %(company)s
-		AND par.parenttype = 'Customer'""", filters, as_dict=1, as_utf8=1)
+		AND par.parenttype = 'Customer'""", filters, as_dict=1)
 
 
 def get_suppliers(filters):
@@ -217,7 +217,7 @@
 			and con.is_primary_contact = '1'
 
 		WHERE par.company = %(company)s
-		AND par.parenttype = 'Supplier'""", filters, as_dict=1, as_utf8=1)
+		AND par.parenttype = 'Supplier'""", filters, as_dict=1)
 
 
 def get_account_names(filters):
diff --git a/erpnext/regional/report/gstr_1/gstr_1.py b/erpnext/regional/report/gstr_1/gstr_1.py
index 2c5ab7c..fd1cc58 100644
--- a/erpnext/regional/report/gstr_1/gstr_1.py
+++ b/erpnext/regional/report/gstr_1/gstr_1.py
@@ -54,8 +54,8 @@
 		return self.columns, self.data
 
 	def get_data(self):
-		if self.filters.get("type_of_business") ==  "B2C Small":
-			self.get_b2cs_data()
+		if self.filters.get("type_of_business") in  ("B2C Small", "B2C Large"):
+			self.get_b2c_data()
 		else:
 			for inv, items_based_on_rate in self.items_based_on_tax_rate.items():
 				invoice_details = self.invoices.get(inv)
@@ -69,7 +69,7 @@
 					if taxable_value:
 						self.data.append(row)
 
-	def get_b2cs_data(self):
+	def get_b2c_data(self):
 		b2cs_output = {}
 
 		for inv, items_based_on_rate in self.items_based_on_tax_rate.items():
@@ -84,7 +84,10 @@
 					"rate": "",
 					"taxable_value": 0,
 					"cess_amount": 0,
-					"type": ""
+					"type": "",
+					"invoice_number": invoice_details.get("invoice_number"),
+					"posting_date": invoice_details.get("posting_date"),
+					"invoice_value": invoice_details.get("base_grand_total"),
 				})
 
 				row = b2cs_output.get((rate, place_of_supply, ecommerce_gstin))
@@ -164,7 +167,7 @@
 				frappe.throw(_("Please set B2C Limit in GST Settings."))
 
 		if self.filters.get("type_of_business") ==  "B2C Large":
-			conditions += """ and SUBSTR(place_of_supply, 1, 2) != SUBSTR(company_gstin, 1, 2)
+			conditions += """ and ifnull(SUBSTR(place_of_supply, 1, 2),'') != ifnull(SUBSTR(company_gstin, 1, 2),'')
 				and grand_total > {0} and is_return != 1 and gst_category ='Unregistered' """.format(flt(b2c_limit))
 
 		elif self.filters.get("type_of_business") ==  "B2C Small":
@@ -581,6 +584,11 @@
 		if not gst_in: continue
 
 		for number, invoice in iteritems(res[gst_in]):
+			if not invoice[0]["place_of_supply"]:
+				frappe.throw(_("""{0} not entered in Invoice {1}.
+					Please update and try again""").format(frappe.bold("Place Of Supply"),
+					frappe.bold(invoice[0]['invoice_number'])))
+
 			inv_item = get_basic_invoice_detail(invoice[0])
 			inv_item["pos"] = "%02d" % int(invoice[0]["place_of_supply"].split('-')[0])
 			inv_item["rchrg"] = invoice[0]["reverse_charge"]
@@ -606,6 +614,9 @@
 
 	out = []
 	for d in data:
+		if not d.get("place_of_supply"):
+			frappe.throw(_("""{0} not entered in some invoices.
+				Please update and try again""").format(frappe.bold("Place Of Supply")))
 
 		pos = d.get('place_of_supply').split('-')[0]
 		tax_details = {}
@@ -642,6 +653,10 @@
 def get_b2cl_json(res, gstin):
 	out = []
 	for pos in res:
+		if not pos:
+			frappe.throw(_("""{0} not entered in some invoices.
+				Please update and try again""").format(frappe.bold("Place Of Supply")))
+
 		b2cl_item, inv = {"pos": "%02d" % int(pos.split('-')[0]), "inv": []}, []
 
 		for row in res[pos]:
diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py
index 6571ecb..02667e8 100644
--- a/erpnext/selling/doctype/customer/customer.py
+++ b/erpnext/selling/doctype/customer/customer.py
@@ -268,9 +268,11 @@
 	target_doc.run_method("set_other_charges")
 	target_doc.run_method("calculate_taxes_and_totals")
 
-	price_list = frappe.get_value("Customer", source_name, 'default_price_list')
+	price_list, currency = frappe.db.get_value("Customer", {'name': source_name}, ['default_price_list', 'default_currency'])
 	if price_list:
 		target_doc.selling_price_list = price_list
+	if currency:
+		target_doc.currency = currency
 
 	return target_doc
 
diff --git a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py
index 1fc3663..405004e 100644
--- a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py
+++ b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py
@@ -121,8 +121,8 @@
 		},
 		{
 			"label": _("Billed Amount"),
-			"fieldname": "rate",
-			"options": "billed_amount",
+			"fieldtype": "currency",
+			"fieldname": "billed_amount",
 			"width": 120
 		},
 		{
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index 8278745..af10069 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -413,15 +413,20 @@
 	*/
 	set_batch_number: function(cdt, cdn) {
 		const doc = frappe.get_doc(cdt, cdn);
-		if (doc && doc.has_batch_no) {
+		if (doc && doc.has_batch_no && doc.warehouse) {
 			this._set_batch_number(doc);
 		}
 	},
 
 	_set_batch_number: function(doc) {
+		let args = {'item_code': doc.item_code, 'warehouse': doc.warehouse, 'qty': flt(doc.qty) * flt(doc.conversion_factor)};
+		if (doc.has_serial_no && doc.serial_no) {
+			args['serial_no'] = doc.serial_no
+		}
+		
 		return frappe.call({
 			method: 'erpnext.stock.doctype.batch.batch.get_batch_no',
-			args: {'item_code': doc.item_code, 'warehouse': doc.warehouse, 'qty': flt(doc.qty) * flt(doc.conversion_factor)},
+			args: args,
 			callback: function(r) {
 				if(r.message) {
 					frappe.model.set_value(doc.doctype, doc.name, 'batch_no', r.message);
diff --git a/erpnext/setup/doctype/company/company.json b/erpnext/setup/doctype/company/company.json
index 84810b6..020a93f 100644
--- a/erpnext/setup/doctype/company/company.json
+++ b/erpnext/setup/doctype/company/company.json
@@ -157,6 +157,7 @@
   {
    "fieldname": "parent_company",
    "fieldtype": "Link",
+   "ignore_user_permissions": 1,
    "in_list_view": 1,
    "label": "Parent Company",
    "options": "Company"
@@ -277,6 +278,7 @@
    "depends_on": "eval:doc.create_chart_of_accounts_based_on===\"Existing Company\"",
    "fieldname": "existing_company",
    "fieldtype": "Link",
+   "ignore_user_permissions": 1,
    "label": "Existing Company ",
    "no_copy": 1,
    "options": "Company"
@@ -728,7 +730,7 @@
  "image_field": "company_logo",
  "is_tree": 1,
  "links": [],
- "modified": "2020-03-18 18:09:53.534211",
+ "modified": "2020-03-21 18:09:53.534211",
  "modified_by": "Administrator",
  "module": "Setup",
  "name": "Company",
diff --git a/erpnext/stock/doctype/batch/batch.py b/erpnext/stock/doctype/batch/batch.py
index 8ae978e..9b7249e 100644
--- a/erpnext/stock/doctype/batch/batch.py
+++ b/erpnext/stock/doctype/batch/batch.py
@@ -122,8 +122,11 @@
 			self.expiry_date = add_days(self.manufacturing_date, shelf_life_in_days)
 
 		if has_expiry_date and not self.expiry_date:
-			frappe.msgprint(_('Expiry date is mandatory for selected item.'))
-			frappe.throw(_("Set item's shelf life in days, to set expiry based on manufacturing date plus shelf-life."))
+			frappe.throw(msg=_("Please set {0} for Batched Item {1}, which is used to set {2} on Submit.") \
+				.format(frappe.bold("Shelf Life in Days"),
+					frappe.utils.get_link_to_form("Item", self.item),
+					frappe.bold("Batch Expiry Date")),
+				title=_("Expiry Date Mandatory"))
 
 	def get_name_from_naming_series(self):
 		"""
diff --git a/erpnext/stock/doctype/delivery_trip/delivery_trip.py b/erpnext/stock/doctype/delivery_trip/delivery_trip.py
index a34db45..28e9533 100644
--- a/erpnext/stock/doctype/delivery_trip/delivery_trip.py
+++ b/erpnext/stock/doctype/delivery_trip/delivery_trip.py
@@ -238,7 +238,7 @@
 		try:
 			directions = maps_client.directions(**directions_data)
 		except Exception as e:
-			frappe.throw(_(e))
+			frappe.throw(_(str(e)))
 
 		return directions[0] if directions else False
 
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index 3503e7c..aa6b2fe 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -343,7 +343,8 @@
   {
    "fieldname": "shelf_life_in_days",
    "fieldtype": "Int",
-   "label": "Shelf Life In Days"
+   "label": "Shelf Life In Days",
+   "mandatory_depends_on": "eval:doc.has_batch_no && doc.has_expiry_date"
   },
   {
    "default": "2099-12-31",
@@ -1045,7 +1046,7 @@
  "image_field": "image",
  "links": [],
  "max_attachments": 1,
- "modified": "2020-01-02 19:13:59.295963",
+ "modified": "2020-03-24 16:14:36.950677",
  "modified_by": "Administrator",
  "module": "Stock",
  "name": "Item",
diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py
index 64d4c6c..772ac58 100644
--- a/erpnext/stock/doctype/serial_no/serial_no.py
+++ b/erpnext/stock/doctype/serial_no/serial_no.py
@@ -523,12 +523,15 @@
 	return serial_nos
 
 @frappe.whitelist()
-def auto_fetch_serial_number(qty, item_code, warehouse, batch_no=None):
-	serial_numbers = frappe.get_list("Serial No", filters={
+def auto_fetch_serial_number(qty, item_code, warehouse, batch_nos=None):
+	import json
+	filters = {
 		"item_code": item_code,
 		"warehouse": warehouse,
-		"batch_no": batch_no,
 		"delivery_document_no": "",
 		"sales_invoice": ""
-	}, limit=qty, order_by="creation")
+	}
+	if batch_nos: filters["batch_no"] = ["in", json.loads(batch_nos)]
+
+	serial_numbers = frappe.get_list("Serial No", filters=filters, limit=qty, order_by="creation")
 	return [item['name'] for item in serial_numbers]
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index 2840a70..3af3524 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -60,7 +60,8 @@
 					}
 				}
 
-				if(item.s_warehouse) filters["warehouse"] = item.s_warehouse;
+				filters["warehouse"] = item.s_warehouse || item.t_warehouse;
+
 				return {
 					query : "erpnext.controllers.queries.get_batch_no",
 					filters: filters
@@ -964,7 +965,7 @@
 		}
 	}
 
-	if(item && !item.has_serial_no && item.has_batch_no) return;
+	if(item && !item.has_serial_no && !item.has_batch_no) return;
 	if (frm.doc.purpose === 'Material Receipt') return;
 
 	frappe.require("assets/erpnext/js/utils/serial_no_batch_selector.js", function() {
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 8b072c6..8d746ba 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -177,6 +177,10 @@
 		stock_items = self.get_stock_items()
 		serialized_items = self.get_serialized_items()
 		for item in self.get("items"):
+			if item.qty and item.qty < 0:
+				frappe.throw(_("Row {0}: The item {1}, quantity must be positive number")
+					.format(item.idx, frappe.bold(item.item_code)))
+
 			if item.item_code not in stock_items:
 				frappe.throw(_("{0} is not a stock Item").format(item.item_code))
 
diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json
index d86e68b..a848c80 100644
--- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json
+++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json
@@ -1,4 +1,5 @@
 {
+ "actions": [],
  "autoname": "hash",
  "creation": "2013-03-29 18:22:12",
  "doctype": "DocType",
@@ -479,8 +480,7 @@
    "fieldname": "project",
    "fieldtype": "Link",
    "label": "Project",
-   "options": "Project",
-   "read_only": 1
+   "options": "Project"
   },
   {
    "fieldname": "po_detail",
@@ -494,7 +494,8 @@
  ],
  "idx": 1,
  "istable": 1,
- "modified": "2019-08-20 14:01:02.319754",
+ "links": [],
+ "modified": "2020-03-19 12:34:09.836295",
  "modified_by": "Administrator",
  "module": "Stock",
  "name": "Stock Entry Detail",
diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.js b/erpnext/stock/report/stock_ledger/stock_ledger.js
index 3d5cfdc..9adfbf7 100644
--- a/erpnext/stock/report/stock_ledger/stock_ledger.js
+++ b/erpnext/stock/report/stock_ledger/stock_ledger.js
@@ -29,7 +29,13 @@
 			"fieldname":"warehouse",
 			"label": __("Warehouse"),
 			"fieldtype": "Link",
-			"options": "Warehouse"
+			"options": "Warehouse",
+			"get_query": function() {
+				const company = frappe.query_report.get_filter_value('company');
+				return { 
+					filters: { 'company': company }
+				}
+			}
 		},
 		{
 			"fieldname":"item_code",
diff --git a/erpnext/tests/utils.py b/erpnext/tests/utils.py
index dfd3ed7..16ecd51 100644
--- a/erpnext/tests/utils.py
+++ b/erpnext/tests/utils.py
@@ -7,6 +7,8 @@
 
 def create_test_contact_and_address():
 	frappe.db.sql('delete from tabContact')
+	frappe.db.sql('delete from `tabContact Email`')
+	frappe.db.sql('delete from `tabContact Phone`')
 	frappe.db.sql('delete from tabAddress')
 	frappe.db.sql('delete from `tabDynamic Link`')
 
diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py
index 2099810..f88ffd4 100644
--- a/erpnext/utilities/transaction_base.py
+++ b/erpnext/utilities/transaction_base.py
@@ -5,7 +5,7 @@
 import frappe
 import frappe.share
 from frappe import _
-from frappe.utils import cstr, now_datetime, cint, flt, get_time
+from frappe.utils import cstr, now_datetime, cint, flt, get_time, get_link_to_form
 from erpnext.controllers.status_updater import StatusUpdater
 
 from six import string_types
@@ -123,8 +123,11 @@
 					ref_rate = frappe.db.get_value(ref_dt + " Item", d.get(ref_link_field), "rate")
 
 					if abs(flt(d.rate - ref_rate, d.precision("rate"))) >= .01:
-						frappe.throw(_("Row #{0}: Rate must be same as {1}: {2} ({3} / {4}) ")
+						frappe.msgprint(_("Row #{0}: Rate must be same as {1}: {2} ({3} / {4}) ")
 							.format(d.idx, ref_dt, d.get(ref_dn_field), d.rate, ref_rate))
+						frappe.throw(_("To allow different rates, disable the {0} checkbox in {1}.")
+							.format(frappe.bold("Maintain Same Rate Throughout Sales Cycle"), 
+							get_link_to_form("Selling Settings", "Selling Settings", frappe.bold("Selling Settings"))))
 
 	def get_link_filters(self, for_doctype):
 		if hasattr(self, "prev_link_mapper") and self.prev_link_mapper.get(for_doctype):