Merge pull request #23201 from alyf-de/website_theme_scss

fix: style for website theme
diff --git a/erpnext/accounts/report/trial_balance/trial_balance.js b/erpnext/accounts/report/trial_balance/trial_balance.js
index 9c0854c..8645d55 100644
--- a/erpnext/accounts/report/trial_balance/trial_balance.js
+++ b/erpnext/accounts/report/trial_balance/trial_balance.js
@@ -73,6 +73,12 @@
 				"options": "Finance Book",
 			},
 			{
+				"fieldname": "presentation_currency",
+				"label": __("Currency"),
+				"fieldtype": "Select",
+				"options": erpnext.get_presentation_currency_list()
+			},
+			{
 				"fieldname": "with_period_closing_entry",
 				"label": __("Period Closing Entry"),
 				"fieldtype": "Check",
diff --git a/erpnext/accounts/report/trial_balance/trial_balance.py b/erpnext/accounts/report/trial_balance/trial_balance.py
index 3cf0870..33360e2 100644
--- a/erpnext/accounts/report/trial_balance/trial_balance.py
+++ b/erpnext/accounts/report/trial_balance/trial_balance.py
@@ -56,7 +56,7 @@
 	accounts = frappe.db.sql("""select name, account_number, parent_account, account_name, root_type, report_type, lft, rgt
 
 		from `tabAccount` where company=%s order by lft""", filters.company, as_dict=True)
-	company_currency = erpnext.get_company_currency(filters.company)
+	company_currency = filters.presentation_currency or erpnext.get_company_currency(filters.company)
 
 	if not accounts:
 		return None
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 90c466b..bb288c5 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -1242,7 +1242,7 @@
 		try:
 			doc.check_permission(perm_type)
 		except frappe.PermissionError:
-			actions = { 'create': 'add', 'write': 'update', 'cancel': 'remove' }
+			actions = { 'create': 'add', 'write': 'update'}
 
 			frappe.throw(_("You do not have permissions to {} items in a {}.")
 				.format(actions[perm_type], parent_doctype), title=_("Insufficient Permissions"))
@@ -1285,7 +1285,7 @@
 	sales_doctypes = ['Sales Order', 'Sales Invoice', 'Delivery Note', 'Quotation']
 	parent = frappe.get_doc(parent_doctype, parent_doctype_name)
 
-	check_doc_permissions(parent, 'cancel')
+	check_doc_permissions(parent, 'write')
 	validate_and_delete_children(parent, data)
 
 	for d in data:
diff --git a/erpnext/controllers/website_list_for_contact.py b/erpnext/controllers/website_list_for_contact.py
index ecf041e..801c405 100644
--- a/erpnext/controllers/website_list_for_contact.py
+++ b/erpnext/controllers/website_list_for_contact.py
@@ -25,7 +25,7 @@
 
 	if not filters: filters = []
 
-	if doctype in ['Supplier Quotation', 'Purchase Invoice']:
+	if doctype in ['Supplier Quotation', 'Purchase Invoice', 'Quotation']:
 		filters.append((doctype, 'docstatus', '<', 2))
 	else:
 		filters.append((doctype, 'docstatus', '=', 1))
diff --git a/erpnext/crm/doctype/lead/lead.py b/erpnext/crm/doctype/lead/lead.py
index 31db569..99fa703 100644
--- a/erpnext/crm/doctype/lead/lead.py
+++ b/erpnext/crm/doctype/lead/lead.py
@@ -365,3 +365,8 @@
 	lead = leads[0].name if leads else None
 
 	return lead
+
+def daily_open_lead():
+	leads = frappe.get_all("Lead", filters = [["contact_date", "Between", [nowdate(), nowdate()]]])
+	for lead in leads:
+		frappe.db.set_value("Lead", lead.name, "status", "Open")
\ No newline at end of file
diff --git a/erpnext/education/doctype/question/question.json b/erpnext/education/doctype/question/question.json
index b3a161d..e396760 100644
--- a/erpnext/education/doctype/question/question.json
+++ b/erpnext/education/doctype/question/question.json
@@ -13,7 +13,7 @@
  "fields": [
   {
    "fieldname": "question",
-   "fieldtype": "Small Text",
+   "fieldtype": "Text Editor",
    "in_list_view": 1,
    "label": "Question",
    "reqd": 1
@@ -34,7 +34,7 @@
    "read_only": 1
   }
  ],
- "modified": "2019-05-30 18:39:21.880974",
+ "modified": "2020-09-24 18:39:21.880974",
  "modified_by": "Administrator",
  "module": "Education",
  "name": "Question",
@@ -77,4 +77,4 @@
  "quick_entry": 1,
  "sort_field": "modified",
  "sort_order": "DESC"
-}
\ No newline at end of file
+}
diff --git a/erpnext/education/doctype/quiz_question/quiz_question.json b/erpnext/education/doctype/quiz_question/quiz_question.json
index 0564482..aab07a3 100644
--- a/erpnext/education/doctype/quiz_question/quiz_question.json
+++ b/erpnext/education/doctype/quiz_question/quiz_question.json
@@ -20,14 +20,14 @@
   {
    "fetch_from": "question_link.question",
    "fieldname": "question",
-   "fieldtype": "Data",
+   "fieldtype": "Text Editor",
    "in_list_view": 1,
    "label": "Question",
    "read_only": 1
   }
  ],
  "istable": 1,
