Merge pull request #25102 from prssanna/pos-print-v13

diff --git a/.flake8 b/.flake8
new file mode 100644
index 0000000..399b176
--- /dev/null
+++ b/.flake8
@@ -0,0 +1,32 @@
+[flake8]
+ignore =
+    E121,
+    E126,
+    E127,
+    E128,
+    E203,
+    E225,
+    E226,
+    E231,
+    E241,
+    E251,
+    E261,
+    E265,
+    E302,
+    E303,
+    E305,
+    E402,
+    E501,
+    E741,
+    W291,
+    W292,
+    W293,
+    W391,
+    W503,
+    W504,
+    F403,
+    B007,
+    B950,
+    W191,
+
+max-line-length = 200
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index 720a917..d382386 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -1952,13 +1952,12 @@
  "is_submittable": 1,
  "links": [
   {
-   "custom": 1,
    "group": "Reference",
    "link_doctype": "POS Invoice",
    "link_fieldname": "consolidated_invoice"
   }
  ],
- "modified": "2021-02-01 15:42:26.261540",
+ "modified": "2021-03-31 15:42:26.261540",
  "modified_by": "Administrator",
  "module": "Accounts",
  "name": "Sales Invoice",
diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py
index 11ac703..f352bae 100644
--- a/erpnext/controllers/stock_controller.py
+++ b/erpnext/controllers/stock_controller.py
@@ -495,7 +495,7 @@
 			"voucher_no": self.name,
 			"company": self.company
 		})
-		if check_if_future_sle_exists(args):
+		if future_sle_exists(args):
 			create_repost_item_valuation_entry(args)
 		elif not is_reposting_pending():
 			check_if_stock_and_account_balance_synced(self.posting_date,
@@ -506,37 +506,42 @@
 		{'docstatus': 1, 'status': ['in', ['Queued','In Progress']]})
 
 