- "modified": "2019-06-12 12:24:02.312577",
+ "modified": "2020-09-24 12:24:02.312577",
  "modified_by": "Administrator",
  "module": "Education",
  "name": "Quiz Question",
@@ -37,4 +37,4 @@
  "sort_field": "modified",
  "sort_order": "DESC",
  "track_changes": 1
-}
\ No newline at end of file
+}
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 1948e45..abb34b8 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -335,7 +335,8 @@
 		"erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry.process_expired_allocation",
 		"erpnext.hr.utils.generate_leave_encashment",
 		"erpnext.loan_management.doctype.loan_security_shortfall.loan_security_shortfall.create_process_loan_security_shortfall",
-		"erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual.process_loan_interest_accrual_for_term_loans"
+		"erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual.process_loan_interest_accrual_for_term_loans",
+		"erpnext.crm.doctype.lead.lead.daily_open_lead"
 	],
 	"monthly_long": [
 		"erpnext.accounts.deferred_revenue.process_deferred_accounting",
diff --git a/erpnext/non_profit/doctype/membership/membership.py b/erpnext/non_profit/doctype/membership/membership.py
index f058004..4c85cb6 100644
--- a/erpnext/non_profit/doctype/membership/membership.py
+++ b/erpnext/non_profit/doctype/membership/membership.py
@@ -224,7 +224,8 @@
 		member.subscription_activated = 1
 		member.save(ignore_permissions=True)
 	except Exception as e:
-		log = frappe.log_error(e, "Error creating membership entry")
+		message = "{0}\n\n{1}\n\n{2}: {3}".format(e, frappe.get_traceback(), __("Payment ID"), payment.id)
+		log = frappe.log_error(message, _("Error creating membership entry for {0}").format(member.name))
 		notify_failure(log)
 		return { 'status': 'Failed', 'reason': e}
 
@@ -250,4 +251,4 @@
 	try:
 		return plan[0]['name']
 	except:
-		return None
\ No newline at end of file
+		return None
diff --git a/erpnext/public/js/education/lms/quiz.js b/erpnext/public/js/education/lms/quiz.js
index 91cbbf4..4a9d1e3 100644
--- a/erpnext/public/js/education/lms/quiz.js
+++ b/erpnext/public/js/education/lms/quiz.js
@@ -140,7 +140,7 @@
 	make_question() {
 		let question_wrapper = document.createElement('h5');
 		question_wrapper.classList.add('mt-3');
-		question_wrapper.innerText = this.question;
+		question_wrapper.innerHTML = this.question;
 		this.wrapper.appendChild(question_wrapper);
 	}
 
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index 87982f1..9ed5009 100755
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -480,7 +480,7 @@
 				callback: r => {
 					if(!r.exc) {
 						if (this.doc.conversion_factor == r.message.conversion_factor) return;
-						
+
 						const docname = this.doc.docname;
 						dialog.fields_dict.trans_items.df.data.some(doc => {
 							if (doc.docname == docname) {
@@ -677,6 +677,7 @@
 			date_field: opts.date_field || undefined,
 			setters: opts.setters,
 			get_query: opts.get_query,
+			add_filters_group: 1,
 			action: function(selections, args) {
 				let values = selections;
 				if(values.length === 0){
diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py
index a7e8388..0ccc025 100644
--- a/erpnext/shopping_cart/cart.py
+++ b/erpnext/shopping_cart/cart.py
@@ -96,7 +96,9 @@
 def request_for_quotation():
 	quotation = _get_cart_quotation()
 	quotation.flags.ignore_permissions = True
-	quotation.submit()
+	quotation.save()
+	if not get_shopping_cart_settings().save_quotations_as_draft:
+		quotation.submit()
 	return quotation.name
 
 @frappe.whitelist()
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json
index 32004ef..9d61e7d 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json
@@ -27,6 +27,7 @@
   "enable_checkout",
   "payment_success_url",
   "column_break_11",
+  "save_quotations_as_draft",
   "payment_gateway_account"
  ],
  "fields": [
@@ -166,13 +167,20 @@
    "fieldname": "enable_variants",
    "fieldtype": "Check",
    "label": "Enable Variants"
+  },
+  {
+   "default": "0",
+   "depends_on": "eval: doc.enable_checkout == 0",
+   "fieldname": "save_quotations_as_draft",
+   "fieldtype": "Check",
+   "label": "Save Quotations as Draft"
   }
  ],
  "icon": "fa fa-shopping-cart",
  "idx": 1,
  "issingle": 1,
  "links": [],
- "modified": "2020-08-02 18:21:43.873303",
+ "modified": "2020-09-24 16:28:07.192525",
  "modified_by": "Administrator",
  "module": "Shopping Cart",
  "name": "Shopping Cart Settings",
diff --git a/erpnext/templates/generators/item/item_add_to_cart.html b/erpnext/templates/generators/item/item_add_to_cart.html
index 40bc0c7..dbf15de 100644
--- a/erpnext/templates/generators/item/item_add_to_cart.html
+++ b/erpnext/templates/generators/item/item_add_to_cart.html
@@ -10,7 +10,10 @@
 			{{ product_info.price.formatted_price_sales_uom }}
 			<small class="text-muted">({{ product_info.price.formatted_price }} / {{ product_info.uom }})</small>
 		</h4>
+		{% else %}
+			{{ _("Unit of Measurement") }} : {{ product_info.uom }}
 		{% endif %}
+
 		{% if cart_settings.show_stock_availability %}
 		<div>
 			{% if product_info.in_stock == 0 %}
diff --git a/erpnext/templates/includes/transaction_row.html b/erpnext/templates/includes/transaction_row.html
index 80a542f..fd4835e 100644
--- a/erpnext/templates/includes/transaction_row.html
+++ b/erpnext/templates/includes/transaction_row.html
@@ -14,7 +14,11 @@
 			</div>
 		</div>
 		<div class="col-sm-3 text-right bold">
-			{{ doc.get_formatted("grand_total") }}
+			{% if doc.doctype == "Quotation" and not doc.docstatus %}
+				{{ _("Pending") }}
+			{% else %}
+				{{ doc.get_formatted("grand_total") }}
+			{% endif %}
 		</div>
 	</div>
 	<a class="transaction-item-link" href="/{{ pathname }}/{{ doc.name }}">Link</a>
diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html
index 9e3c58b..01b5f6d 100644
--- a/erpnext/templates/pages/order.html
+++ b/erpnext/templates/pages/order.html
@@ -12,22 +12,21 @@
 {% endblock %}
 
 {% block header_actions %}
-<div class="dropdown">
-	<button class="btn btn-outline-secondary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
-		<span>{{ _('Actions') }}</span>
-		<b class="caret"></b>
-	</button>
-	<ul class="dropdown-menu dropdown-menu-right" role="menu">
-		{% if doc.doctype == 'Purchase Order' %}
-		<a class="dropdown-item" href="/api/method/erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_invoice_from_portal?purchase_order_name={{ doc.name }}" data-action="make_purchase_invoice">{{ _("Make Purchase Invoice") }}</a>
-		{% endif %}
-		<a class="dropdown-item" href='/printview?doctype={{ doc.doctype}}&name={{ doc.name }}&format={{ print_format }}'
-			target="_blank" rel="noopener noreferrer">
-			{{ _("Print") }}
-		</a>
-	</ul>
-</div>
-
+	<div class="dropdown">
+		<button class="btn btn-outline-secondary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
+			<span>{{ _('Actions') }}</span>
+			<b class="caret"></b>
+		</button>
+		<ul class="dropdown-menu dropdown-menu-right" role="menu">
+			{% if doc.doctype == 'Purchase Order' %}
+			<a class="dropdown-item" href="/api/method/erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_invoice_from_portal?purchase_order_name={{ doc.name }}" data-action="make_purchase_invoice">{{ _("Make Purchase Invoice") }}</a>
+			{% endif %}
+			<a class="dropdown-item" href='/printview?doctype={{ doc.doctype}}&name={{ doc.name }}&format={{ print_format }}'
+				target="_blank" rel="noopener noreferrer">
+				{{ _("Print") }}
+			</a>
+		</ul>
+	</div>
 {% endblock %}
 
 {% block page_content %}
@@ -35,7 +34,11 @@
 <div class="row transaction-subheading">
 	<div class="col-6">
 		<span class="indicator {{ doc.indicator_color or ("blue" if doc.docstatus==1 else "darkgrey") }}">
-			{{ _(doc.get('indicator_title')) or _(doc.status) or _("Submitted") }}
+			{% if doc.doctype == "Quotation" and not doc.docstatus %}
+				{{ _("Pending") }}
+			{% else %}
+				{{ _(doc.get('indicator_title')) or _(doc.status) or _("Submitted") }}
+			{% endif %}
 		</span>
 	</div>
 	<div class="col-6 text-muted text-right small">
@@ -95,7 +98,6 @@
 		</div>
 		{% endfor %}
 	</div>
-
 	<!-- taxes -->
 	<div class="order-taxes d-flex justify-content-end">
 		<table>