-def check_if_future_sle_exists(args):
-	sl_entries = frappe.db.get_all("Stock Ledger Entry",
+def future_sle_exists(args):
+	sl_entries = frappe.get_all("Stock Ledger Entry",
 		filters={"voucher_type": args.voucher_type, "voucher_no": args.voucher_no},
 		fields=["item_code", "warehouse"],
 		order_by="creation asc")
 
-	distinct_item_warehouses = list(set([(d.item_code, d.warehouse) for d in sl_entries]))
+	if not sl_entries:
+		return
 
-	sle_exists = False
-	for item_code, warehouse in distinct_item_warehouses:
-		args.update({
-			"item_code": item_code,
-			"warehouse": warehouse
-		})
-		if get_sle(args):
-			sle_exists = True
-			break
-	return sle_exists
+	warehouse_items_map = {}
+	for entry in sl_entries:
+		if entry.warehouse not in warehouse_items_map:
+			warehouse_items_map[entry.warehouse] = set()
 
-def get_sle(args):
+		warehouse_items_map[entry.warehouse].add(entry.item_code)
+
+	or_conditions = []
+	for warehouse, items in warehouse_items_map.items():
+		or_conditions.append(
+			"warehouse = '{}' and item_code in ({})".format(
+				warehouse,
+				", ".join(frappe.db.escape(item) for item in items)
+			)
+		)
+
 	return frappe.db.sql("""
 		select name
 		from `tabStock Ledger Entry`
 		where
-			item_code=%(item_code)s
-			and warehouse=%(warehouse)s
-			and timestamp(posting_date, posting_time) >= timestamp(%(posting_date)s, %(posting_time)s)
+			({})
+			and timestamp(posting_date, posting_time)
+				>= timestamp(%(posting_date)s, %(posting_time)s)
 			and voucher_no != %(voucher_no)s
 			and is_cancelled = 0
 		limit 1
-	""", args)
+		""".format(" or ".join(or_conditions)), args)
 
 def create_repost_item_valuation_entry(args):
 	args = frappe._dict(args)
@@ -554,4 +559,4 @@
 	repost_entry.allow_zero_rate = args.allow_zero_rate
 	repost_entry.flags.ignore_links = True
 	repost_entry.save()
-	repost_entry.submit()
\ No newline at end of file
+	repost_entry.submit()
diff --git a/erpnext/non_profit/doctype/donation/donation.py b/erpnext/non_profit/doctype/donation/donation.py
index e947588..4fd1a30 100644
--- a/erpnext/non_profit/doctype/donation/donation.py
+++ b/erpnext/non_profit/doctype/donation/donation.py
@@ -42,7 +42,7 @@
 		self.load_from_db()
 		self.create_payment_entry()
 
-	def create_payment_entry(self):
+	def create_payment_entry(self, date=None):
 		settings = frappe.get_doc('Non Profit Settings')
 		if not settings.automate_donation_payment_entries:
 			return
@@ -58,8 +58,9 @@
 		frappe.flags.ignore_account_permission = False
 		pe.paid_from = settings.donation_debit_account
 		pe.paid_to = settings.donation_payment_account
+		pe.posting_date = date or getdate()
 		pe.reference_no = self.name
-		pe.reference_date = getdate()
+		pe.reference_date = date or getdate()
 		pe.flags.ignore_mandatory = True
 		pe.insert()
 		pe.submit()
@@ -91,6 +92,10 @@
 		if not data.event == 'payment.captured':
 			return
 
+		# to avoid capturing subscription payments as donations
+		if payment.description and 'subscription' in str(payment.description).lower():
+			return
+
 		donor = get_donor(payment.email)
 		if not donor:
 			donor = create_donor(payment)
@@ -119,7 +124,7 @@
 		'donor_name': donor.donor_name,
 		'email': donor.email,
 		'date': getdate(),
-		'amount': flt(payment.amount),
+		'amount': flt(payment.amount) / 100, # Convert to rupees from paise
 		'mode_of_payment': payment.method,
 		'razorpay_payment_id': payment.id
 	}).insert(ignore_mandatory=True)
diff --git a/erpnext/non_profit/doctype/membership/membership.py b/erpnext/non_profit/doctype/membership/membership.py
index 191281f..52447e4 100644
--- a/erpnext/non_profit/doctype/membership/membership.py
+++ b/erpnext/non_profit/doctype/membership/membership.py
@@ -48,7 +48,7 @@
 		last_membership = erpnext.get_last_membership(self.member)
 
 		# if person applied for offline membership
-		if last_membership and not frappe.session.user == "Administrator":
+		if last_membership and last_membership.name != self.name and not frappe.session.user == "Administrator":
 			# if last membership does not expire in 30 days, then do not allow to renew
 			if getdate(add_days(last_membership.to_date, -30)) > getdate(nowdate()) :
 				frappe.throw(_("You can only renew if your membership expires within 30 days"))
@@ -90,6 +90,7 @@
 		self.validate_membership_type_and_settings(plan, settings)
 
 		invoice = make_invoice(self, member, plan, settings)
+		self.reload()
 		self.invoice = invoice.name
 
 		if with_payment_entry:
@@ -284,10 +285,11 @@
 
 		settings = frappe.get_doc("Non Profit Settings")
 		if settings.allow_invoicing and settings.automate_membership_invoicing:
+			membership.reload()
 			membership.generate_invoice(with_payment_entry=settings.automate_membership_payment_entries, save=True)
 
 	except Exception as e:
-		message = "{0}\n\n{1}\n\n{2}: {3}".format(e, frappe.get_traceback(), __("Payment ID"), payment.id)
+		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}
diff --git a/erpnext/non_profit/doctype/non_profit_settings/non_profit_settings.js b/erpnext/non_profit/doctype/non_profit_settings/non_profit_settings.js
index cff92b4..4c4ca98 100644
--- a/erpnext/non_profit/doctype/non_profit_settings/non_profit_settings.js
+++ b/erpnext/non_profit/doctype/non_profit_settings/non_profit_settings.js
@@ -19,7 +19,7 @@
 			};
 		});
 
-		frm.set_query("debit_account", function() {
+		frm.set_query("membership_debit_account", function() {
 			return {
 				filters: {
 					"account_type": "Receivable",
@@ -29,6 +29,16 @@
 			};
 		});
 
+		frm.set_query("donation_debit_account", function() {
+			return {
+				filters: {
+					"account_type": "Receivable",
+					"is_group": 0,
+					"company": frm.doc.donation_company
+				}
+			};
+		});
+
 		frm.set_query("membership_payment_account", function () {
 			var account_types = ["Bank", "Cash"];
 			return {
@@ -40,6 +50,17 @@
 			};
 		});
 
+		frm.set_query("donation_payment_account", function () {
+			var account_types = ["Bank", "Cash"];
+			return {
+				filters: {
+					"account_type": ["in", account_types],
+					"is_group": 0,
+					"company": frm.doc.donation_company
+				}
+			};
+		});
+
 		let docs_url = "https://docs.erpnext.com/docs/user/manual/en/non_profit/membership";
 
 		frm.set_intro(__("You can learn more about memberships in the manual. ") + `<a href='${docs_url}'>${__('ERPNext Docs')}</a>`, true);
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index c686635..ff9433a 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -720,7 +720,7 @@
 erpnext.patches.v12_0.update_item_tax_template_company
 erpnext.patches.v13_0.move_branch_code_to_bank_account
 erpnext.patches.v13_0.healthcare_lab_module_rename_doctypes
-erpnext.patches.v13_0.add_standard_navbar_items #4
+erpnext.patches.v13_0.add_standard_navbar_items #2021-03-24
 erpnext.patches.v13_0.stock_entry_enhancements
 erpnext.patches.v12_0.update_state_code_for_daman_and_diu
 erpnext.patches.v12_0.rename_lost_reason_detail
diff --git a/erpnext/payroll/doctype/salary_slip/salary_slip.js b/erpnext/payroll/doctype/salary_slip/salary_slip.js
index 7460c75..d527839 100644
--- a/erpnext/payroll/doctype/salary_slip/salary_slip.js
+++ b/erpnext/payroll/doctype/salary_slip/salary_slip.js
@@ -74,43 +74,46 @@
 		if (!frm.doc.letter_head && company.default_letter_head) {
 			frm.set_value('letter_head', company.default_letter_head);
 		}
+	},
+
+	currency: function(frm) {
 		frm.trigger("set_dynamic_labels");
 	},
 
 	set_dynamic_labels: function(frm) {
 		var company_currency = frm.doc.company? erpnext.get_currency(frm.doc.company): frappe.defaults.get_default("currency");
-		frappe.run_serially([
-			() => 	frm.events.set_exchange_rate(frm, company_currency),
-			() => 	frm.events.change_form_labels(frm, company_currency),
-			() => 	frm.events.change_grid_labels(frm),
-			() => 	frm.refresh_fields()
-		]);
+		if (frm.doc.employee && frm.doc.currency) {
+			frappe.run_serially([
+				() => 	frm.events.set_exchange_rate(frm, company_currency),
+				() => 	frm.events.change_form_labels(frm, company_currency),
+				() => 	frm.events.change_grid_labels(frm),
+				() => 	frm.refresh_fields()
+			]);
+		}
 	},
 
 	set_exchange_rate: function(frm, company_currency) {
-		if (frm.doc.docstatus === 0) {
-			if (frm.doc.currency) {
-				var from_currency = frm.doc.currency;
-				if (from_currency != company_currency) {
-					frm.events.hide_loan_section(frm);
-					frappe.call({
-						method: "erpnext.setup.utils.get_exchange_rate",
-						args: {
-							from_currency: from_currency,
-							to_currency: company_currency,
-						},
-						callback: function(r) {
-							frm.set_value("exchange_rate", flt(r.message));
-							frm.set_df_property('exchange_rate', 'hidden', 0);
-							frm.set_df_property("exchange_rate", "description", "1 " + frm.doc.currency
-								+ " = [?] " + company_currency);
-						}
-					});
-				} else {
-					frm.set_value("exchange_rate", 1.0);
-					frm.set_df_property('exchange_rate', 'hidden', 1);
-					frm.set_df_property("exchange_rate", "description", "" );
-				}
+		if (frm.doc.currency) {
+			var from_currency = frm.doc.currency;
+			if (from_currency != company_currency) {
+				frm.events.hide_loan_section(frm);
+				frappe.call({
+					method: "erpnext.setup.utils.get_exchange_rate",
+					args: {
+						from_currency: from_currency,
+						to_currency: company_currency,
+					},
+					callback: function(r) {
+						frm.set_value("exchange_rate", flt(r.message));
+						frm.set_df_property("exchange_rate", "hidden", 0);
+						frm.set_df_property("exchange_rate", "description", "1 " + frm.doc.currency
+							+ " = [?] " + company_currency);
+					}
+				});
+			} else {
+				frm.set_value("exchange_rate", 1.0);
+				frm.set_df_property("exchange_rate", "hidden", 1);
+				frm.set_df_property("exchange_rate", "description", "");
 			}
 		}
 	},
diff --git a/erpnext/public/js/help_links.js b/erpnext/public/js/help_links.js
index 472c537..e789923 100644
--- a/erpnext/public/js/help_links.js
+++ b/erpnext/public/js/help_links.js
@@ -1,466 +1,1051 @@
-frappe.provide('frappe.help.help_links');
+frappe.provide("frappe.help.help_links");
 
-const docsUrl = 'https://erpnext.com/docs/';
+const docsUrl = "https://erpnext.com/docs/";
 
-frappe.help.help_links['rename tool'] = [
-	{ label: 'Bulk Rename', url: docsUrl + 'user/manual/en/setting-up/data/bulk-rename' },
-]
+frappe.help.help_links["Form/Rename Tool"] = [
+	{
+		label: "Bulk Rename",
+		url: docsUrl + "user/manual/en/setting-up/data/bulk-rename",
+	},
+];
 
 //Setup
 
-frappe.help.help_links['user'] = [
-	{ label: 'New User', url: docsUrl + 'user/manual/en/setting-up/users-and-permissions/adding-users' },
-	{ label: 'Rename User', url: docsUrl + 'user/manual/en/setting-up/articles/rename-user' },
-]
+frappe.help.help_links["List/User"] = [
+	{
+		label: "New User",
+		url:
+			docsUrl +
+			"user/manual/en/setting-up/users-and-permissions/adding-users",
+	},
+	{
+		label: "Rename User",
+		url: docsUrl + "user/manual/en/setting-up/articles/rename-user",
+	},
+];
 
-frappe.help.help_links['permission-manager'] = [
-	{ label: 'Role Permissions Manager', url: docsUrl + 'user/manual/en/setting-up/users-and-permissions/role-based-permissions' },
-	{ label: 'Managing Perm Level in Permissions Manager', url: docsUrl + 'user/manual/en/setting-up/articles/managing-perm-level' },
-	{ label: 'User Permissions', url: docsUrl + 'user/manual/en/setting-up/users-and-permissions/user-permissions' },
-	{ label: 'Sharing', url: docsUrl + 'user/manual/en/setting-up/users-and-permissions/sharing' },
-	{ label: 'Password', url: docsUrl + 'user/manual/en/setting-up/articles/change-password' },
-]
+frappe.help.help_links["permission-manager"] = [
+	{
+		label: "Role Permissions Manager",
+		url:
+			docsUrl +
+			"user/manual/en/setting-up/users-and-permissions/role-based-permissions",
+	},
+	{
+		label: "Managing Perm Level in Permissions Manager",
+		url: docsUrl + "user/manual/en/setting-up/articles/managing-perm-level",
+	},
+	{
+		label: "User Permissions",
+		url:
+			docsUrl +
+			"user/manual/en/setting-up/users-and-permissions/user-permissions",
+	},
+	{
+		label: "Sharing",
+		url:
+			docsUrl + "user/manual/en/setting-up/users-and-permissions/sharing",
+	},
+	{
+		label: "Password",
+		url: docsUrl + "user/manual/en/setting-up/articles/change-password",
+	},
+];
 
-frappe.help.help_links['system-settings'] = [
-	{ label: 'Naming Series', url: docsUrl + 'user/manual/en/setting-up/settings/system-settings' },
-]
+frappe.help.help_links["Form/System Settings"] = [
+	{
+		label: "Naming Series",
+		url: docsUrl + "user/manual/en/setting-up/settings/system-settings",
+	},
+];
 
-frappe.help.help_links['data-import-tool'] = [
-	{ label: 'Importing and Exporting Data', url: docsUrl + 'user/manual/en/setting-up/data/data-import-tool' },
-	{ label: 'Overwriting Data from Data Import Tool', url: docsUrl + 'user/manual/en/setting-up/articles/overwriting-data-from-data-import-tool' },
-]
+frappe.help.help_links["data-import-tool"] = [
+	{
+		label: "Importing and Exporting Data",
+		url: docsUrl + "user/manual/en/setting-up/data/data-import-tool",
+	},
+	{
+		label: "Overwriting Data from Data Import Tool",
+		url:
+			docsUrl +
+			"user/manual/en/setting-up/articles/overwriting-data-from-data-import-tool",
+	},
+];
 
-frappe.help.help_links['naming-series'] = [
-	{ label: 'Naming Series', url: docsUrl + 'user/manual/en/setting-up/settings/naming-series' },
-	{ label: 'Setting the Current Value for Naming Series', url: docsUrl + 'user/manual/en/setting-up/articles/naming-series-current-value' },
-]
+frappe.help.help_links["module_setup"] = [
+	{
+		label: "Role Permissions Manager",
+		url:
+			docsUrl +
+			"user/manual/en/setting-up/users-and-permissions/role-based-permissions",
+	},
+];
 
-frappe.help.help_links['global-defaults'] = [
-	{ label: 'Global Settings', url: docsUrl + 'user/manual/en/setting-up/settings/global-defaults' },
-]
+frappe.help.help_links["Form/Naming Series"] = [
+	{
+		label: "Naming Series",
+		url: docsUrl + "user/manual/en/setting-up/settings/naming-series",
+	},
+	{
+		label: "Setting the Current Value for Naming Series",
+		url:
+			docsUrl +
+			"user/manual/en/setting-up/articles/naming-series-current-value",
+	},
+];
 
-frappe.help.help_links['email-digest'] = [
-	{ label: 'Email Digest', url: docsUrl + 'user/manual/en/setting-up/email/email-digest' },
-]
+frappe.help.help_links["Form/Global Defaults"] = [
+	{
+		label: "Global Settings",
+		url: docsUrl + "user/manual/en/setting-up/settings/global-defaults",
+	},
+];
 
-frappe.help.help_links['print-heading'] = [
-	{ label: 'Print Heading', url: docsUrl + 'user/manual/en/setting-up/print/print-headings' },
-]
+frappe.help.help_links["Form/Email Digest"] = [
+	{
+		label: "Email Digest",
+		url: docsUrl + "user/manual/en/setting-up/email/email-digest",
+	},
+];
 
-frappe.help.help_links['letter-head'] = [
-	{ label: 'Letter Head', url: docsUrl + 'user/manual/en/setting-up/print/letter-head' },
-]
+frappe.help.help_links["List/Print Heading"] = [
+	{
+		label: "Print Heading",
+		url: docsUrl + "user/manual/en/setting-up/print/print-headings",
+	},
+];
 
-frappe.help.help_links['address-template'] = [
-	{ label: 'Address Template', url: docsUrl + 'user/manual/en/setting-up/print/address-template' },
-]
+frappe.help.help_links["List/Letter Head"] = [
+	{
+		label: "Letter Head",
+		url: docsUrl + "user/manual/en/setting-up/print/letter-head",
+	},
+];
 
-frappe.help.help_links['terms-and-conditions'] = [
-	{ label: 'Terms and Conditions', url: docsUrl + 'user/manual/en/setting-up/print/terms-and-conditions' },
-]
+frappe.help.help_links["List/Address Template"] = [
+	{
+		label: "Address Template",
+		url: docsUrl + "user/manual/en/setting-up/print/address-template",
+	},
+];
 
-frappe.help.help_links['cheque-print-template'] = [
-	{ label: 'Cheque Print Template', url: docsUrl + 'user/manual/en/setting-up/print/cheque-print-template' },
-]
+frappe.help.help_links["List/Terms and Conditions"] = [
+	{
+		label: "Terms and Conditions",
+		url: docsUrl + "user/manual/en/setting-up/print/terms-and-conditions",
+	},
+];
 
-frappe.help.help_links['email-account'] = [
-	{ label: 'Email Account', url: docsUrl + 'user/manual/en/setting-up/email/email-account' },
-]
+frappe.help.help_links["List/Cheque Print Template"] = [
+	{
+		label: "Cheque Print Template",
+		url: docsUrl + "user/manual/en/setting-up/print/cheque-print-template",
+	},
+];
 
-frappe.help.help_links['notification'] = [
-	{ label: 'Notification', url: docsUrl + 'user/manual/en/setting-up/email/notifications' },
-]
+frappe.help.help_links["List/Email Account"] = [
+	{
+		label: "Email Account",
+		url: docsUrl + "user/manual/en/setting-up/email/email-account",
+	},
+];
 
-frappe.help.help_links['notification'] = [
-	{ label: 'Notification', url: docsUrl + 'user/manual/en/setting-up/email/notifications' },
-]
+frappe.help.help_links["List/Notification"] = [
+	{
+		label: "Notification",
+		url: docsUrl + "user/manual/en/setting-up/email/notifications",
+	},
+];
 
-frappe.help.help_links['email-digest'] = [
-	{ label: 'Email Digest', url: docsUrl + 'user/manual/en/setting-up/email/email-digest' },
-]
+frappe.help.help_links["Form/Notification"] = [
+	{
+		label: "Notification",
+		url: docsUrl + "user/manual/en/setting-up/email/notifications",
+	},
+];
 
-frappe.help.help_links['auto-email-report'] = [
-	{ label: 'Auto Email Reports', url: docsUrl + 'user/manual/en/setting-up/email/email-reports' },
-]
+frappe.help.help_links["List/Email Digest"] = [
+	{
+		label: "Email Digest",
+		url: docsUrl + "user/manual/en/setting-up/email/email-digest",
+	},
+];
 
-frappe.help.help_links['print-settings'] = [
-	{ label: 'Print Settings', url: docsUrl + 'user/manual/en/setting-up/print/print-settings' },
-]
+frappe.help.help_links["List/Auto Email Report"] = [
+	{
+		label: "Auto Email Reports",
+		url: docsUrl + "user/manual/en/setting-up/email/email-reports",
+	},
+];
 
-frappe.help.help_links['print-format-builder'] = [
-	{ label: 'Print Format Builder', url: docsUrl + 'user/manual/en/setting-up/print/print-settings' },
-]
+frappe.help.help_links["Form/Print Settings"] = [
+	{
+		label: "Print Settings",
+		url: docsUrl + "user/manual/en/setting-up/print/print-settings",
+	},
+];
 
-frappe.help.help_links['print-heading'] = [
-	{ label: 'Print Heading', url: docsUrl + 'user/manual/en/setting-up/print/print-headings' },
-]
+frappe.help.help_links["print-format-builder"] = [
+	{
+		label: "Print Format Builder",
+		url: docsUrl + "user/manual/en/setting-up/print/print-settings",
+	},
+];
+
+frappe.help.help_links["List/Print Heading"] = [
+	{
+		label: "Print Heading",
+		url: docsUrl + "user/manual/en/setting-up/print/print-headings",
+	},
+];
 
 //setup-integrations
 
-frappe.help.help_links['paypal-settings'] = [
-	{ label: 'PayPal Settings', url: docsUrl + 'user/manual/en/setting-up/integrations/paypal-integration' },
-]
+frappe.help.help_links["Form/PayPal Settings"] = [
+	{
+		label: "PayPal Settings",
+		url:
+			docsUrl +
+			"user/manual/en/setting-up/integrations/paypal-integration",
+	},
+];
 
-frappe.help.help_links['razorpay-settings'] = [
-	{ label: 'Razorpay Settings', url: docsUrl + 'user/manual/en/setting-up/integrations/razorpay-integration' },
-]
+frappe.help.help_links["Form/Razorpay Settings"] = [
+	{
+		label: "Razorpay Settings",
+		url:
+			docsUrl +
+			"user/manual/en/setting-up/integrations/razorpay-integration",
+	},
+];
 
-frappe.help.help_links['dropbox-settings'] = [
-	{ label: 'Dropbox Settings', url: docsUrl + 'user/manual/en/setting-up/integrations/dropbox-backup' },
-]
+frappe.help.help_links["Form/Dropbox Settings"] = [
+	{
+		label: "Dropbox Settings",
+		url: docsUrl + "user/manual/en/setting-up/integrations/dropbox-backup",
+	},
+];
 
-frappe.help.help_links['ldap-settings'] = [
-	{ label: 'LDAP Settings', url: docsUrl + 'user/manual/en/setting-up/integrations/ldap-integration' },
-]
+frappe.help.help_links["Form/LDAP Settings"] = [
+	{
+		label: "LDAP Settings",
+		url:
+			docsUrl + "user/manual/en/setting-up/integrations/ldap-integration",
+	},
+];
 
-frappe.help.help_links['stripe-settings'] = [
-	{ label: 'Stripe Settings', url: docsUrl + 'user/manual/en/setting-up/integrations/stripe-integration' },
-]
+frappe.help.help_links["Form/Stripe Settings"] = [
+	{
+		label: "Stripe Settings",
+		url:
+			docsUrl +
+			"user/manual/en/setting-up/integrations/stripe-integration",
+	},
+];
 
 //Sales
 
-frappe.help.help_links['quotation'] = [
-	{ label: 'Quotation', url: docsUrl + 'user/manual/en/selling/quotation' },
-	{ label: 'Applying Discount', url: docsUrl + 'user/manual/en/selling/articles/applying-discount' },
-	{ label: 'Sales Person', url: docsUrl + 'user/manual/en/selling/articles/sales-persons-in-the-sales-transactions' },
-	{ label: 'Applying Margin', url: docsUrl + 'user/manual/en/selling/articles/adding-margin' },
-]
+frappe.help.help_links["Form/Quotation"] = [
+	{ label: "Quotation", url: docsUrl + "user/manual/en/selling/quotation" },
+	{
+		label: "Applying Discount",
+		url: docsUrl + "user/manual/en/selling/articles/applying-discount",
+	},
+	{
+		label: "Sales Person",
+		url:
+			docsUrl +
+			"user/manual/en/selling/articles/sales-persons-in-the-sales-transactions",
+	},
+	{
+		label: "Applying Margin",
+		url: docsUrl + "user/manual/en/selling/articles/adding-margin",
+	},
+];
 
-frappe.help.help_links['customer'] = [
-	{ label: 'Customer', url: docsUrl + 'user/manual/en/CRM/customer' },
-	{ label: 'Credit Limit', url: docsUrl + 'user/manual/en/accounts/credit-limit' },
-]
+frappe.help.help_links["List/Customer"] = [
+	{ label: "Customer", url: docsUrl + "user/manual/en/CRM/customer" },
+	{
+		label: "Credit Limit",
+		url: docsUrl + "user/manual/en/accounts/credit-limit",
+	},
+];
 
-frappe.help.help_links['customer'] = [
-	{ label: 'Customer', url: docsUrl + 'user/manual/en/CRM/customer' },
-	{ label: 'Credit Limit', url: docsUrl + 'user/manual/en/accounts/credit-limit' },
-]
+frappe.help.help_links["Form/Customer"] = [
+	{ label: "Customer", url: docsUrl + "user/manual/en/CRM/customer" },
+	{
+		label: "Credit Limit",
+		url: docsUrl + "user/manual/en/accounts/credit-limit",
+	},
+];
 
-frappe.help.help_links['sales-taxes-and-charges-template'] = [
-	{ label: 'Setting Up Taxes', url: docsUrl + 'user/manual/en/setting-up/setting-up-taxes' },
-]
+frappe.help.help_links["List/Sales Taxes and Charges Template"] = [
+	{
+		label: "Setting Up Taxes",
+		url: docsUrl + "user/manual/en/setting-up/setting-up-taxes",
+	},
+];
 
-frappe.help.help_links['sales-taxes-and-charges-template'] = [
-	{ label: 'Setting Up Taxes', url: docsUrl + 'user/manual/en/setting-up/setting-up-taxes' },
-]
+frappe.help.help_links["Form/Sales Taxes and Charges Template"] = [
+	{
+		label: "Setting Up Taxes",
+		url: docsUrl + "user/manual/en/setting-up/setting-up-taxes",
+	},
+];
 
-frappe.help.help_links['sales-order'] = [
-	{ label: 'Sales Order', url: docsUrl + 'user/manual/en/selling/sales-order' },
-	{ label: 'Recurring Sales Order', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' },
-	{ label: 'Applying Discount', url: docsUrl + 'user/manual/en/selling/articles/applying-discount' },
-	{ label: 'Drop Shipping', url: docsUrl + 'user/manual/en/selling/articles/drop-shipping' },
-	{ label: 'Sales Person', url: docsUrl + 'user/manual/en/selling/articles/sales-persons-in-the-sales-transactions' },
-	{ label: 'Close Sales Order', url: docsUrl + 'user/manual/en/selling/articles/close-sales-order' },
-	{ label: 'Applying Margin', url: docsUrl + 'user/manual/en/selling/articles/adding-margin' },
-]
+frappe.help.help_links["List/Sales Order"] = [
+	{
+		label: "Sales Order",
+		url: docsUrl + "user/manual/en/selling/sales-order",
+	},
+	{
+		label: "Recurring Sales Order",
+		url: docsUrl + "user/manual/en/accounts/recurring-orders-and-invoices",
+	},
+	{
+		label: "Applying Discount",
+		url: docsUrl + "user/manual/en/selling/articles/applying-discount",
+	},
+];
 
-frappe.help.help_links['product-bundle'] = [
-	{ label: 'Product Bundle', url: docsUrl + 'user/manual/en/selling/setup/product-bundle' },
-]
+frappe.help.help_links["Form/Sales Order"] = [
+	{
+		label: "Sales Order",
+		url: docsUrl + "user/manual/en/selling/sales-order",
+	},
+	{
+		label: "Recurring Sales Order",
+		url: docsUrl + "user/manual/en/accounts/recurring-orders-and-invoices",
+	},
+	{
+		label: "Applying Discount",
+		url: docsUrl + "user/manual/en/selling/articles/applying-discount",
+	},
+	{
+		label: "Drop Shipping",
+		url: docsUrl + "user/manual/en/selling/articles/drop-shipping",
+	},
+	{
+		label: "Sales Person",
+		url:
+			docsUrl +
+			"user/manual/en/selling/articles/sales-persons-in-the-sales-transactions",
+	},
+	{
+		label: "Close Sales Order",
+		url: docsUrl + "user/manual/en/selling/articles/close-sales-order",
+	},
+	{
+		label: "Applying Margin",
+		url: docsUrl + "user/manual/en/selling/articles/adding-margin",
+	},
+];
 
-frappe.help.help_links['selling-settings'] = [
-	{ label: 'Selling Settings', url: docsUrl + 'user/manual/en/selling/setup/selling-settings' },
-]
+frappe.help.help_links["Form/Product Bundle"] = [
+	{
+		label: "Product Bundle",
+		url: docsUrl + "user/manual/en/selling/setup/product-bundle",
+	},
+];
+
+frappe.help.help_links["Form/Selling Settings"] = [
+	{
+		label: "Selling Settings",
+		url: docsUrl + "user/manual/en/selling/setup/selling-settings",
+	},
+];
 
 //Buying
 
-frappe.help.help_links['supplier'] = [
-	{ label: 'Supplier', url: docsUrl + 'user/manual/en/buying/supplier' },
-]
+frappe.help.help_links["List/Supplier"] = [
+	{ label: "Supplier", url: docsUrl + "user/manual/en/buying/supplier" },
+];
 
-frappe.help.help_links['request-for-quotation'] = [
-	{ label: 'Request for Quotation', url: docsUrl + 'user/manual/en/buying/request-for-quotation' },
-	{ label: 'RFQ Video', url: docsUrl + 'user/videos/learn/request-for-quotation.html' },
-]
+frappe.help.help_links["Form/Supplier"] = [
+	{ label: "Supplier", url: docsUrl + "user/manual/en/buying/supplier" },
+];
 
-frappe.help.help_links['supplier-quotation'] = [
-	{ label: 'Supplier Quotation', url: docsUrl + 'user/manual/en/buying/supplier-quotation' },
-]
+frappe.help.help_links["Form/Request for Quotation"] = [
+	{
+		label: "Request for Quotation",
+		url: docsUrl + "user/manual/en/buying/request-for-quotation",
+	},
+	{
+		label: "RFQ Video",
+		url: docsUrl + "user/videos/learn/request-for-quotation.html",
+	},
+];
 
-frappe.help.help_links['buying-settings'] = [
-	{ label: 'Buying Settings', url: docsUrl + 'user/manual/en/buying/setup/buying-settings' },
-]
+frappe.help.help_links["Form/Supplier Quotation"] = [
+	{
+		label: "Supplier Quotation",
+		url: docsUrl + "user/manual/en/buying/supplier-quotation",
+	},
+];
 
-frappe.help.help_links['purchase-order'] = [
-	{ label: 'Purchase Order', url: docsUrl + 'user/manual/en/buying/purchase-order' },
-	{ label: 'Item UoM', url: docsUrl + 'user/manual/en/buying/articles/purchasing-in-different-unit' },
-	{ label: 'Supplier Item Code', url: docsUrl + 'user/manual/en/buying/articles/maintaining-suppliers-part-no-in-item' },
-	{ label: 'Recurring Purchase Order', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' },
-	{ label: 'Subcontracting', url: docsUrl + 'user/manual/en/manufacturing/subcontracting' },
-]
+frappe.help.help_links["Form/Buying Settings"] = [
+	{
+		label: "Buying Settings",
+		url: docsUrl + "user/manual/en/buying/setup/buying-settings",
+	},
+];
 
-frappe.help.help_links['purchase-taxes-and-charges-template'] = [
-	{ label: 'Setting Up Taxes', url: docsUrl + 'user/manual/en/setting-up/setting-up-taxes' },
-]
+frappe.help.help_links["List/Purchase Order"] = [
+	{
+		label: "Purchase Order",
+		url: docsUrl + "user/manual/en/buying/purchase-order",
+	},
+	{
+		label: "Recurring Purchase Order",
+		url: docsUrl + "user/manual/en/accounts/recurring-orders-and-invoices",
+	},
+];
 
-frappe.help.help_links['pos-profile'] = [
-	{ label: 'POS Profile', url: docsUrl + 'user/manual/en/setting-up/pos-setting' },
-]
+frappe.help.help_links["Form/Purchase Order"] = [
+	{
+		label: "Purchase Order",
+		url: docsUrl + "user/manual/en/buying/purchase-order",
+	},
+	{
+		label: "Item UoM",
+		url:
+			docsUrl +
+			"user/manual/en/buying/articles/purchasing-in-different-unit",
+	},
+	{
+		label: "Supplier Item Code",
+		url:
+			docsUrl +
+			"user/manual/en/buying/articles/maintaining-suppliers-part-no-in-item",
+	},
+	{
+		label: "Recurring Purchase Order",
+		url: docsUrl + "user/manual/en/accounts/recurring-orders-and-invoices",
+	},
+	{
+		label: "Subcontracting",
+		url: docsUrl + "user/manual/en/manufacturing/subcontracting",
+	},
+];
 
-frappe.help.help_links['price-list'] = [
-	{ label: 'Price List', url: docsUrl + 'user/manual/en/setting-up/price-lists' },
-]
+frappe.help.help_links["List/Purchase Taxes and Charges Template"] = [
+	{
+		label: "Setting Up Taxes",
+		url: docsUrl + "user/manual/en/setting-up/setting-up-taxes",
+	},
+];
 
-frappe.help.help_links['authorization-rule'] = [
-	{ label: 'Authorization Rule', url: docsUrl + 'user/manual/en/setting-up/authorization-rule' },
-]
+frappe.help.help_links["List/POS Profile"] = [
+	{
+		label: "POS Profile",
+		url: docsUrl + "user/manual/en/setting-up/pos-setting",
+	},
+];
 
-frappe.help.help_links['sms-settings'] = [
-	{ label: 'SMS Settings', url: docsUrl + 'user/manual/en/setting-up/sms-setting' },
-]
+frappe.help.help_links["List/Price List"] = [
+	{
+		label: "Price List",
+		url: docsUrl + "user/manual/en/setting-up/price-lists",
+	},
+];
 
-frappe.help.help_links['stock-reconciliation'] = [
-	{ label: 'Stock Reconciliation', url: docsUrl + 'user/manual/en/setting-up/stock-reconciliation-for-non-serialized-item' },
-]
+frappe.help.help_links["List/Authorization Rule"] = [
+	{
+		label: "Authorization Rule",
+		url: docsUrl + "user/manual/en/setting-up/authorization-rule",
+	},
+];
 
-frappe.help.help_links['territory/view/tree'] = [
-	{ label: 'Territory', url: docsUrl + 'user/manual/en/setting-up/territory' },
-]
+frappe.help.help_links["Form/SMS Settings"] = [
+	{
+		label: "SMS Settings",
+		url: docsUrl + "user/manual/en/setting-up/sms-setting",
+	},
+];
 
-frappe.help.help_links['dropbox-backup'] = [
-	{ label: 'Dropbox Backup', url: docsUrl + 'user/manual/en/setting-up/third-party-backups' },
-	{ label: 'Setting Up Dropbox Backup', url: docsUrl + 'user/manual/en/setting-up/articles/setting-up-dropbox-backups' },
-]
+frappe.help.help_links["List/Stock Reconciliation"] = [
+	{
+		label: "Stock Reconciliation",
+		url:
+			docsUrl +
+			"user/manual/en/setting-up/stock-reconciliation-for-non-serialized-item",
+	},
+];
 
-frappe.help.help_links['workflow'] = [
-	{ label: 'Workflow', url: docsUrl + 'user/manual/en/setting-up/workflows' },
-]
+frappe.help.help_links["Tree/Territory"] = [
+	{
+		label: "Territory",
+		url: docsUrl + "user/manual/en/setting-up/territory",
+	},
+];
 
-frappe.help.help_links['company'] = [
-	{ label: 'Company', url: docsUrl + 'user/manual/en/setting-up/company-setup' },
-	{ label: 'Managing Multiple Companies', url: docsUrl + 'user/manual/en/setting-up/articles/managing-multiple-companies' },
-	{ label: 'Delete All Related Transactions for a Company', url: docsUrl + 'user/manual/en/setting-up/articles/delete-a-company-and-all-related-transactions' },
-]
+frappe.help.help_links["Form/Dropbox Backup"] = [
+	{
+		label: "Dropbox Backup",
+		url: docsUrl + "user/manual/en/setting-up/third-party-backups",
+	},
+	{
+		label: "Setting Up Dropbox Backup",
+		url:
+			docsUrl +
+			"user/manual/en/setting-up/articles/setting-up-dropbox-backups",
+	},
+];
+
+frappe.help.help_links["List/Workflow"] = [
+	{ label: "Workflow", url: docsUrl + "user/manual/en/setting-up/workflows" },
+];
+
+frappe.help.help_links["List/Company"] = [
+	{
+		label: "Company",
+		url: docsUrl + "user/manual/en/setting-up/company-setup",
+	},
+	{
+		label: "Managing Multiple Companies",
+		url:
+			docsUrl +
+			"user/manual/en/setting-up/articles/managing-multiple-companies",
+	},
+	{
+		label: "Delete All Related Transactions for a Company",
+		url:
+			docsUrl +
+			"user/manual/en/setting-up/articles/delete-a-company-and-all-related-transactions",
+	},
+];
 
 //Accounts
 
-frappe.help.help_links['accounts'] = [
-	{ label: 'Introduction to Accounts', url: docsUrl + 'user/manual/en/accounts/' },
-	{ label: 'Chart of Accounts', url: docsUrl + 'user/manual/en/accounts/chart-of-accounts.html' },
-	{ label: 'Multi Currency Accounting', url: docsUrl + 'user/manual/en/accounts/multi-currency-accounting' },
-]
+frappe.help.help_links["modules/Accounts"] = [
+	{
+		label: "Introduction to Accounts",
+		url: docsUrl + "user/manual/en/accounts/",
+	},
+	{
+		label: "Chart of Accounts",
+		url: docsUrl + "user/manual/en/accounts/chart-of-accounts.html",
+	},
+	{
+		label: "Multi Currency Accounting",
+		url: docsUrl + "user/manual/en/accounts/multi-currency-accounting",
+	},
+];
 
-frappe.help.help_links['account/view/tree'] = [
-	{ label: 'Chart of Accounts', url: docsUrl + 'user/manual/en/accounts/chart-of-accounts' },
-	{ label: 'Managing Tree Mastes', url: docsUrl + 'user/manual/en/setting-up/articles/managing-tree-structure-masters' },
-]
+frappe.help.help_links["Tree/Account"] = [
+	{
+		label: "Chart of Accounts",
+		url: docsUrl + "user/manual/en/accounts/chart-of-accounts",
+	},
+	{
+		label: "Managing Tree Mastes",
+		url:
+			docsUrl +
+			"user/manual/en/setting-up/articles/managing-tree-structure-masters",
+	},
+];
 
-frappe.help.help_links['sales-invoice'] = [
-	{ label: 'Sales Invoice', url: docsUrl + 'user/manual/en/accounts/sales-invoice' },
-	{ label: 'Accounts Opening Balance', url: docsUrl + 'user/manual/en/accounts/opening-accounts' },
-	{ label: 'Sales Return', url: docsUrl + 'user/manual/en/stock/sales-return' },
-	{ label: 'Recurring Sales Invoice', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' },
-]
+frappe.help.help_links["Form/Sales Invoice"] = [
+	{
+		label: "Sales Invoice",
+		url: docsUrl + "user/manual/en/accounts/sales-invoice",
+	},
+	{
+		label: "Accounts Opening Balance",
+		url: docsUrl + "user/manual/en/accounts/opening-accounts",
+	},
+	{
+		label: "Sales Return",
+		url: docsUrl + "user/manual/en/stock/sales-return",
+	},
+	{
+		label: "Recurring Sales Invoice",
+		url: docsUrl + "user/manual/en/accounts/recurring-orders-and-invoices",
+	},
+];
 
-frappe.help.help_links['sales-invoice'] = [
-	{ label: 'Sales Invoice', url: docsUrl + 'user/manual/en/accounts/sales-invoice' },
-	{ label: 'Accounts Opening Balance', url: docsUrl + 'user/manual/en/accounts/opening-accounts' },
-	{ label: 'Sales Return', url: docsUrl + 'user/manual/en/stock/sales-return' },
-	{ label: 'Recurring Sales Invoice', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' },
-]
+frappe.help.help_links["List/Sales Invoice"] = [
+	{
+		label: "Sales Invoice",
+		url: docsUrl + "user/manual/en/accounts/sales-invoice",
+	},
+	{
+		label: "Accounts Opening Balance",
+		url: docsUrl + "user/manual/en/accounts/opening-accounts",
+	},
+	{
+		label: "Sales Return",
+		url: docsUrl + "user/manual/en/stock/sales-return",
+	},
+	{
+		label: "Recurring Sales Invoice",
+		url: docsUrl + "user/manual/en/accounts/recurring-orders-and-invoices",
+	},
+];
 
-frappe.help.help_links['pos'] = [
-	{ label: 'Point of Sale Invoice', url: docsUrl + 'user/manual/en/accounts/point-of-sale-pos-invoice' },
-]
+frappe.help.help_links["pos"] = [
+	{
+		label: "Point of Sale Invoice",
+		url: docsUrl + "user/manual/en/accounts/point-of-sale-pos-invoice",
+	},
+];
 
-frappe.help.help_links['pos-profile'] = [
-	{ label: 'Point of Sale Profile', url: docsUrl + 'user/manual/en/setting-up/pos-setting' },
-]
+frappe.help.help_links["List/POS Profile"] = [
+	{
+		label: "Point of Sale Profile",
+		url: docsUrl + "user/manual/en/setting-up/pos-setting",
+	},
+];
 
-frappe.help.help_links['purchase-invoice'] = [
-	{ label: 'Purchase Invoice', url: docsUrl + 'user/manual/en/accounts/purchase-invoice' },
-	{ label: 'Accounts Opening Balance', url: docsUrl + 'user/manual/en/accounts/opening-accounts' },
-	{ label: 'Recurring Purchase Invoice', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' },
-]
+frappe.help.help_links["List/Purchase Invoice"] = [
+	{
+		label: "Purchase Invoice",
+		url: docsUrl + "user/manual/en/accounts/purchase-invoice",
+	},
+	{
+		label: "Accounts Opening Balance",
+		url: docsUrl + "user/manual/en/accounts/opening-accounts",
+	},
+	{
+		label: "Recurring Purchase Invoice",
+		url: docsUrl + "user/manual/en/accounts/recurring-orders-and-invoices",
+	},
+];
 
-frappe.help.help_links['journal-entry'] = [
-	{ label: 'Journal Entry', url: docsUrl + 'user/manual/en/accounts/journal-entry' },
-	{ label: 'Advance Payment Entry', url: docsUrl + 'user/manual/en/accounts/advance-payment-entry' },
-	{ label: 'Accounts Opening Balance', url: docsUrl + 'user/manual/en/accounts/opening-accounts' },
-]
+frappe.help.help_links["List/Journal Entry"] = [
+	{
+		label: "Journal Entry",
+		url: docsUrl + "user/manual/en/accounts/journal-entry",
+	},
+	{
+		label: "Advance Payment Entry",
+		url: docsUrl + "user/manual/en/accounts/advance-payment-entry",
+	},
+	{
+		label: "Accounts Opening Balance",
+		url: docsUrl + "user/manual/en/accounts/opening-accounts",
+	},
+];
 
-frappe.help.help_links['payment-entry'] = [
-	{ label: 'Payment Entry', url: docsUrl + 'user/manual/en/accounts/payment-entry' },
-]
+frappe.help.help_links["List/Payment Entry"] = [
+	{
+		label: "Payment Entry",
+		url: docsUrl + "user/manual/en/accounts/payment-entry",
+	},
+];
 
-frappe.help.help_links['payment-request'] = [
-	{ label: 'Payment Request', url: docsUrl + 'user/manual/en/accounts/payment-request' },
-]
+frappe.help.help_links["List/Payment Request"] = [
+	{
+		label: "Payment Request",
+		url: docsUrl + "user/manual/en/accounts/payment-request",
+	},
+];
 
-frappe.help.help_links['asset'] = [
-	{ label: 'Managing Fixed Assets', url: docsUrl + 'user/manual/en/accounts/managing-fixed-assets' },
-]
+frappe.help.help_links["List/Asset"] = [
+	{
+		label: "Managing Fixed Assets",
+		url: docsUrl + "user/manual/en/accounts/managing-fixed-assets",
+	},
+];
 
-frappe.help.help_links['asset-category'] = [
-	{ label: 'Asset Category', url: docsUrl + 'user/manual/en/accounts/managing-fixed-assets' },
-]
+frappe.help.help_links["List/Asset Category"] = [
+	{
+		label: "Asset Category",
+		url: docsUrl + "user/manual/en/accounts/managing-fixed-assets",
+	},
+];
 
-frappe.help.help_links['cost-center/view/tree'] = [
-	{ label: 'Budgeting', url: docsUrl + 'user/manual/en/accounts/budgeting' },
-]
+frappe.help.help_links["Tree/Cost Center"] = [
+	{ label: "Budgeting", url: docsUrl + "user/manual/en/accounts/budgeting" },
+];
 
-frappe.help.help_links['item'] = [
-	{ label: 'Item', url: docsUrl + 'user/manual/en/stock/item' },
-	{ label: 'Item Price', url: docsUrl + 'user/manual/en/stock/item/item-price' },
-	{ label: 'Barcode', url: docsUrl + 'user/manual/en/stock/articles/track-items-using-barcode' },
-	{ label: 'Item Wise Taxation', url: docsUrl + 'user/manual/en/accounts/item-wise-taxation' },
-	{ label: 'Managing Fixed Assets', url: docsUrl + 'user/manual/en/accounts/managing-fixed-assets' },
-	{ label: 'Item Codification', url: docsUrl + 'user/manual/en/stock/item/item-codification' },
-	{ label: 'Item Variants', url: docsUrl + 'user/manual/en/stock/item/item-variants' },
-	{ label: 'Item Valuation', url: docsUrl + 'user/manual/en/stock/item/item-valuation-fifo-and-moving-average' },
-]
+frappe.help.help_links["List/Item"] = [
+	{ label: "Item", url: docsUrl + "user/manual/en/stock/item" },
+	{
+		label: "Item Price",
+		url: docsUrl + "user/manual/en/stock/item/item-price",
+	},
+	{
+		label: "Barcode",
+		url:
+			docsUrl + "user/manual/en/stock/articles/track-items-using-barcode",
+	},
+	{
+		label: "Item Wise Taxation",
+		url: docsUrl + "user/manual/en/accounts/item-wise-taxation",
+	},
+	{
+		label: "Managing Fixed Assets",
+		url: docsUrl + "user/manual/en/accounts/managing-fixed-assets",
+	},
+	{
+		label: "Item Codification",
+		url: docsUrl + "user/manual/en/stock/item/item-codification",
+	},
+	{
+		label: "Item Variants",
+		url: docsUrl + "user/manual/en/stock/item/item-variants",
+	},
+	{
+		label: "Item Valuation",
+		url:
+			docsUrl +
+			"user/manual/en/stock/item/item-valuation-fifo-and-moving-average",
+	},
+];
 
-frappe.help.help_links['purchase-receipt'] = [
-	{ label: 'Purchase Receipt', url: docsUrl + 'user/manual/en/stock/purchase-receipt' },
-	{ label: 'Barcode', url: docsUrl + 'user/manual/en/stock/articles/track-items-using-barcode' },
-]
+frappe.help.help_links["Form/Item"] = [
+	{ label: "Item", url: docsUrl + "user/manual/en/stock/item" },
+	{
+		label: "Item Price",
+		url: docsUrl + "user/manual/en/stock/item/item-price",
+	},
+	{
+		label: "Barcode",
+		url:
+			docsUrl + "user/manual/en/stock/articles/track-items-using-barcode",
+	},
+	{
+		label: "Item Wise Taxation",
+		url: docsUrl + "user/manual/en/accounts/item-wise-taxation",
+	},
+	{
+		label: "Managing Fixed Assets",
+		url: docsUrl + "user/manual/en/accounts/managing-fixed-assets",
+	},
+	{
+		label: "Item Codification",
+		url: docsUrl + "user/manual/en/stock/item/item-codification",
+	},
+	{
+		label: "Item Variants",
+		url: docsUrl + "user/manual/en/stock/item/item-variants",
+	},
+	{
+		label: "Item Valuation",
+		url:
+			docsUrl +
+			"user/manual/en/stock/item/item-valuation-fifo-and-moving-average",
+	},
+];
 
-frappe.help.help_links['delivery-note'] = [
-	{ label: 'Delivery Note', url: docsUrl + 'user/manual/en/stock/delivery-note' },
-	{ label: 'Barcode', url: docsUrl + 'user/manual/en/stock/articles/track-items-using-barcode' },
-	{ label: 'Sales Return', url: docsUrl + 'user/manual/en/stock/sales-return' },
-]
+frappe.help.help_links["List/Purchase Receipt"] = [
+	{
+		label: "Purchase Receipt",
+		url: docsUrl + "user/manual/en/stock/purchase-receipt",
+	},
+	{
+		label: "Barcode",
+		url:
+			docsUrl + "user/manual/en/stock/articles/track-items-using-barcode",
+	},
+];
 
-frappe.help.help_links['delivery-note'] = [
-	{ label: 'Delivery Note', url: docsUrl + 'user/manual/en/stock/delivery-note' },
-	{ label: 'Sales Return', url: docsUrl + 'user/manual/en/stock/sales-return' },
-	{ label: 'Barcode', url: docsUrl + 'user/manual/en/stock/articles/track-items-using-barcode' },
-	{ label: 'Subcontracting', url: docsUrl + 'user/manual/en/manufacturing/subcontracting' },
-]
+frappe.help.help_links["List/Delivery Note"] = [
+	{
+		label: "Delivery Note",
+		url: docsUrl + "user/manual/en/stock/delivery-note",
+	},
+	{
+		label: "Barcode",
+		url:
+			docsUrl + "user/manual/en/stock/articles/track-items-using-barcode",
+	},
+	{
+		label: "Sales Return",
+		url: docsUrl + "user/manual/en/stock/sales-return",
+	},
+];
 
-frappe.help.help_links['installation-note'] = [
-	{ label: 'Installation Note', url: docsUrl + 'user/manual/en/stock/installation-note' },
-]
+frappe.help.help_links["Form/Delivery Note"] = [
+	{
+		label: "Delivery Note",
+		url: docsUrl + "user/manual/en/stock/delivery-note",
+	},
+	{
+		label: "Sales Return",
+		url: docsUrl + "user/manual/en/stock/sales-return",
+	},
+	{
+		label: "Barcode",
+		url:
+			docsUrl + "user/manual/en/stock/articles/track-items-using-barcode",
+	},
+	{
+		label: "Subcontracting",
+		url: docsUrl + "user/manual/en/manufacturing/subcontracting",
+	},
+];
 
+frappe.help.help_links["List/Installation Note"] = [
+	{
+		label: "Installation Note",
+		url: docsUrl + "user/manual/en/stock/installation-note",
+	},
+];
 
+frappe.help.help_links["Tree"] = [
+	{
+		label: "Managing Tree Structure Masters",
+		url:
+			docsUrl +
+			"user/manual/en/setting-up/articles/managing-tree-structure-masters",
+	},
+];
 
-frappe.help.help_links['budget'] = [
-	{ label: 'Budgeting', url: docsUrl + 'user/manual/en/accounts/budgeting' },
-]
+frappe.help.help_links["List/Budget"] = [
+	{ label: "Budgeting", url: docsUrl + "user/manual/en/accounts/budgeting" },
+];
 
 //Stock
 
-frappe.help.help_links['material-request'] = [
-	{ label: 'Material Request', url: docsUrl + 'user/manual/en/stock/material-request' },
-	{ label: 'Auto-creation of Material Request', url: docsUrl + 'user/manual/en/stock/articles/auto-creation-of-material-request' },
-]
+frappe.help.help_links["List/Material Request"] = [
+	{
+		label: "Material Request",
+		url: docsUrl + "user/manual/en/stock/material-request",
+	},
+	{
+		label: "Auto-creation of Material Request",
+		url:
+			docsUrl +
+			"user/manual/en/stock/articles/auto-creation-of-material-request",
+	},
+];
 
-frappe.help.help_links['stock-entry'] = [
-	{ label: 'Stock Entry', url: docsUrl + 'user/manual/en/stock/stock-entry' },
-	{ label: 'Stock Entry Types', url: docsUrl + 'user/manual/en/stock/articles/stock-entry-purpose' },
-	{ label: 'Repack Entry', url: docsUrl + 'user/manual/en/stock/articles/repack-entry' },
-	{ label: 'Opening Stock', url: docsUrl + 'user/manual/en/stock/opening-stock' },
-	{ label: 'Subcontracting', url: docsUrl + 'user/manual/en/manufacturing/subcontracting' },
-]
+frappe.help.help_links["Form/Material Request"] = [
+	{
+		label: "Material Request",
+		url: docsUrl + "user/manual/en/stock/material-request",
+	},
+	{
+		label: "Auto-creation of Material Request",
+		url:
+			docsUrl +
+			"user/manual/en/stock/articles/auto-creation-of-material-request",
+	},
+];
 
-frappe.help.help_links['warehouse/view/tree'] = [
-	{ label: 'Warehouse', url: docsUrl + 'user/manual/en/stock/warehouse' },
-]
+frappe.help.help_links["Form/Stock Entry"] = [
+	{ label: "Stock Entry", url: docsUrl + "user/manual/en/stock/stock-entry" },
+	{
+		label: "Stock Entry Types",
+		url: docsUrl + "user/manual/en/stock/articles/stock-entry-purpose",
+	},
+	{
+		label: "Repack Entry",
+		url: docsUrl + "user/manual/en/stock/articles/repack-entry",
+	},
+	{
+		label: "Opening Stock",
+		url: docsUrl + "user/manual/en/stock/opening-stock",
+	},
+	{
+		label: "Subcontracting",
+		url: docsUrl + "user/manual/en/manufacturing/subcontracting",
+	},
+];
 
-frappe.help.help_links['serial-no'] = [
-	{ label: 'Serial No', url: docsUrl + 'user/manual/en/stock/serial-no' },
-]
+frappe.help.help_links["List/Stock Entry"] = [
+	{ label: "Stock Entry", url: docsUrl + "user/manual/en/stock/stock-entry" },
+];
 
-frappe.help.help_links['batch'] = [
-	{ label: 'Batch', url: docsUrl + 'user/manual/en/stock/batch' },
-]
+frappe.help.help_links["Tree/Warehouse"] = [
+	{ label: "Warehouse", url: docsUrl + "user/manual/en/stock/warehouse" },
+];
 
-frappe.help.help_links['packing-slip'] = [
-	{ label: 'Packing Slip', url: docsUrl + 'user/manual/en/stock/tools/packing-slip' },
-]
+frappe.help.help_links["List/Serial No"] = [
+	{ label: "Serial No", url: docsUrl + "user/manual/en/stock/serial-no" },
+];
 
-frappe.help.help_links['quality-inspection'] = [
-	{ label: 'Quality Inspection', url: docsUrl + 'user/manual/en/stock/tools/quality-inspection' },
-]
+frappe.help.help_links["Form/Serial No"] = [
+	{ label: "Serial No", url: docsUrl + "user/manual/en/stock/serial-no" },
+];
 
-frappe.help.help_links['landed-cost-voucher'] = [
-	{ label: 'Landed Cost Voucher', url: docsUrl + 'user/manual/en/stock/tools/landed-cost-voucher' },
-]
+frappe.help.help_links["Form/Batch"] = [
+	{ label: "Batch", url: docsUrl + "user/manual/en/stock/batch" },
+];
 
-frappe.help.help_links['item-group/view/tree'] = [
-	{ label: 'Item Group', url: docsUrl + 'user/manual/en/stock/setup/item-group' },
-]
+frappe.help.help_links["Form/Packing Slip"] = [
+	{
+		label: "Packing Slip",
+		url: docsUrl + "user/manual/en/stock/tools/packing-slip",
+	},
+];
 
-frappe.help.help_links['item-attribute'] = [
-	{ label: 'Item Attribute', url: docsUrl + 'user/manual/en/stock/setup/item-attribute' },
-]
+frappe.help.help_links["Form/Quality Inspection"] = [
+	{
+		label: "Quality Inspection",
+		url: docsUrl + "user/manual/en/stock/tools/quality-inspection",
+	},
+];
 
-frappe.help.help_links['uom'] = [
-	{ label: 'Fractions in UOM', url: docsUrl + 'user/manual/en/stock/articles/managing-fractions-in-uom' },
-]
+frappe.help.help_links["Form/Landed Cost Voucher"] = [
+	{
+		label: "Landed Cost Voucher",
+		url: docsUrl + "user/manual/en/stock/tools/landed-cost-voucher",
+	},
+];
 
-frappe.help.help_links['stock-reconciliation'] = [
-	{ label: 'Opening Stock Entry', url: docsUrl + 'user/manual/en/stock/opening-stock' },
-]
+frappe.help.help_links["Tree/Item Group"] = [
+	{
+		label: "Item Group",
+		url: docsUrl + "user/manual/en/stock/setup/item-group",
+	},
+];
+
+frappe.help.help_links["Form/Item Attribute"] = [
+	{
+		label: "Item Attribute",
+		url: docsUrl + "user/manual/en/stock/setup/item-attribute",
+	},
+];
+
+frappe.help.help_links["Form/UOM"] = [
+	{
+		label: "Fractions in UOM",
+		url:
+			docsUrl + "user/manual/en/stock/articles/managing-fractions-in-uom",
+	},
+];
+
+frappe.help.help_links["Form/Stock Reconciliation"] = [
+	{
+		label: "Opening Stock Entry",
+		url: docsUrl + "user/manual/en/stock/opening-stock",
+	},
+];
 
 //CRM
 
-frappe.help.help_links['lead'] = [
-	{ label: 'Lead', url: docsUrl + 'user/manual/en/CRM/lead' },
-]
+frappe.help.help_links["Form/Lead"] = [
+	{ label: "Lead", url: docsUrl + "user/manual/en/CRM/lead" },
+];
 
-frappe.help.help_links['opportunity'] = [
-	{ label: 'Opportunity', url: docsUrl + 'user/manual/en/CRM/opportunity' },
-]
+frappe.help.help_links["Form/Opportunity"] = [
+	{ label: "Opportunity", url: docsUrl + "user/manual/en/CRM/opportunity" },
+];
 
-frappe.help.help_links['address'] = [
-	{ label: 'Address', url: docsUrl + 'user/manual/en/CRM/address' },
-]
+frappe.help.help_links["Form/Address"] = [
+	{ label: "Address", url: docsUrl + "user/manual/en/CRM/address" },
+];
 
-frappe.help.help_links['contact'] = [
-	{ label: 'Contact', url: docsUrl + 'user/manual/en/CRM/contact' },
-]
+frappe.help.help_links["Form/Contact"] = [
+	{ label: "Contact", url: docsUrl + "user/manual/en/CRM/contact" },
+];
 
-frappe.help.help_links['newsletter'] = [
-	{ label: 'Newsletter', url: docsUrl + 'user/manual/en/CRM/newsletter' },
-]
+frappe.help.help_links["Form/Newsletter"] = [
+	{ label: "Newsletter", url: docsUrl + "user/manual/en/CRM/newsletter" },
+];
 
-frappe.help.help_links['campaign'] = [
-	{ label: 'Campaign', url: docsUrl + 'user/manual/en/CRM/setup/campaign' },
-]
+frappe.help.help_links["Form/Campaign"] = [
+	{ label: "Campaign", url: docsUrl + "user/manual/en/CRM/setup/campaign" },
+];
 
-frappe.help.help_links['sales-person/view/tree'] = [
-	{ label: 'Sales Person', url: docsUrl + 'user/manual/en/CRM/setup/sales-person' },
-]
+frappe.help.help_links["Tree/Sales Person"] = [
+	{
+		label: "Sales Person",
+		url: docsUrl + "user/manual/en/CRM/setup/sales-person",
+	},
+];
 
-frappe.help.help_links['sales-person'] = [
-	{ label: 'Sales Person Target', url: docsUrl + 'user/manual/en/selling/setup/sales-person-target-allocation' },
-]
+frappe.help.help_links["Form/Sales Person"] = [
+	{
+		label: "Sales Person Target",
+		url:
+			docsUrl +
+			"user/manual/en/selling/setup/sales-person-target-allocation",
+	},
+];
+
+//Support
+
+frappe.help.help_links["List/Feedback Trigger"] = [
+	{
+		label: "Feedback Trigger",
+		url: docsUrl + "user/manual/en/setting-up/feedback/setting-up-feedback",
+	},
+];
+
+frappe.help.help_links["List/Feedback Request"] = [
+	{
+		label: "Feedback Request",
+		url: docsUrl + "user/manual/en/setting-up/feedback/submit-feedback",
+	},
+];
+
+frappe.help.help_links["List/Feedback Request"] = [
+	{
+		label: "Feedback Request",
+		url: docsUrl + "user/manual/en/setting-up/feedback/submit-feedback",
+	},
+];
 
 //Manufacturing
 
-frappe.help.help_links['bom'] = [
-	{ label: 'Bill of Material', url: docsUrl + 'user/manual/en/manufacturing/bill-of-materials' },
-	{ label: 'Nested BOM Structure', url: docsUrl + 'user/manual/en/manufacturing/articles/nested-bom-structure' },
-]
+frappe.help.help_links["Form/BOM"] = [
+	{
+		label: "Bill of Material",
+		url: docsUrl + "user/manual/en/manufacturing/bill-of-materials",
+	},
+	{
+		label: "Nested BOM Structure",
+		url:
+			docsUrl +
+			"user/manual/en/manufacturing/articles/nested-bom-structure",
+	},
+];
 
-frappe.help.help_links['work-order'] = [
-	{ label: 'Work Order', url: docsUrl + 'user/manual/en/manufacturing/work-order' },
-]
+frappe.help.help_links["Form/Work Order"] = [
+	{
+		label: "Work Order",
+		url: docsUrl + "user/manual/en/manufacturing/work-order",
+	},
+];
 
-frappe.help.help_links['workstation'] = [
-	{ label: 'Workstation', url: docsUrl + 'user/manual/en/manufacturing/workstation' },
-]
+frappe.help.help_links["Form/Workstation"] = [
+	{
+		label: "Workstation",
+		url: docsUrl + "user/manual/en/manufacturing/workstation",
+	},
+];
 
-frappe.help.help_links['operation'] = [
-	{ label: 'Operation', url: docsUrl + 'user/manual/en/manufacturing/operation' },
-]
+frappe.help.help_links["Form/Operation"] = [
+	{
+		label: "Operation",
+		url: docsUrl + "user/manual/en/manufacturing/operation",
+	},
+];
 
-frappe.help.help_links['bom-update-tool'] = [
-	{ label: 'BOM Update Tool', url: docsUrl + 'user/manual/en/manufacturing/tools/bom-update-tool' },
-]
+frappe.help.help_links["Form/BOM Update Tool"] = [
+	{
+		label: "BOM Update Tool",
+		url: docsUrl + "user/manual/en/manufacturing/tools/bom-update-tool",
+	},
+];
 
 //Customize
 
-frappe.help.help_links['customize-form'] = [
-	{ label: 'Custom Field', url: docsUrl + 'user/manual/en/customize-erpnext/custom-field' },
-	{ label: 'Customize Field', url: docsUrl + 'user/manual/en/customize-erpnext/customize-form' },
-]
+frappe.help.help_links["Form/Customize Form"] = [
+	{
+		label: "Custom Field",
+		url: docsUrl + "user/manual/en/customize-erpnext/custom-field",
+	},
+	{
+		label: "Customize Field",
+		url: docsUrl + "user/manual/en/customize-erpnext/customize-form",
+	},
+];
 
-frappe.help.help_links['custom-field'] = [
-	{ label: 'Custom Field', url: docsUrl + 'user/manual/en/customize-erpnext/custom-field' },
-]
+frappe.help.help_links["Form/Custom Field"] = [
+	{
+		label: "Custom Field",
+		url: docsUrl + "user/manual/en/customize-erpnext/custom-field",
+	},
+];
 
-frappe.help.help_links['custom-field'] = [
-	{ label: 'Custom Field', url: docsUrl + 'user/manual/en/customize-erpnext/custom-field' },
-]
+frappe.help.help_links["Form/Custom Field"] = [
+	{
+		label: "Custom Field",
+		url: docsUrl + "user/manual/en/customize-erpnext/custom-field",
+	},
+];
diff --git a/erpnext/regional/doctype/tax_exemption_80g_certificate/tax_exemption_80g_certificate.py b/erpnext/regional/doctype/tax_exemption_80g_certificate/tax_exemption_80g_certificate.py
index d734a18..41c7b23 100644
--- a/erpnext/regional/doctype/tax_exemption_80g_certificate/tax_exemption_80g_certificate.py
+++ b/erpnext/regional/doctype/tax_exemption_80g_certificate/tax_exemption_80g_certificate.py
@@ -16,6 +16,7 @@
 		self.validate_duplicates()
 		self.validate_company_details()
 		self.set_company_address()
+		self.calculate_total()
 		self.set_title()
 
 	def validate_date(self):
@@ -29,7 +30,10 @@
 
 	def validate_duplicates(self):
 		if self.recipient == 'Donor':
-			certificate = frappe.db.exists(self.doctype, {'donation': self.donation})
+			certificate = frappe.db.exists(self.doctype, {
+				'donation': self.donation,
+				'name': ('!=', self.name)
+			})
 			if certificate:
 				frappe.throw(_('An 80G Certificate {0} already exists for the donation {1}').format(
 					get_link_to_form(self.doctype, certificate), frappe.bold(self.donation)
@@ -51,8 +55,17 @@
 		self.company_address = address.company_address
 		self.company_address_display = address.company_address_display
 
+	def calculate_total(self):
+		if self.recipient == 'Donor':
+			return
+
+		total = 0
+		for entry in self.payments:
+			total += flt(entry.amount)
+		self.total = total
+
 	def set_title(self):
-		if self.recipient == "Member":
+		if self.recipient == 'Member':
 			self.title = self.member_name
 		else:
 			self.title = self.donor_name
@@ -68,7 +81,7 @@
 			'from_date': ['between', (fiscal_year.year_start_date, fiscal_year.year_end_date)],
 			'to_date': ['between', (fiscal_year.year_start_date, fiscal_year.year_end_date)],
 			'membership_status': ('!=', 'Cancelled')
-		}, ['from_date', 'amount', 'name', 'invoice', 'payment_id'])
+		}, ['from_date', 'amount', 'name', 'invoice', 'payment_id'], order_by='from_date')
 
 		if not memberships:
 			frappe.msgprint(_('No Membership Payments found against the Member {0}').format(self.member))
diff --git a/erpnext/regional/italy/sales_invoice.js b/erpnext/regional/italy/sales_invoice.js
index 586a529..b54ac53 100644
--- a/erpnext/regional/italy/sales_invoice.js
+++ b/erpnext/regional/italy/sales_invoice.js
@@ -11,15 +11,10 @@
 						callback: function(r) {
 							frm.reload_doc();
 							if(r.message) {
-								var w = window.open(
-									frappe.urllib.get_full_url(
-										"/api/method/erpnext.regional.italy.utils.download_e_invoice_file?"
-										+ "file_name=" + r.message
-									)
-								)
-								if (!w) {
-									frappe.msgprint(__("Please enable pop-ups")); return;
-								}
+								open_url_post(frappe.request.url, {
+									cmd: 'frappe.core.doctype.file.file.download_file',
+									file_url: r.message
+								});
 							}
 						}
 					});
diff --git a/erpnext/regional/italy/setup.py b/erpnext/regional/italy/setup.py
index 95b92e7..a1f5bb9 100644
--- a/erpnext/regional/italy/setup.py
+++ b/erpnext/regional/italy/setup.py
@@ -128,11 +128,8 @@
 				fetch_from="company.vat_collectability"),
 			dict(fieldname='sb_e_invoicing_reference', label='E-Invoicing',
 				fieldtype='Section Break', insert_after='against_income_account', print_hide=1),
-			dict(fieldname='company_tax_id', label='Company Tax ID',
-				fieldtype='Data', insert_after='sb_e_invoicing_reference', print_hide=1, read_only=1,
-				fetch_from="company.tax_id"),
 			dict(fieldname='company_fiscal_code', label='Company Fiscal Code',
-				fieldtype='Data', insert_after='company_tax_id', print_hide=1, read_only=1,
+				fieldtype='Data', insert_after='sb_e_invoicing_reference', print_hide=1, read_only=1,
 				fetch_from="company.fiscal_code"),
 			dict(fieldname='company_fiscal_regime', label='Company Fiscal Regime',
 				fieldtype='Data', insert_after='company_fiscal_code', print_hide=1, read_only=1,
@@ -217,4 +214,4 @@
 	update_permission_property(doctype, 'Accounts Manager', 0, 'delete', 1)
 	add_permission(doctype, 'Accounts Manager', 1)
 	update_permission_property(doctype, 'Accounts Manager', 1, 'write', 1)
-	update_permission_property(doctype, 'Accounts Manager', 1, 'create', 1)
\ No newline at end of file
+	update_permission_property(doctype, 'Accounts Manager', 1, 'create', 1)
diff --git a/erpnext/regional/italy/utils.py b/erpnext/regional/italy/utils.py
index 6842fb2..08573cd 100644
--- a/erpnext/regional/italy/utils.py
+++ b/erpnext/regional/italy/utils.py
@@ -1,6 +1,8 @@
 from __future__ import unicode_literals
 
-import frappe, json, os
+import io
+import json
+import frappe
 from frappe.utils import flt, cstr
 from erpnext.controllers.taxes_and_totals import get_itemised_tax
 from frappe import _
@@ -28,20 +30,22 @@
 
 @frappe.whitelist()
 def export_invoices(filters=None):
-	saved_xmls = []
+	frappe.has_permission('Sales Invoice', throw=True)
 
-	invoices = frappe.get_all("Sales Invoice", filters=get_conditions(filters), fields=["*"])
+	invoices = frappe.get_all(
+		"Sales Invoice",
+		filters=get_conditions(filters),
+		fields=["name", "company_tax_id"]
+	)
 
-	for invoice in invoices:
-		attachments = get_e_invoice_attachments(invoice)
-		saved_xmls += [attachment.file_name for attachment in attachments]
+	attachments = get_e_invoice_attachments(invoices)
 
-	zip_filename = "{0}-einvoices.zip".format(frappe.utils.get_datetime().strftime("%Y%m%d_%H%M%S"))
+	zip_filename = "{0}-einvoices.zip".format(
+		frappe.utils.get_datetime().strftime("%Y%m%d_%H%M%S"))
 
-	download_zip(saved_xmls, zip_filename)
+	download_zip(attachments, zip_filename)
 
 
-@frappe.whitelist()
 def prepare_invoice(invoice, progressive_number):
 	#set company information
 	company = frappe.get_doc("Company", invoice.company)
@@ -98,7 +102,7 @@
 def get_conditions(filters):
 	filters = json.loads(filters)
 
-	conditions = {"docstatus": 1}
+	conditions = {"docstatus": 1, "company_tax_id": ("!=", "")}
 
 	if filters.get("company"): conditions["company"] = filters["company"]
 	if filters.get("customer"): conditions["customer"] =  filters["customer"]
@@ -111,23 +115,22 @@
 
 	return conditions
 
-#TODO: Use function from frappe once PR #6853 is merged.
+
 def download_zip(files, output_filename):
-	from zipfile import ZipFile
+	import zipfile
 
-	input_files = [frappe.get_site_path('private', 'files', filename) for filename in files]
-	output_path = frappe.get_site_path('private', 'files', output_filename)
+	zip_stream = io.BytesIO()
+	with zipfile.ZipFile(zip_stream, 'w', zipfile.ZIP_DEFLATED) as zip_file:
+		for file in files:
+			file_path = frappe.utils.get_files_path(
+				file.file_name, is_private=file.is_private)
 
-	with ZipFile(output_path, 'w') as output_zip:
-		for input_file in input_files:
-			output_zip.write(input_file, arcname=os.path.basename(input_file))
-
-	with open(output_path, 'rb') as fileobj:
-		filedata = fileobj.read()
+			zip_file.write(file_path, arcname=file.file_name)
 
 	frappe.local.response.filename = output_filename
-	frappe.local.response.filecontent = filedata
+	frappe.local.response.filecontent = zip_stream.getvalue()
 	frappe.local.response.type = "download"
+	zip_stream.close()
 
 def get_invoice_summary(items, taxes):
 	summary_data = frappe._dict()
@@ -307,23 +310,12 @@
 @frappe.whitelist()
 def generate_single_invoice(docname):
 	doc = frappe.get_doc("Sales Invoice", docname)
-
+	frappe.has_permission("Sales Invoice", doc=doc, throw=True)
 
 	e_invoice = prepare_and_attach_invoice(doc, True)
+	return e_invoice.file_url
 
-	return e_invoice.file_name
-
-@frappe.whitelist()
-def download_e_invoice_file(file_name):
-	content = None
-	with open(frappe.get_site_path('private', 'files', file_name), "r") as f:
-		content = f.read()
-
-	frappe.local.response.filename = file_name
-	frappe.local.response.filecontent = content
-	frappe.local.response.type = "download"
-
-#Delete e-invoice attachment on cancel.
+# Delete e-invoice attachment on cancel.
 def sales_invoice_on_cancel(doc, method):
 	if get_company_country(doc.company) not in ['Italy',
 		'Italia', 'Italian Republic', 'Repubblica Italiana']:
@@ -335,16 +327,38 @@
 def get_company_country(company):
 	return frappe.get_cached_value('Company', company, 'country')
 
-def get_e_invoice_attachments(invoice):
-	if not invoice.company_tax_id:
-		return []
+def get_e_invoice_attachments(invoices):
+	if not isinstance(invoices, list):
+		if not invoices.company_tax_id:
+			return
+
+		invoices = [invoices]
+
+	tax_id_map = {
+		invoice.name: (
+			invoice.company_tax_id
+			if invoice.company_tax_id.startswith("IT")
+			else "IT" + invoice.company_tax_id
+		) for invoice in invoices
+	}
+
+	attachments = frappe.get_all(
+		"File",
+		fields=("name", "file_name", "attached_to_name", "is_private"),
+		filters= {
+			"attached_to_name": ('in', tax_id_map),
+			"attached_to_doctype": 'Sales Invoice'
+		}
+	)
 
 	out = []
-	attachments = get_attachments(invoice.doctype, invoice.name)
-	company_tax_id = invoice.company_tax_id if invoice.company_tax_id.startswith("IT") else "IT" + invoice.company_tax_id
-
 	for attachment in attachments:
-		if attachment.file_name and attachment.file_name.startswith(company_tax_id) and attachment.file_name.endswith(".xml"):
+		if (
+			attachment.file_name
+			and attachment.file_name.endswith(".xml")
+			and attachment.file_name.startswith(
+				tax_id_map.get(attachment.attached_to_name))
+		):
 			out.append(attachment)
 
 	return out
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index e561291..af3d461 100755
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -778,6 +778,7 @@
 
 @frappe.whitelist()
 def make_purchase_order_for_default_supplier(source_name, selected_items=None, target_doc=None):
+	"""Creates Purchase Order for each Supplier. Returns a list of doc objects."""
 	if not selected_items: return
 
 	if isinstance(selected_items, string_types):
@@ -820,15 +821,16 @@
 		target.stock_qty = (flt(source.stock_qty) - flt(source.ordered_qty))
 		target.project = source_parent.project
 
-	suppliers = [item.get('supplier') for item in selected_items if item.get('supplier') and item.get('supplier')]
-	suppliers = list(set(suppliers))
+	suppliers = [item.get('supplier') for item in selected_items if item.get('supplier')]
+	suppliers = list(dict.fromkeys(suppliers)) # remove duplicates while preserving order
 
-	items_to_map = [item.get('item_code') for item in selected_items if item.get('item_code') and item.get('item_code')]
+	items_to_map = [item.get('item_code') for item in selected_items if item.get('item_code')]
 	items_to_map = list(set(items_to_map))
 
 	if not suppliers:
 		frappe.throw(_("Please set a Supplier against the Items to be considered in the Purchase Order."))
 
+	purchase_orders = []
 	for supplier in suppliers:
 		doc = get_mapped_doc("Sales Order", source_name, {
 			"Sales Order": {
@@ -872,7 +874,9 @@
 
 		doc.insert()
 		frappe.db.commit()
-		return doc
+		purchase_orders.append(doc)
+
+	return purchase_orders
 
 @frappe.whitelist()
 def make_purchase_order(source_name, selected_items=None, target_doc=None):
diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py
index ee16f44..b636a94 100644
--- a/erpnext/selling/doctype/sales_order/test_sales_order.py
+++ b/erpnext/selling/doctype/sales_order/test_sales_order.py
@@ -743,7 +743,7 @@
 		so = make_sales_order(item_list=so_items, do_not_submit=True)
 		so.submit()
 
-		po = make_purchase_order_for_default_supplier(so.name, selected_items=[so_items[0]])
+		po = make_purchase_order_for_default_supplier(so.name, selected_items=[so_items[0]])[0]
 		po.submit()
 
 		dn = create_dn_against_so(so.name, delivered_qty=2)
@@ -825,7 +825,7 @@
 		so.submit()
 
 		# create po for only one item
-		po1 = make_purchase_order_for_default_supplier(so.name, selected_items=[so_items[0]])
+		po1 = make_purchase_order_for_default_supplier(so.name, selected_items=[so_items[0]])[0]
 		po1.submit()
 
 		self.assertEqual(so.customer, po1.customer)
@@ -835,7 +835,7 @@
 		self.assertEqual(len(po1.items), 1)
 
 		# create po for remaining item
-		po2 = make_purchase_order_for_default_supplier(so.name, selected_items=[so_items[1]])
+		po2 = make_purchase_order_for_default_supplier(so.name, selected_items=[so_items[1]])[0]
 		po2.submit()
 
 		# teardown
@@ -846,6 +846,45 @@
 		so.load_from_db()
 		so.cancel()
 
+	def test_drop_shipping_full_for_default_suppliers(self):
+		"""Test if multiple POs are generated in one go against different default suppliers."""
+		from erpnext.selling.doctype.sales_order.sales_order import make_purchase_order_for_default_supplier
+
+		if not frappe.db.exists("Item", "_Test Item for Drop Shipping 1"):
+			make_item("_Test Item for Drop Shipping 1", {"is_stock_item": 1, "delivered_by_supplier": 1})
+
+		if not frappe.db.exists("Item", "_Test Item for Drop Shipping 2"):
+			make_item("_Test Item for Drop Shipping 2", {"is_stock_item": 1, "delivered_by_supplier": 1})
+
+		so_items = [
+			{
+				"item_code": "_Test Item for Drop Shipping 1",
+				"warehouse": "",
+				"qty": 2,
+				"rate": 400,
+				"delivered_by_supplier": 1,
+				"supplier": '_Test Supplier'
+			},
+			{
+				"item_code": "_Test Item for Drop Shipping 2",
+				"warehouse": "",
+				"qty": 2,
+				"rate": 400,
+				"delivered_by_supplier": 1,
+				"supplier": '_Test Supplier 1'
+			}
+		]
+
+		# create so and po
+		so = make_sales_order(item_list=so_items, do_not_submit=True)
+		so.submit()
+
+		purchase_orders = make_purchase_order_for_default_supplier(so.name, selected_items=so_items)
+
+		self.assertEqual(len(purchase_orders), 2)
+		self.assertEqual(purchase_orders[0].supplier, '_Test Supplier')
+		self.assertEqual(purchase_orders[1].supplier, '_Test Supplier 1')
+
 	def test_reserved_qty_for_closing_so(self):
 		bin = frappe.get_all("Bin", filters={"item_code": "_Test Item", "warehouse": "_Test Warehouse - _TC"},
 			fields=["reserved_qty"])
diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py
index 0bb480b..29fd0e6 100644
--- a/erpnext/setup/install.py
+++ b/erpnext/setup/install.py
@@ -142,13 +142,15 @@
 		}
 	]
 
-	current_nabvar_items = navbar_settings.help_dropdown
+	current_navbar_items = navbar_settings.help_dropdown
 	navbar_settings.set('help_dropdown', [])
 
 	for item in erpnext_navbar_items:
-		navbar_settings.append('help_dropdown', item)
+		current_labels = [item.get('item_label') for item in current_navbar_items]
+		if not item.get('item_label') in current_labels:
+			navbar_settings.append('help_dropdown', item)
 
-	for item in current_nabvar_items:
+	for item in current_navbar_items:
 		navbar_settings.append('help_dropdown', {
 			'item_label': item.item_label,
 			'item_type': item.item_type,
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py
index 3544390..d326a04 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.py
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.py
@@ -101,7 +101,7 @@
 			for f in fieldname:
 				toggle_print_hide(self.meta if key == "parent" else item_meta, f)
 
-		super(DeliveryNote, self).before_print()
+		super(DeliveryNote, self).before_print(settings)
 
 	def set_actual_qty(self):
 		for d in self.get('items'):
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index 4979234..af3c4e5 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -848,7 +848,6 @@
 		}
 		erpnext.hide_company();
 		erpnext.utils.add_item(this.frm);
-		this.frm.trigger('add_to_transit');
 	},
 
 	scan_barcode: function() {
diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py
index f54b3c1..121c51c 100644
--- a/erpnext/stock/stock_ledger.py
+++ b/erpnext/stock/stock_ledger.py
@@ -207,11 +207,11 @@
 
 
 	def build(self):
-		from erpnext.controllers.stock_controller import check_if_future_sle_exists
+		from erpnext.controllers.stock_controller import future_sle_exists
 
 		if self.args.get("sle_id"):
 			self.process_sle_against_current_timestamp()
-			if not check_if_future_sle_exists(self.args):
+			if not future_sle_exists(self.args):
 				self.update_bin()
 		else:
 			entries_to_fix = self.get_future_entries_to_fix()
@@ -856,4 +856,4 @@
 			and qty_after_transaction < 0
 		order by timestamp(posting_date, posting_time) asc
 		limit 1
-	""", args, as_dict=1)
\ No newline at end of file
+	""", args, as_dict=1)
diff --git a/sider.yml b/sider.yml
new file mode 100644
index 0000000..2ca6e8d
--- /dev/null
+++ b/sider.yml
@@ -0,0 +1,3 @@
+linter:
+  flake8:
+    config: .flake8
\ No newline at end of file