Merge pull request #40344 from pps190/fix-get-default-company

fix: get_user_default_as_list args order
diff --git a/.editorconfig b/.editorconfig
index 24f122a..e7d5cfe 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -9,6 +9,13 @@
 charset = utf-8
 
 # python, js indentation settings
-[{*.py,*.js}]
+[{*.py,*.js,*.vue,*.css,*.scss,*.html}]
 indent_style = tab
 indent_size = 4
+max_line_length = 110
+
+# JSON files - mostly doctype schema files
+[{*.json}]
+insert_final_newline = false
+indent_style = space
+indent_size = 2
diff --git a/.eslintrc b/.eslintrc
index f3d4fd5..1f22552 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -124,6 +124,7 @@
 		"beforeEach": true,
 		"onScan": true,
 		"extend_cscript": true,
-		"localforage": true
+		"localforage": true,
+		"Plaid": true
 	}
 }
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
index 275442a..2a85f70 100644
--- a/.git-blame-ignore-revs
+++ b/.git-blame-ignore-revs
@@ -32,3 +32,6 @@
 
 # bulk refactor with sourcery
 eb9ee3f79b94e594fc6dfa4f6514580e125eee8c
+
+# js formatting
+ec74a5e56617bbd76ac402451468fd4668af543d
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 6ea121f..1f11581 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -20,6 +20,23 @@
       - id: check-yaml
       - id: debug-statements
 
+  - repo: https://github.com/pre-commit/mirrors-prettier
+    rev: v2.7.1
+    hooks:
+      - id: prettier
+        types_or: [javascript, vue, scss]
+        # Ignore any files that might contain jinja / bundles
+        exclude: |
+            (?x)^(
+                erpnext/public/dist/.*|
+                cypress/.*|
+                .*node_modules.*|
+                .*boilerplate.*|
+                erpnext/public/js/controllers/.*|
+                erpnext/templates/pages/order.js|
+                erpnext/templates/includes/.*
+            )$
+
   - repo: https://github.com/pre-commit/mirrors-eslint
     rev: v8.44.0
     hooks:
diff --git a/commitlint.config.js b/commitlint.config.js
index 8847564..5670209 100644
--- a/commitlint.config.js
+++ b/commitlint.config.js
@@ -1,25 +1,13 @@
 module.exports = {
-	parserPreset: 'conventional-changelog-conventionalcommits',
+	parserPreset: "conventional-changelog-conventionalcommits",
 	rules: {
-		'subject-empty': [2, 'never'],
-		'type-case': [2, 'always', 'lower-case'],
-		'type-empty': [2, 'never'],
-		'type-enum': [
+		"subject-empty": [2, "never"],
+		"type-case": [2, "always", "lower-case"],
+		"type-empty": [2, "never"],
+		"type-enum": [
 			2,
-			'always',
-			[
-				'build',
-				'chore',
-				'ci',
-				'docs',
-				'feat',
-				'fix',
-				'perf',
-				'refactor',
-				'revert',
-				'style',
-				'test',
-			],
+			"always",
+			["build", "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test"],
 		],
 	},
 };
diff --git a/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.js b/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.js
index d8a83e5..0984611 100644
--- a/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.js
+++ b/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.js
@@ -1,4 +1,4 @@
-frappe.provide('frappe.dashboards.chart_sources');
+frappe.provide("frappe.dashboards.chart_sources");
 
 frappe.dashboards.chart_sources["Account Balance Timeline"] = {
 	method: "erpnext.accounts.dashboard_chart_source.account_balance_timeline.account_balance_timeline.get",
@@ -9,14 +9,14 @@
 			fieldtype: "Link",
 			options: "Company",
 			default: frappe.defaults.get_user_default("Company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "account",
 			label: __("Account"),
 			fieldtype: "Link",
 			options: "Account",
-			reqd: 1
+			reqd: 1,
 		},
-	]
+	],
 };
diff --git a/erpnext/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js
index bcf7efc..411b90f 100644
--- a/erpnext/accounts/doctype/account/account.js
+++ b/erpnext/accounts/doctype/account/account.js
@@ -26,19 +26,14 @@
 		frm.toggle_enable(["is_group", "company"], false);
 
 		if (cint(frm.doc.is_group) == 0) {
-			frm.toggle_display(
-				"freeze_account",
-				frm.doc.__onload && frm.doc.__onload.can_freeze_account
-			);
+			frm.toggle_display("freeze_account", frm.doc.__onload && frm.doc.__onload.can_freeze_account);
 		}
 
 		// read-only for root accounts
 		if (!frm.is_new()) {
 			if (!frm.doc.parent_account) {
 				frm.set_read_only();
-				frm.set_intro(
-					__("This is a root account and cannot be edited.")
-				);
+				frm.set_intro(__("This is a root account and cannot be edited."));
 			} else {
 				// credit days and type if customer or supplier
 				frm.set_intro(null);
@@ -80,27 +75,33 @@
 		);
 
 		if (frm.doc.is_group == 1) {
-			frm.add_custom_button(__('Convert to Non-Group'), function () {
-				return frappe.call({
-					doc: frm.doc,
-					method: 'convert_group_to_ledger',
-					callback: function() {
-						frm.refresh();
-					}
-				});
-			}, __('Actions'));
-
-		} else if (cint(frm.doc.is_group) == 0
-			&& frappe.boot.user.can_read.indexOf("GL Entry") !== -1) {
-			frm.add_custom_button(__('General Ledger'), function () {
-				frappe.route_options = {
-					"account": frm.doc.name,
-					"from_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
-					"to_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
-					"company": frm.doc.company
-				};
-				frappe.set_route("query-report", "General Ledger");
-			}, __('View'));
+			frm.add_custom_button(
+				__("Convert to Non-Group"),
+				function () {
+					return frappe.call({
+						doc: frm.doc,
+						method: "convert_group_to_ledger",
+						callback: function () {
+							frm.refresh();
+						},
+					});
+				},
+				__("Actions")
+			);
+		} else if (cint(frm.doc.is_group) == 0 && frappe.boot.user.can_read.indexOf("GL Entry") !== -1) {
+			frm.add_custom_button(
+				__("General Ledger"),
+				function () {
+					frappe.route_options = {
+						account: frm.doc.name,
+						from_date: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
+						to_date: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
+						company: frm.doc.company,
+					};
+					frappe.set_route("query-report", "General Ledger");
+				},
+				__("View")
+			);
 
 			frm.add_custom_button(
 				__("Convert to Group"),
@@ -193,14 +194,8 @@
 							if (r.message) {
 								frappe.set_route("Form", "Account", r.message);
 							} else {
-								frm.set_value(
-									"account_number",
-									data.account_number
-								);
-								frm.set_value(
-									"account_name",
-									data.account_name
-								);
+								frm.set_value("account_number", data.account_number);
+								frm.set_value("account_name", data.account_name);
 							}
 							d.hide();
 						}
diff --git a/erpnext/accounts/doctype/account/account_tree.js b/erpnext/accounts/doctype/account/account_tree.js
index 0b29769..93de49d 100644
--- a/erpnext/accounts/doctype/account/account_tree.js
+++ b/erpnext/accounts/doctype/account/account_tree.js
@@ -1,4 +1,4 @@
-frappe.provide("frappe.treeview_settings")
+frappe.provide("frappe.treeview_settings");
 
 frappe.treeview_settings["Account"] = {
 	breadcrumb: "Accounts",
@@ -7,12 +7,12 @@
 	filters: [
 		{
 			fieldname: "company",
-			fieldtype:"Select",
+			fieldtype: "Select",
 			options: erpnext.utils.get_tree_options("company"),
 			label: __("Company"),
 			default: erpnext.utils.get_tree_default("company"),
-			on_change: function() {
-				var me = frappe.treeview_settings['Account'].treeview;
+			on_change: function () {
+				var me = frappe.treeview_settings["Account"].treeview;
 				var company = me.page.fields_dict.company.get_value();
 				if (!company) {
 					frappe.throw(__("Please set a Company"));
@@ -22,30 +22,36 @@
 					args: {
 						company: company,
 					},
-					callback: function(r) {
-						if(r.message) {
+					callback: function (r) {
+						if (r.message) {
 							let root_company = r.message.length ? r.message[0] : "";
 							me.page.fields_dict.root_company.set_value(root_company);
 
-							frappe.db.get_value("Company", {"name": company}, "allow_account_creation_against_child_company", (r) => {
-								frappe.flags.ignore_root_company_validation = r.allow_account_creation_against_child_company;
-							});
+							frappe.db.get_value(
+								"Company",
+								{ name: company },
+								"allow_account_creation_against_child_company",
+								(r) => {
+									frappe.flags.ignore_root_company_validation =
+										r.allow_account_creation_against_child_company;
+								}
+							);
 						}
-					}
+					},
 				});
-			}
+			},
 		},
 		{
 			fieldname: "root_company",
-			fieldtype:"Data",
+			fieldtype: "Data",
 			label: __("Root Company"),
 			hidden: true,
-			disable_onchange: true
-		}
+			disable_onchange: true,
+		},
 	],
 	root_label: "Accounts",
-	get_tree_nodes: 'erpnext.accounts.utils.get_children',
-	on_get_node: function(nodes, deep=false) {
+	get_tree_nodes: "erpnext.accounts.utils.get_children",
+	on_get_node: function (nodes, deep = false) {
 		if (frappe.boot.user.can_read.indexOf("GL Entry") == -1) return;
 
 		let accounts = [];
@@ -57,151 +63,231 @@
 		}
 
 		frappe.db.get_single_value("Accounts Settings", "show_balance_in_coa").then((value) => {
-			if(value) {
-
+			if (value) {
 				const get_balances = frappe.call({
-					method: 'erpnext.accounts.utils.get_account_balances',
+					method: "erpnext.accounts.utils.get_account_balances",
 					args: {
 						accounts: accounts,
-						company: cur_tree.args.company
+						company: cur_tree.args.company,
 					},
 				});
 
-				get_balances.then(r => {
+				get_balances.then((r) => {
 					if (!r.message || r.message.length == 0) return;
 
 					for (let account of r.message) {
-
 						const node = cur_tree.nodes && cur_tree.nodes[account.value];
 						if (!node || node.is_root) continue;
 
 						// show Dr if positive since balance is calculated as debit - credit else show Cr
 						const balance = account.balance_in_account_currency || account.balance;
-						const dr_or_cr = balance > 0 ? __("Dr"): __("Cr");
+						const dr_or_cr = balance > 0 ? __("Dr") : __("Cr");
 						const format = (value, currency) => format_currency(Math.abs(value), currency);
 
-						if (account.balance!==undefined) {
-							node.parent && node.parent.find('.balance-area').remove();
-							$('<span class="balance-area pull-right">'
-							  + (account.balance_in_account_currency ?
-							     (format(account.balance_in_account_currency, account.account_currency) + " / ") : "")
-							  + format(account.balance, account.company_currency)
-							  + " " + dr_or_cr
-							  + '</span>').insertBefore(node.$ul);
+						if (account.balance !== undefined) {
+							node.parent && node.parent.find(".balance-area").remove();
+							$(
+								'<span class="balance-area pull-right">' +
+									(account.balance_in_account_currency
+										? format(
+												account.balance_in_account_currency,
+												account.account_currency
+										  ) + " / "
+										: "") +
+									format(account.balance, account.company_currency) +
+									" " +
+									dr_or_cr +
+									"</span>"
+							).insertBefore(node.$ul);
 						}
 					}
 				});
 			}
 		});
 	},
-	add_tree_node: 'erpnext.accounts.utils.add_ac',
-	menu_items:[
+	add_tree_node: "erpnext.accounts.utils.add_ac",
+	menu_items: [
 		{
-			label: __('New Company'),
-			action: function() { frappe.new_doc("Company", true) },
-			condition: 'frappe.boot.user.can_create.indexOf("Company") !== -1'
-		}
+			label: __("New Company"),
+			action: function () {
+				frappe.new_doc("Company", true);
+			},
+			condition: 'frappe.boot.user.can_create.indexOf("Company") !== -1',
+		},
 	],
 	fields: [
-		{fieldtype:'Data', fieldname:'account_name', label:__('New Account Name'), reqd:true,
-			description: __("Name of new Account. Note: Please don't create accounts for Customers and Suppliers")},
-		{fieldtype:'Data', fieldname:'account_number', label:__('Account Number'),
-			description: __("Number of new Account, it will be included in the account name as a prefix")},
-		{fieldtype:'Check', fieldname:'is_group', label:__('Is Group'),
-			description: __('Further accounts can be made under Groups, but entries can be made against non-Groups')},
-		{fieldtype:'Select', fieldname:'root_type', label:__('Root Type'),
-			options: ['Asset', 'Liability', 'Equity', 'Income', 'Expense'].join('\n'),
-			depends_on: 'eval:doc.is_group && !doc.parent_account'},
-		{fieldtype:'Select', fieldname:'account_type', label:__('Account Type'),
-			options: frappe.get_meta("Account").fields.filter(d => d.fieldname=='account_type')[0].options,
-			description: __("Optional. This setting will be used to filter in various transactions.")
+		{
+			fieldtype: "Data",
+			fieldname: "account_name",
+			label: __("New Account Name"),
+			reqd: true,
+			description: __(
+				"Name of new Account. Note: Please don't create accounts for Customers and Suppliers"
+			),
 		},
-		{fieldtype:'Float', fieldname:'tax_rate', label:__('Tax Rate'),
-			depends_on: 'eval:doc.is_group==0&&doc.account_type=="Tax"'},
-		{fieldtype:'Link', fieldname:'account_currency', label:__('Currency'), options:"Currency",
-			description: __("Optional. Sets company's default currency, if not specified.")}
+		{
+			fieldtype: "Data",
+			fieldname: "account_number",
+			label: __("Account Number"),
+			description: __("Number of new Account, it will be included in the account name as a prefix"),
+		},
+		{
+			fieldtype: "Check",
+			fieldname: "is_group",
+			label: __("Is Group"),
+			description: __(
+				"Further accounts can be made under Groups, but entries can be made against non-Groups"
+			),
+		},
+		{
+			fieldtype: "Select",
+			fieldname: "root_type",
+			label: __("Root Type"),
+			options: ["Asset", "Liability", "Equity", "Income", "Expense"].join("\n"),
+			depends_on: "eval:doc.is_group && !doc.parent_account",
+		},
+		{
+			fieldtype: "Select",
+			fieldname: "account_type",
+			label: __("Account Type"),
+			options: frappe.get_meta("Account").fields.filter((d) => d.fieldname == "account_type")[0]
+				.options,
+			description: __("Optional. This setting will be used to filter in various transactions."),
+		},
+		{
+			fieldtype: "Float",
+			fieldname: "tax_rate",
+			label: __("Tax Rate"),
+			depends_on: 'eval:doc.is_group==0&&doc.account_type=="Tax"',
+		},
+		{
+			fieldtype: "Link",
+			fieldname: "account_currency",
+			label: __("Currency"),
+			options: "Currency",
+			description: __("Optional. Sets company's default currency, if not specified."),
+		},
 	],
-	ignore_fields:["parent_account"],
-	onload: function(treeview) {
-		frappe.treeview_settings['Account'].treeview = {};
-		$.extend(frappe.treeview_settings['Account'].treeview, treeview);
+	ignore_fields: ["parent_account"],
+	onload: function (treeview) {
+		frappe.treeview_settings["Account"].treeview = {};
+		$.extend(frappe.treeview_settings["Account"].treeview, treeview);
 		function get_company() {
 			return treeview.page.fields_dict.company.get_value();
 		}
 
 		// tools
-		treeview.page.add_inner_button(__("Chart of Cost Centers"), function() {
-			frappe.set_route('Tree', 'Cost Center', {company: get_company()});
-		}, __('View'));
+		treeview.page.add_inner_button(
+			__("Chart of Cost Centers"),
+			function () {
+				frappe.set_route("Tree", "Cost Center", { company: get_company() });
+			},
+			__("View")
+		);
 
-		treeview.page.add_inner_button(__("Opening Invoice Creation Tool"), function() {
-			frappe.set_route('Form', 'Opening Invoice Creation Tool', {company: get_company()});
-		}, __('View'));
+		treeview.page.add_inner_button(
+			__("Opening Invoice Creation Tool"),
+			function () {
+				frappe.set_route("Form", "Opening Invoice Creation Tool", { company: get_company() });
+			},
+			__("View")
+		);
 
-		treeview.page.add_inner_button(__("Period Closing Voucher"), function() {
-			frappe.set_route('List', 'Period Closing Voucher', {company: get_company()});
-		}, __('View'));
+		treeview.page.add_inner_button(
+			__("Period Closing Voucher"),
+			function () {
+				frappe.set_route("List", "Period Closing Voucher", { company: get_company() });
+			},
+			__("View")
+		);
 
-
-		treeview.page.add_inner_button(__("Journal Entry"), function() {
-			frappe.new_doc('Journal Entry', {company: get_company()});
-		}, __('Create'));
-		treeview.page.add_inner_button(__("Company"), function() {
-			frappe.new_doc('Company');
-		}, __('Create'));
+		treeview.page.add_inner_button(
+			__("Journal Entry"),
+			function () {
+				frappe.new_doc("Journal Entry", { company: get_company() });
+			},
+			__("Create")
+		);
+		treeview.page.add_inner_button(
+			__("Company"),
+			function () {
+				frappe.new_doc("Company");
+			},
+			__("Create")
+		);
 
 		// financial statements
-		for (let report of ['Trial Balance', 'General Ledger', 'Balance Sheet',
-			'Profit and Loss Statement', 'Cash Flow Statement', 'Accounts Payable', 'Accounts Receivable']) {
-			treeview.page.add_inner_button(__(report), function() {
-				frappe.set_route('query-report', report, {company: get_company()});
-			}, __('Financial Statements'));
+		for (let report of [
+			"Trial Balance",
+			"General Ledger",
+			"Balance Sheet",
+			"Profit and Loss Statement",
+			"Cash Flow Statement",
+			"Accounts Payable",
+			"Accounts Receivable",
+		]) {
+			treeview.page.add_inner_button(
+				__(report),
+				function () {
+					frappe.set_route("query-report", report, { company: get_company() });
+				},
+				__("Financial Statements")
+			);
 		}
-
 	},
-	post_render: function(treeview) {
-		frappe.treeview_settings['Account'].treeview["tree"] = treeview.tree;
-		treeview.page.set_primary_action(__("New"), function() {
-			let root_company = treeview.page.fields_dict.root_company.get_value();
+	post_render: function (treeview) {
+		frappe.treeview_settings["Account"].treeview["tree"] = treeview.tree;
+		treeview.page.set_primary_action(
+			__("New"),
+			function () {
+				let root_company = treeview.page.fields_dict.root_company.get_value();
 
-			if(root_company) {
-				frappe.throw(__("Please add the account to root level Company - {0}"), [root_company]);
-			} else {
-				treeview.new_node();
-			}
-		}, "add");
+				if (root_company) {
+					frappe.throw(__("Please add the account to root level Company - {0}"), [root_company]);
+				} else {
+					treeview.new_node();
+				}
+			},
+			"add"
+		);
 	},
 	toolbar: [
 		{
-			label:__("Add Child"),
-			condition: function(node) {
-				return frappe.boot.user.can_create.indexOf("Account") !== -1
-					&& (!frappe.treeview_settings['Account'].treeview.page.fields_dict.root_company.get_value()
-					|| frappe.flags.ignore_root_company_validation)
-					&& node.expandable && !node.hide_add;
+			label: __("Add Child"),
+			condition: function (node) {
+				return (
+					frappe.boot.user.can_create.indexOf("Account") !== -1 &&
+					(!frappe.treeview_settings[
+						"Account"
+					].treeview.page.fields_dict.root_company.get_value() ||
+						frappe.flags.ignore_root_company_validation) &&
+					node.expandable &&
+					!node.hide_add
+				);
 			},
-			click: function() {
-				var me = frappe.views.trees['Account'];
+			click: function () {
+				var me = frappe.views.trees["Account"];
 				me.new_node();
 			},
-			btnClass: "hidden-xs"
+			btnClass: "hidden-xs",
 		},
 		{
-			condition: function(node) {
-				return !node.root && frappe.boot.user.can_read.indexOf("GL Entry") !== -1
+			condition: function (node) {
+				return !node.root && frappe.boot.user.can_read.indexOf("GL Entry") !== -1;
 			},
 			label: __("View Ledger"),
-			click: function(node, btn) {
+			click: function (node, btn) {
 				frappe.route_options = {
-					"account": node.label,
-					"from_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
-					"to_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
-					"company": frappe.treeview_settings['Account'].treeview.page.fields_dict.company.get_value()
+					account: node.label,
+					from_date: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
+					to_date: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
+					company:
+						frappe.treeview_settings["Account"].treeview.page.fields_dict.company.get_value(),
 				};
 				frappe.set_route("query-report", "General Ledger");
 			},
-			btnClass: "hidden-xs"
-		}
+			btnClass: "hidden-xs",
+		},
 	],
-	extend_toolbar: true
-}
+	extend_toolbar: true,
+};
diff --git a/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.js b/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.js
index 2f53f7b..cd883e5 100644
--- a/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.js
+++ b/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.js
@@ -1,74 +1,86 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Accounting Dimension', {
-	refresh: function(frm) {
-		frm.set_query('document_type', () => {
+frappe.ui.form.on("Accounting Dimension", {
+	refresh: function (frm) {
+		frm.set_query("document_type", () => {
 			let invalid_doctypes = frappe.model.core_doctypes_list;
-			invalid_doctypes.push('Accounting Dimension', 'Project',
-				'Cost Center', 'Accounting Dimension Detail', 'Company');
+			invalid_doctypes.push(
+				"Accounting Dimension",
+				"Project",
+				"Cost Center",
+				"Accounting Dimension Detail",
+				"Company"
+			);
 
 			return {
 				filters: {
-					name: ['not in', invalid_doctypes]
-				}
+					name: ["not in", invalid_doctypes],
+				},
 			};
 		});
 
-		frm.set_query("offsetting_account", "dimension_defaults", function(doc, cdt, cdn) {
+		frm.set_query("offsetting_account", "dimension_defaults", function (doc, cdt, cdn) {
 			let d = locals[cdt][cdn];
 			return {
 				filters: {
 					company: d.company,
 					root_type: ["in", ["Asset", "Liability"]],
-					is_group: 0
-				}
-			}
+					is_group: 0,
+				},
+			};
 		});
 
 		if (!frm.is_new()) {
-			frm.add_custom_button(__('Show {0}', [frm.doc.document_type]), function () {
+			frm.add_custom_button(__("Show {0}", [frm.doc.document_type]), function () {
 				frappe.set_route("List", frm.doc.document_type);
 			});
 
 			let button = frm.doc.disabled ? "Enable" : "Disable";
 
-			frm.add_custom_button(__(button), function() {
-
-				frm.set_value('disabled', 1 - frm.doc.disabled);
+			frm.add_custom_button(__(button), function () {
+				frm.set_value("disabled", 1 - frm.doc.disabled);
 
 				frappe.call({
 					method: "erpnext.accounts.doctype.accounting_dimension.accounting_dimension.disable_dimension",
 					args: {
-						doc: frm.doc
+						doc: frm.doc,
 					},
 					freeze: true,
-					callback: function(r) {
+					callback: function (r) {
 						let message = frm.doc.disabled ? "Dimension Disabled" : "Dimension Enabled";
 						frm.save();
-						frappe.show_alert({message:__(message), indicator:'green'});
-					}
+						frappe.show_alert({ message: __(message), indicator: "green" });
+					},
 				});
 			});
 		}
 	},
 
-	document_type: function(frm) {
+	document_type: function (frm) {
+		frm.set_value("label", frm.doc.document_type);
+		frm.set_value("fieldname", frappe.model.scrub(frm.doc.document_type));
 
-		frm.set_value('label', frm.doc.document_type);
-		frm.set_value('fieldname', frappe.model.scrub(frm.doc.document_type));
-
-		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");
+		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"
+					);
+				}
 			}
-		});
+		);
 	},
 });
 
-frappe.ui.form.on('Accounting Dimension Detail', {
-	dimension_defaults_add: function(frm, cdt, cdn) {
+frappe.ui.form.on("Accounting Dimension Detail", {
+	dimension_defaults_add: function (frm, cdt, cdn) {
 		let row = locals[cdt][cdn];
 		row.reference_document = frm.doc.document_type;
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.js b/erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.js
index 6f0b6fc..38ad131 100644
--- a/erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.js
+++ b/erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.js
@@ -1,10 +1,9 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Accounting Dimension Filter', {
-	refresh: function(frm, cdt, cdn) {
-		let help_content =
-			`<table class="table table-bordered" style="background-color: var(--scrollbar-track-color);">
+frappe.ui.form.on("Accounting Dimension Filter", {
+	refresh: function (frm, cdt, cdn) {
+		let help_content = `<table class="table table-bordered" style="background-color: var(--scrollbar-track-color);">
 				<tr><td>
 					<p>
 						<i class="fa fa-hand-right"></i>
@@ -13,77 +12,80 @@
 				</td></tr>
 			</table>`;
 
-		frm.set_df_property('dimension_filter_help', 'options', help_content);
+		frm.set_df_property("dimension_filter_help", "options", help_content);
 	},
-	onload: function(frm) {
-		frm.set_query('applicable_on_account', 'accounts', function() {
+	onload: function (frm) {
+		frm.set_query("applicable_on_account", "accounts", function () {
 			return {
 				filters: {
-					'company': frm.doc.company
-				}
+					company: frm.doc.company,
+				},
 			};
 		});
 
-		frappe.db.get_list('Accounting Dimension',
-			{fields: ['document_type']}).then((res) => {
-			let options = ['Cost Center', 'Project'];
+		frappe.db.get_list("Accounting Dimension", { fields: ["document_type"] }).then((res) => {
+			let options = ["Cost Center", "Project"];
 
 			res.forEach((dimension) => {
 				options.push(dimension.document_type);
 			});
 
-			frm.set_df_property('accounting_dimension', 'options', options);
+			frm.set_df_property("accounting_dimension", "options", options);
 		});
 
-		frm.trigger('setup_filters');
+		frm.trigger("setup_filters");
 	},
 
-	setup_filters: function(frm) {
+	setup_filters: function (frm) {
 		let filters = {};
 
 		if (frm.doc.accounting_dimension) {
-			frappe.model.with_doctype(frm.doc.accounting_dimension, function() {
+			frappe.model.with_doctype(frm.doc.accounting_dimension, function () {
 				if (frappe.model.is_tree(frm.doc.accounting_dimension)) {
-					filters['is_group'] = 0;
+					filters["is_group"] = 0;
 				}
 
-				if (frappe.meta.has_field(frm.doc.accounting_dimension, 'company')) {
-					filters['company'] = frm.doc.company;
+				if (frappe.meta.has_field(frm.doc.accounting_dimension, "company")) {
+					filters["company"] = frm.doc.company;
 				}
 
-				frm.set_query('dimension_value', 'dimensions', function() {
+				frm.set_query("dimension_value", "dimensions", function () {
 					return {
-						filters: filters
+						filters: filters,
 					};
 				});
 			});
 		}
 	},
 
-	accounting_dimension: function(frm) {
+	accounting_dimension: function (frm) {
 		frm.clear_table("dimensions");
 		let row = frm.add_child("dimensions");
 		row.accounting_dimension = frm.doc.accounting_dimension;
-		frm.fields_dict["dimensions"].grid.update_docfield_property("dimension_value", "label", frm.doc.accounting_dimension);
+		frm.fields_dict["dimensions"].grid.update_docfield_property(
+			"dimension_value",
+			"label",
+			frm.doc.accounting_dimension
+		);
 		frm.refresh_field("dimensions");
-		frm.trigger('setup_filters');
+		frm.trigger("setup_filters");
 	},
-	apply_restriction_on_values: function(frm) {
+	apply_restriction_on_values: function (frm) {
 		/** If restriction on values is not applied, we should set "allow_or_restrict" to "Restrict" with an empty allowed dimension table.
 		 * Hence it's not "restricted" on any value.
-		  */
+		 */
 		if (!frm.doc.apply_restriction_on_values) {
 			frm.set_value("allow_or_restrict", "Restrict");
 			frm.clear_table("dimensions");
 			frm.refresh_field("dimensions");
 		}
-	}
+	},
 });
 
-frappe.ui.form.on('Allowed Dimension', {
-	dimensions_add: function(frm, cdt, cdn) {
+frappe.ui.form.on("Allowed Dimension", {
+	dimensions_add: function (frm, cdt, cdn) {
 		let row = locals[cdt][cdn];
 		row.accounting_dimension = frm.doc.accounting_dimension;
 		frm.refresh_field("dimensions");
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/accounting_period/accounting_period.js b/erpnext/accounts/doctype/accounting_period/accounting_period.js
index f17b6f9..441471f 100644
--- a/erpnext/accounts/doctype/accounting_period/accounting_period.js
+++ b/erpnext/accounts/doctype/accounting_period/accounting_period.js
@@ -1,30 +1,33 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Accounting Period', {
-	onload: function(frm) {
-		if(frm.doc.closed_documents.length === 0 || (frm.doc.closed_documents.length === 1 && frm.doc.closed_documents[0].document_type == undefined)) {
+frappe.ui.form.on("Accounting Period", {
+	onload: function (frm) {
+		if (
+			frm.doc.closed_documents.length === 0 ||
+			(frm.doc.closed_documents.length === 1 && frm.doc.closed_documents[0].document_type == undefined)
+		) {
 			frappe.call({
 				method: "get_doctypes_for_closing",
-				doc:frm.doc,
-				callback: function(r) {
-					if(r.message) {
+				doc: frm.doc,
+				callback: function (r) {
+					if (r.message) {
 						cur_frm.clear_table("closed_documents");
-						r.message.forEach(function(element) {
+						r.message.forEach(function (element) {
 							var c = frm.add_child("closed_documents");
 							c.document_type = element.document_type;
 							c.closed = element.closed;
 						});
 						refresh_field("closed_documents");
 					}
-				}
+				},
 			});
 		}
 
 		frm.set_query("document_type", "closed_documents", () => {
 			return {
 				query: "erpnext.controllers.queries.get_doctypes_for_closing",
-			}
+			};
 		});
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.js b/erpnext/accounts/doctype/accounts_settings/accounts_settings.js
index 0627675..5b9a52e 100644
--- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.js
+++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Accounts Settings', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Accounts Settings", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/accounts/doctype/accounts_settings/regional/united_states.js b/erpnext/accounts/doctype/accounts_settings/regional/united_states.js
index 3e38386..a522de9 100644
--- a/erpnext/accounts/doctype/accounts_settings/regional/united_states.js
+++ b/erpnext/accounts/doctype/accounts_settings/regional/united_states.js
@@ -1,8 +1,11 @@
-
-frappe.ui.form.on('Accounts Settings', {
-	refresh: function(frm) {
+frappe.ui.form.on("Accounts Settings", {
+	refresh: function (frm) {
 		frm.set_df_property("acc_frozen_upto", "label", "Books Closed Through");
-		frm.set_df_property("frozen_accounts_modifier", "label", "Role Allowed to Close Books & Make Changes to Closed Periods");
+		frm.set_df_property(
+			"frozen_accounts_modifier",
+			"label",
+			"Role Allowed to Close Books & Make Changes to Closed Periods"
+		);
 		frm.set_df_property("credit_controller", "label", "Credit Manager");
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/bank/bank.js b/erpnext/accounts/doctype/bank/bank.js
index 83bd7fe..77af313 100644
--- a/erpnext/accounts/doctype/bank/bank.js
+++ b/erpnext/accounts/doctype/bank/bank.js
@@ -1,38 +1,36 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
-frappe.provide('erpnext.integrations');
+frappe.provide("erpnext.integrations");
 
-frappe.ui.form.on('Bank', {
-	onload: function(frm) {
+frappe.ui.form.on("Bank", {
+	onload: function (frm) {
 		add_fields_to_mapping_table(frm);
 	},
-	refresh: function(frm) {
+	refresh: function (frm) {
 		add_fields_to_mapping_table(frm);
-		frm.toggle_display(['address_html','contact_html'], !frm.doc.__islocal);
+		frm.toggle_display(["address_html", "contact_html"], !frm.doc.__islocal);
 
 		if (frm.doc.__islocal) {
-			frm.set_df_property('address_and_contact', 'hidden', 1);
+			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);
+		} else {
+			frm.set_df_property("address_and_contact", "hidden", 0);
 			frappe.contacts.render_address_and_contact(frm);
 		}
 		if (frm.doc.plaid_access_token) {
-			frm.add_custom_button(__('Refresh Plaid Link'), () => {
+			frm.add_custom_button(__("Refresh Plaid Link"), () => {
 				new erpnext.integrations.refreshPlaidLink(frm.doc.plaid_access_token);
 			});
 		}
-	}
+	},
 });
 
-
 let add_fields_to_mapping_table = function (frm) {
 	let options = [];
 
-	frappe.model.with_doctype("Bank Transaction", function() {
+	frappe.model.with_doctype("Bank Transaction", function () {
 		let meta = frappe.get_meta("Bank Transaction");
-		meta.fields.forEach(value => {
+		meta.fields.forEach((value) => {
 			if (!["Section Break", "Column Break"].includes(value.fieldtype)) {
 				options.push(value.fieldname);
 			}
@@ -40,30 +38,32 @@
 	});
 
 	frm.fields_dict.bank_transaction_mapping.grid.update_docfield_property(
-		'bank_transaction_field', 'options', options
+		"bank_transaction_field",
+		"options",
+		options
 	);
 };
 
 erpnext.integrations.refreshPlaidLink = class refreshPlaidLink {
 	constructor(access_token) {
 		this.access_token = access_token;
-		this.plaidUrl = 'https://cdn.plaid.com/link/v2/stable/link-initialize.js';
+		this.plaidUrl = "https://cdn.plaid.com/link/v2/stable/link-initialize.js";
 		this.init_config();
 	}
 
 	async init_config() {
-		this.plaid_env = await frappe.db.get_single_value('Plaid Settings', 'plaid_env');
+		this.plaid_env = await frappe.db.get_single_value("Plaid Settings", "plaid_env");
 		this.token = await this.get_link_token_for_update();
 		this.init_plaid();
 	}
 
 	async get_link_token_for_update() {
 		const token = frappe.xcall(
-			'erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.get_link_token_for_update',
+			"erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.get_link_token_for_update",
 			{ access_token: this.access_token }
-		)
+		);
 		if (!token) {
-			frappe.throw(__('Cannot retrieve link token for update. Check Error Log for more information'));
+			frappe.throw(__("Cannot retrieve link token for update. Check Error Log for more information"));
 		}
 		return token;
 	}
@@ -90,35 +90,45 @@
 				resolve();
 				return;
 			}
-			const el = document.createElement('script');
-			el.type = 'text/javascript';
+			const el = document.createElement("script");
+			el.type = "text/javascript";
 			el.async = true;
 			el.src = src;
-			el.addEventListener('load', resolve);
-			el.addEventListener('error', reject);
-			el.addEventListener('abort', reject);
+			el.addEventListener("load", resolve);
+			el.addEventListener("error", reject);
+			el.addEventListener("abort", reject);
 			document.head.appendChild(el);
 		});
 	}
 
 	onScriptLoaded(me) {
-		me.linkHandler = Plaid.create({ // eslint-disable-line no-undef
+		me.linkHandler = Plaid.create({
+			// eslint-disable-line no-undef
 			env: me.plaid_env,
 			token: me.token,
-			onSuccess: me.plaid_success
+			onSuccess: me.plaid_success,
 		});
 	}
 
 	onScriptError(error) {
-		frappe.msgprint(__("There was an issue connecting to Plaid's authentication server. Check browser console for more information"));
+		frappe.msgprint(
+			__(
+				"There was an issue connecting to Plaid's authentication server. Check browser console for more information"
+			)
+		);
 		console.log(error);
 	}
 
 	plaid_success(token, response) {
-		frappe.xcall('erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.update_bank_account_ids', {
-			response: response,
-		}).then(() => {
-			frappe.show_alert({ message: __('Plaid Link Updated'), indicator: 'green' });
-		});
+		frappe
+			.xcall(
+				"erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.update_bank_account_ids",
+				{
+					response: response,
+				}
+			)
+			.then(() => {
+				frappe.show_alert({ message: __("Plaid Link Updated"), indicator: "green" });
+			});
 	}
 };
diff --git a/erpnext/accounts/doctype/bank_account/bank_account.js b/erpnext/accounts/doctype/bank_account/bank_account.js
index 0598190..202f750 100644
--- a/erpnext/accounts/doctype/bank_account/bank_account.js
+++ b/erpnext/accounts/doctype/bank_account/bank_account.js
@@ -1,45 +1,49 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Bank Account', {
-	setup: function(frm) {
-		frm.set_query("account", function() {
+frappe.ui.form.on("Bank Account", {
+	setup: function (frm) {
+		frm.set_query("account", function () {
 			return {
 				filters: {
-					'account_type': 'Bank',
-					'company': frm.doc.company,
-					'is_group': 0
-				}
+					account_type: "Bank",
+					company: frm.doc.company,
+					is_group: 0,
+				},
 			};
 		});
-		frm.set_query("party_type", function() {
+		frm.set_query("party_type", function () {
 			return {
 				query: "erpnext.setup.doctype.party_type.party_type.get_party_type",
 			};
 		});
 	},
-	refresh: function(frm) {
-		frappe.dynamic_link = { doc: frm.doc, fieldname: 'name', doctype: 'Bank Account' }
+	refresh: function (frm) {
+		frappe.dynamic_link = { doc: frm.doc, fieldname: "name", doctype: "Bank Account" };
 
-		frm.toggle_display(['address_html','contact_html'], !frm.doc.__islocal);
+		frm.toggle_display(["address_html", "contact_html"], !frm.doc.__islocal);
 
 		if (frm.doc.__islocal) {
 			frappe.contacts.clear_address_and_contact(frm);
-		}
-		else {
+		} else {
 			frappe.contacts.render_address_and_contact(frm);
 		}
 
 		if (frm.doc.integration_id) {
-			frm.add_custom_button(__("Unlink external integrations"), function() {
-				frappe.confirm(__("This action will unlink this account from any external service integrating ERPNext with your bank accounts. It cannot be undone. Are you certain ?"), function() {
-					frm.set_value("integration_id", "");
-				});
+			frm.add_custom_button(__("Unlink external integrations"), function () {
+				frappe.confirm(
+					__(
+						"This action will unlink this account from any external service integrating ERPNext with your bank accounts. It cannot be undone. Are you certain ?"
+					),
+					function () {
+						frm.set_value("integration_id", "");
+					}
+				);
 			});
 		}
 	},
 
-	is_company_account: function(frm) {
-		frm.set_df_property('account', 'reqd', frm.doc.is_company_account);
-	}
+	is_company_account: function (frm) {
+		frm.set_df_property("account", "reqd", frm.doc.is_company_account);
+	},
 });
diff --git a/erpnext/accounts/doctype/bank_account_subtype/bank_account_subtype.js b/erpnext/accounts/doctype/bank_account_subtype/bank_account_subtype.js
index f045665..e8fe4e0 100644
--- a/erpnext/accounts/doctype/bank_account_subtype/bank_account_subtype.js
+++ b/erpnext/accounts/doctype/bank_account_subtype/bank_account_subtype.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Bank Account Subtype', {
-	refresh: function() {
-
-	}
+frappe.ui.form.on("Bank Account Subtype", {
+	refresh: function () {},
 });
diff --git a/erpnext/accounts/doctype/bank_account_type/bank_account_type.js b/erpnext/accounts/doctype/bank_account_type/bank_account_type.js
index 4cfabe3..1285fe4 100644
--- a/erpnext/accounts/doctype/bank_account_type/bank_account_type.js
+++ b/erpnext/accounts/doctype/bank_account_type/bank_account_type.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Bank Account Type', {
+frappe.ui.form.on("Bank Account Type", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/accounts/doctype/bank_clearance/bank_clearance.js b/erpnext/accounts/doctype/bank_clearance/bank_clearance.js
index 7af635b..2993825 100644
--- a/erpnext/accounts/doctype/bank_clearance/bank_clearance.js
+++ b/erpnext/accounts/doctype/bank_clearance/bank_clearance.js
@@ -2,80 +2,76 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.ui.form.on("Bank Clearance", {
-	setup: function(frm) {
+	setup: function (frm) {
 		frm.add_fetch("account", "account_currency", "account_currency");
 
-		frm.set_query("account", function() {
+		frm.set_query("account", function () {
 			return {
-				"filters": {
-					"account_type": ["in",["Bank","Cash"]],
-					"is_group": 0,
-				}
+				filters: {
+					account_type: ["in", ["Bank", "Cash"]],
+					is_group: 0,
+				},
 			};
 		});
 
 		frm.set_query("bank_account", function () {
 			return {
 				filters: {
-					'is_company_account': 1
+					is_company_account: 1,
 				},
 			};
 		});
 	},
 
-	onload: function(frm) {
-
-		let default_bank_account =  frappe.defaults.get_user_default("Company")?
-			locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]: "";
+	onload: function (frm) {
+		let default_bank_account = frappe.defaults.get_user_default("Company")
+			? locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]
+			: "";
 		frm.set_value("account", default_bank_account);
 
-
-
 		frm.set_value("from_date", frappe.datetime.month_start());
 		frm.set_value("to_date", frappe.datetime.month_end());
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		frm.disable_save();
-		frm.add_custom_button(__('Get Payment Entries'), () =>
-			frm.trigger("get_payment_entries")
-		);
+		frm.add_custom_button(__("Get Payment Entries"), () => frm.trigger("get_payment_entries"));
 
-		frm.change_custom_button_type(__('Get Payment Entries'), null, 'primary');
+		frm.change_custom_button_type(__("Get Payment Entries"), null, "primary");
 	},
 
-	update_clearance_date: function(frm) {
+	update_clearance_date: function (frm) {
 		return frappe.call({
 			method: "update_clearance_date",
 			doc: frm.doc,
-			callback: function(r, rt) {
+			callback: function (r, rt) {
 				frm.refresh_field("payment_entries");
 				frm.refresh_fields();
 
 				if (!frm.doc.payment_entries.length) {
-					frm.change_custom_button_type(__('Get Payment Entries'), null, 'primary');
-					frm.change_custom_button_type(__('Update Clearance Date'), null, 'default');
+					frm.change_custom_button_type(__("Get Payment Entries"), null, "primary");
+					frm.change_custom_button_type(__("Update Clearance Date"), null, "default");
 				}
-			}
+			},
 		});
 	},
 
-	get_payment_entries: function(frm) {
+	get_payment_entries: function (frm) {
 		return frappe.call({
 			method: "get_payment_entries",
 			doc: frm.doc,
-			callback: function(r, rt) {
+			callback: function (r, rt) {
 				frm.refresh_field("payment_entries");
 
 				if (frm.doc.payment_entries.length) {
-					frm.add_custom_button(__('Update Clearance Date'), () =>
+					frm.add_custom_button(__("Update Clearance Date"), () =>
 						frm.trigger("update_clearance_date")
 					);
 
-					frm.change_custom_button_type(__('Get Payment Entries'), null, 'default');
-					frm.change_custom_button_type(__('Update Clearance Date'), null, 'primary');
+					frm.change_custom_button_type(__("Get Payment Entries"), null, "default");
+					frm.change_custom_button_type(__("Update Clearance Date"), null, "primary");
 				}
-			}
+			},
 		});
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js
index 99cc0a7..060c4b5 100644
--- a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js
+++ b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js
@@ -1,39 +1,39 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-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','swift_number','swift_number');
+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", "swift_number", "swift_number");
 
-frappe.ui.form.on('Bank Guarantee', {
-	setup: function(frm) {
-		frm.set_query("bank", function() {
-			return {
-				filters: {
-					company: frm.doc.company
-				}
-			};
-		});
-		frm.set_query("bank_account", function() {
+frappe.ui.form.on("Bank Guarantee", {
+	setup: function (frm) {
+		frm.set_query("bank", function () {
 			return {
 				filters: {
 					company: frm.doc.company,
-					bank: frm.doc.bank
-				}
-			}
+				},
+			};
 		});
-		frm.set_query("project", function() {
+		frm.set_query("bank_account", function () {
 			return {
 				filters: {
-					customer: frm.doc.customer
-				}
+					company: frm.doc.company,
+					bank: frm.doc.bank,
+				},
+			};
+		});
+		frm.set_query("project", function () {
+			return {
+				filters: {
+					customer: frm.doc.customer,
+				},
 			};
 		});
 	},
 
-	bg_type: function(frm) {
+	bg_type: function (frm) {
 		if (frm.doc.bg_type == "Receiving") {
 			frm.set_value("reference_doctype", "Sales Order");
 		} else if (frm.doc.bg_type == "Providing") {
@@ -41,34 +41,33 @@
 		}
 	},
 
-	reference_docname: function(frm) {
+	reference_docname: function (frm) {
 		if (frm.doc.reference_docname && frm.doc.reference_doctype) {
 			let party_field = frm.doc.reference_doctype == "Sales Order" ? "customer" : "supplier";
 
 			frappe.call({
 				method: "erpnext.accounts.doctype.bank_guarantee.bank_guarantee.get_voucher_details",
 				args: {
-					"bank_guarantee_type": frm.doc.bg_type,
-					"reference_name": frm.doc.reference_docname
+					bank_guarantee_type: frm.doc.bg_type,
+					reference_name: frm.doc.reference_docname,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (r.message) {
 						if (r.message[party_field]) frm.set_value(party_field, r.message[party_field]);
 						if (r.message.project) frm.set_value("project", r.message.project);
 						if (r.message.grand_total) frm.set_value("amount", r.message.grand_total);
 					}
-				}
+				},
 			});
-
 		}
 	},
 
-	start_date: function(frm) {
+	start_date: function (frm) {
 		var end_date = frappe.datetime.add_days(cur_frm.doc.start_date, cur_frm.doc.validity - 1);
 		cur_frm.set_value("end_date", end_date);
 	},
-	validity: function(frm) {
+	validity: function (frm) {
 		var end_date = frappe.datetime.add_days(cur_frm.doc.start_date, cur_frm.doc.validity - 1);
 		cur_frm.set_value("end_date", end_date);
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.js b/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.js
index 1f2d6ce..a1de91f 100644
--- a/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.js
+++ b/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.js
@@ -8,21 +8,22 @@
 			return {
 				filters: {
 					company: frm.doc.company,
-					'is_company_account': 1
+					is_company_account: 1,
 				},
 			};
 		});
-		let no_bank_transactions_text =
-			`<div class="text-muted text-center">${__("No Matching Bank Transactions Found")}</div>`
+		let no_bank_transactions_text = `<div class="text-muted text-center">${__(
+			"No Matching Bank Transactions Found"
+		)}</div>`;
 		set_field_options("no_bank_transactions", no_bank_transactions_text);
 	},
 
 	onload: function (frm) {
 		// Set default filter dates
-		let today = frappe.datetime.get_today()
+		let today = frappe.datetime.get_today();
 		frm.doc.bank_statement_from_date = frappe.datetime.add_months(today, -1);
 		frm.doc.bank_statement_to_date = today;
-		frm.trigger('bank_account');
+		frm.trigger("bank_account");
 	},
 
 	filter_by_reference_date: function (frm) {
@@ -37,34 +38,27 @@
 
 	refresh: function (frm) {
 		frm.disable_save();
-		frappe.require("bank-reconciliation-tool.bundle.js", () =>
-			frm.trigger("make_reconciliation_tool")
-		);
+		frappe.require("bank-reconciliation-tool.bundle.js", () => frm.trigger("make_reconciliation_tool"));
 
 		frm.add_custom_button(__("Upload Bank Statement"), () =>
-				frappe.call({
-					method:
-						"erpnext.accounts.doctype.bank_statement_import.bank_statement_import.upload_bank_statement",
-					args: {
-						dt: frm.doc.doctype,
-						dn: frm.doc.name,
-						company: frm.doc.company,
-						bank_account: frm.doc.bank_account,
-					},
-					callback: function (r) {
-						if (!r.exc) {
-							var doc = frappe.model.sync(r.message);
-							frappe.set_route(
-								"Form",
-								doc[0].doctype,
-								doc[0].name
-							);
-						}
-					},
-				})
+			frappe.call({
+				method: "erpnext.accounts.doctype.bank_statement_import.bank_statement_import.upload_bank_statement",
+				args: {
+					dt: frm.doc.doctype,
+					dn: frm.doc.name,
+					company: frm.doc.company,
+					bank_account: frm.doc.bank_account,
+				},
+				callback: function (r) {
+					if (!r.exc) {
+						var doc = frappe.model.sync(r.message);
+						frappe.set_route("Form", doc[0].doctype, doc[0].name);
+					}
+				},
+			})
 		);
 
-		frm.add_custom_button(__('Auto Reconcile'), function() {
+		frm.add_custom_button(__("Auto Reconcile"), function () {
 			frappe.call({
 				method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.auto_reconcile_vouchers",
 				args: {
@@ -75,33 +69,22 @@
 					from_reference_date: frm.doc.from_reference_date,
 					to_reference_date: frm.doc.to_reference_date,
 				},
-			})
+			});
 		});
 
-		frm.add_custom_button(__('Get Unreconciled Entries'), function() {
+		frm.add_custom_button(__("Get Unreconciled Entries"), function () {
 			frm.trigger("make_reconciliation_tool");
 		});
-		frm.change_custom_button_type(__('Get Unreconciled Entries'), null, 'primary');
-
+		frm.change_custom_button_type(__("Get Unreconciled Entries"), null, "primary");
 	},
 
 	bank_account: function (frm) {
-		frappe.db.get_value(
-			"Bank Account",
-			frm.doc.bank_account,
-			"account",
-			(r) => {
-				frappe.db.get_value(
-					"Account",
-					r.account,
-					"account_currency",
-					(r) => {
-						frm.doc.account_currency = r.account_currency;
-						frm.trigger("render_chart");
-					}
-				);
-			}
-		);
+		frappe.db.get_value("Bank Account", frm.doc.bank_account, "account", (r) => {
+			frappe.db.get_value("Account", r.account, "account_currency", (r) => {
+				frm.doc.account_currency = r.account_currency;
+				frm.trigger("render_chart");
+			});
+		});
 		frm.trigger("get_account_opening_balance");
 	},
 
@@ -120,11 +103,7 @@
 				) {
 					frm.trigger("render_chart");
 					frm.trigger("render");
-					frappe.utils.scroll_to(
-						frm.get_field("reconciliation_tool_cards").$wrapper,
-						true,
-						30
-					);
+					frappe.utils.scroll_to(frm.get_field("reconciliation_tool_cards").$wrapper, true, 30);
 				}
 			});
 		}
@@ -133,11 +112,10 @@
 	get_account_opening_balance(frm) {
 		if (frm.doc.bank_account && frm.doc.bank_statement_from_date) {
 			frappe.call({
-				method:
-					"erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_account_balance",
+				method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_account_balance",
 				args: {
 					bank_account: frm.doc.bank_account,
-					till_date: frappe.datetime.add_days(frm.doc.bank_statement_from_date, -1)
+					till_date: frappe.datetime.add_days(frm.doc.bank_statement_from_date, -1),
 				},
 				callback: (response) => {
 					frm.set_value("account_opening_balance", response.message);
@@ -149,8 +127,7 @@
 	get_cleared_balance(frm) {
 		if (frm.doc.bank_account && frm.doc.bank_statement_to_date) {
 			return frappe.call({
-				method:
-					"erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_account_balance",
+				method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_account_balance",
 				args: {
 					bank_account: frm.doc.bank_account,
 					till_date: frm.doc.bank_statement_to_date,
@@ -163,41 +140,30 @@
 	},
 
 	render_chart(frm) {
-		frm.cards_manager = new erpnext.accounts.bank_reconciliation.NumberCardManager(
-			{
-				$reconciliation_tool_cards: frm.get_field(
-					"reconciliation_tool_cards"
-				).$wrapper,
-				bank_statement_closing_balance:
-				frm.doc.bank_statement_closing_balance,
-				cleared_balance: frm.cleared_balance,
-				currency: frm.doc.account_currency,
-			}
-		);
+		frm.cards_manager = new erpnext.accounts.bank_reconciliation.NumberCardManager({
+			$reconciliation_tool_cards: frm.get_field("reconciliation_tool_cards").$wrapper,
+			bank_statement_closing_balance: frm.doc.bank_statement_closing_balance,
+			cleared_balance: frm.cleared_balance,
+			currency: frm.doc.account_currency,
+		});
 	},
 
 	render(frm) {
 		if (frm.doc.bank_account) {
-			frm.bank_reconciliation_data_table_manager = new erpnext.accounts.bank_reconciliation.DataTableManager(
-				{
+			frm.bank_reconciliation_data_table_manager =
+				new erpnext.accounts.bank_reconciliation.DataTableManager({
 					company: frm.doc.company,
 					bank_account: frm.doc.bank_account,
-					$reconciliation_tool_dt: frm.get_field(
-						"reconciliation_tool_dt"
-					).$wrapper,
-					$no_bank_transactions: frm.get_field(
-						"no_bank_transactions"
-					).$wrapper,
+					$reconciliation_tool_dt: frm.get_field("reconciliation_tool_dt").$wrapper,
+					$no_bank_transactions: frm.get_field("no_bank_transactions").$wrapper,
 					bank_statement_from_date: frm.doc.bank_statement_from_date,
 					bank_statement_to_date: frm.doc.bank_statement_to_date,
 					filter_by_reference_date: frm.doc.filter_by_reference_date,
 					from_reference_date: frm.doc.from_reference_date,
 					to_reference_date: frm.doc.to_reference_date,
-					bank_statement_closing_balance:
-						frm.doc.bank_statement_closing_balance,
+					bank_statement_closing_balance: frm.doc.bank_statement_closing_balance,
 					cards_manager: frm.cards_manager,
-				}
-			);
+				});
 		}
 	},
 });
diff --git a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js
index db68dfa..c4b4420 100644
--- a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js
+++ b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js
@@ -17,11 +17,9 @@
 			frm.import_in_progress = false;
 			if (data_import !== frm.doc.name) return;
 			frappe.model.clear_doc("Bank Statement Import", frm.doc.name);
-			frappe.model
-				.with_doc("Bank Statement Import", frm.doc.name)
-				.then(() => {
-					frm.refresh();
-				});
+			frappe.model.with_doc("Bank Statement Import", frm.doc.name).then(() => {
+				frm.refresh();
+			});
 		});
 		frappe.realtime.on("data_import_progress", (data) => {
 			frm.import_in_progress = true;
@@ -48,20 +46,9 @@
 						: __("Updating {0} of {1}, {2}", message_args);
 			}
 			if (data.skipping) {
-				message = __(
-					"Skipping {0} of {1}, {2}",
-					[
-						data.current,
-						data.total,
-						eta_message,
-					]
-				);
+				message = __("Skipping {0} of {1}, {2}", [data.current, data.total, eta_message]);
 			}
-			frm.dashboard.show_progress(
-				__("Import Progress"),
-				percent,
-				message
-			);
+			frm.dashboard.show_progress(__("Import Progress"), percent, message);
 			frm.page.set_indicator(__("In Progress"), "orange");
 
 			// hide progress when complete
@@ -103,15 +90,12 @@
 		frm.trigger("show_report_error_button");
 
 		if (frm.doc.status === "Partial Success") {
-			frm.add_custom_button(__("Export Errored Rows"), () =>
-				frm.trigger("export_errored_rows")
-			);
+			frm.add_custom_button(__("Export Errored Rows"), () => frm.trigger("export_errored_rows"));
 		}
 
 		if (frm.doc.status.includes("Success")) {
-			frm.add_custom_button(
-				__("Go to {0} List", [__(frm.doc.reference_doctype)]),
-				() => frappe.set_route("List", frm.doc.reference_doctype)
+			frm.add_custom_button(__("Go to {0} List", [__(frm.doc.reference_doctype)]), () =>
+				frappe.set_route("List", frm.doc.reference_doctype)
 			);
 		}
 	},
@@ -128,13 +112,8 @@
 		frm.disable_save();
 		if (frm.doc.status !== "Success") {
 			if (!frm.is_new() && frm.has_import_file()) {
-				let label =
-					frm.doc.status === "Pending"
-						? __("Start Import")
-						: __("Retry");
-				frm.page.set_primary_action(label, () =>
-					frm.events.start_import(frm)
-				);
+				let label = frm.doc.status === "Pending" ? __("Start Import") : __("Retry");
+				frm.page.set_primary_action(label, () => frm.events.start_import(frm));
 			} else {
 				frm.page.set_primary_action(__("Save"), () => frm.save());
 			}
@@ -176,24 +155,24 @@
 				message =
 					successful_records.length > 1
 						? __(
-							"Successfully imported {0} records out of {1}. Click on Export Errored Rows, fix the errors and import again.",
-							message_args
-						)
+								"Successfully imported {0} records out of {1}. Click on Export Errored Rows, fix the errors and import again.",
+								message_args
+						  )
 						: __(
-							"Successfully imported {0} record out of {1}. Click on Export Errored Rows, fix the errors and import again.",
-							message_args
-						);
+								"Successfully imported {0} record out of {1}. Click on Export Errored Rows, fix the errors and import again.",
+								message_args
+						  );
 			} else {
 				message =
 					successful_records.length > 1
 						? __(
-							"Successfully updated {0} records out of {1}. Click on Export Errored Rows, fix the errors and import again.",
-							message_args
-						)
+								"Successfully updated {0} records out of {1}. Click on Export Errored Rows, fix the errors and import again.",
+								message_args
+						  )
 						: __(
-							"Successfully updated {0} record out of {1}. Click on Export Errored Rows, fix the errors and import again.",
-							message_args
-						);
+								"Successfully updated {0} record out of {1}. Click on Export Errored Rows, fix the errors and import again.",
+								message_args
+						  );
 			}
 		}
 		frm.dashboard.set_headline(message);
@@ -236,8 +215,7 @@
 	},
 
 	download_template() {
-		let method =
-			"/api/method/frappe.core.doctype.data_import.data_import.download_template";
+		let method = "/api/method/frappe.core.doctype.data_import.data_import.download_template";
 
 		open_url_post(method, {
 			doctype: "Bank Transaction",
@@ -250,7 +228,7 @@
 					"description",
 					"reference_number",
 					"bank_account",
-					"currency"
+					"currency",
 				],
 			},
 		});
@@ -321,10 +299,7 @@
 	show_import_preview(frm, preview_data) {
 		let import_log = JSON.parse(frm.doc.statement_import_log || "[]");
 
-		if (
-			frm.import_preview &&
-			frm.import_preview.doctype === frm.doc.reference_doctype
-		) {
+		if (frm.import_preview && frm.import_preview.doctype === frm.doc.reference_doctype) {
 			frm.import_preview.preview_data = preview_data;
 			frm.import_preview.import_log = import_log;
 			frm.import_preview.refresh();
@@ -340,19 +315,10 @@
 				frm,
 				events: {
 					remap_column(changed_map) {
-						let template_options = JSON.parse(
-							frm.doc.template_options || "{}"
-						);
-						template_options.column_to_field_map =
-							template_options.column_to_field_map || {};
-						Object.assign(
-							template_options.column_to_field_map,
-							changed_map
-						);
-						frm.set_value(
-							"template_options",
-							JSON.stringify(template_options)
-						);
+						let template_options = JSON.parse(frm.doc.template_options || "{}");
+						template_options.column_to_field_map = template_options.column_to_field_map || {};
+						Object.assign(template_options.column_to_field_map, changed_map);
+						frm.set_value("template_options", JSON.stringify(template_options));
 						frm.save().then(() => frm.trigger("import_file"));
 					},
 				},
@@ -386,8 +352,7 @@
 		let other_warnings = [];
 		for (let warning of warnings) {
 			if (warning.row) {
-				warnings_by_row[warning.row] =
-					warnings_by_row[warning.row] || [];
+				warnings_by_row[warning.row] = warnings_by_row[warning.row] || [];
 				warnings_by_row[warning.row].push(warning);
 			} else {
 				other_warnings.push(warning);
@@ -402,9 +367,7 @@
 						if (w.field) {
 							let label =
 								w.field.label +
-								(w.field.parent !== frm.doc.reference_doctype
-									? ` (${w.field.parent})`
-									: "");
+								(w.field.parent !== frm.doc.reference_doctype ? ` (${w.field.parent})` : "");
 							return `<li>${label}: ${w.message}</li>`;
 						}
 						return `<li>${w.message}</li>`;
@@ -423,10 +386,9 @@
 			.map((warning) => {
 				let header = "";
 				if (warning.col) {
-					let column_number = `<span class="text-uppercase">${__(
-						"Column {0}",
-						[warning.col]
-					)}</span>`;
+					let column_number = `<span class="text-uppercase">${__("Column {0}", [
+						warning.col,
+					])}</span>`;
 					let column_header = columns[warning.col].header_title;
 					header = `${column_number} (${column_header})`;
 				}
@@ -465,36 +427,28 @@
 				let html = "";
 				if (log.success) {
 					if (frm.doc.import_type === "Insert New Records") {
-						html = __(
-							"Successfully imported {0}", [
-								`<span class="underline">${frappe.utils.get_form_link(
-									frm.doc.reference_doctype,
-									log.docname,
-									true
-								)}<span>`,
-							]
-						);
+						html = __("Successfully imported {0}", [
+							`<span class="underline">${frappe.utils.get_form_link(
+								frm.doc.reference_doctype,
+								log.docname,
+								true
+							)}<span>`,
+						]);
 					} else {
-						html = __(
-							"Successfully updated {0}", [
-								`<span class="underline">${frappe.utils.get_form_link(
-									frm.doc.reference_doctype,
-									log.docname,
-									true
-								)}<span>`,
-							]
-						);
+						html = __("Successfully updated {0}", [
+							`<span class="underline">${frappe.utils.get_form_link(
+								frm.doc.reference_doctype,
+								log.docname,
+								true
+							)}<span>`,
+						]);
 					}
 				} else {
 					let messages = log.messages
 						.map(JSON.parse)
 						.map((m) => {
-							let title = m.title
-								? `<strong>${m.title}</strong>`
-								: "";
-							let message = m.message
-								? `<div>${m.message}</div>`
-								: "";
+							let title = m.title ? `<strong>${m.title}</strong>` : "";
+							let message = m.message ? `<div>${m.message}</div>` : "";
 							return title + message;
 						})
 						.join("");
diff --git a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import_list.js b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import_list.js
index 6c75402..4ab65ff 100644
--- a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import_list.js
+++ b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import_list.js
@@ -1,36 +1,34 @@
 let imports_in_progress = [];
 
-frappe.listview_settings['Bank Statement Import'] = {
+frappe.listview_settings["Bank Statement Import"] = {
 	onload(listview) {
-		frappe.realtime.on('data_import_progress', data => {
+		frappe.realtime.on("data_import_progress", (data) => {
 			if (!imports_in_progress.includes(data.data_import)) {
 				imports_in_progress.push(data.data_import);
 			}
 		});
-		frappe.realtime.on('data_import_refresh', data => {
-			imports_in_progress = imports_in_progress.filter(
-				d => d !== data.data_import
-			);
+		frappe.realtime.on("data_import_refresh", (data) => {
+			imports_in_progress = imports_in_progress.filter((d) => d !== data.data_import);
 			listview.refresh();
 		});
 	},
-	get_indicator: function(doc) {
+	get_indicator: function (doc) {
 		var colors = {
-			'Pending': 'orange',
-			'Not Started': 'orange',
-			'Partial Success': 'orange',
-			'Success': 'green',
-			'In Progress': 'orange',
-			'Error': 'red'
+			Pending: "orange",
+			"Not Started": "orange",
+			"Partial Success": "orange",
+			Success: "green",
+			"In Progress": "orange",
+			Error: "red",
 		};
 		let status = doc.status;
 		if (imports_in_progress.includes(doc.name)) {
-			status = 'In Progress';
+			status = "In Progress";
 		}
-		if (status == 'Pending') {
-			status = 'Not Started';
+		if (status == "Pending") {
+			status = "Not Started";
 		}
-		return [__(status), colors[status], 'status,=,' + doc.status];
+		return [__(status), colors[status], "status,=," + doc.status];
 	},
-	hide_name_column: true
+	hide_name_column: true,
 };
diff --git a/erpnext/accounts/doctype/bank_transaction/bank_transaction.js b/erpnext/accounts/doctype/bank_transaction/bank_transaction.js
index b3cc1cb..d899d42 100644
--- a/erpnext/accounts/doctype/bank_transaction/bank_transaction.js
+++ b/erpnext/accounts/doctype/bank_transaction/bank_transaction.js
@@ -3,7 +3,7 @@
 
 frappe.ui.form.on("Bank Transaction", {
 	onload(frm) {
-		frm.set_query("payment_document", "payment_entries", function() {
+		frm.set_query("payment_document", "payment_entries", function () {
 			const payment_doctypes = frm.events.get_payment_doctypes(frm);
 			return {
 				filters: {
@@ -23,7 +23,7 @@
 		set_bank_statement_filter(frm);
 	},
 
-	setup: function(frm) {
+	setup: function (frm) {
 		frm.set_query("party_type", function () {
 			return {
 				filters: {
@@ -33,16 +33,10 @@
 		});
 	},
 
-	get_payment_doctypes: function() {
+	get_payment_doctypes: function () {
 		// get payment doctypes from all the apps
-		return [
-			"Payment Entry",
-			"Journal Entry",
-			"Sales Invoice",
-			"Purchase Invoice",
-			"Bank Transaction",
-		];
-	}
+		return ["Payment Entry", "Journal Entry", "Sales Invoice", "Purchase Invoice", "Bank Transaction"];
+	},
 });
 
 frappe.ui.form.on("Bank Transaction Payments", {
@@ -54,10 +48,11 @@
 const update_clearance_date = (frm, cdt, cdn) => {
 	if (frm.doc.docstatus === 1) {
 		frappe
-			.xcall(
-				"erpnext.accounts.doctype.bank_transaction.bank_transaction.unclear_reference_payment",
-				{ doctype: cdt, docname: cdn, bt_name: frm.doc.name }
-			)
+			.xcall("erpnext.accounts.doctype.bank_transaction.bank_transaction.unclear_reference_payment", {
+				doctype: cdt,
+				docname: cdn,
+				bt_name: frm.doc.name,
+			})
 			.then((e) => {
 				if (e == "success") {
 					frappe.show_alert({
diff --git a/erpnext/accounts/doctype/bank_transaction/bank_transaction_list.js b/erpnext/accounts/doctype/bank_transaction/bank_transaction_list.js
index 2585ee9..9942c09 100644
--- a/erpnext/accounts/doctype/bank_transaction/bank_transaction_list.js
+++ b/erpnext/accounts/doctype/bank_transaction/bank_transaction_list.js
@@ -1,15 +1,15 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.listview_settings['Bank Transaction'] = {
+frappe.listview_settings["Bank Transaction"] = {
 	add_fields: ["unallocated_amount"],
-	get_indicator: function(doc) {
-		if(doc.docstatus == 2) {
+	get_indicator: function (doc) {
+		if (doc.docstatus == 2) {
 			return [__("Cancelled"), "red", "docstatus,=,2"];
-		} else if(flt(doc.unallocated_amount)<=0) {
+		} else if (flt(doc.unallocated_amount) <= 0) {
 			return [__("Reconciled"), "green", "unallocated_amount,=,0"];
-		} else if(flt(doc.unallocated_amount)>0) {
+		} else if (flt(doc.unallocated_amount) > 0) {
 			return [__("Unreconciled"), "orange", "unallocated_amount,>,0"];
 		}
-	}
+	},
 };
diff --git a/erpnext/accounts/doctype/bisect_accounting_statements/bisect_accounting_statements.js b/erpnext/accounts/doctype/bisect_accounting_statements/bisect_accounting_statements.js
index ece0fb3..f3532e5 100644
--- a/erpnext/accounts/doctype/bisect_accounting_statements/bisect_accounting_statements.js
+++ b/erpnext/accounts/doctype/bisect_accounting_statements/bisect_accounting_statements.js
@@ -6,18 +6,18 @@
 		frm.trigger("render_heatmap");
 	},
 	refresh(frm) {
-		frm.add_custom_button(__('Bisect Left'), () => {
+		frm.add_custom_button(__("Bisect Left"), () => {
 			frm.trigger("bisect_left");
 		});
 
-		frm.add_custom_button(__('Bisect Right'), () => {
+		frm.add_custom_button(__("Bisect Right"), () => {
 			frm.trigger("bisect_right");
 		});
 
-		frm.add_custom_button(__('Up'), () => {
+		frm.add_custom_button(__("Up"), () => {
 			frm.trigger("move_up");
 		});
-		frm.add_custom_button(__('Build Tree'), () => {
+		frm.add_custom_button(__("Build Tree"), () => {
 			frm.trigger("build_tree");
 		});
 	},
@@ -26,16 +26,16 @@
 		bisect_heatmap.addClass("bisect_heatmap_location");
 
 		// milliseconds in a day
-		let msiad=24*60*60*1000;
+		let msiad = 24 * 60 * 60 * 1000;
 		let datapoints = {};
 		let fr_dt = new Date(frm.doc.from_date).getTime();
 		let to_dt = new Date(frm.doc.to_date).getTime();
 		let bisect_start = new Date(frm.doc.current_from_date).getTime();
 		let bisect_end = new Date(frm.doc.current_to_date).getTime();
 
-		for(let x=fr_dt; x <= to_dt; x+=msiad){
-			let epoch_in_seconds = x/1000;
-			if ((bisect_start <= x) && (x <= bisect_end )) {
+		for (let x = fr_dt; x <= to_dt; x += msiad) {
+			let epoch_in_seconds = x / 1000;
+			if (bisect_start <= x && x <= bisect_end) {
 				datapoints[epoch_in_seconds] = 1.0;
 			} else {
 				datapoints[epoch_in_seconds] = 0.0;
@@ -49,19 +49,19 @@
 				start: new Date(frm.doc.from_date),
 				end: new Date(frm.doc.to_date),
 			},
-			countLabel: 'Bisecting',
+			countLabel: "Bisecting",
 			discreteDomains: 1,
 		});
 	},
 	bisect_left(frm) {
 		frm.call({
 			doc: frm.doc,
-			method: 'bisect_left',
+			method: "bisect_left",
 			freeze: true,
 			freeze_message: __("Bisecting Left ..."),
 			callback: (r) => {
 				frm.trigger("render_heatmap");
-			}
+			},
 		});
 	},
 	bisect_right(frm) {
@@ -69,10 +69,10 @@
 			doc: frm.doc,
 			freeze: true,
 			freeze_message: __("Bisecting Right ..."),
-			method: 'bisect_right',
+			method: "bisect_right",
 			callback: (r) => {
 				frm.trigger("render_heatmap");
-			}
+			},
 		});
 	},
 	move_up(frm) {
@@ -80,10 +80,10 @@
 			doc: frm.doc,
 			freeze: true,
 			freeze_message: __("Moving up in tree ..."),
-			method: 'move_up',
+			method: "move_up",
 			callback: (r) => {
 				frm.trigger("render_heatmap");
-			}
+			},
 		});
 	},
 	build_tree(frm) {
@@ -91,10 +91,10 @@
 			doc: frm.doc,
 			freeze: true,
 			freeze_message: __("Rebuilding BTree for period ..."),
-			method: 'build_tree',
+			method: "build_tree",
 			callback: (r) => {
 				frm.trigger("render_heatmap");
-			}
+			},
 		});
 	},
 });
diff --git a/erpnext/accounts/doctype/bisect_accounting_statements/bisect_accounting_statements.py b/erpnext/accounts/doctype/bisect_accounting_statements/bisect_accounting_statements.py
index da273b9..e9860a5 100644
--- a/erpnext/accounts/doctype/bisect_accounting_statements/bisect_accounting_statements.py
+++ b/erpnext/accounts/doctype/bisect_accounting_statements/bisect_accounting_statements.py
@@ -138,10 +138,11 @@
 
 		# set root as current node
 		root = frappe.db.get_all("Bisect Nodes", filters={"root": ["is", "not set"]})[0]
-		self.get_report_summary()
 		self.current_node = root.name
 		self.current_from_date = self.from_date
 		self.current_to_date = self.to_date
+
+		self.get_report_summary()
 		self.save()
 
 	def get_report_summary(self):
diff --git a/erpnext/accounts/doctype/budget/budget.js b/erpnext/accounts/doctype/budget/budget.js
index e162e32..6e874f7 100644
--- a/erpnext/accounts/doctype/budget/budget.js
+++ b/erpnext/accounts/doctype/budget/budget.js
@@ -2,48 +2,48 @@
 // For license information, please see license.txt
 frappe.provide("erpnext.accounts.dimensions");
 
-frappe.ui.form.on('Budget', {
-	onload: function(frm) {
-		frm.set_query("account", "accounts", function() {
+frappe.ui.form.on("Budget", {
+	onload: function (frm) {
+		frm.set_query("account", "accounts", function () {
 			return {
 				filters: {
 					company: frm.doc.company,
 					report_type: "Profit and Loss",
-					is_group: 0
-				}
+					is_group: 0,
+				},
 			};
 		});
 
-		frm.set_query("monthly_distribution", function() {
+		frm.set_query("monthly_distribution", function () {
 			return {
 				filters: {
-					fiscal_year: frm.doc.fiscal_year
-				}
+					fiscal_year: frm.doc.fiscal_year,
+				},
 			};
 		});
 
 		erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
 	},
 
-	refresh: function(frm) {
-		frm.trigger("toggle_reqd_fields")
+	refresh: function (frm) {
+		frm.trigger("toggle_reqd_fields");
 	},
 
-	budget_against: function(frm) {
-		frm.trigger("set_null_value")
-		frm.trigger("toggle_reqd_fields")
+	budget_against: function (frm) {
+		frm.trigger("set_null_value");
+		frm.trigger("toggle_reqd_fields");
 	},
 
-	set_null_value: function(frm) {
-		if(frm.doc.budget_against == 'Cost Center') {
-			frm.set_value('project', null)
+	set_null_value: function (frm) {
+		if (frm.doc.budget_against == "Cost Center") {
+			frm.set_value("project", null);
 		} else {
-			frm.set_value('cost_center', null)
+			frm.set_value("cost_center", null);
 		}
 	},
 
-	toggle_reqd_fields: function(frm) {
-		frm.toggle_reqd("cost_center", frm.doc.budget_against=="Cost Center");
-		frm.toggle_reqd("project", frm.doc.budget_against=="Project");
-	}
+	toggle_reqd_fields: function (frm) {
+		frm.toggle_reqd("cost_center", frm.doc.budget_against == "Cost Center");
+		frm.toggle_reqd("project", frm.doc.budget_against == "Project");
+	},
 });
diff --git a/erpnext/accounts/doctype/cashier_closing/cashier_closing.js b/erpnext/accounts/doctype/cashier_closing/cashier_closing.js
index ce791e4..71664b7 100644
--- a/erpnext/accounts/doctype/cashier_closing/cashier_closing.js
+++ b/erpnext/accounts/doctype/cashier_closing/cashier_closing.js
@@ -1,11 +1,10 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.ui.form.on('Cashier Closing', {
-
-	setup: function(frm){
+frappe.ui.form.on("Cashier Closing", {
+	setup: function (frm) {
 		if (frm.doc.user == "" || frm.doc.user == null) {
 			frm.doc.user = frappe.session.user;
 		}
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.js b/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.js
index 56fa6ce..1d8bb85 100644
--- a/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.js
+++ b/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.js
@@ -1,4 +1,4 @@
-frappe.ui.form.on('Chart of Accounts Importer', {
+frappe.ui.form.on("Chart of Accounts Importer", {
 	onload: function (frm) {
 		frm.set_value("company", "");
 		frm.set_value("import_file", "");
@@ -8,31 +8,34 @@
 		frm.disable_save();
 
 		// make company mandatory
-		frm.set_df_property('company', 'reqd', frm.doc.company ? 0 : 1);
-		frm.set_df_property('import_file_section', 'hidden', frm.doc.company ? 0 : 1);
+		frm.set_df_property("company", "reqd", frm.doc.company ? 0 : 1);
+		frm.set_df_property("import_file_section", "hidden", frm.doc.company ? 0 : 1);
 
 		if (frm.doc.import_file) {
 			frappe.run_serially([
 				() => generate_tree_preview(frm),
 				() => create_import_button(frm),
-				() => frm.set_df_property('chart_preview', 'hidden', 0)
+				() => frm.set_df_property("chart_preview", "hidden", 0),
 			]);
 		}
 
-		frm.set_df_property('chart_preview', 'hidden',
-			$(frm.fields_dict['chart_tree'].wrapper).html()!="" ? 0 : 1);
+		frm.set_df_property(
+			"chart_preview",
+			"hidden",
+			$(frm.fields_dict["chart_tree"].wrapper).html() != "" ? 0 : 1
+		);
 	},
 
-	download_template: function(frm) {
+	download_template: function (frm) {
 		var d = new frappe.ui.Dialog({
 			title: __("Download Template"),
 			fields: [
 				{
-					label : "File Type",
+					label: "File Type",
 					fieldname: "file_type",
 					fieldtype: "Select",
 					reqd: 1,
-					options: ["Excel", "CSV"]
+					options: ["Excel", "CSV"],
 				},
 				{
 					label: "Template Type",
@@ -41,21 +44,27 @@
 					reqd: 1,
 					options: ["Sample Template", "Blank Template"],
 					change: () => {
-						let template_type = d.get_value('template_type');
+						let template_type = d.get_value("template_type");
 
 						if (template_type === "Sample Template") {
-							d.set_df_property('template_type', 'description',
+							d.set_df_property(
+								"template_type",
+								"description",
 								`The Sample Template contains all the required accounts pre filled in the  template.
-								You can add more accounts or change existing accounts in the template as per your choice.`);
+								You can add more accounts or change existing accounts in the template as per your choice.`
+							);
 						} else {
-							d.set_df_property('template_type', 'description',
+							d.set_df_property(
+								"template_type",
+								"description",
 								`The Blank Template contains just the account type and root type required to build the Chart
-								of Accounts. Please enter the account names and add more rows as per your requirement.`);
+								of Accounts. Please enter the account names and add more rows as per your requirement.`
+							);
 						}
-					}
+					},
 				},
 				{
-					label : "Company",
+					label: "Company",
 					fieldname: "company",
 					fieldtype: "Link",
 					reqd: 1,
@@ -63,25 +72,25 @@
 					default: frm.doc.company,
 				},
 			],
-			primary_action: function() {
+			primary_action: function () {
 				let data = d.get_values();
 
 				if (!data.template_type) {
-					frappe.throw(__('Please select <b>Template Type</b> to download template'));
+					frappe.throw(__("Please select <b>Template Type</b> to download template"));
 				}
 
 				open_url_post(
-					'/api/method/erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.download_template',
+					"/api/method/erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.download_template",
 					{
 						file_type: data.file_type,
 						template_type: data.template_type,
-						company: data.company
+						company: data.company,
 					}
 				);
 
 				d.hide();
 			},
-			primary_action_label: __('Download')
+			primary_action_label: __("Download"),
 		});
 		d.show();
 	},
@@ -89,7 +98,7 @@
 	import_file: function (frm) {
 		if (!frm.doc.import_file) {
 			frm.page.set_indicator("");
-			$(frm.fields_dict['chart_tree'].wrapper).empty(); // empty wrapper on removing file
+			$(frm.fields_dict["chart_tree"].wrapper).empty(); // empty wrapper on removing file
 		}
 	},
 
@@ -99,89 +108,97 @@
 			frappe.call({
 				method: "erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.validate_company",
 				args: {
-					company: frm.doc.company
+					company: frm.doc.company,
 				},
-				callback: function(r) {
-					if(r.message===false) {
+				callback: function (r) {
+					if (r.message === false) {
 						frm.set_value("company", "");
-						frappe.throw(__("Transactions against the Company already exist! Chart of Accounts can only be imported for a Company with no transactions."));
+						frappe.throw(
+							__(
+								"Transactions against the Company already exist! Chart of Accounts can only be imported for a Company with no transactions."
+							)
+						);
 					} else {
 						frm.trigger("refresh");
 					}
-				}
+				},
 			});
 		}
-	}
+	},
 });
 
-var create_import_button = function(frm) {
-	frm.page.set_primary_action(__("Import"), function () {
+var create_import_button = function (frm) {
+	frm.page
+		.set_primary_action(__("Import"), function () {
+			return frappe.call({
+				method: "erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.import_coa",
+				args: {
+					file_name: frm.doc.import_file,
+					company: frm.doc.company,
+				},
+				freeze: true,
+				freeze_message: __("Creating Accounts..."),
+				callback: function (r) {
+					if (!r.exc) {
+						clearInterval(frm.page["interval"]);
+						frm.page.set_indicator(__("Import Successful"), "blue");
+						create_reset_button(frm);
+					}
+				},
+			});
+		})
+		.addClass("btn btn-primary");
+};
+
+var create_reset_button = function (frm) {
+	frm.page
+		.set_primary_action(__("Reset"), function () {
+			frm.page.clear_primary_action();
+			delete frm.page["show_import_button"];
+			frm.reload_doc();
+		})
+		.addClass("btn btn-primary");
+};
+
+var validate_coa = function (frm) {
+	if (frm.doc.import_file) {
+		let parent = __("All Accounts");
 		return frappe.call({
-			method: "erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.import_coa",
+			method: "erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.get_coa",
 			args: {
 				file_name: frm.doc.import_file,
-				company: frm.doc.company
-			},
-			freeze: true,
-			freeze_message: __("Creating Accounts..."),
-			callback: function(r) {
-				if (!r.exc) {
-					clearInterval(frm.page["interval"]);
-					frm.page.set_indicator(__('Import Successful'), 'blue');
-					create_reset_button(frm);
-				}
-			}
-		});
-	}).addClass('btn btn-primary');
-};
-
-var create_reset_button = function(frm) {
-	frm.page.set_primary_action(__("Reset"), function () {
-		frm.page.clear_primary_action();
-		delete frm.page["show_import_button"];
-		frm.reload_doc();
-	}).addClass('btn btn-primary');
-};
-
-var validate_coa = function(frm) {
-	if (frm.doc.import_file) {
-		let parent = __('All Accounts');
-		return frappe.call({
-			'method': 'erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.get_coa',
-			'args': {
-				file_name: frm.doc.import_file,
 				parent: parent,
-				doctype: 'Chart of Accounts Importer',
+				doctype: "Chart of Accounts Importer",
 				file_type: frm.doc.file_type,
-				for_validate: 1
+				for_validate: 1,
 			},
-			callback: function(r) {
-				if (r.message['show_import_button']) {
-					frm.page['show_import_button'] = Boolean(r.message['show_import_button']);
+			callback: function (r) {
+				if (r.message["show_import_button"]) {
+					frm.page["show_import_button"] = Boolean(r.message["show_import_button"]);
 				}
-			}
+			},
 		});
 	}
 };
 
-var generate_tree_preview = function(frm) {
-	let parent = __('All Accounts');
-	$(frm.fields_dict['chart_tree'].wrapper).empty(); // empty wrapper to load new data
+var generate_tree_preview = function (frm) {
+	let parent = __("All Accounts");
+	$(frm.fields_dict["chart_tree"].wrapper).empty(); // empty wrapper to load new data
 
 	// generate tree structure based on the csv data
 	return new frappe.ui.Tree({
-		parent: $(frm.fields_dict['chart_tree'].wrapper),
+		parent: $(frm.fields_dict["chart_tree"].wrapper),
 		label: parent,
 		expandable: true,
-		method: 'erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.get_coa',
+		method: "erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.get_coa",
 		args: {
 			file_name: frm.doc.import_file,
 			parent: parent,
-			doctype: 'Chart of Accounts Importer',
-			file_type: frm.doc.file_type
+			doctype: "Chart of Accounts Importer",
+			file_type: frm.doc.file_type,
 		},
-		onclick: function(node) {
+		onclick: function (node) {
 			parent = node.value;
-		}
+		},
 	});
 };
diff --git a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js
index d10c618..17cb8d0 100644
--- a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js
+++ b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js
@@ -3,18 +3,20 @@
 
 frappe.provide("erpnext.cheque_print");
 
-frappe.ui.form.on('Cheque Print Template', {
-	refresh: function(frm) {
-		if(!frm.doc.__islocal) {
-			frm.add_custom_button(frm.doc.has_print_format?__("Update Print Format"):__("Create Print Format"),
-				function() {
+frappe.ui.form.on("Cheque Print Template", {
+	refresh: function (frm) {
+		if (!frm.doc.__islocal) {
+			frm.add_custom_button(
+				frm.doc.has_print_format ? __("Update Print Format") : __("Create Print Format"),
+				function () {
 					erpnext.cheque_print.view_cheque_print(frm);
-				}).addClass("btn-primary");
+				}
+			).addClass("btn-primary");
 
-			$(frm.fields_dict.cheque_print_preview.wrapper).empty()
+			$(frm.fields_dict.cheque_print_preview.wrapper).empty();
 
-
-			var template = '<div style="position: relative; overflow-x: scroll;">\
+			var template =
+				'<div style="position: relative; overflow-x: scroll;">\
 				<div id="cheque_preview" style="width: {{ cheque_width }}cm; \
 					height: {{ cheque_height }}cm;\
 					background-repeat: no-repeat;\
@@ -48,30 +50,30 @@
 				</div>\
 			</div>';
 
-			$(frappe.render(template, frm.doc)).appendTo(frm.fields_dict.cheque_print_preview.wrapper)
+			$(frappe.render(template, frm.doc)).appendTo(frm.fields_dict.cheque_print_preview.wrapper);
 
 			if (frm.doc.scanned_cheque) {
-				$(frm.fields_dict.cheque_print_preview.wrapper).find("#cheque_preview").css('background-image', 'url(' + frm.doc.scanned_cheque + ')');
+				$(frm.fields_dict.cheque_print_preview.wrapper)
+					.find("#cheque_preview")
+					.css("background-image", "url(" + frm.doc.scanned_cheque + ")");
 			}
 		}
-	}
+	},
 });
 
-
-erpnext.cheque_print.view_cheque_print = function(frm) {
+erpnext.cheque_print.view_cheque_print = function (frm) {
 	frappe.call({
 		method: "erpnext.accounts.doctype.cheque_print_template.cheque_print_template.create_or_update_cheque_print_format",
-		args:{
-			"template_name": frm.doc.name
+		args: {
+			template_name: frm.doc.name,
 		},
-		callback: function(r) {
+		callback: function (r) {
 			if (!r.exe && !frm.doc.has_print_format) {
 				var doc = frappe.model.sync(r.message);
 				frappe.set_route("Form", r.message.doctype, r.message.name);
+			} else {
+				frappe.msgprint(__("Print settings updated in respective print format"));
 			}
-			else {
-				frappe.msgprint(__("Print settings updated in respective print format"))
-			}
-		}
-	})
-}
+		},
+	});
+};
diff --git a/erpnext/accounts/doctype/cost_center/cost_center.js b/erpnext/accounts/doctype/cost_center/cost_center.js
index c427cc8..7ccc802 100644
--- a/erpnext/accounts/doctype/cost_center/cost_center.js
+++ b/erpnext/accounts/doctype/cost_center/cost_center.js
@@ -3,75 +3,80 @@
 
 frappe.provide("erpnext.accounts");
 
-
-
-frappe.ui.form.on('Cost Center', {
-	onload: function(frm) {
-		frm.set_query("parent_cost_center", function() {
+frappe.ui.form.on("Cost Center", {
+	onload: function (frm) {
+		frm.set_query("parent_cost_center", function () {
 			return {
 				filters: {
 					company: frm.doc.company,
-					is_group: 1
-				}
-			}
+					is_group: 1,
+				},
+			};
 		});
 	},
-	refresh: function(frm) {
+	refresh: function (frm) {
 		if (!frm.is_new()) {
-			frm.add_custom_button(__('Update Cost Center Name / Number'), function () {
+			frm.add_custom_button(__("Update Cost Center Name / Number"), function () {
 				frm.trigger("update_cost_center_number");
 			});
 		}
 
-		let intro_txt = '';
+		let intro_txt = "";
 		let doc = frm.doc;
-		frm.toggle_display('cost_center_name', doc.__islocal);
-		frm.toggle_enable(['is_group', 'company'], doc.__islocal);
+		frm.toggle_display("cost_center_name", doc.__islocal);
+		frm.toggle_enable(["is_group", "company"], doc.__islocal);
 
-		if(!doc.__islocal && doc.is_group==1) {
-			intro_txt += __('Note: This Cost Center is a Group. Cannot make accounting entries against groups.');
+		if (!doc.__islocal && doc.is_group == 1) {
+			intro_txt += __(
+				"Note: This Cost Center is a Group. Cannot make accounting entries against groups."
+			);
 		}
 
 		frm.events.hide_unhide_group_ledger(frm);
 
-		frm.toggle_display('sb1', doc.is_group==0);
+		frm.toggle_display("sb1", doc.is_group == 0);
 		frm.set_intro(intro_txt);
 
-		if(!frm.doc.__islocal) {
-			frm.add_custom_button(__('Chart of Cost Centers'),
-				function() { frappe.set_route("Tree", "Cost Center"); });
+		if (!frm.doc.__islocal) {
+			frm.add_custom_button(__("Chart of Cost Centers"), function () {
+				frappe.set_route("Tree", "Cost Center");
+			});
 
-			frm.add_custom_button(__('Budget'),
-				function() { frappe.set_route("List", "Budget", {'cost_center': frm.doc.name}); });
+			frm.add_custom_button(__("Budget"), function () {
+				frappe.set_route("List", "Budget", { cost_center: frm.doc.name });
+			});
 		}
 	},
-	update_cost_center_number: function(frm) {
+	update_cost_center_number: function (frm) {
 		var d = new frappe.ui.Dialog({
-			title: __('Update Cost Center Name / Number'),
+			title: __("Update Cost Center Name / Number"),
 			fields: [
 				{
-					"label": "Cost Center Name",
-					"fieldname": "cost_center_name",
-					"fieldtype": "Data",
-					"reqd": 1,
-					"default": frm.doc.cost_center_name
+					label: "Cost Center Name",
+					fieldname: "cost_center_name",
+					fieldtype: "Data",
+					reqd: 1,
+					default: frm.doc.cost_center_name,
 				},
 				{
-					"label": "Cost Center Number",
-					"fieldname": "cost_center_number",
-					"fieldtype": "Data",
-					"default": frm.doc.cost_center_number
+					label: "Cost Center Number",
+					fieldname: "cost_center_number",
+					fieldtype: "Data",
+					default: frm.doc.cost_center_number,
 				},
 				{
-					"label": __("Merge with existing"),
-					"fieldname": "merge",
-					"fieldtype": "Check",
-					"default": 0
-				}
+					label: __("Merge with existing"),
+					fieldname: "merge",
+					fieldtype: "Check",
+					default: 0,
+				},
 			],
-			primary_action: function() {
+			primary_action: function () {
 				let data = d.get_values();
-				if(data.cost_center_name === frm.doc.cost_center_name && data.cost_center_number === frm.doc.cost_center_number) {
+				if (
+					data.cost_center_name === frm.doc.cost_center_name &&
+					data.cost_center_number === frm.doc.cost_center_number
+				) {
 					d.hide();
 					return;
 				}
@@ -83,12 +88,12 @@
 						cost_center_name: data.cost_center_name,
 						cost_center_number: cstr(data.cost_center_number),
 						company: frm.doc.company,
-						merge: data.merge
+						merge: data.merge,
 					},
-					callback: function(r) {
+					callback: function (r) {
 						frappe.dom.unfreeze();
-						if(!r.exc) {
-							if(r.message) {
+						if (!r.exc) {
+							if (r.message) {
 								frappe.set_route("Form", "Cost Center", r.message);
 							} else {
 								frm.set_value("cost_center_name", data.cost_center_name);
@@ -96,44 +101,42 @@
 							}
 							d.hide();
 						}
-					}
+					},
 				});
 			},
-			primary_action_label: __('Update')
+			primary_action_label: __("Update"),
 		});
 		d.show();
 	},
 
 	parent_cost_center(frm) {
-		if(!frm.doc.company) {
-			frappe.msgprint(__('Please enter company name first'));
+		if (!frm.doc.company) {
+			frappe.msgprint(__("Please enter company name first"));
 		}
 	},
 
 	hide_unhide_group_ledger(frm) {
 		let doc = frm.doc;
 		if (doc.is_group == 1) {
-			frm.add_custom_button(__('Convert to Non-Group'),
-				() => frm.events.convert_to_ledger(frm));
+			frm.add_custom_button(__("Convert to Non-Group"), () => frm.events.convert_to_ledger(frm));
 		} else if (doc.is_group == 0) {
-			frm.add_custom_button(__('Convert to Group'),
-				() => frm.events.convert_to_group(frm));
+			frm.add_custom_button(__("Convert to Group"), () => frm.events.convert_to_group(frm));
 		}
 	},
 
 	convert_to_group(frm) {
-		frm.call('convert_ledger_to_group').then(r => {
-			if(r.message === 1) {
+		frm.call("convert_ledger_to_group").then((r) => {
+			if (r.message === 1) {
 				frm.refresh();
 			}
 		});
 	},
 
 	convert_to_ledger(frm) {
-		frm.call('convert_group_to_ledger').then(r => {
-			if(r.message === 1) {
+		frm.call("convert_group_to_ledger").then((r) => {
+			if (r.message === 1) {
 				frm.refresh();
 			}
 		});
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/cost_center/cost_center_tree.js b/erpnext/accounts/doctype/cost_center/cost_center_tree.js
index 1d482c5..3edeb8e 100644
--- a/erpnext/accounts/doctype/cost_center/cost_center_tree.js
+++ b/erpnext/accounts/doctype/cost_center/cost_center_tree.js
@@ -1,54 +1,84 @@
 frappe.treeview_settings["Cost Center"] = {
 	breadcrumb: "Accounts",
 	get_tree_root: false,
-	filters: [{
-		fieldname: "company",
-		fieldtype:"Select",
-		options: erpnext.utils.get_tree_options("company"),
-		label: __("Company"),
-		default: erpnext.utils.get_tree_default("company")
-	}],
-	root_label: "Cost Centers",
-	get_tree_nodes: 'erpnext.accounts.utils.get_children',
-	add_tree_node: 'erpnext.accounts.utils.add_cc',
-	menu_items:[
+	filters: [
 		{
-			label: __('New Company'),
-			action: function() { frappe.new_doc("Company", true) },
-			condition: 'frappe.boot.user.can_create.indexOf("Company") !== -1'
-		}
+			fieldname: "company",
+			fieldtype: "Select",
+			options: erpnext.utils.get_tree_options("company"),
+			label: __("Company"),
+			default: erpnext.utils.get_tree_default("company"),
+		},
 	],
-	fields:[
-		{fieldtype:'Data', fieldname:'cost_center_name', label:__('New Cost Center Name'), reqd:true},
-		{fieldtype:'Check', fieldname:'is_group', label:__('Is Group'),
-			description:__('Further cost centers can be made under Groups but entries can be made against non-Groups')},
-		{fieldtype:'Data', fieldname:'cost_center_number', label:__('Cost Center Number'),
-			description: __("Number of new Cost Center, it will be included in the cost center name as a prefix")}
+	root_label: "Cost Centers",
+	get_tree_nodes: "erpnext.accounts.utils.get_children",
+	add_tree_node: "erpnext.accounts.utils.add_cc",
+	menu_items: [
+		{
+			label: __("New Company"),
+			action: function () {
+				frappe.new_doc("Company", true);
+			},
+			condition: 'frappe.boot.user.can_create.indexOf("Company") !== -1',
+		},
 	],
-	ignore_fields:["parent_cost_center"],
-	onload: function(treeview) {
+	fields: [
+		{ fieldtype: "Data", fieldname: "cost_center_name", label: __("New Cost Center Name"), reqd: true },
+		{
+			fieldtype: "Check",
+			fieldname: "is_group",
+			label: __("Is Group"),
+			description: __(
+				"Further cost centers can be made under Groups but entries can be made against non-Groups"
+			),
+		},
+		{
+			fieldtype: "Data",
+			fieldname: "cost_center_number",
+			label: __("Cost Center Number"),
+			description: __(
+				"Number of new Cost Center, it will be included in the cost center name as a prefix"
+			),
+		},
+	],
+	ignore_fields: ["parent_cost_center"],
+	onload: function (treeview) {
 		function get_company() {
 			return treeview.page.fields_dict.company.get_value();
 		}
 
 		// tools
-		treeview.page.add_inner_button(__("Chart of Accounts"), function() {
-			frappe.set_route('Tree', 'Account', {company: get_company()});
-		}, __('View'));
+		treeview.page.add_inner_button(
+			__("Chart of Accounts"),
+			function () {
+				frappe.set_route("Tree", "Account", { company: get_company() });
+			},
+			__("View")
+		);
 
 		// make
-		treeview.page.add_inner_button(__("Budget List"), function() {
-			frappe.set_route('List', 'Budget', {company: get_company()});
-		}, __('Budget'));
+		treeview.page.add_inner_button(
+			__("Budget List"),
+			function () {
+				frappe.set_route("List", "Budget", { company: get_company() });
+			},
+			__("Budget")
+		);
 
-		treeview.page.add_inner_button(__("Monthly Distribution"), function() {
-			frappe.set_route('List', 'Monthly Distribution', {company: get_company()});
-		}, __('Budget'));
+		treeview.page.add_inner_button(
+			__("Monthly Distribution"),
+			function () {
+				frappe.set_route("List", "Monthly Distribution", { company: get_company() });
+			},
+			__("Budget")
+		);
 
-		treeview.page.add_inner_button(__("Budget Variance Report"), function() {
-			frappe.set_route('query-report', 'Budget Variance Report', {company: get_company()});
-		}, __('Budget'));
-
-	}
-
-}
+		treeview.page.add_inner_button(
+			__("Budget Variance Report"),
+			function () {
+				frappe.set_route("query-report", "Budget Variance Report", { company: get_company() });
+			},
+			__("Budget")
+		);
+	},
+};
diff --git a/erpnext/accounts/doctype/cost_center_allocation/cost_center_allocation.js b/erpnext/accounts/doctype/cost_center_allocation/cost_center_allocation.js
index 0da9016..8adc5b2 100644
--- a/erpnext/accounts/doctype/cost_center_allocation/cost_center_allocation.js
+++ b/erpnext/accounts/doctype/cost_center_allocation/cost_center_allocation.js
@@ -1,24 +1,24 @@
 // Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Cost Center Allocation', {
-	setup: function(frm) {
-		frm.set_query('main_cost_center', function() {
+frappe.ui.form.on("Cost Center Allocation", {
+	setup: function (frm) {
+		frm.set_query("main_cost_center", function () {
 			return {
 				filters: {
 					company: frm.doc.company,
-					is_group: 0
-				}
+					is_group: 0,
+				},
 			};
 		});
 
-		frm.set_query('cost_center', 'allocation_percentages', function() {
+		frm.set_query("cost_center", "allocation_percentages", function () {
 			return {
 				filters: {
 					company: frm.doc.company,
-					is_group: 0
-				}
+					is_group: 0,
+				},
 			};
 		});
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/coupon_code/coupon_code.js b/erpnext/accounts/doctype/coupon_code/coupon_code.js
index da3a9f8..f8b5bdc 100644
--- a/erpnext/accounts/doctype/coupon_code/coupon_code.js
+++ b/erpnext/accounts/doctype/coupon_code/coupon_code.js
@@ -1,44 +1,41 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Coupon Code', {
-	setup: function(frm) {
-		frm.set_query("pricing_rule", function() {
+frappe.ui.form.on("Coupon Code", {
+	setup: function (frm) {
+		frm.set_query("pricing_rule", function () {
 			return {
-				filters: [
-					["Pricing Rule","coupon_code_based", "=", "1"]
-				]
+				filters: [["Pricing Rule", "coupon_code_based", "=", "1"]],
 			};
 		});
 	},
-	coupon_name:function(frm){
-		if (frm.doc.__islocal===1) {
+	coupon_name: function (frm) {
+		if (frm.doc.__islocal === 1) {
 			frm.trigger("make_coupon_code");
 		}
 	},
-	coupon_type:function(frm){
-		if (frm.doc.__islocal===1) {
+	coupon_type: function (frm) {
+		if (frm.doc.__islocal === 1) {
 			frm.trigger("make_coupon_code");
 		}
 	},
-	make_coupon_code: function(frm) {
-		var coupon_name=frm.doc.coupon_name;
+	make_coupon_code: function (frm) {
+		var coupon_name = frm.doc.coupon_name;
 		var coupon_code;
-		if (frm.doc.coupon_type=='Gift Card') {
-			coupon_code=Math.random().toString(12).substring(2, 12).toUpperCase();
+		if (frm.doc.coupon_type == "Gift Card") {
+			coupon_code = Math.random().toString(12).substring(2, 12).toUpperCase();
+		} else if (frm.doc.coupon_type == "Promotional") {
+			coupon_name = coupon_name.replace(/\s/g, "");
+			coupon_code = coupon_name.toUpperCase().slice(0, 8);
 		}
-		else if(frm.doc.coupon_type=='Promotional'){
-			coupon_name=coupon_name.replace(/\s/g,'');
-			coupon_code=coupon_name.toUpperCase().slice(0,8);
-		}
-		frm.doc.coupon_code=coupon_code;
-		frm.refresh_field('coupon_code');
+		frm.doc.coupon_code = coupon_code;
+		frm.refresh_field("coupon_code");
 	},
-	refresh: function(frm) {
+	refresh: function (frm) {
 		if (frm.doc.pricing_rule) {
-			frm.add_custom_button(__("Add/Edit Coupon Conditions"), function(){
+			frm.add_custom_button(__("Add/Edit Coupon Conditions"), function () {
 				frappe.set_route("Form", "Pricing Rule", frm.doc.pricing_rule);
 			});
 		}
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.js b/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.js
index 6c40f2b..d931f62 100644
--- a/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.js
+++ b/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.js
@@ -1,28 +1,27 @@
 // Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Currency Exchange Settings', {
-	service_provider: function(frm) {
+frappe.ui.form.on("Currency Exchange Settings", {
+	service_provider: function (frm) {
 		if (frm.doc.service_provider == "exchangerate.host") {
-			let result = ['result'];
+			let result = ["result"];
 			let params = {
-				date: '{transaction_date}',
-				from: '{from_currency}',
-				to: '{to_currency}'
+				date: "{transaction_date}",
+				from: "{from_currency}",
+				to: "{to_currency}",
 			};
 			add_param(frm, "https://api.exchangerate.host/convert", params, result);
 		} else if (frm.doc.service_provider == "frankfurter.app") {
-			let result = ['rates', '{to_currency}'];
+			let result = ["rates", "{to_currency}"];
 			let params = {
-				base: '{from_currency}',
-				symbols: '{to_currency}'
+				base: "{from_currency}",
+				symbols: "{to_currency}",
 			};
 			add_param(frm, "https://frankfurter.app/{transaction_date}", params, result);
 		}
-	}
+	},
 });
 
-
 function add_param(frm, api, params, result) {
 	var row;
 	frm.clear_table("req_params");
@@ -30,13 +29,13 @@
 
 	frm.doc.api_endpoint = api;
 
-	$.each(params, function(key, value) {
+	$.each(params, function (key, value) {
 		row = frm.add_child("req_params");
 		row.key = key;
 		row.value = value;
 	});
 
-	$.each(result, function(key, value) {
+	$.each(result, function (key, value) {
 		row = frm.add_child("result_key");
 		row.key = value;
 	});
diff --git a/erpnext/accounts/doctype/dunning/dunning.js b/erpnext/accounts/doctype/dunning/dunning.js
index 1ac909e..e9d091f 100644
--- a/erpnext/accounts/doctype/dunning/dunning.js
+++ b/erpnext/accounts/doctype/dunning/dunning.js
@@ -10,7 +10,7 @@
 					company: frm.doc.company,
 					customer: frm.doc.customer,
 					outstanding_amount: [">", 0],
-					status: "Overdue"
+					status: "Overdue",
 				},
 			};
 		});
@@ -19,16 +19,16 @@
 				filters: {
 					company: frm.doc.company,
 					root_type: "Income",
-					is_group: 0
-				}
+					is_group: 0,
+				},
 			};
 		});
 		frm.set_query("cost_center", () => {
 			return {
 				filters: {
 					company: frm.doc.company,
-					is_group: 0
-				}
+					is_group: 0,
+				},
 			};
 		});
 
@@ -51,7 +51,8 @@
 				__("Payment"),
 				function () {
 					frm.events.make_payment_entry(frm);
-				}, __("Create")
+				},
+				__("Create")
 			);
 			frm.page.set_inner_btn_group_as_primary(__("Create"));
 		}
@@ -69,7 +70,7 @@
 					get_query_filters: {
 						docstatus: 1,
 						status: "Overdue",
-						company: frm.doc.company
+						company: frm.doc.company,
 					},
 					allow_child_item_selection: true,
 					child_fieldname: "payment_schedule",
@@ -78,9 +79,12 @@
 			});
 		}
 
-		frappe.dynamic_link = { doc: frm.doc, fieldname: 'customer', doctype: 'Customer' };
+		frappe.dynamic_link = { doc: frm.doc, fieldname: "customer", doctype: "Customer" };
 
-		frm.toggle_display("customer_name", (frm.doc.customer_name && frm.doc.customer_name !== frm.doc.customer));
+		frm.toggle_display(
+			"customer_name",
+			frm.doc.customer_name && frm.doc.customer_name !== frm.doc.customer
+		);
 	},
 	// When multiple companies are set up. in case company name is changed set default company address
 	company: function (frm) {
@@ -90,8 +94,8 @@
 				args: { name: frm.doc.company, existing_address: frm.doc.company_address || "" },
 				debounce: 2000,
 				callback: function (r) {
-					frm.set_value("company_address", r && r.message || "");
-				}
+					frm.set_value("company_address", (r && r.message) || "");
+				},
 			});
 
 			if (frm.fields_dict.currency) {
@@ -125,16 +129,16 @@
 					transaction_date: frm.doc.posting_date,
 					from_currency: frm.doc.currency,
 					to_currency: company_currency,
-					args: "for_selling"
+					args: "for_selling",
 				},
 				freeze: true,
 				freeze_message: __("Fetching exchange rates ..."),
-				callback: function(r) {
+				callback: function (r) {
 					const exchange_rate = flt(r.message);
 					if (exchange_rate != frm.doc.conversion_rate) {
 						frm.set_value("conversion_rate", exchange_rate);
 					}
-				}
+				},
 			});
 		} else {
 			frm.trigger("conversion_rate");
@@ -166,8 +170,7 @@
 	get_dunning_letter_text: function (frm) {
 		if (frm.doc.dunning_type) {
 			frappe.call({
-				method:
-					"erpnext.accounts.doctype.dunning.dunning.get_dunning_letter_text",
+				method: "erpnext.accounts.doctype.dunning.dunning.get_dunning_letter_text",
 				args: {
 					dunning_type: frm.doc.dunning_type,
 					language: frm.doc.language,
@@ -204,10 +207,7 @@
 	calculate_overdue_days: function (frm) {
 		frm.doc.overdue_payments.forEach((row) => {
 			if (frm.doc.posting_date && row.due_date) {
-				const overdue_days = moment(frm.doc.posting_date).diff(
-					row.due_date,
-					"days"
-				);
+				const overdue_days = moment(frm.doc.posting_date).diff(row.due_date, "days");
 				frappe.model.set_value(row.doctype, row.name, "overdue_days", overdue_days);
 			}
 		});
@@ -215,15 +215,16 @@
 	calculate_interest: function (frm) {
 		frm.doc.overdue_payments.forEach((row) => {
 			const interest_per_day = frm.doc.rate_of_interest / 100 / 365;
-			const interest = flt((interest_per_day * row.overdue_days * row.outstanding), precision("interest", row));
+			const interest = flt(
+				interest_per_day * row.overdue_days * row.outstanding,
+				precision("interest", row)
+			);
 			frappe.model.set_value(row.doctype, row.name, "interest", interest);
 		});
 	},
 	calculate_totals: function (frm) {
-		const total_interest = frm.doc.overdue_payments
-			.reduce((prev, cur) => prev + cur.interest, 0);
-		const total_outstanding = frm.doc.overdue_payments
-			.reduce((prev, cur) => prev + cur.outstanding, 0);
+		const total_interest = frm.doc.overdue_payments.reduce((prev, cur) => prev + cur.interest, 0);
+		const total_outstanding = frm.doc.overdue_payments.reduce((prev, cur) => prev + cur.outstanding, 0);
 		const dunning_amount = total_interest + frm.doc.dunning_fee;
 		const base_dunning_amount = dunning_amount * frm.doc.conversion_rate;
 		const grand_total = total_outstanding + dunning_amount;
@@ -240,8 +241,7 @@
 	},
 	make_payment_entry: function (frm) {
 		return frappe.call({
-			method:
-				"erpnext.accounts.doctype.payment_entry.payment_entry.get_payment_entry",
+			method: "erpnext.accounts.doctype.payment_entry.payment_entry.get_payment_entry",
 			args: {
 				dt: frm.doc.doctype,
 				dn: frm.doc.name,
@@ -257,5 +257,5 @@
 frappe.ui.form.on("Overdue Payment", {
 	interest: function (frm) {
 		frm.trigger("calculate_totals");
-	}
-});
\ No newline at end of file
+	},
+});
diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js
index 1ef5c83..741039a 100644
--- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js
+++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js
@@ -1,75 +1,79 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Exchange Rate Revaluation', {
-	setup: function(frm) {
-		frm.set_query("party_type", "accounts", function() {
+frappe.ui.form.on("Exchange Rate Revaluation", {
+	setup: function (frm) {
+		frm.set_query("party_type", "accounts", function () {
 			return {
-				"filters": {
-					"name": ["in", Object.keys(frappe.boot.party_account_types)],
-				}
+				filters: {
+					name: ["in", Object.keys(frappe.boot.party_account_types)],
+				},
 			};
 		});
-		frm.set_query("account", "accounts", function(doc) {
+		frm.set_query("account", "accounts", function (doc) {
 			return {
-				"filters": {
-					"company": doc.company
-				}
+				filters: {
+					company: doc.company,
+				},
 			};
 		});
 	},
 
-	refresh: function(frm) {
-		if(frm.doc.docstatus==1) {
+	refresh: function (frm) {
+		if (frm.doc.docstatus == 1) {
 			frappe.call({
-				method: 'check_journal_entry_condition',
+				method: "check_journal_entry_condition",
 				doc: frm.doc,
-				callback: function(r) {
+				callback: function (r) {
 					if (r.message) {
-						frm.add_custom_button(__('Journal Entries'), function() {
-							return frm.events.make_jv(frm);
-						}, __('Create'));
+						frm.add_custom_button(
+							__("Journal Entries"),
+							function () {
+								return frm.events.make_jv(frm);
+							},
+							__("Create")
+						);
 					}
-				}
+				},
 			});
 		}
 	},
 
-	validate_rounding_loss: function(frm) {
+	validate_rounding_loss: function (frm) {
 		let allowance = frm.doc.rounding_loss_allowance;
 		if (!(allowance >= 0 && allowance < 1)) {
 			frappe.throw(__("Rounding Loss Allowance should be between 0 and 1"));
 		}
 	},
 
-	rounding_loss_allowance: function(frm) {
+	rounding_loss_allowance: function (frm) {
 		frm.events.validate_rounding_loss(frm);
 	},
 
-	validate: function(frm) {
+	validate: function (frm) {
 		frm.events.validate_rounding_loss(frm);
 	},
 
-	get_entries: function(frm, account) {
+	get_entries: function (frm, account) {
 		frappe.call({
 			method: "get_accounts_data",
 			doc: cur_frm.doc,
 			account: account,
-			callback: function(r){
+			callback: function (r) {
 				frappe.model.clear_table(frm.doc, "accounts");
-				if(r.message) {
+				if (r.message) {
 					r.message.forEach((d) => {
-						cur_frm.add_child("accounts",d);
+						cur_frm.add_child("accounts", d);
 					});
 					frm.events.get_total_gain_loss(frm);
 					refresh_field("accounts");
 				}
-			}
+			},
 		});
 	},
 
-	get_total_gain_loss: function(frm) {
-		if(!(frm.doc.accounts && frm.doc.accounts.length)) return;
+	get_total_gain_loss: function (frm) {
+		if (!(frm.doc.accounts && frm.doc.accounts.length)) return;
 
 		let total_gain_loss = 0;
 		frm.doc.accounts.forEach((d) => {
@@ -80,7 +84,7 @@
 		frm.refresh_fields();
 	},
 
-	make_jv : function(frm) {
+	make_jv: function (frm) {
 		let revaluation_journal = null;
 		let zero_balance_journal = null;
 		frappe.call({
@@ -88,66 +92,68 @@
 			doc: frm.doc,
 			freeze: true,
 			freeze_message: "Making Journal Entries...",
-			callback: function(r){
+			callback: function (r) {
 				if (r.message) {
 					let response = r.message;
-					if(response['revaluation_jv'] || response['zero_balance_jv']) {
+					if (response["revaluation_jv"] || response["zero_balance_jv"]) {
 						frappe.msgprint(__("Journals have been created"));
 					}
 				}
-			}
+			},
 		});
-	}
+	},
 });
 
 frappe.ui.form.on("Exchange Rate Revaluation Account", {
-	new_exchange_rate: function(frm, cdt, cdn) {
+	new_exchange_rate: function (frm, cdt, cdn) {
 		var row = frappe.get_doc(cdt, cdn);
-		row.new_balance_in_base_currency = flt(row.new_exchange_rate * flt(row.balance_in_account_currency),
-			precision("new_balance_in_base_currency", row));
+		row.new_balance_in_base_currency = flt(
+			row.new_exchange_rate * flt(row.balance_in_account_currency),
+			precision("new_balance_in_base_currency", row)
+		);
 		row.gain_loss = row.new_balance_in_base_currency - flt(row.balance_in_base_currency);
 		refresh_field("accounts");
 		frm.events.get_total_gain_loss(frm);
 	},
 
-	account: function(frm, cdt, cdn) {
+	account: function (frm, cdt, cdn) {
 		var row = locals[cdt][cdn];
 		if (row.account) {
 			get_account_details(frm, cdt, cdn);
 		}
 	},
 
-	party: function(frm, cdt, cdn) {
+	party: function (frm, cdt, cdn) {
 		var row = locals[cdt][cdn];
 		if (row.party && row.account) {
 			get_account_details(frm, cdt, cdn);
 		}
 	},
 
-	accounts_remove: function(frm) {
+	accounts_remove: function (frm) {
 		frm.events.get_total_gain_loss(frm);
-	}
+	},
 });
 
-var get_account_details = function(frm, cdt, cdn) {
+var get_account_details = function (frm, cdt, cdn) {
 	var row = frappe.get_doc(cdt, cdn);
-	if(!frm.doc.company || !frm.doc.posting_date) {
+	if (!frm.doc.company || !frm.doc.posting_date) {
 		frappe.throw(__("Please select Company and Posting Date to getting entries"));
 	}
 	frappe.call({
 		method: "erpnext.accounts.doctype.exchange_rate_revaluation.exchange_rate_revaluation.get_account_details",
-		args:{
+		args: {
 			account: row.account,
 			company: frm.doc.company,
 			posting_date: frm.doc.posting_date,
 			party_type: row.party_type,
 			party: row.party,
-			rounding_loss_allowance: frm.doc.rounding_loss_allowance
+			rounding_loss_allowance: frm.doc.rounding_loss_allowance,
 		},
-		callback: function(r){
+		callback: function (r) {
 			$.extend(row, r.message);
 			refresh_field("accounts");
 			frm.events.get_total_gain_loss(frm);
-		}
+		},
 	});
 };
diff --git a/erpnext/accounts/doctype/finance_book/finance_book.js b/erpnext/accounts/doctype/finance_book/finance_book.js
index 71191bb..ebe1d24 100644
--- a/erpnext/accounts/doctype/finance_book/finance_book.js
+++ b/erpnext/accounts/doctype/finance_book/finance_book.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Finance Book', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Finance Book", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.js b/erpnext/accounts/doctype/fiscal_year/fiscal_year.js
index 508b2ea..a44b52f 100644
--- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.js
+++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.js
@@ -1,17 +1,21 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.ui.form.on('Fiscal Year', {
-	onload: function(frm) {
-		if(frm.doc.__islocal) {
-			frm.set_value("year_start_date",
-				frappe.datetime.add_days(frappe.defaults.get_default("year_end_date"), 1));
+frappe.ui.form.on("Fiscal Year", {
+	onload: function (frm) {
+		if (frm.doc.__islocal) {
+			frm.set_value(
+				"year_start_date",
+				frappe.datetime.add_days(frappe.defaults.get_default("year_end_date"), 1)
+			);
 		}
 	},
-	year_start_date: function(frm) {
+	year_start_date: function (frm) {
 		if (!frm.doc.is_short_year) {
-			let year_end_date =
-				frappe.datetime.add_days(frappe.datetime.add_months(frm.doc.year_start_date, 12), -1);
+			let year_end_date = frappe.datetime.add_days(
+				frappe.datetime.add_months(frm.doc.year_start_date, 12),
+				-1
+			);
 			frm.set_value("year_end_date", year_end_date);
 		}
 	},
diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.js b/erpnext/accounts/doctype/gl_entry/gl_entry.js
index 4d2a513..7f81a2a 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.js
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.js
@@ -1,8 +1,8 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('GL Entry', {
-	refresh: function(frm) {
-		frm.page.btn_secondary.hide()
-	}
+frappe.ui.form.on("GL Entry", {
+	refresh: function (frm) {
+		frm.page.btn_secondary.hide();
+	},
 });
diff --git a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.js b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.js
index c80bf62..6d90c26 100644
--- a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.js
+++ b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.js
@@ -1,47 +1,49 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Invoice Discounting', {
+frappe.ui.form.on("Invoice Discounting", {
 	setup: (frm) => {
 		frm.set_query("sales_invoice", "invoices", (doc) => {
 			return {
-				"filters": {
-					"docstatus": 1,
-					"company": doc.company,
-					"outstanding_amount": [">", 0]
+				filters: {
+					docstatus: 1,
+					company: doc.company,
+					outstanding_amount: [">", 0],
 				},
 			};
 		});
 
-
 		frm.events.filter_accounts("bank_account", frm, [["account_type", "=", "Bank"]]);
 		frm.events.filter_accounts("bank_charges_account", frm, [["root_type", "=", "Expense"]]);
 		frm.events.filter_accounts("short_term_loan", frm, [["root_type", "=", "Liability"]]);
-		frm.events.filter_accounts("accounts_receivable_discounted", frm, [["account_type", "=", "Receivable"]]);
+		frm.events.filter_accounts("accounts_receivable_discounted", frm, [
+			["account_type", "=", "Receivable"],
+		]);
 		frm.events.filter_accounts("accounts_receivable_credit", frm, [["account_type", "=", "Receivable"]]);
 		frm.events.filter_accounts("accounts_receivable_unpaid", frm, [["account_type", "=", "Receivable"]]);
-
 	},
 
 	filter_accounts: (fieldname, frm, addl_filters) => {
 		let filters = [
 			["company", "=", frm.doc.company],
-			["is_group", "=", 0]
+			["is_group", "=", 0],
 		];
-		if(addl_filters){
-			filters = $.merge(filters , addl_filters);
+		if (addl_filters) {
+			filters = $.merge(filters, addl_filters);
 		}
 
-		frm.set_query(fieldname, () => { return { "filters": filters }; });
+		frm.set_query(fieldname, () => {
+			return { filters: filters };
+		});
 	},
 
-	refresh_filters: (frm) =>{
-		let invoice_accounts = Object.keys(frm.doc.invoices).map(function(key) {
+	refresh_filters: (frm) => {
+		let invoice_accounts = Object.keys(frm.doc.invoices).map(function (key) {
 			return frm.doc.invoices[key].debit_to;
 		});
 		let filters = [
 			["account_type", "=", "Receivable"],
-			["name", "not in", invoice_accounts]
+			["name", "not in", invoice_accounts],
 		];
 		frm.events.filter_accounts("accounts_receivable_credit", frm, filters);
 		frm.events.filter_accounts("accounts_receivable_discounted", frm, filters);
@@ -52,19 +54,19 @@
 		frm.events.show_general_ledger(frm);
 
 		if (frm.doc.docstatus === 0) {
-			frm.add_custom_button(__('Get Invoices'), function() {
+			frm.add_custom_button(__("Get Invoices"), function () {
 				frm.events.get_invoices(frm);
 			});
 		}
 
 		if (frm.doc.docstatus === 1 && frm.doc.status !== "Settled") {
 			if (frm.doc.status == "Sanctioned") {
-				frm.add_custom_button(__('Disburse Loan'), function() {
+				frm.add_custom_button(__("Disburse Loan"), function () {
 					frm.events.create_disbursement_entry(frm);
 				}).addClass("btn-primary");
 			}
 			if (frm.doc.status == "Disbursed") {
-				frm.add_custom_button(__('Close Loan'), function() {
+				frm.add_custom_button(__("Close Loan"), function () {
 					frm.events.close_loan(frm);
 				}).addClass("btn-primary");
 			}
@@ -92,119 +94,121 @@
 
 	calculate_total_amount: (frm) => {
 		let total_amount = 0.0;
-		for (let row of (frm.doc.invoices || [])) {
+		for (let row of frm.doc.invoices || []) {
 			total_amount += flt(row.outstanding_amount);
 		}
 		frm.set_value("total_amount", total_amount);
 	},
 	get_invoices: (frm) => {
 		var d = new frappe.ui.Dialog({
-			title: __('Get Invoices based on Filters'),
+			title: __("Get Invoices based on Filters"),
 			fields: [
 				{
-					"label": "Customer",
-					"fieldname": "customer",
-					"fieldtype": "Link",
-					"options": "Customer"
+					label: "Customer",
+					fieldname: "customer",
+					fieldtype: "Link",
+					options: "Customer",
 				},
 				{
-					"label": "From Date",
-					"fieldname": "from_date",
-					"fieldtype": "Date"
+					label: "From Date",
+					fieldname: "from_date",
+					fieldtype: "Date",
 				},
 				{
-					"label": "To Date",
-					"fieldname": "to_date",
-					"fieldtype": "Date"
+					label: "To Date",
+					fieldname: "to_date",
+					fieldtype: "Date",
 				},
 				{
-					"fieldname": "col_break",
-					"fieldtype": "Column Break",
+					fieldname: "col_break",
+					fieldtype: "Column Break",
 				},
 				{
-					"label": "Min Amount",
-					"fieldname": "min_amount",
-					"fieldtype": "Currency"
+					label: "Min Amount",
+					fieldname: "min_amount",
+					fieldtype: "Currency",
 				},
 				{
-					"label": "Max Amount",
-					"fieldname": "max_amount",
-					"fieldtype": "Currency"
-				}
+					label: "Max Amount",
+					fieldname: "max_amount",
+					fieldtype: "Currency",
+				},
 			],
-			primary_action: function() {
+			primary_action: function () {
 				var data = d.get_values();
 
 				frappe.call({
 					method: "erpnext.accounts.doctype.invoice_discounting.invoice_discounting.get_invoices",
 					args: {
-						filters: data
+						filters: data,
 					},
-					callback: function(r) {
-						if(!r.exc) {
+					callback: function (r) {
+						if (!r.exc) {
 							d.hide();
-							$.each(r.message, function(i, v) {
-								frm.doc.invoices = frm.doc.invoices.filter(row => row.sales_invoice);
+							$.each(r.message, function (i, v) {
+								frm.doc.invoices = frm.doc.invoices.filter((row) => row.sales_invoice);
 								let row = frm.add_child("invoices");
 								$.extend(row, v);
 								frm.events.refresh_filters(frm);
 							});
 							refresh_field("invoices");
 						}
-					}
+					},
 				});
 			},
-			primary_action_label: __('Get Invoices')
+			primary_action_label: __("Get Invoices"),
 		});
 		d.show();
 	},
 
 	create_disbursement_entry: (frm) => {
 		frappe.call({
-			method:"create_disbursement_entry",
+			method: "create_disbursement_entry",
 			doc: frm.doc,
-			callback: function(r) {
-				if(!r.exc){
+			callback: function (r) {
+				if (!r.exc) {
 					var doclist = frappe.model.sync(r.message);
 					frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
 				}
-			}
+			},
 		});
-
 	},
 
 	close_loan: (frm) => {
 		frappe.call({
-			method:"close_loan",
+			method: "close_loan",
 			doc: frm.doc,
-			callback: function(r) {
-				if(!r.exc){
+			callback: function (r) {
+				if (!r.exc) {
 					var doclist = frappe.model.sync(r.message);
 					frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
 				}
-			}
+			},
 		});
-
 	},
 
 	show_general_ledger: (frm) => {
-		if(frm.doc.docstatus > 0) {
-			cur_frm.add_custom_button(__('Accounting Ledger'), function() {
-				frappe.route_options = {
-					voucher_no: frm.doc.name,
-					from_date: frm.doc.posting_date,
-					to_date: moment(frm.doc.modified).format('YYYY-MM-DD'),
-					company: frm.doc.company,
-					group_by: "Group by Voucher (Consolidated)",
-					show_cancelled_entries: frm.doc.docstatus === 2
-				};
-				frappe.set_route("query-report", "General Ledger");
-			}, __("View"));
+		if (frm.doc.docstatus > 0) {
+			cur_frm.add_custom_button(
+				__("Accounting Ledger"),
+				function () {
+					frappe.route_options = {
+						voucher_no: frm.doc.name,
+						from_date: frm.doc.posting_date,
+						to_date: moment(frm.doc.modified).format("YYYY-MM-DD"),
+						company: frm.doc.company,
+						group_by: "Group by Voucher (Consolidated)",
+						show_cancelled_entries: frm.doc.docstatus === 2,
+					};
+					frappe.set_route("query-report", "General Ledger");
+				},
+				__("View")
+			);
 		}
-	}
+	},
 });
 
-frappe.ui.form.on('Discounted Invoice', {
+frappe.ui.form.on("Discounted Invoice", {
 	sales_invoice: (frm) => {
 		frm.events.calculate_total_amount(frm);
 		frm.events.refresh_filters(frm);
@@ -212,5 +216,5 @@
 	invoices_remove: (frm) => {
 		frm.events.calculate_total_amount(frm);
 		frm.events.refresh_filters(frm);
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_list.js b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_list.js
index 4895efc..0b08e39 100644
--- a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_list.js
+++ b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_list.js
@@ -1,21 +1,16 @@
-frappe.listview_settings['Invoice Discounting'] = {
+frappe.listview_settings["Invoice Discounting"] = {
 	add_fields: ["status"],
-	get_indicator: function(doc)
-	{
-		if(doc.status == "Draft") {
+	get_indicator: function (doc) {
+		if (doc.status == "Draft") {
 			return [__("Draft"), "red", "status,=,Draft"];
-		}
-		else if(doc.status == "Sanctioned") {
+		} else if (doc.status == "Sanctioned") {
 			return [__("Sanctioned"), "green", "status,=,Sanctioned"];
-		}
-		else if(doc.status == "Disbursed") {
+		} else if (doc.status == "Disbursed") {
 			return [__("Disbursed"), "blue", "status,=,Disbursed"];
-		}
-		else if(doc.status == "Settled") {
+		} else if (doc.status == "Settled") {
 			return [__("Settled"), "orange", "status,=,Settled"];
-		}
-		else if(doc.status == "Canceled") {
+		} else if (doc.status == "Canceled") {
 			return [__("Canceled"), "red", "status,=,Canceled"];
 		}
-	}
+	},
 };
diff --git a/erpnext/accounts/doctype/item_tax_template/item_tax_template.js b/erpnext/accounts/doctype/item_tax_template/item_tax_template.js
index e921a0d..b608ccd 100644
--- a/erpnext/accounts/doctype/item_tax_template/item_tax_template.js
+++ b/erpnext/accounts/doctype/item_tax_template/item_tax_template.js
@@ -1,27 +1,49 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Item Tax Template', {
-	setup: function(frm) {
-		frm.set_query("tax_type", "taxes", function(doc) {
+frappe.ui.form.on("Item Tax Template", {
+	setup: function (frm) {
+		frm.set_query("tax_type", "taxes", function (doc) {
 			return {
 				filters: [
-					['Account', 'company', '=', frm.doc.company],
-					['Account', 'is_group', '=', 0],
-					['Account', 'account_type', 'in', ['Tax', 'Chargeable', 'Income Account', 'Expense Account', 'Expenses Included In Valuation']]
-				]
-			}
+					["Account", "company", "=", frm.doc.company],
+					["Account", "is_group", "=", 0],
+					[
+						"Account",
+						"account_type",
+						"in",
+						[
+							"Tax",
+							"Chargeable",
+							"Income Account",
+							"Expense Account",
+							"Expenses Included In Valuation",
+						],
+					],
+				],
+			};
 		});
 	},
 	company: function (frm) {
-		frm.set_query("tax_type", "taxes", function(doc) {
+		frm.set_query("tax_type", "taxes", function (doc) {
 			return {
 				filters: [
-					['Account', 'company', '=', frm.doc.company],
-					['Account', 'is_group', '=', 0],
-					['Account', 'account_type', 'in', ['Tax', 'Chargeable', 'Income Account', 'Expense Account', 'Expenses Included In Valuation']]
-				]
-			}
+					["Account", "company", "=", frm.doc.company],
+					["Account", "is_group", "=", 0],
+					[
+						"Account",
+						"account_type",
+						"in",
+						[
+							"Tax",
+							"Chargeable",
+							"Income Account",
+							"Expense Account",
+							"Expenses Included In Valuation",
+						],
+					],
+				],
+			};
 		});
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js
index 72469ea..f6d35fe 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.js
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js
@@ -4,58 +4,82 @@
 frappe.provide("erpnext.accounts");
 frappe.provide("erpnext.journal_entry");
 
-
 frappe.ui.form.on("Journal Entry", {
-	setup: function(frm) {
+	setup: function (frm) {
 		frm.add_fetch("bank_account", "account", "account");
-		frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice', 'Journal Entry', "Repost Payment Ledger", 'Asset', 'Asset Movement', 'Asset Depreciation Schedule', "Repost Accounting Ledger", "Unreconcile Payment", "Unreconcile Payment Entries", "Bank Transaction"];
+		frm.ignore_doctypes_on_cancel_all = [
+			"Sales Invoice",
+			"Purchase Invoice",
+			"Journal Entry",
+			"Repost Payment Ledger",
+			"Asset",
+			"Asset Movement",
+			"Asset Depreciation Schedule",
+			"Repost Accounting Ledger",
+			"Unreconcile Payment",
+			"Unreconcile Payment Entries",
+			"Bank Transaction",
+		];
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		erpnext.toggle_naming_series();
 
-		if (frm.doc.repost_required && frm.doc.docstatus===1) {
-			frm.set_intro(__("Accounting entries for this Journal Entry need to be reposted. Please click on 'Repost' button to update."));
-			frm.add_custom_button(__('Repost Accounting Entries'),
-				() => {
-					frm.call({
-						doc: frm.doc,
-						method: 'repost_accounting_entries',
-						freeze: true,
-						freeze_message: __('Reposting...'),
-						callback: (r) => {
-							if (!r.exc) {
-								frappe.msgprint(__('Accounting Entries are reposted.'));
-								frm.refresh();
-							}
+		if (frm.doc.repost_required && frm.doc.docstatus === 1) {
+			frm.set_intro(
+				__(
+					"Accounting entries for this Journal Entry need to be reposted. Please click on 'Repost' button to update."
+				)
+			);
+			frm.add_custom_button(__("Repost Accounting Entries"), () => {
+				frm.call({
+					doc: frm.doc,
+					method: "repost_accounting_entries",
+					freeze: true,
+					freeze_message: __("Reposting..."),
+					callback: (r) => {
+						if (!r.exc) {
+							frappe.msgprint(__("Accounting Entries are reposted."));
+							frm.refresh();
 						}
-					});
-				}).removeClass('btn-default').addClass('btn-warning');
+					},
+				});
+			})
+				.removeClass("btn-default")
+				.addClass("btn-warning");
 		}
 
-		if(frm.doc.docstatus > 0) {
-			frm.add_custom_button(__('Ledger'), function() {
-				frappe.route_options = {
-					"voucher_no": frm.doc.name,
-					"from_date": frm.doc.posting_date,
-					"to_date": moment(frm.doc.modified).format('YYYY-MM-DD'),
-					"company": frm.doc.company,
-					"finance_book": frm.doc.finance_book,
-					"group_by": '',
-					"show_cancelled_entries": frm.doc.docstatus === 2
-				};
-				frappe.set_route("query-report", "General Ledger");
-			}, __('View'));
+		if (frm.doc.docstatus > 0) {
+			frm.add_custom_button(
+				__("Ledger"),
+				function () {
+					frappe.route_options = {
+						voucher_no: frm.doc.name,
+						from_date: frm.doc.posting_date,
+						to_date: moment(frm.doc.modified).format("YYYY-MM-DD"),
+						company: frm.doc.company,
+						finance_book: frm.doc.finance_book,
+						group_by: "",
+						show_cancelled_entries: frm.doc.docstatus === 2,
+					};
+					frappe.set_route("query-report", "General Ledger");
+				},
+				__("View")
+			);
 		}
 
-		if(frm.doc.docstatus==1) {
-			frm.add_custom_button(__('Reverse Journal Entry'), function() {
-				return erpnext.journal_entry.reverse_journal_entry(frm);
-			}, __('Actions'));
+		if (frm.doc.docstatus == 1) {
+			frm.add_custom_button(
+				__("Reverse Journal Entry"),
+				function () {
+					return erpnext.journal_entry.reverse_journal_entry(frm);
+				},
+				__("Actions")
+			);
 		}
 
 		if (frm.doc.__islocal) {
-			frm.add_custom_button(__('Quick Entry'), function() {
+			frm.add_custom_button(__("Quick Entry"), function () {
 				return erpnext.journal_entry.quick_entry(frm);
 			});
 		}
@@ -63,52 +87,63 @@
 		// hide /unhide fields based on currency
 		erpnext.journal_entry.toggle_fields_based_on_currency(frm);
 
-		if ((frm.doc.voucher_type == "Inter Company Journal Entry") && (frm.doc.docstatus == 1) && (!frm.doc.inter_company_journal_entry_reference)) {
-			frm.add_custom_button(__("Create Inter Company Journal Entry"),
-				function() {
+		if (
+			frm.doc.voucher_type == "Inter Company Journal Entry" &&
+			frm.doc.docstatus == 1 &&
+			!frm.doc.inter_company_journal_entry_reference
+		) {
+			frm.add_custom_button(
+				__("Create Inter Company Journal Entry"),
+				function () {
 					frm.trigger("make_inter_company_journal_entry");
-				}, __('Make'));
+				},
+				__("Make")
+			);
 		}
 
 		erpnext.accounts.unreconcile_payment.add_unreconcile_btn(frm);
 	},
-	before_save: function(frm) {
-		if ((frm.doc.docstatus == 0) && (!frm.doc.is_system_generated)) {
-			let payment_entry_references = frm.doc.accounts.filter(elem => (elem.reference_type == "Payment Entry"));
+	before_save: function (frm) {
+		if (frm.doc.docstatus == 0 && !frm.doc.is_system_generated) {
+			let payment_entry_references = frm.doc.accounts.filter(
+				(elem) => elem.reference_type == "Payment Entry"
+			);
 			if (payment_entry_references.length > 0) {
-				let rows = payment_entry_references.map(x => "#"+x.idx);
-				frappe.throw(__("Rows: {0} have 'Payment Entry' as reference_type. This should not be set manually.", [frappe.utils.comma_and(rows)]));
+				let rows = payment_entry_references.map((x) => "#" + x.idx);
+				frappe.throw(
+					__("Rows: {0} have 'Payment Entry' as reference_type. This should not be set manually.", [
+						frappe.utils.comma_and(rows),
+					])
+				);
 			}
 		}
 	},
-	make_inter_company_journal_entry: function(frm) {
+	make_inter_company_journal_entry: function (frm) {
 		var d = new frappe.ui.Dialog({
 			title: __("Select Company"),
 			fields: [
 				{
-					'fieldname': 'company',
-					'fieldtype': 'Link',
-					'label': __('Company'),
-					'options': 'Company',
-					"get_query": function () {
+					fieldname: "company",
+					fieldtype: "Link",
+					label: __("Company"),
+					options: "Company",
+					get_query: function () {
 						return {
-							filters: [
-								["Company", "name", "!=", frm.doc.company]
-							]
+							filters: [["Company", "name", "!=", frm.doc.company]],
 						};
 					},
-					'reqd': 1
-				}
+					reqd: 1,
+				},
 			],
 		});
-		d.set_primary_action(__('Create'), function() {
+		d.set_primary_action(__("Create"), function () {
 			d.hide();
 			var args = d.get_values();
 			frappe.call({
 				args: {
-					"name": frm.doc.name,
-					"voucher_type": frm.doc.voucher_type,
-					"company": args.company
+					name: frm.doc.name,
+					voucher_type: frm.doc.voucher_type,
+					company: args.company,
 				},
 				method: "erpnext.accounts.doctype.journal_entry.journal_entry.make_inter_company_journal_entry",
 				callback: function (r) {
@@ -116,96 +151,101 @@
 						var doc = frappe.model.sync(r.message)[0];
 						frappe.set_route("Form", doc.doctype, doc.name);
 					}
-				}
+				},
 			});
 		});
 		d.show();
 	},
 
-	multi_currency: function(frm) {
+	multi_currency: function (frm) {
 		erpnext.journal_entry.toggle_fields_based_on_currency(frm);
 	},
 
-	posting_date: function(frm) {
-		if(!frm.doc.multi_currency || !frm.doc.posting_date) return;
+	posting_date: function (frm) {
+		if (!frm.doc.multi_currency || !frm.doc.posting_date) return;
 
-		$.each(frm.doc.accounts || [], function(i, row) {
+		$.each(frm.doc.accounts || [], function (i, row) {
 			erpnext.journal_entry.set_exchange_rate(frm, row.doctype, row.name);
-		})
+		});
 	},
 
-	company: function(frm) {
+	company: function (frm) {
 		frappe.call({
 			method: "frappe.client.get_value",
 			args: {
 				doctype: "Company",
-				filters: {"name": frm.doc.company},
-				fieldname: "cost_center"
+				filters: { name: frm.doc.company },
+				fieldname: "cost_center",
 			},
-			callback: function(r){
-				if(r.message){
-					$.each(frm.doc.accounts || [], function(i, jvd) {
+			callback: function (r) {
+				if (r.message) {
+					$.each(frm.doc.accounts || [], function (i, jvd) {
 						frappe.model.set_value(jvd.doctype, jvd.name, "cost_center", r.message.cost_center);
 					});
 				}
-			}
+			},
 		});
 
 		erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
 	},
 
-	voucher_type: function(frm){
+	voucher_type: function (frm) {
+		if (!frm.doc.company) return null;
 
-		if(!frm.doc.company) return null;
-
-		if((!(frm.doc.accounts || []).length) || ((frm.doc.accounts || []).length === 1 && !frm.doc.accounts[0].account)) {
-			if(in_list(["Bank Entry", "Cash Entry"], frm.doc.voucher_type)) {
+		if (
+			!(frm.doc.accounts || []).length ||
+			((frm.doc.accounts || []).length === 1 && !frm.doc.accounts[0].account)
+		) {
+			if (in_list(["Bank Entry", "Cash Entry"], frm.doc.voucher_type)) {
 				return frappe.call({
 					type: "GET",
 					method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_default_bank_cash_account",
 					args: {
-						"account_type": (frm.doc.voucher_type=="Bank Entry" ?
-							"Bank" : (frm.doc.voucher_type=="Cash Entry" ? "Cash" : null)),
-						"company": frm.doc.company
+						account_type:
+							frm.doc.voucher_type == "Bank Entry"
+								? "Bank"
+								: frm.doc.voucher_type == "Cash Entry"
+								? "Cash"
+								: null,
+						company: frm.doc.company,
 					},
-					callback: function(r) {
-						if(r.message) {
+					callback: function (r) {
+						if (r.message) {
 							// If default company bank account not set
-							if(!$.isEmptyObject(r.message)){
+							if (!$.isEmptyObject(r.message)) {
 								update_jv_details(frm.doc, [r.message]);
 							}
 						}
-					}
+					},
 				});
 			}
 		}
 	},
 
-	from_template: function(frm){
-		if (frm.doc.from_template){
-			frappe.db.get_doc("Journal Entry Template", frm.doc.from_template)
-				.then((doc) => {
-					frappe.model.clear_table(frm.doc, "accounts");
-					frm.set_value({
-						"company": doc.company,
-						"voucher_type": doc.voucher_type,
-						"naming_series": doc.naming_series,
-						"is_opening": doc.is_opening,
-						"multi_currency": doc.multi_currency
-					})
-					update_jv_details(frm.doc, doc.accounts);
+	from_template: function (frm) {
+		if (frm.doc.from_template) {
+			frappe.db.get_doc("Journal Entry Template", frm.doc.from_template).then((doc) => {
+				frappe.model.clear_table(frm.doc, "accounts");
+				frm.set_value({
+					company: doc.company,
+					voucher_type: doc.voucher_type,
+					naming_series: doc.naming_series,
+					is_opening: doc.is_opening,
+					multi_currency: doc.multi_currency,
 				});
+				update_jv_details(frm.doc, doc.accounts);
+			});
 		}
-	}
+	},
 });
 
-var update_jv_details = function(doc, r) {
-	$.each(r, function(i, d) {
+var update_jv_details = function (doc, r) {
+	$.each(r, function (i, d) {
 		var row = frappe.model.add_child(doc, "Journal Entry Account", "accounts");
-		frappe.model.set_value(row.doctype, row.name, "account", d.account)
+		frappe.model.set_value(row.doctype, row.name, "account", d.account);
 	});
 	refresh_field("accounts");
-}
+};
 
 erpnext.accounts.JournalEntry = class JournalEntry extends frappe.ui.form.Controller {
 	onload() {
@@ -220,69 +260,67 @@
 
 	load_defaults() {
 		//this.frm.show_print_first = true;
-		if(this.frm.doc.__islocal && this.frm.doc.company) {
+		if (this.frm.doc.__islocal && this.frm.doc.company) {
 			frappe.model.set_default_values(this.frm.doc);
-			$.each(this.frm.doc.accounts || [], function(i, jvd) {
+			$.each(this.frm.doc.accounts || [], function (i, jvd) {
 				frappe.model.set_default_values(jvd);
 			});
 			var posting_date = this.frm.doc.posting_date;
-			if(!this.frm.doc.amended_from) this.frm.set_value('posting_date', posting_date || frappe.datetime.get_today());
+			if (!this.frm.doc.amended_from)
+				this.frm.set_value("posting_date", posting_date || frappe.datetime.get_today());
 		}
 	}
 
 	setup_queries() {
 		var me = this;
 
-		me.frm.set_query("account", "accounts", function(doc, cdt, cdn) {
+		me.frm.set_query("account", "accounts", function (doc, cdt, cdn) {
 			return erpnext.journal_entry.account_query(me.frm);
 		});
 
-		me.frm.set_query("party_type", "accounts", function(doc, cdt, cdn) {
+		me.frm.set_query("party_type", "accounts", function (doc, cdt, cdn) {
 			const row = locals[cdt][cdn];
 
 			return {
 				query: "erpnext.setup.doctype.party_type.party_type.get_party_type",
 				filters: {
-					'account': row.account
-				}
-			}
+					account: row.account,
+				},
+			};
 		});
 
-		me.frm.set_query("reference_name", "accounts", function(doc, cdt, cdn) {
+		me.frm.set_query("reference_name", "accounts", function (doc, cdt, cdn) {
 			var jvd = frappe.get_doc(cdt, cdn);
 
 			// journal entry
-			if(jvd.reference_type==="Journal Entry") {
+			if (jvd.reference_type === "Journal Entry") {
 				frappe.model.validate_missing(jvd, "account");
 				return {
 					query: "erpnext.accounts.doctype.journal_entry.journal_entry.get_against_jv",
 					filters: {
 						account: jvd.account,
-						party: jvd.party
-					}
+						party: jvd.party,
+					},
 				};
 			}
 
 			var out = {
-				filters: [
-					[jvd.reference_type, "docstatus", "=", 1]
-				]
+				filters: [[jvd.reference_type, "docstatus", "=", 1]],
 			};
 
-			if(in_list(["Sales Invoice", "Purchase Invoice"], jvd.reference_type)) {
+			if (in_list(["Sales Invoice", "Purchase Invoice"], jvd.reference_type)) {
 				out.filters.push([jvd.reference_type, "outstanding_amount", "!=", 0]);
 				// Filter by cost center
-				if(jvd.cost_center) {
+				if (jvd.cost_center) {
 					out.filters.push([jvd.reference_type, "cost_center", "in", ["", jvd.cost_center]]);
 				}
 				// account filter
 				frappe.model.validate_missing(jvd, "account");
-				var party_account_field = jvd.reference_type==="Sales Invoice" ? "debit_to": "credit_to";
+				var party_account_field = jvd.reference_type === "Sales Invoice" ? "debit_to" : "credit_to";
 				out.filters.push([jvd.reference_type, party_account_field, "=", jvd.account]);
-
 			}
 
-			if(in_list(["Sales Order", "Purchase Order"], jvd.reference_type)) {
+			if (in_list(["Sales Order", "Purchase Order"], jvd.reference_type)) {
 				// party_type and party mandatory
 				frappe.model.validate_missing(jvd, "party_type");
 				frappe.model.validate_missing(jvd, "party");
@@ -290,11 +328,11 @@
 				out.filters.push([jvd.reference_type, "per_billed", "<", 100]);
 			}
 
-			if(jvd.party_type && jvd.party) {
+			if (jvd.party_type && jvd.party) {
 				let party_field = "";
-				if(jvd.reference_type.indexOf("Sales")===0) {
+				if (jvd.reference_type.indexOf("Sales") === 0) {
 					party_field = "customer";
-				} else if (jvd.reference_type.indexOf("Purchase")===0) {
+				} else if (jvd.reference_type.indexOf("Purchase") === 0) {
 					party_field = "supplier";
 				}
 
@@ -305,51 +343,49 @@
 
 			return out;
 		});
-
-
 	}
 
 	reference_name(doc, cdt, cdn) {
 		var d = frappe.get_doc(cdt, cdn);
 
-		if(d.reference_name) {
-			if (d.reference_type==="Purchase Invoice" && !flt(d.debit)) {
-				this.get_outstanding('Purchase Invoice', d.reference_name, doc.company, d);
-			} else if (d.reference_type==="Sales Invoice" && !flt(d.credit)) {
-				this.get_outstanding('Sales Invoice', d.reference_name, doc.company, d);
-			} else if (d.reference_type==="Journal Entry" && !flt(d.credit) && !flt(d.debit)) {
-				this.get_outstanding('Journal Entry', d.reference_name, doc.company, d);
+		if (d.reference_name) {
+			if (d.reference_type === "Purchase Invoice" && !flt(d.debit)) {
+				this.get_outstanding("Purchase Invoice", d.reference_name, doc.company, d);
+			} else if (d.reference_type === "Sales Invoice" && !flt(d.credit)) {
+				this.get_outstanding("Sales Invoice", d.reference_name, doc.company, d);
+			} else if (d.reference_type === "Journal Entry" && !flt(d.credit) && !flt(d.debit)) {
+				this.get_outstanding("Journal Entry", d.reference_name, doc.company, d);
 			}
 		}
 	}
 
 	get_outstanding(doctype, docname, company, child) {
 		var args = {
-			"doctype": doctype,
-			"docname": docname,
-			"party": child.party,
-			"account": child.account,
-			"account_currency": child.account_currency,
-			"company": company
-		}
+			doctype: doctype,
+			docname: docname,
+			party: child.party,
+			account: child.account,
+			account_currency: child.account_currency,
+			company: company,
+		};
 
 		return frappe.call({
 			method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_outstanding",
-			args: { args: args},
-			callback: function(r) {
-				if(r.message) {
-					$.each(r.message, function(field, value) {
+			args: { args: args },
+			callback: function (r) {
+				if (r.message) {
+					$.each(r.message, function (field, value) {
 						frappe.model.set_value(child.doctype, child.name, field, value);
-					})
+					});
 				}
-			}
+			},
 		});
 	}
 
 	accounts_add(doc, cdt, cdn) {
 		var row = frappe.get_doc(cdt, cdn);
-		$.each(doc.accounts, function(i, d) {
-			if(d.account && d.party && d.party_type) {
+		$.each(doc.accounts, function (i, d) {
+			if (d.account && d.party && d.party_type) {
 				row.account = d.account;
 				row.party = d.party;
 				row.party_type = d.party_type;
@@ -357,8 +393,8 @@
 		});
 
 		// set difference
-		if(doc.difference) {
-			if(doc.difference > 0) {
+		if (doc.difference) {
+			if (doc.difference > 0) {
 				row.credit_in_account_currency = doc.difference;
 				row.credit = doc.difference;
 			} else {
@@ -368,41 +404,43 @@
 		}
 		cur_frm.cscript.update_totals(doc);
 
-		erpnext.accounts.dimensions.copy_dimension_from_first_row(this.frm, cdt, cdn, 'accounts');
+		erpnext.accounts.dimensions.copy_dimension_from_first_row(this.frm, cdt, cdn, "accounts");
 	}
-
 };
 
 cur_frm.script_manager.make(erpnext.accounts.JournalEntry);
 
-cur_frm.cscript.update_totals = function(doc) {
-	var td=0.0; var tc =0.0;
+cur_frm.cscript.update_totals = function (doc) {
+	var td = 0.0;
+	var tc = 0.0;
 	var accounts = doc.accounts || [];
-	for(var i in accounts) {
+	for (var i in accounts) {
 		td += flt(accounts[i].debit, precision("debit", accounts[i]));
 		tc += flt(accounts[i].credit, precision("credit", accounts[i]));
 	}
 	doc = locals[doc.doctype][doc.name];
 	doc.total_debit = td;
 	doc.total_credit = tc;
-	doc.difference = flt((td - tc), precision("difference"));
-	refresh_many(['total_debit','total_credit','difference']);
-}
+	doc.difference = flt(td - tc, precision("difference"));
+	refresh_many(["total_debit", "total_credit", "difference"]);
+};
 
-cur_frm.cscript.get_balance = function(doc,dt,dn) {
+cur_frm.cscript.get_balance = function (doc, dt, dn) {
 	cur_frm.cscript.update_totals(doc);
-	cur_frm.call('get_balance', null, () => { cur_frm.refresh(); });
-}
+	cur_frm.call("get_balance", null, () => {
+		cur_frm.refresh();
+	});
+};
 
-cur_frm.cscript.validate = function(doc,cdt,cdn) {
+cur_frm.cscript.validate = function (doc, cdt, cdn) {
 	cur_frm.cscript.update_totals(doc);
-}
+};
 
 frappe.ui.form.on("Journal Entry Account", {
-	party: function(frm, cdt, cdn) {
+	party: function (frm, cdt, cdn) {
 		var d = frappe.get_doc(cdt, cdn);
-		if(!d.account && d.party_type && d.party) {
-			if(!frm.doc.company) frappe.throw(__("Please select Company"));
+		if (!d.account && d.party_type && d.party) {
+			if (!frm.doc.company) frappe.throw(__("Please select Company"));
 			return frm.call({
 				method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_party_account_and_currency",
 				child: d,
@@ -410,89 +448,97 @@
 					company: frm.doc.company,
 					party_type: d.party_type,
 					party: d.party,
-				}
+				},
 			});
 		}
 	},
-	cost_center: function(frm, dt, dn) {
+	cost_center: function (frm, dt, dn) {
 		erpnext.journal_entry.set_account_details(frm, dt, dn);
 	},
 
-	account: function(frm, dt, dn) {
+	account: function (frm, dt, dn) {
 		erpnext.journal_entry.set_account_details(frm, dt, dn);
 	},
 
-	debit_in_account_currency: function(frm, cdt, cdn) {
+	debit_in_account_currency: function (frm, cdt, cdn) {
 		erpnext.journal_entry.set_exchange_rate(frm, cdt, cdn);
 	},
 
-	credit_in_account_currency: function(frm, cdt, cdn) {
+	credit_in_account_currency: function (frm, cdt, cdn) {
 		erpnext.journal_entry.set_exchange_rate(frm, cdt, cdn);
 	},
 
-	debit: function(frm, dt, dn) {
+	debit: function (frm, dt, dn) {
 		cur_frm.cscript.update_totals(frm.doc);
 	},
 
-	credit: function(frm, dt, dn) {
+	credit: function (frm, dt, dn) {
 		cur_frm.cscript.update_totals(frm.doc);
 	},
 
-	exchange_rate: function(frm, cdt, cdn) {
+	exchange_rate: function (frm, cdt, cdn) {
 		var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
 		var row = locals[cdt][cdn];
 
-		if(row.account_currency == company_currency || !frm.doc.multi_currency) {
+		if (row.account_currency == company_currency || !frm.doc.multi_currency) {
 			frappe.model.set_value(cdt, cdn, "exchange_rate", 1);
 		}
 
 		erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
-	}
-})
+	},
+});
 
-frappe.ui.form.on("Journal Entry Account", "accounts_remove", function(frm) {
+frappe.ui.form.on("Journal Entry Account", "accounts_remove", function (frm) {
 	cur_frm.cscript.update_totals(frm.doc);
 });
 
 $.extend(erpnext.journal_entry, {
-	toggle_fields_based_on_currency: function(frm) {
+	toggle_fields_based_on_currency: function (frm) {
 		var fields = ["currency_section", "account_currency", "exchange_rate", "debit", "credit"];
 
 		var grid = frm.get_field("accounts").grid;
-		if(grid) grid.set_column_disp(fields, frm.doc.multi_currency);
+		if (grid) grid.set_column_disp(fields, frm.doc.multi_currency);
 
 		// dynamic label
 		var field_label_map = {
-			"debit_in_account_currency": "Debit",
-			"credit_in_account_currency": "Credit"
+			debit_in_account_currency: "Debit",
+			credit_in_account_currency: "Credit",
 		};
 
 		$.each(field_label_map, function (fieldname, label) {
 			frm.fields_dict.accounts.grid.update_docfield_property(
 				fieldname,
-				'label',
-				frm.doc.multi_currency ? (label + " in Account Currency") : label
+				"label",
+				frm.doc.multi_currency ? label + " in Account Currency" : label
 			);
-		})
+		});
 	},
 
-	set_debit_credit_in_company_currency: function(frm, cdt, cdn) {
+	set_debit_credit_in_company_currency: function (frm, cdt, cdn) {
 		var row = locals[cdt][cdn];
 
-		frappe.model.set_value(cdt, cdn, "debit",
-			flt(flt(row.debit_in_account_currency)*row.exchange_rate, precision("debit", row)));
+		frappe.model.set_value(
+			cdt,
+			cdn,
+			"debit",
+			flt(flt(row.debit_in_account_currency) * row.exchange_rate, precision("debit", row))
+		);
 
-		frappe.model.set_value(cdt, cdn, "credit",
-			flt(flt(row.credit_in_account_currency)*row.exchange_rate, precision("credit", row)));
+		frappe.model.set_value(
+			cdt,
+			cdn,
+			"credit",
+			flt(flt(row.credit_in_account_currency) * row.exchange_rate, precision("credit", row))
+		);
 
 		cur_frm.cscript.update_totals(frm.doc);
 	},
 
-	set_exchange_rate: function(frm, cdt, cdn) {
+	set_exchange_rate: function (frm, cdt, cdn) {
 		var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
 		var row = locals[cdt][cdn];
 
-		if(row.account_currency == company_currency || !frm.doc.multi_currency) {
+		if (row.account_currency == company_currency || !frm.doc.multi_currency) {
 			row.exchange_rate = 1;
 			erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
 		} else if (!row.exchange_rate || row.exchange_rate == 1 || row.account_type == "Bank") {
@@ -507,50 +553,70 @@
 					reference_name: cstr(row.reference_name),
 					debit: flt(row.debit_in_account_currency),
 					credit: flt(row.credit_in_account_currency),
-					exchange_rate: row.exchange_rate
+					exchange_rate: row.exchange_rate,
 				},
-				callback: function(r) {
-					if(r.message) {
+				callback: function (r) {
+					if (r.message) {
 						row.exchange_rate = r.message;
 						erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
 					}
-				}
-			})
+				},
+			});
 		} else {
 			erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
 		}
 		refresh_field("exchange_rate", cdn, "accounts");
 	},
 
-	quick_entry: function(frm) {
+	quick_entry: function (frm) {
 		var naming_series_options = frm.fields_dict.naming_series.df.options;
-		var naming_series_default = frm.fields_dict.naming_series.df.default || naming_series_options.split("\n")[0];
+		var naming_series_default =
+			frm.fields_dict.naming_series.df.default || naming_series_options.split("\n")[0];
 
 		var dialog = new frappe.ui.Dialog({
 			title: __("Quick Journal Entry"),
 			fields: [
-				{fieldtype: "Currency", fieldname: "debit", label: __("Amount"), reqd: 1},
-				{fieldtype: "Link", fieldname: "debit_account", label: __("Debit Account"), reqd: 1,
+				{ fieldtype: "Currency", fieldname: "debit", label: __("Amount"), reqd: 1 },
+				{
+					fieldtype: "Link",
+					fieldname: "debit_account",
+					label: __("Debit Account"),
+					reqd: 1,
 					options: "Account",
-					get_query: function() {
+					get_query: function () {
 						return erpnext.journal_entry.account_query(frm);
-					}
+					},
 				},
-				{fieldtype: "Link", fieldname: "credit_account", label: __("Credit Account"), reqd: 1,
+				{
+					fieldtype: "Link",
+					fieldname: "credit_account",
+					label: __("Credit Account"),
+					reqd: 1,
 					options: "Account",
-					get_query: function() {
+					get_query: function () {
 						return erpnext.journal_entry.account_query(frm);
-					}
+					},
 				},
-				{fieldtype: "Date", fieldname: "posting_date", label: __("Date"), reqd: 1,
-					default: frm.doc.posting_date},
-				{fieldtype: "Small Text", fieldname: "user_remark", label: __("User Remark")},
-				{fieldtype: "Select", fieldname: "naming_series", label: __("Series"), reqd: 1,
-					options: naming_series_options, default: naming_series_default},
-			]
+				{
+					fieldtype: "Date",
+					fieldname: "posting_date",
+					label: __("Date"),
+					reqd: 1,
+					default: frm.doc.posting_date,
+				},
+				{ fieldtype: "Small Text", fieldname: "user_remark", label: __("User Remark") },
+				{
+					fieldtype: "Select",
+					fieldname: "naming_series",
+					label: __("Series"),
+					reqd: 1,
+					options: naming_series_options,
+					default: naming_series_default,
+				},
+			],
 		});
 
-		dialog.set_primary_action(__("Save"), function() {
+		dialog.set_primary_action(__("Save"), function () {
 			var btn = this;
 			var values = dialog.get_values();
 
@@ -567,11 +633,21 @@
 
 			var debit_row = frm.fields_dict.accounts.grid.add_new_row();
 			frappe.model.set_value(debit_row.doctype, debit_row.name, "account", values.debit_account);
-			frappe.model.set_value(debit_row.doctype, debit_row.name, "debit_in_account_currency", values.debit);
+			frappe.model.set_value(
+				debit_row.doctype,
+				debit_row.name,
+				"debit_in_account_currency",
+				values.debit
+			);
 
 			var credit_row = frm.fields_dict.accounts.grid.add_new_row();
 			frappe.model.set_value(credit_row.doctype, credit_row.name, "account", values.credit_account);
-			frappe.model.set_value(credit_row.doctype, credit_row.name, "credit_in_account_currency", values.debit);
+			frappe.model.set_value(
+				credit_row.doctype,
+				credit_row.name,
+				"credit_in_account_currency",
+				values.debit
+			);
 
 			frm.save();
 
@@ -581,33 +657,36 @@
 		dialog.show();
 	},
 
-	account_query: function(frm) {
+	account_query: function (frm) {
 		var filters = {
 			company: frm.doc.company,
-			is_group: 0
+			is_group: 0,
 		};
-		if(!frm.doc.multi_currency) {
+		if (!frm.doc.multi_currency) {
 			$.extend(filters, {
-				account_currency: ['in', [frappe.get_doc(":Company", frm.doc.company).default_currency, null]]
+				account_currency: [
+					"in",
+					[frappe.get_doc(":Company", frm.doc.company).default_currency, null],
+				],
 			});
 		}
 		return { filters: filters };
 	},
 
-	reverse_journal_entry: function() {
+	reverse_journal_entry: function () {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.accounts.doctype.journal_entry.journal_entry.make_reverse_journal_entry",
-			frm: cur_frm
-		})
+			frm: cur_frm,
+		});
 	},
 });
 
 $.extend(erpnext.journal_entry, {
-	set_account_details: function(frm, dt, dn) {
+	set_account_details: function (frm, dt, dn) {
 		var d = locals[dt][dn];
-		if(d.account) {
-			if(!frm.doc.company) frappe.throw(__("Please select Company first"));
-			if(!frm.doc.posting_date) frappe.throw(__("Please select Posting Date first"));
+		if (d.account) {
+			if (!frm.doc.company) frappe.throw(__("Please select Company first"));
+			if (!frm.doc.posting_date) frappe.throw(__("Please select Posting Date first"));
 
 			return frappe.call({
 				method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_account_details_and_party_type",
@@ -619,13 +698,13 @@
 					credit: flt(d.credit_in_account_currency),
 					exchange_rate: d.exchange_rate,
 				},
-				callback: function(r) {
-					if(r.message) {
+				callback: function (r) {
+					if (r.message) {
 						$.extend(d, r.message);
 						erpnext.journal_entry.set_debit_credit_in_company_currency(frm, dt, dn);
-						refresh_field('accounts');
+						refresh_field("accounts");
 					}
-				}
+				},
 			});
 		}
 	},
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry_list.js b/erpnext/accounts/doctype/journal_entry/journal_entry_list.js
index acd17cb..4ef7b99 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry_list.js
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry_list.js
@@ -1,18 +1,8 @@
 frappe.listview_settings["Journal Entry"] = {
-	add_fields: [
-		"voucher_type",
-		"posting_date",
-		"total_debit",
-		"company",
-		"user_remark",
-	],
+	add_fields: ["voucher_type", "posting_date", "total_debit", "company", "user_remark"],
 	get_indicator: function (doc) {
 		if (doc.docstatus === 1) {
-			return [
-				__(doc.voucher_type),
-				"blue",
-				`voucher_type,=,${doc.voucher_type}`,
-			];
+			return [__(doc.voucher_type), "blue", `voucher_type,=,${doc.voucher_type}`];
 		}
 	},
 };
diff --git a/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.js b/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.js
index 7d80754..cfd6ccf 100644
--- a/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.js
+++ b/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.js
@@ -2,78 +2,85 @@
 // For license information, please see license.txt
 
 frappe.ui.form.on("Journal Entry Template", {
-	onload: function(frm) {
-		if(frm.is_new()) {
+	onload: function (frm) {
+		if (frm.is_new()) {
 			frappe.call({
 				type: "GET",
 				method: "erpnext.accounts.doctype.journal_entry_template.journal_entry_template.get_naming_series",
-				callback: function(r){
-					if(r.message) {
+				callback: function (r) {
+					if (r.message) {
 						frm.set_df_property("naming_series", "options", r.message.split("\n"));
 						frm.set_value("naming_series", r.message.split("\n")[0]);
 						frm.refresh_field("naming_series");
 					}
-				}
+				},
 			});
 		}
 	},
-	refresh: function(frm) {
+	refresh: function (frm) {
 		frappe.model.set_default_values(frm.doc);
 
-		frm.set_query("account" ,"accounts", function(){
+		frm.set_query("account", "accounts", function () {
 			var filters = {
 				company: frm.doc.company,
-				is_group: 0
+				is_group: 0,
 			};
 
-			if(!frm.doc.multi_currency) {
+			if (!frm.doc.multi_currency) {
 				$.extend(filters, {
-					account_currency: ['in', [frappe.get_doc(":Company", frm.doc.company).default_currency, null]]
+					account_currency: [
+						"in",
+						[frappe.get_doc(":Company", frm.doc.company).default_currency, null],
+					],
 				});
 			}
 
 			return { filters: filters };
 		});
 	},
-	voucher_type: function(frm) {
-		var add_accounts = function(doc, r) {
-			$.each(r, function(i, d) {
+	voucher_type: function (frm) {
+		var add_accounts = function (doc, r) {
+			$.each(r, function (i, d) {
 				var row = frappe.model.add_child(doc, "Journal Entry Template Account", "accounts");
 				row.account = d.account;
 			});
 			refresh_field("accounts");
 		};
 
-		if(!frm.doc.company) return;
+		if (!frm.doc.company) return;
 
 		frm.trigger("clear_child");
-		switch(frm.doc.voucher_type){
+		switch (frm.doc.voucher_type) {
 			case "Bank Entry":
 			case "Cash Entry":
 				frappe.call({
 					type: "GET",
 					method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_default_bank_cash_account",
 					args: {
-						"account_type": (frm.doc.voucher_type=="Bank Entry" ?
-							"Bank" : (frm.doc.voucher_type=="Cash Entry" ? "Cash" : null)),
-						"company": frm.doc.company
+						account_type:
+							frm.doc.voucher_type == "Bank Entry"
+								? "Bank"
+								: frm.doc.voucher_type == "Cash Entry"
+								? "Cash"
+								: null,
+						company: frm.doc.company,
 					},
-					callback: function(r) {
-						if(r.message) {
+					callback: function (r) {
+						if (r.message) {
 							// If default company bank account not set
-							if(!$.isEmptyObject(r.message)){
+							if (!$.isEmptyObject(r.message)) {
 								add_accounts(frm.doc, [r.message]);
 							}
 						}
-					}
+					},
 				});
 				break;
 			default:
 				frm.trigger("clear_child");
 		}
 	},
-	clear_child: function(frm){
+	clear_child: function (frm) {
 		frappe.model.clear_table(frm.doc, "accounts");
 		frm.refresh_field("accounts");
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/ledger_merge/ledger_merge.js b/erpnext/accounts/doctype/ledger_merge/ledger_merge.js
index b2db98d..6faae84 100644
--- a/erpnext/accounts/doctype/ledger_merge/ledger_merge.js
+++ b/erpnext/accounts/doctype/ledger_merge/ledger_merge.js
@@ -1,9 +1,9 @@
 // Copyright (c) 2021, Wahni Green Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Ledger Merge', {
-	setup: function(frm) {
-		frappe.realtime.on('ledger_merge_refresh', ({ ledger_merge }) => {
+frappe.ui.form.on("Ledger Merge", {
+	setup: function (frm) {
+		frappe.realtime.on("ledger_merge_refresh", ({ ledger_merge }) => {
 			if (ledger_merge !== frm.doc.name) return;
 			frappe.model.clear_doc(frm.doc.doctype, frm.doc.name);
 			frappe.model.with_doc(frm.doc.doctype, frm.doc.name).then(() => {
@@ -11,29 +11,29 @@
 			});
 		});
 
-		frappe.realtime.on('ledger_merge_progress', data => {
+		frappe.realtime.on("ledger_merge_progress", (data) => {
 			if (data.ledger_merge !== frm.doc.name) return;
-			let message = __('Merging {0} of {1}', [data.current, data.total]);
+			let message = __("Merging {0} of {1}", [data.current, data.total]);
 			let percent = Math.floor((data.current * 100) / data.total);
-			frm.dashboard.show_progress(__('Merge Progress'), percent, message);
-			frm.page.set_indicator(__('In Progress'), 'orange');
+			frm.dashboard.show_progress(__("Merge Progress"), percent, message);
+			frm.page.set_indicator(__("In Progress"), "orange");
 		});
 
-		frm.set_query("account", function(doc) {
-			if (!doc.company) frappe.throw(__('Please set Company'));
-			if (!doc.root_type) frappe.throw(__('Please set Root Type'));
+		frm.set_query("account", function (doc) {
+			if (!doc.company) frappe.throw(__("Please set Company"));
+			if (!doc.root_type) frappe.throw(__("Please set Root Type"));
 			return {
 				filters: {
 					root_type: doc.root_type,
-					company: doc.company
-				}
+					company: doc.company,
+				},
 			};
 		});
 
-		frm.set_query('account', 'merge_accounts', function(doc) {
-			if (!doc.company) frappe.throw(__('Please set Company'));
-			if (!doc.root_type) frappe.throw(__('Please set Root Type'));
-			if (!doc.account) frappe.throw(__('Please set Account'));
+		frm.set_query("account", "merge_accounts", function (doc) {
+			if (!doc.company) frappe.throw(__("Please set Company"));
+			if (!doc.root_type) frappe.throw(__("Please set Root Type"));
+			if (!doc.account) frappe.throw(__("Please set Account"));
 			let acc = [doc.account];
 			frm.doc.merge_accounts.forEach((row) => {
 				acc.push(row.account);
@@ -43,86 +43,86 @@
 					is_group: doc.is_group,
 					root_type: doc.root_type,
 					name: ["not in", acc],
-					company: doc.company
-				}
+					company: doc.company,
+				},
 			};
 		});
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		frm.page.hide_icon_group();
-		frm.trigger('set_merge_status');
-		frm.trigger('update_primary_action');
+		frm.trigger("set_merge_status");
+		frm.trigger("update_primary_action");
 	},
 
-	after_save: function(frm) {
+	after_save: function (frm) {
 		setTimeout(() => {
-			frm.trigger('update_primary_action');
+			frm.trigger("update_primary_action");
 		}, 500);
 	},
 
-	update_primary_action: function(frm) {
+	update_primary_action: function (frm) {
 		if (frm.is_dirty()) {
 			frm.enable_save();
 			return;
 		}
 		frm.disable_save();
-		if (frm.doc.status !== 'Success') {
+		if (frm.doc.status !== "Success") {
 			if (!frm.is_new()) {
-				let label = frm.doc.status === 'Pending' ? __('Start Merge') : __('Retry');
+				let label = frm.doc.status === "Pending" ? __("Start Merge") : __("Retry");
 				frm.page.set_primary_action(label, () => frm.events.start_merge(frm));
 			} else {
-				frm.page.set_primary_action(__('Save'), () => frm.save());
+				frm.page.set_primary_action(__("Save"), () => frm.save());
 			}
 		}
 	},
 
-	start_merge: function(frm) {
+	start_merge: function (frm) {
 		frm.call({
-			method: 'form_start_merge',
+			method: "form_start_merge",
 			args: { docname: frm.doc.name },
-			btn: frm.page.btn_primary
-		}).then(r => {
+			btn: frm.page.btn_primary,
+		}).then((r) => {
 			if (r.message === true) {
 				frm.disable_save();
 			}
 		});
 	},
 
-	set_merge_status: function(frm) {
+	set_merge_status: function (frm) {
 		if (frm.doc.status == "Pending") return;
 		let successful_records = 0;
 		frm.doc.merge_accounts.forEach((row) => {
 			if (row.merged) successful_records += 1;
 		});
 		let message_args = [successful_records, frm.doc.merge_accounts.length];
-		frm.dashboard.set_headline(__('Successfully merged {0} out of {1}.', message_args));
+		frm.dashboard.set_headline(__("Successfully merged {0} out of {1}.", message_args));
 	},
 
-	root_type: function(frm) {
-		frm.set_value('account', '');
-		frm.set_value('merge_accounts', []);
+	root_type: function (frm) {
+		frm.set_value("account", "");
+		frm.set_value("merge_accounts", []);
 	},
 
-	company: function(frm) {
-		frm.set_value('account', '');
-		frm.set_value('merge_accounts', []);
-	}
+	company: function (frm) {
+		frm.set_value("account", "");
+		frm.set_value("merge_accounts", []);
+	},
 });
 
-frappe.ui.form.on('Ledger Merge Accounts', {
-	merge_accounts_add: function(frm) {
-		frm.trigger('update_primary_action');
+frappe.ui.form.on("Ledger Merge Accounts", {
+	merge_accounts_add: function (frm) {
+		frm.trigger("update_primary_action");
 	},
 
-	merge_accounts_remove: function(frm) {
-		frm.trigger('update_primary_action');
+	merge_accounts_remove: function (frm) {
+		frm.trigger("update_primary_action");
 	},
 
-	account: function(frm, cdt, cdn) {
+	account: function (frm, cdt, cdn) {
 		let row = frappe.get_doc(cdt, cdn);
 		row.account_name = row.account;
-		frm.refresh_field('merge_accounts');
-		frm.trigger('update_primary_action');
-	}
+		frm.refresh_field("merge_accounts");
+		frm.trigger("update_primary_action");
+	},
 });
diff --git a/erpnext/accounts/doctype/loyalty_point_entry/loyalty_point_entry.js b/erpnext/accounts/doctype/loyalty_point_entry/loyalty_point_entry.js
index d7dc7f3..d522f6d 100644
--- a/erpnext/accounts/doctype/loyalty_point_entry/loyalty_point_entry.js
+++ b/erpnext/accounts/doctype/loyalty_point_entry/loyalty_point_entry.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Loyalty Point Entry', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Loyalty Point Entry", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/accounts/doctype/loyalty_program/loyalty_program.js b/erpnext/accounts/doctype/loyalty_program/loyalty_program.js
index 6951b2a..4c29be3 100644
--- a/erpnext/accounts/doctype/loyalty_program/loyalty_program.js
+++ b/erpnext/accounts/doctype/loyalty_program/loyalty_program.js
@@ -3,30 +3,37 @@
 
 frappe.provide("erpnext.accounts.dimensions");
 
-frappe.ui.form.on('Loyalty Program', {
-	setup: function(frm) {
-		var help_content =
-			`<table class="table table-bordered" style="background-color: var(--scrollbar-track-color);">
+frappe.ui.form.on("Loyalty Program", {
+	setup: function (frm) {
+		var help_content = `<table class="table table-bordered" style="background-color: var(--scrollbar-track-color);">
 				<tr><td>
 					<h4>
 						<i class="fa fa-hand-right"></i>
-						${__('Notes')}
+						${__("Notes")}
 					</h4>
 					<ul>
 						<li>
-							${__("Loyalty Points will be calculated from the spent done (via the Sales Invoice), based on collection factor mentioned.")}
+							${__(
+								"Loyalty Points will be calculated from the spent done (via the Sales Invoice), based on collection factor mentioned."
+							)}
 						</li>
 						<li>
-							${__("There can be multiple tiered collection factor based on the total spent. But the conversion factor for redemption will always be same for all the tier.")}
+							${__(
+								"There can be multiple tiered collection factor based on the total spent. But the conversion factor for redemption will always be same for all the tier."
+							)}
 						</li>
 						<li>
-							${__("In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent")}
+							${__(
+								"In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent"
+							)}
 						</li>
 						<li>
 							${__("If unlimited expiry for the Loyalty Points, keep the Expiry Duration empty or 0.")}
 						</li>
 						<li>
-							${__("If Auto Opt In is checked, then the customers will be automatically linked with the concerned Loyalty Program (on save)")}
+							${__(
+								"If Auto Opt In is checked, then the customers will be automatically linked with the concerned Loyalty Program (on save)"
+							)}
 						</li>
 						<li>
 							${__("One customer can be part of only single Loyalty Program.")}
@@ -37,14 +44,14 @@
 		set_field_options("loyalty_program_help", help_content);
 	},
 
-	onload: function(frm) {
-		frm.set_query("expense_account", function(doc) {
+	onload: function (frm) {
+		frm.set_query("expense_account", function (doc) {
 			return {
 				filters: {
-					"root_type": "Expense",
-					'is_group': 0,
-					'company': doc.company
-				}
+					root_type: "Expense",
+					is_group: 0,
+					company: doc.company,
+				},
 			};
 		});
 
@@ -52,13 +59,15 @@
 		erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		if (frm.doc.loyalty_program_type === "Single Tier Program" && frm.doc.collection_rules.length > 1) {
-			frappe.throw(__("Please select the Multiple Tier Program type for more than one collection rules."));
+			frappe.throw(
+				__("Please select the Multiple Tier Program type for more than one collection rules.")
+			);
 		}
 	},
 
-	company: function(frm) {
+	company: function (frm) {
 		erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.js b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.js
index 103fa96..25d437f 100644
--- a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.js
+++ b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.js
@@ -1,16 +1,16 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.ui.form.on('Mode of Payment', {
-	setup: function(frm) {
-		frm.set_query("default_account", "accounts", function(doc, cdt, cdn) {
+frappe.ui.form.on("Mode of Payment", {
+	setup: function (frm) {
+		frm.set_query("default_account", "accounts", function (doc, cdt, cdn) {
 			let d = locals[cdt][cdn];
 			return {
 				filters: [
-					['Account', 'account_type', 'in', 'Bank, Cash, Receivable'],
-					['Account', 'is_group', '=', 0],
-					['Account', 'company', '=', d.company]
-				]
+					["Account", "account_type", "in", "Bank, Cash, Receivable"],
+					["Account", "is_group", "=", 0],
+					["Account", "company", "=", d.company],
+				],
 			};
 		});
 	},
diff --git a/erpnext/accounts/doctype/monthly_distribution/monthly_distribution.js b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution.js
index 569f008..3383534 100644
--- a/erpnext/accounts/doctype/monthly_distribution/monthly_distribution.js
+++ b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution.js
@@ -1,16 +1,16 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.ui.form.on('Monthly Distribution', {
+frappe.ui.form.on("Monthly Distribution", {
 	onload(frm) {
-		if(frm.doc.__islocal) {
-			return frm.call('get_months').then(() => {
-				frm.refresh_field('percentages');
+		if (frm.doc.__islocal) {
+			return frm.call("get_months").then(() => {
+				frm.refresh_field("percentages");
 			});
 		}
 	},
 
 	refresh(frm) {
-		frm.toggle_display('distribution_id', frm.doc.__islocal);
-	}
+		frm.toggle_display("distribution_id", frm.doc.__islocal);
+	},
 });
diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.js b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.js
index 88867d1..f1efba8 100644
--- a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.js
+++ b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.js
@@ -1,48 +1,52 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Opening Invoice Creation Tool', {
-	setup: function(frm) {
-		frm.set_query('party_type', 'invoices', function(doc, cdt, cdn) {
+frappe.ui.form.on("Opening Invoice Creation Tool", {
+	setup: function (frm) {
+		frm.set_query("party_type", "invoices", function (doc, cdt, cdn) {
 			return {
 				filters: {
-					'name': ['in', 'Customer, Supplier']
-				}
+					name: ["in", "Customer, Supplier"],
+				},
 			};
 		});
 
 		if (frm.doc.company) {
-			frm.trigger('setup_company_filters');
+			frm.trigger("setup_company_filters");
 		}
 
-		frappe.realtime.on('opening_invoice_creation_progress', data => {
+		frappe.realtime.on("opening_invoice_creation_progress", (data) => {
 			if (!frm.doc.import_in_progress) {
 				frm.dashboard.reset();
 				frm.doc.import_in_progress = true;
 			}
 			if (data.count == data.total) {
-				setTimeout(() => {
-					frm.doc.import_in_progress = false;
-					frm.clear_table("invoices");
-					frm.refresh_fields();
-					frm.page.clear_indicator();
-					frm.dashboard.hide_progress();
-					frappe.msgprint(__("Opening {0} Invoices created", [frm.doc.invoice_type]));
-				}, 1500, data.title);
+				setTimeout(
+					() => {
+						frm.doc.import_in_progress = false;
+						frm.clear_table("invoices");
+						frm.refresh_fields();
+						frm.page.clear_indicator();
+						frm.dashboard.hide_progress();
+						frappe.msgprint(__("Opening {0} Invoices created", [frm.doc.invoice_type]));
+					},
+					1500,
+					data.title
+				);
 				return;
 			}
 
 			frm.dashboard.show_progress(data.title, (data.count / data.total) * 100, data.message);
-			frm.page.set_indicator(__('In Progress'), 'orange');
+			frm.page.set_indicator(__("In Progress"), "orange");
 		});
 
 		erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		frm.disable_save();
 		!frm.doc.import_in_progress && frm.trigger("make_dashboard");
-		frm.page.set_primary_action(__('Create Invoices'), () => {
+		frm.page.set_primary_action(__("Create Invoices"), () => {
 			let btn_primary = frm.page.btn_primary.get(0);
 			return frm.call({
 				doc: frm.doc,
@@ -58,100 +62,98 @@
 		}
 	},
 
-	setup_company_filters: function(frm) {
-		frm.set_query('cost_center', 'invoices', function(doc, cdt, cdn) {
+	setup_company_filters: function (frm) {
+		frm.set_query("cost_center", "invoices", function (doc, cdt, cdn) {
 			return {
 				filters: {
-					'company': doc.company
-				}
+					company: doc.company,
+				},
 			};
 		});
 
-		frm.set_query('cost_center', function(doc) {
+		frm.set_query("cost_center", function (doc) {
 			return {
 				filters: {
-					'company': doc.company
-				}
+					company: doc.company,
+				},
 			};
 		});
 
-		frm.set_query('temporary_opening_account', 'invoices', function(doc, cdt, cdn) {
+		frm.set_query("temporary_opening_account", "invoices", function (doc, cdt, cdn) {
 			return {
 				filters: {
-					'company': doc.company
-				}
-			}
+					company: doc.company,
+				},
+			};
 		});
 	},
 
-	company: function(frm) {
+	company: function (frm) {
 		if (frm.doc.company) {
-
-			frm.trigger('setup_company_filters');
+			frm.trigger("setup_company_filters");
 
 			frappe.call({
-				method: 'erpnext.accounts.doctype.opening_invoice_creation_tool.opening_invoice_creation_tool.get_temporary_opening_account',
+				method: "erpnext.accounts.doctype.opening_invoice_creation_tool.opening_invoice_creation_tool.get_temporary_opening_account",
 				args: {
-					company: frm.doc.company
+					company: frm.doc.company,
 				},
 				callback: (r) => {
 					if (r.message) {
 						frm.doc.__onload.temporary_opening_account = r.message;
-						frm.trigger('update_invoice_table');
+						frm.trigger("update_invoice_table");
 					}
-				}
-			})
+				},
+			});
 		}
 		erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
 	},
 
-	invoice_type: function(frm) {
+	invoice_type: function (frm) {
 		$.each(frm.doc.invoices, (idx, row) => {
-			row.party_type = frm.doc.invoice_type == "Sales"? "Customer": "Supplier";
+			row.party_type = frm.doc.invoice_type == "Sales" ? "Customer" : "Supplier";
 			row.party = "";
 		});
 		frm.refresh_fields();
 	},
 
-	make_dashboard: function(frm) {
+	make_dashboard: function (frm) {
 		let max_count = frm.doc.__onload.max_count;
 		let opening_invoices_summary = frm.doc.__onload.opening_invoices_summary;
-		if(!$.isEmptyObject(opening_invoices_summary)) {
+		if (!$.isEmptyObject(opening_invoices_summary)) {
 			let section = frm.dashboard.add_section(
-				frappe.render_template('opening_invoice_creation_tool_dashboard', {
+				frappe.render_template("opening_invoice_creation_tool_dashboard", {
 					data: opening_invoices_summary,
-					max_count: max_count
+					max_count: max_count,
 				}),
 				__("Opening Invoices Summary")
 			);
 
-			section.on('click', '.invoice-link', function() {
-				let doctype = $(this).attr('data-type');
-				let company = $(this).attr('data-company');
-				frappe.set_route('List', doctype,
-					{'is_opening': 'Yes', 'company': company, 'docstatus': 1});
+			section.on("click", ".invoice-link", function () {
+				let doctype = $(this).attr("data-type");
+				let company = $(this).attr("data-company");
+				frappe.set_route("List", doctype, { is_opening: "Yes", company: company, docstatus: 1 });
 			});
 			frm.dashboard.show();
 		}
 	},
 
-	update_invoice_table: function(frm) {
+	update_invoice_table: function (frm) {
 		$.each(frm.doc.invoices, (idx, row) => {
 			if (!row.temporary_opening_account) {
 				row.temporary_opening_account = frm.doc.__onload.temporary_opening_account;
 			}
 
-			if(!row.cost_center) {
+			if (!row.cost_center) {
 				row.cost_center = frm.doc.cost_center;
 			}
 
-			row.party_type = frm.doc.invoice_type == "Sales"? "Customer": "Supplier";
+			row.party_type = frm.doc.invoice_type == "Sales" ? "Customer" : "Supplier";
 		});
-	}
+	},
 });
 
-frappe.ui.form.on('Opening Invoice Creation Tool Item', {
+frappe.ui.form.on("Opening Invoice Creation Tool Item", {
 	invoices_add: (frm) => {
-		frm.trigger('update_invoice_table');
-	}
+		frm.trigger("update_invoice_table");
+	},
 });
diff --git a/erpnext/accounts/doctype/party_link/party_link.js b/erpnext/accounts/doctype/party_link/party_link.js
index 6da9291..dfa02c4 100644
--- a/erpnext/accounts/doctype/party_link/party_link.js
+++ b/erpnext/accounts/doctype/party_link/party_link.js
@@ -1,33 +1,34 @@
 // Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Party Link', {
-	refresh: function(frm) {
-		frm.set_query('primary_role', () => {
+frappe.ui.form.on("Party Link", {
+	refresh: function (frm) {
+		frm.set_query("primary_role", () => {
 			return {
 				filters: {
-					name: ['in', ['Customer', 'Supplier']]
-				}
+					name: ["in", ["Customer", "Supplier"]],
+				},
 			};
 		});
 
-		frm.set_query('secondary_role', () => {
-			let party_types = Object.keys(frappe.boot.party_account_types)
-				.filter(p => p != frm.doc.primary_role);
+		frm.set_query("secondary_role", () => {
+			let party_types = Object.keys(frappe.boot.party_account_types).filter(
+				(p) => p != frm.doc.primary_role
+			);
 			return {
 				filters: {
-					name: ['in', party_types]
-				}
+					name: ["in", party_types],
+				},
 			};
 		});
 	},
 
 	primary_role(frm) {
-		frm.set_value('primary_party', '');
-		frm.set_value('secondary_role', '');
+		frm.set_value("primary_party", "");
+		frm.set_value("secondary_role", "");
 	},
 
 	secondary_role(frm) {
-		frm.set_value('secondary_party', '');
-	}
+		frm.set_value("secondary_party", "");
+	},
 });
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js
index 832b116..ab50c38 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.js
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js
@@ -7,11 +7,20 @@
 erpnext.accounts.taxes.setup_tax_validations("Payment Entry");
 erpnext.accounts.taxes.setup_tax_filters("Advance Taxes and Charges");
 
-frappe.ui.form.on('Payment Entry', {
-	onload: function(frm) {
-		frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice', 'Journal Entry', 'Repost Payment Ledger','Repost Accounting Ledger', 'Unreconcile Payment', 'Unreconcile Payment Entries', "Bank Transaction"];
+frappe.ui.form.on("Payment Entry", {
+	onload: function (frm) {
+		frm.ignore_doctypes_on_cancel_all = [
+			"Sales Invoice",
+			"Purchase Invoice",
+			"Journal Entry",
+			"Repost Payment Ledger",
+			"Repost Accounting Ledger",
+			"Unreconcile Payment",
+			"Unreconcile Payment Entries",
+			"Bank Transaction",
+		];
 
-		if(frm.doc.__islocal) {
+		if (frm.doc.__islocal) {
 			if (!frm.doc.paid_from) frm.set_value("paid_from_account_currency", null);
 			if (!frm.doc.paid_to) frm.set_value("paid_to_account_currency", null);
 		}
@@ -19,95 +28,97 @@
 		erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
 	},
 
-	setup: function(frm) {
-		frm.set_query("paid_from", function() {
+	setup: function (frm) {
+		frm.set_query("paid_from", function () {
 			frm.events.validate_company(frm);
 
-			var account_types = in_list(["Pay", "Internal Transfer"], frm.doc.payment_type) ?
-				["Bank", "Cash"] : [frappe.boot.party_account_types[frm.doc.party_type]];
+			var account_types = in_list(["Pay", "Internal Transfer"], frm.doc.payment_type)
+				? ["Bank", "Cash"]
+				: [frappe.boot.party_account_types[frm.doc.party_type]];
 			return {
 				filters: {
-					"account_type": ["in", account_types],
-					"is_group": 0,
-					"company": frm.doc.company
-				}
-			}
+					account_type: ["in", account_types],
+					is_group: 0,
+					company: frm.doc.company,
+				},
+			};
 		});
 
-		frm.set_query("party_type", function() {
+		frm.set_query("party_type", function () {
 			frm.events.validate_company(frm);
-			return{
+			return {
 				filters: {
-					"name": ["in", Object.keys(frappe.boot.party_account_types)],
-				}
-			}
+					name: ["in", Object.keys(frappe.boot.party_account_types)],
+				},
+			};
 		});
 
-		frm.set_query("party_bank_account", function() {
+		frm.set_query("party_bank_account", function () {
 			return {
 				filters: {
 					is_company_account: 0,
 					party_type: frm.doc.party_type,
-					party: frm.doc.party
-				}
-			}
+					party: frm.doc.party,
+				},
+			};
 		});
 
-		frm.set_query("bank_account", function() {
+		frm.set_query("bank_account", function () {
 			return {
 				filters: {
 					is_company_account: 1,
-					company: frm.doc.company
-				}
-			}
+					company: frm.doc.company,
+				},
+			};
 		});
 
-		frm.set_query("contact_person", function() {
+		frm.set_query("contact_person", function () {
 			if (frm.doc.party) {
 				return {
-					query: 'frappe.contacts.doctype.contact.contact.contact_query',
+					query: "frappe.contacts.doctype.contact.contact.contact_query",
 					filters: {
 						link_doctype: frm.doc.party_type,
-						link_name: frm.doc.party
-					}
+						link_name: frm.doc.party,
+					},
 				};
 			}
 		});
 
-		frm.set_query("paid_to", function() {
+		frm.set_query("paid_to", function () {
 			frm.events.validate_company(frm);
 
-			var account_types = in_list(["Receive", "Internal Transfer"], frm.doc.payment_type) ?
-				["Bank", "Cash"] : [frappe.boot.party_account_types[frm.doc.party_type]];
+			var account_types = in_list(["Receive", "Internal Transfer"], frm.doc.payment_type)
+				? ["Bank", "Cash"]
+				: [frappe.boot.party_account_types[frm.doc.party_type]];
 			return {
 				filters: {
-					"account_type": ["in", account_types],
-					"is_group": 0,
-					"company": frm.doc.company
-				}
-			}
+					account_type: ["in", account_types],
+					is_group: 0,
+					company: frm.doc.company,
+				},
+			};
 		});
 
-		frm.set_query("account", "deductions", function() {
+		frm.set_query("account", "deductions", function () {
 			return {
 				filters: {
-					"is_group": 0,
-					"company": frm.doc.company
-				}
-			}
+					is_group: 0,
+					company: frm.doc.company,
+				},
+			};
 		});
 
-		frm.set_query("advance_tax_account", function() {
+		frm.set_query("advance_tax_account", function () {
 			return {
 				filters: {
-					"company": frm.doc.company,
-					"root_type": ["in", ["Asset", "Liability"]],
-					"is_group": 0
-				}
-			}
+					company: frm.doc.company,
+					root_type: ["in", ["Asset", "Liability"]],
+					is_group: 0,
+				},
+			};
 		});
 
-		frm.set_query("reference_doctype", "references", function() {
+		frm.set_query("reference_doctype", "references", function () {
 			let doctypes = ["Journal Entry"];
 			if (frm.doc.party_type == "Customer") {
 				doctypes = ["Sales Order", "Sales Invoice", "Journal Entry", "Dunning"];
@@ -116,232 +127,312 @@
 			}
 
 			return {
-				filters: { "name": ["in", doctypes] }
+				filters: { name: ["in", doctypes] },
 			};
 		});
 
-		frm.set_query('payment_term', 'references', function(frm, cdt, cdn) {
+		frm.set_query("payment_term", "references", function (frm, cdt, cdn) {
 			const child = locals[cdt][cdn];
-			if (in_list(['Purchase Invoice', 'Sales Invoice'], child.reference_doctype) && child.reference_name) {
+			if (
+				in_list(["Purchase Invoice", "Sales Invoice"], child.reference_doctype) &&
+				child.reference_name
+			) {
 				return {
 					query: "erpnext.controllers.queries.get_payment_terms_for_references",
 					filters: {
-						'reference': child.reference_name
-					}
-				}
+						reference: child.reference_name,
+					},
+				};
 			}
 		});
 
-		frm.set_query("reference_name", "references", function(doc, cdt, cdn) {
+		frm.set_query("reference_name", "references", function (doc, cdt, cdn) {
 			const child = locals[cdt][cdn];
-			const filters = {"docstatus": 1, "company": doc.company};
-			const party_type_doctypes = ['Sales Invoice', 'Sales Order', 'Purchase Invoice',
-				'Purchase Order', 'Dunning'];
+			const filters = { docstatus: 1, company: doc.company };
+			const party_type_doctypes = [
+				"Sales Invoice",
+				"Sales Order",
+				"Purchase Invoice",
+				"Purchase Order",
+				"Dunning",
+			];
 
 			if (in_list(party_type_doctypes, child.reference_doctype)) {
 				filters[doc.party_type.toLowerCase()] = doc.party;
 			}
 
 			return {
-				filters: filters
+				filters: filters,
 			};
 		});
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		erpnext.hide_company(frm);
 		frm.events.hide_unhide_fields(frm);
 		frm.events.set_dynamic_labels(frm);
 		frm.events.show_general_ledger(frm);
 		erpnext.accounts.ledger_preview.show_accounting_ledger_preview(frm);
-		if((frm.doc.references) && (frm.doc.references.find((elem) => {return elem.exchange_gain_loss != 0}))) {
-			frm.add_custom_button(__("View Exchange Gain/Loss Journals"), function() {
-				frappe.set_route("List", "Journal Entry", {"voucher_type": "Exchange Gain Or Loss", "reference_name": frm.doc.name});
-			}, __('Actions'));
-
+		if (
+			frm.doc.references &&
+			frm.doc.references.find((elem) => {
+				return elem.exchange_gain_loss != 0;
+			})
+		) {
+			frm.add_custom_button(
+				__("View Exchange Gain/Loss Journals"),
+				function () {
+					frappe.set_route("List", "Journal Entry", {
+						voucher_type: "Exchange Gain Or Loss",
+						reference_name: frm.doc.name,
+					});
+				},
+				__("Actions")
+			);
 		}
 		erpnext.accounts.unreconcile_payment.add_unreconcile_btn(frm);
 	},
 
 	validate_company: (frm) => {
-		if (!frm.doc.company){
-			frappe.throw({message:__("Please select a Company first."), title: __("Mandatory")});
+		if (!frm.doc.company) {
+			frappe.throw({ message: __("Please select a Company first."), title: __("Mandatory") });
 		}
 	},
 
-	company: function(frm) {
-		frm.trigger('party');
+	company: function (frm) {
+		frm.trigger("party");
 		frm.events.hide_unhide_fields(frm);
 		frm.events.set_dynamic_labels(frm);
 		erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
 	},
 
-	contact_person: function(frm) {
+	contact_person: function (frm) {
 		frm.set_value("contact_email", "");
 		erpnext.utils.get_contact_details(frm);
 	},
 
-	hide_unhide_fields: function(frm) {
-		var company_currency = frm.doc.company? frappe.get_doc(":Company", frm.doc.company).default_currency: "";
+	hide_unhide_fields: function (frm) {
+		var company_currency = frm.doc.company
+			? frappe.get_doc(":Company", frm.doc.company).default_currency
+			: "";
 
-		frm.toggle_display("source_exchange_rate",
-			(frm.doc.paid_amount && frm.doc.paid_from_account_currency != company_currency));
+		frm.toggle_display(
+			"source_exchange_rate",
+			frm.doc.paid_amount && frm.doc.paid_from_account_currency != company_currency
+		);
 
-		frm.toggle_display("target_exchange_rate", (frm.doc.received_amount &&
-			frm.doc.paid_to_account_currency != company_currency &&
-			frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency));
+		frm.toggle_display(
+			"target_exchange_rate",
+			frm.doc.received_amount &&
+				frm.doc.paid_to_account_currency != company_currency &&
+				frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency
+		);
 
 		frm.toggle_display("base_paid_amount", frm.doc.paid_from_account_currency != company_currency);
 
 		if (frm.doc.payment_type == "Pay") {
-			frm.toggle_display("base_total_taxes_and_charges", frm.doc.total_taxes_and_charges &&
-				(frm.doc.paid_to_account_currency != company_currency));
+			frm.toggle_display(
+				"base_total_taxes_and_charges",
+				frm.doc.total_taxes_and_charges && frm.doc.paid_to_account_currency != company_currency
+			);
 		} else {
-			frm.toggle_display("base_total_taxes_and_charges", frm.doc.total_taxes_and_charges &&
-				(frm.doc.paid_from_account_currency != company_currency));
+			frm.toggle_display(
+				"base_total_taxes_and_charges",
+				frm.doc.total_taxes_and_charges && frm.doc.paid_from_account_currency != company_currency
+			);
 		}
 
-		frm.toggle_display("base_received_amount", (
-			frm.doc.paid_to_account_currency != company_currency
-			&& frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency
-			&& frm.doc.base_paid_amount != frm.doc.base_received_amount
-		));
+		frm.toggle_display(
+			"base_received_amount",
+			frm.doc.paid_to_account_currency != company_currency &&
+				frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency &&
+				frm.doc.base_paid_amount != frm.doc.base_received_amount
+		);
 
-		frm.toggle_display("received_amount", (frm.doc.payment_type=="Internal Transfer" ||
-			frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency))
+		frm.toggle_display(
+			"received_amount",
+			frm.doc.payment_type == "Internal Transfer" ||
+				frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency
+		);
 
-		frm.toggle_display(["base_total_allocated_amount"],
-			(frm.doc.paid_amount && frm.doc.received_amount && frm.doc.base_total_allocated_amount &&
-			((frm.doc.payment_type=="Receive" && frm.doc.paid_from_account_currency != company_currency) ||
-			(frm.doc.payment_type=="Pay" && frm.doc.paid_to_account_currency != company_currency))));
+		frm.toggle_display(
+			["base_total_allocated_amount"],
+			frm.doc.paid_amount &&
+				frm.doc.received_amount &&
+				frm.doc.base_total_allocated_amount &&
+				((frm.doc.payment_type == "Receive" &&
+					frm.doc.paid_from_account_currency != company_currency) ||
+					(frm.doc.payment_type == "Pay" && frm.doc.paid_to_account_currency != company_currency))
+		);
 
-		var party_amount = frm.doc.payment_type=="Receive" ?
-			frm.doc.paid_amount : frm.doc.received_amount;
+		var party_amount = frm.doc.payment_type == "Receive" ? frm.doc.paid_amount : frm.doc.received_amount;
 
-		frm.toggle_display("write_off_difference_amount", (frm.doc.difference_amount && frm.doc.party &&
-			(frm.doc.total_allocated_amount > party_amount)));
+		frm.toggle_display(
+			"write_off_difference_amount",
+			frm.doc.difference_amount && frm.doc.party && frm.doc.total_allocated_amount > party_amount
+		);
 
-		frm.toggle_display("set_exchange_gain_loss",
-			frm.doc.paid_amount && frm.doc.received_amount && frm.doc.difference_amount);
-
+		frm.toggle_display(
+			"set_exchange_gain_loss",
+			frm.doc.paid_amount && frm.doc.received_amount && frm.doc.difference_amount
+		);
 	},
 
-	set_dynamic_labels: function(frm) {
-		var company_currency = frm.doc.company? frappe.get_doc(":Company", frm.doc.company).default_currency: "";
+	set_dynamic_labels: function (frm) {
+		var company_currency = frm.doc.company
+			? frappe.get_doc(":Company", frm.doc.company).default_currency
+			: "";
 
-		frm.set_currency_labels(["base_paid_amount", "base_received_amount", "base_total_allocated_amount",
-			"difference_amount", "base_paid_amount_after_tax", "base_received_amount_after_tax",
-			"base_total_taxes_and_charges"], company_currency);
+		frm.set_currency_labels(
+			[
+				"base_paid_amount",
+				"base_received_amount",
+				"base_total_allocated_amount",
+				"difference_amount",
+				"base_paid_amount_after_tax",
+				"base_received_amount_after_tax",
+				"base_total_taxes_and_charges",
+			],
+			company_currency
+		);
 
 		frm.set_currency_labels(["paid_amount"], frm.doc.paid_from_account_currency);
 		frm.set_currency_labels(["received_amount"], frm.doc.paid_to_account_currency);
 
-		var party_account_currency = frm.doc.payment_type=="Receive" ?
-			frm.doc.paid_from_account_currency : frm.doc.paid_to_account_currency;
+		var party_account_currency =
+			frm.doc.payment_type == "Receive"
+				? frm.doc.paid_from_account_currency
+				: frm.doc.paid_to_account_currency;
 
-		frm.set_currency_labels(["total_allocated_amount", "unallocated_amount",
-			"total_taxes_and_charges"], party_account_currency);
+		frm.set_currency_labels(
+			["total_allocated_amount", "unallocated_amount", "total_taxes_and_charges"],
+			party_account_currency
+		);
 
-		var currency_field = (frm.doc.payment_type=="Receive") ? "paid_from_account_currency" : "paid_to_account_currency"
+		var currency_field =
+			frm.doc.payment_type == "Receive" ? "paid_from_account_currency" : "paid_to_account_currency";
 		frm.set_df_property("total_allocated_amount", "options", currency_field);
 		frm.set_df_property("unallocated_amount", "options", currency_field);
 		frm.set_df_property("total_taxes_and_charges", "options", currency_field);
 		frm.set_df_property("party_balance", "options", currency_field);
 
-		frm.set_currency_labels(["total_amount", "outstanding_amount", "allocated_amount"],
-			party_account_currency, "references");
+		frm.set_currency_labels(
+			["total_amount", "outstanding_amount", "allocated_amount"],
+			party_account_currency,
+			"references"
+		);
 
-		cur_frm.set_df_property("source_exchange_rate", "description",
-			("1 " + frm.doc.paid_from_account_currency + " = [?] " + company_currency));
+		cur_frm.set_df_property(
+			"source_exchange_rate",
+			"description",
+			"1 " + frm.doc.paid_from_account_currency + " = [?] " + company_currency
+		);
 
-		cur_frm.set_df_property("target_exchange_rate", "description",
-			("1 " + frm.doc.paid_to_account_currency + " = [?] " + company_currency));
+		cur_frm.set_df_property(
+			"target_exchange_rate",
+			"description",
+			"1 " + frm.doc.paid_to_account_currency + " = [?] " + company_currency
+		);
 
 		frm.refresh_fields();
 	},
 
-	show_general_ledger: function(frm) {
-		if(frm.doc.docstatus > 0) {
-			frm.add_custom_button(__('Ledger'), function() {
-				frappe.route_options = {
-					"voucher_no": frm.doc.name,
-					"from_date": frm.doc.posting_date,
-					"to_date": moment(frm.doc.modified).format('YYYY-MM-DD'),
-					"company": frm.doc.company,
-					"group_by": "",
-					"show_cancelled_entries": frm.doc.docstatus === 2
-				};
-				frappe.set_route("query-report", "General Ledger");
-			}, "fa fa-table");
+	show_general_ledger: function (frm) {
+		if (frm.doc.docstatus > 0) {
+			frm.add_custom_button(
+				__("Ledger"),
+				function () {
+					frappe.route_options = {
+						voucher_no: frm.doc.name,
+						from_date: frm.doc.posting_date,
+						to_date: moment(frm.doc.modified).format("YYYY-MM-DD"),
+						company: frm.doc.company,
+						group_by: "",
+						show_cancelled_entries: frm.doc.docstatus === 2,
+					};
+					frappe.set_route("query-report", "General Ledger");
+				},
+				"fa fa-table"
+			);
 		}
 	},
 
-	payment_type: function(frm) {
-		if(frm.doc.payment_type == "Internal Transfer") {
-			$.each(["party", "party_balance", "paid_from", "paid_to",
-				"references", "total_allocated_amount"], function(i, field) {
-				frm.set_value(field, null);
-			});
+	payment_type: function (frm) {
+		if (frm.doc.payment_type == "Internal Transfer") {
+			$.each(
+				["party", "party_balance", "paid_from", "paid_to", "references", "total_allocated_amount"],
+				function (i, field) {
+					frm.set_value(field, null);
+				}
+			);
 		} else {
-			if(frm.doc.party) {
+			if (frm.doc.party) {
 				frm.events.party(frm);
 			}
 
-			if(frm.doc.mode_of_payment) {
+			if (frm.doc.mode_of_payment) {
 				frm.events.mode_of_payment(frm);
 			}
 		}
 	},
 
-	mode_of_payment: function(frm) {
-		erpnext.accounts.pos.get_payment_mode_account(frm, frm.doc.mode_of_payment, function(account){
+	mode_of_payment: function (frm) {
+		erpnext.accounts.pos.get_payment_mode_account(frm, frm.doc.mode_of_payment, function (account) {
 			let payment_account_field = frm.doc.payment_type == "Receive" ? "paid_to" : "paid_from";
 			frm.set_value(payment_account_field, account);
-		})
+		});
 	},
 
-	party_type: function(frm) {
-
+	party_type: function (frm) {
 		let party_types = Object.keys(frappe.boot.party_account_types);
-		if(frm.doc.party_type && !party_types.includes(frm.doc.party_type)){
+		if (frm.doc.party_type && !party_types.includes(frm.doc.party_type)) {
 			frm.set_value("party_type", "");
 			frappe.throw(__("Party can only be one of {0}", [party_types.join(", ")]));
 		}
 
-		frm.set_query("party", function() {
-			if(frm.doc.party_type == 'Employee'){
+		frm.set_query("party", function () {
+			if (frm.doc.party_type == "Employee") {
 				return {
-					query: "erpnext.controllers.queries.employee_query"
-				}
-			}
-			else if(frm.doc.party_type == 'Customer'){
+					query: "erpnext.controllers.queries.employee_query",
+				};
+			} else if (frm.doc.party_type == "Customer") {
 				return {
-					query: "erpnext.controllers.queries.customer_query"
-				}
+					query: "erpnext.controllers.queries.customer_query",
+				};
 			}
 		});
 
-		if(frm.doc.party) {
-			$.each(["party", "party_balance", "paid_from", "paid_to",
-				"paid_from_account_currency", "paid_from_account_balance",
-				"paid_to_account_currency", "paid_to_account_balance",
-				"references", "total_allocated_amount"],
-				function(i, field) {
+		if (frm.doc.party) {
+			$.each(
+				[
+					"party",
+					"party_balance",
+					"paid_from",
+					"paid_to",
+					"paid_from_account_currency",
+					"paid_from_account_balance",
+					"paid_to_account_currency",
+					"paid_to_account_balance",
+					"references",
+					"total_allocated_amount",
+				],
+				function (i, field) {
 					frm.set_value(field, null);
-				})
+				}
+			);
 		}
 	},
 
-	party: function(frm) {
+	party: function (frm) {
 		if (frm.doc.contact_email || frm.doc.contact_person) {
 			frm.set_value("contact_email", "");
 			frm.set_value("contact_person", "");
 		}
-		if(frm.doc.payment_type && frm.doc.party_type && frm.doc.party && frm.doc.company) {
-			if(!frm.doc.posting_date) {
-				frappe.msgprint(__("Please select Posting Date before selecting Party"))
+		if (frm.doc.payment_type && frm.doc.party_type && frm.doc.party && frm.doc.company) {
+			if (!frm.doc.posting_date) {
+				frappe.msgprint(__("Please select Posting Date before selecting Party"));
 				frm.set_value("party", "");
-				return ;
+				return;
 			}
 			frm.set_party_account_based_on_party = true;
 
@@ -354,19 +445,25 @@
 					party_type: frm.doc.party_type,
 					party: frm.doc.party,
 					date: frm.doc.posting_date,
-					cost_center: frm.doc.cost_center
+					cost_center: frm.doc.cost_center,
 				},
-				callback: function(r, rt) {
-					if(r.message) {
+				callback: function (r, rt) {
+					if (r.message) {
 						frappe.run_serially([
 							() => {
-								if(frm.doc.payment_type == "Receive") {
+								if (frm.doc.payment_type == "Receive") {
 									frm.set_value("paid_from", r.message.party_account);
-									frm.set_value("paid_from_account_currency", r.message.party_account_currency);
+									frm.set_value(
+										"paid_from_account_currency",
+										r.message.party_account_currency
+									);
 									frm.set_value("paid_from_account_balance", r.message.account_balance);
-								} else if (frm.doc.payment_type == "Pay"){
+								} else if (frm.doc.payment_type == "Pay") {
 									frm.set_value("paid_to", r.message.party_account);
-									frm.set_value("paid_to_account_currency", r.message.party_account_currency);
+									frm.set_value(
+										"paid_to_account_currency",
+										r.message.party_account_currency
+									);
 									frm.set_value("paid_to_account_balance", r.message.account_balance);
 								}
 							},
@@ -381,32 +478,46 @@
 									frm.set_value("bank_account", r.message.bank_account);
 								}
 							},
-							() => frm.events.set_current_exchange_rate(frm, "source_exchange_rate",
-									frm.doc.paid_from_account_currency, company_currency),
-							() => frm.events.set_current_exchange_rate(frm, "target_exchange_rate",
-									frm.doc.paid_to_account_currency, company_currency)
+							() =>
+								frm.events.set_current_exchange_rate(
+									frm,
+									"source_exchange_rate",
+									frm.doc.paid_from_account_currency,
+									company_currency
+								),
+							() =>
+								frm.events.set_current_exchange_rate(
+									frm,
+									"target_exchange_rate",
+									frm.doc.paid_to_account_currency,
+									company_currency
+								),
 						]);
 					}
-				}
+				},
 			});
 		}
 	},
 
-	apply_tax_withholding_amount: function(frm) {
+	apply_tax_withholding_amount: function (frm) {
 		if (!frm.doc.apply_tax_withholding_amount) {
-			frm.set_value("tax_withholding_category", '');
+			frm.set_value("tax_withholding_category", "");
 		} else {
-			frappe.db.get_value('Supplier', frm.doc.party, 'tax_withholding_category', (values) => {
+			frappe.db.get_value("Supplier", frm.doc.party, "tax_withholding_category", (values) => {
 				frm.set_value("tax_withholding_category", values.tax_withholding_category);
 			});
 		}
 	},
 
-	paid_from: function(frm) {
-		if(frm.set_party_account_based_on_party) return;
+	paid_from: function (frm) {
+		if (frm.set_party_account_based_on_party) return;
 
-		frm.events.set_account_currency_and_balance(frm, frm.doc.paid_from,
-			"paid_from_account_currency", "paid_from_account_balance", function(frm) {
+		frm.events.set_account_currency_and_balance(
+			frm,
+			frm.doc.paid_from,
+			"paid_from_account_currency",
+			"paid_from_account_balance",
+			function (frm) {
 				if (frm.doc.payment_type == "Pay") {
 					frm.events.paid_amount(frm);
 				}
@@ -414,18 +525,21 @@
 		);
 	},
 
-	paid_to: function(frm) {
-		if(frm.set_party_account_based_on_party) return;
+	paid_to: function (frm) {
+		if (frm.set_party_account_based_on_party) return;
 
-		frm.events.set_account_currency_and_balance(frm, frm.doc.paid_to,
-			"paid_to_account_currency", "paid_to_account_balance", function(frm) {
+		frm.events.set_account_currency_and_balance(
+			frm,
+			frm.doc.paid_to,
+			"paid_to_account_currency",
+			"paid_to_account_balance",
+			function (frm) {
 				if (frm.doc.payment_type == "Receive") {
-					if(frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency) {
-						if(frm.doc.source_exchange_rate) {
+					if (frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency) {
+						if (frm.doc.source_exchange_rate) {
 							frm.set_value("target_exchange_rate", frm.doc.source_exchange_rate);
 						}
 						frm.set_value("received_amount", frm.doc.paid_amount);
-
 					} else {
 						frm.events.received_amount(frm);
 					}
@@ -434,66 +548,85 @@
 		);
 	},
 
-	set_account_currency_and_balance: function(frm, account, currency_field,
-			balance_field, callback_function) {
-
+	set_account_currency_and_balance: function (
+		frm,
+		account,
+		currency_field,
+		balance_field,
+		callback_function
+	) {
 		var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
 		if (frm.doc.posting_date && account) {
 			frappe.call({
 				method: "erpnext.accounts.doctype.payment_entry.payment_entry.get_account_details",
 				args: {
-					"account": account,
-					"date": frm.doc.posting_date,
-					"cost_center": frm.doc.cost_center
+					account: account,
+					date: frm.doc.posting_date,
+					cost_center: frm.doc.cost_center,
 				},
-				callback: function(r, rt) {
-					if(r.message) {
+				callback: function (r, rt) {
+					if (r.message) {
 						frappe.run_serially([
-							() => frm.set_value(currency_field, r.message['account_currency']),
+							() => frm.set_value(currency_field, r.message["account_currency"]),
 							() => {
-								frm.set_value(balance_field, r.message['account_balance']);
+								frm.set_value(balance_field, r.message["account_balance"]);
 
-								if(frm.doc.payment_type=="Receive" && currency_field=="paid_to_account_currency") {
-									frm.toggle_reqd(["reference_no", "reference_date"],
-										(r.message['account_type'] == "Bank" ? 1 : 0));
-									if(!frm.doc.received_amount && frm.doc.paid_amount)
+								if (
+									frm.doc.payment_type == "Receive" &&
+									currency_field == "paid_to_account_currency"
+								) {
+									frm.toggle_reqd(
+										["reference_no", "reference_date"],
+										r.message["account_type"] == "Bank" ? 1 : 0
+									);
+									if (!frm.doc.received_amount && frm.doc.paid_amount)
 										frm.events.paid_amount(frm);
-								} else if(frm.doc.payment_type=="Pay" && currency_field=="paid_from_account_currency") {
-									frm.toggle_reqd(["reference_no", "reference_date"],
-										(r.message['account_type'] == "Bank" ? 1 : 0));
+								} else if (
+									frm.doc.payment_type == "Pay" &&
+									currency_field == "paid_from_account_currency"
+								) {
+									frm.toggle_reqd(
+										["reference_no", "reference_date"],
+										r.message["account_type"] == "Bank" ? 1 : 0
+									);
 
-									if(!frm.doc.paid_amount && frm.doc.received_amount)
+									if (!frm.doc.paid_amount && frm.doc.received_amount)
 										frm.events.received_amount(frm);
 
-									if (frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency
-										&& frm.doc.paid_amount != frm.doc.received_amount) {
-											if (company_currency != frm.doc.paid_from_account_currency &&
-												frm.doc.payment_type == "Pay") {
-													frm.doc.paid_amount = frm.doc.received_amount;
-												}
+									if (
+										frm.doc.paid_from_account_currency ==
+											frm.doc.paid_to_account_currency &&
+										frm.doc.paid_amount != frm.doc.received_amount
+									) {
+										if (
+											company_currency != frm.doc.paid_from_account_currency &&
+											frm.doc.payment_type == "Pay"
+										) {
+											frm.doc.paid_amount = frm.doc.received_amount;
 										}
+									}
 								}
 							},
 							() => {
-								if(callback_function) callback_function(frm);
+								if (callback_function) callback_function(frm);
 
 								frm.events.hide_unhide_fields(frm);
 								frm.events.set_dynamic_labels(frm);
-							}
+							},
 						]);
 					}
-				}
+				},
 			});
 		}
 	},
 
-	paid_from_account_currency: function(frm) {
-		if(!frm.doc.paid_from_account_currency || !frm.doc.company) return;
+	paid_from_account_currency: function (frm) {
+		if (!frm.doc.paid_from_account_currency || !frm.doc.company) return;
 		let company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
 
 		if (frm.doc.paid_from_account_currency == company_currency) {
 			frm.set_value("source_exchange_rate", 1);
-		} else if (frm.doc.paid_from){
+		} else if (frm.doc.paid_from) {
 			if (in_list(["Internal Transfer", "Pay"], frm.doc.payment_type)) {
 				let company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
 				frappe.call({
@@ -501,52 +634,60 @@
 					args: {
 						from_currency: frm.doc.paid_from_account_currency,
 						to_currency: company_currency,
-						transaction_date: frm.doc.posting_date
+						transaction_date: frm.doc.posting_date,
 					},
-					callback: function(r, rt) {
+					callback: function (r, rt) {
 						frm.set_value("source_exchange_rate", r.message);
-					}
-				})
+					},
+				});
 			} else {
-				frm.events.set_current_exchange_rate(frm, "source_exchange_rate",
-					frm.doc.paid_from_account_currency, company_currency);
+				frm.events.set_current_exchange_rate(
+					frm,
+					"source_exchange_rate",
+					frm.doc.paid_from_account_currency,
+					company_currency
+				);
 			}
 		}
 	},
 
-	paid_to_account_currency: function(frm) {
-		if(!frm.doc.paid_to_account_currency || !frm.doc.company) return;
+	paid_to_account_currency: function (frm) {
+		if (!frm.doc.paid_to_account_currency || !frm.doc.company) return;
 		let company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
 
-		frm.events.set_current_exchange_rate(frm, "target_exchange_rate",
-			frm.doc.paid_to_account_currency, company_currency);
+		frm.events.set_current_exchange_rate(
+			frm,
+			"target_exchange_rate",
+			frm.doc.paid_to_account_currency,
+			company_currency
+		);
 	},
 
-	set_current_exchange_rate: function(frm, exchange_rate_field, from_currency, to_currency) {
+	set_current_exchange_rate: function (frm, exchange_rate_field, from_currency, to_currency) {
 		frappe.call({
 			method: "erpnext.setup.utils.get_exchange_rate",
 			args: {
 				transaction_date: frm.doc.posting_date,
 				from_currency: from_currency,
-				to_currency: to_currency
+				to_currency: to_currency,
 			},
-			callback: function(r, rt) {
+			callback: function (r, rt) {
 				const ex_rate = flt(r.message, frm.get_field(exchange_rate_field).get_precision());
 				frm.set_value(exchange_rate_field, ex_rate);
-			}
-		})
+			},
+		});
 	},
 
-	posting_date: function(frm) {
+	posting_date: function (frm) {
 		frm.events.paid_from_account_currency(frm);
 	},
 
-	source_exchange_rate: function(frm) {
+	source_exchange_rate: function (frm) {
 		let company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
 		if (frm.doc.paid_amount) {
 			frm.set_value("base_paid_amount", flt(frm.doc.paid_amount) * flt(frm.doc.source_exchange_rate));
 			// target exchange rate should always be same as source if both account currencies is same
-			if(frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency) {
+			if (frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency) {
 				frm.set_value("target_exchange_rate", frm.doc.source_exchange_rate);
 				frm.set_value("base_received_amount", frm.doc.base_paid_amount);
 			} else if (company_currency == frm.doc.paid_to_account_currency) {
@@ -563,16 +704,20 @@
 		frm.set_df_property("source_exchange_rate", "read_only", erpnext.stale_rate_allowed() ? 0 : 1);
 	},
 
-	target_exchange_rate: function(frm) {
+	target_exchange_rate: function (frm) {
 		frm.set_paid_amount_based_on_received_amount = true;
 		let company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
 
 		if (frm.doc.received_amount) {
-			frm.set_value("base_received_amount",
-				flt(frm.doc.received_amount) * flt(frm.doc.target_exchange_rate));
+			frm.set_value(
+				"base_received_amount",
+				flt(frm.doc.received_amount) * flt(frm.doc.target_exchange_rate)
+			);
 
-			if(!frm.doc.source_exchange_rate &&
-					(frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency)) {
+			if (
+				!frm.doc.source_exchange_rate &&
+				frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency
+			) {
 				frm.set_value("source_exchange_rate", frm.doc.target_exchange_rate);
 				frm.set_value("base_paid_amount", frm.doc.base_received_amount);
 			} else if (company_currency == frm.doc.paid_from_account_currency) {
@@ -590,125 +735,148 @@
 		frm.set_df_property("target_exchange_rate", "read_only", erpnext.stale_rate_allowed() ? 0 : 1);
 	},
 
-	paid_amount: function(frm) {
+	paid_amount: function (frm) {
 		frm.set_value("base_paid_amount", flt(frm.doc.paid_amount) * flt(frm.doc.source_exchange_rate));
 		frm.trigger("reset_received_amount");
 		frm.events.hide_unhide_fields(frm);
 	},
 
-	received_amount: function(frm) {
+	received_amount: function (frm) {
 		frm.set_paid_amount_based_on_received_amount = true;
 
-		if(!frm.doc.paid_amount && frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency) {
+		if (!frm.doc.paid_amount && frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency) {
 			frm.set_value("paid_amount", frm.doc.received_amount);
 
-			if(frm.doc.target_exchange_rate) {
+			if (frm.doc.target_exchange_rate) {
 				frm.set_value("source_exchange_rate", frm.doc.target_exchange_rate);
 			}
 			frm.set_value("base_paid_amount", frm.doc.base_received_amount);
 		}
 
-		frm.set_value("base_received_amount",
-			flt(frm.doc.received_amount) * flt(frm.doc.target_exchange_rate));
+		frm.set_value(
+			"base_received_amount",
+			flt(frm.doc.received_amount) * flt(frm.doc.target_exchange_rate)
+		);
 
-		if(frm.doc.payment_type == "Pay")
+		if (frm.doc.payment_type == "Pay")
 			frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.received_amount, 1);
-		else
-			frm.events.set_unallocated_amount(frm);
+		else frm.events.set_unallocated_amount(frm);
 
 		frm.set_paid_amount_based_on_received_amount = false;
 		frm.events.hide_unhide_fields(frm);
 	},
 
-	reset_received_amount: function(frm) {
-		if(!frm.set_paid_amount_based_on_received_amount &&
-				(frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency)) {
-
+	reset_received_amount: function (frm) {
+		if (
+			!frm.set_paid_amount_based_on_received_amount &&
+			frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency
+		) {
 			frm.set_value("received_amount", frm.doc.paid_amount);
 
-			if(frm.doc.source_exchange_rate) {
+			if (frm.doc.source_exchange_rate) {
 				frm.set_value("target_exchange_rate", frm.doc.source_exchange_rate);
 			}
 			frm.set_value("base_received_amount", frm.doc.base_paid_amount);
 		}
 
-		if(frm.doc.payment_type == "Receive")
+		if (frm.doc.payment_type == "Receive")
 			frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.paid_amount, 1);
-		else
-			frm.events.set_unallocated_amount(frm);
+		else frm.events.set_unallocated_amount(frm);
 	},
 
-	get_outstanding_invoices_or_orders: function(frm, get_outstanding_invoices, get_orders_to_be_billed) {
+	get_outstanding_invoices_or_orders: function (frm, get_outstanding_invoices, get_orders_to_be_billed) {
 		const today = frappe.datetime.get_today();
 		let fields = [
-			{fieldtype:"Section Break", label: __("Posting Date")},
-			{fieldtype:"Date", label: __("From Date"),
-				fieldname:"from_posting_date", default:frappe.datetime.add_days(today, -30)},
-			{fieldtype:"Column Break"},
-			{fieldtype:"Date", label: __("To Date"), fieldname:"to_posting_date", default:today},
-			{fieldtype:"Section Break", label: __("Due Date")},
-			{fieldtype:"Date", label: __("From Date"), fieldname:"from_due_date"},
-			{fieldtype:"Column Break"},
-			{fieldtype:"Date", label: __("To Date"), fieldname:"to_due_date"},
-			{fieldtype:"Section Break", label: __("Outstanding Amount")},
-			{fieldtype:"Float", label: __("Greater Than Amount"),
-				fieldname:"outstanding_amt_greater_than", default: 0},
-			{fieldtype:"Column Break"},
-			{fieldtype:"Float", label: __("Less Than Amount"), fieldname:"outstanding_amt_less_than"},
+			{ fieldtype: "Section Break", label: __("Posting Date") },
+			{
+				fieldtype: "Date",
+				label: __("From Date"),
+				fieldname: "from_posting_date",
+				default: frappe.datetime.add_days(today, -30),
+			},
+			{ fieldtype: "Column Break" },
+			{ fieldtype: "Date", label: __("To Date"), fieldname: "to_posting_date", default: today },
+			{ fieldtype: "Section Break", label: __("Due Date") },
+			{ fieldtype: "Date", label: __("From Date"), fieldname: "from_due_date" },
+			{ fieldtype: "Column Break" },
+			{ fieldtype: "Date", label: __("To Date"), fieldname: "to_due_date" },
+			{ fieldtype: "Section Break", label: __("Outstanding Amount") },
+			{
+				fieldtype: "Float",
+				label: __("Greater Than Amount"),
+				fieldname: "outstanding_amt_greater_than",
+				default: 0,
+			},
+			{ fieldtype: "Column Break" },
+			{ fieldtype: "Float", label: __("Less Than Amount"), fieldname: "outstanding_amt_less_than" },
 		];
 
 		if (frm.dimension_filters) {
-			let column_break_insertion_point = Math.ceil((frm.dimension_filters.length)/2);
+			let column_break_insertion_point = Math.ceil(frm.dimension_filters.length / 2);
 
-			fields.push({fieldtype:"Section Break"});
-			frm.dimension_filters.map((elem, idx)=>{
+			fields.push({ fieldtype: "Section Break" });
+			frm.dimension_filters.map((elem, idx) => {
 				fields.push({
 					fieldtype: "Link",
 					label: elem.document_type == "Cost Center" ? "Cost Center" : elem.label,
 					options: elem.document_type,
-					fieldname: elem.fieldname || elem.document_type
+					fieldname: elem.fieldname || elem.document_type,
 				});
-				if(idx+1 == column_break_insertion_point) {
-					fields.push({fieldtype:"Column Break"});
+				if (idx + 1 == column_break_insertion_point) {
+					fields.push({ fieldtype: "Column Break" });
 				}
 			});
 		}
 
 		fields = fields.concat([
-			{fieldtype:"Section Break"},
-			{fieldtype:"Check", label: __("Allocate Payment Amount"), fieldname:"allocate_payment_amount", default:1},
+			{ fieldtype: "Section Break" },
+			{
+				fieldtype: "Check",
+				label: __("Allocate Payment Amount"),
+				fieldname: "allocate_payment_amount",
+				default: 1,
+			},
 		]);
 
 		let btn_text = "";
 
 		if (get_outstanding_invoices) {
 			btn_text = "Get Outstanding Invoices";
-		}
-		else if (get_orders_to_be_billed) {
+		} else if (get_orders_to_be_billed) {
 			btn_text = "Get Outstanding Orders";
 		}
 
-		frappe.prompt(fields, function(filters){
-			frappe.flags.allocate_payment_amount = true;
-			frm.events.validate_filters_data(frm, filters);
-			frm.doc.cost_center = filters.cost_center;
-			frm.events.get_outstanding_documents(frm, filters, get_outstanding_invoices, get_orders_to_be_billed);
-		}, __("Filters"), __(btn_text));
+		frappe.prompt(
+			fields,
+			function (filters) {
+				frappe.flags.allocate_payment_amount = true;
+				frm.events.validate_filters_data(frm, filters);
+				frm.doc.cost_center = filters.cost_center;
+				frm.events.get_outstanding_documents(
+					frm,
+					filters,
+					get_outstanding_invoices,
+					get_orders_to_be_billed
+				);
+			},
+			__("Filters"),
+			__(btn_text)
+		);
 	},
 
-	get_outstanding_invoices: function(frm) {
+	get_outstanding_invoices: function (frm) {
 		frm.events.get_outstanding_invoices_or_orders(frm, true, false);
 	},
 
-	get_outstanding_orders: function(frm) {
+	get_outstanding_orders: function (frm) {
 		frm.events.get_outstanding_invoices_or_orders(frm, false, true);
 	},
 
-	validate_filters_data: function(frm, filters) {
+	validate_filters_data: function (frm, filters) {
 		const fields = {
-			'Posting Date': ['from_posting_date', 'to_posting_date'],
-			'Due Date': ['from_posting_date', 'to_posting_date'],
-			'Advance Amount': ['from_posting_date', 'to_posting_date'],
+			"Posting Date": ["from_posting_date", "to_posting_date"],
+			"Due Date": ["from_posting_date", "to_posting_date"],
+			"Advance Amount": ["from_posting_date", "to_posting_date"],
 		};
 
 		for (let key in fields) {
@@ -716,21 +884,23 @@
 			let to_field = fields[key][1];
 
 			if (filters[from_field] && !filters[to_field]) {
-				frappe.throw(
-					__("Error: {0} is mandatory field", [to_field.replace(/_/g, " ")])
-				);
+				frappe.throw(__("Error: {0} is mandatory field", [to_field.replace(/_/g, " ")]));
 			} else if (filters[from_field] && filters[from_field] > filters[to_field]) {
 				frappe.throw(
-					__("{0}: {1} must be less than {2}", [key, from_field.replace(/_/g, " "), to_field.replace(/_/g, " ")])
+					__("{0}: {1} must be less than {2}", [
+						key,
+						from_field.replace(/_/g, " "),
+						to_field.replace(/_/g, " "),
+					])
 				);
 			}
 		}
 	},
 
-	get_outstanding_documents: function(frm, filters, get_outstanding_invoices, get_orders_to_be_billed) {
+	get_outstanding_documents: function (frm, filters, get_outstanding_invoices, get_orders_to_be_billed) {
 		frm.clear_table("references");
 
-		if(!frm.doc.party) {
+		if (!frm.doc.party) {
 			return;
 		}
 
@@ -738,14 +908,14 @@
 		var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
 
 		var args = {
-			"posting_date": frm.doc.posting_date,
-			"company": frm.doc.company,
-			"party_type": frm.doc.party_type,
-			"payment_type": frm.doc.payment_type,
-			"party": frm.doc.party,
-			"party_account": frm.doc.payment_type=="Receive" ? frm.doc.paid_from : frm.doc.paid_to,
-			"cost_center": frm.doc.cost_center
-		}
+			posting_date: frm.doc.posting_date,
+			company: frm.doc.company,
+			party_type: frm.doc.party_type,
+			payment_type: frm.doc.payment_type,
+			party: frm.doc.party,
+			party_account: frm.doc.payment_type == "Receive" ? frm.doc.paid_from : frm.doc.paid_to,
+			cost_center: frm.doc.cost_center,
+		};
 
 		for (let key in filters) {
 			args[key] = filters[key];
@@ -753,8 +923,7 @@
 
 		if (get_outstanding_invoices) {
 			args["get_outstanding_invoices"] = true;
-		}
-		else if (get_orders_to_be_billed) {
+		} else if (get_orders_to_be_billed) {
 			args["get_orders_to_be_billed"] = true;
 		}
 
@@ -762,22 +931,22 @@
 			args["book_advance_payments_in_separate_party_account"] = true;
 		}
 
-		frappe.flags.allocate_payment_amount = filters['allocate_payment_amount'];
+		frappe.flags.allocate_payment_amount = filters["allocate_payment_amount"];
 
-		return  frappe.call({
-			method: 'erpnext.accounts.doctype.payment_entry.payment_entry.get_outstanding_reference_documents',
+		return frappe.call({
+			method: "erpnext.accounts.doctype.payment_entry.payment_entry.get_outstanding_reference_documents",
 			args: {
-				args:args
+				args: args,
 			},
-			callback: function(r, rt) {
-				if(r.message) {
+			callback: function (r, rt) {
+				if (r.message) {
 					var total_positive_outstanding = 0;
 					var total_negative_outstanding = 0;
-					$.each(r.message, function(i, d) {
+					$.each(r.message, function (i, d) {
 						var c = frm.add_child("references");
 						c.reference_doctype = d.voucher_type;
 						c.reference_name = d.voucher_no;
-						c.due_date = d.due_date
+						c.due_date = d.due_date;
 						c.total_amount = d.invoice_amount;
 						c.outstanding_amount = d.outstanding_amount;
 						c.bill_no = d.bill_no;
@@ -785,135 +954,157 @@
 						c.allocated_amount = d.allocated_amount;
 						c.account = d.account;
 
-						if(!in_list(frm.events.get_order_doctypes(frm), d.voucher_type)) {
-							if(flt(d.outstanding_amount) > 0)
+						if (!in_list(frm.events.get_order_doctypes(frm), d.voucher_type)) {
+							if (flt(d.outstanding_amount) > 0)
 								total_positive_outstanding += flt(d.outstanding_amount);
-							else
-								total_negative_outstanding += Math.abs(flt(d.outstanding_amount));
+							else total_negative_outstanding += Math.abs(flt(d.outstanding_amount));
 						}
 
-						var party_account_currency = frm.doc.payment_type=="Receive" ?
-							frm.doc.paid_from_account_currency : frm.doc.paid_to_account_currency;
+						var party_account_currency =
+							frm.doc.payment_type == "Receive"
+								? frm.doc.paid_from_account_currency
+								: frm.doc.paid_to_account_currency;
 
-						if(party_account_currency != company_currency) {
+						if (party_account_currency != company_currency) {
 							c.exchange_rate = d.exchange_rate;
 						} else {
 							c.exchange_rate = 1;
 						}
-						if (in_list(frm.events.get_invoice_doctypes(frm), d.reference_doctype)){
+						if (in_list(frm.events.get_invoice_doctypes(frm), d.reference_doctype)) {
 							c.due_date = d.due_date;
 						}
 					});
 
-					if(
-						(frm.doc.payment_type=="Receive" && frm.doc.party_type=="Customer") ||
-						(frm.doc.payment_type=="Pay" && frm.doc.party_type=="Supplier")  ||
-						(frm.doc.payment_type=="Pay" && frm.doc.party_type=="Employee")
+					if (
+						(frm.doc.payment_type == "Receive" && frm.doc.party_type == "Customer") ||
+						(frm.doc.payment_type == "Pay" && frm.doc.party_type == "Supplier") ||
+						(frm.doc.payment_type == "Pay" && frm.doc.party_type == "Employee")
 					) {
-						if(total_positive_outstanding > total_negative_outstanding)
+						if (total_positive_outstanding > total_negative_outstanding)
 							if (!frm.doc.paid_amount)
-								frm.set_value("paid_amount",
-									total_positive_outstanding - total_negative_outstanding);
+								frm.set_value(
+									"paid_amount",
+									total_positive_outstanding - total_negative_outstanding
+								);
 					} else if (
 						total_negative_outstanding &&
 						total_positive_outstanding < total_negative_outstanding
 					) {
 						if (!frm.doc.received_amount)
-							frm.set_value("received_amount",
-								total_negative_outstanding - total_positive_outstanding);
+							frm.set_value(
+								"received_amount",
+								total_negative_outstanding - total_positive_outstanding
+							);
 					}
 				}
 
-				frm.events.allocate_party_amount_against_ref_docs(frm,
-					(frm.doc.payment_type=="Receive" ? frm.doc.paid_amount : frm.doc.received_amount));
-
-			}
+				frm.events.allocate_party_amount_against_ref_docs(
+					frm,
+					frm.doc.payment_type == "Receive" ? frm.doc.paid_amount : frm.doc.received_amount
+				);
+			},
 		});
 	},
 
-	get_order_doctypes: function(frm) {
+	get_order_doctypes: function (frm) {
 		return ["Sales Order", "Purchase Order"];
 	},
 
-	get_invoice_doctypes: function(frm) {
+	get_invoice_doctypes: function (frm) {
 		return ["Sales Invoice", "Purchase Invoice"];
 	},
 
-	allocate_party_amount_against_ref_docs: function(frm, paid_amount, paid_amount_change) {
+	allocate_party_amount_against_ref_docs: function (frm, paid_amount, paid_amount_change) {
 		var total_positive_outstanding_including_order = 0;
 		var total_negative_outstanding = 0;
-		var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [],
-			function(d) { return flt(d.amount) }));
+		var total_deductions = frappe.utils.sum(
+			$.map(frm.doc.deductions || [], function (d) {
+				return flt(d.amount);
+			})
+		);
 
 		paid_amount -= total_deductions;
 
-		$.each(frm.doc.references || [], function(i, row) {
-			if(flt(row.outstanding_amount) > 0)
+		$.each(frm.doc.references || [], function (i, row) {
+			if (flt(row.outstanding_amount) > 0)
 				total_positive_outstanding_including_order += flt(row.outstanding_amount);
-			else
-				total_negative_outstanding += Math.abs(flt(row.outstanding_amount));
-		})
+			else total_negative_outstanding += Math.abs(flt(row.outstanding_amount));
+		});
 
 		var allocated_negative_outstanding = 0;
 		if (
-				(frm.doc.payment_type=="Receive" && frm.doc.party_type=="Customer") ||
-				(frm.doc.payment_type=="Pay" && frm.doc.party_type=="Supplier") ||
-				(frm.doc.payment_type=="Pay" && frm.doc.party_type=="Employee")
-			) {
-				if(total_positive_outstanding_including_order > paid_amount) {
-					var remaining_outstanding = total_positive_outstanding_including_order - paid_amount;
-					allocated_negative_outstanding = total_negative_outstanding < remaining_outstanding ?
-						total_negative_outstanding : remaining_outstanding;
+			(frm.doc.payment_type == "Receive" && frm.doc.party_type == "Customer") ||
+			(frm.doc.payment_type == "Pay" && frm.doc.party_type == "Supplier") ||
+			(frm.doc.payment_type == "Pay" && frm.doc.party_type == "Employee")
+		) {
+			if (total_positive_outstanding_including_order > paid_amount) {
+				var remaining_outstanding = total_positive_outstanding_including_order - paid_amount;
+				allocated_negative_outstanding =
+					total_negative_outstanding < remaining_outstanding
+						? total_negative_outstanding
+						: remaining_outstanding;
 			}
 
-			var allocated_positive_outstanding =  paid_amount + allocated_negative_outstanding;
+			var allocated_positive_outstanding = paid_amount + allocated_negative_outstanding;
 		} else if (in_list(["Customer", "Supplier"], frm.doc.party_type)) {
-			total_negative_outstanding = flt(total_negative_outstanding, precision("outstanding_amount"))
-			if(paid_amount > total_negative_outstanding) {
-				if(total_negative_outstanding == 0) {
+			total_negative_outstanding = flt(total_negative_outstanding, precision("outstanding_amount"));
+			if (paid_amount > total_negative_outstanding) {
+				if (total_negative_outstanding == 0) {
 					frappe.msgprint(
-						__("Cannot {0} {1} {2} without any negative outstanding invoice", [frm.doc.payment_type,
-							(frm.doc.party_type=="Customer" ? "to" : "from"), frm.doc.party_type])
+						__("Cannot {0} {1} {2} without any negative outstanding invoice", [
+							frm.doc.payment_type,
+							frm.doc.party_type == "Customer" ? "to" : "from",
+							frm.doc.party_type,
+						])
 					);
-					return false
+					return false;
 				} else {
 					frappe.msgprint(
-						__("Paid Amount cannot be greater than total negative outstanding amount {0}", [total_negative_outstanding])
+						__("Paid Amount cannot be greater than total negative outstanding amount {0}", [
+							total_negative_outstanding,
+						])
 					);
 					return false;
 				}
 			} else {
 				allocated_positive_outstanding = total_negative_outstanding - paid_amount;
-				allocated_negative_outstanding = paid_amount +
-					(total_positive_outstanding_including_order < allocated_positive_outstanding ?
-						total_positive_outstanding_including_order : allocated_positive_outstanding)
+				allocated_negative_outstanding =
+					paid_amount +
+					(total_positive_outstanding_including_order < allocated_positive_outstanding
+						? total_positive_outstanding_including_order
+						: allocated_positive_outstanding);
 			}
 		}
 
-		$.each(frm.doc.references || [], function(i, row) {
+		$.each(frm.doc.references || [], function (i, row) {
 			if (frappe.flags.allocate_payment_amount == 0) {
 				//If allocate payment amount checkbox is unchecked, set zero to allocate amount
 				row.allocated_amount = 0;
-
-			} else if (frappe.flags.allocate_payment_amount != 0 && (!row.allocated_amount || paid_amount_change)) {
+			} else if (
+				frappe.flags.allocate_payment_amount != 0 &&
+				(!row.allocated_amount || paid_amount_change)
+			) {
 				if (row.outstanding_amount > 0 && allocated_positive_outstanding >= 0) {
-					row.allocated_amount = (row.outstanding_amount >= allocated_positive_outstanding) ?
-						allocated_positive_outstanding : row.outstanding_amount;
+					row.allocated_amount =
+						row.outstanding_amount >= allocated_positive_outstanding
+							? allocated_positive_outstanding
+							: row.outstanding_amount;
 					allocated_positive_outstanding -= flt(row.allocated_amount);
-
 				} else if (row.outstanding_amount < 0 && allocated_negative_outstanding) {
-					row.allocated_amount = (Math.abs(row.outstanding_amount) >= allocated_negative_outstanding) ?
-						-1*allocated_negative_outstanding : row.outstanding_amount;
+					row.allocated_amount =
+						Math.abs(row.outstanding_amount) >= allocated_negative_outstanding
+							? -1 * allocated_negative_outstanding
+							: row.outstanding_amount;
 					allocated_negative_outstanding -= Math.abs(flt(row.allocated_amount));
 				}
 			}
-		})
+		});
 
-		frm.refresh_fields()
+		frm.refresh_fields();
 		frm.events.set_total_allocated_amount(frm);
 	},
 
-	set_total_allocated_amount: function(frm) {
+	set_total_allocated_amount: function (frm) {
 		let exchange_rate = 1;
 		if (frm.doc.payment_type == "Receive") {
 			exchange_rate = frm.doc.source_exchange_rate;
@@ -922,11 +1113,13 @@
 		}
 		var total_allocated_amount = 0.0;
 		var base_total_allocated_amount = 0.0;
-		$.each(frm.doc.references || [], function(i, row) {
+		$.each(frm.doc.references || [], function (i, row) {
 			if (row.allocated_amount) {
 				total_allocated_amount += flt(row.allocated_amount);
-				base_total_allocated_amount += flt(flt(row.allocated_amount)*flt(exchange_rate),
-					precision("base_paid_amount"));
+				base_total_allocated_amount += flt(
+					flt(row.allocated_amount) * flt(exchange_rate),
+					precision("base_paid_amount")
+				);
 			}
 		});
 		frm.set_value("total_allocated_amount", Math.abs(total_allocated_amount));
@@ -935,36 +1128,53 @@
 		frm.events.set_unallocated_amount(frm);
 	},
 
-	set_unallocated_amount: function(frm) {
+	set_unallocated_amount: function (frm) {
 		var unallocated_amount = 0;
-		var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [],
-			function(d) { return flt(d.amount) }));
+		var total_deductions = frappe.utils.sum(
+			$.map(frm.doc.deductions || [], function (d) {
+				return flt(d.amount);
+			})
+		);
 
-		if(frm.doc.party) {
-			if(frm.doc.payment_type == "Receive"
-				&& frm.doc.base_total_allocated_amount < frm.doc.base_received_amount + total_deductions
-				&& frm.doc.total_allocated_amount < frm.doc.paid_amount + (total_deductions / frm.doc.source_exchange_rate)) {
-					unallocated_amount = (frm.doc.base_received_amount + total_deductions - flt(frm.doc.base_total_taxes_and_charges)
-						- frm.doc.base_total_allocated_amount) / frm.doc.source_exchange_rate;
-			} else if (frm.doc.payment_type == "Pay"
-				&& frm.doc.base_total_allocated_amount < frm.doc.base_paid_amount - total_deductions
-				&& frm.doc.total_allocated_amount < frm.doc.received_amount + (total_deductions / frm.doc.target_exchange_rate)) {
-					unallocated_amount = (frm.doc.base_paid_amount + flt(frm.doc.base_total_taxes_and_charges) - (total_deductions
-						+ frm.doc.base_total_allocated_amount)) / frm.doc.target_exchange_rate;
+		if (frm.doc.party) {
+			if (
+				frm.doc.payment_type == "Receive" &&
+				frm.doc.base_total_allocated_amount < frm.doc.base_received_amount + total_deductions &&
+				frm.doc.total_allocated_amount <
+					frm.doc.paid_amount + total_deductions / frm.doc.source_exchange_rate
+			) {
+				unallocated_amount =
+					(frm.doc.base_received_amount +
+						total_deductions -
+						flt(frm.doc.base_total_taxes_and_charges) -
+						frm.doc.base_total_allocated_amount) /
+					frm.doc.source_exchange_rate;
+			} else if (
+				frm.doc.payment_type == "Pay" &&
+				frm.doc.base_total_allocated_amount < frm.doc.base_paid_amount - total_deductions &&
+				frm.doc.total_allocated_amount <
+					frm.doc.received_amount + total_deductions / frm.doc.target_exchange_rate
+			) {
+				unallocated_amount =
+					(frm.doc.base_paid_amount +
+						flt(frm.doc.base_total_taxes_and_charges) -
+						(total_deductions + frm.doc.base_total_allocated_amount)) /
+					frm.doc.target_exchange_rate;
 			}
 		}
 		frm.set_value("unallocated_amount", unallocated_amount);
 		frm.trigger("set_difference_amount");
 	},
 
-	set_difference_amount: function(frm) {
+	set_difference_amount: function (frm) {
 		var difference_amount = 0;
-		var base_unallocated_amount = flt(frm.doc.unallocated_amount) *
-			(frm.doc.payment_type=="Receive" ? frm.doc.source_exchange_rate : frm.doc.target_exchange_rate);
+		var base_unallocated_amount =
+			flt(frm.doc.unallocated_amount) *
+			(frm.doc.payment_type == "Receive" ? frm.doc.source_exchange_rate : frm.doc.target_exchange_rate);
 
 		var base_party_amount = flt(frm.doc.base_total_allocated_amount) + base_unallocated_amount;
 
-		if(frm.doc.payment_type == "Receive") {
+		if (frm.doc.payment_type == "Receive") {
 			difference_amount = base_party_amount - flt(frm.doc.base_received_amount);
 		} else if (frm.doc.payment_type == "Pay") {
 			difference_amount = flt(frm.doc.base_paid_amount) - base_party_amount;
@@ -972,51 +1182,67 @@
 			difference_amount = flt(frm.doc.base_paid_amount) - flt(frm.doc.base_received_amount);
 		}
 
-		var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [],
-			function(d) { return flt(d.amount) }));
+		var total_deductions = frappe.utils.sum(
+			$.map(frm.doc.deductions || [], function (d) {
+				return flt(d.amount);
+			})
+		);
 
-		frm.set_value("difference_amount", difference_amount - total_deductions +
-			flt(frm.doc.base_total_taxes_and_charges));
+		frm.set_value(
+			"difference_amount",
+			difference_amount - total_deductions + flt(frm.doc.base_total_taxes_and_charges)
+		);
 
 		frm.events.hide_unhide_fields(frm);
 	},
 
-	unallocated_amount: function(frm) {
+	unallocated_amount: function (frm) {
 		frm.trigger("set_difference_amount");
 	},
 
-	check_mandatory_to_fetch: function(frm) {
-		$.each(["Company", "Party Type", "Party", "payment_type"], function(i, field) {
-			if(!frm.doc[frappe.model.scrub(field)]) {
+	check_mandatory_to_fetch: function (frm) {
+		$.each(["Company", "Party Type", "Party", "payment_type"], function (i, field) {
+			if (!frm.doc[frappe.model.scrub(field)]) {
 				frappe.msgprint(__("Please select {0} first", [field]));
 				return false;
 			}
-
 		});
 	},
 
-	validate_reference_document: function(frm, row) {
-		var _validate = function(i, row) {
+	validate_reference_document: function (frm, row) {
+		var _validate = function (i, row) {
 			if (!row.reference_doctype) {
 				return;
 			}
 
-			if(frm.doc.party_type=="Customer" &&
+			if (
+				frm.doc.party_type == "Customer" &&
 				!in_list(["Sales Order", "Sales Invoice", "Journal Entry", "Dunning"], row.reference_doctype)
 			) {
 				frappe.model.set_value(row.doctype, row.name, "reference_doctype", null);
-				frappe.msgprint(__("Row #{0}: Reference Document Type must be one of Sales Order, Sales Invoice, Journal Entry or Dunning", [row.idx]));
+				frappe.msgprint(
+					__(
+						"Row #{0}: Reference Document Type must be one of Sales Order, Sales Invoice, Journal Entry or Dunning",
+						[row.idx]
+					)
+				);
 				return false;
 			}
 
-			if(frm.doc.party_type=="Supplier" &&
+			if (
+				frm.doc.party_type == "Supplier" &&
 				!in_list(["Purchase Order", "Purchase Invoice", "Journal Entry"], row.reference_doctype)
 			) {
 				frappe.model.set_value(row.doctype, row.name, "against_voucher_type", null);
-				frappe.msgprint(__("Row #{0}: Reference Document Type must be one of Purchase Order, Purchase Invoice or Journal Entry", [row.idx]));
+				frappe.msgprint(
+					__(
+						"Row #{0}: Reference Document Type must be one of Purchase Order, Purchase Invoice or Journal Entry",
+						[row.idx]
+					)
+				);
 				return false;
 			}
-		}
+		};
 
 		if (row) {
 			_validate(0, row);
@@ -1025,28 +1251,31 @@
 		}
 	},
 
-	write_off_difference_amount: function(frm) {
+	write_off_difference_amount: function (frm) {
 		frm.events.set_deductions_entry(frm, "write_off_account");
 	},
 
-	set_exchange_gain_loss: function(frm) {
+	set_exchange_gain_loss: function (frm) {
 		frm.events.set_deductions_entry(frm, "exchange_gain_loss_account");
 	},
 
-	set_deductions_entry: function(frm, account) {
-		if(frm.doc.difference_amount) {
+	set_deductions_entry: function (frm, account) {
+		if (frm.doc.difference_amount) {
 			frappe.call({
 				method: "erpnext.accounts.doctype.payment_entry.payment_entry.get_company_defaults",
 				args: {
-					company: frm.doc.company
+					company: frm.doc.company,
 				},
-				callback: function(r, rt) {
-					if(r.message) {
-						const write_off_row = $.map(frm.doc["deductions"] || [], function(t) {
-							return t.account==r.message[account] ? t : null; });
+				callback: function (r, rt) {
+					if (r.message) {
+						const write_off_row = $.map(frm.doc["deductions"] || [], function (t) {
+							return t.account == r.message[account] ? t : null;
+						});
 
-						const difference_amount = flt(frm.doc.difference_amount,
-							precision("difference_amount"));
+						const difference_amount = flt(
+							frm.doc.difference_amount,
+							precision("difference_amount")
+						);
 
 						const add_deductions = (details) => {
 							let row = null;
@@ -1061,73 +1290,77 @@
 							if (row) {
 								row.amount = flt(row.amount) + difference_amount;
 							} else {
-								frappe.msgprint(__("No gain or loss in the exchange rate"))
+								frappe.msgprint(__("No gain or loss in the exchange rate"));
 							}
 							refresh_field("deductions");
 						};
 
 						if (!r.message[account]) {
-							frappe.prompt({
-								label: __("Please Specify Account"),
-								fieldname: account,
-								fieldtype: "Link",
-								options: "Account",
-								get_query: () => ({
-									filters: {
-										company: frm.doc.company,
-									}
-								})
-							}, (values) => {
-								const details = Object.assign({}, r.message, values);
-								add_deductions(details);
-							}, __(frappe.unscrub(account)));
+							frappe.prompt(
+								{
+									label: __("Please Specify Account"),
+									fieldname: account,
+									fieldtype: "Link",
+									options: "Account",
+									get_query: () => ({
+										filters: {
+											company: frm.doc.company,
+										},
+									}),
+								},
+								(values) => {
+									const details = Object.assign({}, r.message, values);
+									add_deductions(details);
+								},
+								__(frappe.unscrub(account))
+							);
 						} else {
 							add_deductions(r.message);
 						}
 
 						frm.events.set_unallocated_amount(frm);
 					}
-				}
-			})
-		}
-	},
-
-	bank_account: function(frm) {
-		const field = frm.doc.payment_type == "Pay" ? "paid_from":"paid_to";
-		if (frm.doc.bank_account && in_list(['Pay', 'Receive'], frm.doc.payment_type)) {
-			frappe.call({
-				method: "erpnext.accounts.doctype.bank_account.bank_account.get_bank_account_details",
-				args: {
-					bank_account: frm.doc.bank_account
 				},
-				callback: function(r) {
-					if (r.message) {
-						frm.set_value(field, r.message.account);
-						frm.set_value('bank', r.message.bank);
-						frm.set_value('bank_account_no', r.message.bank_account_no);
-					}
-				}
 			});
 		}
 	},
 
-	sales_taxes_and_charges_template: function(frm) {
-		frm.trigger('fetch_taxes_from_template');
+	bank_account: function (frm) {
+		const field = frm.doc.payment_type == "Pay" ? "paid_from" : "paid_to";
+		if (frm.doc.bank_account && in_list(["Pay", "Receive"], frm.doc.payment_type)) {
+			frappe.call({
+				method: "erpnext.accounts.doctype.bank_account.bank_account.get_bank_account_details",
+				args: {
+					bank_account: frm.doc.bank_account,
+				},
+				callback: function (r) {
+					if (r.message) {
+						frm.set_value(field, r.message.account);
+						frm.set_value("bank", r.message.bank);
+						frm.set_value("bank_account_no", r.message.bank_account_no);
+					}
+				},
+			});
+		}
 	},
 
-	purchase_taxes_and_charges_template: function(frm) {
-		frm.trigger('fetch_taxes_from_template');
+	sales_taxes_and_charges_template: function (frm) {
+		frm.trigger("fetch_taxes_from_template");
 	},
 
-	fetch_taxes_from_template: function(frm) {
-		let master_doctype = '';
-		let taxes_and_charges = '';
+	purchase_taxes_and_charges_template: function (frm) {
+		frm.trigger("fetch_taxes_from_template");
+	},
 
-		if (frm.doc.party_type == 'Supplier') {
-			master_doctype = 'Purchase Taxes and Charges Template';
+	fetch_taxes_from_template: function (frm) {
+		let master_doctype = "";
+		let taxes_and_charges = "";
+
+		if (frm.doc.party_type == "Supplier") {
+			master_doctype = "Purchase Taxes and Charges Template";
 			taxes_and_charges = frm.doc.purchase_taxes_and_charges_template;
-		} else if (frm.doc.party_type == 'Customer') {
-			master_doctype = 'Sales Taxes and Charges Template';
+		} else if (frm.doc.party_type == "Customer") {
+			master_doctype = "Sales Taxes and Charges Template";
 			taxes_and_charges = frm.doc.sales_taxes_and_charges_template;
 		}
 
@@ -1138,16 +1371,16 @@
 		frappe.call({
 			method: "erpnext.controllers.accounts_controller.get_taxes_and_charges",
 			args: {
-				"master_doctype": master_doctype,
-				"master_name": taxes_and_charges
+				master_doctype: master_doctype,
+				master_name: taxes_and_charges,
 			},
-			callback: function(r) {
-				if(!r.exc && r.message) {
+			callback: function (r) {
+				if (!r.exc && r.message) {
 					// set taxes table
-					if(r.message) {
+					if (r.message) {
 						for (let tax of r.message) {
-							if (tax.charge_type === 'On Net Total') {
-								tax.charge_type = 'On Paid Amount';
+							if (tax.charge_type === "On Net Total") {
+								tax.charge_type = "On Paid Amount";
 							}
 							frm.add_child("taxes", tax);
 						}
@@ -1155,58 +1388,77 @@
 						frm.events.set_unallocated_amount(frm);
 					}
 				}
-			}
+			},
 		});
 	},
 
-	apply_taxes: function(frm) {
+	apply_taxes: function (frm) {
 		frm.events.initialize_taxes(frm);
 		frm.events.determine_exclusive_rate(frm);
 		frm.events.calculate_taxes(frm);
 	},
 
-	initialize_taxes: function(frm) {
-		$.each(frm.doc["taxes"] || [], function(i, tax) {
+	initialize_taxes: function (frm) {
+		$.each(frm.doc["taxes"] || [], function (i, tax) {
 			frm.events.validate_taxes_and_charges(tax);
 			frm.events.validate_inclusive_tax(tax);
 			tax.item_wise_tax_detail = {};
-			let tax_fields = ["total",  "tax_fraction_for_current_item",
-				"grand_total_fraction_for_current_item"];
+			let tax_fields = [
+				"total",
+				"tax_fraction_for_current_item",
+				"grand_total_fraction_for_current_item",
+			];
 
 			if (cstr(tax.charge_type) != "Actual") {
 				tax_fields.push("tax_amount");
 			}
 
-			$.each(tax_fields, function(i, fieldname) { tax[fieldname] = 0.0; });
+			$.each(tax_fields, function (i, fieldname) {
+				tax[fieldname] = 0.0;
+			});
 
 			frm.doc.paid_amount_after_tax = frm.doc.base_paid_amount;
 		});
 	},
 
-	validate_taxes_and_charges: function(d) {
+	validate_taxes_and_charges: function (d) {
 		let msg = "";
 
 		if (d.account_head && !d.description) {
 			// set description from account head
-			d.description = d.account_head.split(' - ').slice(0, -1).join(' - ');
+			d.description = d.account_head.split(" - ").slice(0, -1).join(" - ");
 		}
 
 		if (!d.charge_type && (d.row_id || d.rate || d.tax_amount)) {
 			msg = __("Please select Charge Type first");
 			d.row_id = "";
 			d.rate = d.tax_amount = 0.0;
-		} else if ((d.charge_type == 'Actual' || d.charge_type == 'On Net Total' || d.charge_type == 'On Paid Amount') && d.row_id) {
-			msg = __("Can refer row only if the charge type is 'On Previous Row Amount' or 'Previous Row Total'");
+		} else if (
+			(d.charge_type == "Actual" ||
+				d.charge_type == "On Net Total" ||
+				d.charge_type == "On Paid Amount") &&
+			d.row_id
+		) {
+			msg = __(
+				"Can refer row only if the charge type is 'On Previous Row Amount' or 'Previous Row Total'"
+			);
 			d.row_id = "";
-		} else if ((d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total') && d.row_id) {
+		} else if (
+			(d.charge_type == "On Previous Row Amount" || d.charge_type == "On Previous Row Total") &&
+			d.row_id
+		) {
 			if (d.idx == 1) {
-				msg = __("Cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for first row");
-				d.charge_type = '';
+				msg = __(
+					"Cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for first row"
+				);
+				d.charge_type = "";
 			} else if (!d.row_id) {
 				msg = __("Please specify a valid Row ID for row {0} in table {1}", [d.idx, __(d.doctype)]);
 				d.row_id = "";
 			} else if (d.row_id && d.row_id >= d.idx) {
-				msg = __("Cannot refer row number greater than or equal to current row number for this Charge type");
+				msg = __(
+					"Cannot refer row number greater than or equal to current row number for this Charge type"
+				);
 				d.row_id = "";
 			}
 		}
@@ -1215,34 +1467,39 @@
 			refresh_field("taxes");
 			frappe.throw(msg);
 		}
-
 	},
 
-	validate_inclusive_tax: function(tax) {
-		let actual_type_error = function() {
-			let msg = __("Actual type tax cannot be included in Item rate in row {0}", [tax.idx])
+	validate_inclusive_tax: function (tax) {
+		let actual_type_error = function () {
+			let msg = __("Actual type tax cannot be included in Item rate in row {0}", [tax.idx]);
 			frappe.throw(msg);
 		};
 
-		let on_previous_row_error = function(row_range) {
-			let msg = __("For row {0} in {1}. To include {2} in Item rate, rows {3} must also be included",
-				[tax.idx, __(tax.doctype), tax.charge_type, row_range])
+		let on_previous_row_error = function (row_range) {
+			let msg = __("For row {0} in {1}. To include {2} in Item rate, rows {3} must also be included", [
+				tax.idx,
+				__(tax.doctype),
+				tax.charge_type,
+				row_range,
+			]);
 			frappe.throw(msg);
 		};
 
-		if(cint(tax.included_in_paid_amount)) {
-			if(tax.charge_type == "Actual") {
+		if (cint(tax.included_in_paid_amount)) {
+			if (tax.charge_type == "Actual") {
 				// inclusive tax cannot be of type Actual
 				actual_type_error();
-			} else if(tax.charge_type == "On Previous Row Amount" &&
+			} else if (
+				tax.charge_type == "On Previous Row Amount" &&
 				!cint(this.frm.doc["taxes"][tax.row_id - 1].included_in_paid_amount)
 			) {
 				// referred row should also be an inclusive tax
 				on_previous_row_error(tax.row_id);
-			} else if(tax.charge_type == "On Previous Row Total") {
-				let taxes_not_included = $.map(this.frm.doc["taxes"].slice(0, tax.row_id),
-					function(t) { return cint(t.included_in_paid_amount) ? null : t; });
-				if(taxes_not_included.length > 0) {
+			} else if (tax.charge_type == "On Previous Row Total") {
+				let taxes_not_included = $.map(this.frm.doc["taxes"].slice(0, tax.row_id), function (t) {
+					return cint(t.included_in_paid_amount) ? null : t;
+				});
+				if (taxes_not_included.length > 0) {
 					// all rows above this tax should be inclusive
 					on_previous_row_error(tax.row_id == 1 ? "1" : "1 - " + tax.row_id);
 				}
@@ -1250,55 +1507,55 @@
 		}
 	},
 
-	determine_exclusive_rate: function(frm) {
+	determine_exclusive_rate: function (frm) {
 		let has_inclusive_tax = false;
-		$.each(frm.doc["taxes"] || [], function(i, row) {
-			if(cint(row.included_in_paid_amount)) has_inclusive_tax = true;
+		$.each(frm.doc["taxes"] || [], function (i, row) {
+			if (cint(row.included_in_paid_amount)) has_inclusive_tax = true;
 		});
-		if(has_inclusive_tax==false) return;
+		if (has_inclusive_tax == false) return;
 
 		let cumulated_tax_fraction = 0.0;
-		$.each(frm.doc["taxes"] || [], function(i, tax) {
+		$.each(frm.doc["taxes"] || [], function (i, tax) {
 			tax.tax_fraction_for_current_item = frm.events.get_current_tax_fraction(frm, tax);
 
-			if(i==0) {
+			if (i == 0) {
 				tax.grand_total_fraction_for_current_item = 1 + tax.tax_fraction_for_current_item;
 			} else {
 				tax.grand_total_fraction_for_current_item =
-					frm.doc["taxes"][i-1].grand_total_fraction_for_current_item +
+					frm.doc["taxes"][i - 1].grand_total_fraction_for_current_item +
 					tax.tax_fraction_for_current_item;
 			}
 
 			cumulated_tax_fraction += tax.tax_fraction_for_current_item;
-			frm.doc.paid_amount_after_tax = flt(frm.doc.base_paid_amount/(1+cumulated_tax_fraction))
+			frm.doc.paid_amount_after_tax = flt(frm.doc.base_paid_amount / (1 + cumulated_tax_fraction));
 		});
 	},
 
-	get_current_tax_fraction: function(frm, tax) {
+	get_current_tax_fraction: function (frm, tax) {
 		let current_tax_fraction = 0.0;
 
-		if(cint(tax.included_in_paid_amount)) {
+		if (cint(tax.included_in_paid_amount)) {
 			let tax_rate = tax.rate;
 
-			if(tax.charge_type == "On Paid Amount") {
-				current_tax_fraction = (tax_rate / 100.0);
-			} else if(tax.charge_type == "On Previous Row Amount") {
-				current_tax_fraction = (tax_rate / 100.0) *
-					frm.doc["taxes"][cint(tax.row_id) - 1].tax_fraction_for_current_item;
-			} else if(tax.charge_type == "On Previous Row Total") {
-				current_tax_fraction = (tax_rate / 100.0) *
+			if (tax.charge_type == "On Paid Amount") {
+				current_tax_fraction = tax_rate / 100.0;
+			} else if (tax.charge_type == "On Previous Row Amount") {
+				current_tax_fraction =
+					(tax_rate / 100.0) * frm.doc["taxes"][cint(tax.row_id) - 1].tax_fraction_for_current_item;
+			} else if (tax.charge_type == "On Previous Row Total") {
+				current_tax_fraction =
+					(tax_rate / 100.0) *
 					frm.doc["taxes"][cint(tax.row_id) - 1].grand_total_fraction_for_current_item;
 			}
 		}
 
-		if(tax.add_deduct_tax && tax.add_deduct_tax == "Deduct") {
+		if (tax.add_deduct_tax && tax.add_deduct_tax == "Deduct") {
 			current_tax_fraction *= -1;
 		}
 		return current_tax_fraction;
 	},
 
-
-	calculate_taxes: function(frm) {
+	calculate_taxes: function (frm) {
 		frm.doc.total_taxes_and_charges = 0.0;
 		frm.doc.base_total_taxes_and_charges = 0.0;
 
@@ -1306,13 +1563,13 @@
 		let actual_tax_dict = {};
 
 		// maintain actual tax rate based on idx
-		$.each(frm.doc["taxes"] || [], function(i, tax) {
+		$.each(frm.doc["taxes"] || [], function (i, tax) {
 			if (tax.charge_type == "Actual") {
 				actual_tax_dict[tax.idx] = flt(tax.tax_amount, precision("tax_amount", tax));
 			}
 		});
 
-		$.each(frm.doc["taxes"] || [], function(i, tax) {
+		$.each(frm.doc["taxes"] || [], function (i, tax) {
 			let current_tax_amount = frm.events.get_current_tax_amount(frm, tax);
 
 			// Adjust divisional loss to the last item
@@ -1325,29 +1582,28 @@
 
 			// tax accounts are only in company currency
 			tax.base_tax_amount = current_tax_amount;
-			current_tax_amount *= (tax.add_deduct_tax == "Deduct") ? -1.0 : 1.0;
+			current_tax_amount *= tax.add_deduct_tax == "Deduct" ? -1.0 : 1.0;
 
-			if(i==0) {
+			if (i == 0) {
 				tax.total = flt(frm.doc.paid_amount_after_tax + current_tax_amount, precision("total", tax));
 			} else {
-				tax.total = flt(frm.doc["taxes"][i-1].total + current_tax_amount, precision("total", tax));
+				tax.total = flt(frm.doc["taxes"][i - 1].total + current_tax_amount, precision("total", tax));
 			}
 
 			// tac accounts are only in company currency
-			tax.base_total = tax.total
+			tax.base_total = tax.total;
 
 			// calculate total taxes and base total taxes
-			if(frm.doc.payment_type == "Pay") {
+			if (frm.doc.payment_type == "Pay") {
 				// tax accounts only have company currency
-				if(tax.currency != frm.doc.paid_to_account_currency) {
+				if (tax.currency != frm.doc.paid_to_account_currency) {
 					//total_taxes_and_charges has the target currency. so using target conversion rate
 					frm.doc.total_taxes_and_charges += flt(current_tax_amount / frm.doc.target_exchange_rate);
-
 				} else {
 					frm.doc.total_taxes_and_charges += current_tax_amount;
 				}
-			} else if(frm.doc.payment_type == "Receive") {
-				if(tax.currency != frm.doc.paid_from_account_currency) {
+			} else if (frm.doc.payment_type == "Receive") {
+				if (tax.currency != frm.doc.paid_from_account_currency) {
 					//total_taxes_and_charges has the target currency. so using source conversion rate
 					frm.doc.total_taxes_and_charges += flt(current_tax_amount / frm.doc.source_exchange_rate);
 				} else {
@@ -1357,49 +1613,48 @@
 
 			frm.doc.base_total_taxes_and_charges += tax.base_tax_amount;
 
-			frm.refresh_field('taxes');
-			frm.refresh_field('total_taxes_and_charges');
-			frm.refresh_field('base_total_taxes_and_charges');
+			frm.refresh_field("taxes");
+			frm.refresh_field("total_taxes_and_charges");
+			frm.refresh_field("base_total_taxes_and_charges");
 		});
 	},
 
-	get_current_tax_amount: function(frm, tax) {
+	get_current_tax_amount: function (frm, tax) {
 		let tax_rate = tax.rate;
 		let current_tax_amount = 0.0;
 
 		// To set row_id by default as previous row.
-		if(["On Previous Row Amount", "On Previous Row Total"].includes(tax.charge_type)) {
+		if (["On Previous Row Amount", "On Previous Row Total"].includes(tax.charge_type)) {
 			if (tax.idx === 1) {
 				frappe.throw(
-					__("Cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for first row"));
+					__(
+						"Cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for first row"
+					)
+				);
 			}
 		}
 
-		if(tax.charge_type == "Actual") {
-			current_tax_amount = flt(tax.tax_amount, precision("tax_amount", tax))
-		} else if(tax.charge_type == "On Paid Amount") {
+		if (tax.charge_type == "Actual") {
+			current_tax_amount = flt(tax.tax_amount, precision("tax_amount", tax));
+		} else if (tax.charge_type == "On Paid Amount") {
 			current_tax_amount = flt((tax_rate / 100.0) * frm.doc.paid_amount_after_tax);
-		} else if(tax.charge_type == "On Previous Row Amount") {
-			current_tax_amount = flt((tax_rate / 100.0) *
-				frm.doc["taxes"][cint(tax.row_id) - 1].tax_amount);
-
-		} else if(tax.charge_type == "On Previous Row Total") {
-			current_tax_amount = flt((tax_rate / 100.0) *
-				frm.doc["taxes"][cint(tax.row_id) - 1].total);
+		} else if (tax.charge_type == "On Previous Row Amount") {
+			current_tax_amount = flt((tax_rate / 100.0) * frm.doc["taxes"][cint(tax.row_id) - 1].tax_amount);
+		} else if (tax.charge_type == "On Previous Row Total") {
+			current_tax_amount = flt((tax_rate / 100.0) * frm.doc["taxes"][cint(tax.row_id) - 1].total);
 		}
 
 		return current_tax_amount;
 	},
 });
 
-
-frappe.ui.form.on('Payment Entry Reference', {
-	reference_doctype: function(frm, cdt, cdn) {
+frappe.ui.form.on("Payment Entry Reference", {
+	reference_doctype: function (frm, cdt, cdn) {
 		var row = locals[cdt][cdn];
 		frm.events.validate_reference_document(frm, row);
 	},
 
-	reference_name: function(frm, cdt, cdn) {
+	reference_name: function (frm, cdt, cdn) {
 		var row = locals[cdt][cdn];
 		if (row.reference_name && row.reference_doctype) {
 			return frappe.call({
@@ -1407,79 +1662,83 @@
 				args: {
 					reference_doctype: row.reference_doctype,
 					reference_name: row.reference_name,
-					party_account_currency: frm.doc.payment_type=="Receive" ?
-						frm.doc.paid_from_account_currency : frm.doc.paid_to_account_currency
+					party_account_currency:
+						frm.doc.payment_type == "Receive"
+							? frm.doc.paid_from_account_currency
+							: frm.doc.paid_to_account_currency,
 				},
-				callback: function(r, rt) {
-					if(r.message) {
-						$.each(r.message, function(field, value) {
+				callback: function (r, rt) {
+					if (r.message) {
+						$.each(r.message, function (field, value) {
 							frappe.model.set_value(cdt, cdn, field, value);
-						})
+						});
 
-						let allocated_amount = frm.doc.unallocated_amount > row.outstanding_amount ?
-							row.outstanding_amount : frm.doc.unallocated_amount;
+						let allocated_amount =
+							frm.doc.unallocated_amount > row.outstanding_amount
+								? row.outstanding_amount
+								: frm.doc.unallocated_amount;
 
-						frappe.model.set_value(cdt, cdn, 'allocated_amount', allocated_amount);
+						frappe.model.set_value(cdt, cdn, "allocated_amount", allocated_amount);
 						frm.refresh_fields();
 					}
-				}
-			})
+				},
+			});
 		}
 	},
 
-	allocated_amount: function(frm) {
+	allocated_amount: function (frm) {
 		frm.events.set_total_allocated_amount(frm);
 	},
 
-	references_remove: function(frm) {
+	references_remove: function (frm) {
 		frm.events.set_total_allocated_amount(frm);
-	}
-})
+	},
+});
 
-frappe.ui.form.on('Advance Taxes and Charges', {
-	rate: function(frm) {
+frappe.ui.form.on("Advance Taxes and Charges", {
+	rate: function (frm) {
 		frm.events.apply_taxes(frm);
 		frm.events.set_unallocated_amount(frm);
 	},
 
-	tax_amount : function(frm) {
+	tax_amount: function (frm) {
 		frm.events.apply_taxes(frm);
 		frm.events.set_unallocated_amount(frm);
 	},
 
-	row_id: function(frm) {
+	row_id: function (frm) {
 		frm.events.apply_taxes(frm);
 		frm.events.set_unallocated_amount(frm);
 	},
 
-	taxes_remove: function(frm) {
+	taxes_remove: function (frm) {
 		frm.events.apply_taxes(frm);
 		frm.events.set_unallocated_amount(frm);
 	},
 
-	included_in_paid_amount: function(frm) {
+	included_in_paid_amount: function (frm) {
 		frm.events.apply_taxes(frm);
 		frm.events.set_unallocated_amount(frm);
 	},
 
-	charge_type: function(frm) {
+	charge_type: function (frm) {
 		frm.events.apply_taxes(frm);
 		frm.events.set_unallocated_amount(frm);
-	}
-})
+	},
+});
 
-frappe.ui.form.on('Payment Entry Deduction', {
-	amount: function(frm) {
+frappe.ui.form.on("Payment Entry Deduction", {
+	amount: function (frm) {
 		frm.events.set_unallocated_amount(frm);
 	},
 
-	deductions_remove: function(frm) {
+	deductions_remove: function (frm) {
 		frm.events.set_unallocated_amount(frm);
-	}
-})
-frappe.ui.form.on('Payment Entry', {
-	cost_center: function(frm){
-		if (frm.doc.posting_date && (frm.doc.paid_from||frm.doc.paid_to)) {
+	},
+});
+frappe.ui.form.on("Payment Entry", {
+	cost_center: function (frm) {
+		if (frm.doc.posting_date && (frm.doc.paid_from || frm.doc.paid_to)) {
 			return frappe.call({
 				method: "erpnext.accounts.doctype.payment_entry.payment_entry.get_party_and_account_balance",
 				args: {
@@ -1489,21 +1748,23 @@
 					paid_to: frm.doc.paid_to,
 					ptype: frm.doc.party_type,
 					pty: frm.doc.party,
-					cost_center: frm.doc.cost_center
+					cost_center: frm.doc.cost_center,
 				},
-				callback: function(r, rt) {
-					if(r.message) {
+				callback: function (r, rt) {
+					if (r.message) {
 						frappe.run_serially([
 							() => {
-								frm.set_value("paid_from_account_balance", r.message.paid_from_account_balance);
+								frm.set_value(
+									"paid_from_account_balance",
+									r.message.paid_from_account_balance
+								);
 								frm.set_value("paid_to_account_balance", r.message.paid_to_account_balance);
 								frm.set_value("party_balance", r.message.party_balance);
-							}
+							},
 						]);
-
 					}
-				}
+				},
 			});
 		}
 	},
-})
+});
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py
index 77efe78..7970a3e 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.py
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py
@@ -1271,7 +1271,13 @@
 				references = [x for x in self.get("references") if x.name == entry.name]
 
 			for ref in references:
-				if ref.reference_doctype in ("Sales Invoice", "Purchase Invoice", "Journal Entry"):
+				if ref.reference_doctype in (
+					"Sales Invoice",
+					"Purchase Invoice",
+					"Journal Entry",
+					"Sales Order",
+					"Purchase Order",
+				):
 					self.add_advance_gl_for_reference(gl_entries, ref)
 
 	def add_advance_gl_for_reference(self, gl_entries, invoice):
@@ -1285,14 +1291,15 @@
 			"voucher_detail_no": invoice.name,
 		}
 
-		posting_date = frappe.db.get_value(
-			invoice.reference_doctype, invoice.reference_name, "posting_date"
-		)
+		date_field = "posting_date"
+		if invoice.reference_doctype in ["Sales Order", "Purchase Order"]:
+			date_field = "transaction_date"
+		posting_date = frappe.db.get_value(invoice.reference_doctype, invoice.reference_name, date_field)
 
 		if getdate(posting_date) < getdate(self.posting_date):
 			posting_date = self.posting_date
 
-		dr_or_cr = "credit" if invoice.reference_doctype == "Sales Invoice" else "debit"
+		dr_or_cr = "credit" if invoice.reference_doctype in ["Sales Invoice", "Sales Order"] else "debit"
 		args_dict["account"] = invoice.account
 		args_dict[dr_or_cr] = invoice.allocated_amount
 		args_dict[dr_or_cr + "_in_account_currency"] = invoice.allocated_amount
@@ -2197,6 +2204,11 @@
 		else:
 			outstanding_amount = flt(total_amount) - flt(ref_doc.get("advance_paid"))
 
+		if reference_doctype in ["Sales Order", "Purchase Order"]:
+			party_type = "Customer" if reference_doctype == "Sales Order" else "Supplier"
+			party_field = "customer" if reference_doctype == "Sales Order" else "supplier"
+			party = ref_doc.get(party_field)
+			account = get_party_account(party_type, party, ref_doc.company)
 	else:
 		# Get the exchange rate based on the posting date of the ref doc.
 		exchange_rate = get_exchange_rate(party_account_currency, company_currency, ref_doc.posting_date)
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry_list.js b/erpnext/accounts/doctype/payment_entry/payment_entry_list.js
index 2d76fe6..6974e58 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry_list.js
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry_list.js
@@ -1,14 +1,13 @@
-frappe.listview_settings['Payment Entry'] = {
-
-	onload: function(listview) {
+frappe.listview_settings["Payment Entry"] = {
+	onload: function (listview) {
 		if (listview.page.fields_dict.party_type) {
-			listview.page.fields_dict.party_type.get_query = function() {
+			listview.page.fields_dict.party_type.get_query = function () {
 				return {
-					"filters": {
-						"name": ["in", Object.keys(frappe.boot.party_account_types)],
-					}
+					filters: {
+						name: ["in", Object.keys(frappe.boot.party_account_types)],
+					},
 				};
 			};
 		}
-	}
+	},
 };
diff --git a/erpnext/accounts/doctype/payment_entry/test_payment_entry.py b/erpnext/accounts/doctype/payment_entry/test_payment_entry.py
index 8a03dd7..5a014b8 100644
--- a/erpnext/accounts/doctype/payment_entry/test_payment_entry.py
+++ b/erpnext/accounts/doctype/payment_entry/test_payment_entry.py
@@ -1070,6 +1070,8 @@
 		self.assertRaises(frappe.ValidationError, pe_draft.submit)
 
 	def test_details_update_on_reference_table(self):
+		from erpnext.accounts.party import get_party_account
+
 		so = make_sales_order(
 			customer="_Test Customer USD", currency="USD", qty=1, rate=100, do_not_submit=True
 		)
@@ -1084,6 +1086,7 @@
 
 		ref_details = get_reference_details(so.doctype, so.name, pe.paid_from_account_currency)
 		expected_response = {
+			"account": get_party_account("Customer", so.customer, so.company),
 			"total_amount": 5000.0,
 			"outstanding_amount": 5000.0,
 			"exchange_rate": 1.0,
diff --git a/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account.js b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account.js
index aff067e..f15c2bd 100644
--- a/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account.js
+++ b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account.js
@@ -1,11 +1,11 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.ui.form.on('Payment Gateway Account', {
+frappe.ui.form.on("Payment Gateway Account", {
 	refresh(frm) {
 		erpnext.utils.check_payments_app();
-		if(!frm.doc.__islocal) {
-			frm.set_df_property('payment_gateway', 'read_only', 1);
+		if (!frm.doc.__islocal) {
+			frm.set_df_property("payment_gateway", "read_only", 1);
 		}
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/payment_ledger_entry/payment_ledger_entry.js b/erpnext/accounts/doctype/payment_ledger_entry/payment_ledger_entry.js
index 5a7be8e..07fe831 100644
--- a/erpnext/accounts/doctype/payment_ledger_entry/payment_ledger_entry.js
+++ b/erpnext/accounts/doctype/payment_ledger_entry/payment_ledger_entry.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Payment Ledger Entry', {
+frappe.ui.form.on("Payment Ledger Entry", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/accounts/doctype/payment_order/payment_order.js b/erpnext/accounts/doctype/payment_order/payment_order.js
index 6630e71..f009de5 100644
--- a/erpnext/accounts/doctype/payment_order/payment_order.js
+++ b/erpnext/accounts/doctype/payment_order/payment_order.js
@@ -1,61 +1,69 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Payment Order', {
-	setup: function(frm) {
-		frm.set_query("company_bank_account", function() {
+frappe.ui.form.on("Payment Order", {
+	setup: function (frm) {
+		frm.set_query("company_bank_account", function () {
 			return {
 				filters: {
-					"is_company_account":1
-				}
-			}
+					is_company_account: 1,
+				},
+			};
 		});
 
-		frm.set_df_property('references', 'cannot_add_rows', true);
+		frm.set_df_property("references", "cannot_add_rows", true);
 	},
-	refresh: function(frm) {
+	refresh: function (frm) {
 		if (frm.doc.docstatus == 0) {
-			frm.add_custom_button(__('Payment Request'), function() {
-				frm.trigger("get_from_payment_request");
-			}, __("Get Payments from"));
+			frm.add_custom_button(
+				__("Payment Request"),
+				function () {
+					frm.trigger("get_from_payment_request");
+				},
+				__("Get Payments from")
+			);
 
-			frm.add_custom_button(__('Payment Entry'), function() {
-				frm.trigger("get_from_payment_entry");
-			}, __("Get Payments from"));
+			frm.add_custom_button(
+				__("Payment Entry"),
+				function () {
+					frm.trigger("get_from_payment_entry");
+				},
+				__("Get Payments from")
+			);
 
-			frm.trigger('remove_button');
+			frm.trigger("remove_button");
 		}
 
 		// payment Entry
-		if (frm.doc.docstatus===1 && frm.doc.payment_order_type==='Payment Request') {
-			frm.add_custom_button(__('Create Payment Entries'), function() {
+		if (frm.doc.docstatus === 1 && frm.doc.payment_order_type === "Payment Request") {
+			frm.add_custom_button(__("Create Payment Entries"), function () {
 				frm.trigger("make_payment_records");
 			});
 		}
 	},
 
-	remove_row_if_empty: function(frm) {
+	remove_row_if_empty: function (frm) {
 		// remove if first row is empty
 		if (frm.doc.references.length > 0 && !frm.doc.references[0].reference_name) {
 			frm.doc.references = [];
 		}
 	},
 
-	remove_button: function(frm) {
+	remove_button: function (frm) {
 		// remove custom button of order type that is not imported
 
 		let label = ["Payment Request", "Payment Entry"];
 
 		if (frm.doc.references.length > 0 && frm.doc.payment_order_type) {
-			label = label.reduce(x => {
-				x!= frm.doc.payment_order_type;
+			label = label.reduce((x) => {
+				x != frm.doc.payment_order_type;
 				return x;
 			});
 			frm.remove_custom_button(label, "Get from");
 		}
 	},
 
-	get_from_payment_entry: function(frm) {
+	get_from_payment_entry: function (frm) {
 		frm.trigger("remove_row_if_empty");
 		erpnext.utils.map_current_doc({
 			method: "erpnext.accounts.doctype.payment_entry.payment_entry.make_payment_order",
@@ -63,7 +71,7 @@
 			target: frm,
 			date_field: "posting_date",
 			setters: {
-				party: frm.doc.supplier || ""
+				party: frm.doc.supplier || "",
 			},
 			get_query_filters: {
 				bank: frm.doc.bank,
@@ -71,70 +79,79 @@
 				payment_type: ["!=", "Receive"],
 				bank_account: frm.doc.company_bank_account,
 				paid_from: frm.doc.account,
-				payment_order_status: ["=", "Initiated"]
-			}
+				payment_order_status: ["=", "Initiated"],
+			},
 		});
 	},
 
-	get_from_payment_request: function(frm) {
+	get_from_payment_request: function (frm) {
 		frm.trigger("remove_row_if_empty");
 		erpnext.utils.map_current_doc({
 			method: "erpnext.accounts.doctype.payment_request.payment_request.make_payment_order",
 			source_doctype: "Payment Request",
 			target: frm,
 			setters: {
-				party: frm.doc.supplier || ""
+				party: frm.doc.supplier || "",
 			},
 			get_query_filters: {
 				bank: frm.doc.bank,
 				docstatus: 1,
 				status: ["=", "Initiated"],
-			}
+			},
 		});
 	},
 
-	make_payment_records: function(frm){
+	make_payment_records: function (frm) {
 		var dialog = new frappe.ui.Dialog({
 			title: __("For Supplier"),
 			fields: [
-				{"fieldtype": "Link", "label": __("Supplier"), "fieldname": "supplier", "options":"Supplier",
-					"get_query": function () {
+				{
+					fieldtype: "Link",
+					label: __("Supplier"),
+					fieldname: "supplier",
+					options: "Supplier",
+					get_query: function () {
 						return {
-							query:"erpnext.accounts.doctype.payment_order.payment_order.get_supplier_query",
-							filters: {'parent': frm.doc.name}
-						}
-					}, "reqd": 1
+							query: "erpnext.accounts.doctype.payment_order.payment_order.get_supplier_query",
+							filters: { parent: frm.doc.name },
+						};
+					},
+					reqd: 1,
 				},
 
-				{"fieldtype": "Link", "label": __("Mode of Payment"), "fieldname": "mode_of_payment", "options":"Mode of Payment",
-					"get_query": function () {
+				{
+					fieldtype: "Link",
+					label: __("Mode of Payment"),
+					fieldname: "mode_of_payment",
+					options: "Mode of Payment",
+					get_query: function () {
 						return {
-							query:"erpnext.accounts.doctype.payment_order.payment_order.get_mop_query",
-							filters: {'parent': frm.doc.name}
-						}
-					}
-				}
-			]
+							query: "erpnext.accounts.doctype.payment_order.payment_order.get_mop_query",
+							filters: { parent: frm.doc.name },
+						};
+					},
+				},
+			],
 		});
 
-		dialog.set_primary_action(__("Submit"), function() {
+		dialog.set_primary_action(__("Submit"), function () {
 			var args = dialog.get_values();
-			if(!args) return;
+			if (!args) return;
 
 			return frappe.call({
 				method: "erpnext.accounts.doctype.payment_order.payment_order.make_payment_records",
 				args: {
-					"name": frm.doc.name,
-					"supplier": args.supplier,
-					"mode_of_payment": args.mode_of_payment
+					name: frm.doc.name,
+					supplier: args.supplier,
+					mode_of_payment: args.mode_of_payment,
 				},
 				freeze: true,
-				callback: function(r) {
+				callback: function (r) {
 					dialog.hide();
 					frm.refresh();
-				}
-			})
-		})
+				},
+			});
+		});
 
 		dialog.show();
 	},
diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js
index 99593de..cc99fe7 100644
--- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js
+++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js
@@ -2,97 +2,94 @@
 // For license information, please see license.txt
 
 frappe.provide("erpnext.accounts");
-erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationController extends frappe.ui.form.Controller {
+erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationController extends (
+	frappe.ui.form.Controller
+) {
 	onload() {
-		const default_company = frappe.defaults.get_default('company');
-		this.frm.set_value('company', default_company);
+		const default_company = frappe.defaults.get_default("company");
+		this.frm.set_value("company", default_company);
 
-		this.frm.set_value('party_type', '');
-		this.frm.set_value('party', '');
-		this.frm.set_value('receivable_payable_account', '');
+		this.frm.set_value("party_type", "");
+		this.frm.set_value("party", "");
+		this.frm.set_value("receivable_payable_account", "");
 
 		this.frm.set_query("party_type", () => {
 			return {
-				"filters": {
-					"name": ["in", Object.keys(frappe.boot.party_account_types)],
-				}
-			}
-		});
-
-		this.frm.set_query('receivable_payable_account', () => {
-			return {
 				filters: {
-					"company": this.frm.doc.company,
-					"is_group": 0,
-					"account_type": frappe.boot.party_account_types[this.frm.doc.party_type],
-					"root_type": this.frm.doc.party_type == 'Customer' ? "Asset" : "Liability"
-				}
+					name: ["in", Object.keys(frappe.boot.party_account_types)],
+				},
 			};
 		});
 
-		this.frm.set_query('default_advance_account', () => {
+		this.frm.set_query("receivable_payable_account", () => {
 			return {
 				filters: {
-					"company": this.frm.doc.company,
-					"is_group": 0,
-					"account_type": this.frm.doc.party_type == 'Customer' ? "Receivable": "Payable",
-					"root_type": this.frm.doc.party_type == 'Customer' ? "Liability": "Asset"
-				}
+					company: this.frm.doc.company,
+					is_group: 0,
+					account_type: frappe.boot.party_account_types[this.frm.doc.party_type],
+					root_type: this.frm.doc.party_type == "Customer" ? "Asset" : "Liability",
+				},
 			};
 		});
 
-		this.frm.set_query('bank_cash_account', () => {
+		this.frm.set_query("default_advance_account", () => {
 			return {
-				filters:[
-					['Account', 'company', '=', this.frm.doc.company],
-					['Account', 'is_group', '=', 0],
-					['Account', 'account_type', 'in', ['Bank', 'Cash']]
-				]
+				filters: {
+					company: this.frm.doc.company,
+					is_group: 0,
+					account_type: this.frm.doc.party_type == "Customer" ? "Receivable" : "Payable",
+					root_type: this.frm.doc.party_type == "Customer" ? "Liability" : "Asset",
+				},
+			};
+		});
+
+		this.frm.set_query("bank_cash_account", () => {
+			return {
+				filters: [
+					["Account", "company", "=", this.frm.doc.company],
+					["Account", "is_group", "=", 0],
+					["Account", "account_type", "in", ["Bank", "Cash"]],
+				],
 			};
 		});
 
 		this.frm.set_query("cost_center", () => {
 			return {
-				"filters": {
-					"company": this.frm.doc.company,
-					"is_group": 0
-				}
-			}
+				filters: {
+					company: this.frm.doc.company,
+					is_group: 0,
+				},
+			};
 		});
 	}
 
 	refresh() {
 		this.frm.disable_save();
 
-		this.frm.set_df_property('invoices', 'cannot_delete_rows', true);
-		this.frm.set_df_property('payments', 'cannot_delete_rows', true);
-		this.frm.set_df_property('allocation', 'cannot_delete_rows', true);
+		this.frm.set_df_property("invoices", "cannot_delete_rows", true);
+		this.frm.set_df_property("payments", "cannot_delete_rows", true);
+		this.frm.set_df_property("allocation", "cannot_delete_rows", true);
 
-		this.frm.set_df_property('invoices', 'cannot_add_rows', true);
-		this.frm.set_df_property('payments', 'cannot_add_rows', true);
-		this.frm.set_df_property('allocation', 'cannot_add_rows', true);
-
+		this.frm.set_df_property("invoices", "cannot_add_rows", true);
+		this.frm.set_df_property("payments", "cannot_add_rows", true);
+		this.frm.set_df_property("allocation", "cannot_add_rows", true);
 
 		if (this.frm.doc.receivable_payable_account) {
-			this.frm.add_custom_button(__('Get Unreconciled Entries'), () =>
+			this.frm.add_custom_button(__("Get Unreconciled Entries"), () =>
 				this.frm.trigger("get_unreconciled_entries")
 			);
-			this.frm.change_custom_button_type(__('Get Unreconciled Entries'), null, 'primary');
+			this.frm.change_custom_button_type(__("Get Unreconciled Entries"), null, "primary");
 		}
 		if (this.frm.doc.invoices.length && this.frm.doc.payments.length) {
-			this.frm.add_custom_button(__('Allocate'), () =>
-				this.frm.trigger("allocate")
-			);
-			this.frm.change_custom_button_type(__('Allocate'), null, 'primary');
-			this.frm.change_custom_button_type(__('Get Unreconciled Entries'), null, 'default');
+			this.frm.add_custom_button(__("Allocate"), () => this.frm.trigger("allocate"));
+			this.frm.change_custom_button_type(__("Allocate"), null, "primary");
+			this.frm.change_custom_button_type(__("Get Unreconciled Entries"), null, "default");
 		}
 		if (this.frm.doc.allocation.length) {
-			this.frm.add_custom_button(__('Reconcile'), () =>
-				this.frm.trigger("reconcile")
-			);
-			this.frm.change_custom_button_type(__('Reconcile'), null, 'primary');
-			this.frm.change_custom_button_type(__('Get Unreconciled Entries'), null, 'default');
-			this.frm.change_custom_button_type(__('Allocate'), null, 'default');
+			this.frm.add_custom_button(__("Reconcile"), () => this.frm.trigger("reconcile"));
+			this.frm.change_custom_button_type(__("Reconcile"), null, "primary");
+			this.frm.change_custom_button_type(__("Get Unreconciled Entries"), null, "default");
+			this.frm.change_custom_button_type(__("Allocate"), null, "default");
 		}
 
 		this.frm.trigger("set_query_for_dimension_filters");
@@ -101,31 +98,39 @@
 		if (this.frm.doc.receivable_payable_account) {
 			this.frm.call({
 				doc: this.frm.doc,
-				method: 'is_auto_process_enabled',
+				method: "is_auto_process_enabled",
 				callback: (r) => {
 					if (r.message) {
-						this.frm.call({
-							'method': "erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.is_any_doc_running",
-							"args": {
-								for_filter: {
-									company: this.frm.doc.company,
-									party_type: this.frm.doc.party_type,
-									party: this.frm.doc.party,
-									receivable_payable_account: this.frm.doc.receivable_payable_account
+						this.frm
+							.call({
+								method: "erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.is_any_doc_running",
+								args: {
+									for_filter: {
+										company: this.frm.doc.company,
+										party_type: this.frm.doc.party_type,
+										party: this.frm.doc.party,
+										receivable_payable_account: this.frm.doc.receivable_payable_account,
+									},
+								},
+							})
+							.then((r) => {
+								if (r.message) {
+									let doc_link = frappe.utils.get_form_link(
+										"Process Payment Reconciliation",
+										r.message,
+										true
+									);
+									let msg = __(
+										"Payment Reconciliation Job: {0} is running for this party. Can't reconcile now.",
+										[doc_link]
+									);
+									this.frm.dashboard.add_comment(msg, "yellow");
 								}
-							}
-						}).then(r => {
-							if (r.message) {
-								let doc_link = frappe.utils.get_form_link("Process Payment Reconciliation", r.message, true);
-								let msg = __("Payment Reconciliation Job: {0} is running for this party. Can't reconcile now.", [doc_link]);
-								this.frm.dashboard.add_comment(msg, "yellow");
-							}
-						});
+							});
 					}
-				}
+				},
 			});
 		}
-
 	}
 	set_query_for_dimension_filters() {
 		frappe.call({
@@ -135,29 +140,29 @@
 			},
 			callback: (r) => {
 				if (!r.exc && r.message) {
-					r.message.forEach(x => {
+					r.message.forEach((x) => {
 						this.frm.set_query(x.fieldname, () => {
 							return {
-								'filters': x.filters
+								filters: x.filters,
 							};
 						});
 					});
 				}
-			}
+			},
 		});
 	}
 
 	company() {
-		this.frm.set_value('party', '');
-		this.frm.set_value('receivable_payable_account', '');
+		this.frm.set_value("party", "");
+		this.frm.set_value("receivable_payable_account", "");
 	}
 
 	party_type() {
-		this.frm.set_value('party', '');
+		this.frm.set_value("party", "");
 	}
 
 	party() {
-		this.frm.set_value('receivable_payable_account', '');
+		this.frm.set_value("receivable_payable_account", "");
 		this.frm.trigger("clear_child_tables");
 
 		if (!this.frm.doc.receivable_payable_account && this.frm.doc.party_type && this.frm.doc.party) {
@@ -167,7 +172,7 @@
 					company: this.frm.doc.company,
 					party_type: this.frm.doc.party_type,
 					party: this.frm.doc.party,
-					include_advance: 1
+					include_advance: 1,
 				},
 				callback: (r) => {
 					if (!r.exc && r.message) {
@@ -175,7 +180,7 @@
 						this.frm.set_value("default_advance_account", r.message[1]);
 					}
 					this.frm.refresh();
-				}
+				},
 			});
 		}
 	}
@@ -193,7 +198,6 @@
 		this.frm.trigger("get_unreconciled_entries");
 	}
 
-
 	clear_child_tables() {
 		this.frm.clear_table("invoices");
 		this.frm.clear_table("payments");
@@ -205,52 +209,52 @@
 		this.frm.clear_table("allocation");
 		return this.frm.call({
 			doc: this.frm.doc,
-			method: 'get_unreconciled_entries',
+			method: "get_unreconciled_entries",
 			callback: () => {
 				if (!(this.frm.doc.payments.length || this.frm.doc.invoices.length)) {
-					frappe.throw({message: __("No Unreconciled Invoices and Payments found for this party and account")});
-				} else if (!(this.frm.doc.invoices.length)) {
-					frappe.throw({message: __("No Outstanding Invoices found for this party")});
-				} else if (!(this.frm.doc.payments.length)) {
-					frappe.throw({message: __("No Unreconciled Payments found for this party")});
+					frappe.throw({
+						message: __("No Unreconciled Invoices and Payments found for this party and account"),
+					});
+				} else if (!this.frm.doc.invoices.length) {
+					frappe.throw({ message: __("No Outstanding Invoices found for this party") });
+				} else if (!this.frm.doc.payments.length) {
+					frappe.throw({ message: __("No Unreconciled Payments found for this party") });
 				}
 				this.frm.refresh();
-			}
+			},
 		});
-
 	}
 
 	allocate() {
 		let payments = this.frm.fields_dict.payments.grid.get_selected_children();
-		if (!(payments.length)) {
+		if (!payments.length) {
 			payments = this.frm.doc.payments;
 		}
 		let invoices = this.frm.fields_dict.invoices.grid.get_selected_children();
-		if (!(invoices.length)) {
+		if (!invoices.length) {
 			invoices = this.frm.doc.invoices;
 		}
 		return this.frm.call({
 			doc: this.frm.doc,
-			method: 'allocate_entries',
+			method: "allocate_entries",
 			args: {
 				payments: payments,
-				invoices: invoices
+				invoices: invoices,
 			},
 			callback: () => {
 				this.frm.refresh();
-			}
+			},
 		});
 	}
 
 	reconcile() {
-		var show_dialog = this.frm.doc.allocation.filter(d => d.difference_amount);
+		var show_dialog = this.frm.doc.allocation.filter((d) => d.difference_amount);
 
 		if (show_dialog && show_dialog.length) {
-
 			this.data = [];
 			const dialog = new frappe.ui.Dialog({
 				title: __("Select Difference Account"),
-				size: 'extra-large',
+				size: "extra-large",
 				fields: [
 					{
 						fieldname: "allocation",
@@ -262,77 +266,89 @@
 						get_data: () => {
 							return this.data;
 						},
-						fields: [{
-							fieldtype:'Data',
-							fieldname:"docname",
-							in_list_view: 1,
-							hidden: 1
-						}, {
-							fieldtype:'Data',
-							fieldname:"reference_name",
-							label: __("Voucher No"),
-							in_list_view: 1,
-							read_only: 1
-						}, {
-							fieldtype:'Date',
-							fieldname:"gain_loss_posting_date",
-							label: __("Posting Date"),
-							in_list_view: 1,
-							reqd: 1,
-						}, {
-
-							fieldtype:'Link',
-							options: 'Account',
-							in_list_view: 1,
-							label: __("Difference Account"),
-							fieldname: 'difference_account',
-							reqd: 1,
-							get_query: () => {
-								return {
-									filters: {
-										company: this.frm.doc.company,
-										is_group: 0
-									}
-								}
-							}
-						}, {
-							fieldtype:'Currency',
-							in_list_view: 1,
-							label: __("Difference Amount"),
-							fieldname: 'difference_amount',
-							read_only: 1
-						}]
+						fields: [
+							{
+								fieldtype: "Data",
+								fieldname: "docname",
+								in_list_view: 1,
+								hidden: 1,
+							},
+							{
+								fieldtype: "Data",
+								fieldname: "reference_name",
+								label: __("Voucher No"),
+								in_list_view: 1,
+								read_only: 1,
+							},
+							{
+								fieldtype: "Date",
+								fieldname: "gain_loss_posting_date",
+								label: __("Posting Date"),
+								in_list_view: 1,
+								reqd: 1,
+							},
+							{
+								fieldtype: "Link",
+								options: "Account",
+								in_list_view: 1,
+								label: __("Difference Account"),
+								fieldname: "difference_account",
+								reqd: 1,
+								get_query: () => {
+									return {
+										filters: {
+											company: this.frm.doc.company,
+											is_group: 0,
+										},
+									};
+								},
+							},
+							{
+								fieldtype: "Currency",
+								in_list_view: 1,
+								label: __("Difference Amount"),
+								fieldname: "difference_amount",
+								read_only: 1,
+							},
+						],
 					},
 					{
-						fieldtype: 'HTML',
-						options: "<b> New Journal Entry will be posted for the difference amount </b>"
-					}
+						fieldtype: "HTML",
+						options: "<b> New Journal Entry will be posted for the difference amount </b>",
+					},
 				],
 				primary_action: () => {
 					const args = dialog.get_values()["allocation"];
 
-					args.forEach(d => {
-						frappe.model.set_value("Payment Reconciliation Allocation", d.docname,
-							"difference_account", d.difference_account);
-						frappe.model.set_value("Payment Reconciliation Allocation", d.docname,
-							"gain_loss_posting_date", d.gain_loss_posting_date);
-
+					args.forEach((d) => {
+						frappe.model.set_value(
+							"Payment Reconciliation Allocation",
+							d.docname,
+							"difference_account",
+							d.difference_account
+						);
+						frappe.model.set_value(
+							"Payment Reconciliation Allocation",
+							d.docname,
+							"gain_loss_posting_date",
+							d.gain_loss_posting_date
+						);
 					});
 
 					this.reconcile_payment_entries();
 					dialog.hide();
 				},
-				primary_action_label: __('Reconcile Entries')
+				primary_action_label: __("Reconcile Entries"),
 			});
 
-			this.frm.doc.allocation.forEach(d => {
+			this.frm.doc.allocation.forEach((d) => {
 				if (d.difference_amount) {
 					dialog.fields_dict.allocation.df.data.push({
-						'docname': d.name,
-						'reference_name': d.reference_name,
-						'difference_amount': d.difference_amount,
-						'difference_account': d.difference_account,
-						'gain_loss_posting_date': d.gain_loss_posting_date
+						docname: d.name,
+						reference_name: d.reference_name,
+						difference_amount: d.difference_amount,
+						difference_account: d.difference_account,
+						gain_loss_posting_date: d.gain_loss_posting_date,
 					});
 				}
 			});
@@ -348,41 +364,39 @@
 	reconcile_payment_entries() {
 		return this.frm.call({
 			doc: this.frm.doc,
-			method: 'reconcile',
+			method: "reconcile",
 			callback: () => {
 				this.frm.clear_table("allocation");
 				this.frm.refresh();
-			}
+			},
 		});
 	}
 };
 
-frappe.ui.form.on('Payment Reconciliation Allocation', {
-	allocated_amount: function(frm, cdt, cdn) {
+frappe.ui.form.on("Payment Reconciliation Allocation", {
+	allocated_amount: function (frm, cdt, cdn) {
 		let row = locals[cdt][cdn];
 		// filter invoice
-		let invoice = frm.doc.invoices.filter((x) => (x.invoice_number == row.invoice_number));
+		let invoice = frm.doc.invoices.filter((x) => x.invoice_number == row.invoice_number);
 		// filter payment
-		let payment = frm.doc.payments.filter((x) => (x.reference_name == row.reference_name));
+		let payment = frm.doc.payments.filter((x) => x.reference_name == row.reference_name);
 
 		frm.call({
 			doc: frm.doc,
-			method: 'calculate_difference_on_allocation_change',
+			method: "calculate_difference_on_allocation_change",
 			args: {
 				payment_entry: payment,
 				invoice: invoice,
-				allocated_amount: row.allocated_amount
+				allocated_amount: row.allocated_amount,
 			},
 			callback: (r) => {
 				if (r.message) {
 					row.difference_amount = r.message;
 					frm.refresh();
 				}
-			}
+			},
 		});
-	}
+	},
 });
 
-
-
-extend_cscript(cur_frm.cscript, new erpnext.accounts.PaymentReconciliationController({frm: cur_frm}));
+extend_cscript(cur_frm.cscript, new erpnext.accounts.PaymentReconciliationController({ frm: cur_frm }));
diff --git a/erpnext/accounts/doctype/payment_request/payment_request.js b/erpnext/accounts/doctype/payment_request/payment_request.js
index c85cd42..d07f824 100644
--- a/erpnext/accounts/doctype/payment_request/payment_request.js
+++ b/erpnext/accounts/doctype/payment_request/payment_request.js
@@ -1,87 +1,99 @@
-cur_frm.add_fetch("payment_gateway_account", "payment_account", "payment_account")
-cur_frm.add_fetch("payment_gateway_account", "payment_gateway", "payment_gateway")
-cur_frm.add_fetch("payment_gateway_account", "message", "message")
+cur_frm.add_fetch("payment_gateway_account", "payment_account", "payment_account");
+cur_frm.add_fetch("payment_gateway_account", "payment_gateway", "payment_gateway");
+cur_frm.add_fetch("payment_gateway_account", "message", "message");
 
 frappe.ui.form.on("Payment Request", {
-	setup: function(frm) {
-		frm.set_query("party_type", function() {
+	setup: function (frm) {
+		frm.set_query("party_type", function () {
 			return {
 				query: "erpnext.setup.doctype.party_type.party_type.get_party_type",
 			};
 		});
-	}
-})
+	},
+});
 
-frappe.ui.form.on("Payment Request", "onload", function(frm, dt, dn){
+frappe.ui.form.on("Payment Request", "onload", function (frm, dt, dn) {
 	if (frm.doc.reference_doctype) {
 		frappe.call({
-			method:"erpnext.accounts.doctype.payment_request.payment_request.get_print_format_list",
-			args: {"ref_doctype": frm.doc.reference_doctype},
-			callback:function(r){
-				set_field_options("print_format", r.message["print_format"])
-			}
-		})
+			method: "erpnext.accounts.doctype.payment_request.payment_request.get_print_format_list",
+			args: { ref_doctype: frm.doc.reference_doctype },
+			callback: function (r) {
+				set_field_options("print_format", r.message["print_format"]);
+			},
+		});
 	}
-})
+});
 
-frappe.ui.form.on("Payment Request", "refresh", function(frm) {
-	if(frm.doc.status == 'Failed'){
+frappe.ui.form.on("Payment Request", "refresh", function (frm) {
+	if (frm.doc.status == "Failed") {
 		frm.set_intro(__("Failure: {0}", [frm.doc.failed_reason]), "red");
 	}
 
-	if(frm.doc.payment_request_type == 'Inward' && frm.doc.payment_channel !== "Phone" &&
-		!in_list(["Initiated", "Paid"], frm.doc.status) && !frm.doc.__islocal && frm.doc.docstatus==1){
-		frm.add_custom_button(__('Resend Payment Email'), function(){
+	if (
+		frm.doc.payment_request_type == "Inward" &&
+		frm.doc.payment_channel !== "Phone" &&
+		!in_list(["Initiated", "Paid"], frm.doc.status) &&
+		!frm.doc.__islocal &&
+		frm.doc.docstatus == 1
+	) {
+		frm.add_custom_button(__("Resend Payment Email"), function () {
 			frappe.call({
 				method: "erpnext.accounts.doctype.payment_request.payment_request.resend_payment_email",
-				args: {"docname": frm.doc.name},
+				args: { docname: frm.doc.name },
 				freeze: true,
 				freeze_message: __("Sending"),
-				callback: function(r){
-					if(!r.exc) {
+				callback: function (r) {
+					if (!r.exc) {
 						frappe.msgprint(__("Message Sent"));
 					}
-				}
+				},
 			});
 		});
 	}
 
-	if((!frm.doc.payment_gateway_account || frm.doc.payment_request_type == "Outward") && frm.doc.status == "Initiated") {
-		frm.add_custom_button(__('Create Payment Entry'), function(){
+	if (
+		(!frm.doc.payment_gateway_account || frm.doc.payment_request_type == "Outward") &&
+		frm.doc.status == "Initiated"
+	) {
+		frm.add_custom_button(__("Create Payment Entry"), function () {
 			frappe.call({
 				method: "erpnext.accounts.doctype.payment_request.payment_request.make_payment_entry",
-				args: {"docname": frm.doc.name},
+				args: { docname: frm.doc.name },
 				freeze: true,
-				callback: function(r){
-					if(!r.exc) {
+				callback: function (r) {
+					if (!r.exc) {
 						var doc = frappe.model.sync(r.message);
 						frappe.set_route("Form", r.message.doctype, r.message.name);
 					}
-				}
+				},
 			});
 		}).addClass("btn-primary");
 	}
 });
 
-frappe.ui.form.on("Payment Request", "is_a_subscription", function(frm) {
+frappe.ui.form.on("Payment Request", "is_a_subscription", function (frm) {
 	frm.toggle_reqd("payment_gateway_account", frm.doc.is_a_subscription);
 	frm.toggle_reqd("subscription_plans", frm.doc.is_a_subscription);
 
 	if (frm.doc.is_a_subscription && frm.doc.reference_doctype && frm.doc.reference_name) {
 		frappe.call({
 			method: "erpnext.accounts.doctype.payment_request.payment_request.get_subscription_details",
-			args: {"reference_doctype": frm.doc.reference_doctype, "reference_name": frm.doc.reference_name},
+			args: { reference_doctype: frm.doc.reference_doctype, reference_name: frm.doc.reference_name },
 			freeze: true,
-			callback: function(data){
-				if(!data.exc) {
-					$.each(data.message || [], function(i, v){
-						var d = frappe.model.add_child(frm.doc, "Subscription Plan Detail", "subscription_plans");
+			callback: function (data) {
+				if (!data.exc) {
+					$.each(data.message || [], function (i, v) {
+						var d = frappe.model.add_child(
+							frm.doc,
+							"Subscription Plan Detail",
+							"subscription_plans"
+						);
 						d.qty = v.qty;
 						d.plan = v.plan;
 					});
 					frm.refresh_field("subscription_plans");
 				}
-			}
+			},
 		});
 	}
 });
diff --git a/erpnext/accounts/doctype/payment_request/payment_request_list.js b/erpnext/accounts/doctype/payment_request/payment_request_list.js
index 43f7856..6e3dcef 100644
--- a/erpnext/accounts/doctype/payment_request/payment_request_list.js
+++ b/erpnext/accounts/doctype/payment_request/payment_request_list.js
@@ -1,26 +1,21 @@
-frappe.listview_settings['Payment Request'] = {
+frappe.listview_settings["Payment Request"] = {
 	add_fields: ["status"],
-	get_indicator: function(doc) {
-		if(doc.status == "Draft") {
+	get_indicator: function (doc) {
+		if (doc.status == "Draft") {
 			return [__("Draft"), "gray", "status,=,Draft"];
 		}
-		if(doc.status == "Requested") {
+		if (doc.status == "Requested") {
 			return [__("Requested"), "green", "status,=,Requested"];
-		}
-		else if(doc.status == "Initiated") {
+		} else if (doc.status == "Initiated") {
 			return [__("Initiated"), "green", "status,=,Initiated"];
-		}
-		else if(doc.status == "Partially Paid") {
+		} else if (doc.status == "Partially Paid") {
 			return [__("Partially Paid"), "orange", "status,=,Partially Paid"];
-		}
-		else if(doc.status == "Paid") {
+		} else if (doc.status == "Paid") {
 			return [__("Paid"), "blue", "status,=,Paid"];
-		}
-		else if(doc.status == "Failed") {
+		} else if (doc.status == "Failed") {
 			return [__("Failed"), "red", "status,=,Failed"];
-		}
-		else if(doc.status == "Cancelled") {
+		} else if (doc.status == "Cancelled") {
 			return [__("Cancelled"), "red", "status,=,Cancelled"];
 		}
-	}
-}
+	},
+};
diff --git a/erpnext/accounts/doctype/payment_term/payment_term.js b/erpnext/accounts/doctype/payment_term/payment_term.js
index 0898a09..96cc507 100644
--- a/erpnext/accounts/doctype/payment_term/payment_term.js
+++ b/erpnext/accounts/doctype/payment_term/payment_term.js
@@ -1,22 +1,24 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
-frappe.ui.form.on('Payment Term', {
+frappe.ui.form.on("Payment Term", {
 	onload(frm) {
-		frm.trigger('set_dynamic_description');
+		frm.trigger("set_dynamic_description");
 	},
 	discount(frm) {
-		frm.trigger('set_dynamic_description');
+		frm.trigger("set_dynamic_description");
 	},
 	discount_type(frm) {
-		frm.trigger('set_dynamic_description');
+		frm.trigger("set_dynamic_description");
 	},
 	set_dynamic_description(frm) {
 		if (frm.doc.discount) {
-			let description = __("{0}% of total invoice value will be given as discount.", [frm.doc.discount]);
-			if (frm.doc.discount_type == 'Amount') {
+			let description = __("{0}% of total invoice value will be given as discount.", [
+				frm.doc.discount,
+			]);
+			if (frm.doc.discount_type == "Amount") {
 				description = __("{0} will be given as discount.", [frm.doc.discount]);
 			}
 			frm.set_df_property("discount", "description", description);
 		}
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.js b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.js
index 6046c13..b766c3b 100644
--- a/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.js
+++ b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.js
@@ -1,12 +1,18 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Payment Terms Template', {
-	refresh: function(frm) {
-		frm.fields_dict.terms.grid.toggle_reqd("payment_term", frm.doc.allocate_payment_based_on_payment_terms);
+frappe.ui.form.on("Payment Terms Template", {
+	refresh: function (frm) {
+		frm.fields_dict.terms.grid.toggle_reqd(
+			"payment_term",
+			frm.doc.allocate_payment_based_on_payment_terms
+		);
 	},
 
-	allocate_payment_based_on_payment_terms: function(frm) {
-		frm.fields_dict.terms.grid.toggle_reqd("payment_term", frm.doc.allocate_payment_based_on_payment_terms);
-	}
+	allocate_payment_based_on_payment_terms: function (frm) {
+		frm.fields_dict.terms.grid.toggle_reqd(
+			"payment_term",
+			frm.doc.allocate_payment_based_on_payment_terms
+		);
+	},
 });
diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.js b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.js
index e923d4e..82d8cb3 100644
--- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.js
+++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.js
@@ -1,38 +1,41 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.ui.form.on('Period Closing Voucher', {
-	onload: function(frm) {
+frappe.ui.form.on("Period Closing Voucher", {
+	onload: function (frm) {
 		if (!frm.doc.transaction_date) frm.doc.transaction_date = frappe.datetime.obj_to_str(new Date());
 	},
 
-	setup: function(frm) {
-		frm.set_query("closing_account_head", function() {
+	setup: function (frm) {
+		frm.set_query("closing_account_head", function () {
 			return {
 				filters: [
-					['Account', 'company', '=', frm.doc.company],
-					['Account', 'is_group', '=', '0'],
-					['Account', 'freeze_account', '=', 'No'],
-					['Account', 'root_type', 'in', 'Liability, Equity']
-				]
-			}
+					["Account", "company", "=", frm.doc.company],
+					["Account", "is_group", "=", "0"],
+					["Account", "freeze_account", "=", "No"],
+					["Account", "root_type", "in", "Liability, Equity"],
+				],
+			};
 		});
 	},
 
-	refresh: function(frm) {
-		if(frm.doc.docstatus > 0) {
-			frm.add_custom_button(__('Ledger'), function() {
-				frappe.route_options = {
-					"voucher_no": frm.doc.name,
-					"from_date": frm.doc.posting_date,
-					"to_date": moment(frm.doc.modified).format('YYYY-MM-DD'),
-					"company": frm.doc.company,
-					"group_by": "",
-					"show_cancelled_entries": frm.doc.docstatus === 2
-				};
-				frappe.set_route("query-report", "General Ledger");
-			}, "fa fa-table");
+	refresh: function (frm) {
+		if (frm.doc.docstatus > 0) {
+			frm.add_custom_button(
+				__("Ledger"),
+				function () {
+					frappe.route_options = {
+						voucher_no: frm.doc.name,
+						from_date: frm.doc.posting_date,
+						to_date: moment(frm.doc.modified).format("YYYY-MM-DD"),
+						company: frm.doc.company,
+						group_by: "",
+						show_cancelled_entries: frm.doc.docstatus === 2,
+					};
+					frappe.set_route("query-report", "General Ledger");
+				},
+				"fa fa-table"
+			);
 		}
-	}
-
-})
+	},
+});
diff --git a/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.js b/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.js
index faceaf3..68a85f7 100644
--- a/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.js
+++ b/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.js
@@ -1,36 +1,37 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('POS Closing Entry', {
-	onload: function(frm) {
-		frm.ignore_doctypes_on_cancel_all = ['POS Invoice Merge Log'];
-		frm.set_query("pos_profile", function(doc) {
+frappe.ui.form.on("POS Closing Entry", {
+	onload: function (frm) {
+		frm.ignore_doctypes_on_cancel_all = ["POS Invoice Merge Log"];
+		frm.set_query("pos_profile", function (doc) {
 			return {
-				filters: { 'user': doc.user }
+				filters: { user: doc.user },
 			};
 		});
 
-		frm.set_query("user", function(doc) {
+		frm.set_query("user", function (doc) {
 			return {
 				query: "erpnext.accounts.doctype.pos_closing_entry.pos_closing_entry.get_cashiers",
-				filters: { 'parent': doc.pos_profile }
+				filters: { parent: doc.pos_profile },
 			};
 		});
 
-		frm.set_query("pos_opening_entry", function(doc) {
-			return { filters: { 'status': 'Open', 'docstatus': 1 } };
+		frm.set_query("pos_opening_entry", function (doc) {
+			return { filters: { status: "Open", docstatus: 1 } };
 		});
 
-		if (frm.doc.docstatus === 0 && !frm.doc.amended_from) frm.set_value("period_end_date", frappe.datetime.now_datetime());
+		if (frm.doc.docstatus === 0 && !frm.doc.amended_from)
+			frm.set_value("period_end_date", frappe.datetime.now_datetime());
 
-		frappe.realtime.on('closing_process_complete', async function(data) {
+		frappe.realtime.on("closing_process_complete", async function (data) {
 			await frm.reload_doc();
-			if (frm.doc.status == 'Failed' && frm.doc.error_message) {
+			if (frm.doc.status == "Failed" && frm.doc.error_message) {
 				frappe.msgprint({
-					title: __('POS Closing Failed'),
+					title: __("POS Closing Failed"),
 					message: frm.doc.error_message,
-					indicator: 'orange',
-					clear: true
+					indicator: "orange",
+					clear: true,
 				});
 			}
 		});
@@ -47,23 +48,23 @@
 		}
 	},
 
-	refresh: function(frm) {
-		if (frm.doc.docstatus == 1 && frm.doc.status == 'Failed') {
+	refresh: function (frm) {
+		if (frm.doc.docstatus == 1 && frm.doc.status == "Failed") {
 			const issue = '<a id="jump_to_error" style="text-decoration: underline;">issue</a>';
 			frm.dashboard.set_headline(
-				__('POS Closing failed while running in a background process. You can resolve the {0} and retry the process again.', [issue]));
+				__(
+					"POS Closing failed while running in a background process. You can resolve the {0} and retry the process again.",
+					[issue]
+				)
+			);
 
-			$('#jump_to_error').on('click', (e) => {
+			$("#jump_to_error").on("click", (e) => {
 				e.preventDefault();
-				frappe.utils.scroll_to(
-					cur_frm.get_field("error_message").$wrapper,
-					true,
-					30
-				);
+				frappe.utils.scroll_to(cur_frm.get_field("error_message").$wrapper, true, 30);
 			});
 
-			frm.add_custom_button(__('Retry'), function () {
-				frm.call('retry', {}, () => {
+			frm.add_custom_button(__("Retry"), function () {
+				frm.call("retry", {}, () => {
 					frm.reload_doc();
 				});
 			});
@@ -71,48 +72,54 @@
 	},
 
 	pos_opening_entry(frm) {
-		if (frm.doc.pos_opening_entry && frm.doc.period_start_date && frm.doc.period_end_date && frm.doc.user) {
+		if (
+			frm.doc.pos_opening_entry &&
+			frm.doc.period_start_date &&
+			frm.doc.period_end_date &&
+			frm.doc.user
+		) {
 			reset_values(frm);
 			frappe.run_serially([
 				() => frm.trigger("set_opening_amounts"),
-				() => frm.trigger("get_pos_invoices")
+				() => frm.trigger("get_pos_invoices"),
 			]);
 		}
 	},
 
 	set_opening_amounts(frm) {
-		return frappe.db.get_doc("POS Opening Entry", frm.doc.pos_opening_entry)
+		return frappe.db
+			.get_doc("POS Opening Entry", frm.doc.pos_opening_entry)
 			.then(({ balance_details }) => {
-				balance_details.forEach(detail => {
+				balance_details.forEach((detail) => {
 					frm.add_child("payment_reconciliation", {
 						mode_of_payment: detail.mode_of_payment,
 						opening_amount: detail.opening_amount,
-						expected_amount: detail.opening_amount
+						expected_amount: detail.opening_amount,
 					});
-				})
+				});
 			});
 	},
 
 	get_pos_invoices(frm) {
 		return frappe.call({
-			method: 'erpnext.accounts.doctype.pos_closing_entry.pos_closing_entry.get_pos_invoices',
+			method: "erpnext.accounts.doctype.pos_closing_entry.pos_closing_entry.get_pos_invoices",
 			args: {
 				start: frappe.datetime.get_datetime_as_string(frm.doc.period_start_date),
 				end: frappe.datetime.get_datetime_as_string(frm.doc.period_end_date),
 				pos_profile: frm.doc.pos_profile,
-				user: frm.doc.user
+				user: frm.doc.user,
 			},
 			callback: (r) => {
 				let pos_docs = r.message;
 				set_form_data(pos_docs, frm);
 				refresh_fields(frm);
 				set_html_data(frm);
-			}
+			},
 		});
 	},
 
-	before_save: async function(frm) {
-		frappe.dom.freeze(__('Processing Sales! Please Wait...'));
+	before_save: async function (frm) {
+		frappe.dom.freeze(__("Processing Sales! Please Wait..."));
 
 		frm.set_value("grand_total", 0);
 		frm.set_value("net_total", 0);
@@ -125,12 +132,12 @@
 
 		await Promise.all([
 			frappe.call({
-				method: 'erpnext.accounts.doctype.pos_closing_entry.pos_closing_entry.get_pos_invoices',
+				method: "erpnext.accounts.doctype.pos_closing_entry.pos_closing_entry.get_pos_invoices",
 				args: {
 					start: frappe.datetime.get_datetime_as_string(frm.doc.period_start_date),
 					end: frappe.datetime.get_datetime_as_string(frm.doc.period_end_date),
 					pos_profile: frm.doc.pos_profile,
-					user: frm.doc.user
+					user: frm.doc.user,
 				},
 				callback: (r) => {
 					let pos_invoices = r.message;
@@ -143,22 +150,22 @@
 						refresh_fields(frm);
 						set_html_data(frm);
 					}
-				}
-			})
-		])
+				},
+			}),
+		]);
 		frappe.dom.unfreeze();
-	}
+	},
 });
 
-frappe.ui.form.on('POS Closing Entry Detail', {
+frappe.ui.form.on("POS Closing Entry Detail", {
 	closing_amount: (frm, cdt, cdn) => {
 		const row = locals[cdt][cdn];
 		frappe.model.set_value(cdt, cdn, "difference", flt(row.closing_amount - row.expected_amount));
-	}
-})
+	},
+});
 
 function set_form_data(data, frm) {
-	data.forEach(d => {
+	data.forEach((d) => {
 		add_to_pos_transaction(d, frm);
 		frm.doc.grand_total += flt(d.grand_total);
 		frm.doc.net_total += flt(d.net_total);
@@ -173,13 +180,15 @@
 		pos_invoice: d.name,
 		posting_date: d.posting_date,
 		grand_total: d.grand_total,
-		customer: d.customer
-	})
+		customer: d.customer,
+	});
 }
 
 function refresh_payments(d, frm) {
-	d.payments.forEach(p => {
-		const payment = frm.doc.payment_reconciliation.find(pay => pay.mode_of_payment === p.mode_of_payment);
+	d.payments.forEach((p) => {
+		const payment = frm.doc.payment_reconciliation.find(
+			(pay) => pay.mode_of_payment === p.mode_of_payment
+		);
 		if (p.account == d.account_for_change_amount) {
 			p.amount -= flt(d.change_amount);
 		}
@@ -192,25 +201,25 @@
 				mode_of_payment: p.mode_of_payment,
 				opening_amount: 0,
 				expected_amount: p.amount,
-				closing_amount: 0
-			})
+				closing_amount: 0,
+			});
 		}
-	})
+	});
 }
 
 function refresh_taxes(d, frm) {
-	d.taxes.forEach(t => {
-		const tax = frm.doc.taxes.find(tx => tx.account_head === t.account_head && tx.rate === t.rate);
+	d.taxes.forEach((t) => {
+		const tax = frm.doc.taxes.find((tx) => tx.account_head === t.account_head && tx.rate === t.rate);
 		if (tax) {
 			tax.amount += flt(t.tax_amount);
 		} else {
 			frm.add_child("taxes", {
 				account_head: t.account_head,
 				rate: t.rate,
-				amount: t.tax_amount
-			})
+				amount: t.tax_amount,
+			});
 		}
-	})
+	});
 }
 
 function reset_values(frm) {
@@ -232,13 +241,13 @@
 }
 
 function set_html_data(frm) {
-	if (frm.doc.docstatus === 1 && frm.doc.status == 'Submitted') {
+	if (frm.doc.docstatus === 1 && frm.doc.status == "Submitted") {
 		frappe.call({
 			method: "get_payment_reconciliation_details",
 			doc: frm.doc,
 			callback: (r) => {
 				frm.get_field("payment_reconciliation_details").$wrapper.html(r.message);
-			}
+			},
 		});
 	}
 }
diff --git a/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry_list.js b/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry_list.js
index cffeb4d..29f00fb 100644
--- a/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry_list.js
+++ b/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry_list.js
@@ -2,16 +2,15 @@
 // License: GNU General Public License v3. See license.txt
 
 // render
-frappe.listview_settings['POS Closing Entry'] = {
-	get_indicator: function(doc) {
+frappe.listview_settings["POS Closing Entry"] = {
+	get_indicator: function (doc) {
 		var status_color = {
-			"Draft": "red",
-			"Submitted": "blue",
-			"Queued": "orange",
-			"Failed": "red",
-			"Cancelled": "red"
-
+			Draft: "red",
+			Submitted: "blue",
+			Queued: "orange",
+			Failed: "red",
+			Cancelled: "red",
 		};
-		return [__(doc.status), status_color[doc.status], "status,=,"+doc.status];
-	}
+		return [__(doc.status), status_color[doc.status], "status,=," + doc.status];
+	},
 };
diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.js b/erpnext/accounts/doctype/pos_invoice/pos_invoice.js
index ae132eb..a6e8bfa 100644
--- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.js
+++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.js
@@ -21,19 +21,23 @@
 
 	onload(doc) {
 		super.onload();
-		this.frm.ignore_doctypes_on_cancel_all = ['POS Invoice Merge Log', 'POS Closing Entry', 'Serial and Batch Bundle'];
+		this.frm.ignore_doctypes_on_cancel_all = [
+			"POS Invoice Merge Log",
+			"POS Closing Entry",
+			"Serial and Batch Bundle",
+		];
 
-		if(doc.__islocal && doc.is_pos && frappe.get_route_str() !== 'point-of-sale') {
+		if (doc.__islocal && doc.is_pos && frappe.get_route_str() !== "point-of-sale") {
 			this.frm.script_manager.trigger("is_pos");
 			this.frm.refresh_fields();
 		}
 
-		this.frm.set_query("set_warehouse", function(doc) {
+		this.frm.set_query("set_warehouse", function (doc) {
 			return {
 				filters: {
-					company: doc.company ? doc.company : '',
-				}
-			}
+					company: doc.company ? doc.company : "",
+				},
+			};
 		});
 
 		erpnext.accounts.dimensions.setup_dimension_filters(this.frm, this.frm.doctype);
@@ -47,26 +51,29 @@
 		super.refresh();
 
 		if (doc.docstatus == 1 && !doc.is_return) {
-			this.frm.add_custom_button(__('Return'), this.make_sales_return, __('Create'));
-			this.frm.page.set_inner_btn_group_as_primary(__('Create'));
+			this.frm.add_custom_button(__("Return"), this.make_sales_return, __("Create"));
+			this.frm.page.set_inner_btn_group_as_primary(__("Create"));
 		}
 
 		if (doc.is_return && doc.__islocal) {
 			this.frm.return_print_format = "Sales Invoice Return";
-			this.frm.set_value('consolidated_invoice', '');
+			this.frm.set_value("consolidated_invoice", "");
 		}
 
-		this.frm.set_query("customer", (function () {
-			const customer_groups = this.settings?.customer_groups;
+		this.frm.set_query(
+			"customer",
+			function () {
+				const customer_groups = this.settings?.customer_groups;
 
-			if (!customer_groups?.length) return {};
+				if (!customer_groups?.length) return {};
 
-			return {
-				filters: {
-					customer_group: ["in", customer_groups],
-				}
-			}
-		}).bind(this));
+				return {
+					filters: {
+						customer_group: ["in", customer_groups],
+					},
+				};
+			}.bind(this)
+		);
 	}
 
 	is_pos() {
@@ -74,19 +81,19 @@
 	}
 
 	async set_pos_data() {
-		if(this.frm.doc.is_pos) {
+		if (this.frm.doc.is_pos) {
 			this.frm.set_value("allocate_advances_automatically", 0);
-			if(!this.frm.doc.company) {
+			if (!this.frm.doc.company) {
 				this.frm.set_value("is_pos", 0);
 				frappe.msgprint(__("Please specify Company to proceed"));
 			} else {
 				const r = await this.frm.call({
 					doc: this.frm.doc,
 					method: "set_missing_values",
-					freeze: true
+					freeze: true,
 				});
-				if(!r.exc) {
-					if(r.message) {
+				if (!r.exc) {
+					if (r.message) {
 						this.frm.pos_print_format = r.message.print_format || "";
 						this.frm.meta.default_print_format = r.message.print_format || "";
 						this.frm.doc.campaign = r.message.campaign;
@@ -103,32 +110,36 @@
 	}
 
 	customer() {
-		if (!this.frm.doc.customer) return
+		if (!this.frm.doc.customer) return;
 		const pos_profile = this.frm.doc.pos_profile;
-		if(this.frm.updating_party_details) return;
-		erpnext.utils.get_party_details(this.frm,
-			"erpnext.accounts.party.get_party_details", {
+		if (this.frm.updating_party_details) return;
+		erpnext.utils.get_party_details(
+			this.frm,
+			"erpnext.accounts.party.get_party_details",
+			{
 				posting_date: this.frm.doc.posting_date,
 				party: this.frm.doc.customer,
 				party_type: "Customer",
 				account: this.frm.doc.debit_to,
 				price_list: this.frm.doc.selling_price_list,
 				pos_profile: pos_profile,
-				company_address: this.frm.doc.company_address
-			}, () => {
+				company_address: this.frm.doc.company_address,
+			},
+			() => {
 				this.apply_pricing_rule();
-			});
+			}
+		);
 	}
 
 	pos_profile(frm) {
-		if (!frm.pos_profile || frm.pos_profile == '') {
+		if (!frm.pos_profile || frm.pos_profile == "") {
 			this.update_customer_groups_settings([]);
 			return;
 		}
 
 		frappe.call({
 			method: "erpnext.selling.page.point_of_sale.point_of_sale.get_pos_profile_data",
-			args: { "pos_profile": frm.pos_profile },
+			args: { pos_profile: frm.pos_profile },
 			callback: ({ message: profile }) => {
 				this.update_customer_groups_settings(profile?.customer_groups);
 				this.frm.set_value("company", profile?.company);
@@ -137,17 +148,17 @@
 	}
 
 	update_customer_groups_settings(customer_groups) {
-		this.settings.customer_groups = customer_groups?.map((group) => group.name)
+		this.settings.customer_groups = customer_groups?.map((group) => group.name);
 	}
 
-	amount(){
-		this.write_off_outstanding_amount_automatically()
+	amount() {
+		this.write_off_outstanding_amount_automatically();
 	}
 
-	change_amount(){
-		if(this.frm.doc.paid_amount > this.frm.doc.grand_total){
+	change_amount() {
+		if (this.frm.doc.paid_amount > this.frm.doc.grand_total) {
 			this.calculate_write_off_amount();
-		}else {
+		} else {
 			this.frm.set_value("change_amount", 0.0);
 			this.frm.set_value("base_change_amount", 0.0);
 		}
@@ -155,7 +166,7 @@
 		this.frm.refresh_fields();
 	}
 
-	loyalty_amount(){
+	loyalty_amount() {
 		this.calculate_outstanding_amount();
 		this.frm.refresh_field("outstanding_amount");
 		this.frm.refresh_field("paid_amount");
@@ -166,8 +177,12 @@
 		if (cint(this.frm.doc.write_off_outstanding_amount_automatically)) {
 			frappe.model.round_floats_in(this.frm.doc, ["grand_total", "paid_amount"]);
 			// this will make outstanding amount 0
-			this.frm.set_value("write_off_amount",
-				flt(this.frm.doc.grand_total - this.frm.doc.paid_amount - this.frm.doc.total_advance, precision("write_off_amount"))
+			this.frm.set_value(
+				"write_off_amount",
+				flt(
+					this.frm.doc.grand_total - this.frm.doc.paid_amount - this.frm.doc.total_advance,
+					precision("write_off_amount")
+				)
 			);
 		}
 
@@ -178,65 +193,69 @@
 	make_sales_return() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.accounts.doctype.pos_invoice.pos_invoice.make_sales_return",
-			frm: cur_frm
-		})
+			frm: cur_frm,
+		});
 	}
-}
+};
 
-extend_cscript(cur_frm.cscript, new erpnext.selling.POSInvoiceController({ frm: cur_frm }))
+extend_cscript(cur_frm.cscript, new erpnext.selling.POSInvoiceController({ frm: cur_frm }));
 
-frappe.ui.form.on('POS Invoice', {
-	redeem_loyalty_points: function(frm) {
+frappe.ui.form.on("POS Invoice", {
+	redeem_loyalty_points: function (frm) {
 		frm.events.get_loyalty_details(frm);
 	},
 
-	loyalty_points: function(frm) {
+	loyalty_points: function (frm) {
 		if (frm.redemption_conversion_factor) {
 			frm.events.set_loyalty_points(frm);
 		} else {
 			frappe.call({
 				method: "erpnext.accounts.doctype.loyalty_program.loyalty_program.get_redeemption_factor",
 				args: {
-					"loyalty_program": frm.doc.loyalty_program
+					loyalty_program: frm.doc.loyalty_program,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (r) {
 						frm.redemption_conversion_factor = r.message;
 						frm.events.set_loyalty_points(frm);
 					}
-				}
+				},
 			});
 		}
 	},
 
-	get_loyalty_details: function(frm) {
+	get_loyalty_details: function (frm) {
 		if (frm.doc.customer && frm.doc.redeem_loyalty_points) {
 			frappe.call({
 				method: "erpnext.accounts.doctype.loyalty_program.loyalty_program.get_loyalty_program_details",
 				args: {
-					"customer": frm.doc.customer,
-					"loyalty_program": frm.doc.loyalty_program,
-					"expiry_date": frm.doc.posting_date,
-					"company": frm.doc.company
+					customer: frm.doc.customer,
+					loyalty_program: frm.doc.loyalty_program,
+					expiry_date: frm.doc.posting_date,
+					company: frm.doc.company,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (r) {
 						frm.set_value("loyalty_redemption_account", r.message.expense_account);
 						frm.set_value("loyalty_redemption_cost_center", r.message.cost_center);
 						frm.redemption_conversion_factor = r.message.conversion_factor;
 					}
-				}
+				},
 			});
 		}
 	},
 
-	set_loyalty_points: function(frm) {
+	set_loyalty_points: function (frm) {
 		if (frm.redemption_conversion_factor) {
-			let loyalty_amount = flt(frm.redemption_conversion_factor*flt(frm.doc.loyalty_points), precision("loyalty_amount"));
-			var remaining_amount = flt(frm.doc.grand_total) - flt(frm.doc.total_advance) - flt(frm.doc.write_off_amount);
-			if (frm.doc.grand_total && (remaining_amount < loyalty_amount)) {
-				let redeemable_points = parseInt(remaining_amount/frm.redemption_conversion_factor);
-				frappe.throw(__("You can only redeem max {0} points in this order.",[redeemable_points]));
+			let loyalty_amount = flt(
+				frm.redemption_conversion_factor * flt(frm.doc.loyalty_points),
+				precision("loyalty_amount")
+			);
+			var remaining_amount =
+				flt(frm.doc.grand_total) - flt(frm.doc.total_advance) - flt(frm.doc.write_off_amount);
+			if (frm.doc.grand_total && remaining_amount < loyalty_amount) {
+				let redeemable_points = parseInt(remaining_amount / frm.redemption_conversion_factor);
+				frappe.throw(__("You can only redeem max {0} points in this order.", [redeemable_points]));
 			}
 			frm.set_value("loyalty_amount", loyalty_amount);
 		}
@@ -244,43 +263,49 @@
 
 	request_for_payment: function (frm) {
 		if (!frm.doc.contact_mobile) {
-			frappe.throw(__('Please enter mobile number first.'));
+			frappe.throw(__("Please enter mobile number first."));
 		}
 		frm.dirty();
 		frm.save().then(() => {
-			frappe.dom.freeze(__('Waiting for payment...'));
+			frappe.dom.freeze(__("Waiting for payment..."));
 			frappe
 				.call({
-					method: 'create_payment_request',
-					doc: frm.doc
+					method: "create_payment_request",
+					doc: frm.doc,
 				})
 				.fail(() => {
 					frappe.dom.unfreeze();
-					frappe.msgprint(__('Payment request failed'));
+					frappe.msgprint(__("Payment request failed"));
 				})
 				.then(({ message }) => {
 					const payment_request_name = message.name;
 					setTimeout(() => {
-						frappe.db.get_value('Payment Request', payment_request_name, ['status', 'grand_total']).then(({ message }) => {
-							if (message.status != 'Paid') {
-								frappe.dom.unfreeze();
-								frappe.msgprint({
-									message: __('Payment Request took too long to respond. Please try requesting for payment again.'),
-									title: __('Request Timeout')
-								});
-							} else if (frappe.dom.freeze_count != 0) {
-								frappe.dom.unfreeze();
-								cur_frm.reload_doc();
-								cur_pos.payment.events.submit_invoice();
+						frappe.db
+							.get_value("Payment Request", payment_request_name, ["status", "grand_total"])
+							.then(({ message }) => {
+								if (message.status != "Paid") {
+									frappe.dom.unfreeze();
+									frappe.msgprint({
+										message: __(
+											"Payment Request took too long to respond. Please try requesting for payment again."
+										),
+										title: __("Request Timeout"),
+									});
+								} else if (frappe.dom.freeze_count != 0) {
+									frappe.dom.unfreeze();
+									cur_frm.reload_doc();
+									cur_pos.payment.events.submit_invoice();
 
-								frappe.show_alert({
-									message: __("Payment of {0} received successfully.", [format_currency(message.grand_total, frm.doc.currency, 0)]),
-									indicator: 'green'
-								});
-							}
-						});
+									frappe.show_alert({
+										message: __("Payment of {0} received successfully.", [
+											format_currency(message.grand_total, frm.doc.currency, 0),
+										]),
+										indicator: "green",
+									});
+								}
+							});
 					}, 60000);
 				});
 		});
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice_list.js b/erpnext/accounts/doctype/pos_invoice/pos_invoice_list.js
index 2dbf2a4..0379932 100644
--- a/erpnext/accounts/doctype/pos_invoice/pos_invoice_list.js
+++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice_list.js
@@ -2,40 +2,47 @@
 // License: GNU General Public License v3. See license.txt
 
 // render
-frappe.listview_settings['POS Invoice'] = {
-	add_fields: ["customer", "customer_name", "base_grand_total", "outstanding_amount", "due_date", "company",
-		"currency", "is_return"],
-	get_indicator: function(doc) {
+frappe.listview_settings["POS Invoice"] = {
+	add_fields: [
+		"customer",
+		"customer_name",
+		"base_grand_total",
+		"outstanding_amount",
+		"due_date",
+		"company",
+		"currency",
+		"is_return",
+	],
+	get_indicator: function (doc) {
 		var status_color = {
-			"Draft": "red",
-			"Unpaid": "orange",
-			"Paid": "green",
-			"Submitted": "blue",
-			"Consolidated": "green",
-			"Return": "darkgrey",
+			Draft: "red",
+			Unpaid: "orange",
+			Paid: "green",
+			Submitted: "blue",
+			Consolidated: "green",
+			Return: "darkgrey",
 			"Unpaid and Discounted": "orange",
 			"Overdue and Discounted": "red",
-			"Overdue": "red"
-
+			Overdue: "red",
 		};
-		return [__(doc.status), status_color[doc.status], "status,=,"+doc.status];
+		return [__(doc.status), status_color[doc.status], "status,=," + doc.status];
 	},
 	right_column: "grand_total",
-	onload: function(me) {
-		me.page.add_action_item('Make Merge Log', function() {
+	onload: function (me) {
+		me.page.add_action_item("Make Merge Log", function () {
 			const invoices = me.get_checked_items();
 			frappe.call({
 				method: "erpnext.accounts.doctype.pos_invoice.pos_invoice.make_merge_log",
 				freeze: true,
-				args:{
-					"invoices": invoices
+				args: {
+					invoices: invoices,
 				},
 				callback: function (r) {
 					if (r.message) {
 						var doc = frappe.model.sync(r.message)[0];
 						frappe.set_route("Form", doc.doctype, doc.name);
 					}
-				}
+				},
 			});
 		});
 	},
diff --git a/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.py b/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.py
index c24db1d..e058f82 100644
--- a/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.py
+++ b/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.py
@@ -3,10 +3,10 @@
 
 
 # import frappe
-from frappe.model.document import Document
+from erpnext.accounts.doctype.sales_invoice_item.sales_invoice_item import SalesInvoiceItem
 
 
-class POSInvoiceItem(Document):
+class POSInvoiceItem(SalesInvoiceItem):
 	# begin: auto-generated types
 	# This code is auto-generated. Do not modify anything in this block.
 
diff --git a/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.js b/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.js
index 73c6290..8423987 100644
--- a/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.js
+++ b/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.js
@@ -1,21 +1,21 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('POS Invoice Merge Log', {
-	setup: function(frm) {
-		frm.set_query("pos_invoice", "pos_invoices", doc => {
+frappe.ui.form.on("POS Invoice Merge Log", {
+	setup: function (frm) {
+		frm.set_query("pos_invoice", "pos_invoices", (doc) => {
 			return {
 				filters: {
-					'docstatus': 1,
-					'customer': doc.customer,
-					'consolidated_invoice': ''
-				}
-			}
+					docstatus: 1,
+					customer: doc.customer,
+					consolidated_invoice: "",
+				},
+			};
 		});
 	},
 
-	merge_invoices_based_on: function(frm) {
-		frm.set_value('customer', '');
-		frm.set_value('customer_group', '');
-	}
+	merge_invoices_based_on: function (frm) {
+		frm.set_value("customer", "");
+		frm.set_value("customer_group", "");
+	},
 });
diff --git a/erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry.js b/erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry.js
index d23f348..6a316d5 100644
--- a/erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry.js
+++ b/erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry.js
@@ -1,56 +1,55 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('POS Opening Entry', {
+frappe.ui.form.on("POS Opening Entry", {
 	setup(frm) {
 		if (frm.doc.docstatus == 0) {
-			frm.trigger('set_posting_date_read_only');
-			frm.set_value('period_start_date', frappe.datetime.now_datetime());
-			frm.set_value('user', frappe.session.user);
+			frm.trigger("set_posting_date_read_only");
+			frm.set_value("period_start_date", frappe.datetime.now_datetime());
+			frm.set_value("user", frappe.session.user);
 		}
 
-		frm.set_query("user", function(doc) {
+		frm.set_query("user", function (doc) {
 			return {
 				query: "erpnext.accounts.doctype.pos_closing_entry.pos_closing_entry.get_cashiers",
-				filters: { 'parent': doc.pos_profile }
+				filters: { parent: doc.pos_profile },
 			};
 		});
 	},
 
 	refresh(frm) {
 		// set default posting date / time
-		if(frm.doc.docstatus == 0) {
-			if(!frm.doc.posting_date) {
-				frm.set_value('posting_date', frappe.datetime.nowdate());
+		if (frm.doc.docstatus == 0) {
+			if (!frm.doc.posting_date) {
+				frm.set_value("posting_date", frappe.datetime.nowdate());
 			}
-			frm.trigger('set_posting_date_read_only');
+			frm.trigger("set_posting_date_read_only");
 		}
 	},
 
 	set_posting_date_read_only(frm) {
-		if(frm.doc.docstatus == 0 && frm.doc.set_posting_date) {
-			frm.set_df_property('posting_date', 'read_only', 0);
+		if (frm.doc.docstatus == 0 && frm.doc.set_posting_date) {
+			frm.set_df_property("posting_date", "read_only", 0);
 		} else {
-			frm.set_df_property('posting_date', 'read_only', 1);
+			frm.set_df_property("posting_date", "read_only", 1);
 		}
 	},
 
 	set_posting_date(frm) {
-		frm.trigger('set_posting_date_read_only');
+		frm.trigger("set_posting_date_read_only");
 	},
 
 	pos_profile: (frm) => {
 		if (frm.doc.pos_profile) {
-			frappe.db.get_doc("POS Profile", frm.doc.pos_profile)
-				.then(({ payments }) => {
-					if (payments.length) {
-						frm.doc.balance_details = [];
-						payments.forEach(({ mode_of_payment }) => {
-							frm.add_child("balance_details", { mode_of_payment });
-						})
-						frm.refresh_field("balance_details");
-					}
-				});
+			frappe.db.get_doc("POS Profile", frm.doc.pos_profile).then(({ payments }) => {
+				if (payments.length) {
+					frm.doc.balance_details = [];
+					payments.forEach(({ mode_of_payment }) => {
+						frm.add_child("balance_details", { mode_of_payment });
+					});
+					frm.refresh_field("balance_details");
+				}
+			});
 		}
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry_list.js b/erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry_list.js
index 1ad3c91..7ff9c4b 100644
--- a/erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry_list.js
+++ b/erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry_list.js
@@ -2,15 +2,14 @@
 // License: GNU General Public License v3. See license.txt
 
 // render
-frappe.listview_settings['POS Opening Entry'] = {
-	get_indicator: function(doc) {
+frappe.listview_settings["POS Opening Entry"] = {
+	get_indicator: function (doc) {
 		var status_color = {
-			"Draft": "red",
-			"Open": "orange",
-			"Closed": "green",
-			"Cancelled": "red"
-
+			Draft: "red",
+			Open: "orange",
+			Closed: "green",
+			Cancelled: "red",
 		};
-		return [__(doc.status), status_color[doc.status], "status,=,"+doc.status];
-	}
+		return [__(doc.status), status_color[doc.status], "status,=," + doc.status];
+	},
 };
diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.js b/erpnext/accounts/doctype/pos_profile/pos_profile.js
index ceaafaa..31f0f07 100755
--- a/erpnext/accounts/doctype/pos_profile/pos_profile.js
+++ b/erpnext/accounts/doctype/pos_profile/pos_profile.js
@@ -1,149 +1,143 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
-frappe.ui.form.on('POS Profile', {
-	setup: function(frm) {
-		frm.set_query("selling_price_list", function() {
+frappe.ui.form.on("POS Profile", {
+	setup: function (frm) {
+		frm.set_query("selling_price_list", function () {
 			return { filters: { selling: 1 } };
 		});
 
-		frm.set_query("tc_name", function() {
+		frm.set_query("tc_name", function () {
 			return { filters: { selling: 1 } };
 		});
 
-		erpnext.queries.setup_queries(frm, "Warehouse", function() {
+		erpnext.queries.setup_queries(frm, "Warehouse", function () {
 			return erpnext.queries.warehouse(frm.doc);
 		});
 
-		frm.set_query("print_format", function() {
+		frm.set_query("print_format", function () {
 			return {
-				filters: [
-					['Print Format', 'doc_type', '=', 'POS Invoice']
-				]
+				filters: [["Print Format", "doc_type", "=", "POS Invoice"]],
 			};
 		});
 
-		frm.set_query("account_for_change_amount", function(doc) {
+		frm.set_query("account_for_change_amount", function (doc) {
 			if (!doc.company) {
-				frappe.throw(__('Please set Company'));
+				frappe.throw(__("Please set Company"));
 			}
 
 			return {
 				filters: {
-					account_type: ['in', ["Cash", "Bank"]],
+					account_type: ["in", ["Cash", "Bank"]],
 					is_group: 0,
-					company: doc.company
-				}
+					company: doc.company,
+				},
 			};
 		});
 
-		frm.set_query("taxes_and_charges", function() {
+		frm.set_query("taxes_and_charges", function () {
 			return {
 				filters: [
-					['Sales Taxes and Charges Template', 'company', '=', frm.doc.company],
-					['Sales Taxes and Charges Template', 'docstatus', '!=', 2]
-				]
+					["Sales Taxes and Charges Template", "company", "=", frm.doc.company],
+					["Sales Taxes and Charges Template", "docstatus", "!=", 2],
+				],
 			};
 		});
 
-		frm.set_query('company_address', function(doc) {
+		frm.set_query("company_address", function (doc) {
 			if (!doc.company) {
-				frappe.throw(__('Please set Company'));
+				frappe.throw(__("Please set Company"));
 			}
 
 			return {
-				query: 'frappe.contacts.doctype.address.address.address_query',
+				query: "frappe.contacts.doctype.address.address.address_query",
 				filters: {
-					link_doctype: 'Company',
-					link_name: doc.company
-				}
+					link_doctype: "Company",
+					link_name: doc.company,
+				},
 			};
 		});
 
-		frm.set_query('income_account', function(doc) {
+		frm.set_query("income_account", function (doc) {
 			if (!doc.company) {
-				frappe.throw(__('Please set Company'));
+				frappe.throw(__("Please set Company"));
 			}
 
 			return {
 				filters: {
-					'is_group': 0,
-					'company': doc.company,
-					'account_type': "Income Account"
-				}
+					is_group: 0,
+					company: doc.company,
+					account_type: "Income Account",
+				},
 			};
 		});
 
-		frm.set_query('cost_center', function(doc) {
+		frm.set_query("cost_center", function (doc) {
 			if (!doc.company) {
-				frappe.throw(__('Please set Company'));
+				frappe.throw(__("Please set Company"));
 			}
 
 			return {
 				filters: {
-					'company': doc.company,
-					'is_group': 0
-				}
+					company: doc.company,
+					is_group: 0,
+				},
 			};
 		});
 
-		frm.set_query('expense_account', function(doc) {
+		frm.set_query("expense_account", function (doc) {
 			if (!doc.company) {
-				frappe.throw(__('Please set Company'));
+				frappe.throw(__("Please set Company"));
 			}
 
 			return {
 				filters: {
-					"report_type": "Profit and Loss",
-					"company": doc.company,
-					"is_group": 0
-				}
+					report_type: "Profit and Loss",
+					company: doc.company,
+					is_group: 0,
+				},
 			};
 		});
 
-		frm.set_query("select_print_heading", function() {
+		frm.set_query("select_print_heading", function () {
 			return {
-				filters: [
-					['Print Heading', 'docstatus', '!=', 2]
-				]
+				filters: [["Print Heading", "docstatus", "!=", 2]],
 			};
 		});
 
-		frm.set_query("write_off_account", function(doc) {
+		frm.set_query("write_off_account", function (doc) {
 			return {
 				filters: {
-					'report_type': 'Profit and Loss',
-					'is_group': 0,
-					'company': doc.company
-				}
+					report_type: "Profit and Loss",
+					is_group: 0,
+					company: doc.company,
+				},
 			};
 		});
 
-		frm.set_query("write_off_cost_center", function(doc) {
+		frm.set_query("write_off_cost_center", function (doc) {
 			return {
 				filters: {
-					'is_group': 0,
-					'company': doc.company
-				}
+					is_group: 0,
+					company: doc.company,
+				},
 			};
 		});
 
 		erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		if (frm.doc.company) {
 			frm.trigger("toggle_display_account_head");
 		}
 	},
 
-	company: function(frm) {
+	company: function (frm) {
 		frm.trigger("toggle_display_account_head");
 		erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
-
 	},
 
-	toggle_display_account_head: function(frm) {
-		frm.toggle_display('expense_account',
-			erpnext.is_perpetual_inventory_enabled(frm.doc.company));
-	}
-});
\ No newline at end of file
+	toggle_display_account_head: function (frm) {
+		frm.toggle_display("expense_account", erpnext.is_perpetual_inventory_enabled(frm.doc.company));
+	},
+});
diff --git a/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.js b/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.js
index f0884eb..6341674 100644
--- a/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.js
+++ b/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.js
@@ -1,6 +1,4 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('POS Profile User', {
-
-});
+frappe.ui.form.on("POS Profile User", {});
diff --git a/erpnext/accounts/doctype/pos_settings/pos_settings.js b/erpnext/accounts/doctype/pos_settings/pos_settings.js
index 7d8f356..a2e5a57 100644
--- a/erpnext/accounts/doctype/pos_settings/pos_settings.js
+++ b/erpnext/accounts/doctype/pos_settings/pos_settings.js
@@ -1,57 +1,91 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-let search_fields_datatypes = ['Data', 'Link', 'Dynamic Link', 'Long Text', 'Select', 'Small Text', 'Text', 'Text Editor'];
-let do_not_include_fields = ["naming_series", "item_code", "item_name", "stock_uom", "asset_naming_series",
-	"default_material_request_type", "valuation_method", "warranty_period", "weight_uom", "batch_number_series",
-	"serial_no_series", "purchase_uom", "customs_tariff_number", "sales_uom", "deferred_revenue_account",
-	"deferred_expense_account", "quality_inspection_template", "route", "slideshow", "website_image_alt", "thumbnail",
-	"web_long_description"]
+let search_fields_datatypes = [
+	"Data",
+	"Link",
+	"Dynamic Link",
+	"Long Text",
+	"Select",
+	"Small Text",
+	"Text",
+	"Text Editor",
+];
+let do_not_include_fields = [
+	"naming_series",
+	"item_code",
+	"item_name",
+	"stock_uom",
+	"asset_naming_series",
+	"default_material_request_type",
+	"valuation_method",
+	"warranty_period",
+	"weight_uom",
+	"batch_number_series",
+	"serial_no_series",
+	"purchase_uom",
+	"customs_tariff_number",
+	"sales_uom",
+	"deferred_revenue_account",
+	"deferred_expense_account",
+	"quality_inspection_template",
+	"route",
+	"slideshow",
+	"website_image_alt",
+	"thumbnail",
+	"web_long_description",
+];
 
-frappe.ui.form.on('POS Settings', {
-	onload: function(frm) {
+frappe.ui.form.on("POS Settings", {
+	onload: function (frm) {
 		frm.trigger("get_invoice_fields");
 		frm.trigger("add_search_options");
 	},
 
-	get_invoice_fields: function(frm) {
+	get_invoice_fields: function (frm) {
 		frappe.model.with_doctype("POS Invoice", () => {
-			var fields = $.map(frappe.get_doc("DocType", "POS Invoice").fields, function(d) {
-				if (frappe.model.no_value_type.indexOf(d.fieldtype) === -1 || ['Button'].includes(d.fieldtype)) {
-					return { label: d.label + ' (' + d.fieldtype + ')', value: d.fieldname };
+			var fields = $.map(frappe.get_doc("DocType", "POS Invoice").fields, function (d) {
+				if (
+					frappe.model.no_value_type.indexOf(d.fieldtype) === -1 ||
+					["Button"].includes(d.fieldtype)
+				) {
+					return { label: d.label + " (" + d.fieldtype + ")", value: d.fieldname };
 				} else {
 					return null;
 				}
 			});
 
 			frm.fields_dict.invoice_fields.grid.update_docfield_property(
-				'fieldname', 'options', [""].concat(fields)
+				"fieldname",
+				"options",
+				[""].concat(fields)
 			);
 		});
-
 	},
 
-	add_search_options: function(frm) {
+	add_search_options: function (frm) {
 		frappe.model.with_doctype("Item", () => {
-			var fields = $.map(frappe.get_doc("DocType", "Item").fields, function(d) {
-				if (search_fields_datatypes.includes(d.fieldtype) && !(do_not_include_fields.includes(d.fieldname))) {
+			var fields = $.map(frappe.get_doc("DocType", "Item").fields, function (d) {
+				if (
+					search_fields_datatypes.includes(d.fieldtype) &&
+					!do_not_include_fields.includes(d.fieldname)
+				) {
 					return [d.label];
 				} else {
 					return null;
 				}
 			});
 
-			fields.unshift('');
-			frm.fields_dict.pos_search_fields.grid.update_docfield_property('field', 'options', fields);
+			fields.unshift("");
+			frm.fields_dict.pos_search_fields.grid.update_docfield_property("field", "options", fields);
 		});
-
-	}
+	},
 });
 
 frappe.ui.form.on("POS Search Fields", {
-	field: function(frm, doctype, name) {
+	field: function (frm, doctype, name) {
 		var doc = frappe.get_doc(doctype, name);
-		var df = $.map(frappe.get_doc("DocType", "Item").fields, function(d) {
+		var df = $.map(frappe.get_doc("DocType", "Item").fields, function (d) {
 			if (doc.field == d.label && search_fields_datatypes.includes(d.fieldtype)) {
 				return d;
 			} else {
@@ -61,13 +95,13 @@
 
 		doc.fieldname = df.fieldname;
 		frm.refresh_field("fields");
-	}
+	},
 });
 
 frappe.ui.form.on("POS Field", {
-	fieldname: function(frm, doctype, name) {
+	fieldname: function (frm, doctype, name) {
 		var doc = frappe.get_doc(doctype, name);
-		var df = $.map(frappe.get_doc("DocType", "POS Invoice").fields, function(d) {
+		var df = $.map(frappe.get_doc("DocType", "POS Invoice").fields, function (d) {
 			return doc.fieldname == d.fieldname ? d : null;
 		})[0];
 
@@ -77,5 +111,5 @@
 		doc.fieldtype = df.fieldtype;
 		doc.default_value = df.default;
 		frm.refresh_field("fields");
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.js b/erpnext/accounts/doctype/pricing_rule/pricing_rule.js
index 8267582..cd5b00e 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.js
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.js
@@ -1,44 +1,43 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.ui.form.on('Pricing Rule', {
-	setup: function(frm) {
-		frm.fields_dict["for_price_list"].get_query = function(doc){
+frappe.ui.form.on("Pricing Rule", {
+	setup: function (frm) {
+		frm.fields_dict["for_price_list"].get_query = function (doc) {
 			return {
 				filters: {
-					'selling': doc.selling,
-					'buying': doc.buying,
-					'currency': doc.currency
-				}
+					selling: doc.selling,
+					buying: doc.buying,
+					currency: doc.currency,
+				},
 			};
 		};
 
-		['items', 'item_groups', 'brands'].forEach(d => {
-			frm.fields_dict[d].grid.get_field('uom').get_query = function(doc, cdt, cdn){
+		["items", "item_groups", "brands"].forEach((d) => {
+			frm.fields_dict[d].grid.get_field("uom").get_query = function (doc, cdt, cdn) {
 				var row = locals[cdt][cdn];
 				return {
-					query:"erpnext.accounts.doctype.pricing_rule.pricing_rule.get_item_uoms",
-					filters: {'value': row[frappe.scrub(doc.apply_on)], apply_on: doc.apply_on}
-				}
+					query: "erpnext.accounts.doctype.pricing_rule.pricing_rule.get_item_uoms",
+					filters: { value: row[frappe.scrub(doc.apply_on)], apply_on: doc.apply_on },
+				};
 			};
-		})
+		});
 	},
 
-	onload: function(frm) {
-		if(frm.doc.__islocal && !frm.doc.applicable_for && (frm.doc.customer || frm.doc.supplier)) {
-			if(frm.doc.customer) {
+	onload: function (frm) {
+		if (frm.doc.__islocal && !frm.doc.applicable_for && (frm.doc.customer || frm.doc.supplier)) {
+			if (frm.doc.customer) {
 				frm.doc.applicable_for = "Customer";
-				frm.doc.selling = 1
+				frm.doc.selling = 1;
 			} else {
 				frm.doc.applicable_for = "Supplier";
-				frm.doc.buying = 1
+				frm.doc.buying = 1;
 			}
 		}
 	},
 
-	refresh: function(frm) {
-		var help_content =
-			`<table class="table table-bordered" style="background-color: var(--scrollbar-track-color);">
+	refresh: function (frm) {
+		var help_content = `<table class="table table-bordered" style="background-color: var(--scrollbar-track-color);">
 				<tr><td>
 					<h4>
 						<i class="fa fa-hand-right"></i>
@@ -97,61 +96,70 @@
 				</td></tr>
 			</table>`;
 
-		frm.set_df_property('pricing_rule_help', 'options', help_content);
+		frm.set_df_property("pricing_rule_help", "options", help_content);
 		frm.events.set_options_for_applicable_for(frm);
 		frm.trigger("toggle_reqd_apply_on");
 	},
 
-	apply_on: function(frm) {
+	apply_on: function (frm) {
 		frm.trigger("toggle_reqd_apply_on");
 	},
 
-	toggle_reqd_apply_on: function(frm) {
+	toggle_reqd_apply_on: function (frm) {
 		const fields = {
-			'Item Code': 'items',
-			'Item Group': 'item_groups',
-			'Brand': 'brands'
-		}
+			"Item Code": "items",
+			"Item Group": "item_groups",
+			Brand: "brands",
+		};
 
 		for (var key in fields) {
-			frm.toggle_reqd(fields[key],
-				frm.doc.apply_on === key ? 1 : 0);
+			frm.toggle_reqd(fields[key], frm.doc.apply_on === key ? 1 : 0);
 		}
 	},
 
-	rate_or_discount: function(frm) {
-		if(frm.doc.rate_or_discount == 'Rate') {
-			frm.set_value('for_price_list', "");
+	rate_or_discount: function (frm) {
+		if (frm.doc.rate_or_discount == "Rate") {
+			frm.set_value("for_price_list", "");
 		}
 	},
 
-	selling: function(frm) {
+	selling: function (frm) {
 		frm.events.set_options_for_applicable_for(frm);
 	},
 
-	buying: function(frm) {
+	buying: function (frm) {
 		frm.events.set_options_for_applicable_for(frm);
 	},
 
 	//Dynamically change the description based on type of margin
-	margin_type: function(frm){
-		frm.set_df_property('margin_rate_or_amount', 'description', frm.doc.margin_type=='Percentage'?'In Percentage %':'In Amount');
+	margin_type: function (frm) {
+		frm.set_df_property(
+			"margin_rate_or_amount",
+			"description",
+			frm.doc.margin_type == "Percentage" ? "In Percentage %" : "In Amount"
+		);
 	},
 
-	set_options_for_applicable_for: function(frm) {
+	set_options_for_applicable_for: function (frm) {
 		var options = [""];
 		var applicable_for = frm.doc.applicable_for;
 
-		if(frm.doc.selling) {
-			options = $.merge(options, ["Customer", "Customer Group", "Territory", "Sales Partner", "Campaign"]);
+		if (frm.doc.selling) {
+			options = $.merge(options, [
+				"Customer",
+				"Customer Group",
+				"Territory",
+				"Sales Partner",
+				"Campaign",
+			]);
 		}
-		if(frm.doc.buying) {
+		if (frm.doc.buying) {
 			$.merge(options, ["Supplier", "Supplier Group"]);
 		}
 
 		set_field_options("applicable_for", options.join("\n"));
 
-		if(!in_list(options, applicable_for)) applicable_for = null;
+		if (!in_list(options, applicable_for)) applicable_for = null;
 		frm.set_value("applicable_for", applicable_for);
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/process_deferred_accounting/process_deferred_accounting.js b/erpnext/accounts/doctype/process_deferred_accounting/process_deferred_accounting.js
index 1ec6805..92a6c62 100644
--- a/erpnext/accounts/doctype/process_deferred_accounting/process_deferred_accounting.js
+++ b/erpnext/accounts/doctype/process_deferred_accounting/process_deferred_accounting.js
@@ -1,53 +1,58 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Process Deferred Accounting', {
-	setup: function(frm) {
-		frm.set_query("document_type", function() {
+frappe.ui.form.on("Process Deferred Accounting", {
+	setup: function (frm) {
+		frm.set_query("document_type", function () {
 			return {
 				filters: {
-					'name': ['in', ['Sales Invoice', 'Purchase Invoice']]
-				}
+					name: ["in", ["Sales Invoice", "Purchase Invoice"]],
+				},
 			};
 		});
 	},
 
-	type: function(frm) {
+	type: function (frm) {
 		if (frm.doc.company && frm.doc.type) {
-			frm.set_query("account", function() {
+			frm.set_query("account", function () {
 				return {
 					filters: {
-						'company': frm.doc.company,
-						'root_type': frm.doc.type === 'Income' ? 'Liability' : 'Asset',
-						'is_group': 0
-					}
+						company: frm.doc.company,
+						root_type: frm.doc.type === "Income" ? "Liability" : "Asset",
+						is_group: 0,
+					},
 				};
 			});
 		}
 	},
 
-	validate: function() {
+	validate: function () {
 		return new Promise((resolve) => {
-			return frappe.db.get_single_value('Accounts Settings', 'automatically_process_deferred_accounting_entry')
-				.then(value => {
-					if(value) {
-						frappe.throw(__('Manual entry cannot be created! Disable automatic entry for deferred accounting in accounts settings and try again'));
+			return frappe.db
+				.get_single_value("Accounts Settings", "automatically_process_deferred_accounting_entry")
+				.then((value) => {
+					if (value) {
+						frappe.throw(
+							__(
+								"Manual entry cannot be created! Disable automatic entry for deferred accounting in accounts settings and try again"
+							)
+						);
 					}
 					resolve(value);
 				});
 		});
 	},
 
-	end_date: function(frm) {
+	end_date: function (frm) {
 		if (frm.doc.end_date && frm.doc.end_date < frm.doc.start_date) {
 			frappe.throw(__("End date cannot be before start date"));
 		}
 	},
 
-	onload: function(frm) {
+	onload: function (frm) {
 		if (frm.doc.posting_date && frm.doc.docstatus === 0) {
-			frm.set_value('start_date', frappe.datetime.add_months(frm.doc.posting_date, -1));
-			frm.set_value('end_date', frm.doc.posting_date);
+			frm.set_value("start_date", frappe.datetime.add_months(frm.doc.posting_date, -1));
+			frm.set_value("end_date", frm.doc.posting_date);
 		}
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/process_payment_reconciliation/process_payment_reconciliation.js b/erpnext/accounts/doctype/process_payment_reconciliation/process_payment_reconciliation.js
index dd601bf..0f52a4d 100644
--- a/erpnext/accounts/doctype/process_payment_reconciliation/process_payment_reconciliation.js
+++ b/erpnext/accounts/doctype/process_payment_reconciliation/process_payment_reconciliation.js
@@ -2,129 +2,128 @@
 // For license information, please see license.txt
 
 frappe.ui.form.on("Process Payment Reconciliation", {
-	onload: function(frm) {
+	onload: function (frm) {
 		// set queries
-		frm.set_query("party_type", function() {
-			return {
-				"filters": {
-					"name": ["in", Object.keys(frappe.boot.party_account_types)],
-				}
-			}
-		});
-		frm.set_query('receivable_payable_account',  function(doc) {
+		frm.set_query("party_type", function () {
 			return {
 				filters: {
-					"company": doc.company,
-					"is_group": 0,
-					"account_type": frappe.boot.party_account_types[doc.party_type]
-				}
+					name: ["in", Object.keys(frappe.boot.party_account_types)],
+				},
 			};
 		});
-		frm.set_query('cost_center', function(doc) {
+		frm.set_query("receivable_payable_account", function (doc) {
 			return {
 				filters: {
-					"company": doc.company,
-					"is_group": 0,
-				}
+					company: doc.company,
+					is_group: 0,
+					account_type: frappe.boot.party_account_types[doc.party_type],
+				},
 			};
 		});
-		frm.set_query('bank_cash_account', function(doc) {
+		frm.set_query("cost_center", function (doc) {
 			return {
-				filters:[
-					['Account', 'company', '=', doc.company],
-					['Account', 'is_group', '=', 0],
-					['Account', 'account_type', 'in', ['Bank', 'Cash']]
-				]
+				filters: {
+					company: doc.company,
+					is_group: 0,
+				},
 			};
 		});
-
+		frm.set_query("bank_cash_account", function (doc) {
+			return {
+				filters: [
+					["Account", "company", "=", doc.company],
+					["Account", "is_group", "=", 0],
+					["Account", "account_type", "in", ["Bank", "Cash"]],
+				],
+			};
+		});
 	},
-	refresh: function(frm) {
-		if (frm.doc.docstatus==1 && ['Queued', 'Paused'].find(x => x == frm.doc.status)) {
-			let execute_btn = __("Start / Resume")
+	refresh: function (frm) {
+		if (frm.doc.docstatus == 1 && ["Queued", "Paused"].find((x) => x == frm.doc.status)) {
+			let execute_btn = __("Start / Resume");
 
 			frm.add_custom_button(execute_btn, () => {
 				frm.call({
-					method: 'erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.trigger_job_for_doc',
+					method: "erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.trigger_job_for_doc",
 					args: {
-						docname: frm.doc.name
-					}
-				}).then(r => {
-					if(!r.exc) {
+						docname: frm.doc.name,
+					},
+				}).then((r) => {
+					if (!r.exc) {
 						frappe.show_alert(__("Job Started"));
 						frm.reload_doc();
 					}
 				});
 			});
 		}
-		if (frm.doc.docstatus==1 && ['Completed', 'Running', 'Paused', 'Partially Reconciled'].find(x => x == frm.doc.status)) {
+		if (
+			frm.doc.docstatus == 1 &&
+			["Completed", "Running", "Paused", "Partially Reconciled"].find((x) => x == frm.doc.status)
+		) {
 			frm.call({
-				'method': "erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.get_reconciled_count",
+				method: "erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.get_reconciled_count",
 				args: {
-					"docname": frm.docname,
-				}
-			}).then(r => {
+					docname: frm.docname,
+				},
+			}).then((r) => {
 				if (r.message) {
 					let progress = 0;
 					let description = "";
 
 					if (r.message.processed) {
-						progress = (r.message.processed/r.message.total) * 100;
-						description = r.message.processed + "/" + r.message.total +  " processed";
+						progress = (r.message.processed / r.message.total) * 100;
+						description = r.message.processed + "/" + r.message.total + " processed";
 					} else if (r.message.total == 0 && frm.doc.status == "Completed") {
 						progress = 100;
 					}
 
-
-					frm.dashboard.add_progress('Reconciliation Progress', progress, description);
+					frm.dashboard.add_progress("Reconciliation Progress", progress, description);
 				}
-			})
+			});
 		}
-		if (frm.doc.docstatus==1 && frm.doc.status == 'Running') {
-			let execute_btn = __("Pause")
+		if (frm.doc.docstatus == 1 && frm.doc.status == "Running") {
+			let execute_btn = __("Pause");
 
 			frm.add_custom_button(execute_btn, () => {
 				frm.call({
-					'method': "erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.pause_job_for_doc",
+					method: "erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.pause_job_for_doc",
 					args: {
-						"docname": frm.docname,
-					}
-				}).then(r => {
+						docname: frm.docname,
+					},
+				}).then((r) => {
 					if (!r.exc) {
 						frappe.show_alert(__("Job Paused"));
-						frm.reload_doc()
+						frm.reload_doc();
 					}
 				});
-
 			});
 		}
 	},
 	company(frm) {
-		frm.set_value('party', '');
-		frm.set_value('receivable_payable_account', '');
+		frm.set_value("party", "");
+		frm.set_value("receivable_payable_account", "");
 	},
 	party_type(frm) {
-		frm.set_value('party', '');
+		frm.set_value("party", "");
 	},
 
 	party(frm) {
-		frm.set_value('receivable_payable_account', '');
+		frm.set_value("receivable_payable_account", "");
 		if (!frm.doc.receivable_payable_account && frm.doc.party_type && frm.doc.party) {
 			return frappe.call({
 				method: "erpnext.accounts.party.get_party_account",
 				args: {
 					company: frm.doc.company,
 					party_type: frm.doc.party_type,
-					party: frm.doc.party
+					party: frm.doc.party,
 				},
 				callback: (r) => {
 					if (!r.exc && r.message) {
 						frm.set_value("receivable_payable_account", r.message);
 					}
 					frm.refresh();
-
-				}
+				},
 			});
 		}
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/process_payment_reconciliation/process_payment_reconciliation_list.js b/erpnext/accounts/doctype/process_payment_reconciliation/process_payment_reconciliation_list.js
index 8012d6e..ed182ad 100644
--- a/erpnext/accounts/doctype/process_payment_reconciliation/process_payment_reconciliation_list.js
+++ b/erpnext/accounts/doctype/process_payment_reconciliation/process_payment_reconciliation_list.js
@@ -1,15 +1,15 @@
-frappe.listview_settings['Process Payment Reconciliation'] = {
+frappe.listview_settings["Process Payment Reconciliation"] = {
 	add_fields: ["status"],
-	get_indicator: function(doc) {
+	get_indicator: function (doc) {
 		let colors = {
-			'Queued': 'orange',
-			'Paused': 'orange',
-			'Completed': 'green',
-			'Partially Reconciled': 'orange',
-			'Running': 'blue',
-			'Failed': 'red',
+			Queued: "orange",
+			Paused: "orange",
+			Completed: "green",
+			"Partially Reconciled": "orange",
+			Running: "blue",
+			Failed: "red",
 		};
 		let status = doc.status;
-		return [__(status), colors[status], 'status,=,'+status];
+		return [__(status), colors[status], "status,=," + status];
 	},
 };
diff --git a/erpnext/accounts/doctype/process_payment_reconciliation_log/process_payment_reconciliation_log.js b/erpnext/accounts/doctype/process_payment_reconciliation_log/process_payment_reconciliation_log.js
index 2468f10..f483d00 100644
--- a/erpnext/accounts/doctype/process_payment_reconciliation_log/process_payment_reconciliation_log.js
+++ b/erpnext/accounts/doctype/process_payment_reconciliation_log/process_payment_reconciliation_log.js
@@ -3,15 +3,14 @@
 
 frappe.ui.form.on("Process Payment Reconciliation Log", {
 	refresh(frm) {
-		if (['Completed', 'Running', 'Paused', 'Partially Reconciled'].find(x => x == frm.doc.status)) {
+		if (["Completed", "Running", "Paused", "Partially Reconciled"].find((x) => x == frm.doc.status)) {
 			let progress = 0;
 			if (frm.doc.reconciled_entries != 0) {
-				progress = frm.doc.reconciled_entries / frm.doc.total_allocations * 100;
-			} else if(frm.doc.total_allocations == 0 && frm.doc.status == "Completed"){
+				progress = (frm.doc.reconciled_entries / frm.doc.total_allocations) * 100;
+			} else if (frm.doc.total_allocations == 0 && frm.doc.status == "Completed") {
 				progress = 100;
 			}
-			frm.dashboard.add_progress(__('Reconciliation Progress'), progress);
+			frm.dashboard.add_progress(__("Reconciliation Progress"), progress);
 		}
-
 	},
 });
diff --git a/erpnext/accounts/doctype/process_payment_reconciliation_log/process_payment_reconciliation_log_list.js b/erpnext/accounts/doctype/process_payment_reconciliation_log/process_payment_reconciliation_log_list.js
index 5a65204..19c73b2 100644
--- a/erpnext/accounts/doctype/process_payment_reconciliation_log/process_payment_reconciliation_log_list.js
+++ b/erpnext/accounts/doctype/process_payment_reconciliation_log/process_payment_reconciliation_log_list.js
@@ -1,15 +1,15 @@
-frappe.listview_settings['Process Payment Reconciliation Log'] = {
+frappe.listview_settings["Process Payment Reconciliation Log"] = {
 	add_fields: ["status"],
-	get_indicator: function(doc) {
+	get_indicator: function (doc) {
 		var colors = {
-			'Partially Reconciled': 'orange',
-			'Paused': 'orange',
-			'Reconciled': 'green',
-			'Failed': 'red',
-			'Cancelled': 'red',
-			'Running': 'blue',
+			"Partially Reconciled": "orange",
+			Paused: "orange",
+			Reconciled: "green",
+			Failed: "red",
+			Cancelled: "red",
+			Running: "blue",
 		};
 		let status = doc.status;
-		return [__(status), colors[status], "status,=,"+status];
+		return [__(status), colors[status], "status,=," + status];
 	},
 };
diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.js b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.js
index cec48c1..25274f1 100644
--- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.js
+++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.js
@@ -1,155 +1,150 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Process Statement Of Accounts', {
-	view_properties: function(frm) {
-		frappe.route_options = {doc_type: 'Customer'};
+frappe.ui.form.on("Process Statement Of Accounts", {
+	view_properties: function (frm) {
+		frappe.route_options = { doc_type: "Customer" };
 		frappe.set_route("Form", "Customize Form");
 	},
-	refresh: function(frm){
-		if(!frm.doc.__islocal) {
-			frm.add_custom_button(__('Send Emails'), function(){
-				if (frm.is_dirty()) frappe.throw(__("Please save before proceeding."))
+	refresh: function (frm) {
+		if (!frm.doc.__islocal) {
+			frm.add_custom_button(__("Send Emails"), function () {
+				if (frm.is_dirty()) frappe.throw(__("Please save before proceeding."));
 				frappe.call({
 					method: "erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts.send_emails",
 					args: {
-						"document_name": frm.doc.name,
+						document_name: frm.doc.name,
 					},
-					callback: function(r) {
-						if(r && r.message) {
-							frappe.show_alert({message: __('Emails Queued'), indicator: 'blue'});
+					callback: function (r) {
+						if (r && r.message) {
+							frappe.show_alert({ message: __("Emails Queued"), indicator: "blue" });
+						} else {
+							frappe.msgprint(__("No Records for these settings."));
 						}
-						else{
-							frappe.msgprint(__('No Records for these settings.'))
-						}
-					}
+					},
 				});
 			});
-			frm.add_custom_button(__('Download'), function(){
-				if (frm.is_dirty()) frappe.throw(__("Please save before proceeding."))
+			frm.add_custom_button(__("Download"), function () {
+				if (frm.is_dirty()) frappe.throw(__("Please save before proceeding."));
 				let url = frappe.urllib.get_full_url(
-					'/api/method/erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts.download_statements?'
-					+ 'document_name='+encodeURIComponent(frm.doc.name))
+					"/api/method/erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts.download_statements?" +
+						"document_name=" +
+						encodeURIComponent(frm.doc.name)
+				);
 				$.ajax({
 					url: url,
-					type: 'GET',
-					success: function(result) {
-						if(jQuery.isEmptyObject(result)){
-							frappe.msgprint(__('No Records for these settings.'));
-						}
-						else{
+					type: "GET",
+					success: function (result) {
+						if (jQuery.isEmptyObject(result)) {
+							frappe.msgprint(__("No Records for these settings."));
+						} else {
 							window.location = url;
 						}
-					}
+					},
 				});
 			});
 		}
 	},
-	onload: function(frm) {
-		frm.set_query('currency', function(){
+	onload: function (frm) {
+		frm.set_query("currency", function () {
 			return {
 				filters: {
-					'enabled': 1
-				}
-			}
-		});
-		frm.set_query("account", function() {
-			return {
-				filters: {
-					'company': frm.doc.company
-				}
+					enabled: 1,
+				},
 			};
 		});
-		if(frm.doc.__islocal){
-			frm.set_value('from_date', frappe.datetime.add_months(frappe.datetime.get_today(), -1));
-			frm.set_value('to_date', frappe.datetime.get_today());
+		frm.set_query("account", function () {
+			return {
+				filters: {
+					company: frm.doc.company,
+				},
+			};
+		});
+		if (frm.doc.__islocal) {
+			frm.set_value("from_date", frappe.datetime.add_months(frappe.datetime.get_today(), -1));
+			frm.set_value("to_date", frappe.datetime.get_today());
 		}
 	},
-	report: function(frm){
+	report: function (frm) {
 		let filters = {
-			'company': frm.doc.company,
+			company: frm.doc.company,
+		};
+		if (frm.doc.report == "Accounts Receivable") {
+			filters["account_type"] = "Receivable";
 		}
-		if(frm.doc.report == 'Accounts Receivable'){
-			filters['account_type'] = 'Receivable';
-		}
-		frm.set_query("account", function() {
+		frm.set_query("account", function () {
 			return {
-				filters: filters
+				filters: filters,
 			};
 		});
-
 	},
-	customer_collection: function(frm){
-		frm.set_value('collection_name', '');
-		if(frm.doc.customer_collection){
-			frm.get_field('collection_name').set_label(frm.doc.customer_collection);
+	customer_collection: function (frm) {
+		frm.set_value("collection_name", "");
+		if (frm.doc.customer_collection) {
+			frm.get_field("collection_name").set_label(frm.doc.customer_collection);
 		}
 	},
-	frequency: function(frm){
-		if(frm.doc.frequency != ''){
-			frm.set_value('start_date', frappe.datetime.get_today());
-		}
-		else{
-			frm.set_value('start_date', '');
+	frequency: function (frm) {
+		if (frm.doc.frequency != "") {
+			frm.set_value("start_date", frappe.datetime.get_today());
+		} else {
+			frm.set_value("start_date", "");
 		}
 	},
-	fetch_customers: function(frm){
-		if(frm.doc.collection_name){
+	fetch_customers: function (frm) {
+		if (frm.doc.collection_name) {
 			frappe.call({
 				method: "erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts.fetch_customers",
 				args: {
-					'customer_collection': frm.doc.customer_collection,
-					'collection_name': frm.doc.collection_name,
-					'primary_mandatory': frm.doc.primary_mandatory
+					customer_collection: frm.doc.customer_collection,
+					collection_name: frm.doc.collection_name,
+					primary_mandatory: frm.doc.primary_mandatory,
 				},
-				callback: function(r) {
-					if(!r.exc) {
-						if(r.message.length){
-							frm.clear_table('customers');
-							for (const customer of r.message){
-								var row = frm.add_child('customers');
+				callback: function (r) {
+					if (!r.exc) {
+						if (r.message.length) {
+							frm.clear_table("customers");
+							for (const customer of r.message) {
+								var row = frm.add_child("customers");
 								row.customer = customer.name;
 								row.primary_email = customer.primary_email;
 								row.billing_email = customer.billing_email;
 							}
-							frm.refresh_field('customers');
-						}
-						else{
-							frappe.throw(__('No Customers found with selected options.'));
+							frm.refresh_field("customers");
+						} else {
+							frappe.throw(__("No Customers found with selected options."));
 						}
 					}
-				}
+				},
 			});
+		} else {
+			frappe.throw("Enter " + frm.doc.customer_collection + " name.");
 		}
-		else {
-			frappe.throw('Enter ' + frm.doc.customer_collection + ' name.');
-		}
-	}
+	},
 });
 
-frappe.ui.form.on('Process Statement Of Accounts Customer', {
-	customer: function(frm, cdt, cdn){
+frappe.ui.form.on("Process Statement Of Accounts Customer", {
+	customer: function (frm, cdt, cdn) {
 		var row = locals[cdt][cdn];
-		if (!row.customer){
+		if (!row.customer) {
 			return;
 		}
 		frappe.call({
-			method: 'erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts.get_customer_emails',
+			method: "erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts.get_customer_emails",
 			args: {
-				'customer_name': row.customer,
-				'primary_mandatory': frm.doc.primary_mandatory
+				customer_name: row.customer,
+				primary_mandatory: frm.doc.primary_mandatory,
 			},
-			callback: function(r){
-				if(!r.exe){
-					if(r.message.length){
-						frappe.model.set_value(cdt, cdn, "primary_email", r.message[0])
-						frappe.model.set_value(cdt, cdn, "billing_email", r.message[1])
-					}
-					else {
-						return
+			callback: function (r) {
+				if (!r.exe) {
+					if (r.message.length) {
+						frappe.model.set_value(cdt, cdn, "primary_email", r.message[0]);
+						frappe.model.set_value(cdt, cdn, "billing_email", r.message[1]);
+					} else {
+						return;
 					}
 				}
-			}
-		})
-	}
+			},
+		});
+	},
 });
diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py
index 083c8fc..f9d6136 100644
--- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py
+++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py
@@ -455,11 +455,16 @@
 			subject = frappe.render_template(doc.subject, context)
 			message = frappe.render_template(doc.body, context)
 
+			if doc.sender:
+				sender_email = frappe.db.get_value("Email Account", doc.sender, "email_id")
+			else:
+				sender_email = frappe.session.user
+
 			frappe.enqueue(
 				queue="short",
 				method=frappe.sendmail,
 				recipients=recipients,
-				sender=doc.sender or frappe.session.user,
+				sender=sender_email,
 				cc=cc,
 				subject=subject,
 				message=message,
diff --git a/erpnext/accounts/doctype/promotional_scheme/promotional_scheme.js b/erpnext/accounts/doctype/promotional_scheme/promotional_scheme.js
index e840c79..7a26c07 100644
--- a/erpnext/accounts/doctype/promotional_scheme/promotional_scheme.js
+++ b/erpnext/accounts/doctype/promotional_scheme/promotional_scheme.js
@@ -1,51 +1,56 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Promotional Scheme', {
-	refresh: function(frm) {
+frappe.ui.form.on("Promotional Scheme", {
+	refresh: function (frm) {
 		frm.trigger("set_options_for_applicable_for");
 		frm.trigger("toggle_reqd_apply_on");
 	},
 
-	selling: function(frm) {
+	selling: function (frm) {
 		frm.trigger("set_options_for_applicable_for");
 	},
 
-	buying: function(frm) {
+	buying: function (frm) {
 		frm.trigger("set_options_for_applicable_for");
 	},
 
-	set_options_for_applicable_for: function(frm) {
+	set_options_for_applicable_for: function (frm) {
 		var options = [""];
 		var applicable_for = frm.doc.applicable_for;
 
-		if(frm.doc.selling) {
-			options = $.merge(options, ["Customer", "Customer Group", "Territory", "Sales Partner", "Campaign"]);
+		if (frm.doc.selling) {
+			options = $.merge(options, [
+				"Customer",
+				"Customer Group",
+				"Territory",
+				"Sales Partner",
+				"Campaign",
+			]);
 		}
-		if(frm.doc.buying) {
+		if (frm.doc.buying) {
 			$.merge(options, ["Supplier", "Supplier Group"]);
 		}
 
 		set_field_options("applicable_for", options.join("\n"));
 
-		if(!in_list(options, applicable_for)) applicable_for = null;
+		if (!in_list(options, applicable_for)) applicable_for = null;
 		frm.set_value("applicable_for", applicable_for);
 	},
 
-	apply_on: function(frm) {
+	apply_on: function (frm) {
 		frm.trigger("toggle_reqd_apply_on");
 	},
 
-	toggle_reqd_apply_on: function(frm) {
+	toggle_reqd_apply_on: function (frm) {
 		const fields = {
-			'Item Code': 'items',
-			'Item Group': 'item_groups',
-			'Brand': 'brands'
+			"Item Code": "items",
+			"Item Group": "item_groups",
+			Brand: "brands",
 		};
 
 		for (var key in fields) {
-			frm.toggle_reqd(fields[key],
-				frm.doc.apply_on === key ? 1 : 0);
+			frm.toggle_reqd(fields[key], frm.doc.apply_on === key ? 1 : 0);
 		}
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
index 8f0df3e..d6455b2 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
@@ -14,19 +14,19 @@
 		super.setup(doc);
 
 		// formatter for purchase invoice item
-		if(this.frm.doc.update_stock) {
-			this.frm.set_indicator_formatter('item_code', function(doc) {
-				return (doc.qty<=doc.received_qty) ? "green" : "orange";
+		if (this.frm.doc.update_stock) {
+			this.frm.set_indicator_formatter("item_code", function (doc) {
+				return doc.qty <= doc.received_qty ? "green" : "orange";
 			});
 		}
 
-		this.frm.set_query("unrealized_profit_loss_account", function() {
+		this.frm.set_query("unrealized_profit_loss_account", function () {
 			return {
 				filters: {
 					company: doc.company,
 					is_group: 0,
 					root_type: "Liability",
-				}
+				},
 			};
 		});
 	}
@@ -35,11 +35,21 @@
 		super.onload();
 
 		// Ignore linked advances
-		this.frm.ignore_doctypes_on_cancel_all = ['Journal Entry', 'Payment Entry', 'Purchase Invoice', "Repost Payment Ledger", "Repost Accounting Ledger", "Unreconcile Payment", "Unreconcile Payment Entries", "Serial and Batch Bundle", "Bank Transaction"];
+		this.frm.ignore_doctypes_on_cancel_all = [
+			"Journal Entry",
+			"Payment Entry",
+			"Purchase Invoice",
+			"Repost Payment Ledger",
+			"Repost Accounting Ledger",
+			"Unreconcile Payment",
+			"Unreconcile Payment Entries",
+			"Serial and Batch Bundle",
+			"Bank Transaction",
+		];
 
-		if(!this.frm.doc.__islocal) {
+		if (!this.frm.doc.__islocal) {
 			// show credit_to in print format
-			if(!this.frm.doc.supplier && this.frm.doc.credit_to) {
+			if (!this.frm.doc.supplier && this.frm.doc.credit_to) {
 				this.frm.set_df_property("credit_to", "print_hide", 0);
 			}
 		}
@@ -47,7 +57,7 @@
 		// Trigger supplier event on load if supplier is available
 		// The reason for this is PI can be created from PR or PO and supplier is pre populated
 		if (this.frm.doc.supplier && this.frm.doc.__islocal) {
-			this.frm.trigger('supplier');
+			this.frm.trigger("supplier");
 		}
 	}
 
@@ -60,116 +70,137 @@
 		this.show_general_ledger();
 		erpnext.accounts.ledger_preview.show_accounting_ledger_preview(this.frm);
 
-		if(doc.update_stock==1) {
+		if (doc.update_stock == 1) {
 			this.show_stock_ledger();
 			erpnext.accounts.ledger_preview.show_stock_ledger_preview(this.frm);
 		}
 
-		if (this.frm.doc.repost_required && this.frm.doc.docstatus===1) {
-			this.frm.set_intro(__("Accounting entries for this invoice need to be reposted. Please click on 'Repost' button to update."));
-			this.frm.add_custom_button(__('Repost Accounting Entries'),
-				() => {
+		if (this.frm.doc.repost_required && this.frm.doc.docstatus === 1) {
+			this.frm.set_intro(
+				__(
+					"Accounting entries for this invoice need to be reposted. Please click on 'Repost' button to update."
+				)
+			);
+			this.frm
+				.add_custom_button(__("Repost Accounting Entries"), () => {
 					this.frm.call({
 						doc: this.frm.doc,
-						method: 'repost_accounting_entries',
+						method: "repost_accounting_entries",
 						freeze: true,
-						freeze_message: __('Reposting...'),
+						freeze_message: __("Reposting..."),
 						callback: (r) => {
 							if (!r.exc) {
-								frappe.msgprint(__('Accounting Entries are reposted.'));
+								frappe.msgprint(__("Accounting Entries are reposted."));
 								me.frm.refresh();
 							}
-						}
+						},
 					});
-				}).removeClass('btn-default').addClass('btn-warning');
+				})
+				.removeClass("btn-default")
+				.addClass("btn-warning");
 		}
 
-		if(!doc.is_return && doc.docstatus == 1 && doc.outstanding_amount != 0){
-			if(doc.on_hold) {
+		if (!doc.is_return && doc.docstatus == 1 && doc.outstanding_amount != 0) {
+			if (doc.on_hold) {
 				this.frm.add_custom_button(
-					__('Change Release Date'),
-					function() {me.change_release_date()},
-					__('Hold Invoice')
+					__("Change Release Date"),
+					function () {
+						me.change_release_date();
+					},
+					__("Hold Invoice")
 				);
 				this.frm.add_custom_button(
-					__('Unblock Invoice'),
-					function() {me.unblock_invoice()},
-					__('Create')
+					__("Unblock Invoice"),
+					function () {
+						me.unblock_invoice();
+					},
+					__("Create")
 				);
 			} else if (!doc.on_hold) {
 				this.frm.add_custom_button(
-					__('Block Invoice'),
-					function() {me.block_invoice()},
-					__('Create')
+					__("Block Invoice"),
+					function () {
+						me.block_invoice();
+					},
+					__("Create")
 				);
 			}
 		}
 
-		if(doc.docstatus == 1 && doc.outstanding_amount != 0 && !doc.on_hold) {
-			this.frm.add_custom_button(
-				__('Payment'),
-				() => this.make_payment_entry(),
-				__('Create')
-			);
-			cur_frm.page.set_inner_btn_group_as_primary(__('Create'));
+		if (doc.docstatus == 1 && doc.outstanding_amount != 0 && !doc.on_hold) {
+			this.frm.add_custom_button(__("Payment"), () => this.make_payment_entry(), __("Create"));
+			cur_frm.page.set_inner_btn_group_as_primary(__("Create"));
 		}
 
-		if(!doc.is_return && doc.docstatus==1) {
-			if(doc.outstanding_amount >= 0 || Math.abs(flt(doc.outstanding_amount)) < flt(doc.grand_total)) {
-				cur_frm.add_custom_button(__('Return / Debit Note'),
-					this.make_debit_note, __('Create'));
+		if (!doc.is_return && doc.docstatus == 1) {
+			if (doc.outstanding_amount >= 0 || Math.abs(flt(doc.outstanding_amount)) < flt(doc.grand_total)) {
+				cur_frm.add_custom_button(__("Return / Debit Note"), this.make_debit_note, __("Create"));
 			}
 		}
 
 		if (doc.outstanding_amount > 0 && !cint(doc.is_return) && !doc.on_hold) {
-			cur_frm.add_custom_button(__('Payment Request'), function() {
-				me.make_payment_request()
-			}, __('Create'));
+			cur_frm.add_custom_button(
+				__("Payment Request"),
+				function () {
+					me.make_payment_request();
+				},
+				__("Create")
+			);
 		}
 
-		if(doc.docstatus===0) {
-			this.frm.add_custom_button(__('Purchase Order'), function() {
-				erpnext.utils.map_current_doc({
-					method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_invoice",
-					source_doctype: "Purchase Order",
-					target: me.frm,
-					setters: {
-						supplier: me.frm.doc.supplier || undefined,
-						schedule_date: undefined
-					},
-					get_query_filters: {
-						docstatus: 1,
-						status: ["not in", ["Closed", "On Hold"]],
-						per_billed: ["<", 99.99],
-						company: me.frm.doc.company
-					}
-				})
-			}, __("Get Items From"));
+		if (doc.docstatus === 0) {
+			this.frm.add_custom_button(
+				__("Purchase Order"),
+				function () {
+					erpnext.utils.map_current_doc({
+						method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_invoice",
+						source_doctype: "Purchase Order",
+						target: me.frm,
+						setters: {
+							supplier: me.frm.doc.supplier || undefined,
+							schedule_date: undefined,
+						},
+						get_query_filters: {
+							docstatus: 1,
+							status: ["not in", ["Closed", "On Hold"]],
+							per_billed: ["<", 99.99],
+							company: me.frm.doc.company,
+						},
+					});
+				},
+				__("Get Items From")
+			);
 
-			this.frm.add_custom_button(__('Purchase Receipt'), function() {
-				erpnext.utils.map_current_doc({
-					method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_purchase_invoice",
-					source_doctype: "Purchase Receipt",
-					target: me.frm,
-					setters: {
-						supplier: me.frm.doc.supplier || undefined,
-						posting_date: undefined
-					},
-					get_query_filters: {
-						docstatus: 1,
-						status: ["not in", ["Closed", "Completed", "Return Issued"]],
-						company: me.frm.doc.company,
-						is_return: 0
-					}
-				})
-			}, __("Get Items From"));
+			this.frm.add_custom_button(
+				__("Purchase Receipt"),
+				function () {
+					erpnext.utils.map_current_doc({
+						method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_purchase_invoice",
+						source_doctype: "Purchase Receipt",
+						target: me.frm,
+						setters: {
+							supplier: me.frm.doc.supplier || undefined,
+							posting_date: undefined,
+						},
+						get_query_filters: {
+							docstatus: 1,
+							status: ["not in", ["Closed", "Completed", "Return Issued"]],
+							company: me.frm.doc.company,
+							is_return: 0,
+						},
+					});
+				},
+				__("Get Items From")
+			);
 
 			if (!this.frm.doc.is_return) {
 				frappe.db.get_single_value("Buying Settings", "maintain_same_rate").then((value) => {
 					if (value) {
 						this.frm.doc.items.forEach((item) => {
 							this.frm.fields_dict.items.grid.update_docfield_property(
-								"rate", "read_only", (item.purchase_receipt && item.pr_detail)
+								"rate",
+								"read_only",
+								item.purchase_receipt && item.pr_detail
 							);
 						});
 					}
@@ -179,14 +210,18 @@
 		this.frm.toggle_reqd("supplier_warehouse", this.frm.doc.is_subcontracted);
 
 		if (doc.docstatus == 1 && !doc.inter_company_invoice_reference) {
-			frappe.model.with_doc("Supplier", me.frm.doc.supplier, function() {
+			frappe.model.with_doc("Supplier", me.frm.doc.supplier, function () {
 				var supplier = frappe.model.get_doc("Supplier", me.frm.doc.supplier);
 				var internal = supplier.is_internal_supplier;
 				var disabled = supplier.disabled;
 				if (internal == 1 && disabled == 0) {
-					me.frm.add_custom_button("Inter Company Invoice", function() {
-						me.make_inter_company_invoice(me.frm);
-					}, __('Create'));
+					me.frm.add_custom_button(
+						"Inter Company Invoice",
+						function () {
+							me.make_inter_company_invoice(me.frm);
+						},
+						__("Create")
+					);
 				}
 			});
 		}
@@ -198,9 +233,9 @@
 	unblock_invoice() {
 		const me = this;
 		frappe.call({
-			'method': 'erpnext.accounts.doctype.purchase_invoice.purchase_invoice.unblock_invoice',
-			'args': {'name': me.frm.doc.name},
-			'callback': (r) => me.frm.reload_doc()
+			method: "erpnext.accounts.doctype.purchase_invoice.purchase_invoice.unblock_invoice",
+			args: { name: me.frm.doc.name },
+			callback: (r) => me.frm.reload_doc(),
 		});
 	}
 
@@ -215,50 +250,50 @@
 	can_change_release_date(date) {
 		const diff = frappe.datetime.get_diff(date, frappe.datetime.nowdate());
 		if (diff < 0) {
-			frappe.throw(__('New release date should be in the future'));
+			frappe.throw(__("New release date should be in the future"));
 			return false;
 		} else {
 			return true;
 		}
 	}
 
-	make_comment_dialog_and_block_invoice(){
+	make_comment_dialog_and_block_invoice() {
 		const me = this;
 
-		const title = __('Block Invoice');
+		const title = __("Block Invoice");
 		const fields = [
 			{
-				fieldname: 'release_date',
+				fieldname: "release_date",
 				read_only: 0,
-				fieldtype:'Date',
-				label: __('Release Date'),
+				fieldtype: "Date",
+				label: __("Release Date"),
 				default: me.frm.doc.release_date,
-				reqd: 1
+				reqd: 1,
 			},
 			{
-				fieldname: 'hold_comment',
+				fieldname: "hold_comment",
 				read_only: 0,
-				fieldtype:'Small Text',
-				label: __('Reason For Putting On Hold'),
-				default: ""
+				fieldtype: "Small Text",
+				label: __("Reason For Putting On Hold"),
+				default: "",
 			},
 		];
 
 		this.dialog = new frappe.ui.Dialog({
 			title: title,
-			fields: fields
+			fields: fields,
 		});
 
-		this.dialog.set_primary_action(__('Save'), function() {
+		this.dialog.set_primary_action(__("Save"), function () {
 			const dialog_data = me.dialog.get_values();
 			frappe.call({
-				'method': 'erpnext.accounts.doctype.purchase_invoice.purchase_invoice.block_invoice',
-				'args': {
-					'name': me.frm.doc.name,
-					'hold_comment': dialog_data.hold_comment,
-					'release_date': dialog_data.release_date
+				method: "erpnext.accounts.doctype.purchase_invoice.purchase_invoice.block_invoice",
+				args: {
+					name: me.frm.doc.name,
+					hold_comment: dialog_data.hold_comment,
+					release_date: dialog_data.release_date,
 				},
-				'callback': (r) => me.frm.reload_doc()
+				callback: (r) => me.frm.reload_doc(),
 			});
 			me.dialog.hide();
 		});
@@ -269,25 +304,25 @@
 	make_dialog_and_set_release_date() {
 		const me = this;
 
-		const title = __('Set New Release Date');
+		const title = __("Set New Release Date");
 		const fields = [
 			{
-				fieldname: 'release_date',
+				fieldname: "release_date",
 				read_only: 0,
-				fieldtype:'Date',
-				label: __('Release Date'),
-				default: me.frm.doc.release_date
+				fieldtype: "Date",
+				label: __("Release Date"),
+				default: me.frm.doc.release_date,
 			},
 		];
 
 		this.dialog = new frappe.ui.Dialog({
 			title: title,
-			fields: fields
+			fields: fields,
 		});
 
-		this.dialog.set_primary_action(__('Save'), function() {
+		this.dialog.set_primary_action(__("Save"), function () {
 			me.dialog_data = me.dialog.get_values();
-			if(me.can_change_release_date(me.dialog_data.release_date)) {
+			if (me.can_change_release_date(me.dialog_data.release_date)) {
 				me.dialog_data.name = me.frm.doc.name;
 				me.set_release_date(me.dialog_data);
 				me.dialog.hide();
@@ -299,9 +334,9 @@
 
 	set_release_date(data) {
 		return frappe.call({
-			'method': 'erpnext.accounts.doctype.purchase_invoice.purchase_invoice.change_release_date',
-			'args': data,
-			'callback': (r) => this.frm.reload_doc()
+			method: "erpnext.accounts.doctype.purchase_invoice.purchase_invoice.change_release_date",
+			args: data,
+			callback: (r) => this.frm.reload_doc(),
 		});
 	}
 
@@ -309,12 +344,13 @@
 		var me = this;
 
 		// Do not update if inter company reference is there as the details will already be updated
-		if(this.frm.updating_party_details || this.frm.doc.inter_company_invoice_reference)
-			return;
+		if (this.frm.updating_party_details || this.frm.doc.inter_company_invoice_reference) return;
 
 		if (this.frm.doc.__onload && this.frm.doc.__onload.load_after_mapping) return;
 
-		erpnext.utils.get_party_details(this.frm, "erpnext.accounts.party.get_party_details",
+		erpnext.utils.get_party_details(
+			this.frm,
+			"erpnext.accounts.party.get_party_details",
 			{
 				posting_date: this.frm.doc.posting_date,
 				bill_date: this.frm.doc.bill_date,
@@ -322,21 +358,23 @@
 				party_type: "Supplier",
 				account: this.frm.doc.credit_to,
 				price_list: this.frm.doc.buying_price_list,
-				fetch_payment_terms_template: cint(!this.frm.doc.ignore_default_payment_terms_template)
-			}, function() {
+				fetch_payment_terms_template: cint(!this.frm.doc.ignore_default_payment_terms_template),
+			},
+			function () {
 				me.apply_pricing_rule();
 				me.frm.doc.apply_tds = me.frm.supplier_tds ? 1 : 0;
 				me.frm.doc.tax_withholding_category = me.frm.supplier_tds;
 				me.frm.set_df_property("apply_tds", "read_only", me.frm.supplier_tds ? 0 : 1);
 				me.frm.set_df_property("tax_withholding_category", "hidden", me.frm.supplier_tds ? 0 : 1);
-			})
+			}
+		);
 	}
 
 	apply_tds(frm) {
 		var me = this;
 		me.frm.set_value("tax_withheld_vouchers", []);
 		if (!me.frm.doc.apply_tds) {
-			me.frm.set_value("tax_withholding_category", '');
+			me.frm.set_value("tax_withholding_category", "");
 			me.frm.set_df_property("tax_withholding_category", "hidden", 1);
 		} else {
 			me.frm.set_value("tax_withholding_category", me.frm.supplier_tds);
@@ -346,7 +384,7 @@
 
 	credit_to() {
 		var me = this;
-		if(this.frm.doc.credit_to) {
+		if (this.frm.doc.credit_to) {
 			me.frm.call({
 				method: "frappe.client.get_value",
 				args: {
@@ -354,12 +392,12 @@
 					fieldname: "account_currency",
 					filters: { name: me.frm.doc.credit_to },
 				},
-				callback: function(r, rt) {
-					if(r.message) {
+				callback: function (r, rt) {
+					if (r.message) {
 						me.frm.set_value("party_account_currency", r.message.account_currency);
 						me.set_dynamic_labels();
 					}
-				}
+				},
 			});
 		}
 	}
@@ -367,16 +405,16 @@
 	make_inter_company_invoice(frm) {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.accounts.doctype.purchase_invoice.purchase_invoice.make_inter_company_sales_invoice",
-			frm: frm
+			frm: frm,
 		});
 	}
 
 	is_paid() {
 		hide_fields(this.frm.doc);
-		if(cint(this.frm.doc.is_paid)) {
+		if (cint(this.frm.doc.is_paid)) {
 			this.frm.set_value("allocate_advances_automatically", 0);
-			if(!this.frm.doc.company) {
-				this.frm.set_value("is_paid", 0)
+			if (!this.frm.doc.company) {
+				this.frm.set_value("is_paid", 0);
 				frappe.msgprint(__("Please specify Company to proceed"));
 			}
 		}
@@ -403,23 +441,27 @@
 
 	items_add(doc, cdt, cdn) {
 		var row = frappe.get_doc(cdt, cdn);
-		this.frm.script_manager.copy_from_first_row("items", row,
-			["expense_account", "discount_account", "cost_center", "project"]);
+		this.frm.script_manager.copy_from_first_row("items", row, [
+			"expense_account",
+			"discount_account",
+			"cost_center",
+			"project",
+		]);
 	}
 
 	on_submit() {
 		super.on_submit();
 
-		$.each(this.frm.doc["items"] || [], function(i, row) {
-			if(row.purchase_receipt) frappe.model.clear_doc("Purchase Receipt", row.purchase_receipt)
-		})
+		$.each(this.frm.doc["items"] || [], function (i, row) {
+			if (row.purchase_receipt) frappe.model.clear_doc("Purchase Receipt", row.purchase_receipt);
+		});
 	}
 
 	make_debit_note() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.accounts.doctype.purchase_invoice.purchase_invoice.make_debit_note",
-			frm: cur_frm
-		})
+			frm: cur_frm,
+		});
 	}
 };
 
@@ -428,172 +470,170 @@
 // Hide Fields
 // ------------
 function hide_fields(doc) {
-	var parent_fields = ['due_date', 'is_opening', 'advances_section', 'from_date', 'to_date'];
+	var parent_fields = ["due_date", "is_opening", "advances_section", "from_date", "to_date"];
 
-	if(cint(doc.is_paid) == 1) {
+	if (cint(doc.is_paid) == 1) {
 		hide_field(parent_fields);
 	} else {
 		for (var i in parent_fields) {
 			var docfield = frappe.meta.docfield_map[doc.doctype][parent_fields[i]];
-			if(!docfield.hidden) unhide_field(parent_fields[i]);
+			if (!docfield.hidden) unhide_field(parent_fields[i]);
 		}
-
 	}
 
-	var item_fields_stock = ['warehouse_section', 'received_qty', 'rejected_qty'];
+	var item_fields_stock = ["warehouse_section", "received_qty", "rejected_qty"];
 
-	cur_frm.fields_dict['items'].grid.set_column_disp(item_fields_stock,
-		(cint(doc.update_stock)==1 || cint(doc.is_return)==1 ? true : false));
+	cur_frm.fields_dict["items"].grid.set_column_disp(
+		item_fields_stock,
+		cint(doc.update_stock) == 1 || cint(doc.is_return) == 1 ? true : false
+	);
 
 	cur_frm.refresh_fields();
 }
 
-cur_frm.fields_dict.cash_bank_account.get_query = function(doc) {
+cur_frm.fields_dict.cash_bank_account.get_query = function (doc) {
 	return {
 		filters: [
 			["Account", "account_type", "in", ["Cash", "Bank"]],
-			["Account", "is_group", "=",0],
+			["Account", "is_group", "=", 0],
 			["Account", "company", "=", doc.company],
-			["Account", "report_type", "=", "Balance Sheet"]
-		]
-	}
-}
+			["Account", "report_type", "=", "Balance Sheet"],
+		],
+	};
+};
 
-cur_frm.fields_dict['items'].grid.get_field("item_code").get_query = function(doc, cdt, cdn) {
+cur_frm.fields_dict["items"].grid.get_field("item_code").get_query = function (doc, cdt, cdn) {
 	return {
 		query: "erpnext.controllers.queries.item_query",
-		filters: {'is_purchase_item': 1}
-	}
-}
+		filters: { is_purchase_item: 1 },
+	};
+};
 
-cur_frm.fields_dict['credit_to'].get_query = function(doc) {
+cur_frm.fields_dict["credit_to"].get_query = function (doc) {
 	// filter on Account
 	return {
 		filters: {
-			'account_type': 'Payable',
-			'is_group': 0,
-			'company': doc.company
-		}
-	}
-}
+			account_type: "Payable",
+			is_group: 0,
+			company: doc.company,
+		},
+	};
+};
 
 // Get Print Heading
-cur_frm.fields_dict['select_print_heading'].get_query = function(doc, cdt, cdn) {
+cur_frm.fields_dict["select_print_heading"].get_query = function (doc, cdt, cdn) {
 	return {
-		filters:[
-			['Print Heading', 'docstatus', '!=', 2]
-		]
-	}
-}
+		filters: [["Print Heading", "docstatus", "!=", 2]],
+	};
+};
 
-cur_frm.set_query("expense_account", "items", function(doc) {
+cur_frm.set_query("expense_account", "items", function (doc) {
 	return {
 		query: "erpnext.controllers.queries.get_expense_account",
-		filters: {'company': doc.company }
-	}
+		filters: { company: doc.company },
+	};
 });
 
-cur_frm.set_query("wip_composite_asset", "items", function() {
+cur_frm.set_query("wip_composite_asset", "items", function () {
 	return {
-		filters: {'is_composite_asset': 1, 'docstatus': 0 }
-	}
+		filters: { is_composite_asset: 1, docstatus: 0 },
+	};
 });
 
-cur_frm.cscript.expense_account = function(doc, cdt, cdn){
+cur_frm.cscript.expense_account = function (doc, cdt, cdn) {
 	var d = locals[cdt][cdn];
-	if(d.idx == 1 && d.expense_account){
+	if (d.idx == 1 && d.expense_account) {
 		var cl = doc.items || [];
-		for(var i = 0; i < cl.length; i++){
-			if(!cl[i].expense_account) cl[i].expense_account = d.expense_account;
+		for (var i = 0; i < cl.length; i++) {
+			if (!cl[i].expense_account) cl[i].expense_account = d.expense_account;
 		}
 	}
-	refresh_field('items');
-}
+	refresh_field("items");
+};
 
-cur_frm.fields_dict["items"].grid.get_field("cost_center").get_query = function(doc) {
+cur_frm.fields_dict["items"].grid.get_field("cost_center").get_query = function (doc) {
 	return {
 		filters: {
-			'company': doc.company,
-			'is_group': 0
-		}
+			company: doc.company,
+			is_group: 0,
+		},
+	};
+};
 
-	}
-}
-
-cur_frm.cscript.cost_center = function(doc, cdt, cdn){
+cur_frm.cscript.cost_center = function (doc, cdt, cdn) {
 	var d = locals[cdt][cdn];
-	if(d.cost_center){
+	if (d.cost_center) {
 		var cl = doc.items || [];
-		for(var i = 0; i < cl.length; i++){
-			if(!cl[i].cost_center) cl[i].cost_center = d.cost_center;
+		for (var i = 0; i < cl.length; i++) {
+			if (!cl[i].cost_center) cl[i].cost_center = d.cost_center;
 		}
 	}
-	refresh_field('items');
-}
+	refresh_field("items");
+};
 
-cur_frm.fields_dict['items'].grid.get_field('project').get_query = function(doc, cdt, cdn) {
-	return{
-		filters:[
-			['Project', 'status', 'not in', 'Completed, Cancelled']
-		]
-	}
-}
+cur_frm.fields_dict["items"].grid.get_field("project").get_query = function (doc, cdt, cdn) {
+	return {
+		filters: [["Project", "status", "not in", "Completed, Cancelled"]],
+	};
+};
 
 frappe.ui.form.on("Purchase Invoice", {
-	setup: function(frm) {
+	setup: function (frm) {
 		frm.custom_make_buttons = {
-			'Purchase Invoice': 'Return / Debit Note',
-			'Payment Entry': 'Payment',
-			'Landed Cost Voucher': function () { frm.trigger('create_landed_cost_voucher') },
-		}
+			"Purchase Invoice": "Return / Debit Note",
+			"Payment Entry": "Payment",
+			"Landed Cost Voucher": function () {
+				frm.trigger("create_landed_cost_voucher");
+			},
+		};
 
-		frm.set_query("additional_discount_account", function() {
+		frm.set_query("additional_discount_account", function () {
 			return {
 				filters: {
 					company: frm.doc.company,
 					is_group: 0,
 					report_type: "Profit and Loss",
-				}
+				},
 			};
 		});
 
-		frm.fields_dict['items'].grid.get_field('deferred_expense_account').get_query = function(doc) {
+		frm.fields_dict["items"].grid.get_field("deferred_expense_account").get_query = function (doc) {
 			return {
 				filters: {
-					'root_type': 'Asset',
-					'company': doc.company,
-					"is_group": 0
-				}
-			}
-		}
+					root_type: "Asset",
+					company: doc.company,
+					is_group: 0,
+				},
+			};
+		};
 
-		frm.fields_dict['items'].grid.get_field('discount_account').get_query = function(doc) {
+		frm.fields_dict["items"].grid.get_field("discount_account").get_query = function (doc) {
 			return {
 				filters: {
-					'report_type': 'Profit and Loss',
-					'company': doc.company,
-					"is_group": 0
-				}
-			}
-		}
+					report_type: "Profit and Loss",
+					company: doc.company,
+					is_group: 0,
+				},
+			};
+		};
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		frm.events.add_custom_buttons(frm);
 	},
 
-	mode_of_payment: function(frm) {
-		erpnext.accounts.pos.get_payment_mode_account(frm, frm.doc.mode_of_payment, function(account) {
+	mode_of_payment: function (frm) {
+		erpnext.accounts.pos.get_payment_mode_account(frm, frm.doc.mode_of_payment, function (account) {
 			frm.set_value("cash_bank_account", account);
-		})
+		});
 	},
 
 	create_landed_cost_voucher: function (frm) {
-		let lcv = frappe.model.get_new_doc('Landed Cost Voucher');
+		let lcv = frappe.model.get_new_doc("Landed Cost Voucher");
 		lcv.company = frm.doc.company;
 
-		let lcv_receipt = frappe.model.get_new_doc('Landed Cost Purchase Invoice');
-		lcv_receipt.receipt_document_type = 'Purchase Invoice';
+		let lcv_receipt = frappe.model.get_new_doc("Landed Cost Purchase Invoice");
+		lcv_receipt.receipt_document_type = "Purchase Invoice";
 		lcv_receipt.receipt_document = frm.doc.name;
 		lcv_receipt.supplier = frm.doc.supplier;
 		lcv_receipt.grand_total = frm.doc.grand_total;
@@ -602,35 +642,43 @@
 		frappe.set_route("Form", lcv.doctype, lcv.name);
 	},
 
-	add_custom_buttons: function(frm) {
+	add_custom_buttons: function (frm) {
 		if (frm.doc.docstatus == 1 && frm.doc.per_received < 100) {
-			frm.add_custom_button(__('Purchase Receipt'), () => {
-				frm.events.make_purchase_receipt(frm);
-			}, __('Create'));
+			frm.add_custom_button(
+				__("Purchase Receipt"),
+				() => {
+					frm.events.make_purchase_receipt(frm);
+				},
+				__("Create")
+			);
 		}
 
 		if (frm.doc.docstatus == 1 && frm.doc.per_received > 0) {
-			frm.add_custom_button(__('Purchase Receipt'), () => {
-				frappe.route_options = {
-					'purchase_invoice': frm.doc.name
-				}
+			frm.add_custom_button(
+				__("Purchase Receipt"),
+				() => {
+					frappe.route_options = {
+						purchase_invoice: frm.doc.name,
+					};
 
-				frappe.set_route("List", "Purchase Receipt", "List")
-			}, __('View'));
+					frappe.set_route("List", "Purchase Receipt", "List");
+				},
+				__("View")
+			);
 		}
 	},
 
-	onload: function(frm) {
-		if(frm.doc.__onload && frm.is_new()) {
-			if(frm.doc.supplier) {
+	onload: function (frm) {
+		if (frm.doc.__onload && frm.is_new()) {
+			if (frm.doc.supplier) {
 				frm.doc.apply_tds = frm.doc.__onload.supplier_tds ? 1 : 0;
 			}
-			if(!frm.doc.__onload.supplier_tds) {
+			if (!frm.doc.__onload.supplier_tds) {
 				frm.set_df_property("apply_tds", "read_only", 1);
 			}
 		}
 
-		erpnext.queries.setup_queries(frm, "Warehouse", function() {
+		erpnext.queries.setup_queries(frm, "Warehouse", function () {
 			return erpnext.queries.warehouse(frm.doc);
 		});
 
@@ -639,7 +687,7 @@
 		}
 	},
 
-	is_subcontracted: function(frm) {
+	is_subcontracted: function (frm) {
 		if (frm.doc.is_old_subcontracting_flow) {
 			erpnext.buying.get_default_bom(frm);
 		}
@@ -647,30 +695,29 @@
 		frm.toggle_reqd("supplier_warehouse", frm.doc.is_subcontracted);
 	},
 
-	update_stock: function(frm) {
+	update_stock: function (frm) {
 		hide_fields(frm.doc);
-		frm.fields_dict.items.grid.toggle_reqd("item_code", frm.doc.update_stock? true: false);
+		frm.fields_dict.items.grid.toggle_reqd("item_code", frm.doc.update_stock ? true : false);
 	},
 
-	make_purchase_receipt: function(frm) {
+	make_purchase_receipt: function (frm) {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.accounts.doctype.purchase_invoice.purchase_invoice.make_purchase_receipt",
 			frm: frm,
-			freeze_message: __("Creating Purchase Receipt ...")
-		})
+			freeze_message: __("Creating Purchase Receipt ..."),
+		});
 	},
 
-	company: function(frm) {
+	company: function (frm) {
 		erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
 
 		if (frm.doc.company) {
 			frappe.call({
-				method:
-					"erpnext.accounts.party.get_party_account",
+				method: "erpnext.accounts.party.get_party_account",
 				args: {
-					party_type: 'Supplier',
+					party_type: "Supplier",
 					party: frm.doc.supplier,
-					company: frm.doc.company
+					company: frm.doc.company,
 				},
 				callback: (response) => {
 					if (response) frm.set_value("credit_to", response.message);
@@ -678,4 +725,4 @@
 			});
 		}
 	},
-})
+});
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js
index fa30c37..031b234 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js
@@ -22,48 +22,35 @@
 			return [__(doc.status), "gray", "status,=," + doc.status];
 		}
 
-		if (
-			flt(doc.outstanding_amount) > 0 &&
-			doc.docstatus == 1 &&
-			cint(doc.on_hold)
-		) {
+		if (flt(doc.outstanding_amount) > 0 && doc.docstatus == 1 && cint(doc.on_hold)) {
 			if (!doc.release_date) {
 				return [__("On Hold"), "darkgrey"];
-			} else if (
-				frappe.datetime.get_diff(
-					doc.release_date,
-					frappe.datetime.nowdate()
-				) > 0
-			) {
+			} else if (frappe.datetime.get_diff(doc.release_date, frappe.datetime.nowdate()) > 0) {
 				return [__("Temporarily on Hold"), "darkgrey"];
 			}
 		}
 
 		const status_colors = {
-			"Unpaid": "orange",
-			"Paid": "green",
-			"Return": "gray",
-			"Overdue": "red",
+			Unpaid: "orange",
+			Paid: "green",
+			Return: "gray",
+			Overdue: "red",
 			"Partly Paid": "yellow",
 			"Internal Transfer": "darkgrey",
 		};
 
 		if (status_colors[doc.status]) {
-			return [
-				__(doc.status),
-				status_colors[doc.status],
-				"status,=," + doc.status,
-			];
+			return [__(doc.status), status_colors[doc.status], "status,=," + doc.status];
 		}
 	},
 
-	onload: function(listview) {
-		listview.page.add_action_item(__("Purchase Receipt"), ()=>{
+	onload: function (listview) {
+		listview.page.add_action_item(__("Purchase Receipt"), () => {
 			erpnext.bulk_transaction_processing.create(listview, "Purchase Invoice", "Purchase Receipt");
 		});
 
-		listview.page.add_action_item(__("Payment"), ()=>{
+		listview.page.add_action_item(__("Payment"), () => {
 			erpnext.bulk_transaction_processing.create(listview, "Purchase Invoice", "Payment Entry");
 		});
-	}
+	},
 };
diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template.js b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template.js
index 78dc4be..66a9cbe 100644
--- a/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template.js
+++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template.js
@@ -8,24 +8,23 @@
 	add_deduct_tax(doc, cdt, cdn) {
 		let d = locals[cdt][cdn];
 
-		if(!d.category && d.add_deduct_tax) {
+		if (!d.category && d.add_deduct_tax) {
 			frappe.msgprint(__("Please select Category first"));
-			d.add_deduct_tax = '';
-		}
-		else if(d.category != 'Total' && d.add_deduct_tax == 'Deduct') {
+			d.add_deduct_tax = "";
+		} else if (d.category != "Total" && d.add_deduct_tax == "Deduct") {
 			frappe.msgprint(__("Cannot deduct when category is for 'Valuation' or 'Valuation and Total'"));
-			d.add_deduct_tax = '';
+			d.add_deduct_tax = "";
 		}
-		refresh_field('add_deduct_tax', d.name, 'taxes');
+		refresh_field("add_deduct_tax", d.name, "taxes");
 	},
 
 	category(doc, cdt, cdn) {
 		let d = locals[cdt][cdn];
 
-		if(d.category != 'Total' && d.add_deduct_tax == 'Deduct') {
+		if (d.category != "Total" && d.add_deduct_tax == "Deduct") {
 			frappe.msgprint(__("Cannot deduct when category is for 'Valuation' or 'Valuation and Total'"));
-			d.add_deduct_tax = '';
+			d.add_deduct_tax = "";
 		}
-		refresh_field('add_deduct_tax', d.name, 'taxes');
-	}
+		refresh_field("add_deduct_tax", d.name, "taxes");
+	},
 });
diff --git a/erpnext/accounts/doctype/repost_accounting_ledger/repost_accounting_ledger.js b/erpnext/accounts/doctype/repost_accounting_ledger/repost_accounting_ledger.js
index c7b7a14..c304c7f 100644
--- a/erpnext/accounts/doctype/repost_accounting_ledger/repost_accounting_ledger.js
+++ b/erpnext/accounts/doctype/repost_accounting_ledger/repost_accounting_ledger.js
@@ -2,47 +2,47 @@
 // For license information, please see license.txt
 
 frappe.ui.form.on("Repost Accounting Ledger", {
-	setup: function(frm) {
-		frm.fields_dict['vouchers'].grid.get_field('voucher_type').get_query = function(doc) {
+	setup: function (frm) {
+		frm.fields_dict["vouchers"].grid.get_field("voucher_type").get_query = function (doc) {
 			return {
-				query: "erpnext.accounts.doctype.repost_accounting_ledger.repost_accounting_ledger.get_repost_allowed_types"
-			}
-		}
+				query: "erpnext.accounts.doctype.repost_accounting_ledger.repost_accounting_ledger.get_repost_allowed_types",
+			};
+		};
 
-		frm.fields_dict['vouchers'].grid.get_field('voucher_no').get_query = function(doc) {
+		frm.fields_dict["vouchers"].grid.get_field("voucher_no").get_query = function (doc) {
 			if (doc.company) {
 				return {
 					filters: {
 						company: doc.company,
-						docstatus: 1
-					}
-				}
+						docstatus: 1,
+					},
+				};
 			}
-		}
+		};
 	},
 
-	refresh: function(frm) {
-		frm.add_custom_button(__('Show Preview'), () => {
+	refresh: function (frm) {
+		frm.add_custom_button(__("Show Preview"), () => {
 			frm.call({
-				method: 'generate_preview',
+				method: "generate_preview",
 				doc: frm.doc,
 				freeze: true,
-				freeze_message: __('Generating Preview'),
-				callback: function(r) {
+				freeze_message: __("Generating Preview"),
+				callback: function (r) {
 					if (r && r.message) {
 						let content = r.message;
 						let opts = {
 							title: "Preview",
 							subtitle: "preview",
 							content: content,
-							print_settings: {orientation: "landscape"},
+							print_settings: { orientation: "landscape" },
 							columns: [],
 							data: [],
-						}
+						};
 						frappe.render_grid(opts);
 					}
-				}
+				},
 			});
 		});
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger.js b/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger.js
index 6801408..b9621c0 100644
--- a/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger.js
+++ b/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger.js
@@ -1,53 +1,53 @@
 // Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Repost Payment Ledger', {
-	setup: function(frm) {
+frappe.ui.form.on("Repost Payment Ledger", {
+	setup: function (frm) {
 		frm.set_query("voucher_type", () => {
 			return {
 				filters: {
-					name: ['in', ['Purchase Invoice', 'Sales Invoice', 'Payment Entry', 'Journal Entry']]
-				}
+					name: ["in", ["Purchase Invoice", "Sales Invoice", "Payment Entry", "Journal Entry"]],
+				},
 			};
 		});
 
-		frm.fields_dict['repost_vouchers'].grid.get_field('voucher_type').get_query = function(doc) {
+		frm.fields_dict["repost_vouchers"].grid.get_field("voucher_type").get_query = function (doc) {
 			return {
 				filters: {
-					name: ['in', ['Purchase Invoice', 'Sales Invoice', 'Payment Entry', 'Journal Entry']]
-				}
-			}
-		}
+					name: ["in", ["Purchase Invoice", "Sales Invoice", "Payment Entry", "Journal Entry"]],
+				},
+			};
+		};
 
-		frm.fields_dict['repost_vouchers'].grid.get_field('voucher_no').get_query = function(doc) {
+		frm.fields_dict["repost_vouchers"].grid.get_field("voucher_no").get_query = function (doc) {
 			if (doc.company) {
 				return {
 					filters: {
 						company: doc.company,
-						docstatus: 1
-					}
-				}
+						docstatus: 1,
+					},
+				};
 			}
-		}
-
+		};
 	},
-	refresh: function(frm) {
-
-		if (frm.doc.docstatus==1 && ['Queued', 'Failed'].find(x => x == frm.doc.repost_status)) {
-			frm.set_intro(__("Use 'Repost in background' button to trigger background job. Job can only be triggered when document is in Queued or Failed status."));
-			var btn_label = __("Repost in background")
+	refresh: function (frm) {
+		if (frm.doc.docstatus == 1 && ["Queued", "Failed"].find((x) => x == frm.doc.repost_status)) {
+			frm.set_intro(
+				__(
+					"Use 'Repost in background' button to trigger background job. Job can only be triggered when document is in Queued or Failed status."
+				)
+			);
+			var btn_label = __("Repost in background");
 
 			frm.add_custom_button(btn_label, () => {
 				frappe.call({
-					method: 'erpnext.accounts.doctype.repost_payment_ledger.repost_payment_ledger.execute_repost_payment_ledger',
+					method: "erpnext.accounts.doctype.repost_payment_ledger.repost_payment_ledger.execute_repost_payment_ledger",
 					args: {
 						docname: frm.doc.name,
-					}
+					},
 				});
-				frappe.msgprint(__('Reposting in the background.'));
+				frappe.msgprint(__("Reposting in the background."));
 			});
 		}
-
-	}
+	},
 });
-
diff --git a/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger_list.js b/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger_list.js
index e045184..76d17fc 100644
--- a/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger_list.js
+++ b/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger_list.js
@@ -1,12 +1,12 @@
 frappe.listview_settings["Repost Payment Ledger"] = {
 	add_fields: ["repost_status"],
-	get_indicator: function(doc) {
+	get_indicator: function (doc) {
 		var colors = {
-			'Queued': 'orange',
-			'Completed': 'green',
-			'Failed': 'red',
+			Queued: "orange",
+			Completed: "green",
+			Failed: "red",
 		};
 		let status = doc.repost_status;
-		return [__(status), colors[status], 'status,=,'+status];
+		return [__(status), colors[status], "status,=," + status];
 	},
 };
diff --git a/erpnext/accounts/doctype/sales_invoice/regional/italy.js b/erpnext/accounts/doctype/sales_invoice/regional/italy.js
index 2f305b9..a403b444 100644
--- a/erpnext/accounts/doctype/sales_invoice/regional/italy.js
+++ b/erpnext/accounts/doctype/sales_invoice/regional/italy.js
@@ -1,23 +1,23 @@
 frappe.ui.form.on("Sales Invoice", {
-    refresh: (frm) => {
-        if(frm.doc.docstatus == 1) {
-            frm.add_custom_button(__('Generate E-Invoice'), () => {
-                frm.call({
-                    method: "erpnext.regional.italy.utils.generate_single_invoice",
-                    args: {
-                        docname: frm.doc.name
-                    },
-                    callback: function(r) {
-                        frm.reload_doc();
-                        if(r.message) {
-                            open_url_post(frappe.request.url, {
-                                cmd: 'frappe.core.doctype.file.file.download_file',
-                                file_url: r.message
-                            });
-                        }
-                    }
-                });
-            });
-        }
-    }
-});
\ No newline at end of file
+	refresh: (frm) => {
+		if (frm.doc.docstatus == 1) {
+			frm.add_custom_button(__("Generate E-Invoice"), () => {
+				frm.call({
+					method: "erpnext.regional.italy.utils.generate_single_invoice",
+					args: {
+						docname: frm.doc.name,
+					},
+					callback: function (r) {
+						frm.reload_doc();
+						if (r.message) {
+							open_url_post(frappe.request.url, {
+								cmd: "frappe.core.doctype.file.file.download_file",
+								file_url: r.message,
+							});
+						}
+					},
+				});
+			});
+		}
+	},
+});
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index ef1f6bd..17101cd 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -8,7 +8,9 @@
 erpnext.accounts.pos.setup("Sales Invoice");
 erpnext.accounts.taxes.setup_tax_filters("Sales Taxes and Charges");
 erpnext.sales_common.setup_selling_controller();
-erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends erpnext.selling.SellingController {
+erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends (
+	erpnext.selling.SellingController
+) {
 	setup(doc) {
 		this.setup_posting_date_time_check();
 		super.setup(doc);
@@ -21,20 +23,31 @@
 		var me = this;
 		super.onload();
 
-		this.frm.ignore_doctypes_on_cancel_all = ['POS Invoice', 'Timesheet', 'POS Invoice Merge Log',
-			'POS Closing Entry', 'Journal Entry', 'Payment Entry', "Repost Payment Ledger", "Repost Accounting Ledger", "Unreconcile Payment", "Unreconcile Payment Entries", "Serial and Batch Bundle", "Bank Transaction",
+		this.frm.ignore_doctypes_on_cancel_all = [
+			"POS Invoice",
+			"Timesheet",
+			"POS Invoice Merge Log",
+			"POS Closing Entry",
+			"Journal Entry",
+			"Payment Entry",
+			"Repost Payment Ledger",
+			"Repost Accounting Ledger",
+			"Unreconcile Payment",
+			"Unreconcile Payment Entries",
+			"Serial and Batch Bundle",
+			"Bank Transaction",
 		];
 
-		if(!this.frm.doc.__islocal && !this.frm.doc.customer && this.frm.doc.debit_to) {
+		if (!this.frm.doc.__islocal && !this.frm.doc.customer && this.frm.doc.debit_to) {
 			// show debit_to in print format
 			this.frm.set_df_property("debit_to", "print_hide", 0);
 		}
 
-		erpnext.queries.setup_queries(this.frm, "Warehouse", function() {
+		erpnext.queries.setup_queries(this.frm, "Warehouse", function () {
 			return erpnext.queries.warehouse(me.frm.doc);
 		});
 
-		if(this.frm.doc.__islocal && this.frm.doc.is_pos) {
+		if (this.frm.doc.__islocal && this.frm.doc.is_pos) {
 			//Load pos profile data on the invoice if the default value of Is POS is 1
 
 			me.frm.script_manager.trigger("is_pos");
@@ -46,30 +59,36 @@
 	refresh(doc, dt, dn) {
 		const me = this;
 		super.refresh();
-		if(cur_frm.msgbox && cur_frm.msgbox.$wrapper.is(":visible")) {
+		if (cur_frm.msgbox && cur_frm.msgbox.$wrapper.is(":visible")) {
 			// hide new msgbox
 			cur_frm.msgbox.hide();
 		}
 
 		this.frm.toggle_reqd("due_date", !this.frm.doc.is_return);
 
-		if (this.frm.doc.repost_required && this.frm.doc.docstatus===1) {
-			this.frm.set_intro(__("Accounting entries for this invoice needs to be reposted. Please click on 'Repost' button to update."));
-			this.frm.add_custom_button(__('Repost Accounting Entries'),
-				() => {
+		if (this.frm.doc.repost_required && this.frm.doc.docstatus === 1) {
+			this.frm.set_intro(
+				__(
+					"Accounting entries for this invoice needs to be reposted. Please click on 'Repost' button to update."
+				)
+			);
+			this.frm
+				.add_custom_button(__("Repost Accounting Entries"), () => {
 					this.frm.call({
 						doc: this.frm.doc,
-						method: 'repost_accounting_entries',
+						method: "repost_accounting_entries",
 						freeze: true,
-						freeze_message: __('Reposting...'),
+						freeze_message: __("Reposting..."),
 						callback: (r) => {
 							if (!r.exc) {
-								frappe.msgprint(__('Accounting Entries are reposted'));
+								frappe.msgprint(__("Accounting Entries are reposted"));
 								me.frm.refresh();
 							}
-						}
+						},
 					});
-				}).removeClass('btn-default').addClass('btn-warning');
+				})
+				.removeClass("btn-default")
+				.addClass("btn-warning");
 		}
 
 		if (this.frm.doc.is_return) {
@@ -79,79 +98,89 @@
 		this.show_general_ledger();
 		erpnext.accounts.ledger_preview.show_accounting_ledger_preview(this.frm);
 
-		if(doc.update_stock){
+		if (doc.update_stock) {
 			this.show_stock_ledger();
 			erpnext.accounts.ledger_preview.show_stock_ledger_preview(this.frm);
 		}
 
-		if (doc.docstatus == 1 && doc.outstanding_amount!=0) {
-			this.frm.add_custom_button(
-				__('Payment'),
-				() => this.make_payment_entry(),
-				__('Create')
-			);
-			this.frm.page.set_inner_btn_group_as_primary(__('Create'));
+		if (doc.docstatus == 1 && doc.outstanding_amount != 0) {
+			this.frm.add_custom_button(__("Payment"), () => this.make_payment_entry(), __("Create"));
+			this.frm.page.set_inner_btn_group_as_primary(__("Create"));
 		}
 
-		if(doc.docstatus==1 && !doc.is_return) {
-
+		if (doc.docstatus == 1 && !doc.is_return) {
 			var is_delivered_by_supplier = false;
 
-			is_delivered_by_supplier = cur_frm.doc.items.some(function(item){
+			is_delivered_by_supplier = cur_frm.doc.items.some(function (item) {
 				return item.is_delivered_by_supplier ? true : false;
-			})
+			});
 
-			if(doc.outstanding_amount >= 0 || Math.abs(flt(doc.outstanding_amount)) < flt(doc.grand_total)) {
-				cur_frm.add_custom_button(__('Return / Credit Note'),
-					this.make_sales_return, __('Create'));
-				cur_frm.page.set_inner_btn_group_as_primary(__('Create'));
+			if (doc.outstanding_amount >= 0 || Math.abs(flt(doc.outstanding_amount)) < flt(doc.grand_total)) {
+				cur_frm.add_custom_button(__("Return / Credit Note"), this.make_sales_return, __("Create"));
+				cur_frm.page.set_inner_btn_group_as_primary(__("Create"));
 			}
 
-			if(cint(doc.update_stock)!=1) {
+			if (cint(doc.update_stock) != 1) {
 				// show Make Delivery Note button only if Sales Invoice is not created from Delivery Note
 				var from_delivery_note = false;
-				from_delivery_note = cur_frm.doc.items
-					.some(function(item) {
-						return item.delivery_note ? true : false;
-					});
+				from_delivery_note = cur_frm.doc.items.some(function (item) {
+					return item.delivery_note ? true : false;
+				});
 
-				if(!from_delivery_note && !is_delivered_by_supplier) {
-					cur_frm.add_custom_button(__('Delivery'),
-						cur_frm.cscript['Make Delivery Note'], __('Create'));
+				if (!from_delivery_note && !is_delivered_by_supplier) {
+					cur_frm.add_custom_button(
+						__("Delivery"),
+						cur_frm.cscript["Make Delivery Note"],
+						__("Create")
+					);
 				}
 			}
 
-			if (doc.outstanding_amount>0) {
-				cur_frm.add_custom_button(__('Payment Request'), function() {
-					me.make_payment_request();
-				}, __('Create'));
-
-				cur_frm.add_custom_button(__('Invoice Discounting'), function() {
-					cur_frm.events.create_invoice_discounting(cur_frm);
-				}, __('Create'));
-
-				const payment_is_overdue = doc.payment_schedule.map(
-					row => Date.parse(row.due_date) < Date.now()
-				).reduce(
-					(prev, current) => prev || current
+			if (doc.outstanding_amount > 0) {
+				cur_frm.add_custom_button(
+					__("Payment Request"),
+					function () {
+						me.make_payment_request();
+					},
+					__("Create")
 				);
 
+				cur_frm.add_custom_button(
+					__("Invoice Discounting"),
+					function () {
+						cur_frm.events.create_invoice_discounting(cur_frm);
+					},
+					__("Create")
+				);
+
+				const payment_is_overdue = doc.payment_schedule
+					.map((row) => Date.parse(row.due_date) < Date.now())
+					.reduce((prev, current) => prev || current);
+
 				if (payment_is_overdue) {
-					this.frm.add_custom_button(__('Dunning'), () => {
-						this.frm.events.create_dunning(this.frm);
-					}, __('Create'));
+					this.frm.add_custom_button(
+						__("Dunning"),
+						() => {
+							this.frm.events.create_dunning(this.frm);
+						},
+						__("Create")
+					);
 				}
 			}
 
 			if (doc.docstatus === 1) {
-				cur_frm.add_custom_button(__('Maintenance Schedule'), function () {
-					cur_frm.cscript.make_maintenance_schedule();
-				}, __('Create'));
+				cur_frm.add_custom_button(
+					__("Maintenance Schedule"),
+					function () {
+						cur_frm.cscript.make_maintenance_schedule();
+					},
+					__("Create")
+				);
 			}
 		}
 
 		// Show buttons only when pos view is active
-		if (cint(doc.docstatus==0) && cur_frm.page.current_view_name!=="pos" && !doc.is_return) {
+		if (cint(doc.docstatus == 0) && cur_frm.page.current_view_name !== "pos" && !doc.is_return) {
 			this.frm.cscript.sales_order_btn();
 			this.frm.cscript.delivery_note_btn();
 			this.frm.cscript.quotation_btn();
@@ -161,12 +190,18 @@
 		if (doc.docstatus == 1 && !doc.inter_company_invoice_reference) {
 			let internal = me.frm.doc.is_internal_customer;
 			if (internal) {
-				let button_label = (me.frm.doc.company === me.frm.doc.represents_company) ? "Internal Purchase Invoice" :
-					"Inter Company Purchase Invoice";
+				let button_label =
+					me.frm.doc.company === me.frm.doc.represents_company
+						? "Internal Purchase Invoice"
+						: "Inter Company Purchase Invoice";
 
-				me.frm.add_custom_button(button_label, function() {
-					me.make_inter_company_invoice();
-				}, __('Create'));
+				me.frm.add_custom_button(
+					button_label,
+					function () {
+						me.make_inter_company_invoice();
+					},
+					__("Create")
+				);
 			}
 		}
 
@@ -176,40 +211,45 @@
 	make_maintenance_schedule() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_maintenance_schedule",
-			frm: cur_frm
-		})
+			frm: cur_frm,
+		});
 	}
 
 	on_submit(doc, dt, dn) {
 		var me = this;
 
 		super.on_submit();
-		if (frappe.get_route()[0] != 'Form') {
-			return
+		if (frappe.get_route()[0] != "Form") {
+			return;
 		}
 
 		doc.items.forEach((row) => {
-			if(row.delivery_note) frappe.model.clear_doc("Delivery Note", row.delivery_note)
+			if (row.delivery_note) frappe.model.clear_doc("Delivery Note", row.delivery_note);
 		});
 	}
 
 	set_default_print_format() {
 		// set default print format to POS type or Credit Note
-		if(cur_frm.doc.is_pos) {
-			if(cur_frm.pos_print_format) {
+		if (cur_frm.doc.is_pos) {
+			if (cur_frm.pos_print_format) {
 				cur_frm.meta._default_print_format = cur_frm.meta.default_print_format;
 				cur_frm.meta.default_print_format = cur_frm.pos_print_format;
 			}
-		} else if(cur_frm.doc.is_return && !cur_frm.meta.default_print_format) {
-			if(cur_frm.return_print_format) {
+		} else if (cur_frm.doc.is_return && !cur_frm.meta.default_print_format) {
+			if (cur_frm.return_print_format) {
 				cur_frm.meta._default_print_format = cur_frm.meta.default_print_format;
 				cur_frm.meta.default_print_format = cur_frm.return_print_format;
 			}
 		} else {
-			if(cur_frm.meta._default_print_format) {
+			if (cur_frm.meta._default_print_format) {
 				cur_frm.meta.default_print_format = cur_frm.meta._default_print_format;
 				cur_frm.meta._default_print_format = null;
-			} else if(in_list([cur_frm.pos_print_format, cur_frm.return_print_format], cur_frm.meta.default_print_format)) {
+			} else if (
+				in_list(
+					[cur_frm.pos_print_format, cur_frm.return_print_format],
+					cur_frm.meta.default_print_format
+				)
+			) {
 				cur_frm.meta.default_print_format = null;
 				cur_frm.meta._default_print_format = null;
 			}
@@ -218,8 +258,9 @@
 
 	sales_order_btn() {
 		var me = this;
-		this.$sales_order_btn = this.frm.add_custom_button(__('Sales Order'),
-			function() {
+		this.$sales_order_btn = this.frm.add_custom_button(
+			__("Sales Order"),
+			function () {
 				erpnext.utils.map_current_doc({
 					method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice",
 					source_doctype: "Sales Order",
@@ -231,99 +272,113 @@
 						docstatus: 1,
 						status: ["not in", ["Closed", "On Hold"]],
 						per_billed: ["<", 99.99],
-						company: me.frm.doc.company
-					}
-				})
-			}, __("Get Items From"));
+						company: me.frm.doc.company,
+					},
+				});
+			},
+			__("Get Items From")
+		);
 	}
 
 	quotation_btn() {
 		var me = this;
-		this.$quotation_btn = this.frm.add_custom_button(__('Quotation'),
-			function() {
+		this.$quotation_btn = this.frm.add_custom_button(
+			__("Quotation"),
+			function () {
 				erpnext.utils.map_current_doc({
 					method: "erpnext.selling.doctype.quotation.quotation.make_sales_invoice",
 					source_doctype: "Quotation",
 					target: me.frm,
-					setters: [{
-						fieldtype: 'Link',
-						label: __('Customer'),
-						options: 'Customer',
-						fieldname: 'party_name',
-						default: me.frm.doc.customer,
-					}],
+					setters: [
+						{
+							fieldtype: "Link",
+							label: __("Customer"),
+							options: "Customer",
+							fieldname: "party_name",
+							default: me.frm.doc.customer,
+						},
+					],
 					get_query_filters: {
 						docstatus: 1,
 						status: ["!=", "Lost"],
-						company: me.frm.doc.company
-					}
-				})
-			}, __("Get Items From"));
+						company: me.frm.doc.company,
+					},
+				});
+			},
+			__("Get Items From")
+		);
 	}
 
 	delivery_note_btn() {
 		var me = this;
-		this.$delivery_note_btn = this.frm.add_custom_button(__('Delivery Note'),
-			function() {
+		this.$delivery_note_btn = this.frm.add_custom_button(
+			__("Delivery Note"),
+			function () {
 				erpnext.utils.map_current_doc({
 					method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice",
 					source_doctype: "Delivery Note",
 					target: me.frm,
 					date_field: "posting_date",
 					setters: {
-						customer: me.frm.doc.customer || undefined
+						customer: me.frm.doc.customer || undefined,
 					},
-					get_query: function() {
+					get_query: function () {
 						var filters = {
 							docstatus: 1,
 							company: me.frm.doc.company,
-							is_return: 0
+							is_return: 0,
 						};
-						if(me.frm.doc.customer) filters["customer"] = me.frm.doc.customer;
+						if (me.frm.doc.customer) filters["customer"] = me.frm.doc.customer;
 						return {
 							query: "erpnext.controllers.queries.get_delivery_notes_to_be_billed",
-							filters: filters
+							filters: filters,
 						};
-					}
+					},
 				});
-			}, __("Get Items From"));
+			},
+			__("Get Items From")
+		);
 	}
 
 	tc_name() {
 		this.get_terms();
 	}
 	customer() {
-		if (this.frm.doc.is_pos){
+		if (this.frm.doc.is_pos) {
 			var pos_profile = this.frm.doc.pos_profile;
 		}
 		var me = this;
-		if(this.frm.updating_party_details) return;
+		if (this.frm.updating_party_details) return;
 
 		if (this.frm.doc.__onload && this.frm.doc.__onload.load_after_mapping) return;
 
-		erpnext.utils.get_party_details(this.frm,
-			"erpnext.accounts.party.get_party_details", {
+		erpnext.utils.get_party_details(
+			this.frm,
+			"erpnext.accounts.party.get_party_details",
+			{
 				posting_date: this.frm.doc.posting_date,
 				party: this.frm.doc.customer,
 				party_type: "Customer",
 				account: this.frm.doc.debit_to,
 				price_list: this.frm.doc.selling_price_list,
-				pos_profile: pos_profile
-			}, function() {
+				pos_profile: pos_profile,
+			},
+			function () {
 				me.apply_pricing_rule();
-			});
+			}
+		);
 
-		if(this.frm.doc.customer) {
+		if (this.frm.doc.customer) {
 			frappe.call({
-				"method": "erpnext.accounts.doctype.sales_invoice.sales_invoice.get_loyalty_programs",
-				"args": {
-					"customer": this.frm.doc.customer
+				method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.get_loyalty_programs",
+				args: {
+					customer: this.frm.doc.customer,
 				},
-				callback: function(r) {
-					if(r.message && r.message.length > 1) {
+				callback: function (r) {
+					if (r.message && r.message.length > 1) {
 						select_loyalty_program(me.frm, r.message);
 					}
-				}
+				},
 			});
 		}
 	}
@@ -332,13 +387,13 @@
 		let me = this;
 		frappe.model.open_mapped_doc({
 			method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_inter_company_purchase_invoice",
-			frm: me.frm
+			frm: me.frm,
 		});
 	}
 
 	debit_to() {
 		var me = this;
-		if(this.frm.doc.debit_to) {
+		if (this.frm.doc.debit_to) {
 			me.frm.call({
 				method: "frappe.client.get_value",
 				args: {
@@ -346,12 +401,12 @@
 					fieldname: "account_currency",
 					filters: { name: me.frm.doc.debit_to },
 				},
-				callback: function(r, rt) {
-					if(r.message) {
+				callback: function (r, rt) {
+					if (r.message) {
 						me.frm.set_value("party_account_currency", r.message.account_currency);
 						me.set_dynamic_labels();
 					}
-				}
+				},
 			});
 		}
 	}
@@ -365,8 +420,12 @@
 		if (cint(this.frm.doc.write_off_outstanding_amount_automatically)) {
 			frappe.model.round_floats_in(this.frm.doc, ["grand_total", "paid_amount"]);
 			// this will make outstanding amount 0
-			this.frm.set_value("write_off_amount",
-				flt(this.frm.doc.grand_total - this.frm.doc.paid_amount - this.frm.doc.total_advance, precision("write_off_amount"))
+			this.frm.set_value(
+				"write_off_amount",
+				flt(
+					this.frm.doc.grand_total - this.frm.doc.paid_amount - this.frm.doc.total_advance,
+					precision("write_off_amount")
+				)
 			);
 		}
 
@@ -381,12 +440,16 @@
 
 	items_add(doc, cdt, cdn) {
 		var row = frappe.get_doc(cdt, cdn);
-		this.frm.script_manager.copy_from_first_row("items", row, ["income_account", "discount_account", "cost_center"]);
+		this.frm.script_manager.copy_from_first_row("items", row, [
+			"income_account",
+			"discount_account",
+			"cost_center",
+		]);
 	}
 
 	set_dynamic_labels() {
 		super.set_dynamic_labels();
-		this.frm.events.hide_fields(this.frm)
+		this.frm.events.hide_fields(this.frm);
 	}
 
 	items_on_form_rendered() {
@@ -400,39 +463,39 @@
 	make_sales_return() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_sales_return",
-			frm: cur_frm
-		})
+			frm: cur_frm,
+		});
 	}
 
 	asset(frm, cdt, cdn) {
 		var row = locals[cdt][cdn];
-		if(row.asset) {
+		if (row.asset) {
 			frappe.call({
 				method: erpnext.assets.doctype.asset.depreciation.get_disposal_account_and_cost_center,
 				args: {
-					"company": frm.doc.company
+					company: frm.doc.company,
 				},
-				callback: function(r, rt) {
+				callback: function (r, rt) {
 					frappe.model.set_value(cdt, cdn, "income_account", r.message[0]);
 					frappe.model.set_value(cdt, cdn, "cost_center", r.message[1]);
-				}
-			})
+				},
+			});
 		}
 	}
 
-	is_pos(frm){
+	is_pos(frm) {
 		this.set_pos_data();
 	}
 
 	pos_profile() {
-		this.frm.doc.taxes = []
+		this.frm.doc.taxes = [];
 		this.set_pos_data();
 	}
 
 	set_pos_data() {
-		if(this.frm.doc.is_pos) {
+		if (this.frm.doc.is_pos) {
 			this.frm.set_value("allocate_advances_automatically", 0);
-			if(!this.frm.doc.company) {
+			if (!this.frm.doc.company) {
 				this.frm.set_value("is_pos", 0);
 				frappe.msgprint(__("Please specify Company to proceed"));
 			} else {
@@ -440,13 +503,13 @@
 				return this.frm.call({
 					doc: me.frm.doc,
 					method: "set_missing_values",
-					callback: function(r) {
-						if(!r.exc) {
-							if(r.message && r.message.print_format) {
+					callback: function (r) {
+						if (!r.exc) {
+							if (r.message && r.message.print_format) {
 								me.frm.pos_print_format = r.message.print_format;
 							}
 							me.frm.trigger("update_stock");
-							if(me.frm.doc.taxes_and_charges) {
+							if (me.frm.doc.taxes_and_charges) {
 								me.frm.script_manager.trigger("taxes_and_charges");
 							}
 
@@ -454,21 +517,20 @@
 							me.set_dynamic_labels();
 							me.calculate_taxes_and_totals();
 						}
-					}
+					},
 				});
 			}
-		}
-		else this.frm.trigger("refresh");
+		} else this.frm.trigger("refresh");
 	}
 
-	amount(){
-		this.write_off_outstanding_amount_automatically()
+	amount() {
+		this.write_off_outstanding_amount_automatically();
 	}
 
-	change_amount(){
-		if(this.frm.doc.paid_amount > this.frm.doc.grand_total){
+	change_amount() {
+		if (this.frm.doc.paid_amount > this.frm.doc.grand_total) {
 			this.calculate_write_off_amount();
-		}else {
+		} else {
 			this.frm.set_value("change_amount", 0.0);
 			this.frm.set_value("base_change_amount", 0.0);
 		}
@@ -476,7 +538,7 @@
 		this.frm.refresh_fields();
 	}
 
-	loyalty_amount(){
+	loyalty_amount() {
 		this.calculate_outstanding_amount();
 		this.frm.refresh_field("outstanding_amount");
 		this.frm.refresh_field("paid_amount");
@@ -488,16 +550,24 @@
 		super.currency();
 		if (this.frm.doc.timesheets) {
 			this.frm.doc.timesheets.forEach((d) => {
-				let row = frappe.get_doc(d.doctype, d.name)
-				set_timesheet_detail_rate(row.doctype, row.name, me.frm.doc.currency, row.timesheet_detail)
+				let row = frappe.get_doc(d.doctype, d.name);
+				set_timesheet_detail_rate(row.doctype, row.name, me.frm.doc.currency, row.timesheet_detail);
 			});
 			this.frm.trigger("calculate_timesheet_totals");
 		}
 	}
 
 	is_cash_or_non_trade_discount() {
-		this.frm.set_df_property("additional_discount_account", "hidden", 1 - this.frm.doc.is_cash_or_non_trade_discount);
-		this.frm.set_df_property("additional_discount_account", "reqd", this.frm.doc.is_cash_or_non_trade_discount);
+		this.frm.set_df_property(
+			"additional_discount_account",
+			"hidden",
+			1 - this.frm.doc.is_cash_or_non_trade_discount
+		);
+		this.frm.set_df_property(
+			"additional_discount_account",
+			"reqd",
+			this.frm.doc.is_cash_or_non_trade_discount
+		);
 
 		if (!this.frm.doc.is_cash_or_non_trade_discount) {
 			this.frm.set_value("additional_discount_account", "");
@@ -508,337 +578,349 @@
 };
 
 // for backward compatibility: combine new and previous states
-extend_cscript(cur_frm.cscript, new erpnext.accounts.SalesInvoiceController({frm: cur_frm}));
+extend_cscript(cur_frm.cscript, new erpnext.accounts.SalesInvoiceController({ frm: cur_frm }));
 
-cur_frm.cscript['Make Delivery Note'] = function() {
+cur_frm.cscript["Make Delivery Note"] = function () {
 	frappe.model.open_mapped_doc({
 		method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_delivery_note",
-		frm: cur_frm
-	})
-}
+		frm: cur_frm,
+	});
+};
 
-cur_frm.fields_dict.cash_bank_account.get_query = function(doc) {
+cur_frm.fields_dict.cash_bank_account.get_query = function (doc) {
 	return {
 		filters: [
 			["Account", "account_type", "in", ["Cash", "Bank"]],
 			["Account", "root_type", "=", "Asset"],
-			["Account", "is_group", "=",0],
-			["Account", "company", "=", doc.company]
-		]
-	}
-}
+			["Account", "is_group", "=", 0],
+			["Account", "company", "=", doc.company],
+		],
+	};
+};
 
-cur_frm.fields_dict.write_off_account.get_query = function(doc) {
-	return{
-		filters:{
-			'report_type': 'Profit and Loss',
-			'is_group': 0,
-			'company': doc.company
-		}
-	}
-}
+cur_frm.fields_dict.write_off_account.get_query = function (doc) {
+	return {
+		filters: {
+			report_type: "Profit and Loss",
+			is_group: 0,
+			company: doc.company,
+		},
+	};
+};
 
 // Write off cost center
 //-----------------------
-cur_frm.fields_dict.write_off_cost_center.get_query = function(doc) {
-	return{
-		filters:{
-			'is_group': 0,
-			'company': doc.company
-		}
-	}
-}
+cur_frm.fields_dict.write_off_cost_center.get_query = function (doc) {
+	return {
+		filters: {
+			is_group: 0,
+			company: doc.company,
+		},
+	};
+};
 
 // Cost Center in Details Table
 // -----------------------------
-cur_frm.fields_dict["items"].grid.get_field("cost_center").get_query = function(doc) {
+cur_frm.fields_dict["items"].grid.get_field("cost_center").get_query = function (doc) {
 	return {
 		filters: {
-			'company': doc.company,
-			"is_group": 0
-		}
-	}
-}
+			company: doc.company,
+			is_group: 0,
+		},
+	};
+};
 
-cur_frm.cscript.income_account = function(doc, cdt, cdn) {
+cur_frm.cscript.income_account = function (doc, cdt, cdn) {
 	erpnext.utils.copy_value_in_all_rows(doc, cdt, cdn, "items", "income_account");
-}
+};
 
-cur_frm.cscript.expense_account = function(doc, cdt, cdn) {
+cur_frm.cscript.expense_account = function (doc, cdt, cdn) {
 	erpnext.utils.copy_value_in_all_rows(doc, cdt, cdn, "items", "expense_account");
-}
+};
 
-cur_frm.cscript.cost_center = function(doc, cdt, cdn) {
+cur_frm.cscript.cost_center = function (doc, cdt, cdn) {
 	erpnext.utils.copy_value_in_all_rows(doc, cdt, cdn, "items", "cost_center");
-}
+};
 
-cur_frm.set_query("debit_to", function(doc) {
+cur_frm.set_query("debit_to", function (doc) {
 	return {
 		filters: {
-			'account_type': 'Receivable',
-			'is_group': 0,
-			'company': doc.company
-		}
-	}
+			account_type: "Receivable",
+			is_group: 0,
+			company: doc.company,
+		},
+	};
 });
 
-cur_frm.set_query("asset", "items", function(doc, cdt, cdn) {
+cur_frm.set_query("asset", "items", function (doc, cdt, cdn) {
 	var d = locals[cdt][cdn];
 	return {
 		filters: [
 			["Asset", "item_code", "=", d.item_code],
 			["Asset", "docstatus", "=", 1],
 			["Asset", "status", "in", ["Submitted", "Partially Depreciated", "Fully Depreciated"]],
-			["Asset", "company", "=", doc.company]
-		]
-	}
+			["Asset", "company", "=", doc.company],
+		],
+	};
 });
 
-frappe.ui.form.on('Sales Invoice', {
-	setup: function(frm){
-		frm.add_fetch('customer', 'tax_id', 'tax_id');
-		frm.add_fetch('payment_term', 'invoice_portion', 'invoice_portion');
-		frm.add_fetch('payment_term', 'description', 'description');
+frappe.ui.form.on("Sales Invoice", {
+	setup: function (frm) {
+		frm.add_fetch("customer", "tax_id", "tax_id");
+		frm.add_fetch("payment_term", "invoice_portion", "invoice_portion");
+		frm.add_fetch("payment_term", "description", "description");
 
-		frm.set_df_property('packed_items', 'cannot_add_rows', true);
-		frm.set_df_property('packed_items', 'cannot_delete_rows', true);
+		frm.set_df_property("packed_items", "cannot_add_rows", true);
+		frm.set_df_property("packed_items", "cannot_delete_rows", true);
 
-		frm.set_query("account_for_change_amount", function() {
+		frm.set_query("account_for_change_amount", function () {
 			return {
 				filters: {
-					account_type: ['in', ["Cash", "Bank"]],
+					account_type: ["in", ["Cash", "Bank"]],
 					company: frm.doc.company,
-					is_group: 0
-				}
+					is_group: 0,
+				},
 			};
 		});
 
-		frm.set_query("unrealized_profit_loss_account", function() {
+		frm.set_query("unrealized_profit_loss_account", function () {
 			return {
 				filters: {
 					company: frm.doc.company,
 					is_group: 0,
 					root_type: "Liability",
-				}
+				},
 			};
 		});
 
-		frm.set_query("adjustment_against", function() {
+		frm.set_query("adjustment_against", function () {
 			return {
 				filters: {
 					company: frm.doc.company,
 					customer: frm.doc.customer,
-					docstatus: 1
-				}
+					docstatus: 1,
+				},
 			};
 		});
 
-		frm.set_query("additional_discount_account", function() {
+		frm.set_query("additional_discount_account", function () {
 			return {
 				filters: {
 					company: frm.doc.company,
 					is_group: 0,
 					report_type: "Profit and Loss",
-				}
+				},
 			};
 		});
 
-		frm.set_query("income_account", "items", function() {
-			return{
+		frm.set_query("income_account", "items", function () {
+			return {
 				query: "erpnext.controllers.queries.get_income_account",
 				filters: {
-					'company': frm.doc.company,
-					"disabled": 0
-				}
-			}
-		});
-
-		frm.custom_make_buttons = {
-			'Delivery Note': 'Delivery',
-			'Sales Invoice': 'Return / Credit Note',
-			'Payment Request': 'Payment Request',
-			'Payment Entry': 'Payment'
-		},
-		frm.fields_dict["timesheets"].grid.get_field("time_sheet").get_query = function(doc, cdt, cdn){
-			return{
-				query: "erpnext.projects.doctype.timesheet.timesheet.get_timesheet",
-				filters: {'project': doc.project}
-			}
-		}
-
-		// discount account
-		frm.fields_dict['items'].grid.get_field('discount_account').get_query = function(doc) {
-			return {
-				filters: {
-					'report_type': 'Profit and Loss',
-					'company': doc.company,
-					"is_group": 0
-				}
-			}
-		}
-
-		frm.fields_dict['items'].grid.get_field('deferred_revenue_account').get_query = function(doc) {
-			return {
-				filters: {
-					'root_type': 'Liability',
-					'company': doc.company,
-					"is_group": 0
-				}
-			}
-		}
-
-		frm.set_query('company_address', function(doc) {
-			if(!doc.company) {
-				frappe.throw(__('Please set Company'));
-			}
-
-			return {
-				query: 'frappe.contacts.doctype.address.address.address_query',
-				filters: {
-					link_doctype: 'Company',
-					link_name: doc.company
-				}
+					company: frm.doc.company,
+					disabled: 0,
+				},
 			};
 		});
 
-		frm.set_query('pos_profile', function(doc) {
-			if(!doc.company) {
-				frappe.throw(__('Please set Company'));
+		(frm.custom_make_buttons = {
+			"Delivery Note": "Delivery",
+			"Sales Invoice": "Return / Credit Note",
+			"Payment Request": "Payment Request",
+			"Payment Entry": "Payment",
+		}),
+			(frm.fields_dict["timesheets"].grid.get_field("time_sheet").get_query = function (doc, cdt, cdn) {
+				return {
+					query: "erpnext.projects.doctype.timesheet.timesheet.get_timesheet",
+					filters: { project: doc.project },
+				};
+			});
+
+		// discount account
+		frm.fields_dict["items"].grid.get_field("discount_account").get_query = function (doc) {
+			return {
+				filters: {
+					report_type: "Profit and Loss",
+					company: doc.company,
+					is_group: 0,
+				},
+			};
+		};
+
+		frm.fields_dict["items"].grid.get_field("deferred_revenue_account").get_query = function (doc) {
+			return {
+				filters: {
+					root_type: "Liability",
+					company: doc.company,
+					is_group: 0,
+				},
+			};
+		};
+
+		frm.set_query("company_address", function (doc) {
+			if (!doc.company) {
+				frappe.throw(__("Please set Company"));
 			}
 
 			return {
-				query: 'erpnext.accounts.doctype.pos_profile.pos_profile.pos_profile_query',
+				query: "frappe.contacts.doctype.address.address.address_query",
 				filters: {
-					company: doc.company
-				}
+					link_doctype: "Company",
+					link_name: doc.company,
+				},
+			};
+		});
+
+		frm.set_query("pos_profile", function (doc) {
+			if (!doc.company) {
+				frappe.throw(__("Please set Company"));
+			}
+
+			return {
+				query: "erpnext.accounts.doctype.pos_profile.pos_profile.pos_profile_query",
+				filters: {
+					company: doc.company,
+				},
 			};
 		});
 
 		// set get_query for loyalty redemption account
-		frm.fields_dict["loyalty_redemption_account"].get_query = function() {
+		frm.fields_dict["loyalty_redemption_account"].get_query = function () {
 			return {
-				filters:{
-					"company": frm.doc.company,
-					"is_group": 0
-				}
-			}
+				filters: {
+					company: frm.doc.company,
+					is_group: 0,
+				},
+			};
 		};
 
 		// set get_query for loyalty redemption cost center
-		frm.fields_dict["loyalty_redemption_cost_center"].get_query = function() {
+		frm.fields_dict["loyalty_redemption_cost_center"].get_query = function () {
 			return {
-				filters:{
-					"company": frm.doc.company,
-					"is_group": 0
-				}
-			}
+				filters: {
+					company: frm.doc.company,
+					is_group: 0,
+				},
+			};
 		};
 	},
 	// When multiple companies are set up. in case company name is changed set default company address
-	company: function(frm){
+	company: function (frm) {
 		if (frm.doc.company) {
 			frappe.call({
 				method: "erpnext.setup.doctype.company.company.get_default_company_address",
-				args: {name:frm.doc.company, existing_address: frm.doc.company_address || ""},
+				args: { name: frm.doc.company, existing_address: frm.doc.company_address || "" },
 				debounce: 2000,
-				callback: function(r){
-					if (r.message){
-						frm.set_value("company_address",r.message)
+				callback: function (r) {
+					if (r.message) {
+						frm.set_value("company_address", r.message);
+					} else {
+						frm.set_value("company_address", "");
 					}
-					else {
-						frm.set_value("company_address","")
-					}
-				}
-			})
+				},
+			});
 		}
 	},
 
-	onload: function(frm) {
+	onload: function (frm) {
 		frm.redemption_conversion_factor = null;
 	},
 
-	update_stock: function(frm, dt, dn) {
+	update_stock: function (frm, dt, dn) {
 		frm.events.hide_fields(frm);
-		frm.trigger('reset_posting_time');
+		frm.trigger("reset_posting_time");
 	},
 
-	redeem_loyalty_points: function(frm) {
+	redeem_loyalty_points: function (frm) {
 		frm.events.get_loyalty_details(frm);
 	},
 
-	loyalty_points: function(frm) {
+	loyalty_points: function (frm) {
 		if (frm.redemption_conversion_factor) {
 			frm.events.set_loyalty_points(frm);
 		} else {
 			frappe.call({
 				method: "erpnext.accounts.doctype.loyalty_program.loyalty_program.get_redeemption_factor",
 				args: {
-					"loyalty_program": frm.doc.loyalty_program
+					loyalty_program: frm.doc.loyalty_program,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (r) {
 						frm.redemption_conversion_factor = r.message;
 						frm.events.set_loyalty_points(frm);
 					}
-				}
+				},
 			});
 		}
 	},
 
-	hide_fields: function(frm) {
+	hide_fields: function (frm) {
 		let doc = frm.doc;
-		var parent_fields = ['project', 'due_date', 'is_opening', 'source', 'total_advance', 'get_advances',
-		'advances', 'from_date', 'to_date'];
+		var parent_fields = [
+			"project",
+			"due_date",
+			"is_opening",
+			"source",
+			"total_advance",
+			"get_advances",
+			"advances",
+			"from_date",
+			"to_date",
+		];
 
-		if(cint(doc.is_pos) == 1) {
+		if (cint(doc.is_pos) == 1) {
 			hide_field(parent_fields);
 		} else {
 			for (var i in parent_fields) {
 				var docfield = frappe.meta.docfield_map[doc.doctype][parent_fields[i]];
-				if(!docfield.hidden) unhide_field(parent_fields[i]);
+				if (!docfield.hidden) unhide_field(parent_fields[i]);
 			}
 		}
 
 		frm.refresh_fields();
 	},
 
-	get_loyalty_details: function(frm) {
+	get_loyalty_details: function (frm) {
 		if (frm.doc.customer && frm.doc.redeem_loyalty_points) {
 			frappe.call({
 				method: "erpnext.accounts.doctype.loyalty_program.loyalty_program.get_loyalty_program_details",
 				args: {
-					"customer": frm.doc.customer,
-					"loyalty_program": frm.doc.loyalty_program,
-					"expiry_date": frm.doc.posting_date,
-					"company": frm.doc.company
+					customer: frm.doc.customer,
+					loyalty_program: frm.doc.loyalty_program,
+					expiry_date: frm.doc.posting_date,
+					company: frm.doc.company,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (r) {
 						frm.set_value("loyalty_redemption_account", r.message.expense_account);
 						frm.set_value("loyalty_redemption_cost_center", r.message.cost_center);
 						frm.redemption_conversion_factor = r.message.conversion_factor;
 					}
-				}
+				},
 			});
 		}
 	},
 
-	set_loyalty_points: function(frm) {
+	set_loyalty_points: function (frm) {
 		if (frm.redemption_conversion_factor) {
-			let loyalty_amount = flt(frm.redemption_conversion_factor*flt(frm.doc.loyalty_points), precision("loyalty_amount"));
-			var remaining_amount = flt(frm.doc.grand_total) - flt(frm.doc.total_advance) - flt(frm.doc.write_off_amount);
-			if (frm.doc.grand_total && (remaining_amount < loyalty_amount)) {
-				let redeemable_points = parseInt(remaining_amount/frm.redemption_conversion_factor);
-				frappe.throw(__("You can only redeem max {0} points in this order.",[redeemable_points]));
+			let loyalty_amount = flt(
+				frm.redemption_conversion_factor * flt(frm.doc.loyalty_points),
+				precision("loyalty_amount")
+			);
+			var remaining_amount =
+				flt(frm.doc.grand_total) - flt(frm.doc.total_advance) - flt(frm.doc.write_off_amount);
+			if (frm.doc.grand_total && remaining_amount < loyalty_amount) {
+				let redeemable_points = parseInt(remaining_amount / frm.redemption_conversion_factor);
+				frappe.throw(__("You can only redeem max {0} points in this order.", [redeemable_points]));
 			}
 			frm.set_value("loyalty_amount", loyalty_amount);
 		}
 	},
 
-	project: function(frm) {
+	project: function (frm) {
 		if (frm.doc.project) {
 			frm.events.add_timesheet_data(frm, {
-				project: frm.doc.project
+				project: frm.doc.project,
 			});
 		}
 	},
@@ -858,26 +940,30 @@
 	},
 
 	async get_timesheet_data(frm, kwargs) {
-		return frappe.call({
-			method: "erpnext.projects.doctype.timesheet.timesheet.get_projectwise_timesheet_data",
-			args: kwargs
-		}).then(r => {
-			if (!r.exc && r.message.length > 0) {
-				return r.message
-			} else {
-				return []
-			}
-		});
+		return frappe
+			.call({
+				method: "erpnext.projects.doctype.timesheet.timesheet.get_projectwise_timesheet_data",
+				args: kwargs,
+			})
+			.then((r) => {
+				if (!r.exc && r.message.length > 0) {
+					return r.message;
+				} else {
+					return [];
+				}
+			});
 	},
 
-	set_timesheet_data: function(frm, timesheets) {
-		frm.clear_table("timesheets")
+	set_timesheet_data: function (frm, timesheets) {
+		frm.clear_table("timesheets");
 		timesheets.forEach(async (timesheet) => {
 			if (frm.doc.currency != timesheet.currency) {
 				const exchange_rate = await frm.events.get_exchange_rate(
-					frm, timesheet.currency, frm.doc.currency
-				)
-				frm.events.append_time_log(frm, timesheet, exchange_rate)
+					frm,
+					timesheet.currency,
+					frm.doc.currency
+				);
+				frm.events.append_time_log(frm, timesheet, exchange_rate);
 			} else {
 				frm.events.append_time_log(frm, timesheet, 1.0);
 			}
@@ -888,9 +974,9 @@
 
 	async get_exchange_rate(frm, from_currency, to_currency) {
 		if (
-			frm.exchange_rates
-			&& frm.exchange_rates[from_currency]
-			&& frm.exchange_rates[from_currency][to_currency]
+			frm.exchange_rates &&
+			frm.exchange_rates[from_currency] &&
+			frm.exchange_rates[from_currency][to_currency]
 		) {
 			return frm.exchange_rates[from_currency][to_currency];
 		}
@@ -899,20 +985,20 @@
 			method: "erpnext.setup.utils.get_exchange_rate",
 			args: {
 				from_currency,
-				to_currency
+				to_currency,
 			},
-			callback: function(r) {
+			callback: function (r) {
 				if (r.message) {
 					// cache exchange rates
 					frm.exchange_rates = frm.exchange_rates || {};
 					frm.exchange_rates[from_currency] = frm.exchange_rates[from_currency] || {};
 					frm.exchange_rates[from_currency][to_currency] = r.message;
 				}
-			}
+			},
 		});
 	},
 
-	append_time_log: function(frm, time_log, exchange_rate) {
+	append_time_log: function (frm, time_log, exchange_rate) {
 		const row = frm.add_child("timesheets");
 		row.activity_type = time_log.activity_type;
 		row.description = time_log.description;
@@ -925,114 +1011,118 @@
 		row.project_name = time_log.project_name;
 	},
 
-	calculate_timesheet_totals: function(frm) {
-		frm.set_value("total_billing_amount",
-			frm.doc.timesheets.reduce((a, b) => a + (b["billing_amount"] || 0.0), 0.0));
-		frm.set_value("total_billing_hours",
-			frm.doc.timesheets.reduce((a, b) => a + (b["billing_hours"] || 0.0), 0.0));
+	calculate_timesheet_totals: function (frm) {
+		frm.set_value(
+			"total_billing_amount",
+			frm.doc.timesheets.reduce((a, b) => a + (b["billing_amount"] || 0.0), 0.0)
+		);
+		frm.set_value(
+			"total_billing_hours",
+			frm.doc.timesheets.reduce((a, b) => a + (b["billing_hours"] || 0.0), 0.0)
+		);
 	},
 
-	refresh: function(frm) {
-		if (frm.doc.docstatus===0 && !frm.doc.is_return) {
-			frm.add_custom_button(__("Fetch Timesheet"), function() {
+	refresh: function (frm) {
+		if (frm.doc.docstatus === 0 && !frm.doc.is_return) {
+			frm.add_custom_button(__("Fetch Timesheet"), function () {
 				let d = new frappe.ui.Dialog({
 					title: __("Fetch Timesheet"),
 					fields: [
 						{
-							"label" : __("From"),
-							"fieldname": "from_time",
-							"fieldtype": "Date",
-							"reqd": 1,
+							label: __("From"),
+							fieldname: "from_time",
+							fieldtype: "Date",
+							reqd: 1,
 						},
 						{
 							fieldtype: "Column Break",
 							fieldname: "col_break_1",
 						},
 						{
-							"label" : __("To"),
-							"fieldname": "to_time",
-							"fieldtype": "Date",
-							"reqd": 1,
+							label: __("To"),
+							fieldname: "to_time",
+							fieldtype: "Date",
+							reqd: 1,
 						},
 						{
-							"label" : __("Project"),
-							"fieldname": "project",
-							"fieldtype": "Link",
-							"options": "Project",
-							"default": frm.doc.project
+							label: __("Project"),
+							fieldname: "project",
+							fieldtype: "Link",
+							options: "Project",
+							default: frm.doc.project,
 						},
 					],
-					primary_action: function() {
+					primary_action: function () {
 						const data = d.get_values();
 						frm.events.add_timesheet_data(frm, {
 							from_time: data.from_time,
 							to_time: data.to_time,
-							project: data.project
+							project: data.project,
 						});
 						d.hide();
 					},
-					primary_action_label: __("Get Timesheets")
+					primary_action_label: __("Get Timesheets"),
 				});
 				d.show();
 			});
 		}
 
 		if (frm.doc.is_debit_note) {
-			frm.set_df_property('return_against', 'label', __('Adjustment Against'));
+			frm.set_df_property("return_against", "label", __("Adjustment Against"));
 		}
 	},
 
-	create_invoice_discounting: function(frm) {
+	create_invoice_discounting: function (frm) {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.create_invoice_discounting",
-			frm: frm
+			frm: frm,
 		});
 	},
 
-	create_dunning: function(frm) {
+	create_dunning: function (frm) {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.create_dunning",
-			frm: frm
+			frm: frm,
 		});
-	}
+	},
 });
 
 frappe.ui.form.on("Sales Invoice Timesheet", {
 	timesheets_remove(frm) {
 		frm.trigger("calculate_timesheet_totals");
-	}
+	},
 });
 
-var set_timesheet_detail_rate = function(cdt, cdn, currency, timelog) {
+var set_timesheet_detail_rate = function (cdt, cdn, currency, timelog) {
 	frappe.call({
 		method: "erpnext.projects.doctype.timesheet.timesheet.get_timesheet_detail_rate",
 		args: {
 			timelog: timelog,
-			currency: currency
+			currency: currency,
 		},
-		callback: function(r) {
+		callback: function (r) {
 			if (!r.exc && r.message) {
-				frappe.model.set_value(cdt, cdn, 'billing_amount', r.message);
+				frappe.model.set_value(cdt, cdn, "billing_amount", r.message);
 			}
-		}
+		},
 	});
-}
+};
 
-var select_loyalty_program = function(frm, loyalty_programs) {
+var select_loyalty_program = function (frm, loyalty_programs) {
 	var dialog = new frappe.ui.Dialog({
 		title: __("Select Loyalty Program"),
 		fields: [
 			{
-				"label": __("Loyalty Program"),
-				"fieldname": "loyalty_program",
-				"fieldtype": "Select",
-				"options": loyalty_programs,
-				"default": loyalty_programs[0]
-			}
-		]
+				label: __("Loyalty Program"),
+				fieldname: "loyalty_program",
+				fieldtype: "Select",
+				options: loyalty_programs,
+				default: loyalty_programs[0],
+			},
+		],
 	});
 
-	dialog.set_primary_action(__("Set Loyalty Program"), function() {
+	dialog.set_primary_action(__("Set Loyalty Program"), function () {
 		dialog.hide();
 		return frappe.call({
 			method: "frappe.client.set_value",
@@ -1042,9 +1132,9 @@
 				fieldname: "loyalty_program",
 				value: dialog.get_value("loyalty_program"),
 			},
-			callback: function(r) { }
+			callback: function (r) {},
 		});
 	});
 
 	dialog.show();
-}
+};
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index 5e2187e..88b28ad 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -785,6 +785,7 @@
    "hide_days": 1,
    "hide_seconds": 1,
    "label": "Time Sheets",
+   "no_copy": 1,
    "options": "Sales Invoice Timesheet",
    "print_hide": 1
   },
@@ -2182,7 +2183,7 @@
    "link_fieldname": "consolidated_invoice"
   }
  ],
- "modified": "2024-01-02 17:25:46.027523",
+ "modified": "2024-03-01 09:21:54.201289",
  "modified_by": "Administrator",
  "module": "Accounts",
  "name": "Sales Invoice",
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index 3352e0d..e2cbf5e 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -8,6 +8,7 @@
 from frappe.model.mapper import get_mapped_doc
 from frappe.model.utils import get_fetch_values
 from frappe.utils import add_days, cint, cstr, flt, formatdate, get_link_to_form, getdate, nowdate
+from frappe.utils.data import comma_and
 
 import erpnext
 from erpnext.accounts.deferred_revenue import validate_service_stop_date
@@ -27,7 +28,6 @@
 from erpnext.accounts.utils import cancel_exchange_gain_loss_journal, get_account_currency
 from erpnext.assets.doctype.asset.depreciation import (
 	depreciate_asset,
-	get_disposal_account_and_cost_center,
 	get_gl_entries_on_asset_disposal,
 	get_gl_entries_on_asset_regain,
 	reset_depreciation_schedule,
@@ -39,7 +39,6 @@
 from erpnext.projects.doctype.timesheet.timesheet import get_projectwise_timesheet_data
 from erpnext.setup.doctype.company.company import update_company_current_month_sales
 from erpnext.stock.doctype.delivery_note.delivery_note import update_billed_amount_based_on_so
-from erpnext.stock.doctype.serial_no.serial_no import get_delivery_note_serial_no, get_serial_nos
 
 form_grid_templates = {"items": "templates/form_grid/item_grid.html"}
 
@@ -297,11 +296,13 @@
 		if cint(self.is_pos):
 			self.validate_pos()
 
+		self.validate_dropship_item()
+
 		if cint(self.update_stock):
-			self.validate_dropship_item()
 			self.validate_warehouse()
 			self.update_current_stock()
-			self.validate_delivery_note()
+
+		self.validate_delivery_note()
 
 		# validate service stop date to lie in between start and end date
 		validate_service_stop_date(self)
@@ -379,13 +380,7 @@
 
 	def validate_item_cost_centers(self):
 		for item in self.items:
-			cost_center_company = frappe.get_cached_value("Cost Center", item.cost_center, "company")
-			if cost_center_company != self.company:
-				frappe.throw(
-					_("Row #{0}: Cost Center {1} does not belong to company {2}").format(
-						frappe.bold(item.idx), frappe.bold(item.cost_center), frappe.bold(self.company)
-					)
-				)
+			item.validate_cost_center(self.company)
 
 	def validate_income_account(self):
 		for item in self.get("items"):
@@ -601,43 +596,48 @@
 		self.delete_auto_created_batches()
 
 	def update_status_updater_args(self):
-		if cint(self.update_stock):
-			self.status_updater.append(
-				{
-					"source_dt": "Sales Invoice Item",
-					"target_dt": "Sales Order Item",
-					"target_parent_dt": "Sales Order",
-					"target_parent_field": "per_delivered",
-					"target_field": "delivered_qty",
-					"target_ref_field": "qty",
-					"source_field": "qty",
-					"join_field": "so_detail",
-					"percent_join_field": "sales_order",
-					"status_field": "delivery_status",
-					"keyword": "Delivered",
-					"second_source_dt": "Delivery Note Item",
-					"second_source_field": "qty",
-					"second_join_field": "so_detail",
-					"overflow_type": "delivery",
-					"extra_cond": """ and exists(select name from `tabSales Invoice`
-					where name=`tabSales Invoice Item`.parent and update_stock = 1)""",
-				}
-			)
-			if cint(self.is_return):
-				self.status_updater.append(
-					{
-						"source_dt": "Sales Invoice Item",
-						"target_dt": "Sales Order Item",
-						"join_field": "so_detail",
-						"target_field": "returned_qty",
-						"target_parent_dt": "Sales Order",
-						"source_field": "-1 * qty",
-						"second_source_dt": "Delivery Note Item",
-						"second_source_field": "-1 * qty",
-						"second_join_field": "so_detail",
-						"extra_cond": """ and exists (select name from `tabSales Invoice` where name=`tabSales Invoice Item`.parent and update_stock=1 and is_return=1)""",
-					}
-				)
+		if not cint(self.update_stock):
+			return
+
+		self.status_updater.append(
+			{
+				"source_dt": "Sales Invoice Item",
+				"target_dt": "Sales Order Item",
+				"target_parent_dt": "Sales Order",
+				"target_parent_field": "per_delivered",
+				"target_field": "delivered_qty",
+				"target_ref_field": "qty",
+				"source_field": "qty",
+				"join_field": "so_detail",
+				"percent_join_field": "sales_order",
+				"status_field": "delivery_status",
+				"keyword": "Delivered",
+				"second_source_dt": "Delivery Note Item",
+				"second_source_field": "qty",
+				"second_join_field": "so_detail",
+				"overflow_type": "delivery",
+				"extra_cond": """ and exists(select name from `tabSales Invoice`
+				where name=`tabSales Invoice Item`.parent and update_stock = 1)""",
+			}
+		)
+
+		if not cint(self.is_return):
+			return
+
+		self.status_updater.append(
+			{
+				"source_dt": "Sales Invoice Item",
+				"target_dt": "Sales Order Item",
+				"join_field": "so_detail",
+				"target_field": "returned_qty",
+				"target_parent_dt": "Sales Order",
+				"source_field": "-1 * qty",
+				"second_source_dt": "Delivery Note Item",
+				"second_source_field": "-1 * qty",
+				"second_join_field": "so_detail",
+				"extra_cond": """ and exists (select name from `tabSales Invoice` where name=`tabSales Invoice Item`.parent and update_stock=1 and is_return=1)""",
+			}
+		)
 
 	def check_credit_limit(self):
 		from erpnext.selling.doctype.customer.customer import check_credit_limit
@@ -662,13 +662,8 @@
 	def unlink_sales_invoice_from_timesheets(self):
 		for row in self.timesheets:
 			timesheet = frappe.get_doc("Timesheet", row.time_sheet)
-			for time_log in timesheet.time_logs:
-				if time_log.sales_invoice == self.name:
-					time_log.sales_invoice = None
-			timesheet.calculate_total_amounts()
-			timesheet.calculate_percentage_billed()
+			timesheet.unlink_sales_invoice(self.name)
 			timesheet.flags.ignore_validate_update_after_submit = True
-			timesheet.set_status()
 			timesheet.db_update_all()
 
 	@frappe.whitelist()
@@ -1011,12 +1006,17 @@
 				frappe.throw(_("Warehouse required for stock Item {0}").format(d.item_code))
 
 	def validate_delivery_note(self):
-		for d in self.get("items"):
-			if d.delivery_note:
-				msgprint(
-					_("Stock cannot be updated against Delivery Note {0}").format(d.delivery_note),
-					raise_exception=1,
-				)
+		"""If items are linked with a delivery note, stock cannot be updated again."""
+		if not cint(self.update_stock):
+			return
+
+		notes = [item.delivery_note for item in self.items if item.delivery_note]
+		if notes:
+			frappe.throw(
+				_("Stock cannot be updated against the following Delivery Notes: {0}").format(
+					comma_and(notes)
+				),
+			)
 
 	def validate_write_off_account(self):
 		if flt(self.write_off_amount) and not self.write_off_account:
@@ -1030,29 +1030,23 @@
 			msgprint(_("Please enter Account for Change Amount"), raise_exception=1)
 
 	def validate_dropship_item(self):
-		for item in self.items:
-			if item.sales_order:
-				if frappe.db.get_value("Sales Order Item", item.so_detail, "delivered_by_supplier"):
-					frappe.throw(_("Could not update stock, invoice contains drop shipping item."))
+		"""If items are drop shipped, stock cannot be updated."""
+		if not cint(self.update_stock):
+			return
+
+		if any(item.delivered_by_supplier for item in self.items):
+			frappe.throw(
+				_(
+					"Stock cannot be updated because the invoice contains a drop shipping item. Please disable 'Update Stock' or remove the drop shipping item."
+				),
+			)
 
 	def update_current_stock(self):
-		for d in self.get("items"):
-			if d.item_code and d.warehouse:
-				bin = frappe.db.sql(
-					"select actual_qty from `tabBin` where item_code = %s and warehouse = %s",
-					(d.item_code, d.warehouse),
-					as_dict=1,
-				)
-				d.actual_qty = bin and flt(bin[0]["actual_qty"]) or 0
+		for item in self.items:
+			item.set_actual_qty()
 
-		for d in self.get("packed_items"):
-			bin = frappe.db.sql(
-				"select actual_qty, projected_qty from `tabBin` where item_code =	%s and warehouse = %s",
-				(d.item_code, d.warehouse),
-				as_dict=1,
-			)
-			d.actual_qty = bin and flt(bin[0]["actual_qty"]) or 0
-			d.projected_qty = bin and flt(bin[0]["projected_qty"]) or 0
+		for packed_item in self.packed_items:
+			packed_item.set_actual_and_projected_qty()
 
 	def update_packing_list(self):
 		if cint(self.update_stock) == 1:
@@ -1127,17 +1121,8 @@
 		return warehouse
 
 	def set_income_account_for_fixed_assets(self):
-		disposal_account = depreciation_cost_center = None
-		for d in self.get("items"):
-			if d.is_fixed_asset:
-				if not disposal_account:
-					disposal_account, depreciation_cost_center = get_disposal_account_and_cost_center(
-						self.company
-					)
-
-				d.income_account = disposal_account
-				if not d.cost_center:
-					d.cost_center = depreciation_cost_center
+		for item in self.items:
+			item.set_income_account_for_fixed_asset(self.company)
 
 	def check_prev_docstatus(self):
 		for d in self.get("items"):
@@ -1510,47 +1495,46 @@
 					)
 
 			if not skip_change_gl_entries:
-				self.make_gle_for_change_amount(gl_entries)
+				gl_entries.extend(self.get_gle_for_change_amount())
 
-	def make_gle_for_change_amount(self, gl_entries):
-		if self.change_amount:
-			if self.account_for_change_amount:
-				gl_entries.append(
-					self.get_gl_dict(
-						{
-							"account": self.debit_to,
-							"party_type": "Customer",
-							"party": self.customer,
-							"against": self.account_for_change_amount,
-							"debit": flt(self.base_change_amount),
-							"debit_in_account_currency": flt(self.base_change_amount)
-							if self.party_account_currency == self.company_currency
-							else flt(self.change_amount),
-							"against_voucher": self.return_against
-							if cint(self.is_return) and self.return_against
-							else self.name,
-							"against_voucher_type": self.doctype,
-							"cost_center": self.cost_center,
-							"project": self.project,
-						},
-						self.party_account_currency,
-						item=self,
-					)
-				)
+	def get_gle_for_change_amount(self) -> list[dict]:
+		if not self.change_amount:
+			return []
 
-				gl_entries.append(
-					self.get_gl_dict(
-						{
-							"account": self.account_for_change_amount,
-							"against": self.customer,
-							"credit": self.base_change_amount,
-							"cost_center": self.cost_center,
-						},
-						item=self,
-					)
-				)
-			else:
-				frappe.throw(_("Select change amount account"), title=_("Mandatory Field"))
+		if not self.account_for_change_amount:
+			frappe.throw(_("Please set Account for Change Amount"), title=_("Mandatory Field"))
+
+		return [
+			self.get_gl_dict(
+				{
+					"account": self.debit_to,
+					"party_type": "Customer",
+					"party": self.customer,
+					"against": self.account_for_change_amount,
+					"debit": flt(self.base_change_amount),
+					"debit_in_account_currency": flt(self.base_change_amount)
+					if self.party_account_currency == self.company_currency
+					else flt(self.change_amount),
+					"against_voucher": self.return_against
+					if cint(self.is_return) and self.return_against
+					else self.name,
+					"against_voucher_type": self.doctype,
+					"cost_center": self.cost_center,
+					"project": self.project,
+				},
+				self.party_account_currency,
+				item=self,
+			),
+			self.get_gl_dict(
+				{
+					"account": self.account_for_change_amount,
+					"against": self.customer,
+					"credit": self.base_change_amount,
+					"cost_center": self.cost_center,
+				},
+				item=self,
+			),
+		]
 
 	def make_write_off_gl_entry(self, gl_entries):
 		# write off entries, applicable if only pos
@@ -1659,48 +1643,9 @@
 		"""
 		validate serial number agains Delivery Note and Sales Invoice
 		"""
-		self.set_serial_no_against_delivery_note()
-		self.validate_serial_against_delivery_note()
-
-	def set_serial_no_against_delivery_note(self):
 		for item in self.items:
-			if item.serial_no and item.delivery_note and item.qty != len(get_serial_nos(item.serial_no)):
-				item.serial_no = get_delivery_note_serial_no(item.item_code, item.qty, item.delivery_note)
-
-	def validate_serial_against_delivery_note(self):
-		"""
-		validate if the serial numbers in Sales Invoice Items are same as in
-		Delivery Note Item
-		"""
-
-		for item in self.items:
-			if not item.delivery_note or not item.dn_detail:
-				continue
-
-			serial_nos = frappe.db.get_value("Delivery Note Item", item.dn_detail, "serial_no") or ""
-			dn_serial_nos = set(get_serial_nos(serial_nos))
-
-			serial_nos = item.serial_no or ""
-			si_serial_nos = set(get_serial_nos(serial_nos))
-			serial_no_diff = si_serial_nos - dn_serial_nos
-
-			if serial_no_diff:
-				dn_link = frappe.utils.get_link_to_form("Delivery Note", item.delivery_note)
-				serial_no_msg = ", ".join(frappe.bold(d) for d in serial_no_diff)
-
-				msg = _("Row #{0}: The following Serial Nos are not present in Delivery Note {1}:").format(
-					item.idx, dn_link
-				)
-				msg += " " + serial_no_msg
-
-				frappe.throw(msg=msg, title=_("Serial Nos Mismatch"))
-
-			if item.serial_no and cint(item.qty) != len(si_serial_nos):
-				frappe.throw(
-					_("Row #{0}: {1} Serial numbers required for Item {2}. You have provided {3}.").format(
-						item.idx, item.qty, item.item_code, len(si_serial_nos)
-					)
-				)
+			item.set_serial_no_against_delivery_note()
+			item.validate_serial_against_delivery_note()
 
 	def update_project(self):
 		if self.project:
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js
index 1605b15..f971f68 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js
@@ -2,34 +2,42 @@
 // License: GNU General Public License v3. See license.txt
 
 // render
-frappe.listview_settings['Sales Invoice'] = {
-	add_fields: ["customer", "customer_name", "base_grand_total", "outstanding_amount", "due_date", "company",
-		"currency", "is_return"],
-	get_indicator: function(doc) {
+frappe.listview_settings["Sales Invoice"] = {
+	add_fields: [
+		"customer",
+		"customer_name",
+		"base_grand_total",
+		"outstanding_amount",
+		"due_date",
+		"company",
+		"currency",
+		"is_return",
+	],
+	get_indicator: function (doc) {
 		const status_colors = {
-			"Draft": "grey",
-			"Unpaid": "orange",
-			"Paid": "green",
-			"Return": "gray",
+			Draft: "grey",
+			Unpaid: "orange",
+			Paid: "green",
+			Return: "gray",
 			"Credit Note Issued": "gray",
 			"Unpaid and Discounted": "orange",
 			"Partly Paid and Discounted": "yellow",
 			"Overdue and Discounted": "red",
-			"Overdue": "red",
+			Overdue: "red",
 			"Partly Paid": "yellow",
-			"Internal Transfer": "darkgrey"
+			"Internal Transfer": "darkgrey",
 		};
-		return [__(doc.status), status_colors[doc.status], "status,=,"+doc.status];
+		return [__(doc.status), status_colors[doc.status], "status,=," + doc.status];
 	},
 	right_column: "grand_total",
 
-	onload: function(listview) {
-		listview.page.add_action_item(__("Delivery Note"), ()=>{
+	onload: function (listview) {
+		listview.page.add_action_item(__("Delivery Note"), () => {
 			erpnext.bulk_transaction_processing.create(listview, "Sales Invoice", "Delivery Note");
 		});
 
-		listview.page.add_action_item(__("Payment"), ()=>{
+		listview.page.add_action_item(__("Payment"), () => {
 			erpnext.bulk_transaction_processing.create(listview, "Sales Invoice", "Payment Entry");
 		});
-	}
+	},
 };
diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py
index 9be1b42..f92a7a8 100644
--- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py
+++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py
@@ -2,7 +2,13 @@
 # License: GNU General Public License v3. See license.txt
 
 
+import frappe
+from frappe import _
 from frappe.model.document import Document
+from frappe.utils.data import cint
+
+from erpnext.assets.doctype.asset.depreciation import get_disposal_account_and_cost_center
+from erpnext.stock.doctype.serial_no.serial_no import get_delivery_note_serial_no, get_serial_nos
 
 
 class SalesInvoiceItem(Document):
@@ -92,4 +98,67 @@
 		weight_uom: DF.Link | None
 	# end: auto-generated types
 
-	pass
+	def validate_cost_center(self, company: str):
+		cost_center_company = frappe.get_cached_value("Cost Center", self.cost_center, "company")
+		if cost_center_company != company:
+			frappe.throw(
+				_("Row #{0}: Cost Center {1} does not belong to company {2}").format(
+					frappe.bold(self.idx), frappe.bold(self.cost_center), frappe.bold(company)
+				)
+			)
+
+	def set_actual_qty(self):
+		if self.item_code and self.warehouse:
+			self.actual_qty = (
+				frappe.db.get_value(
+					"Bin", {"item_code": self.item_code, "warehouse": self.warehouse}, "actual_qty"
+				)
+				or 0
+			)
+
+	def set_income_account_for_fixed_asset(self, company: str):
+		"""Set income account for fixed asset item based on company's disposal account and cost center."""
+		if not self.is_fixed_asset:
+			return
+
+		disposal_account, depreciation_cost_center = get_disposal_account_and_cost_center(company)
+
+		self.income_account = disposal_account
+		if not self.cost_center:
+			self.cost_center = depreciation_cost_center
+
+	def set_serial_no_against_delivery_note(self):
+		"""Set serial no based on delivery note."""
+		if self.serial_no and self.delivery_note and self.qty != len(get_serial_nos(self.serial_no)):
+			self.serial_no = get_delivery_note_serial_no(self.item_code, self.qty, self.delivery_note)
+
+	def validate_serial_against_delivery_note(self):
+		"""Ensure the serial numbers in this Sales Invoice Item are same as in the linked Delivery Note."""
+		if not self.delivery_note or not self.dn_detail:
+			return
+
+		serial_nos = frappe.db.get_value("Delivery Note Item", self.dn_detail, "serial_no") or ""
+		dn_serial_nos = set(get_serial_nos(serial_nos))
+
+		serial_nos = self.serial_no or ""
+		si_serial_nos = set(get_serial_nos(serial_nos))
+		serial_no_diff = si_serial_nos - dn_serial_nos
+
+		if serial_no_diff:
+			dn_link = frappe.utils.get_link_to_form("Delivery Note", self.delivery_note)
+			msg = (
+				_("Row #{0}: The following serial numbers are not present in Delivery Note {1}:").format(
+					self.idx, dn_link
+				)
+				+ " "
+				+ ", ".join(frappe.bold(d) for d in serial_no_diff)
+			)
+
+			frappe.throw(msg=msg, title=_("Serial Nos Mismatch"))
+
+		if self.serial_no and cint(self.qty) != len(si_serial_nos):
+			frappe.throw(
+				_(
+					"Row #{0}: {1} serial numbers are required for Item {2}. You have provided {3} serial numbers."
+				).format(self.idx, self.qty, self.item_code, len(si_serial_nos))
+			)
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.js b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.js
index 00e8b62..91d4d04 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.js
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.js
@@ -2,4 +2,4 @@
 // License: GNU General Public License v3. See license.txt
 
 erpnext.accounts.taxes.setup_tax_validations("Sales Taxes and Charges Template");
-erpnext.accounts.taxes.setup_tax_filters("Sales Taxes and Charges");
\ No newline at end of file
+erpnext.accounts.taxes.setup_tax_filters("Sales Taxes and Charges");
diff --git a/erpnext/accounts/doctype/share_transfer/share_transfer.js b/erpnext/accounts/doctype/share_transfer/share_transfer.js
index 6317c9c..dd9d962 100644
--- a/erpnext/accounts/doctype/share_transfer/share_transfer.js
+++ b/erpnext/accounts/doctype/share_transfer/share_transfer.js
@@ -3,21 +3,19 @@
 
 frappe.provide("erpnext.share_transfer");
 
-frappe.ui.form.on('Share Transfer', {
-	refresh: function(frm) {
+frappe.ui.form.on("Share Transfer", {
+	refresh: function (frm) {
 		// Don't show Parties which are a Company
-		let shareholders = ['from_shareholder', 'to_shareholder'];
+		let shareholders = ["from_shareholder", "to_shareholder"];
 		shareholders.forEach((shareholder) => {
-			frm.fields_dict[shareholder].get_query = function() {
+			frm.fields_dict[shareholder].get_query = function () {
 				return {
-					filters: [
-						["Shareholder", "is_company", "=", 0]
-					]
+					filters: [["Shareholder", "is_company", "=", 0]],
 				};
 			};
 		});
 		if (frm.doc.docstatus == 1 && frm.doc.equity_or_liability_account && frm.doc.asset_account) {
-			frm.add_custom_button(__('Create Journal Entry'), function () {
+			frm.add_custom_button(__("Create Journal Entry"), function () {
 				erpnext.share_transfer.make_jv(frm);
 			});
 		}
@@ -25,54 +23,59 @@
 		frm.toggle_reqd("asset_account", frm.doc.transfer_type != "Transfer");
 	},
 	no_of_shares: (frm) => {
-		if (frm.doc.rate != undefined || frm.doc.rate != null){
+		if (frm.doc.rate != undefined || frm.doc.rate != null) {
 			erpnext.share_transfer.update_amount(frm);
 		}
 	},
 	rate: (frm) => {
-		if (frm.doc.no_of_shares != undefined || frm.doc.no_of_shares != null){
+		if (frm.doc.no_of_shares != undefined || frm.doc.no_of_shares != null) {
 			erpnext.share_transfer.update_amount(frm);
 		}
 	},
-	company: async function(frm) {
+	company: async function (frm) {
 		if (frm.doc.company) {
-			let currency = (await frappe.db.get_value("Company", frm.doc.company, "default_currency")).message.default_currency;
-			frm.set_query("equity_or_liability_account", function() {
+			let currency = (await frappe.db.get_value("Company", frm.doc.company, "default_currency")).message
+				.default_currency;
+			frm.set_query("equity_or_liability_account", function () {
 				return {
 					filters: {
-						"is_group":0,
-						"root_type": ["in",["Equity","Liability"]],
-						"company": frm.doc.company,
-						"account_currency": currency
-					}
+						is_group: 0,
+						root_type: ["in", ["Equity", "Liability"]],
+						company: frm.doc.company,
+						account_currency: currency,
+					},
 				};
 			});
-			frm.set_query("asset_account", function() {
+			frm.set_query("asset_account", function () {
 				return {
 					filters: {
-						"is_group":0,
-						"root_type":"Asset",
-						"company": frm.doc.company,
-						"account_currency": currency
-					}
+						is_group: 0,
+						root_type: "Asset",
+						company: frm.doc.company,
+						account_currency: currency,
+					},
 				};
 			});
 		}
 	},
 
-	transfer_type: function(frm) {
+	transfer_type: function (frm) {
 		frm.toggle_reqd("asset_account", frm.doc.transfer_type != "Transfer");
-	}
+	},
 });
 
-erpnext.share_transfer.update_amount = function(frm) {
+erpnext.share_transfer.update_amount = function (frm) {
 	frm.doc.amount = frm.doc.no_of_shares * frm.doc.rate;
 	frm.refresh_field("amount");
 };
 
 erpnext.share_transfer.make_jv = function (frm) {
-	var account, payment_account, credit_applicant_type, credit_applicant,
-		debit_applicant_type, debit_applicant;
+	var account,
+		payment_account,
+		credit_applicant_type,
+		credit_applicant,
+		debit_applicant_type,
+		debit_applicant;
 
 	if (frm.doc.transfer_type == "Transfer") {
 		account = frm.doc.equity_or_liability_account;
@@ -81,16 +84,14 @@
 		credit_applicant = frm.doc.to_shareholder;
 		debit_applicant_type = "Shareholder";
 		debit_applicant = frm.doc.from_shareholder;
-	}
-	else if (frm.doc.transfer_type == "Issue") {
+	} else if (frm.doc.transfer_type == "Issue") {
 		account = frm.doc.asset_account;
 		payment_account = frm.doc.equity_or_liability_account;
 		credit_applicant_type = "Shareholder";
 		credit_applicant = frm.doc.to_shareholder;
 		debit_applicant_type = "";
 		debit_applicant = "";
-	}
-	else {
+	} else {
 		account = frm.doc.equity_or_liability_account;
 		payment_account = frm.doc.asset_account;
 		credit_applicant_type = "";
@@ -100,19 +101,19 @@
 	}
 	frappe.call({
 		args: {
-			"company": frm.doc.company,
-			"account": account,
-			"amount": frm.doc.amount,
-			"payment_account": payment_account,
-			"credit_applicant_type": credit_applicant_type,
-			"credit_applicant": credit_applicant,
-			"debit_applicant_type": debit_applicant_type,
-			"debit_applicant": debit_applicant
+			company: frm.doc.company,
+			account: account,
+			amount: frm.doc.amount,
+			payment_account: payment_account,
+			credit_applicant_type: credit_applicant_type,
+			credit_applicant: credit_applicant,
+			debit_applicant_type: debit_applicant_type,
+			debit_applicant: debit_applicant,
 		},
 		method: "erpnext.accounts.doctype.share_transfer.share_transfer.make_jv_entry",
 		callback: function (r) {
 			var doc = frappe.model.sync(r.message)[0];
 			frappe.set_route("Form", doc.doctype, doc.name);
-		}
+		},
 	});
 };
diff --git a/erpnext/accounts/doctype/share_type/share_type.js b/erpnext/accounts/doctype/share_type/share_type.js
index 1ae85e3..5dfb760 100644
--- a/erpnext/accounts/doctype/share_type/share_type.js
+++ b/erpnext/accounts/doctype/share_type/share_type.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Share Type', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Share Type", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/accounts/doctype/shareholder/shareholder.js b/erpnext/accounts/doctype/shareholder/shareholder.js
index 544d417..baf0920 100644
--- a/erpnext/accounts/doctype/shareholder/shareholder.js
+++ b/erpnext/accounts/doctype/shareholder/shareholder.js
@@ -1,37 +1,36 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Shareholder', {
-	refresh: function(frm) {
-		frm.toggle_display(['contact_html'], !frm.doc.__islocal);
+frappe.ui.form.on("Shareholder", {
+	refresh: function (frm) {
+		frm.toggle_display(["contact_html"], !frm.doc.__islocal);
 
 		if (frm.doc.__islocal) {
-			hide_field(['contact_html']);
+			hide_field(["contact_html"]);
 			frappe.contacts.clear_address_and_contact(frm);
-		}
-		else {
-			if (frm.doc.is_company){
-				hide_field(['company']);
+		} else {
+			if (frm.doc.is_company) {
+				hide_field(["company"]);
 			} else {
-				unhide_field(['contact_html']);
+				unhide_field(["contact_html"]);
 				frappe.contacts.render_address_and_contact(frm);
 			}
 		}
 
-		if (frm.doc.folio_no != undefined){
-			frm.add_custom_button(__("Share Balance"), function(){
+		if (frm.doc.folio_no != undefined) {
+			frm.add_custom_button(__("Share Balance"), function () {
 				frappe.route_options = {
-					"shareholder": frm.doc.name,
+					shareholder: frm.doc.name,
 				};
 				frappe.set_route("query-report", "Share Balance");
 			});
-			frm.add_custom_button(__("Share Ledger"), function(){
+			frm.add_custom_button(__("Share Ledger"), function () {
 				frappe.route_options = {
-					"shareholder": frm.doc.name,
+					shareholder: frm.doc.name,
 				};
 				frappe.set_route("query-report", "Share Ledger");
 			});
-			let fields = ['title', 'folio_no', 'company'];
+			let fields = ["title", "folio_no", "company"];
 			fields.forEach((fieldname) => {
 				frm.fields_dict[fieldname].df.read_only = 1;
 				frm.refresh_fields(fieldname);
@@ -42,11 +41,11 @@
 	},
 	validate: (frm) => {
 		let contact_list = {
-			contacts: []
+			contacts: [],
 		};
-		$('div[data-fieldname=contact_html] > .address-box').each( (index, ele) => {
-			contact_list.contacts.push(ele.innerText.replace(' Edit', ''));
+		$("div[data-fieldname=contact_html] > .address-box").each((index, ele) => {
+			contact_list.contacts.push(ele.innerText.replace(" Edit", ""));
 		});
 		frm.doc.contact_list = JSON.stringify(contact_list);
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.js b/erpnext/accounts/doctype/shipping_rule/shipping_rule.js
index 8e4b806..1ece3e6 100644
--- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.js
+++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.js
@@ -1,33 +1,33 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.provide('erpnext.accounts.dimensions');
+frappe.provide("erpnext.accounts.dimensions");
 
-frappe.ui.form.on('Shipping Rule', {
-	onload: function(frm) {
+frappe.ui.form.on("Shipping Rule", {
+	onload: function (frm) {
 		erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
 	},
 
-	company: function(frm) {
+	company: function (frm) {
 		erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
 	},
 
-	refresh: function(frm) {
-		frm.set_query("account", function() {
+	refresh: function (frm) {
+		frm.set_query("account", function () {
 			return {
 				filters: {
-					company: frm.doc.company
-				}
-			}
-		})
+					company: frm.doc.company,
+				},
+			};
+		});
 
-		frm.trigger('toggle_reqd');
+		frm.trigger("toggle_reqd");
 	},
-	calculate_based_on: function(frm) {
-		frm.trigger('toggle_reqd');
+	calculate_based_on: function (frm) {
+		frm.trigger("toggle_reqd");
 	},
-	toggle_reqd: function(frm) {
-		frm.toggle_reqd("shipping_amount", frm.doc.calculate_based_on === 'Fixed');
-		frm.toggle_reqd("conditions", frm.doc.calculate_based_on !== 'Fixed');
-	}
+	toggle_reqd: function (frm) {
+		frm.toggle_reqd("shipping_amount", frm.doc.calculate_based_on === "Fixed");
+		frm.toggle_reqd("conditions", frm.doc.calculate_based_on !== "Fixed");
+	},
 });
diff --git a/erpnext/accounts/doctype/subscription/subscription.js b/erpnext/accounts/doctype/subscription/subscription.js
index 92f8a3a..b3e21ab 100644
--- a/erpnext/accounts/doctype/subscription/subscription.js
+++ b/erpnext/accounts/doctype/subscription/subscription.js
@@ -1,29 +1,29 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Subscription', {
+frappe.ui.form.on("Subscription", {
 	setup: function (frm) {
-		frm.set_query('party_type', function () {
+		frm.set_query("party_type", function () {
 			return {
 				filters: {
-					name: ['in', ['Customer', 'Supplier']]
-				}
-			}
-		});
-
-		frm.set_query('cost_center', function () {
-			return {
-				filters: {
-					company: frm.doc.company
-				}
+					name: ["in", ["Customer", "Supplier"]],
+				},
 			};
 		});
 
-		frm.set_query('sales_tax_template', function () {
+		frm.set_query("cost_center", function () {
 			return {
 				filters: {
-					company: frm.doc.company
-				}
+					company: frm.doc.company,
+				},
+			};
+		});
+
+		frm.set_query("sales_tax_template", function () {
+			return {
+				filters: {
+					company: frm.doc.company,
+				},
 			};
 		});
 	},
@@ -31,32 +31,32 @@
 	refresh: function (frm) {
 		if (frm.is_new()) return;
 
-		if (frm.doc.status !== 'Cancelled') {
+		if (frm.doc.status !== "Cancelled") {
 			frm.add_custom_button(
-				__('Fetch Subscription Updates'),
-				() => frm.trigger('get_subscription_updates'),
-				__('Actions')
+				__("Fetch Subscription Updates"),
+				() => frm.trigger("get_subscription_updates"),
+				__("Actions")
 			);
 
 			frm.add_custom_button(
-				__('Cancel Subscription'),
-				() => frm.trigger('cancel_this_subscription'),
-				__('Actions')
+				__("Cancel Subscription"),
+				() => frm.trigger("cancel_this_subscription"),
+				__("Actions")
 			);
-		} else if (frm.doc.status === 'Cancelled') {
+		} else if (frm.doc.status === "Cancelled") {
 			frm.add_custom_button(
-				__('Restart Subscription'),
-				() => frm.trigger('renew_this_subscription'),
-				__('Actions')
+				__("Restart Subscription"),
+				() => frm.trigger("renew_this_subscription"),
+				__("Actions")
 			);
 		}
 	},
 
 	cancel_this_subscription: function (frm) {
 		frappe.confirm(
-			__('This action will stop future billing. Are you sure you want to cancel this subscription?'),
+			__("This action will stop future billing. Are you sure you want to cancel this subscription?"),
 			() => {
-				frm.call('cancel_subscription').then(r => {
+				frm.call("cancel_subscription").then((r) => {
 					if (!r.exec) {
 						frm.reload_doc();
 					}
@@ -66,23 +66,20 @@
 	},
 
 	renew_this_subscription: function (frm) {
-		frappe.confirm(
-			__('Are you sure you want to restart this subscription?'),
-			() => {
-				frm.call('restart_subscription').then(r => {
-					if (!r.exec) {
-						frm.reload_doc();
-					}
-				});
-			}
-		);
+		frappe.confirm(__("Are you sure you want to restart this subscription?"), () => {
+			frm.call("restart_subscription").then((r) => {
+				if (!r.exec) {
+					frm.reload_doc();
+				}
+			});
+		});
 	},
 
 	get_subscription_updates: function (frm) {
-		frm.call('process').then(r => {
+		frm.call("process").then((r) => {
 			if (!r.exec) {
 				frm.reload_doc();
 			}
 		});
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/subscription/subscription_list.js b/erpnext/accounts/doctype/subscription/subscription_list.js
index ea48b53..bc831d3 100644
--- a/erpnext/accounts/doctype/subscription/subscription_list.js
+++ b/erpnext/accounts/doctype/subscription/subscription_list.js
@@ -1,17 +1,17 @@
-frappe.listview_settings['Subscription'] = {
-	get_indicator: function(doc) {
-		if(doc.status === 'Trialing') {
+frappe.listview_settings["Subscription"] = {
+	get_indicator: function (doc) {
+		if (doc.status === "Trialing") {
 			return [__("Trialing"), "green"];
-		} else if(doc.status === 'Active') {
+		} else if (doc.status === "Active") {
 			return [__("Active"), "green"];
-		} else if(doc.status === 'Completed') {
-				return [__("Completed"), "green"];
-		} else if(doc.status === 'Past Due Date') {
+		} else if (doc.status === "Completed") {
+			return [__("Completed"), "green"];
+		} else if (doc.status === "Past Due Date") {
 			return [__("Past Due Date"), "orange"];
-		} else if(doc.status === 'Unpaid') {
+		} else if (doc.status === "Unpaid") {
 			return [__("Unpaid"), "red"];
-		} else if(doc.status === 'Cancelled') {
+		} else if (doc.status === "Cancelled") {
 			return [__("Cancelled"), "gray"];
 		}
-	}
+	},
 };
diff --git a/erpnext/accounts/doctype/subscription_plan/subscription_plan.js b/erpnext/accounts/doctype/subscription_plan/subscription_plan.js
index 00727f1..125dc7d 100644
--- a/erpnext/accounts/doctype/subscription_plan/subscription_plan.js
+++ b/erpnext/accounts/doctype/subscription_plan/subscription_plan.js
@@ -1,10 +1,10 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Subscription Plan', {
-	price_determination: function(frm) {
-		frm.toggle_reqd("cost", frm.doc.price_determination === 'Fixed rate');
-		frm.toggle_reqd("price_list", frm.doc.price_determination === 'Based on price list');
+frappe.ui.form.on("Subscription Plan", {
+	price_determination: function (frm) {
+		frm.toggle_reqd("cost", frm.doc.price_determination === "Fixed rate");
+		frm.toggle_reqd("price_list", frm.doc.price_determination === "Based on price list");
 	},
 
 	subscription_plan: function (frm) {
diff --git a/erpnext/accounts/doctype/tax_category/tax_category.js b/erpnext/accounts/doctype/tax_category/tax_category.js
index 4b63edb..fe60e03 100644
--- a/erpnext/accounts/doctype/tax_category/tax_category.js
+++ b/erpnext/accounts/doctype/tax_category/tax_category.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Tax Category', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Tax Category", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.js b/erpnext/accounts/doctype/tax_rule/tax_rule.js
index bc49716..b8c68e8 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.js
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.js
@@ -1,40 +1,40 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.ui.form.on("Tax Rule", "customer", function(frm) {
-	if(frm.doc.customer) {
+frappe.ui.form.on("Tax Rule", "customer", function (frm) {
+	if (frm.doc.customer) {
 		frappe.call({
-			method:"erpnext.accounts.doctype.tax_rule.tax_rule.get_party_details",
+			method: "erpnext.accounts.doctype.tax_rule.tax_rule.get_party_details",
 			args: {
-				"party": frm.doc.customer,
-				"party_type": "customer"
+				party: frm.doc.customer,
+				party_type: "customer",
 			},
-			callback: function(r) {
-				if(!r.exc) {
-					$.each(r.message, function(k, v) {
+			callback: function (r) {
+				if (!r.exc) {
+					$.each(r.message, function (k, v) {
 						frm.set_value(k, v);
 					});
 				}
-			}
+			},
 		});
 	}
 });
 
-frappe.ui.form.on("Tax Rule", "supplier", function(frm) {
-	if(frm.doc.supplier) {
+frappe.ui.form.on("Tax Rule", "supplier", function (frm) {
+	if (frm.doc.supplier) {
 		frappe.call({
-			method:"erpnext.accounts.doctype.tax_rule.tax_rule.get_party_details",
+			method: "erpnext.accounts.doctype.tax_rule.tax_rule.get_party_details",
 			args: {
-				"party": frm.doc.supplier,
-				"party_type": "supplier"
+				party: frm.doc.supplier,
+				party_type: "supplier",
 			},
-			callback: function(r) {
-				if(!r.exc) {
-					$.each(r.message, function(k, v) {
+			callback: function (r) {
+				if (!r.exc) {
+					$.each(r.message, function (k, v) {
 						frm.set_value(k, v);
 					});
 				}
-			}
+			},
 		});
 	}
 });
diff --git a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.js b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.js
index 7b47974..4f4f32c 100644
--- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.js
+++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.js
@@ -1,18 +1,18 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Tax Withholding Category', {
-	setup: function(frm) {
-		frm.set_query("account", "accounts", function(doc, cdt, cdn) {
+frappe.ui.form.on("Tax Withholding Category", {
+	setup: function (frm) {
+		frm.set_query("account", "accounts", function (doc, cdt, cdn) {
 			var child = locals[cdt][cdn];
 			if (child.company) {
 				return {
 					filters: {
-						'company': child.company,
-						'root_type': ['in', ['Asset', 'Liability']]
-					}
+						company: child.company,
+						root_type: ["in", ["Asset", "Liability"]],
+					},
 				};
 			}
 		});
-	}
+	},
 });
diff --git a/erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.js b/erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.js
index 70cefb1..63ae30d 100644
--- a/erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.js
+++ b/erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.js
@@ -3,39 +3,36 @@
 
 frappe.ui.form.on("Unreconcile Payment", {
 	refresh(frm) {
-		frm.set_query("voucher_type", function() {
+		frm.set_query("voucher_type", function () {
 			return {
 				filters: {
-					name: ["in", ["Payment Entry", "Journal Entry"]]
-				}
-			}
+					name: ["in", ["Payment Entry", "Journal Entry"]],
+				},
+			};
 		});
 
-
-		frm.set_query("voucher_no", function(doc) {
+		frm.set_query("voucher_no", function (doc) {
 			return {
 				filters: {
 					company: doc.company,
-					docstatus: 1
-				}
-			}
+					docstatus: 1,
+				},
+			};
 		});
-
 	},
-	get_allocations: function(frm) {
+	get_allocations: function (frm) {
 		frm.clear_table("allocations");
 		frappe.call({
 			method: "get_allocations_from_payment",
 			doc: frm.doc,
-			callback: function(r) {
+			callback: function (r) {
 				if (r.message) {
-					r.message.forEach(x => {
-						frm.add_child("allocations", x)
-					})
+					r.message.forEach((x) => {
+						frm.add_child("allocations", x);
+					});
 					frm.refresh_fields();
 				}
-			}
-		})
-
-	}
+			},
+		});
+	},
 });
diff --git a/erpnext/accounts/report/account_balance/account_balance.js b/erpnext/accounts/report/account_balance/account_balance.js
index ab5dce8..f425b25 100644
--- a/erpnext/accounts/report/account_balance/account_balance.js
+++ b/erpnext/accounts/report/account_balance/account_balance.js
@@ -1,33 +1,32 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Account Balance"] = {
-	"filters": [
+	filters: [
 		{
-			fieldname:"company",
+			fieldname: "company",
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
-			default: frappe.defaults.get_user_default("Company")
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			fieldname:"report_date",
+			fieldname: "report_date",
 			label: __("Date"),
 			fieldtype: "Date",
 			default: frappe.datetime.get_today(),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "root_type",
 			label: __("Root Type"),
 			fieldtype: "Select",
 			options: [
-				{ "value": "Asset", "label": __("Asset") },
-				{ "value": "Liability", "label": __("Liability") },
-				{ "value": "Income", "label": __("Income") },
-				{ "value": "Expense", "label": __("Expense") },
-				{ "value": "Equity", "label": __("Equity") }
+				{ value: "Asset", label: __("Asset") },
+				{ value: "Liability", label: __("Liability") },
+				{ value: "Income", label: __("Income") },
+				{ value: "Expense", label: __("Expense") },
+				{ value: "Equity", label: __("Equity") },
 			],
 		},
 		{
@@ -35,30 +34,32 @@
 			label: __("Account Type"),
 			fieldtype: "Select",
 			options: [
-				{ "value": "Accumulated Depreciation", "label": __("Accumulated Depreciation") },
-				{ "value": "Asset Received But Not Billed", "label": __("Asset Received But Not Billed") },
-				{ "value": "Bank", "label": __("Bank") },
-				{ "value": "Cash", "label": __("Cash") },
-				{ "value": "Chargeable", "label": __("Chargeable") },
-				{ "value": "Capital Work in Progress", "label": __("Capital Work in Progress") },
-				{ "value": "Cost of Goods Sold", "label": __("Cost of Goods Sold") },
-				{ "value": "Depreciation", "label": __("Depreciation") },
-				{ "value": "Equity", "label": __("Equity") },
-				{ "value": "Expense Account", "label": __("Expense Account") },
-				{ "value": "Expenses Included In Asset Valuation", "label": __("Expenses Included In Asset Valuation") },
-				{ "value": "Expenses Included In Valuation", "label": __("Expenses Included In Valuation") },
-				{ "value": "Fixed Asset", "label": __("Fixed Asset") },
-				{ "value": "Income Account", "label": __("Income Account") },
-				{ "value": "Payable", "label": __("Payable") },
-				{ "value": "Receivable", "label": __("Receivable") },
-				{ "value": "Round Off", "label": __("Round Off") },
-				{ "value": "Stock", "label": __("Stock") },
-				{ "value": "Stock Adjustment", "label": __("Stock Adjustment") },
-				{ "value": "Stock Received But Not Billed", "label": __("Stock Received But Not Billed") },
-				{ "value": "Tax", "label": __("Tax") },
-				{ "value": "Temporary", "label": __("Temporary") },
+				{ value: "Accumulated Depreciation", label: __("Accumulated Depreciation") },
+				{ value: "Asset Received But Not Billed", label: __("Asset Received But Not Billed") },
+				{ value: "Bank", label: __("Bank") },
+				{ value: "Cash", label: __("Cash") },
+				{ value: "Chargeable", label: __("Chargeable") },
+				{ value: "Capital Work in Progress", label: __("Capital Work in Progress") },
+				{ value: "Cost of Goods Sold", label: __("Cost of Goods Sold") },
+				{ value: "Depreciation", label: __("Depreciation") },
+				{ value: "Equity", label: __("Equity") },
+				{ value: "Expense Account", label: __("Expense Account") },
+				{
+					value: "Expenses Included In Asset Valuation",
+					label: __("Expenses Included In Asset Valuation"),
+				},
+				{ value: "Expenses Included In Valuation", label: __("Expenses Included In Valuation") },
+				{ value: "Fixed Asset", label: __("Fixed Asset") },
+				{ value: "Income Account", label: __("Income Account") },
+				{ value: "Payable", label: __("Payable") },
+				{ value: "Receivable", label: __("Receivable") },
+				{ value: "Round Off", label: __("Round Off") },
+				{ value: "Stock", label: __("Stock") },
+				{ value: "Stock Adjustment", label: __("Stock Adjustment") },
+				{ value: "Stock Received But Not Billed", label: __("Stock Received But Not Billed") },
+				{ value: "Tax", label: __("Tax") },
+				{ value: "Temporary", label: __("Temporary") },
 			],
 		},
-
-	]
-}
+	],
+};
diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js
index b608ebc..f540224 100644
--- a/erpnext/accounts/report/accounts_payable/accounts_payable.js
+++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js
@@ -2,193 +2,194 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Accounts Payable"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"reqd": 1,
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname": "report_date",
-			"label": __("Posting Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today()
+			fieldname: "report_date",
+			label: __("Posting Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname": "finance_book",
-			"label": __("Finance Book"),
-			"fieldtype": "Link",
-			"options": "Finance Book"
+			fieldname: "finance_book",
+			label: __("Finance Book"),
+			fieldtype: "Link",
+			options: "Finance Book",
 		},
 		{
-			"fieldname": "cost_center",
-			"label": __("Cost Center"),
-			"fieldtype": "Link",
-			"options": "Cost Center",
+			fieldname: "cost_center",
+			label: __("Cost Center"),
+			fieldtype: "Link",
+			options: "Cost Center",
 			get_query: () => {
-				var company = frappe.query_report.get_filter_value('company');
+				var company = frappe.query_report.get_filter_value("company");
 				return {
 					filters: {
-						'company': company
-					}
-				}
-			}
-		},
-		{
-			"fieldname": "party_account",
-			"label": __("Payable Account"),
-			"fieldtype": "Link",
-			"options": "Account",
-			get_query: () => {
-				var company = frappe.query_report.get_filter_value('company');
-				return {
-					filters: {
-						'company': company,
-						'account_type': 'Payable',
-						'is_group': 0
-					}
+						company: company,
+					},
 				};
-			}
+			},
 		},
 		{
-			"fieldname": "ageing_based_on",
-			"label": __("Ageing Based On"),
-			"fieldtype": "Select",
-			"options": 'Posting Date\nDue Date\nSupplier Invoice Date',
-			"default": "Due Date"
+			fieldname: "party_account",
+			label: __("Payable Account"),
+			fieldtype: "Link",
+			options: "Account",
+			get_query: () => {
+				var company = frappe.query_report.get_filter_value("company");
+				return {
+					filters: {
+						company: company,
+						account_type: "Payable",
+						is_group: 0,
+					},
+				};
+			},
 		},
 		{
-			"fieldname": "range1",
-			"label": __("Ageing Range 1"),
-			"fieldtype": "Int",
-			"default": "30",
-			"reqd": 1
+			fieldname: "ageing_based_on",
+			label: __("Ageing Based On"),
+			fieldtype: "Select",
+			options: "Posting Date\nDue Date\nSupplier Invoice Date",
+			default: "Due Date",
 		},
 		{
-			"fieldname": "range2",
-			"label": __("Ageing Range 2"),
-			"fieldtype": "Int",
-			"default": "60",
-			"reqd": 1
+			fieldname: "range1",
+			label: __("Ageing Range 1"),
+			fieldtype: "Int",
+			default: "30",
+			reqd: 1,
 		},
 		{
-			"fieldname": "range3",
-			"label": __("Ageing Range 3"),
-			"fieldtype": "Int",
-			"default": "90",
-			"reqd": 1
+			fieldname: "range2",
+			label: __("Ageing Range 2"),
+			fieldtype: "Int",
+			default: "60",
+			reqd: 1,
 		},
 		{
-			"fieldname": "range4",
-			"label": __("Ageing Range 4"),
-			"fieldtype": "Int",
-			"default": "120",
-			"reqd": 1
+			fieldname: "range3",
+			label: __("Ageing Range 3"),
+			fieldtype: "Int",
+			default: "90",
+			reqd: 1,
 		},
 		{
-			"fieldname": "payment_terms_template",
-			"label": __("Payment Terms Template"),
-			"fieldtype": "Link",
-			"options": "Payment Terms Template"
+			fieldname: "range4",
+			label: __("Ageing Range 4"),
+			fieldtype: "Int",
+			default: "120",
+			reqd: 1,
 		},
 		{
-			"fieldname":"party_type",
-			"label": __("Party Type"),
-			"fieldtype": "Autocomplete",
+			fieldname: "payment_terms_template",
+			label: __("Payment Terms Template"),
+			fieldtype: "Link",
+			options: "Payment Terms Template",
+		},
+		{
+			fieldname: "party_type",
+			label: __("Party Type"),
+			fieldtype: "Autocomplete",
 			options: get_party_type_options(),
-			on_change: function() {
-				frappe.query_report.set_filter_value('party', "");
-				frappe.query_report.toggle_filter_display('supplier_group', frappe.query_report.get_filter_value('party_type') !== "Supplier");
-			}
+			on_change: function () {
+				frappe.query_report.set_filter_value("party", "");
+				frappe.query_report.toggle_filter_display(
+					"supplier_group",
+					frappe.query_report.get_filter_value("party_type") !== "Supplier"
+				);
+			},
 		},
 		{
-			"fieldname":"party",
-			"label": __("Party"),
-			"fieldtype": "MultiSelectList",
-			get_data: function(txt) {
+			fieldname: "party",
+			label: __("Party"),
+			fieldtype: "MultiSelectList",
+			get_data: function (txt) {
 				if (!frappe.query_report.filters) return;
 
-				let party_type = frappe.query_report.get_filter_value('party_type');
+				let party_type = frappe.query_report.get_filter_value("party_type");
 				if (!party_type) return;
 
 				return frappe.db.get_link_options(party_type, txt);
 			},
 		},
 		{
-			"fieldname": "supplier_group",
-			"label": __("Supplier Group"),
-			"fieldtype": "Link",
-			"options": "Supplier Group",
-			"hidden": 1
+			fieldname: "supplier_group",
+			label: __("Supplier Group"),
+			fieldtype: "Link",
+			options: "Supplier Group",
+			hidden: 1,
 		},
 		{
-			"fieldname": "group_by_party",
-			"label": __("Group By Supplier"),
-			"fieldtype": "Check"
+			fieldname: "group_by_party",
+			label: __("Group By Supplier"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "based_on_payment_terms",
-			"label": __("Based On Payment Terms"),
-			"fieldtype": "Check",
+			fieldname: "based_on_payment_terms",
+			label: __("Based On Payment Terms"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "show_remarks",
-			"label": __("Show Remarks"),
-			"fieldtype": "Check",
+			fieldname: "show_remarks",
+			label: __("Show Remarks"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "show_future_payments",
-			"label": __("Show Future Payments"),
-			"fieldtype": "Check",
+			fieldname: "show_future_payments",
+			label: __("Show Future Payments"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "in_party_currency",
-			"label": __("In Party Currency"),
-			"fieldtype": "Check",
+			fieldname: "in_party_currency",
+			label: __("In Party Currency"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "for_revaluation_journals",
-			"label": __("Revaluation Journals"),
-			"fieldtype": "Check",
+			fieldname: "for_revaluation_journals",
+			label: __("Revaluation Journals"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "ignore_accounts",
-			"label": __("Group by Voucher"),
-			"fieldtype": "Check",
-		}
-
+			fieldname: "ignore_accounts",
+			label: __("Group by Voucher"),
+			fieldtype: "Check",
+		},
 	],
 
-	"formatter": function(value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 		if (data && data.bold) {
 			value = value.bold();
-
 		}
 		return value;
 	},
 
-	onload: function(report) {
-		report.page.add_inner_button(__("Accounts Payable Summary"), function() {
+	onload: function (report) {
+		report.page.add_inner_button(__("Accounts Payable Summary"), function () {
 			var filters = report.get_values();
-			frappe.set_route('query-report', 'Accounts Payable Summary', {company: filters.company});
+			frappe.set_route("query-report", "Accounts Payable Summary", { company: filters.company });
 		});
-	}
-}
+	},
+};
 
-erpnext.utils.add_dimensions('Accounts Payable', 9);
+erpnext.utils.add_dimensions("Accounts Payable", 9);
 
 function get_party_type_options() {
 	let options = [];
-	frappe.db.get_list(
-		"Party Type", {filters:{"account_type": "Payable"}, fields:['name']}
-	).then((res) => {
-		res.forEach((party_type) => {
-			options.push(party_type.name);
+	frappe.db
+		.get_list("Party Type", { filters: { account_type: "Payable" }, fields: ["name"] })
+		.then((res) => {
+			res.forEach((party_type) => {
+				options.push(party_type.name);
+			});
 		});
-	});
 	return options;
 }
diff --git a/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js b/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js
index 0f206b1..92ea9e8 100644
--- a/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js
+++ b/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js
@@ -2,140 +2,143 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Accounts Payable Summary"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname":"report_date",
-			"label": __("Posting Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today()
+			fieldname: "report_date",
+			label: __("Posting Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname":"ageing_based_on",
-			"label": __("Ageing Based On"),
-			"fieldtype": "Select",
-			"options": 'Posting Date\nDue Date',
-			"default": "Due Date"
+			fieldname: "ageing_based_on",
+			label: __("Ageing Based On"),
+			fieldtype: "Select",
+			options: "Posting Date\nDue Date",
+			default: "Due Date",
 		},
 		{
-			"fieldname":"range1",
-			"label": __("Ageing Range 1"),
-			"fieldtype": "Int",
-			"default": "30",
-			"reqd": 1
+			fieldname: "range1",
+			label: __("Ageing Range 1"),
+			fieldtype: "Int",
+			default: "30",
+			reqd: 1,
 		},
 		{
-			"fieldname":"range2",
-			"label": __("Ageing Range 2"),
-			"fieldtype": "Int",
-			"default": "60",
-			"reqd": 1
+			fieldname: "range2",
+			label: __("Ageing Range 2"),
+			fieldtype: "Int",
+			default: "60",
+			reqd: 1,
 		},
 		{
-			"fieldname":"range3",
-			"label": __("Ageing Range 3"),
-			"fieldtype": "Int",
-			"default": "90",
-			"reqd": 1
+			fieldname: "range3",
+			label: __("Ageing Range 3"),
+			fieldtype: "Int",
+			default: "90",
+			reqd: 1,
 		},
 		{
-			"fieldname":"range4",
-			"label": __("Ageing Range 4"),
-			"fieldtype": "Int",
-			"default": "120",
-			"reqd": 1
+			fieldname: "range4",
+			label: __("Ageing Range 4"),
+			fieldtype: "Int",
+			default: "120",
+			reqd: 1,
 		},
 		{
-			"fieldname":"finance_book",
-			"label": __("Finance Book"),
-			"fieldtype": "Link",
-			"options": "Finance Book"
+			fieldname: "finance_book",
+			label: __("Finance Book"),
+			fieldtype: "Link",
+			options: "Finance Book",
 		},
 		{
-			"fieldname":"cost_center",
-			"label": __("Cost Center"),
-			"fieldtype": "Link",
-			"options": "Cost Center",
+			fieldname: "cost_center",
+			label: __("Cost Center"),
+			fieldtype: "Link",
+			options: "Cost Center",
 			get_query: () => {
-				var company = frappe.query_report.get_filter_value('company');
+				var company = frappe.query_report.get_filter_value("company");
 				return {
 					filters: {
-						'company': company
-					}
-				}
-			}
+						company: company,
+					},
+				};
+			},
 		},
 		{
-			"fieldname":"party_type",
-			"label": __("Party Type"),
-			"fieldtype": "Autocomplete",
+			fieldname: "party_type",
+			label: __("Party Type"),
+			fieldtype: "Autocomplete",
 			options: get_party_type_options(),
-			on_change: function() {
-				frappe.query_report.set_filter_value('party', "");
-				frappe.query_report.toggle_filter_display('supplier_group', frappe.query_report.get_filter_value('party_type') !== "Supplier");
-			}
+			on_change: function () {
+				frappe.query_report.set_filter_value("party", "");
+				frappe.query_report.toggle_filter_display(
+					"supplier_group",
+					frappe.query_report.get_filter_value("party_type") !== "Supplier"
+				);
+			},
 		},
 		{
-			"fieldname":"party",
-			"label": __("Party"),
-			"fieldtype": "MultiSelectList",
-			get_data: function(txt) {
+			fieldname: "party",
+			label: __("Party"),
+			fieldtype: "MultiSelectList",
+			get_data: function (txt) {
 				if (!frappe.query_report.filters) return;
 
-				let party_type = frappe.query_report.get_filter_value('party_type');
+				let party_type = frappe.query_report.get_filter_value("party_type");
 				if (!party_type) return;
 
 				return frappe.db.get_link_options(party_type, txt);
 			},
 		},
 		{
-			"fieldname":"payment_terms_template",
-			"label": __("Payment Terms Template"),
-			"fieldtype": "Link",
-			"options": "Payment Terms Template"
+			fieldname: "payment_terms_template",
+			label: __("Payment Terms Template"),
+			fieldtype: "Link",
+			options: "Payment Terms Template",
 		},
 		{
-			"fieldname":"supplier_group",
-			"label": __("Supplier Group"),
-			"fieldtype": "Link",
-			"options": "Supplier Group"
+			fieldname: "supplier_group",
+			label: __("Supplier Group"),
+			fieldtype: "Link",
+			options: "Supplier Group",
 		},
 		{
-			"fieldname":"based_on_payment_terms",
-			"label": __("Based On Payment Terms"),
-			"fieldtype": "Check",
+			fieldname: "based_on_payment_terms",
+			label: __("Based On Payment Terms"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "for_revaluation_journals",
-			"label": __("Revaluation Journals"),
-			"fieldtype": "Check",
-		}
+			fieldname: "for_revaluation_journals",
+			label: __("Revaluation Journals"),
+			fieldtype: "Check",
+		},
 	],
 
-	onload: function(report) {
-		report.page.add_inner_button(__("Accounts Payable"), function() {
+	onload: function (report) {
+		report.page.add_inner_button(__("Accounts Payable"), function () {
 			var filters = report.get_values();
-			frappe.set_route('query-report', 'Accounts Payable', {company: filters.company});
+			frappe.set_route("query-report", "Accounts Payable", { company: filters.company });
 		});
-	}
-}
+	},
+};
 
-erpnext.utils.add_dimensions('Accounts Payable Summary', 9);
+erpnext.utils.add_dimensions("Accounts Payable Summary", 9);
 
 function get_party_type_options() {
 	let options = [];
-	frappe.db.get_list(
-		"Party Type", {filters:{"account_type": "Payable"}, fields:['name']}
-	).then((res) => {
-		res.forEach((party_type) => {
-			options.push(party_type.name);
+	frappe.db
+		.get_list("Party Type", { filters: { account_type: "Payable" }, fields: ["name"] })
+		.then((res) => {
+			res.forEach((party_type) => {
+				options.push(party_type.name);
+			});
 		});
-	});
 	return options;
-}
\ No newline at end of file
+}
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
index b4bc887..0daf79e 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
@@ -4,225 +4,224 @@
 frappe.provide("erpnext.utils");
 
 frappe.query_reports["Accounts Receivable"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"reqd": 1,
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname": "report_date",
-			"label": __("Posting Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today()
+			fieldname: "report_date",
+			label: __("Posting Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname": "finance_book",
-			"label": __("Finance Book"),
-			"fieldtype": "Link",
-			"options": "Finance Book"
+			fieldname: "finance_book",
+			label: __("Finance Book"),
+			fieldtype: "Link",
+			options: "Finance Book",
 		},
 		{
-			"fieldname": "cost_center",
-			"label": __("Cost Center"),
-			"fieldtype": "Link",
-			"options": "Cost Center",
+			fieldname: "cost_center",
+			label: __("Cost Center"),
+			fieldtype: "Link",
+			options: "Cost Center",
 			get_query: () => {
-				var company = frappe.query_report.get_filter_value('company');
+				var company = frappe.query_report.get_filter_value("company");
 				return {
 					filters: {
-						'company': company
-					}
+						company: company,
+					},
 				};
-			}
+			},
 		},
 		{
-			"fieldname":"party_type",
-			"label": __("Party Type"),
-			"fieldtype": "Autocomplete",
+			fieldname: "party_type",
+			label: __("Party Type"),
+			fieldtype: "Autocomplete",
 			options: get_party_type_options(),
-			on_change: function() {
-				frappe.query_report.set_filter_value('party', "");
-				frappe.query_report.toggle_filter_display('customer_group', frappe.query_report.get_filter_value('party_type') !== "Customer");
-			}
+			on_change: function () {
+				frappe.query_report.set_filter_value("party", "");
+				frappe.query_report.toggle_filter_display(
+					"customer_group",
+					frappe.query_report.get_filter_value("party_type") !== "Customer"
+				);
+			},
 		},
 		{
-			"fieldname":"party",
-			"label": __("Party"),
-			"fieldtype": "MultiSelectList",
-			get_data: function(txt) {
+			fieldname: "party",
+			label: __("Party"),
+			fieldtype: "MultiSelectList",
+			get_data: function (txt) {
 				if (!frappe.query_report.filters) return;
 
-				let party_type = frappe.query_report.get_filter_value('party_type');
+				let party_type = frappe.query_report.get_filter_value("party_type");
 				if (!party_type) return;
 
 				return frappe.db.get_link_options(party_type, txt);
 			},
 		},
 		{
-			"fieldname": "party_account",
-			"label": __("Receivable Account"),
-			"fieldtype": "Link",
-			"options": "Account",
+			fieldname: "party_account",
+			label: __("Receivable Account"),
+			fieldtype: "Link",
+			options: "Account",
 			get_query: () => {
-				var company = frappe.query_report.get_filter_value('company');
+				var company = frappe.query_report.get_filter_value("company");
 				return {
 					filters: {
-						'company': company,
-						'account_type': 'Receivable',
-						'is_group': 0
-					}
+						company: company,
+						account_type: "Receivable",
+						is_group: 0,
+					},
 				};
-			}
+			},
 		},
 		{
-			"fieldname": "ageing_based_on",
-			"label": __("Ageing Based On"),
-			"fieldtype": "Select",
-			"options": 'Posting Date\nDue Date',
-			"default": "Due Date"
+			fieldname: "ageing_based_on",
+			label: __("Ageing Based On"),
+			fieldtype: "Select",
+			options: "Posting Date\nDue Date",
+			default: "Due Date",
 		},
 		{
-			"fieldname": "range1",
-			"label": __("Ageing Range 1"),
-			"fieldtype": "Int",
-			"default": "30",
-			"reqd": 1
+			fieldname: "range1",
+			label: __("Ageing Range 1"),
+			fieldtype: "Int",
+			default: "30",
+			reqd: 1,
 		},
 		{
-			"fieldname": "range2",
-			"label": __("Ageing Range 2"),
-			"fieldtype": "Int",
-			"default": "60",
-			"reqd": 1
+			fieldname: "range2",
+			label: __("Ageing Range 2"),
+			fieldtype: "Int",
+			default: "60",
+			reqd: 1,
 		},
 		{
-			"fieldname": "range3",
-			"label": __("Ageing Range 3"),
-			"fieldtype": "Int",
-			"default": "90",
-			"reqd": 1
+			fieldname: "range3",
+			label: __("Ageing Range 3"),
+			fieldtype: "Int",
+			default: "90",
+			reqd: 1,
 		},
 		{
-			"fieldname": "range4",
-			"label": __("Ageing Range 4"),
-			"fieldtype": "Int",
-			"default": "120",
-			"reqd": 1
+			fieldname: "range4",
+			label: __("Ageing Range 4"),
+			fieldtype: "Int",
+			default: "120",
+			reqd: 1,
 		},
 		{
-			"fieldname":"customer_group",
-			"label": __("Customer Group"),
-			"fieldtype": "MultiSelectList",
-			"options": "Customer Group",
-			get_data: function(txt) {
-				return frappe.db.get_link_options('Customer Group', txt);
-			}
+			fieldname: "customer_group",
+			label: __("Customer Group"),
+			fieldtype: "MultiSelectList",
+			options: "Customer Group",
+			get_data: function (txt) {
+				return frappe.db.get_link_options("Customer Group", txt);
+			},
 		},
 		{
-			"fieldname": "payment_terms_template",
-			"label": __("Payment Terms Template"),
-			"fieldtype": "Link",
-			"options": "Payment Terms Template"
+			fieldname: "payment_terms_template",
+			label: __("Payment Terms Template"),
+			fieldtype: "Link",
+			options: "Payment Terms Template",
 		},
 		{
-			"fieldname": "sales_partner",
-			"label": __("Sales Partner"),
-			"fieldtype": "Link",
-			"options": "Sales Partner"
+			fieldname: "sales_partner",
+			label: __("Sales Partner"),
+			fieldtype: "Link",
+			options: "Sales Partner",
 		},
 		{
-			"fieldname": "sales_person",
-			"label": __("Sales Person"),
-			"fieldtype": "Link",
-			"options": "Sales Person"
+			fieldname: "sales_person",
+			label: __("Sales Person"),
+			fieldtype: "Link",
+			options: "Sales Person",
 		},
 		{
-			"fieldname": "territory",
-			"label": __("Territory"),
-			"fieldtype": "Link",
-			"options": "Territory"
+			fieldname: "territory",
+			label: __("Territory"),
+			fieldtype: "Link",
+			options: "Territory",
 		},
 		{
-			"fieldname": "group_by_party",
-			"label": __("Group By Customer"),
-			"fieldtype": "Check"
+			fieldname: "group_by_party",
+			label: __("Group By Customer"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "based_on_payment_terms",
-			"label": __("Based On Payment Terms"),
-			"fieldtype": "Check",
+			fieldname: "based_on_payment_terms",
+			label: __("Based On Payment Terms"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "show_future_payments",
-			"label": __("Show Future Payments"),
-			"fieldtype": "Check",
+			fieldname: "show_future_payments",
+			label: __("Show Future Payments"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "show_delivery_notes",
-			"label": __("Show Linked Delivery Notes"),
-			"fieldtype": "Check",
+			fieldname: "show_delivery_notes",
+			label: __("Show Linked Delivery Notes"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "show_sales_person",
-			"label": __("Show Sales Person"),
-			"fieldtype": "Check",
+			fieldname: "show_sales_person",
+			label: __("Show Sales Person"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "show_remarks",
-			"label": __("Show Remarks"),
-			"fieldtype": "Check",
+			fieldname: "show_remarks",
+			label: __("Show Remarks"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "in_party_currency",
-			"label": __("In Party Currency"),
-			"fieldtype": "Check",
+			fieldname: "in_party_currency",
+			label: __("In Party Currency"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "for_revaluation_journals",
-			"label": __("Revaluation Journals"),
-			"fieldtype": "Check",
+			fieldname: "for_revaluation_journals",
+			label: __("Revaluation Journals"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "ignore_accounts",
-			"label": __("Group by Voucher"),
-			"fieldtype": "Check",
-		}
-
-
+			fieldname: "ignore_accounts",
+			label: __("Group by Voucher"),
+			fieldtype: "Check",
+		},
 	],
 
-	"formatter": function(value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 		if (data && data.bold) {
 			value = value.bold();
-
 		}
 		return value;
 	},
 
-	onload: function(report) {
-		report.page.add_inner_button(__("Accounts Receivable Summary"), function() {
+	onload: function (report) {
+		report.page.add_inner_button(__("Accounts Receivable Summary"), function () {
 			var filters = report.get_values();
-			frappe.set_route('query-report', 'Accounts Receivable Summary', {company: filters.company});
+			frappe.set_route("query-report", "Accounts Receivable Summary", { company: filters.company });
 		});
-	}
-}
+	},
+};
 
-erpnext.utils.add_dimensions('Accounts Receivable', 9);
-
+erpnext.utils.add_dimensions("Accounts Receivable", 9);
 
 function get_party_type_options() {
 	let options = [];
-	frappe.db.get_list(
-		"Party Type", {filters:{"account_type": "Receivable"}, fields:['name']}
-	).then((res) => {
-		res.forEach((party_type) => {
-			options.push(party_type.name);
+	frappe.db
+		.get_list("Party Type", { filters: { account_type: "Receivable" }, fields: ["name"] })
+		.then((res) => {
+			res.forEach((party_type) => {
+				options.push(party_type.name);
+			});
 		});
-	});
 	return options;
 }
diff --git a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js
index 2f6d258..964abc2 100644
--- a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js
+++ b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js
@@ -2,168 +2,171 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Accounts Receivable Summary"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname":"report_date",
-			"label": __("Posting Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today()
+			fieldname: "report_date",
+			label: __("Posting Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname":"ageing_based_on",
-			"label": __("Ageing Based On"),
-			"fieldtype": "Select",
-			"options": 'Posting Date\nDue Date',
-			"default": "Due Date"
+			fieldname: "ageing_based_on",
+			label: __("Ageing Based On"),
+			fieldtype: "Select",
+			options: "Posting Date\nDue Date",
+			default: "Due Date",
 		},
 		{
-			"fieldname":"range1",
-			"label": __("Ageing Range 1"),
-			"fieldtype": "Int",
-			"default": "30",
-			"reqd": 1
+			fieldname: "range1",
+			label: __("Ageing Range 1"),
+			fieldtype: "Int",
+			default: "30",
+			reqd: 1,
 		},
 		{
-			"fieldname":"range2",
-			"label": __("Ageing Range 2"),
-			"fieldtype": "Int",
-			"default": "60",
-			"reqd": 1
+			fieldname: "range2",
+			label: __("Ageing Range 2"),
+			fieldtype: "Int",
+			default: "60",
+			reqd: 1,
 		},
 		{
-			"fieldname":"range3",
-			"label": __("Ageing Range 3"),
-			"fieldtype": "Int",
-			"default": "90",
-			"reqd": 1
+			fieldname: "range3",
+			label: __("Ageing Range 3"),
+			fieldtype: "Int",
+			default: "90",
+			reqd: 1,
 		},
 		{
-			"fieldname":"range4",
-			"label": __("Ageing Range 4"),
-			"fieldtype": "Int",
-			"default": "120",
-			"reqd": 1
+			fieldname: "range4",
+			label: __("Ageing Range 4"),
+			fieldtype: "Int",
+			default: "120",
+			reqd: 1,
 		},
 		{
-			"fieldname":"finance_book",
-			"label": __("Finance Book"),
-			"fieldtype": "Link",
-			"options": "Finance Book"
+			fieldname: "finance_book",
+			label: __("Finance Book"),
+			fieldtype: "Link",
+			options: "Finance Book",
 		},
 		{
-			"fieldname":"cost_center",
-			"label": __("Cost Center"),
-			"fieldtype": "Link",
-			"options": "Cost Center",
+			fieldname: "cost_center",
+			label: __("Cost Center"),
+			fieldtype: "Link",
+			options: "Cost Center",
 			get_query: () => {
-				var company = frappe.query_report.get_filter_value('company');
+				var company = frappe.query_report.get_filter_value("company");
 				return {
 					filters: {
-						'company': company
-					}
-				}
-			}
+						company: company,
+					},
+				};
+			},
 		},
 		{
-			"fieldname":"party_type",
-			"label": __("Party Type"),
-			"fieldtype": "Autocomplete",
+			fieldname: "party_type",
+			label: __("Party Type"),
+			fieldtype: "Autocomplete",
 			options: get_party_type_options(),
-			on_change: function() {
-				frappe.query_report.set_filter_value('party', "");
-				frappe.query_report.toggle_filter_display('customer_group', frappe.query_report.get_filter_value('party_type') !== "Customer");
-			}
+			on_change: function () {
+				frappe.query_report.set_filter_value("party", "");
+				frappe.query_report.toggle_filter_display(
+					"customer_group",
+					frappe.query_report.get_filter_value("party_type") !== "Customer"
+				);
+			},
 		},
 		{
-			"fieldname":"party",
-			"label": __("Party"),
-			"fieldtype": "MultiSelectList",
-			get_data: function(txt) {
+			fieldname: "party",
+			label: __("Party"),
+			fieldtype: "MultiSelectList",
+			get_data: function (txt) {
 				if (!frappe.query_report.filters) return;
 
-				let party_type = frappe.query_report.get_filter_value('party_type');
+				let party_type = frappe.query_report.get_filter_value("party_type");
 				if (!party_type) return;
 
 				return frappe.db.get_link_options(party_type, txt);
 			},
 		},
 		{
-			"fieldname":"customer_group",
-			"label": __("Customer Group"),
-			"fieldtype": "Link",
-			"options": "Customer Group"
+			fieldname: "customer_group",
+			label: __("Customer Group"),
+			fieldtype: "Link",
+			options: "Customer Group",
 		},
 		{
-			"fieldname":"payment_terms_template",
-			"label": __("Payment Terms Template"),
-			"fieldtype": "Link",
-			"options": "Payment Terms Template"
+			fieldname: "payment_terms_template",
+			label: __("Payment Terms Template"),
+			fieldtype: "Link",
+			options: "Payment Terms Template",
 		},
 		{
-			"fieldname":"territory",
-			"label": __("Territory"),
-			"fieldtype": "Link",
-			"options": "Territory"
+			fieldname: "territory",
+			label: __("Territory"),
+			fieldtype: "Link",
+			options: "Territory",
 		},
 		{
-			"fieldname":"sales_partner",
-			"label": __("Sales Partner"),
-			"fieldtype": "Link",
-			"options": "Sales Partner"
+			fieldname: "sales_partner",
+			label: __("Sales Partner"),
+			fieldtype: "Link",
+			options: "Sales Partner",
 		},
 		{
-			"fieldname":"sales_person",
-			"label": __("Sales Person"),
-			"fieldtype": "Link",
-			"options": "Sales Person"
+			fieldname: "sales_person",
+			label: __("Sales Person"),
+			fieldtype: "Link",
+			options: "Sales Person",
 		},
 		{
-			"fieldname":"based_on_payment_terms",
-			"label": __("Based On Payment Terms"),
-			"fieldtype": "Check",
+			fieldname: "based_on_payment_terms",
+			label: __("Based On Payment Terms"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname":"show_future_payments",
-			"label": __("Show Future Payments"),
-			"fieldtype": "Check",
+			fieldname: "show_future_payments",
+			label: __("Show Future Payments"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname":"show_gl_balance",
-			"label": __("Show GL Balance"),
-			"fieldtype": "Check",
+			fieldname: "show_gl_balance",
+			label: __("Show GL Balance"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "for_revaluation_journals",
-			"label": __("Revaluation Journals"),
-			"fieldtype": "Check",
-		}
+			fieldname: "for_revaluation_journals",
+			label: __("Revaluation Journals"),
+			fieldtype: "Check",
+		},
 	],
 
-	onload: function(report) {
-		report.page.add_inner_button(__("Accounts Receivable"), function() {
+	onload: function (report) {
+		report.page.add_inner_button(__("Accounts Receivable"), function () {
 			var filters = report.get_values();
-			frappe.set_route('query-report', 'Accounts Receivable', { company: filters.company });
+			frappe.set_route("query-report", "Accounts Receivable", { company: filters.company });
 		});
-	}
-}
+	},
+};
 
-erpnext.utils.add_dimensions('Accounts Receivable Summary', 9);
+erpnext.utils.add_dimensions("Accounts Receivable Summary", 9);
 
 function get_party_type_options() {
 	let options = [];
-	frappe.db.get_list(
-		"Party Type", {filters:{"account_type": "Receivable"}, fields:['name']}
-	).then((res) => {
-		res.forEach((party_type) => {
-			options.push(party_type.name);
+	frappe.db
+		.get_list("Party Type", { filters: { account_type: "Receivable" }, fields: ["name"] })
+		.then((res) => {
+			res.forEach((party_type) => {
+				options.push(party_type.name);
+			});
 		});
-	});
 	return options;
-}
\ No newline at end of file
+}
diff --git a/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.js b/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.js
index 12b9434..db49ccb 100644
--- a/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.js
+++ b/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.js
@@ -2,58 +2,58 @@
 // For license information, please see license.txt
 
 frappe.query_reports["Asset Depreciation Ledger"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-			"reqd": 1
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			reqd: 1,
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
 		},
 		{
-			"fieldname":"asset",
-			"label": __("Asset"),
-			"fieldtype": "Link",
-			"options": "Asset"
+			fieldname: "asset",
+			label: __("Asset"),
+			fieldtype: "Link",
+			options: "Asset",
 		},
 		{
-			"fieldname":"asset_category",
-			"label": __("Asset Category"),
-			"fieldtype": "Link",
-			"options": "Asset Category"
+			fieldname: "asset_category",
+			label: __("Asset Category"),
+			fieldtype: "Link",
+			options: "Asset Category",
 		},
 		{
-			"fieldname":"cost_center",
-			"label": __("Cost Center"),
-			"fieldtype": "Link",
-			"options": "Cost Center"
+			fieldname: "cost_center",
+			label: __("Cost Center"),
+			fieldtype: "Link",
+			options: "Cost Center",
 		},
 		{
-			"fieldname":"finance_book",
-			"label": __("Finance Book"),
-			"fieldtype": "Link",
-			"options": "Finance Book"
+			fieldname: "finance_book",
+			label: __("Finance Book"),
+			fieldtype: "Link",
+			options: "Finance Book",
 		},
 		{
-			"fieldname": "include_default_book_assets",
-			"label": __("Include Default FB Assets"),
-			"fieldtype": "Check",
-			"default": 1
+			fieldname: "include_default_book_assets",
+			label: __("Include Default FB Assets"),
+			fieldtype: "Check",
+			default: 1,
 		},
-	]
-}
+	],
+};
diff --git a/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.js b/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.js
index 06fa9f3..49771d7 100644
--- a/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.js
+++ b/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.js
@@ -2,49 +2,49 @@
 // For license information, please see license.txt
 
 frappe.query_reports["Asset Depreciations and Balances"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
-			"reqd": 1
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
+			reqd: 1,
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
-			"reqd": 1
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
+			reqd: 1,
 		},
 		{
-			"fieldname":"group_by",
-			"label": __("Group By"),
-			"fieldtype": "Select",
-			"options": ["Asset Category", "Asset"],
-			"default": "Asset Category",
+			fieldname: "group_by",
+			label: __("Group By"),
+			fieldtype: "Select",
+			options: ["Asset Category", "Asset"],
+			default: "Asset Category",
 		},
 		{
-			"fieldname":"asset_category",
-			"label": __("Asset Category"),
-			"fieldtype": "Link",
-			"options": "Asset Category",
-			"depends_on": "eval: doc.group_by == 'Asset Category'",
+			fieldname: "asset_category",
+			label: __("Asset Category"),
+			fieldtype: "Link",
+			options: "Asset Category",
+			depends_on: "eval: doc.group_by == 'Asset Category'",
 		},
 		{
-			"fieldname":"asset",
-			"label": __("Asset"),
-			"fieldtype": "Link",
-			"options": "Asset",
-			"depends_on": "eval: doc.group_by == 'Asset'",
+			fieldname: "asset",
+			label: __("Asset"),
+			fieldtype: "Link",
+			options: "Asset",
+			depends_on: "eval: doc.group_by == 'Asset'",
 		},
-	]
-}
+	],
+};
diff --git a/erpnext/accounts/report/balance_sheet/balance_sheet.js b/erpnext/accounts/report/balance_sheet/balance_sheet.js
index 5525024..0863c68 100644
--- a/erpnext/accounts/report/balance_sheet/balance_sheet.js
+++ b/erpnext/accounts/report/balance_sheet/balance_sheet.js
@@ -1,26 +1,21 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.query_reports["Balance Sheet"] = $.extend(
-	{},
-	erpnext.financial_statements
-);
+frappe.query_reports["Balance Sheet"] = $.extend({}, erpnext.financial_statements);
 
 erpnext.utils.add_dimensions("Balance Sheet", 10);
 
-frappe.query_reports["Balance Sheet"]["filters"].push(
-	{
-		"fieldname": "selected_view",
-		"label": __("Select View"),
-		"fieldtype": "Select",
-		"options": [
-			{ "value": "Report", "label": __("Report View") },
-			{ "value": "Growth", "label": __("Growth View") }
-		],
-		"default": "Report",
-		"reqd": 1
-	},
-);
+frappe.query_reports["Balance Sheet"]["filters"].push({
+	fieldname: "selected_view",
+	label: __("Select View"),
+	fieldtype: "Select",
+	options: [
+		{ value: "Report", label: __("Report View") },
+		{ value: "Growth", label: __("Growth View") },
+	],
+	default: "Report",
+	reqd: 1,
+});
 
 frappe.query_reports["Balance Sheet"]["filters"].push({
 	fieldname: "accumulated_values",
diff --git a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js
index 8a7d071..e8ae2a1 100644
--- a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js
+++ b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js
@@ -2,37 +2,38 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Bank Clearance Summary"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
-			"width": "80"
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
+			width: "80",
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today()
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname":"account",
-			"label": __("Bank Account"),
-			"fieldtype": "Link",
-			"options": "Account",
-			"reqd": 1,
-			"default": frappe.defaults.get_user_default("Company")?
-				locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]: "",
-			"get_query": function() {
+			fieldname: "account",
+			label: __("Bank Account"),
+			fieldtype: "Link",
+			options: "Account",
+			reqd: 1,
+			default: frappe.defaults.get_user_default("Company")
+				? locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]
+				: "",
+			get_query: function () {
 				return {
-					"query": "erpnext.controllers.queries.get_account_list",
-					"filters": [
-						['Account', 'account_type', 'in', 'Bank, Cash'],
-						['Account', 'is_group', '=', 0],
-					]
-				}
-			}
+					query: "erpnext.controllers.queries.get_account_list",
+					filters: [
+						["Account", "account_type", "in", "Bank, Cash"],
+						["Account", "is_group", "=", 0],
+					],
+				};
+			},
 		},
-	]
-}
+	],
+};
diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js
index 9bb6a14..efcfa7a 100644
--- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js
+++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js
@@ -2,47 +2,48 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Bank Reconciliation Statement"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"reqd": 1,
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname":"account",
-			"label": __("Bank Account"),
-			"fieldtype": "Link",
-			"options": "Account",
-			"default": frappe.defaults.get_user_default("Company")?
-				locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]: "",
-			"reqd": 1,
-			"get_query": function() {
-				var company = frappe.query_report.get_filter_value('company')
+			fieldname: "account",
+			label: __("Bank Account"),
+			fieldtype: "Link",
+			options: "Account",
+			default: frappe.defaults.get_user_default("Company")
+				? locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]
+				: "",
+			reqd: 1,
+			get_query: function () {
+				var company = frappe.query_report.get_filter_value("company");
 				return {
-					"query": "erpnext.controllers.queries.get_account_list",
-					"filters": [
-						['Account', 'account_type', 'in', 'Bank, Cash'],
-						['Account', 'is_group', '=', 0],
-						['Account', 'disabled', '=', 0],
-						['Account', 'company', '=', company],
-					]
-				}
-			}
+					query: "erpnext.controllers.queries.get_account_list",
+					filters: [
+						["Account", "account_type", "in", "Bank, Cash"],
+						["Account", "is_group", "=", 0],
+						["Account", "disabled", "=", 0],
+						["Account", "company", "=", company],
+					],
+				};
+			},
 		},
 		{
-			"fieldname":"report_date",
-			"label": __("Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1
+			fieldname: "report_date",
+			label: __("Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
 		},
 		{
-			"fieldname":"include_pos_transactions",
-			"label": __("Include POS Transactions"),
-			"fieldtype": "Check"
+			fieldname: "include_pos_transactions",
+			label: __("Include POS Transactions"),
+			fieldtype: "Check",
 		},
-	]
-}
+	],
+};
diff --git a/erpnext/accounts/report/billed_items_to_be_received/billed_items_to_be_received.js b/erpnext/accounts/report/billed_items_to_be_received/billed_items_to_be_received.js
index 7617ed1..c8407c2 100644
--- a/erpnext/accounts/report/billed_items_to_be_received/billed_items_to_be_received.js
+++ b/erpnext/accounts/report/billed_items_to_be_received/billed_items_to_be_received.js
@@ -1,29 +1,28 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
-frappe.query_reports['Billed Items To Be Received'] = {
-	'filters': [
+frappe.query_reports["Billed Items To Be Received"] = {
+	filters: [
 		{
-			'label': __('Company'),
-			'fieldname': 'company',
-			'fieldtype': 'Link',
-			'options': 'Company',
-			'reqd': 1,
-			'default': frappe.defaults.get_default('Company')
+			label: __("Company"),
+			fieldname: "company",
+			fieldtype: "Link",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_default("Company"),
 		},
 		{
-			'label': __('As on Date'),
-			'fieldname': 'posting_date',
-			'fieldtype': 'Date',
-			'reqd': 1,
-			'default': frappe.datetime.get_today()
+			label: __("As on Date"),
+			fieldname: "posting_date",
+			fieldtype: "Date",
+			reqd: 1,
+			default: frappe.datetime.get_today(),
 		},
 		{
-			'label': __('Purchase Invoice'),
-			'fieldname': 'purchase_invoice',
-			'fieldtype': 'Link',
-			'options': 'Purchase Invoice'
-		}
-	]
+			label: __("Purchase Invoice"),
+			fieldname: "purchase_invoice",
+			fieldtype: "Link",
+			options: "Purchase Invoice",
+		},
+	],
 };
diff --git a/erpnext/accounts/report/budget_variance_report/budget_variance_report.js b/erpnext/accounts/report/budget_variance_report/budget_variance_report.js
index d6a4755..83bd48c 100644
--- a/erpnext/accounts/report/budget_variance_report/budget_variance_report.js
+++ b/erpnext/accounts/report/budget_variance_report/budget_variance_report.js
@@ -2,37 +2,35 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Budget Variance Report"] = {
-	"filters": get_filters(),
-	"formatter": function (value, row, column, data, default_formatter) {
+	filters: get_filters(),
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 
 		if (column.fieldname.includes(__("variance"))) {
-
 			if (data[column.fieldname] < 0) {
 				value = "<span style='color:red'>" + value + "</span>";
-			}
-			else if (data[column.fieldname] > 0) {
+			} else if (data[column.fieldname] > 0) {
 				value = "<span style='color:green'>" + value + "</span>";
 			}
 		}
 
 		return value;
-	}
-}
+	},
+};
 function get_filters() {
 	function get_dimensions() {
 		let result = [];
 		frappe.call({
 			method: "erpnext.accounts.doctype.accounting_dimension.accounting_dimension.get_dimensions",
 			args: {
-				'with_cost_center_and_project': true
+				with_cost_center_and_project: true,
 			},
 			async: false,
-			callback: function(r) {
-				if(!r.exc) {
-					result = r.message[0].map(elem => elem.document_type);
+			callback: function (r) {
+				if (!r.exc) {
+					result = r.message[0].map((elem) => elem.document_type);
 				}
-			}
+			},
 		});
 		return result;
 	}
@@ -46,7 +44,7 @@
 			fieldtype: "Link",
 			options: "Fiscal Year",
 			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "to_fiscal_year",
@@ -54,20 +52,20 @@
 			fieldtype: "Link",
 			options: "Fiscal Year",
 			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "period",
 			label: __("Period"),
 			fieldtype: "Select",
 			options: [
-				{ "value": "Monthly", "label": __("Monthly") },
-				{ "value": "Quarterly", "label": __("Quarterly") },
-				{ "value": "Half-Yearly", "label": __("Half-Yearly") },
-				{ "value": "Yearly", "label": __("Yearly") }
+				{ value: "Monthly", label: __("Monthly") },
+				{ value: "Quarterly", label: __("Quarterly") },
+				{ value: "Half-Yearly", label: __("Half-Yearly") },
+				{ value: "Yearly", label: __("Yearly") },
 			],
 			default: "Yearly",
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "company",
@@ -75,7 +73,7 @@
 			fieldtype: "Link",
 			options: "Company",
 			default: frappe.defaults.get_user_default("Company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "budget_against",
@@ -84,32 +82,31 @@
 			options: budget_against_options,
 			default: "Cost Center",
 			reqd: 1,
-			on_change: function() {
+			on_change: function () {
 				frappe.query_report.set_filter_value("budget_against_filter", []);
 				frappe.query_report.refresh();
-			}
+			},
 		},
 		{
-			fieldname:"budget_against_filter",
-			label: __('Dimension Filter'),
+			fieldname: "budget_against_filter",
+			label: __("Dimension Filter"),
 			fieldtype: "MultiSelectList",
-			get_data: function(txt) {
+			get_data: function (txt) {
 				if (!frappe.query_report.filters) return;
 
-				let budget_against = frappe.query_report.get_filter_value('budget_against');
+				let budget_against = frappe.query_report.get_filter_value("budget_against");
 				if (!budget_against) return;
 
 				return frappe.db.get_link_options(budget_against, txt);
-			}
+			},
 		},
 		{
-			fieldname:"show_cumulative",
+			fieldname: "show_cumulative",
 			label: __("Show Cumulative Amount"),
 			fieldtype: "Check",
 			default: 0,
 		},
-	]
+	];
 
 	return filters;
 }
-
diff --git a/erpnext/accounts/report/cash_flow/cash_flow.js b/erpnext/accounts/report/cash_flow/cash_flow.js
index ef17eb1..c824f0d 100644
--- a/erpnext/accounts/report/cash_flow/cash_flow.js
+++ b/erpnext/accounts/report/cash_flow/cash_flow.js
@@ -1,12 +1,9 @@
 // Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.query_reports["Cash Flow"] = $.extend(
-	{},
-	erpnext.financial_statements
-);
+frappe.query_reports["Cash Flow"] = $.extend({}, erpnext.financial_statements);
 
-erpnext.utils.add_dimensions('Cash Flow', 10);
+erpnext.utils.add_dimensions("Cash Flow", 10);
 
 // The last item in the array is the definition for Presentation Currency
 // filter. It won't be used in cash flow for now so we pop it. Please take
@@ -14,11 +11,9 @@
 
 frappe.query_reports["Cash Flow"]["filters"].splice(8, 1);
 
-frappe.query_reports["Cash Flow"]["filters"].push(
-	{
-		"fieldname": "include_default_book_entries",
-		"label": __("Include Default FB Entries"),
-		"fieldtype": "Check",
-		"default": 1
-	}
-);
+frappe.query_reports["Cash Flow"]["filters"].push({
+	fieldname: "include_default_book_entries",
+	label: __("Include Default FB Entries"),
+	fieldtype: "Check",
+	default: 1,
+});
diff --git a/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.js b/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.js
index 6210fd1..5cd12aa 100644
--- a/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.js
+++ b/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.js
@@ -1,121 +1,145 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Consolidated Financial Statement"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname":"filter_based_on",
-			"label": __("Filter Based On"),
-			"fieldtype": "Select",
-			"options": ["Fiscal Year", "Date Range"],
-			"default": ["Fiscal Year"],
-			"reqd": 1,
-			on_change: function() {
-				let filter_based_on = frappe.query_report.get_filter_value('filter_based_on');
-				frappe.query_report.toggle_filter_display('from_fiscal_year', filter_based_on === 'Date Range');
-				frappe.query_report.toggle_filter_display('to_fiscal_year', filter_based_on === 'Date Range');
-				frappe.query_report.toggle_filter_display('period_start_date', filter_based_on === 'Fiscal Year');
-				frappe.query_report.toggle_filter_display('period_end_date', filter_based_on === 'Fiscal Year');
+			fieldname: "filter_based_on",
+			label: __("Filter Based On"),
+			fieldtype: "Select",
+			options: ["Fiscal Year", "Date Range"],
+			default: ["Fiscal Year"],
+			reqd: 1,
+			on_change: function () {
+				let filter_based_on = frappe.query_report.get_filter_value("filter_based_on");
+				frappe.query_report.toggle_filter_display(
+					"from_fiscal_year",
+					filter_based_on === "Date Range"
+				);
+				frappe.query_report.toggle_filter_display("to_fiscal_year", filter_based_on === "Date Range");
+				frappe.query_report.toggle_filter_display(
+					"period_start_date",
+					filter_based_on === "Fiscal Year"
+				);
+				frappe.query_report.toggle_filter_display(
+					"period_end_date",
+					filter_based_on === "Fiscal Year"
+				);
 
 				frappe.query_report.refresh();
-			}
+			},
 		},
 		{
-			"fieldname":"period_start_date",
-			"label": __("Start Date"),
-			"fieldtype": "Date",
-			"hidden": 1,
-			"reqd": 1
+			fieldname: "period_start_date",
+			label: __("Start Date"),
+			fieldtype: "Date",
+			hidden: 1,
+			reqd: 1,
 		},
 		{
-			"fieldname":"period_end_date",
-			"label": __("End Date"),
-			"fieldtype": "Date",
-			"hidden": 1,
-			"reqd": 1
+			fieldname: "period_end_date",
+			label: __("End Date"),
+			fieldtype: "Date",
+			hidden: 1,
+			reqd: 1,
 		},
 		{
-			"fieldname":"from_fiscal_year",
-			"label": __("Start Year"),
-			"fieldtype": "Link",
-			"options": "Fiscal Year",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
-			"reqd": 1,
+			fieldname: "from_fiscal_year",
+			label: __("Start Year"),
+			fieldtype: "Link",
+			options: "Fiscal Year",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
+			reqd: 1,
 			on_change: () => {
-				frappe.model.with_doc("Fiscal Year", frappe.query_report.get_filter_value('from_fiscal_year'), function(r) {
-					let year_start_date = frappe.model.get_value("Fiscal Year", frappe.query_report.get_filter_value('from_fiscal_year'), "year_start_date");
-					frappe.query_report.set_filter_value({
-						period_start_date: year_start_date
-					});
-				});
-			}
+				frappe.model.with_doc(
+					"Fiscal Year",
+					frappe.query_report.get_filter_value("from_fiscal_year"),
+					function (r) {
+						let year_start_date = frappe.model.get_value(
+							"Fiscal Year",
+							frappe.query_report.get_filter_value("from_fiscal_year"),
+							"year_start_date"
+						);
+						frappe.query_report.set_filter_value({
+							period_start_date: year_start_date,
+						});
+					}
+				);
+			},
 		},
 		{
-			"fieldname":"to_fiscal_year",
-			"label": __("End Year"),
-			"fieldtype": "Link",
-			"options": "Fiscal Year",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
-			"reqd": 1,
+			fieldname: "to_fiscal_year",
+			label: __("End Year"),
+			fieldtype: "Link",
+			options: "Fiscal Year",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
+			reqd: 1,
 			on_change: () => {
-				frappe.model.with_doc("Fiscal Year", frappe.query_report.get_filter_value('to_fiscal_year'), function(r) {
-					let year_end_date = frappe.model.get_value("Fiscal Year", frappe.query_report.get_filter_value('to_fiscal_year'), "year_end_date");
-					frappe.query_report.set_filter_value({
-						period_end_date: year_end_date
-					});
-				});
-			}
+				frappe.model.with_doc(
+					"Fiscal Year",
+					frappe.query_report.get_filter_value("to_fiscal_year"),
+					function (r) {
+						let year_end_date = frappe.model.get_value(
+							"Fiscal Year",
+							frappe.query_report.get_filter_value("to_fiscal_year"),
+							"year_end_date"
+						);
+						frappe.query_report.set_filter_value({
+							period_end_date: year_end_date,
+						});
+					}
+				);
+			},
 		},
 		{
-			"fieldname":"finance_book",
-			"label": __("Finance Book"),
-			"fieldtype": "Link",
-			"options": "Finance Book"
+			fieldname: "finance_book",
+			label: __("Finance Book"),
+			fieldtype: "Link",
+			options: "Finance Book",
 		},
 		{
-			"fieldname":"report",
-			"label": __("Report"),
-			"fieldtype": "Select",
-			"options": ["Profit and Loss Statement", "Balance Sheet", "Cash Flow"],
-			"default": "Balance Sheet",
-			"reqd": 1
+			fieldname: "report",
+			label: __("Report"),
+			fieldtype: "Select",
+			options: ["Profit and Loss Statement", "Balance Sheet", "Cash Flow"],
+			default: "Balance Sheet",
+			reqd: 1,
 		},
 		{
-			"fieldname": "presentation_currency",
-			"label": __("Currency"),
-			"fieldtype": "Select",
-			"options": erpnext.get_presentation_currency_list(),
-			"default": frappe.defaults.get_user_default("Currency")
+			fieldname: "presentation_currency",
+			label: __("Currency"),
+			fieldtype: "Select",
+			options: erpnext.get_presentation_currency_list(),
+			default: frappe.defaults.get_user_default("Currency"),
 		},
 		{
-			"fieldname":"accumulated_in_group_company",
-			"label": __("Accumulated Values in Group Company"),
-			"fieldtype": "Check",
-			"default": 0
+			fieldname: "accumulated_in_group_company",
+			label: __("Accumulated Values in Group Company"),
+			fieldtype: "Check",
+			default: 0,
 		},
 		{
-			"fieldname": "include_default_book_entries",
-			"label": __("Include Default FB Entries"),
-			"fieldtype": "Check",
-			"default": 1
+			fieldname: "include_default_book_entries",
+			label: __("Include Default FB Entries"),
+			fieldtype: "Check",
+			default: 1,
 		},
 		{
-			"fieldname": "show_zero_values",
-			"label": __("Show zero values"),
-			"fieldtype": "Check"
-		}
+			fieldname: "show_zero_values",
+			label: __("Show zero values"),
+			fieldtype: "Check",
+		},
 	],
-	"formatter": function(value, row, column, data, default_formatter) {
-		if (data && column.fieldname=="account") {
+	formatter: function (value, row, column, data, default_formatter) {
+		if (data && column.fieldname == "account") {
 			value = data.account_name || value;
 
 			column.link_onclick =
@@ -137,15 +161,15 @@
 		}
 		return value;
 	},
-	onload: function() {
+	onload: function () {
 		let fiscal_year = erpnext.utils.get_fiscal_year(frappe.datetime.get_today());
 
-		frappe.model.with_doc("Fiscal Year", fiscal_year, function(r) {
+		frappe.model.with_doc("Fiscal Year", fiscal_year, function (r) {
 			var fy = frappe.model.get_doc("Fiscal Year", fiscal_year);
 			frappe.query_report.set_filter_value({
 				period_start_date: fy.year_start_date,
-				period_end_date: fy.year_end_date
+				period_end_date: fy.year_end_date,
 			});
 		});
-	}
-}
+	},
+};
diff --git a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.js b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.js
index 74d52de..3600db8 100644
--- a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.js
+++ b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.js
@@ -1,97 +1,96 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Customer Ledger Summary"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-			"reqd": 1,
-			"width": "60px"
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			reqd: 1,
+			width: "60px",
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1,
-			"width": "60px"
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
+			width: "60px",
 		},
 		{
-			"fieldname":"finance_book",
-			"label": __("Finance Book"),
-			"fieldtype": "Link",
-			"options": "Finance Book"
+			fieldname: "finance_book",
+			label: __("Finance Book"),
+			fieldtype: "Link",
+			options: "Finance Book",
 		},
 		{
-			"fieldname":"party",
-			"label": __("Customer"),
-			"fieldtype": "Link",
-			"options": "Customer",
+			fieldname: "party",
+			label: __("Customer"),
+			fieldtype: "Link",
+			options: "Customer",
 			on_change: () => {
-				var party = frappe.query_report.get_filter_value('party');
+				var party = frappe.query_report.get_filter_value("party");
 				if (party) {
-					frappe.db.get_value('Customer', party, ["tax_id", "customer_name"], function(value) {
-						frappe.query_report.set_filter_value('tax_id', value["tax_id"]);
-						frappe.query_report.set_filter_value('customer_name', value["customer_name"]);
+					frappe.db.get_value("Customer", party, ["tax_id", "customer_name"], function (value) {
+						frappe.query_report.set_filter_value("tax_id", value["tax_id"]);
+						frappe.query_report.set_filter_value("customer_name", value["customer_name"]);
 					});
 				} else {
-					frappe.query_report.set_filter_value('tax_id', "");
-					frappe.query_report.set_filter_value('customer_name', "");
+					frappe.query_report.set_filter_value("tax_id", "");
+					frappe.query_report.set_filter_value("customer_name", "");
 				}
-			}
+			},
 		},
 		{
-			"fieldname":"customer_group",
-			"label": __("Customer Group"),
-			"fieldtype": "Link",
-			"options": "Customer Group"
+			fieldname: "customer_group",
+			label: __("Customer Group"),
+			fieldtype: "Link",
+			options: "Customer Group",
 		},
 		{
-			"fieldname":"payment_terms_template",
-			"label": __("Payment Terms Template"),
-			"fieldtype": "Link",
-			"options": "Payment Terms Template"
+			fieldname: "payment_terms_template",
+			label: __("Payment Terms Template"),
+			fieldtype: "Link",
+			options: "Payment Terms Template",
 		},
 		{
-			"fieldname":"territory",
-			"label": __("Territory"),
-			"fieldtype": "Link",
-			"options": "Territory"
+			fieldname: "territory",
+			label: __("Territory"),
+			fieldtype: "Link",
+			options: "Territory",
 		},
 		{
-			"fieldname":"sales_partner",
-			"label": __("Sales Partner"),
-			"fieldtype": "Link",
-			"options": "Sales Partner"
+			fieldname: "sales_partner",
+			label: __("Sales Partner"),
+			fieldtype: "Link",
+			options: "Sales Partner",
 		},
 		{
-			"fieldname":"sales_person",
-			"label": __("Sales Person"),
-			"fieldtype": "Link",
-			"options": "Sales Person"
+			fieldname: "sales_person",
+			label: __("Sales Person"),
+			fieldtype: "Link",
+			options: "Sales Person",
 		},
 		{
-			"fieldname":"tax_id",
-			"label": __("Tax Id"),
-			"fieldtype": "Data",
-			"hidden": 1
+			fieldname: "tax_id",
+			label: __("Tax Id"),
+			fieldtype: "Data",
+			hidden: 1,
 		},
 		{
-			"fieldname":"customer_name",
-			"label": __("Customer Name"),
-			"fieldtype": "Data",
-			"hidden": 1
-		}
-	]
+			fieldname: "customer_name",
+			label: __("Customer Name"),
+			fieldtype: "Data",
+			hidden: 1,
+		},
+	],
 };
diff --git a/erpnext/accounts/report/deferred_revenue_and_expense/deferred_revenue_and_expense.js b/erpnext/accounts/report/deferred_revenue_and_expense/deferred_revenue_and_expense.js
index eec904e..3540200 100644
--- a/erpnext/accounts/report/deferred_revenue_and_expense/deferred_revenue_and_expense.js
+++ b/erpnext/accounts/report/deferred_revenue_and_expense/deferred_revenue_and_expense.js
@@ -1,114 +1,121 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 function get_filters() {
 	let filters = [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname":"filter_based_on",
-			"label": __("Filter Based On"),
-			"fieldtype": "Select",
-			"options": ["Fiscal Year", "Date Range"],
-			"default": ["Fiscal Year"],
-			"reqd": 1,
-			on_change: function() {
-				let filter_based_on = frappe.query_report.get_filter_value('filter_based_on');
-				frappe.query_report.toggle_filter_display('from_fiscal_year', filter_based_on === 'Date Range');
-				frappe.query_report.toggle_filter_display('to_fiscal_year', filter_based_on === 'Date Range');
-				frappe.query_report.toggle_filter_display('period_start_date', filter_based_on === 'Fiscal Year');
-				frappe.query_report.toggle_filter_display('period_end_date', filter_based_on === 'Fiscal Year');
+			fieldname: "filter_based_on",
+			label: __("Filter Based On"),
+			fieldtype: "Select",
+			options: ["Fiscal Year", "Date Range"],
+			default: ["Fiscal Year"],
+			reqd: 1,
+			on_change: function () {
+				let filter_based_on = frappe.query_report.get_filter_value("filter_based_on");
+				frappe.query_report.toggle_filter_display(
+					"from_fiscal_year",
+					filter_based_on === "Date Range"
+				);
+				frappe.query_report.toggle_filter_display("to_fiscal_year", filter_based_on === "Date Range");
+				frappe.query_report.toggle_filter_display(
+					"period_start_date",
+					filter_based_on === "Fiscal Year"
+				);
+				frappe.query_report.toggle_filter_display(
+					"period_end_date",
+					filter_based_on === "Fiscal Year"
+				);
 
 				frappe.query_report.refresh();
-			}
+			},
 		},
 		{
-			"fieldname":"period_start_date",
-			"label": __("Start Date"),
-			"fieldtype": "Date",
-			"hidden": 1,
-			"reqd": 1
+			fieldname: "period_start_date",
+			label: __("Start Date"),
+			fieldtype: "Date",
+			hidden: 1,
+			reqd: 1,
 		},
 		{
-			"fieldname":"period_end_date",
-			"label": __("End Date"),
-			"fieldtype": "Date",
-			"hidden": 1,
-			"reqd": 1
+			fieldname: "period_end_date",
+			label: __("End Date"),
+			fieldtype: "Date",
+			hidden: 1,
+			reqd: 1,
 		},
 		{
-			"fieldname":"from_fiscal_year",
-			"label": __("Start Year"),
-			"fieldtype": "Link",
-			"options": "Fiscal Year",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
-			"reqd": 1
+			fieldname: "from_fiscal_year",
+			label: __("Start Year"),
+			fieldtype: "Link",
+			options: "Fiscal Year",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
+			reqd: 1,
 		},
 		{
-			"fieldname":"to_fiscal_year",
-			"label": __("End Year"),
-			"fieldtype": "Link",
-			"options": "Fiscal Year",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
-			"reqd": 1
+			fieldname: "to_fiscal_year",
+			label: __("End Year"),
+			fieldtype: "Link",
+			options: "Fiscal Year",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
+			reqd: 1,
 		},
 		{
-			"fieldname": "periodicity",
-			"label": __("Periodicity"),
-			"fieldtype": "Select",
-			"options": [
-				{ "value": "Monthly", "label": __("Monthly") },
-				{ "value": "Quarterly", "label": __("Quarterly") },
-				{ "value": "Half-Yearly", "label": __("Half-Yearly") },
-				{ "value": "Yearly", "label": __("Yearly") }
+			fieldname: "periodicity",
+			label: __("Periodicity"),
+			fieldtype: "Select",
+			options: [
+				{ value: "Monthly", label: __("Monthly") },
+				{ value: "Quarterly", label: __("Quarterly") },
+				{ value: "Half-Yearly", label: __("Half-Yearly") },
+				{ value: "Yearly", label: __("Yearly") },
 			],
-			"default": "Monthly",
-			"reqd": 1
+			default: "Monthly",
+			reqd: 1,
 		},
 		{
-			"fieldname": "type",
-			"label": __("Invoice Type"),
-			"fieldtype": "Select",
-			"options": [
-				{ "value": "Revenue", "label": __("Revenue") },
-				{ "value": "Expense", "label": __("Expense") }
+			fieldname: "type",
+			label: __("Invoice Type"),
+			fieldtype: "Select",
+			options: [
+				{ value: "Revenue", label: __("Revenue") },
+				{ value: "Expense", label: __("Expense") },
 			],
-			"default": "Revenue",
-			"reqd": 1
+			default: "Revenue",
+			reqd: 1,
 		},
 		{
-			"fieldname" : "with_upcoming_postings",
-			"label": __("Show with upcoming revenue/expense"),
-			"fieldtype": "Check",
-			"default": 1
-		}
-	]
+			fieldname: "with_upcoming_postings",
+			label: __("Show with upcoming revenue/expense"),
+			fieldtype: "Check",
+			default: 1,
+		},
+	];
 
 	return filters;
 }
 
 frappe.query_reports["Deferred Revenue and Expense"] = {
-	"filters": get_filters(),
-	"formatter": function(value, row, column, data, default_formatter){
+	filters: get_filters(),
+	formatter: function (value, row, column, data, default_formatter) {
 		return default_formatter(value, row, column, data);
 	},
-	onload: function(report){
+	onload: function (report) {
 		let fiscal_year = erpnext.utils.get_fiscal_year(frappe.datetime.get_today());
 
-		frappe.model.with_doc("Fiscal Year", fiscal_year, function(r) {
+		frappe.model.with_doc("Fiscal Year", fiscal_year, function (r) {
 			var fy = frappe.model.get_doc("Fiscal Year", fiscal_year);
 			frappe.query_report.set_filter_value({
 				period_start_date: fy.year_start_date,
-				period_end_date: fy.year_end_date
+				period_end_date: fy.year_end_date,
 			});
 		});
-	}
+	},
 };
-
diff --git a/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.js b/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.js
index 1454b2c..f6051d7 100644
--- a/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.js
+++ b/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.js
@@ -2,7 +2,5 @@
 // For license information, please see license.txt
 
 frappe.query_reports["Delivered Items To Be Billed"] = {
-	"filters": [
-
-	]
-}
+	filters: [],
+};
diff --git a/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.js b/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.js
index 51fa8c8..20c34e3 100644
--- a/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.js
+++ b/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.js
@@ -1,82 +1,79 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Dimension-wise Accounts Balance Report"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname": "fiscal_year",
-			"label": __("Fiscal Year"),
-			"fieldtype": "Link",
-			"options": "Fiscal Year",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
-			"reqd": 1,
-			"on_change": function(query_report) {
+			fieldname: "fiscal_year",
+			label: __("Fiscal Year"),
+			fieldtype: "Link",
+			options: "Fiscal Year",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
+			reqd: 1,
+			on_change: function (query_report) {
 				var fiscal_year = query_report.get_values().fiscal_year;
 				if (!fiscal_year) {
 					return;
 				}
-				frappe.model.with_doc("Fiscal Year", fiscal_year, function(r) {
+				frappe.model.with_doc("Fiscal Year", fiscal_year, function (r) {
 					var fy = frappe.model.get_doc("Fiscal Year", fiscal_year);
 					frappe.query_report.set_filter_value({
 						from_date: fy.year_start_date,
-						to_date: fy.year_end_date
+						to_date: fy.year_end_date,
 					});
 				});
-			}
+			},
 		},
 		{
-			"fieldname": "from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
-			"reqd": 1
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
+			reqd: 1,
 		},
 		{
-			"fieldname": "to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
-			"reqd": 1
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
+			reqd: 1,
 		},
 		{
-			"fieldname": "finance_book",
-			"label": __("Finance Book"),
-			"fieldtype": "Link",
-			"options": "Finance Book",
+			fieldname: "finance_book",
+			label: __("Finance Book"),
+			fieldtype: "Link",
+			options: "Finance Book",
 		},
 		{
-			"fieldname": "dimension",
-			"label": __("Select Dimension"),
-			"fieldtype": "Select",
-			"default": "Cost Center",
-			"options": get_accounting_dimension_options(),
-			"reqd": 1,
+			fieldname: "dimension",
+			label: __("Select Dimension"),
+			fieldtype: "Select",
+			default: "Cost Center",
+			options: get_accounting_dimension_options(),
+			reqd: 1,
 		},
 	],
-	"formatter": erpnext.financial_statements.formatter,
-	"tree": true,
-	"name_field": "account",
-	"parent_field": "parent_account",
-	"initial_depth": 3
-}
-
+	formatter: erpnext.financial_statements.formatter,
+	tree: true,
+	name_field: "account",
+	parent_field: "parent_account",
+	initial_depth: 3,
+};
 
 function get_accounting_dimension_options() {
-	let options =["Cost Center", "Project"];
-	frappe.db.get_list('Accounting Dimension',
-			   {fields:['document_type']}).then((res) => {
-				   res.forEach((dimension) => {
-					   options.push(dimension.document_type);
-				   });
-			   });
-	return options
+	let options = ["Cost Center", "Project"];
+	frappe.db.get_list("Accounting Dimension", { fields: ["document_type"] }).then((res) => {
+		res.forEach((dimension) => {
+			options.push(dimension.document_type);
+		});
+	});
+	return options;
 }
diff --git a/erpnext/accounts/report/financial_ratios/financial_ratios.js b/erpnext/accounts/report/financial_ratios/financial_ratios.js
index 643423d..c0ae31d 100644
--- a/erpnext/accounts/report/financial_ratios/financial_ratios.js
+++ b/erpnext/accounts/report/financial_ratios/financial_ratios.js
@@ -51,9 +51,8 @@
 			hidden: 1,
 		},
 	],
-	"formatter": function(value, row, column, data, default_formatter) {
-
-		let heading_ratios = ["Liquidity Ratios", "Solvency Ratios","Turnover Ratios"]
+	formatter: function (value, row, column, data, default_formatter) {
+		let heading_ratios = ["Liquidity Ratios", "Solvency Ratios", "Turnover Ratios"];
 
 		if (heading_ratios.includes(value)) {
 			value = $(`<span>${value}</span>`);
diff --git a/erpnext/accounts/report/general_and_payment_ledger_comparison/general_and_payment_ledger_comparison.js b/erpnext/accounts/report/general_and_payment_ledger_comparison/general_and_payment_ledger_comparison.js
index 7e6b053..4eadf34 100644
--- a/erpnext/accounts/report/general_and_payment_ledger_comparison/general_and_payment_ledger_comparison.js
+++ b/erpnext/accounts/report/general_and_payment_ledger_comparison/general_and_payment_ledger_comparison.js
@@ -4,49 +4,49 @@
 function get_filters() {
 	let filters = [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname":"period_start_date",
-			"label": __("Start Date"),
-			"fieldtype": "Date",
-			"reqd": 1,
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1)
+			fieldname: "period_start_date",
+			label: __("Start Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
 		},
 		{
-			"fieldname":"period_end_date",
-			"label": __("End Date"),
-			"fieldtype": "Date",
-			"reqd": 1,
-			"default": frappe.datetime.get_today()
+			fieldname: "period_end_date",
+			label: __("End Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname":"account",
-			"label": __("Account"),
-			"fieldtype": "MultiSelectList",
-			"options": "Account",
-			get_data: function(txt) {
-				return frappe.db.get_link_options('Account', txt, {
+			fieldname: "account",
+			label: __("Account"),
+			fieldtype: "MultiSelectList",
+			options: "Account",
+			get_data: function (txt) {
+				return frappe.db.get_link_options("Account", txt, {
 					company: frappe.query_report.get_filter_value("company"),
-					account_type: ['in', ["Receivable", "Payable"]]
+					account_type: ["in", ["Receivable", "Payable"]],
 				});
-			}
+			},
 		},
 		{
-			"fieldname":"voucher_no",
-			"label": __("Voucher No"),
-			"fieldtype": "Data",
-			"width": 100,
+			fieldname: "voucher_no",
+			label: __("Voucher No"),
+			fieldtype: "Data",
+			width: 100,
 		},
-	]
+	];
 	return filters;
 }
 
 frappe.query_reports["General and Payment Ledger Comparison"] = {
-	"filters": get_filters()
+	filters: get_filters(),
 };
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.js b/erpnext/accounts/report/general_ledger/general_ledger.js
index b7b9d34..1894e95 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.js
+++ b/erpnext/accounts/report/general_ledger/general_ledger.js
@@ -2,119 +2,119 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["General Ledger"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname":"finance_book",
-			"label": __("Finance Book"),
-			"fieldtype": "Link",
-			"options": "Finance Book"
+			fieldname: "finance_book",
+			label: __("Finance Book"),
+			fieldtype: "Link",
+			options: "Finance Book",
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-			"reqd": 1,
-			"width": "60px"
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			reqd: 1,
+			width: "60px",
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1,
-			"width": "60px"
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
+			width: "60px",
 		},
 		{
-			"fieldname":"account",
-			"label": __("Account"),
-			"fieldtype": "MultiSelectList",
-			"options": "Account",
-			get_data: function(txt) {
-				return frappe.db.get_link_options('Account', txt, {
-					company: frappe.query_report.get_filter_value("company")
+			fieldname: "account",
+			label: __("Account"),
+			fieldtype: "MultiSelectList",
+			options: "Account",
+			get_data: function (txt) {
+				return frappe.db.get_link_options("Account", txt, {
+					company: frappe.query_report.get_filter_value("company"),
 				});
-			}
+			},
 		},
 		{
-			"fieldname":"voucher_no",
-			"label": __("Voucher No"),
-			"fieldtype": "Data",
-			on_change: function() {
-				frappe.query_report.set_filter_value('group_by', "Group by Voucher (Consolidated)");
-			}
+			fieldname: "voucher_no",
+			label: __("Voucher No"),
+			fieldtype: "Data",
+			on_change: function () {
+				frappe.query_report.set_filter_value("group_by", "Group by Voucher (Consolidated)");
+			},
 		},
 		{
-			"fieldname":"against_voucher_no",
-			"label": __("Against Voucher No"),
-			"fieldtype": "Data",
+			fieldname: "against_voucher_no",
+			label: __("Against Voucher No"),
+			fieldtype: "Data",
 		},
 		{
-			"fieldtype": "Break",
+			fieldtype: "Break",
 		},
 		{
-			"fieldname":"party_type",
-			"label": __("Party Type"),
-			"fieldtype": "Autocomplete",
+			fieldname: "party_type",
+			label: __("Party Type"),
+			fieldtype: "Autocomplete",
 			options: Object.keys(frappe.boot.party_account_types),
-			on_change: function() {
-				frappe.query_report.set_filter_value('party', "");
-			}
+			on_change: function () {
+				frappe.query_report.set_filter_value("party", "");
+			},
 		},
 		{
-			"fieldname":"party",
-			"label": __("Party"),
-			"fieldtype": "MultiSelectList",
-			get_data: function(txt) {
+			fieldname: "party",
+			label: __("Party"),
+			fieldtype: "MultiSelectList",
+			get_data: function (txt) {
 				if (!frappe.query_report.filters) return;
 
-				let party_type = frappe.query_report.get_filter_value('party_type');
+				let party_type = frappe.query_report.get_filter_value("party_type");
 				if (!party_type) return;
 
 				return frappe.db.get_link_options(party_type, txt);
 			},
-			on_change: function() {
-				var party_type = frappe.query_report.get_filter_value('party_type');
-				var parties = frappe.query_report.get_filter_value('party');
+			on_change: function () {
+				var party_type = frappe.query_report.get_filter_value("party_type");
+				var parties = frappe.query_report.get_filter_value("party");
 
-				if(!party_type || parties.length === 0 || parties.length > 1) {
-					frappe.query_report.set_filter_value('party_name', "");
-					frappe.query_report.set_filter_value('tax_id', "");
+				if (!party_type || parties.length === 0 || parties.length > 1) {
+					frappe.query_report.set_filter_value("party_name", "");
+					frappe.query_report.set_filter_value("tax_id", "");
 					return;
 				} else {
 					var party = parties[0];
 					var fieldname = erpnext.utils.get_party_name(party_type) || "name";
-					frappe.db.get_value(party_type, party, fieldname, function(value) {
-						frappe.query_report.set_filter_value('party_name', value[fieldname]);
+					frappe.db.get_value(party_type, party, fieldname, function (value) {
+						frappe.query_report.set_filter_value("party_name", value[fieldname]);
 					});
 
 					if (party_type === "Customer" || party_type === "Supplier") {
-						frappe.db.get_value(party_type, party, "tax_id", function(value) {
-							frappe.query_report.set_filter_value('tax_id', value["tax_id"]);
+						frappe.db.get_value(party_type, party, "tax_id", function (value) {
+							frappe.query_report.set_filter_value("tax_id", value["tax_id"]);
 						});
 					}
 				}
-			}
+			},
 		},
 		{
-			"fieldname":"party_name",
-			"label": __("Party Name"),
-			"fieldtype": "Data",
-			"hidden": 1
+			fieldname: "party_name",
+			label: __("Party Name"),
+			fieldtype: "Data",
+			hidden: 1,
 		},
 		{
-			"fieldname":"group_by",
-			"label": __("Group by"),
-			"fieldtype": "Select",
-			"options": [
+			fieldname: "group_by",
+			label: __("Group by"),
+			fieldtype: "Select",
+			options: [
 				"",
 				{
 					label: __("Group by Voucher"),
@@ -133,85 +133,83 @@
 					value: "Group by Party",
 				},
 			],
-			"default": "Group by Voucher (Consolidated)"
+			default: "Group by Voucher (Consolidated)",
 		},
 		{
-			"fieldname":"tax_id",
-			"label": __("Tax Id"),
-			"fieldtype": "Data",
-			"hidden": 1
+			fieldname: "tax_id",
+			label: __("Tax Id"),
+			fieldtype: "Data",
+			hidden: 1,
 		},
 		{
-			"fieldname": "presentation_currency",
-			"label": __("Currency"),
-			"fieldtype": "Select",
-			"options": erpnext.get_presentation_currency_list()
+			fieldname: "presentation_currency",
+			label: __("Currency"),
+			fieldtype: "Select",
+			options: erpnext.get_presentation_currency_list(),
 		},
 		{
-			"fieldname":"cost_center",
-			"label": __("Cost Center"),
-			"fieldtype": "MultiSelectList",
-			get_data: function(txt) {
-				return frappe.db.get_link_options('Cost Center', txt, {
-					company: frappe.query_report.get_filter_value("company")
+			fieldname: "cost_center",
+			label: __("Cost Center"),
+			fieldtype: "MultiSelectList",
+			get_data: function (txt) {
+				return frappe.db.get_link_options("Cost Center", txt, {
+					company: frappe.query_report.get_filter_value("company"),
 				});
-			}
+			},
 		},
 		{
-			"fieldname":"project",
-			"label": __("Project"),
-			"fieldtype": "MultiSelectList",
-			get_data: function(txt) {
-				return frappe.db.get_link_options('Project', txt, {
-					company: frappe.query_report.get_filter_value("company")
+			fieldname: "project",
+			label: __("Project"),
+			fieldtype: "MultiSelectList",
+			get_data: function (txt) {
+				return frappe.db.get_link_options("Project", txt, {
+					company: frappe.query_report.get_filter_value("company"),
 				});
-			}
+			},
 		},
 		{
-			"fieldname": "include_dimensions",
-			"label": __("Consider Accounting Dimensions"),
-			"fieldtype": "Check",
-			"default": 1
+			fieldname: "include_dimensions",
+			label: __("Consider Accounting Dimensions"),
+			fieldtype: "Check",
+			default: 1,
 		},
 		{
-			"fieldname": "show_opening_entries",
-			"label": __("Show Opening Entries"),
-			"fieldtype": "Check"
+			fieldname: "show_opening_entries",
+			label: __("Show Opening Entries"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "include_default_book_entries",
-			"label": __("Include Default FB Entries"),
-			"fieldtype": "Check",
-			"default": 1
+			fieldname: "include_default_book_entries",
+			label: __("Include Default FB Entries"),
+			fieldtype: "Check",
+			default: 1,
 		},
 		{
-			"fieldname": "show_cancelled_entries",
-			"label": __("Show Cancelled Entries"),
-			"fieldtype": "Check"
+			fieldname: "show_cancelled_entries",
+			label: __("Show Cancelled Entries"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "show_net_values_in_party_account",
-			"label": __("Show Net Values in Party Account"),
-			"fieldtype": "Check"
+			fieldname: "show_net_values_in_party_account",
+			label: __("Show Net Values in Party Account"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "add_values_in_transaction_currency",
-			"label": __("Add Columns in Transaction Currency"),
-			"fieldtype": "Check"
+			fieldname: "add_values_in_transaction_currency",
+			label: __("Add Columns in Transaction Currency"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "show_remarks",
-			"label": __("Show Remarks"),
-			"fieldtype": "Check"
+			fieldname: "show_remarks",
+			label: __("Show Remarks"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "ignore_err",
-			"label": __("Ignore Exchange Rate Revaluation Journals"),
-			"fieldtype": "Check"
-		}
+			fieldname: "ignore_err",
+			label: __("Ignore Exchange Rate Revaluation Journals"),
+			fieldtype: "Check",
+		},
+	],
+};
 
-
-	]
-}
-
-erpnext.utils.add_dimensions('General Ledger', 15)
+erpnext.utils.add_dimensions("General Ledger", 15);
diff --git a/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.js b/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.js
index 40d4259..2448eef 100644
--- a/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.js
+++ b/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.js
@@ -1,16 +1,10 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
+frappe.query_reports["Gross and Net Profit Report"] = $.extend({}, erpnext.financial_statements);
 
-frappe.query_reports["Gross and Net Profit Report"] = $.extend(
-	{},
-	erpnext.financial_statements
-);
-
-frappe.query_reports["Gross and Net Profit Report"]["filters"].push(
-	{
-		"fieldname": "accumulated_values",
-		"label": __("Accumulated Values"),
-		"fieldtype": "Check"
-	}
-);
+frappe.query_reports["Gross and Net Profit Report"]["filters"].push({
+	fieldname: "accumulated_values",
+	label: __("Accumulated Values"),
+	fieldtype: "Check",
+});
diff --git a/erpnext/accounts/report/gross_profit/gross_profit.js b/erpnext/accounts/report/gross_profit/gross_profit.js
index 7520548..fad6586 100644
--- a/erpnext/accounts/report/gross_profit/gross_profit.js
+++ b/erpnext/accounts/report/gross_profit/gross_profit.js
@@ -2,74 +2,73 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Gross Profit"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname": "from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
-			"reqd": 1
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
+			reqd: 1,
 		},
 		{
-			"fieldname": "to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
-			"reqd": 1
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
+			reqd: 1,
 		},
 		{
-			"fieldname": "sales_invoice",
-			"label": __("Sales Invoice"),
-			"fieldtype": "Link",
-			"options": "Sales Invoice"
+			fieldname: "sales_invoice",
+			label: __("Sales Invoice"),
+			fieldtype: "Link",
+			options: "Sales Invoice",
 		},
 		{
-			"fieldname": "group_by",
-			"label": __("Group By"),
-			"fieldtype": "Select",
-			"options": "Invoice\nItem Code\nItem Group\nBrand\nWarehouse\nCustomer\nCustomer Group\nTerritory\nSales Person\nProject\nMonthly\nPayment Term",
-			"default": "Invoice"
+			fieldname: "group_by",
+			label: __("Group By"),
+			fieldtype: "Select",
+			options:
+				"Invoice\nItem Code\nItem Group\nBrand\nWarehouse\nCustomer\nCustomer Group\nTerritory\nSales Person\nProject\nMonthly\nPayment Term",
+			default: "Invoice",
 		},
 		{
-			"fieldname": "item_group",
-			"label": __("Item Group"),
-			"fieldtype": "Link",
-			"options": "Item Group"
+			fieldname: "item_group",
+			label: __("Item Group"),
+			fieldtype: "Link",
+			options: "Item Group",
 		},
 		{
-			"fieldname": "sales_person",
-			"label": __("Sales Person"),
-			"fieldtype": "Link",
-			"options": "Sales Person"
+			fieldname: "sales_person",
+			label: __("Sales Person"),
+			fieldtype: "Link",
+			options: "Sales Person",
 		},
 		{
-			"fieldname": "warehouse",
-			"label": __("Warehouse"),
-			"fieldtype": "Link",
-			"options": "Warehouse",
-			"get_query": function () {
-				var company = frappe.query_report.get_filter_value('company');
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			options: "Warehouse",
+			get_query: function () {
+				var company = frappe.query_report.get_filter_value("company");
 				return {
-					filters: [
-						["Warehouse", "company", "=", company]
-					]
+					filters: [["Warehouse", "company", "=", company]],
 				};
 			},
 		},
 	],
-	"tree": true,
-	"name_field": "parent",
-	"parent_field": "parent_invoice",
-	"initial_depth": 3,
-	"formatter": function(value, row, column, data, default_formatter) {
+	tree: true,
+	name_field: "parent",
+	parent_field: "parent_invoice",
+	initial_depth: 3,
+	formatter: function (value, row, column, data, default_formatter) {
 		if (column.fieldname == "sales_invoice" && column.options == "Item" && data && data.indent == 0) {
 			column._options = "Sales Invoice";
 		} else {
@@ -85,4 +84,4 @@
 
 		return value;
 	},
-}
+};
diff --git a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.js b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.js
index bd9b543..b420d99 100644
--- a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.js
+++ b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.js
@@ -1,9 +1,8 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Inactive Sales Items"] = {
-	"filters": [
+	filters: [
 		{
 			fieldname: "territory",
 			label: __("Territory"),
@@ -15,27 +14,27 @@
 			fieldname: "item",
 			label: __("Item"),
 			fieldtype: "Link",
-			options: "Item"
+			options: "Item",
 		},
 		{
 			fieldname: "item_group",
 			label: __("Item Group"),
 			fieldtype: "Link",
-			options: "Item Group"
+			options: "Item Group",
 		},
 		{
 			fieldname: "based_on",
 			label: __("Based On"),
 			fieldtype: "Select",
 			options: "Sales Order\nSales Invoice",
-			default: "Sales Order"
+			default: "Sales Order",
 		},
 		{
 			fieldname: "days",
 			label: __("Days Since Last order"),
 			fieldtype: "Select",
 			options: [30, 60, 90],
-			default: 30
+			default: 30,
 		},
-	]
+	],
 };
diff --git a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js
index 423cd6a..e05591e 100644
--- a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js
+++ b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js
@@ -2,65 +2,64 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Item-wise Purchase Register"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-			"reqd": 1,
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			reqd: 1,
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1,
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
 		},
 		{
-			"fieldname": "item_code",
-			"label": __("Item"),
-			"fieldtype": "Link",
-			"options": "Item",
+			fieldname: "item_code",
+			label: __("Item"),
+			fieldtype: "Link",
+			options: "Item",
 		},
 		{
-			"fieldname": "item_group",
-			"label": __("Item Group"),
-			"fieldtype": "Link",
-			"options": "Item Group",
+			fieldname: "item_group",
+			label: __("Item Group"),
+			fieldtype: "Link",
+			options: "Item Group",
 		},
 		{
-			"fieldname":"supplier",
-			"label": __("Supplier"),
-			"fieldtype": "Link",
-			"options": "Supplier"
+			fieldname: "supplier",
+			label: __("Supplier"),
+			fieldtype: "Link",
+			options: "Supplier",
 		},
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname":"mode_of_payment",
-			"label": __("Mode of Payment"),
-			"fieldtype": "Link",
-			"options": "Mode of Payment"
+			fieldname: "mode_of_payment",
+			label: __("Mode of Payment"),
+			fieldtype: "Link",
+			options: "Mode of Payment",
 		},
 		{
-			"label": __("Group By"),
-			"fieldname": "group_by",
-			"fieldtype": "Select",
-			"options": ["Supplier", "Item Group", "Item", "Invoice"]
-		}
+			label: __("Group By"),
+			fieldname: "group_by",
+			fieldtype: "Select",
+			options: ["Supplier", "Item Group", "Item", "Invoice"],
+		},
 	],
-	"formatter": function(value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 		if (data && data.bold) {
 			value = value.bold();
-
 		}
 		return value;
-	}
-}
+	},
+};
diff --git a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js
index 06f426b..193e175 100644
--- a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js
+++ b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js
@@ -2,85 +2,84 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Item-wise Sales Register"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-			"reqd": 1,
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			reqd: 1,
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1,
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
 		},
 		{
-			"fieldname": "customer",
-			"label": __("Customer"),
-			"fieldtype": "Link",
-			"options": "Customer"
+			fieldname: "customer",
+			label: __("Customer"),
+			fieldtype: "Link",
+			options: "Customer",
 		},
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname": "mode_of_payment",
-			"label": __("Mode of Payment"),
-			"fieldtype": "Link",
-			"options": "Mode of Payment"
+			fieldname: "mode_of_payment",
+			label: __("Mode of Payment"),
+			fieldtype: "Link",
+			options: "Mode of Payment",
 		},
 		{
-			"fieldname": "warehouse",
-			"label": __("Warehouse"),
-			"fieldtype": "Link",
-			"options": "Warehouse"
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			options: "Warehouse",
 		},
 		{
-			"fieldname": "brand",
-			"label": __("Brand"),
-			"fieldtype": "Link",
-			"options": "Brand"
+			fieldname: "brand",
+			label: __("Brand"),
+			fieldtype: "Link",
+			options: "Brand",
 		},
 		{
-			"fieldname": "item_group",
-			"label": __("Item Group"),
-			"fieldtype": "Link",
-			"options": "Item Group"
+			fieldname: "item_group",
+			label: __("Item Group"),
+			fieldtype: "Link",
+			options: "Item Group",
 		},
 		{
-			"label": __("Group By"),
-			"fieldname": "group_by",
-			"fieldtype": "Select",
-			"options": ["Customer Group", "Customer", "Item Group", "Item", "Territory", "Invoice"]
+			label: __("Group By"),
+			fieldname: "group_by",
+			fieldtype: "Select",
+			options: ["Customer Group", "Customer", "Item Group", "Item", "Territory", "Invoice"],
 		},
 		{
-			"fieldname": "income_account",
-			"label": __("Income Account"),
-			"fieldtype": "Link",
-			"options": "Account",
+			fieldname: "income_account",
+			label: __("Income Account"),
+			fieldtype: "Link",
+			options: "Account",
 			get_query: () => {
-				let company = frappe.query_report.get_filter_value('company');
+				let company = frappe.query_report.get_filter_value("company");
 				return {
 					filters: {
-						'company': company,
-					}
+						company: company,
+					},
 				};
-			}
+			},
 		},
 	],
-	"formatter": function(value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 		if (data && data.bold) {
 			value = value.bold();
-
 		}
 		return value;
-	}
-}
+	},
+};
diff --git a/erpnext/accounts/report/payment_ledger/payment_ledger.js b/erpnext/accounts/report/payment_ledger/payment_ledger.js
index 65380cc..8d1f227 100644
--- a/erpnext/accounts/report/payment_ledger/payment_ledger.js
+++ b/erpnext/accounts/report/payment_ledger/payment_ledger.js
@@ -1,96 +1,92 @@
 // Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 function get_filters() {
 	let filters = [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname":"period_start_date",
-			"label": __("Start Date"),
-			"fieldtype": "Date",
-			"reqd": 1,
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1)
+			fieldname: "period_start_date",
+			label: __("Start Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
 		},
 		{
-			"fieldname":"period_end_date",
-			"label": __("End Date"),
-			"fieldtype": "Date",
-			"reqd": 1,
-			"default": frappe.datetime.get_today()
+			fieldname: "period_end_date",
+			label: __("End Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname":"account",
-			"label": __("Account"),
-			"fieldtype": "MultiSelectList",
-			"options": "Account",
-			get_data: function(txt) {
-				return frappe.db.get_link_options('Account', txt, {
-					company: frappe.query_report.get_filter_value("company")
+			fieldname: "account",
+			label: __("Account"),
+			fieldtype: "MultiSelectList",
+			options: "Account",
+			get_data: function (txt) {
+				return frappe.db.get_link_options("Account", txt, {
+					company: frappe.query_report.get_filter_value("company"),
 				});
-			}
+			},
 		},
 		{
-			"fieldname":"party_type",
-			"label": __("Party Type"),
-			"fieldtype": "Link",
-			"options": "Party Type",
-			"default": "",
-			on_change: function() {
-				frappe.query_report.set_filter_value('party', "");
-			}
+			fieldname: "party_type",
+			label: __("Party Type"),
+			fieldtype: "Link",
+			options: "Party Type",
+			default: "",
+			on_change: function () {
+				frappe.query_report.set_filter_value("party", "");
+			},
 		},
 		{
-			"fieldname":"party",
-			"label": __("Party"),
-			"fieldtype": "MultiSelectList",
-			get_data: function(txt) {
+			fieldname: "party",
+			label: __("Party"),
+			fieldtype: "MultiSelectList",
+			get_data: function (txt) {
 				if (!frappe.query_report.filters) return;
 
-				let party_type = frappe.query_report.get_filter_value('party_type');
+				let party_type = frappe.query_report.get_filter_value("party_type");
 				if (!party_type) return;
 
 				return frappe.db.get_link_options(party_type, txt);
 			},
 		},
 		{
-			"fieldname":"voucher_no",
-			"label": __("Voucher No"),
-			"fieldtype": "Data",
-			"width": 100,
+			fieldname: "voucher_no",
+			label: __("Voucher No"),
+			fieldtype: "Data",
+			width: 100,
 		},
 		{
-			"fieldname":"against_voucher_no",
-			"label": __("Against Voucher No"),
-			"fieldtype": "Data",
-			"width": 100,
+			fieldname: "against_voucher_no",
+			label: __("Against Voucher No"),
+			fieldtype: "Data",
+			width: 100,
 		},
 		{
-			"fieldname":"include_account_currency",
-			"label": __("Include Account Currency"),
-			"fieldtype": "Check",
-			"width": 100,
+			fieldname: "include_account_currency",
+			label: __("Include Account Currency"),
+			fieldtype: "Check",
+			width: 100,
 		},
 		{
-			"fieldname":"group_party",
-			"label": __("Group by Party"),
-			"fieldtype": "Check",
-			"width": 100,
+			fieldname: "group_party",
+			label: __("Group by Party"),
+			fieldtype: "Check",
+			width: 100,
 		},
-
-
-
-	]
+	];
 	return filters;
 }
 
 frappe.query_reports["Payment Ledger"] = {
-	"filters": get_filters()
+	filters: get_filters(),
 };
diff --git a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js
index 5ec2c98..528246c 100644
--- a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js
+++ b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js
@@ -2,14 +2,14 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Payment Period Based On Invoice Date"] = {
-	"filters": [
+	filters: [
 		{
-			fieldname:"company",
+			fieldname: "company",
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
 			reqd: 1,
-			default: frappe.defaults.get_user_default("Company")
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
 			fieldname: "from_date",
@@ -18,41 +18,41 @@
 			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
-			default: frappe.datetime.get_today()
+			default: frappe.datetime.get_today(),
 		},
 		{
-			fieldname:"payment_type",
+			fieldname: "payment_type",
 			label: __("Payment Type"),
 			fieldtype: "Select",
 			options: __("Incoming") + "\n" + __("Outgoing"),
-			default: __("Incoming")
+			default: __("Incoming"),
 		},
 		{
-			"fieldname":"party_type",
-			"label": __("Party Type"),
-			"fieldtype": "Link",
-			"options": "DocType",
-			"get_query": function() {
+			fieldname: "party_type",
+			label: __("Party Type"),
+			fieldtype: "Link",
+			options: "DocType",
+			get_query: function () {
 				return {
-					filters: {"name": ["in", ["Customer", "Supplier"]]}
-				}
-			}
+					filters: { name: ["in", ["Customer", "Supplier"]] },
+				};
+			},
 		},
 		{
-			"fieldname":"party",
-			"label": __("Party"),
-			"fieldtype": "Dynamic Link",
-			"get_options": function() {
-				var party_type = frappe.query_report.get_filter_value('party_type');
-				var party = frappe.query_report.get_filter_value('party');
-				if(party && !party_type) {
+			fieldname: "party",
+			label: __("Party"),
+			fieldtype: "Dynamic Link",
+			get_options: function () {
+				var party_type = frappe.query_report.get_filter_value("party_type");
+				var party = frappe.query_report.get_filter_value("party");
+				if (party && !party_type) {
 					frappe.throw(__("Please select Party Type first"));
 				}
 				return party_type;
-			}
+			},
 		},
-	]
-}
+	],
+};
diff --git a/erpnext/accounts/report/pos_register/pos_register.js b/erpnext/accounts/report/pos_register/pos_register.js
index 6e5491a..5d39796 100644
--- a/erpnext/accounts/report/pos_register/pos_register.js
+++ b/erpnext/accounts/report/pos_register/pos_register.js
@@ -1,76 +1,74 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["POS Register"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-			"reqd": 1,
-			"width": "60px"
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			reqd: 1,
+			width: "60px",
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1,
-			"width": "60px"
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
+			width: "60px",
 		},
 		{
-			"fieldname":"pos_profile",
-			"label": __("POS Profile"),
-			"fieldtype": "Link",
-			"options": "POS Profile"
+			fieldname: "pos_profile",
+			label: __("POS Profile"),
+			fieldtype: "Link",
+			options: "POS Profile",
 		},
 		{
-			"fieldname":"cashier",
-			"label": __("Cashier"),
-			"fieldtype": "Link",
-			"options": "User"
+			fieldname: "cashier",
+			label: __("Cashier"),
+			fieldtype: "Link",
+			options: "User",
 		},
 		{
-			"fieldname":"customer",
-			"label": __("Customer"),
-			"fieldtype": "Link",
-			"options": "Customer"
+			fieldname: "customer",
+			label: __("Customer"),
+			fieldtype: "Link",
+			options: "Customer",
 		},
 		{
-			"fieldname":"mode_of_payment",
-			"label": __("Payment Method"),
-			"fieldtype": "Link",
-			"options": "Mode of Payment"
+			fieldname: "mode_of_payment",
+			label: __("Payment Method"),
+			fieldtype: "Link",
+			options: "Mode of Payment",
 		},
 		{
-			"fieldname":"group_by",
-			"label": __("Group by"),
-			"fieldtype": "Select",
-			"options": ["", "POS Profile", "Cashier", "Payment Method", "Customer"],
-			"default": "POS Profile"
+			fieldname: "group_by",
+			label: __("Group by"),
+			fieldtype: "Select",
+			options: ["", "POS Profile", "Cashier", "Payment Method", "Customer"],
+			default: "POS Profile",
 		},
 		{
-			"fieldname":"is_return",
-			"label": __("Is Return"),
-			"fieldtype": "Check"
+			fieldname: "is_return",
+			label: __("Is Return"),
+			fieldtype: "Check",
 		},
 	],
-	"formatter": function(value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 		if (data && data.bold) {
 			value = value.bold();
-
 		}
 		return value;
-	}
+	},
 };
diff --git a/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.js b/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.js
index a2f0fde..2ffd3b3 100644
--- a/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.js
+++ b/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.js
@@ -1,27 +1,22 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.query_reports["Profit and Loss Statement"] = $.extend(
-	{},
-	erpnext.financial_statements
-);
+frappe.query_reports["Profit and Loss Statement"] = $.extend({}, erpnext.financial_statements);
 
 erpnext.utils.add_dimensions("Profit and Loss Statement", 10);
 
-frappe.query_reports["Profit and Loss Statement"]["filters"].push(
-	{
-		"fieldname": "selected_view",
-		"label": __("Select View"),
-		"fieldtype": "Select",
-		"options": [
-			{ "value": "Report", "label": __("Report View") },
-			{ "value": "Growth", "label": __("Growth View") },
-			{ "value": "Margin", "label": __("Margin View") },
-		],
-		"default": "Report",
-		"reqd": 1
-	},
-);
+frappe.query_reports["Profit and Loss Statement"]["filters"].push({
+	fieldname: "selected_view",
+	label: __("Select View"),
+	fieldtype: "Select",
+	options: [
+		{ value: "Report", label: __("Report View") },
+		{ value: "Growth", label: __("Growth View") },
+		{ value: "Margin", label: __("Margin View") },
+	],
+	default: "Report",
+	reqd: 1,
+});
 
 frappe.query_reports["Profit and Loss Statement"]["filters"].push({
 	fieldname: "accumulated_values",
diff --git a/erpnext/accounts/report/profitability_analysis/profitability_analysis.js b/erpnext/accounts/report/profitability_analysis/profitability_analysis.js
index 5dd3617..69e1284 100644
--- a/erpnext/accounts/report/profitability_analysis/profitability_analysis.js
+++ b/erpnext/accounts/report/profitability_analysis/profitability_analysis.js
@@ -2,88 +2,90 @@
 // For license information, please see license.txt
 
 frappe.query_reports["Profitability Analysis"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname": "based_on",
-			"label": __("Based On"),
-			"fieldtype": "Select",
-			"options": ["Cost Center", "Project", "Accounting Dimension"],
-			"default": "Cost Center",
-			"reqd": 1,
-			"on_change": function(query_report){
+			fieldname: "based_on",
+			label: __("Based On"),
+			fieldtype: "Select",
+			options: ["Cost Center", "Project", "Accounting Dimension"],
+			default: "Cost Center",
+			reqd: 1,
+			on_change: function (query_report) {
 				let based_on = query_report.get_values().based_on;
-				if(based_on!='Accounting Dimension'){
+				if (based_on != "Accounting Dimension") {
 					frappe.query_report.set_filter_value({
-						accounting_dimension: ''
+						accounting_dimension: "",
 					});
 				}
-			}
+			},
 		},
 		{
-			"fieldname": "accounting_dimension",
-			"label": __("Accounting Dimension"),
-			"fieldtype": "Link",
-			"options": "Accounting Dimension",
+			fieldname: "accounting_dimension",
+			label: __("Accounting Dimension"),
+			fieldtype: "Link",
+			options: "Accounting Dimension",
 		},
 		{
-			"fieldname": "fiscal_year",
-			"label": __("Fiscal Year"),
-			"fieldtype": "Link",
-			"options": "Fiscal Year",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
-			"reqd": 1,
-			"on_change": function(query_report) {
+			fieldname: "fiscal_year",
+			label: __("Fiscal Year"),
+			fieldtype: "Link",
+			options: "Fiscal Year",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
+			reqd: 1,
+			on_change: function (query_report) {
 				var fiscal_year = query_report.get_values().fiscal_year;
 				if (!fiscal_year) {
 					return;
 				}
-				frappe.model.with_doc("Fiscal Year", fiscal_year, function(r) {
+				frappe.model.with_doc("Fiscal Year", fiscal_year, function (r) {
 					var fy = frappe.model.get_doc("Fiscal Year", fiscal_year);
 					frappe.query_report.set_filter_value({
 						from_date: fy.year_start_date,
-						to_date: fy.year_end_date
+						to_date: fy.year_end_date,
 					});
 				});
-			}
+			},
 		},
 		{
-			"fieldname": "from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
 		},
 		{
-			"fieldname": "to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
 		},
 		{
-			"fieldname": "show_zero_values",
-			"label": __("Show zero values"),
-			"fieldtype": "Check"
-		}
+			fieldname: "show_zero_values",
+			label: __("Show zero values"),
+			fieldtype: "Check",
+		},
 	],
-	"formatter": function(value, row, column, data, default_formatter) {
-		if (column.fieldname=="account") {
+	formatter: function (value, row, column, data, default_formatter) {
+		if (column.fieldname == "account") {
 			value = data.account_name;
 
 			column.link_onclick =
-				"frappe.query_reports['Profitability Analysis'].open_profit_and_loss_statement(" + JSON.stringify(data) + ")";
+				"frappe.query_reports['Profitability Analysis'].open_profit_and_loss_statement(" +
+				JSON.stringify(data) +
+				")";
 			column.is_tree = true;
 		}
 
 		value = default_formatter(value, row, column, data);
 
-		if (!data.parent_account && data.based_on != 'project') {
+		if (!data.parent_account && data.based_on != "project") {
 			value = $(`<span>${value}</span>`);
 			var $value = $(value).css("font-weight", "bold");
 			if (data.warn_if_negative && data[column.fieldname] < 0) {
@@ -95,25 +97,25 @@
 
 		return value;
 	},
-	"open_profit_and_loss_statement": function(data) {
+	open_profit_and_loss_statement: function (data) {
 		if (!data.account) return;
 
 		frappe.route_options = {
-			"company": frappe.query_report.get_filter_value('company'),
-			"from_fiscal_year": data.fiscal_year,
-			"to_fiscal_year": data.fiscal_year
+			company: frappe.query_report.get_filter_value("company"),
+			from_fiscal_year: data.fiscal_year,
+			to_fiscal_year: data.fiscal_year,
 		};
 
-		if(data.based_on == 'Cost Center'){
-			frappe.route_options["cost_center"] = data.account
+		if (data.based_on == "Cost Center") {
+			frappe.route_options["cost_center"] = data.account;
 		} else {
-			frappe.route_options["project"] = data.account
+			frappe.route_options["project"] = data.account;
 		}
 
 		frappe.set_route("query-report", "Profit and Loss Statement");
 	},
-	"tree": true,
-	"name_field": "account",
-	"parent_field": "parent_account",
-	"initial_depth": 3
-}
+	tree: true,
+	name_field: "account",
+	parent_field: "parent_account",
+	initial_depth: 3,
+};
diff --git a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.js b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.js
index feab96f..e3f90f2 100644
--- a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.js
+++ b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.js
@@ -1,8 +1,8 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.require("assets/erpnext/js/purchase_trends_filters.js", function() {
+frappe.require("assets/erpnext/js/purchase_trends_filters.js", function () {
 	frappe.query_reports["Purchase Invoice Trends"] = {
-		filters: erpnext.get_purchase_trends_filters()
-	}
+		filters: erpnext.get_purchase_trends_filters(),
+	};
 });
diff --git a/erpnext/accounts/report/purchase_register/purchase_register.js b/erpnext/accounts/report/purchase_register/purchase_register.js
index cf11ed0..5887498 100644
--- a/erpnext/accounts/report/purchase_register/purchase_register.js
+++ b/erpnext/accounts/report/purchase_register/purchase_register.js
@@ -2,70 +2,70 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Purchase Register"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-			"width": "80"
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			width: "80",
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today()
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname":"supplier",
-			"label": __("Supplier"),
-			"fieldtype": "Link",
-			"options": "Supplier"
+			fieldname: "supplier",
+			label: __("Supplier"),
+			fieldtype: "Link",
+			options: "Supplier",
 		},
 		{
-			"fieldname":"supplier_group",
-			"label": __("Supplier Group"),
-			"fieldtype": "Link",
-			"options": "Supplier Group"
+			fieldname: "supplier_group",
+			label: __("Supplier Group"),
+			fieldtype: "Link",
+			options: "Supplier Group",
 		},
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname":"mode_of_payment",
-			"label": __("Mode of Payment"),
-			"fieldtype": "Link",
-			"options": "Mode of Payment"
+			fieldname: "mode_of_payment",
+			label: __("Mode of Payment"),
+			fieldtype: "Link",
+			options: "Mode of Payment",
 		},
 		{
-			"fieldname":"cost_center",
-			"label": __("Cost Center"),
-			"fieldtype": "Link",
-			"options": "Cost Center"
+			fieldname: "cost_center",
+			label: __("Cost Center"),
+			fieldtype: "Link",
+			options: "Cost Center",
 		},
 		{
-			"fieldname":"warehouse",
-			"label": __("Warehouse"),
-			"fieldtype": "Link",
-			"options": "Warehouse"
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			options: "Warehouse",
 		},
 		{
-			"fieldname":"item_group",
-			"label": __("Item Group"),
-			"fieldtype": "Link",
-			"options": "Item Group"
+			fieldname: "item_group",
+			label: __("Item Group"),
+			fieldtype: "Link",
+			options: "Item Group",
 		},
 		{
-			"fieldname": "include_payments",
-			"label": __("Show Ledger View"),
-			"fieldtype": "Check",
-			"default": 0
-		}
-	]
-}
+			fieldname: "include_payments",
+			label: __("Show Ledger View"),
+			fieldtype: "Check",
+			default: 0,
+		},
+	],
+};
 
-erpnext.utils.add_dimensions('Purchase Register', 7);
+erpnext.utils.add_dimensions("Purchase Register", 7);
diff --git a/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.js b/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.js
index 0ee3f57..ad97f27 100644
--- a/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.js
+++ b/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.js
@@ -2,7 +2,5 @@
 // For license information, please see license.txt
 
 frappe.query_reports["Received Items To Be Billed"] = {
-	"filters": [
-
-	]
-}
+	filters: [],
+};
diff --git a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.js b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.js
index e3d43a7..292d827 100644
--- a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.js
+++ b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.js
@@ -1,8 +1,8 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.require("assets/erpnext/js/sales_trends_filters.js", function() {
+frappe.require("assets/erpnext/js/sales_trends_filters.js", function () {
 	frappe.query_reports["Sales Invoice Trends"] = {
-		filters: erpnext.get_sales_trends_filters()
-	}
+		filters: erpnext.get_sales_trends_filters(),
+	};
 });
diff --git a/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.js b/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.js
index 92e6f7f..b64db9e 100644
--- a/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.js
+++ b/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.js
@@ -1,44 +1,44 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 frappe.query_reports["Sales Payment Summary"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1,
-			"width": "80"
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
+			width: "80",
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"reqd": 1,
-			"default": frappe.datetime.get_today()
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname":"owner",
-			"label": __("Owner"),
-			"fieldtype": "Link",
-			"options": "User",
+			fieldname: "owner",
+			label: __("Owner"),
+			fieldtype: "Link",
+			options: "User",
 		},
 		{
-			"fieldname":"is_pos",
-			"label": __("Show only POS"),
-			"fieldtype": "Check"
+			fieldname: "is_pos",
+			label: __("Show only POS"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname":"payment_detail",
-			"label": __("Show Payment Details"),
-			"fieldtype": "Check"
+			fieldname: "payment_detail",
+			label: __("Show Payment Details"),
+			fieldtype: "Check",
 		},
-	]
+	],
 };
diff --git a/erpnext/accounts/report/sales_register/sales_register.js b/erpnext/accounts/report/sales_register/sales_register.js
index 4578ac3..c4f57c8 100644
--- a/erpnext/accounts/report/sales_register/sales_register.js
+++ b/erpnext/accounts/report/sales_register/sales_register.js
@@ -2,82 +2,82 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Sales Register"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-			"width": "80"
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			width: "80",
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today()
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname":"customer",
-			"label": __("Customer"),
-			"fieldtype": "Link",
-			"options": "Customer"
+			fieldname: "customer",
+			label: __("Customer"),
+			fieldtype: "Link",
+			options: "Customer",
 		},
 		{
-			"fieldname":"customer_group",
-			"label": __("Customer Group"),
-			"fieldtype": "Link",
-			"options": "Customer Group"
+			fieldname: "customer_group",
+			label: __("Customer Group"),
+			fieldtype: "Link",
+			options: "Customer Group",
 		},
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname":"mode_of_payment",
-			"label": __("Mode of Payment"),
-			"fieldtype": "Link",
-			"options": "Mode of Payment"
+			fieldname: "mode_of_payment",
+			label: __("Mode of Payment"),
+			fieldtype: "Link",
+			options: "Mode of Payment",
 		},
 		{
-			"fieldname":"owner",
-			"label": __("Owner"),
-			"fieldtype": "Link",
-			"options": "User"
+			fieldname: "owner",
+			label: __("Owner"),
+			fieldtype: "Link",
+			options: "User",
 		},
 		{
-			"fieldname":"cost_center",
-			"label": __("Cost Center"),
-			"fieldtype": "Link",
-			"options": "Cost Center"
+			fieldname: "cost_center",
+			label: __("Cost Center"),
+			fieldtype: "Link",
+			options: "Cost Center",
 		},
 		{
-			"fieldname":"warehouse",
-			"label": __("Warehouse"),
-			"fieldtype": "Link",
-			"options": "Warehouse"
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			options: "Warehouse",
 		},
 		{
-			"fieldname":"brand",
-			"label": __("Brand"),
-			"fieldtype": "Link",
-			"options": "Brand"
+			fieldname: "brand",
+			label: __("Brand"),
+			fieldtype: "Link",
+			options: "Brand",
 		},
 		{
-			"fieldname":"item_group",
-			"label": __("Item Group"),
-			"fieldtype": "Link",
-			"options": "Item Group"
+			fieldname: "item_group",
+			label: __("Item Group"),
+			fieldtype: "Link",
+			options: "Item Group",
 		},
 		{
-			"fieldname": "include_payments",
-			"label": __("Show Ledger View"),
-			"fieldtype": "Check",
-			"default": 0
-		}
-	]
-}
+			fieldname: "include_payments",
+			label: __("Show Ledger View"),
+			fieldtype: "Check",
+			default: 0,
+		},
+	],
+};
 
-erpnext.utils.add_dimensions('Sales Register', 7);
+erpnext.utils.add_dimensions("Sales Register", 7);
diff --git a/erpnext/accounts/report/share_balance/share_balance.js b/erpnext/accounts/report/share_balance/share_balance.js
index ac64a0b..05d2959 100644
--- a/erpnext/accounts/report/share_balance/share_balance.js
+++ b/erpnext/accounts/report/share_balance/share_balance.js
@@ -2,21 +2,20 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Share Balance"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"date",
-			"label": __("Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1
+			fieldname: "date",
+			label: __("Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
 		},
 		{
-			"fieldname":"shareholder",
-			"label": __("Shareholder"),
-			"fieldtype": "Link",
-			"options": "Shareholder"
-		}
-	]
-}
+			fieldname: "shareholder",
+			label: __("Shareholder"),
+			fieldtype: "Link",
+			options: "Shareholder",
+		},
+	],
+};
diff --git a/erpnext/accounts/report/share_ledger/share_ledger.js b/erpnext/accounts/report/share_ledger/share_ledger.js
index 4f2d2cc..0d4e3c6 100644
--- a/erpnext/accounts/report/share_ledger/share_ledger.js
+++ b/erpnext/accounts/report/share_ledger/share_ledger.js
@@ -2,21 +2,20 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Share Ledger"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"date",
-			"label": __("Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1
+			fieldname: "date",
+			label: __("Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
 		},
 		{
-			"fieldname":"shareholder",
-			"label": __("Shareholder"),
-			"fieldtype": "Link",
-			"options": "Shareholder"
-		}
-	]
+			fieldname: "shareholder",
+			label: __("Shareholder"),
+			fieldtype: "Link",
+			options: "Shareholder",
+		},
+	],
 };
diff --git a/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js
index 8e3c8ac..5d91575 100644
--- a/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js
+++ b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js
@@ -1,79 +1,78 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Supplier Ledger Summary"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-			"reqd": 1,
-			"width": "60px"
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			reqd: 1,
+			width: "60px",
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1,
-			"width": "60px"
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
+			width: "60px",
 		},
 		{
-			"fieldname":"finance_book",
-			"label": __("Finance Book"),
-			"fieldtype": "Link",
-			"options": "Finance Book"
+			fieldname: "finance_book",
+			label: __("Finance Book"),
+			fieldtype: "Link",
+			options: "Finance Book",
 		},
 		{
-			"fieldname":"party",
-			"label": __("Supplier"),
-			"fieldtype": "Link",
-			"options": "Supplier",
+			fieldname: "party",
+			label: __("Supplier"),
+			fieldtype: "Link",
+			options: "Supplier",
 			on_change: () => {
-				var party = frappe.query_report.get_filter_value('party');
+				var party = frappe.query_report.get_filter_value("party");
 				if (party) {
-					frappe.db.get_value('Supplier', party, ["tax_id", "supplier_name"], function(value) {
-						frappe.query_report.set_filter_value('tax_id', value["tax_id"]);
-						frappe.query_report.set_filter_value('supplier_name', value["supplier_name"]);
+					frappe.db.get_value("Supplier", party, ["tax_id", "supplier_name"], function (value) {
+						frappe.query_report.set_filter_value("tax_id", value["tax_id"]);
+						frappe.query_report.set_filter_value("supplier_name", value["supplier_name"]);
 					});
 				} else {
-					frappe.query_report.set_filter_value('tax_id', "");
-					frappe.query_report.set_filter_value('supplier_name', "");
+					frappe.query_report.set_filter_value("tax_id", "");
+					frappe.query_report.set_filter_value("supplier_name", "");
 				}
-			}
+			},
 		},
 		{
-			"fieldname":"supplier_group",
-			"label": __("Supplier Group"),
-			"fieldtype": "Link",
-			"options": "Supplier Group"
+			fieldname: "supplier_group",
+			label: __("Supplier Group"),
+			fieldtype: "Link",
+			options: "Supplier Group",
 		},
 		{
-			"fieldname":"payment_terms_template",
-			"label": __("Payment Terms Template"),
-			"fieldtype": "Link",
-			"options": "Payment Terms Template"
+			fieldname: "payment_terms_template",
+			label: __("Payment Terms Template"),
+			fieldtype: "Link",
+			options: "Payment Terms Template",
 		},
 		{
-			"fieldname":"tax_id",
-			"label": __("Tax Id"),
-			"fieldtype": "Data",
-			"hidden": 1
+			fieldname: "tax_id",
+			label: __("Tax Id"),
+			fieldtype: "Data",
+			hidden: 1,
 		},
 		{
-			"fieldname":"supplier_name",
-			"label": __("Supplier Name"),
-			"fieldtype": "Data",
-			"hidden": 1
-		}
-	]
+			fieldname: "supplier_name",
+			label: __("Supplier Name"),
+			fieldtype: "Data",
+			hidden: 1,
+		},
+	],
 };
diff --git a/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.js b/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.js
index 8808165..bdc98ab 100644
--- a/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.js
+++ b/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.js
@@ -1,62 +1,61 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Tax Withholding Details"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_default('company')
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_default("company"),
 		},
 		{
-			"fieldname":"party_type",
-			"label": __("Party Type"),
-			"fieldtype": "Select",
-			"options": ["Supplier", "Customer"],
-			"reqd": 1,
-			"default": "Supplier",
-			"on_change": function(){
+			fieldname: "party_type",
+			label: __("Party Type"),
+			fieldtype: "Select",
+			options: ["Supplier", "Customer"],
+			reqd: 1,
+			default: "Supplier",
+			on_change: function () {
 				frappe.query_report.set_filter_value("party", "");
-			}
+			},
 		},
 		{
-			"fieldname":"party",
-			"label": __("Party"),
-			"fieldtype": "Dynamic Link",
-			"get_options": function() {
-				var party_type = frappe.query_report.get_filter_value('party_type');
-				var party = frappe.query_report.get_filter_value('party');
-				if(party && !party_type) {
+			fieldname: "party",
+			label: __("Party"),
+			fieldtype: "Dynamic Link",
+			get_options: function () {
+				var party_type = frappe.query_report.get_filter_value("party_type");
+				var party = frappe.query_report.get_filter_value("party");
+				if (party && !party_type) {
 					frappe.throw(__("Please select Party Type first"));
 				}
 				return party_type;
 			},
-			"get_query": function() {
+			get_query: function () {
 				return {
-					"filters": {
-						"tax_withholding_category": ["!=",""],
-					}
-				}
+					filters: {
+						tax_withholding_category: ["!=", ""],
+					},
+				};
 			},
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-			"reqd": 1,
-			"width": "60px"
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			reqd: 1,
+			width: "60px",
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1,
-			"width": "60px"
-		}
-	]
-}
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
+			width: "60px",
+		},
+	],
+};
diff --git a/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.js b/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.js
index a0be1b5..3db1f29 100644
--- a/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.js
+++ b/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.js
@@ -1,62 +1,61 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["TDS Computation Summary"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_default('company')
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_default("company"),
 		},
 		{
-			"fieldname":"party_type",
-			"label": __("Party Type"),
-			"fieldtype": "Select",
-			"options": ["Supplier", "Customer"],
-			"reqd": 1,
-			"default": "Supplier",
-			"on_change": function(){
+			fieldname: "party_type",
+			label: __("Party Type"),
+			fieldtype: "Select",
+			options: ["Supplier", "Customer"],
+			reqd: 1,
+			default: "Supplier",
+			on_change: function () {
 				frappe.query_report.set_filter_value("party", "");
-			}
+			},
 		},
 		{
-			"fieldname":"party",
-			"label": __("Party"),
-			"fieldtype": "Dynamic Link",
-			"get_options": function() {
-				var party_type = frappe.query_report.get_filter_value('party_type');
-				var party = frappe.query_report.get_filter_value('party');
-				if(party && !party_type) {
+			fieldname: "party",
+			label: __("Party"),
+			fieldtype: "Dynamic Link",
+			get_options: function () {
+				var party_type = frappe.query_report.get_filter_value("party_type");
+				var party = frappe.query_report.get_filter_value("party");
+				if (party && !party_type) {
 					frappe.throw(__("Please select Party Type first"));
 				}
 				return party_type;
 			},
-			"get_query": function() {
+			get_query: function () {
 				return {
-					"filters": {
-						"tax_withholding_category": ["!=",""],
-					}
-				}
+					filters: {
+						tax_withholding_category: ["!=", ""],
+					},
+				};
 			},
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-			"reqd": 1,
-			"width": "60px"
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			reqd: 1,
+			width: "60px",
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1,
-			"width": "60px"
-		}
-	]
-}
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
+			width: "60px",
+		},
+	],
+};
diff --git a/erpnext/accounts/report/trial_balance/trial_balance.js b/erpnext/accounts/report/trial_balance/trial_balance.js
index 5374ac1..2f70190 100644
--- a/erpnext/accounts/report/trial_balance/trial_balance.js
+++ b/erpnext/accounts/report/trial_balance/trial_balance.js
@@ -2,121 +2,121 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Trial Balance"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname": "fiscal_year",
-			"label": __("Fiscal Year"),
-			"fieldtype": "Link",
-			"options": "Fiscal Year",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
-			"reqd": 1,
-			"on_change": function(query_report) {
+			fieldname: "fiscal_year",
+			label: __("Fiscal Year"),
+			fieldtype: "Link",
+			options: "Fiscal Year",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
+			reqd: 1,
+			on_change: function (query_report) {
 				var fiscal_year = query_report.get_values().fiscal_year;
 				if (!fiscal_year) {
 					return;
 				}
-				frappe.model.with_doc("Fiscal Year", fiscal_year, function(r) {
+				frappe.model.with_doc("Fiscal Year", fiscal_year, function (r) {
 					var fy = frappe.model.get_doc("Fiscal Year", fiscal_year);
 					frappe.query_report.set_filter_value({
 						from_date: fy.year_start_date,
-						to_date: fy.year_end_date
+						to_date: fy.year_end_date,
 					});
 				});
-			}
+			},
 		},
 		{
-			"fieldname": "from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
 		},
 		{
-			"fieldname": "to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
 		},
 		{
-			"fieldname": "cost_center",
-			"label": __("Cost Center"),
-			"fieldtype": "Link",
-			"options": "Cost Center",
-			"get_query": function() {
-				var company = frappe.query_report.get_filter_value('company');
+			fieldname: "cost_center",
+			label: __("Cost Center"),
+			fieldtype: "Link",
+			options: "Cost Center",
+			get_query: function () {
+				var company = frappe.query_report.get_filter_value("company");
 				return {
-					"doctype": "Cost Center",
-					"filters": {
-						"company": company,
-					}
-				}
-			}
+					doctype: "Cost Center",
+					filters: {
+						company: company,
+					},
+				};
+			},
 		},
 		{
-			"fieldname": "project",
-			"label": __("Project"),
-			"fieldtype": "Link",
-			"options": "Project"
+			fieldname: "project",
+			label: __("Project"),
+			fieldtype: "Link",
+			options: "Project",
 		},
 		{
-			"fieldname": "finance_book",
-			"label": __("Finance Book"),
-			"fieldtype": "Link",
-			"options": "Finance Book",
+			fieldname: "finance_book",
+			label: __("Finance Book"),
+			fieldtype: "Link",
+			options: "Finance Book",
 		},
 		{
-			"fieldname": "presentation_currency",
-			"label": __("Currency"),
-			"fieldtype": "Select",
-			"options": erpnext.get_presentation_currency_list()
+			fieldname: "presentation_currency",
+			label: __("Currency"),
+			fieldtype: "Select",
+			options: erpnext.get_presentation_currency_list(),
 		},
 		{
-			"fieldname": "with_period_closing_entry_for_opening",
-			"label": __("With Period Closing Entry For Opening Balances"),
-			"fieldtype": "Check",
-			"default": 1
+			fieldname: "with_period_closing_entry_for_opening",
+			label: __("With Period Closing Entry For Opening Balances"),
+			fieldtype: "Check",
+			default: 1,
 		},
 		{
-			"fieldname": "with_period_closing_entry_for_current_period",
-			"label": __("Period Closing Entry For Current Period"),
-			"fieldtype": "Check",
-			"default": 1
+			fieldname: "with_period_closing_entry_for_current_period",
+			label: __("Period Closing Entry For Current Period"),
+			fieldtype: "Check",
+			default: 1,
 		},
 		{
-			"fieldname": "show_zero_values",
-			"label": __("Show zero values"),
-			"fieldtype": "Check"
+			fieldname: "show_zero_values",
+			label: __("Show zero values"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "show_unclosed_fy_pl_balances",
-			"label": __("Show unclosed fiscal year's P&L balances"),
-			"fieldtype": "Check"
+			fieldname: "show_unclosed_fy_pl_balances",
+			label: __("Show unclosed fiscal year's P&L balances"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": "include_default_book_entries",
-			"label": __("Include Default FB Entries"),
-			"fieldtype": "Check",
-			"default": 1
+			fieldname: "include_default_book_entries",
+			label: __("Include Default FB Entries"),
+			fieldtype: "Check",
+			default: 1,
 		},
 		{
-			"fieldname": "show_net_values",
-			"label": __("Show net values in opening and closing columns"),
-			"fieldtype": "Check",
-			"default": 1
-		}
+			fieldname: "show_net_values",
+			label: __("Show net values in opening and closing columns"),
+			fieldtype: "Check",
+			default: 1,
+		},
 	],
-	"formatter": erpnext.financial_statements.formatter,
-	"tree": true,
-	"name_field": "account",
-	"parent_field": "parent_account",
-	"initial_depth": 3
-}
+	formatter: erpnext.financial_statements.formatter,
+	tree: true,
+	name_field: "account",
+	parent_field: "parent_account",
+	initial_depth: 3,
+};
 
-erpnext.utils.add_dimensions('Trial Balance', 6);
+erpnext.utils.add_dimensions("Trial Balance", 6);
diff --git a/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.js b/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.js
index 33c644a..50578d3 100644
--- a/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.js
+++ b/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.js
@@ -2,88 +2,88 @@
 // For license information, please see license.txt
 
 frappe.query_reports["Trial Balance for Party"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname": "fiscal_year",
-			"label": __("Fiscal Year"),
-			"fieldtype": "Link",
-			"options": "Fiscal Year",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
-			"reqd": 1,
-			"on_change": function(query_report) {
+			fieldname: "fiscal_year",
+			label: __("Fiscal Year"),
+			fieldtype: "Link",
+			options: "Fiscal Year",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
+			reqd: 1,
+			on_change: function (query_report) {
 				var fiscal_year = query_report.get_values().fiscal_year;
 				if (!fiscal_year) {
 					return;
 				}
-				frappe.model.with_doc("Fiscal Year", fiscal_year, function(r) {
+				frappe.model.with_doc("Fiscal Year", fiscal_year, function (r) {
 					var fy = frappe.model.get_doc("Fiscal Year", fiscal_year);
 					frappe.query_report.set_filter_value({
 						from_date: fy.year_start_date,
-						to_date: fy.year_end_date
+						to_date: fy.year_end_date,
 					});
 				});
-			}
+			},
 		},
 		{
-			"fieldname": "from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
 		},
 		{
-			"fieldname": "to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
 		},
 		{
-			"fieldname":"party_type",
-			"label": __("Party Type"),
-			"fieldtype": "Link",
-			"options": "Party Type",
-			"default": "Customer",
-			"reqd": 1
+			fieldname: "party_type",
+			label: __("Party Type"),
+			fieldtype: "Link",
+			options: "Party Type",
+			default: "Customer",
+			reqd: 1,
 		},
 		{
-			"fieldname":"party",
-			"label": __("Party"),
-			"fieldtype": "Dynamic Link",
-			"get_options": function() {
-				var party_type = frappe.query_report.get_filter_value('party_type');
-				var party = frappe.query_report.get_filter_value('party');
-				if(party && !party_type) {
+			fieldname: "party",
+			label: __("Party"),
+			fieldtype: "Dynamic Link",
+			get_options: function () {
+				var party_type = frappe.query_report.get_filter_value("party_type");
+				var party = frappe.query_report.get_filter_value("party");
+				if (party && !party_type) {
 					frappe.throw(__("Please select Party Type first"));
 				}
 				return party_type;
-			}
+			},
 		},
 		{
-			"fieldname": "account",
-			"label": __("Account"),
-			"fieldtype": "Link",
-			"options": "Account",
-			"get_query": function() {
-				var company = frappe.query_report.get_filter_value('company');
+			fieldname: "account",
+			label: __("Account"),
+			fieldtype: "Link",
+			options: "Account",
+			get_query: function () {
+				var company = frappe.query_report.get_filter_value("company");
 				return {
-					"doctype": "Account",
-					"filters": {
-						"company": company,
-					}
-				}
-			}
+					doctype: "Account",
+					filters: {
+						company: company,
+					},
+				};
+			},
 		},
 		{
-			"fieldname": "show_zero_values",
-			"label": __("Show zero values"),
-			"fieldtype": "Check"
-		}
-	]
-}
+			fieldname: "show_zero_values",
+			label: __("Show zero values"),
+			fieldtype: "Check",
+		},
+	],
+};
diff --git a/erpnext/accounts/report/voucher_wise_balance/voucher_wise_balance.js b/erpnext/accounts/report/voucher_wise_balance/voucher_wise_balance.js
index f7ab029..03ebf73 100644
--- a/erpnext/accounts/report/voucher_wise_balance/voucher_wise_balance.js
+++ b/erpnext/accounts/report/voucher_wise_balance/voucher_wise_balance.js
@@ -1,28 +1,27 @@
 // Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Voucher-wise Balance"] = {
-	"filters": [
-        {
-            "fieldname": "company",
-            "label": __("Company"),
-            "fieldtype": "Link",
-            "options": "Company"
-        },
-        {
-            "fieldname":"from_date",
-            "label": __("From Date"),
-            "fieldtype": "Date",
-            "default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-            "width": "60px"
-        },
-        {
-            "fieldname":"to_date",
-            "label": __("To Date"),
-            "fieldtype": "Date",
-            "default": frappe.datetime.get_today(),
-            "width": "60px"
-        },
-    ]
+	filters: [
+		{
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+		},
+		{
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			width: "60px",
+		},
+		{
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			width: "60px",
+		},
+	],
 };
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index d4cb57b..0755f2e 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -490,7 +490,9 @@
 
 		# For payments with `Advance` in separate account feature enabled, only new ledger entries are posted for each reference.
 		# No need to cancel/delete payment ledger entries
-		if not (voucher_type == "Payment Entry" and doc.book_advance_payments_in_separate_party_account):
+		if voucher_type == "Payment Entry" and doc.book_advance_payments_in_separate_party_account:
+			doc.make_advance_gl_entries(cancel=1)
+		else:
 			_delete_pl_entries(voucher_type, voucher_no)
 
 		for entry in entries:
@@ -501,14 +503,16 @@
 
 			# update ref in advance entry
 			if voucher_type == "Journal Entry":
-				referenced_row = update_reference_in_journal_entry(entry, doc, do_not_save=False)
+				referenced_row, update_advance_paid = update_reference_in_journal_entry(
+					entry, doc, do_not_save=False
+				)
 				# advance section in sales/purchase invoice and reconciliation tool,both pass on exchange gain/loss
 				# amount and account in args
 				# referenced_row is used to deduplicate gain/loss journal
 				entry.update({"referenced_row": referenced_row})
 				doc.make_exchange_gain_loss_journal([entry], dimensions_dict)
 			else:
-				referenced_row = update_reference_in_payment_entry(
+				referenced_row, update_advance_paid = update_reference_in_payment_entry(
 					entry,
 					doc,
 					do_not_save=True,
@@ -522,7 +526,8 @@
 
 		if voucher_type == "Payment Entry" and doc.book_advance_payments_in_separate_party_account:
 			# both ledgers must be posted to for `Advance` in separate account feature
-			doc.make_advance_gl_entries(referenced_row, update_outstanding="No")
+			# TODO: find a more efficient way post only for the new linked vouchers
+			doc.make_advance_gl_entries()
 		else:
 			gl_map = doc.build_gl_map()
 			create_payment_ledger_entry(gl_map, update_outstanding="No", cancel=0, adv_adj=1)
@@ -532,6 +537,10 @@
 			update_voucher_outstanding(
 				entry.against_voucher_type, entry.against_voucher, entry.account, entry.party_type, entry.party
 			)
+		# update advance paid in Advance Receivable/Payable doctypes
+		if update_advance_paid:
+			for t, n in update_advance_paid:
+				frappe.get_doc(t, n).set_total_advance_paid()
 
 		frappe.flags.ignore_party_validation = False
 
@@ -621,11 +630,12 @@
 	jv_detail = journal_entry.get("accounts", {"name": d["voucher_detail_no"]})[0]
 
 	# Update Advance Paid in SO/PO since they might be getting unlinked
+	update_advance_paid = []
 	advance_payment_doctypes = frappe.get_hooks(
 		"advance_payment_receivable_doctypes"
 	) + frappe.get_hooks("advance_payment_payable_doctypes")
 	if jv_detail.get("reference_type") in advance_payment_doctypes:
-		frappe.get_doc(jv_detail.reference_type, jv_detail.reference_name).set_total_advance_paid()
+		update_advance_paid.append((jv_detail.reference_type, jv_detail.reference_name))
 
 	if flt(d["unadjusted_amount"]) - flt(d["allocated_amount"]) != 0:
 		# adjust the unreconciled balance
@@ -674,7 +684,7 @@
 	if not do_not_save:
 		journal_entry.save(ignore_permissions=True)
 
-	return new_row.name
+	return new_row.name, update_advance_paid
 
 
 def update_reference_in_payment_entry(
@@ -693,6 +703,7 @@
 		"account": d.account,
 		"dimensions": d.dimensions,
 	}
+	update_advance_paid = []
 
 	if d.voucher_detail_no:
 		existing_row = payment_entry.get("references", {"name": d["voucher_detail_no"]})[0]
@@ -702,9 +713,7 @@
 			"advance_payment_receivable_doctypes"
 		) + frappe.get_hooks("advance_payment_payable_doctypes")
 		if existing_row.get("reference_doctype") in advance_payment_doctypes:
-			frappe.get_doc(
-				existing_row.reference_doctype, existing_row.reference_name
-			).set_total_advance_paid()
+			update_advance_paid.append((existing_row.reference_doctype, existing_row.reference_name))
 
 		if d.allocated_amount <= existing_row.allocated_amount:
 			existing_row.allocated_amount -= d.allocated_amount
@@ -734,7 +743,7 @@
 
 	if not do_not_save:
 		payment_entry.save(ignore_permissions=True)
-	return row
+	return row, update_advance_paid
 
 
 def cancel_exchange_gain_loss_journal(
diff --git a/erpnext/assets/doctype/asset/asset.js b/erpnext/assets/doctype/asset/asset.js
index 673fe54..6dbb53a 100644
--- a/erpnext/assets/doctype/asset/asset.js
+++ b/erpnext/assets/doctype/asset/asset.js
@@ -4,136 +4,175 @@
 frappe.provide("erpnext.asset");
 frappe.provide("erpnext.accounts.dimensions");
 
-frappe.ui.form.on('Asset', {
-	onload: function(frm) {
-		frm.set_query("item_code", function() {
+frappe.ui.form.on("Asset", {
+	onload: function (frm) {
+		frm.set_query("item_code", function () {
 			return {
-				"filters": {
-					"is_fixed_asset": 1,
-					"is_stock_item": 0
-				}
+				filters: {
+					is_fixed_asset: 1,
+					is_stock_item: 0,
+				},
 			};
 		});
 
-		frm.set_query("warehouse", function() {
+		frm.set_query("warehouse", function () {
 			return {
-				"filters": {
-					"company": frm.doc.company,
-					"is_group": 0
-				}
+				filters: {
+					company: frm.doc.company,
+					is_group: 0,
+				},
 			};
 		});
 
-		frm.set_query("department", function() {
+		frm.set_query("department", function () {
 			return {
-				"filters": {
-					"company": frm.doc.company,
-				}
+				filters: {
+					company: frm.doc.company,
+				},
 			};
 		});
 
 		erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
 	},
 
-	company: function(frm) {
+	company: function (frm) {
 		erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
 	},
 
-	setup: function(frm) {
-		frm.ignore_doctypes_on_cancel_all = ['Journal Entry'];
+	setup: function (frm) {
+		frm.ignore_doctypes_on_cancel_all = ["Journal Entry"];
 
 		frm.make_methods = {
-			'Asset Movement': () => {
+			"Asset Movement": () => {
 				frappe.call({
-				method: "erpnext.assets.doctype.asset.asset.make_asset_movement",
-				freeze: true,
-				args:{
-					"assets": [{ name: cur_frm.doc.name }]
-				},
-				callback: function (r) {
-					if (r.message) {
-						var doc = frappe.model.sync(r.message)[0];
-						frappe.set_route("Form", doc.doctype, doc.name);
-					}
-				}
-			});
+					method: "erpnext.assets.doctype.asset.asset.make_asset_movement",
+					freeze: true,
+					args: {
+						assets: [{ name: cur_frm.doc.name }],
+					},
+					callback: function (r) {
+						if (r.message) {
+							var doc = frappe.model.sync(r.message)[0];
+							frappe.set_route("Form", doc.doctype, doc.name);
+						}
+					},
+				});
 			},
-		}
+		};
 
 		frm.set_query("purchase_receipt", (doc) => {
 			return {
 				query: "erpnext.controllers.queries.get_purchase_receipts",
-				filters: { item_code: doc.item_code }
-			}
+				filters: { item_code: doc.item_code },
+			};
 		});
 		frm.set_query("purchase_invoice", (doc) => {
 			return {
 				query: "erpnext.controllers.queries.get_purchase_invoices",
-				filters: { item_code: doc.item_code }
-			}
+				filters: { item_code: doc.item_code },
+			};
 		});
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		frappe.ui.form.trigger("Asset", "is_existing_asset");
 		frm.toggle_display("next_depreciation_date", frm.doc.docstatus < 1);
 
-		if (frm.doc.docstatus==1) {
+		if (frm.doc.docstatus == 1) {
 			if (in_list(["Submitted", "Partially Depreciated", "Fully Depreciated"], frm.doc.status)) {
-				frm.add_custom_button(__("Transfer Asset"), function() {
-					erpnext.asset.transfer_asset(frm);
-				}, __("Manage"));
+				frm.add_custom_button(
+					__("Transfer Asset"),
+					function () {
+						erpnext.asset.transfer_asset(frm);
+					},
+					__("Manage")
+				);
 
-				frm.add_custom_button(__("Scrap Asset"), function() {
-					erpnext.asset.scrap_asset(frm);
-				}, __("Manage"));
+				frm.add_custom_button(
+					__("Scrap Asset"),
+					function () {
+						erpnext.asset.scrap_asset(frm);
+					},
+					__("Manage")
+				);
 
-				frm.add_custom_button(__("Sell Asset"), function() {
-					frm.trigger("make_sales_invoice");
-				}, __("Manage"));
-
-			} else if (frm.doc.status=='Scrapped') {
-				frm.add_custom_button(__("Restore Asset"), function() {
-					erpnext.asset.restore_asset(frm);
-				}, __("Manage"));
+				frm.add_custom_button(
+					__("Sell Asset"),
+					function () {
+						frm.trigger("make_sales_invoice");
+					},
+					__("Manage")
+				);
+			} else if (frm.doc.status == "Scrapped") {
+				frm.add_custom_button(
+					__("Restore Asset"),
+					function () {
+						erpnext.asset.restore_asset(frm);
+					},
+					__("Manage")
+				);
 			}
 
 			if (frm.doc.maintenance_required && !frm.doc.maintenance_schedule) {
-				frm.add_custom_button(__("Maintain Asset"), function() {
-					frm.trigger("create_asset_maintenance");
-				}, __("Manage"));
+				frm.add_custom_button(
+					__("Maintain Asset"),
+					function () {
+						frm.trigger("create_asset_maintenance");
+					},
+					__("Manage")
+				);
 			}
 
-			frm.add_custom_button(__("Repair Asset"), function() {
-				frm.trigger("create_asset_repair");
-			}, __("Manage"));
+			frm.add_custom_button(
+				__("Repair Asset"),
+				function () {
+					frm.trigger("create_asset_repair");
+				},
+				__("Manage")
+			);
 
-			frm.add_custom_button(__("Split Asset"), function() {
-				frm.trigger("split_asset");
-			}, __("Manage"));
+			frm.add_custom_button(
+				__("Split Asset"),
+				function () {
+					frm.trigger("split_asset");
+				},
+				__("Manage")
+			);
 
-			if (frm.doc.status != 'Fully Depreciated') {
-				frm.add_custom_button(__("Adjust Asset Value"), function() {
-					frm.trigger("create_asset_value_adjustment");
-				}, __("Manage"));
+			if (frm.doc.status != "Fully Depreciated") {
+				frm.add_custom_button(
+					__("Adjust Asset Value"),
+					function () {
+						frm.trigger("create_asset_value_adjustment");
+					},
+					__("Manage")
+				);
 			}
 
 			if (!frm.doc.calculate_depreciation) {
-				frm.add_custom_button(__("Create Depreciation Entry"), function() {
-					frm.trigger("make_journal_entry");
-				}, __("Manage"));
+				frm.add_custom_button(
+					__("Create Depreciation Entry"),
+					function () {
+						frm.trigger("make_journal_entry");
+					},
+					__("Manage")
+				);
 			}
 
 			if (frm.doc.purchase_receipt || !frm.doc.is_existing_asset) {
-				frm.add_custom_button(__("View General Ledger"), function() {
-					frappe.route_options = {
-						"voucher_no": frm.doc.name,
-						"from_date": frm.doc.available_for_use_date,
-						"to_date": frm.doc.available_for_use_date,
-						"company": frm.doc.company
-					};
-					frappe.set_route("query-report", "General Ledger");
-				}, __("Manage"));
+				frm.add_custom_button(
+					__("View General Ledger"),
+					function () {
+						frappe.route_options = {
+							voucher_no: frm.doc.name,
+							from_date: frm.doc.available_for_use_date,
+							to_date: frm.doc.available_for_use_date,
+							company: frm.doc.company,
+						};
+						frappe.set_route("query-report", "General Ledger");
+					},
+					__("Manage")
+				);
 			}
 
 			if (frm.doc.depr_entry_posting_status === "Failed") {
@@ -149,10 +188,10 @@
 			frm.toggle_reqd("finance_books", frm.doc.calculate_depreciation);
 
 			if (frm.doc.is_composite_asset && !frm.doc.capitalized_in) {
-				$('.primary-action').prop('hidden', true);
-				$('.form-message').text('Capitalize this asset to confirm');
+				$(".primary-action").prop("hidden", true);
+				$(".form-message").text("Capitalize this asset to confirm");
 
-				frm.add_custom_button(__("Capitalize Asset"), function() {
+				frm.add_custom_button(__("Capitalize Asset"), function () {
 					frm.trigger("create_asset_capitalization");
 				});
 			}
@@ -172,81 +211,89 @@
 		frm.dashboard.set_headline_alert(alert);
 	},
 
-	toggle_reference_doc: function(frm) {
+	toggle_reference_doc: function (frm) {
 		if (frm.doc.purchase_receipt && frm.doc.purchase_invoice && frm.doc.docstatus === 1) {
-			frm.set_df_property('purchase_invoice', 'read_only', 1);
-			frm.set_df_property('purchase_receipt', 'read_only', 1);
-		}
-		else if (frm.doc.is_existing_asset || frm.doc.is_composite_asset) {
-			frm.toggle_reqd('purchase_receipt', 0);
-			frm.toggle_reqd('purchase_invoice', 0);
-		}
-		else if (frm.doc.purchase_receipt) {
+			frm.set_df_property("purchase_invoice", "read_only", 1);
+			frm.set_df_property("purchase_receipt", "read_only", 1);
+		} else if (frm.doc.is_existing_asset || frm.doc.is_composite_asset) {
+			frm.toggle_reqd("purchase_receipt", 0);
+			frm.toggle_reqd("purchase_invoice", 0);
+		} else if (frm.doc.purchase_receipt) {
 			// if purchase receipt link is set then set PI disabled
-			frm.toggle_reqd('purchase_invoice', 0);
-			frm.set_df_property('purchase_invoice', 'read_only', 1);
-		}
-		else if (frm.doc.purchase_invoice) {
+			frm.toggle_reqd("purchase_invoice", 0);
+			frm.set_df_property("purchase_invoice", "read_only", 1);
+		} else if (frm.doc.purchase_invoice) {
 			// if purchase invoice link is set then set PR disabled
-			frm.toggle_reqd('purchase_receipt', 0);
-			frm.set_df_property('purchase_receipt', 'read_only', 1);
-		}
-		else {
-			frm.toggle_reqd('purchase_receipt', 1);
-			frm.set_df_property('purchase_receipt', 'read_only', 0);
-			frm.toggle_reqd('purchase_invoice', 1);
-			frm.set_df_property('purchase_invoice', 'read_only', 0);
+			frm.toggle_reqd("purchase_receipt", 0);
+			frm.set_df_property("purchase_receipt", "read_only", 1);
+		} else {
+			frm.toggle_reqd("purchase_receipt", 1);
+			frm.set_df_property("purchase_receipt", "read_only", 0);
+			frm.toggle_reqd("purchase_invoice", 1);
+			frm.set_df_property("purchase_invoice", "read_only", 0);
 		}
 	},
 
-	make_journal_entry: function(frm) {
+	make_journal_entry: function (frm) {
 		frappe.call({
 			method: "erpnext.assets.doctype.asset.asset.make_journal_entry",
 			args: {
-				asset_name: frm.doc.name
+				asset_name: frm.doc.name,
 			},
-			callback: function(r) {
+			callback: function (r) {
 				if (r.message) {
 					var doclist = frappe.model.sync(r.message);
 					frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
 				}
-			}
-		})
+			},
+		});
 	},
 
-	render_depreciation_schedule_view: function(frm, asset_depr_schedule_doc) {
+	render_depreciation_schedule_view: function (frm, asset_depr_schedule_doc) {
 		let wrapper = $(frm.fields_dict["depreciation_schedule_view"].wrapper).empty();
 
 		let data = [];
 
 		asset_depr_schedule_doc.depreciation_schedule.forEach((sch) => {
 			const row = [
-				sch['idx'],
-				frappe.format(sch['schedule_date'], { fieldtype: 'Date' }),
-				frappe.format(sch['depreciation_amount'], { fieldtype: 'Currency' }),
-				frappe.format(sch['accumulated_depreciation_amount'], { fieldtype: 'Currency' }),
-				sch['journal_entry'] || '',
+				sch["idx"],
+				frappe.format(sch["schedule_date"], { fieldtype: "Date" }),
+				frappe.format(sch["depreciation_amount"], { fieldtype: "Currency" }),
+				frappe.format(sch["accumulated_depreciation_amount"], { fieldtype: "Currency" }),
+				sch["journal_entry"] || "",
 			];
 
 			if (asset_depr_schedule_doc.shift_based) {
-				row.push(sch['shift']);
+				row.push(sch["shift"]);
 			}
 
 			data.push(row);
 		});
 
 		let columns = [
-			{name: __("No."), editable: false, resizable: false, format: value => value, width: 60},
-			{name: __("Schedule Date"), editable: false, resizable: false, width: 270},
-			{name: __("Depreciation Amount"), editable: false, resizable: false, width: 164},
-			{name: __("Accumulated Depreciation Amount"), editable: false, resizable: false, width: 164},
+			{ name: __("No."), editable: false, resizable: false, format: (value) => value, width: 60 },
+			{ name: __("Schedule Date"), editable: false, resizable: false, width: 270 },
+			{ name: __("Depreciation Amount"), editable: false, resizable: false, width: 164 },
+			{ name: __("Accumulated Depreciation Amount"), editable: false, resizable: false, width: 164 },
 		];
 
 		if (asset_depr_schedule_doc.shift_based) {
-			columns.push({name: __("Journal Entry"), editable: false, resizable: false, format: value => `<a href="/app/journal-entry/${value}">${value}</a>`, width: 245});
-			columns.push({name: __("Shift"), editable: false, resizable: false, width: 59});
+			columns.push({
+				name: __("Journal Entry"),
+				editable: false,
+				resizable: false,
+				format: (value) => `<a href="/app/journal-entry/${value}">${value}</a>`,
+				width: 245,
+			});
+			columns.push({ name: __("Shift"), editable: false, resizable: false, width: 59 });
 		} else {
-			columns.push({name: __("Journal Entry"), editable: false, resizable: false, format: value => `<a href="/app/journal-entry/${value}">${value}</a>`, width: 304});
+			columns.push({
+				name: __("Journal Entry"),
+				editable: false,
+				resizable: false,
+				format: (value) => `<a href="/app/journal-entry/${value}">${value}</a>`,
+				width: 304,
+			});
 		}
 
 		let datatable = new frappe.DataTable(wrapper.get(0), {
@@ -255,55 +302,73 @@
 			layout: "fluid",
 			serialNoColumn: false,
 			checkboxColumn: true,
-			cellHeight: 35
+			cellHeight: 35,
 		});
 
-		datatable.style.setStyle(`.dt-scrollable`, {'font-size': '0.75rem', 'margin-bottom': '1rem', 'margin-left': '0.35rem', 'margin-right': '0.35rem'});
-		datatable.style.setStyle(`.dt-header`, {'margin-left': '0.35rem', 'margin-right': '0.35rem'});
-		datatable.style.setStyle(`.dt-cell--header .dt-cell__content`, {'color': 'var(--gray-600)', 'font-size': 'var(--text-sm)'});
-		datatable.style.setStyle(`.dt-cell`, {'color': 'var(--text-color)'});
-		datatable.style.setStyle(`.dt-cell--col-1`, {'text-align': 'center'});
-		datatable.style.setStyle(`.dt-cell--col-2`, {'font-weight': 600});
-		datatable.style.setStyle(`.dt-cell--col-3`, {'font-weight': 600});
+		datatable.style.setStyle(`.dt-scrollable`, {
+			"font-size": "0.75rem",
+			"margin-bottom": "1rem",
+			"margin-left": "0.35rem",
+			"margin-right": "0.35rem",
+		});
+		datatable.style.setStyle(`.dt-header`, { "margin-left": "0.35rem", "margin-right": "0.35rem" });
+		datatable.style.setStyle(`.dt-cell--header .dt-cell__content`, {
+			color: "var(--gray-600)",
+			"font-size": "var(--text-sm)",
+		});
+		datatable.style.setStyle(`.dt-cell`, { color: "var(--text-color)" });
+		datatable.style.setStyle(`.dt-cell--col-1`, { "text-align": "center" });
+		datatable.style.setStyle(`.dt-cell--col-2`, { "font-weight": 600 });
+		datatable.style.setStyle(`.dt-cell--col-3`, { "font-weight": 600 });
 	},
 
-	setup_chart_and_depr_schedule_view: async function(frm) {
-		if(frm.doc.finance_books.length > 1) {
-			return
+	setup_chart_and_depr_schedule_view: async function (frm) {
+		if (frm.doc.finance_books.length > 1) {
+			return;
 		}
 
-		var x_intervals = [frappe.format(frm.doc.purchase_date, { fieldtype: 'Date' })];
+		var x_intervals = [frappe.format(frm.doc.purchase_date, { fieldtype: "Date" })];
 		var asset_values = [frm.doc.gross_purchase_amount];
 
-		if(frm.doc.calculate_depreciation) {
-			if(frm.doc.opening_accumulated_depreciation) {
+		if (frm.doc.calculate_depreciation) {
+			if (frm.doc.opening_accumulated_depreciation) {
 				var depreciation_date = frappe.datetime.add_months(
 					frm.doc.finance_books[0].depreciation_start_date,
 					-1 * frm.doc.finance_books[0].frequency_of_depreciation
 				);
-				x_intervals.push(frappe.format(depreciation_date, { fieldtype: 'Date' }));
-				asset_values.push(flt(frm.doc.gross_purchase_amount - frm.doc.opening_accumulated_depreciation, precision('gross_purchase_amount')));
+				x_intervals.push(frappe.format(depreciation_date, { fieldtype: "Date" }));
+				asset_values.push(
+					flt(
+						frm.doc.gross_purchase_amount - frm.doc.opening_accumulated_depreciation,
+						precision("gross_purchase_amount")
+					)
+				);
 			}
 
-			let asset_depr_schedule_doc = (await frappe.call(
-				"erpnext.assets.doctype.asset_depreciation_schedule.asset_depreciation_schedule.get_asset_depr_schedule_doc",
-				{
-					asset_name: frm.doc.name,
-					status: "Active",
-					finance_book: frm.doc.finance_books[0].finance_book || null
-				}
-			)).message;
+			let asset_depr_schedule_doc = (
+				await frappe.call(
+					"erpnext.assets.doctype.asset_depreciation_schedule.asset_depreciation_schedule.get_asset_depr_schedule_doc",
+					{
+						asset_name: frm.doc.name,
+						status: "Active",
+						finance_book: frm.doc.finance_books[0].finance_book || null,
+					}
+				)
+			).message;
 
-			$.each(asset_depr_schedule_doc.depreciation_schedule || [], function(i, v) {
-				x_intervals.push(frappe.format(v.schedule_date, { fieldtype: 'Date' }));
-				var asset_value = flt(frm.doc.gross_purchase_amount - v.accumulated_depreciation_amount, precision('gross_purchase_amount'));
-				if(v.journal_entry) {
+			$.each(asset_depr_schedule_doc.depreciation_schedule || [], function (i, v) {
+				x_intervals.push(frappe.format(v.schedule_date, { fieldtype: "Date" }));
+				var asset_value = flt(
+					frm.doc.gross_purchase_amount - v.accumulated_depreciation_amount,
+					precision("gross_purchase_amount")
+				);
+				if (v.journal_entry) {
 					asset_values.push(asset_value);
 				} else {
 					if (in_list(["Scrapped", "Sold"], frm.doc.status)) {
 						asset_values.push(null);
 					} else {
-						asset_values.push(asset_value)
+						asset_values.push(asset_value);
 					}
 				}
 			});
@@ -311,25 +376,32 @@
 			frm.toggle_display(["depreciation_schedule_view"], 1);
 			frm.events.render_depreciation_schedule_view(frm, asset_depr_schedule_doc);
 		} else {
-			if(frm.doc.opening_accumulated_depreciation) {
-				x_intervals.push(frappe.format(frm.doc.creation.split(" ")[0], { fieldtype: 'Date' }));
-				asset_values.push(flt(frm.doc.gross_purchase_amount - frm.doc.opening_accumulated_depreciation, precision('gross_purchase_amount')));
+			if (frm.doc.opening_accumulated_depreciation) {
+				x_intervals.push(frappe.format(frm.doc.creation.split(" ")[0], { fieldtype: "Date" }));
+				asset_values.push(
+					flt(
+						frm.doc.gross_purchase_amount - frm.doc.opening_accumulated_depreciation,
+						precision("gross_purchase_amount")
+					)
+				);
 			}
 
-			let depr_entries = (await frappe.call({
-				method: "get_manual_depreciation_entries",
-				doc: frm.doc,
-			})).message;
+			let depr_entries = (
+				await frappe.call({
+					method: "get_manual_depreciation_entries",
+					doc: frm.doc,
+				})
+			).message;
 
-			$.each(depr_entries || [], function(i, v) {
-				x_intervals.push(frappe.format(v.posting_date, { fieldtype: 'Date' }));
-				let last_asset_value = asset_values[asset_values.length - 1]
-				asset_values.push(flt(last_asset_value - v.value, precision('gross_purchase_amount')));
+			$.each(depr_entries || [], function (i, v) {
+				x_intervals.push(frappe.format(v.posting_date, { fieldtype: "Date" }));
+				let last_asset_value = asset_values[asset_values.length - 1];
+				asset_values.push(flt(last_asset_value - v.value, precision("gross_purchase_amount")));
 			});
 		}
 
-		if(in_list(["Scrapped", "Sold"], frm.doc.status)) {
-			x_intervals.push(frappe.format(frm.doc.disposal_date, { fieldtype: 'Date' }));
+		if (in_list(["Scrapped", "Sold"], frm.doc.status)) {
+			x_intervals.push(frappe.format(frm.doc.disposal_date, { fieldtype: "Date" }));
 			asset_values.push(0);
 		}
 
@@ -337,145 +409,146 @@
 			title: "Asset Value",
 			data: {
 				labels: x_intervals,
-				datasets: [{
-					color: 'green',
-					values: asset_values,
-					formatted: asset_values.map(d => d?.toFixed(2))
-				}]
+				datasets: [
+					{
+						color: "green",
+						values: asset_values,
+						formatted: asset_values.map((d) => d?.toFixed(2)),
+					},
+				],
 			},
-			type: 'line'
+			type: "line",
 		});
 	},
 
-
-	item_code: function(frm) {
-		if(frm.doc.item_code && frm.doc.calculate_depreciation && frm.doc.gross_purchase_amount) {
-			frm.trigger('set_finance_book');
+	item_code: function (frm) {
+		if (frm.doc.item_code && frm.doc.calculate_depreciation && frm.doc.gross_purchase_amount) {
+			frm.trigger("set_finance_book");
 		} else {
-			frm.set_value('finance_books', []);
+			frm.set_value("finance_books", []);
 		}
 	},
 
-	set_finance_book: function(frm) {
+	set_finance_book: function (frm) {
 		frappe.call({
 			method: "erpnext.assets.doctype.asset.asset.get_item_details",
 			args: {
 				item_code: frm.doc.item_code,
 				asset_category: frm.doc.asset_category,
-				gross_purchase_amount: frm.doc.gross_purchase_amount
+				gross_purchase_amount: frm.doc.gross_purchase_amount,
 			},
-			callback: function(r, rt) {
-				if(r.message) {
-					frm.set_value('finance_books', r.message);
+			callback: function (r, rt) {
+				if (r.message) {
+					frm.set_value("finance_books", r.message);
 				}
-			}
-		})
+			},
+		});
 	},
 
-	is_existing_asset: function(frm) {
+	is_existing_asset: function (frm) {
 		frm.trigger("toggle_reference_doc");
 	},
 
-	is_composite_asset: function(frm) {
-		if(frm.doc.is_composite_asset) {
-			frm.set_value('gross_purchase_amount', 0);
-			frm.set_df_property('gross_purchase_amount', 'read_only', 1);
+	is_composite_asset: function (frm) {
+		if (frm.doc.is_composite_asset) {
+			frm.set_value("gross_purchase_amount", 0);
+			frm.set_df_property("gross_purchase_amount", "read_only", 1);
 		} else {
-			frm.set_df_property('gross_purchase_amount', 'read_only', 0);
+			frm.set_df_property("gross_purchase_amount", "read_only", 0);
 		}
 
 		frm.trigger("toggle_reference_doc");
 	},
 
-	make_sales_invoice: function(frm) {
+	make_sales_invoice: function (frm) {
 		frappe.call({
 			args: {
-				"asset": frm.doc.name,
-				"item_code": frm.doc.item_code,
-				"company": frm.doc.company,
-				"serial_no": frm.doc.serial_no
+				asset: frm.doc.name,
+				item_code: frm.doc.item_code,
+				company: frm.doc.company,
+				serial_no: frm.doc.serial_no,
 			},
 			method: "erpnext.assets.doctype.asset.asset.make_sales_invoice",
-			callback: function(r) {
+			callback: function (r) {
 				var doclist = frappe.model.sync(r.message);
 				frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
-			}
-		})
+			},
+		});
 	},
 
-	create_asset_maintenance: function(frm) {
+	create_asset_maintenance: function (frm) {
 		frappe.call({
 			args: {
-				"asset": frm.doc.name,
-				"item_code": frm.doc.item_code,
-				"item_name": frm.doc.item_name,
-				"asset_category": frm.doc.asset_category,
-				"company": frm.doc.company
+				asset: frm.doc.name,
+				item_code: frm.doc.item_code,
+				item_name: frm.doc.item_name,
+				asset_category: frm.doc.asset_category,
+				company: frm.doc.company,
 			},
 			method: "erpnext.assets.doctype.asset.asset.create_asset_maintenance",
-			callback: function(r) {
+			callback: function (r) {
 				var doclist = frappe.model.sync(r.message);
 				frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
-			}
-		})
+			},
+		});
 	},
 
-	create_asset_repair: function(frm) {
+	create_asset_repair: function (frm) {
 		frappe.call({
 			args: {
-				"asset": frm.doc.name,
-				"asset_name": frm.doc.asset_name
+				asset: frm.doc.name,
+				asset_name: frm.doc.asset_name,
 			},
 			method: "erpnext.assets.doctype.asset.asset.create_asset_repair",
-			callback: function(r) {
+			callback: function (r) {
 				var doclist = frappe.model.sync(r.message);
 				frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
-			}
+			},
 		});
 	},
 
-	create_asset_capitalization: function(frm) {
+	create_asset_capitalization: function (frm) {
 		frappe.call({
 			args: {
-				"asset": frm.doc.name,
+				asset: frm.doc.name,
 			},
 			method: "erpnext.assets.doctype.asset.asset.create_asset_capitalization",
-			callback: function(r) {
+			callback: function (r) {
 				var doclist = frappe.model.sync(r.message);
 				frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
-			}
+			},
 		});
 	},
 
-	split_asset: function(frm) {
-		const title = __('Split Asset');
+	split_asset: function (frm) {
+		const title = __("Split Asset");
 
 		const fields = [
 			{
-				fieldname: 'split_qty',
-				fieldtype: 'Int',
-				label: __('Split Qty'),
-				reqd: 1
-			}
+				fieldname: "split_qty",
+				fieldtype: "Int",
+				label: __("Split Qty"),
+				reqd: 1,
+			},
 		];
 
 		let dialog = new frappe.ui.Dialog({
 			title: title,
-			fields: fields
+			fields: fields,
 		});
 
-		dialog.set_primary_action(__('Split'), function() {
+		dialog.set_primary_action(__("Split"), function () {
 			const dialog_data = dialog.get_values();
 			frappe.call({
 				args: {
-					"asset_name": frm.doc.name,
-					"split_qty": cint(dialog_data.split_qty)
+					asset_name: frm.doc.name,
+					split_qty: cint(dialog_data.split_qty),
 				},
 				method: "erpnext.assets.doctype.asset.asset.split_asset",
-				callback: function(r) {
+				callback: function (r) {
 					let doclist = frappe.model.sync(r.message);
 					frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
-				}
+				},
 			});
 
 			dialog.hide();
@@ -484,23 +557,23 @@
 		dialog.show();
 	},
 
-	create_asset_value_adjustment: function(frm) {
+	create_asset_value_adjustment: function (frm) {
 		frappe.call({
 			args: {
-				"asset": frm.doc.name,
-				"asset_category": frm.doc.asset_category,
-				"company": frm.doc.company
+				asset: frm.doc.name,
+				asset_category: frm.doc.asset_category,
+				company: frm.doc.company,
 			},
 			method: "erpnext.assets.doctype.asset.asset.create_asset_value_adjustment",
 			freeze: 1,
-			callback: function(r) {
+			callback: function (r) {
 				var doclist = frappe.model.sync(r.message);
 				frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
-			}
-		})
+			},
+		});
 	},
 
-	calculate_depreciation: function(frm) {
+	calculate_depreciation: function (frm) {
 		frm.toggle_reqd("finance_books", frm.doc.calculate_depreciation);
 		if (frm.doc.item_code && frm.doc.calculate_depreciation && frm.doc.gross_purchase_amount) {
 			frm.trigger("set_finance_book");
@@ -509,203 +582,249 @@
 		}
 	},
 
-	gross_purchase_amount: function(frm) {
+	gross_purchase_amount: function (frm) {
 		if (frm.doc.finance_books) {
-			frm.doc.finance_books.forEach(d => {
+			frm.doc.finance_books.forEach((d) => {
 				frm.events.set_depreciation_rate(frm, d);
-			})
+			});
 		}
 	},
 
 	purchase_receipt: (frm) => {
-		frm.trigger('toggle_reference_doc');
+		frm.trigger("toggle_reference_doc");
 		if (frm.doc.purchase_receipt) {
 			if (frm.doc.item_code) {
-				frappe.db.get_doc('Purchase Receipt', frm.doc.purchase_receipt).then(pr_doc => {
-					frm.events.set_values_from_purchase_doc(frm, 'Purchase Receipt', pr_doc)
+				frappe.db.get_doc("Purchase Receipt", frm.doc.purchase_receipt).then((pr_doc) => {
+					frm.events.set_values_from_purchase_doc(frm, "Purchase Receipt", pr_doc);
 				});
 			} else {
-				frm.set_value('purchase_receipt', '');
+				frm.set_value("purchase_receipt", "");
 				frappe.msgprint({
-					title: __('Not Allowed'),
-					message: __("Please select Item Code first")
+					title: __("Not Allowed"),
+					message: __("Please select Item Code first"),
 				});
 			}
 		}
 	},
 
 	purchase_invoice: (frm) => {
-		frm.trigger('toggle_reference_doc');
+		frm.trigger("toggle_reference_doc");
 		if (frm.doc.purchase_invoice) {
 			if (frm.doc.item_code) {
-				frappe.db.get_doc('Purchase Invoice', frm.doc.purchase_invoice).then(pi_doc => {
-					frm.events.set_values_from_purchase_doc(frm, 'Purchase Invoice', pi_doc)
+				frappe.db.get_doc("Purchase Invoice", frm.doc.purchase_invoice).then((pi_doc) => {
+					frm.events.set_values_from_purchase_doc(frm, "Purchase Invoice", pi_doc);
 				});
 			} else {
-				frm.set_value('purchase_invoice', '');
+				frm.set_value("purchase_invoice", "");
 				frappe.msgprint({
-					title: __('Not Allowed'),
-					message: __("Please select Item Code first")
+					title: __("Not Allowed"),
+					message: __("Please select Item Code first"),
 				});
 			}
 		}
 	},
 
-	set_values_from_purchase_doc: function(frm, doctype, purchase_doc) {
-		frm.set_value('company', purchase_doc.company);
+	set_values_from_purchase_doc: function (frm, doctype, purchase_doc) {
+		frm.set_value("company", purchase_doc.company);
 		if (purchase_doc.bill_date) {
-			frm.set_value('purchase_date', purchase_doc.bill_date);
+			frm.set_value("purchase_date", purchase_doc.bill_date);
 		} else {
-			frm.set_value('purchase_date', purchase_doc.posting_date);
+			frm.set_value("purchase_date", purchase_doc.posting_date);
 		}
 		if (!frm.doc.is_existing_asset && !frm.doc.available_for_use_date) {
-			frm.set_value('available_for_use_date', frm.doc.purchase_date);
+			frm.set_value("available_for_use_date", frm.doc.purchase_date);
 		}
-		const item = purchase_doc.items.find(item => item.item_code === frm.doc.item_code);
+		const item = purchase_doc.items.find((item) => item.item_code === frm.doc.item_code);
 		if (!item) {
-			let doctype_field = frappe.scrub(doctype)
-			frm.set_value(doctype_field, '');
+			let doctype_field = frappe.scrub(doctype);
+			frm.set_value(doctype_field, "");
 			frappe.msgprint({
-				title: __('Invalid {0}', [__(doctype)]),
-				message: __('The selected {0} does not contain the selected Asset Item.', [__(doctype)]),
-				indicator: 'red'
+				title: __("Invalid {0}", [__(doctype)]),
+				message: __("The selected {0} does not contain the selected Asset Item.", [__(doctype)]),
+				indicator: "red",
 			});
 		}
-		frappe.db.get_value('Item', item.item_code, 'is_grouped_asset', (r) => {
+		frappe.db.get_value("Item", item.item_code, "is_grouped_asset", (r) => {
 			var asset_quantity = r.is_grouped_asset ? item.qty : 1;
-			var purchase_amount = flt(item.valuation_rate * asset_quantity, precision('gross_purchase_amount'));
+			var purchase_amount = flt(
+				item.valuation_rate * asset_quantity,
+				precision("gross_purchase_amount")
+			);
 
-			frm.set_value('gross_purchase_amount', purchase_amount);
-			frm.set_value('purchase_receipt_amount', purchase_amount);
-			frm.set_value('asset_quantity', asset_quantity);
-			frm.set_value('cost_center', item.cost_center || purchase_doc.cost_center);
-			if(item.asset_location) { frm.set_value('location', item.asset_location); }
+			frm.set_value("gross_purchase_amount", purchase_amount);
+			frm.set_value("purchase_receipt_amount", purchase_amount);
+			frm.set_value("asset_quantity", asset_quantity);
+			frm.set_value("cost_center", item.cost_center || purchase_doc.cost_center);
+			if (item.asset_location) {
+				frm.set_value("location", item.asset_location);
+			}
 		});
 	},
 
-	set_depreciation_rate: function(frm, row) {
-		if (row.total_number_of_depreciations && row.frequency_of_depreciation
-			&& row.expected_value_after_useful_life) {
+	set_depreciation_rate: function (frm, row) {
+		if (
+			row.total_number_of_depreciations &&
+			row.frequency_of_depreciation &&
+			row.expected_value_after_useful_life
+		) {
 			frappe.call({
 				method: "get_depreciation_rate",
 				doc: frm.doc,
 				args: row,
-				callback: function(r) {
+				callback: function (r) {
 					if (r.message) {
 						frappe.flags.dont_change_rate = true;
-						frappe.model.set_value(row.doctype, row.name,
-							"rate_of_depreciation", flt(r.message, precision("rate_of_depreciation", row)));
+						frappe.model.set_value(
+							row.doctype,
+							row.name,
+							"rate_of_depreciation",
+							flt(r.message, precision("rate_of_depreciation", row))
+						);
 					}
-				}
+				},
 			});
 		}
 	},
 
-	set_salvage_value_percentage_or_expected_value_after_useful_life: function(frm, row, salvage_value_percentage_changed, expected_value_after_useful_life_changed) {
+	set_salvage_value_percentage_or_expected_value_after_useful_life: function (
+		frm,
+		row,
+		salvage_value_percentage_changed,
+		expected_value_after_useful_life_changed
+	) {
 		if (expected_value_after_useful_life_changed) {
 			frappe.flags.from_set_salvage_value_percentage_or_expected_value_after_useful_life = true;
-			const new_salvage_value_percentage = flt((row.expected_value_after_useful_life * 100) / frm.doc.gross_purchase_amount, precision("salvage_value_percentage", row));
-			frappe.model.set_value(row.doctype, row.name, "salvage_value_percentage", new_salvage_value_percentage);
+			const new_salvage_value_percentage = flt(
+				(row.expected_value_after_useful_life * 100) / frm.doc.gross_purchase_amount,
+				precision("salvage_value_percentage", row)
+			);
+			frappe.model.set_value(
+				row.doctype,
+				row.name,
+				"salvage_value_percentage",
+				new_salvage_value_percentage
+			);
 			frappe.flags.from_set_salvage_value_percentage_or_expected_value_after_useful_life = false;
 		} else if (salvage_value_percentage_changed) {
 			frappe.flags.from_set_salvage_value_percentage_or_expected_value_after_useful_life = true;
-			const new_expected_value_after_useful_life = flt(frm.doc.gross_purchase_amount * (row.salvage_value_percentage / 100), precision('gross_purchase_amount'));
-			frappe.model.set_value(row.doctype, row.name, "expected_value_after_useful_life", new_expected_value_after_useful_life);
+			const new_expected_value_after_useful_life = flt(
+				frm.doc.gross_purchase_amount * (row.salvage_value_percentage / 100),
+				precision("gross_purchase_amount")
+			);
+			frappe.model.set_value(
+				row.doctype,
+				row.name,
+				"expected_value_after_useful_life",
+				new_expected_value_after_useful_life
+			);
 			frappe.flags.from_set_salvage_value_percentage_or_expected_value_after_useful_life = false;
 		}
 	},
 });
 
-frappe.ui.form.on('Asset Finance Book', {
-	depreciation_method: function(frm, cdt, cdn) {
+frappe.ui.form.on("Asset Finance Book", {
+	depreciation_method: function (frm, cdt, cdn) {
 		const row = locals[cdt][cdn];
 		frm.events.set_depreciation_rate(frm, row);
 	},
 
-	expected_value_after_useful_life: function(frm, cdt, cdn) {
+	expected_value_after_useful_life: function (frm, cdt, cdn) {
 		const row = locals[cdt][cdn];
 		if (!frappe.flags.from_set_salvage_value_percentage_or_expected_value_after_useful_life) {
-			frm.events.set_salvage_value_percentage_or_expected_value_after_useful_life(frm, row, false, true);
+			frm.events.set_salvage_value_percentage_or_expected_value_after_useful_life(
+				frm,
+				row,
+				false,
+				true
+			);
 		}
 		frm.events.set_depreciation_rate(frm, row);
 	},
 
-	salvage_value_percentage: function(frm, cdt, cdn) {
+	salvage_value_percentage: function (frm, cdt, cdn) {
 		const row = locals[cdt][cdn];
 		if (!frappe.flags.from_set_salvage_value_percentage_or_expected_value_after_useful_life) {
-			frm.events.set_salvage_value_percentage_or_expected_value_after_useful_life(frm, row, true, false);
+			frm.events.set_salvage_value_percentage_or_expected_value_after_useful_life(
+				frm,
+				row,
+				true,
+				false
+			);
 		}
 	},
 
-	frequency_of_depreciation: function(frm, cdt, cdn) {
+	frequency_of_depreciation: function (frm, cdt, cdn) {
 		const row = locals[cdt][cdn];
 		frm.events.set_depreciation_rate(frm, row);
 	},
 
-	total_number_of_depreciations: function(frm, cdt, cdn) {
+	total_number_of_depreciations: function (frm, cdt, cdn) {
 		const row = locals[cdt][cdn];
 		frm.events.set_depreciation_rate(frm, row);
 	},
 
-	rate_of_depreciation: function(frm, cdt, cdn) {
-		if(!frappe.flags.dont_change_rate) {
+	rate_of_depreciation: function (frm, cdt, cdn) {
+		if (!frappe.flags.dont_change_rate) {
 			frappe.model.set_value(cdt, cdn, "expected_value_after_useful_life", 0);
 		}
 
 		frappe.flags.dont_change_rate = false;
 	},
 
-	depreciation_start_date: function(frm, cdt, cdn) {
+	depreciation_start_date: function (frm, cdt, cdn) {
 		const book = locals[cdt][cdn];
-		if (frm.doc.available_for_use_date && book.depreciation_start_date == frm.doc.available_for_use_date) {
+		if (
+			frm.doc.available_for_use_date &&
+			book.depreciation_start_date == frm.doc.available_for_use_date
+		) {
 			frappe.msgprint(__("Depreciation Posting Date should not be equal to Available for Use Date."));
 			book.depreciation_start_date = "";
 			frm.refresh_field("finance_books");
 		}
-	}
+	},
 });
 
-erpnext.asset.scrap_asset = function(frm) {
+erpnext.asset.scrap_asset = function (frm) {
 	frappe.confirm(__("Do you really want to scrap this asset?"), function () {
 		frappe.call({
 			args: {
-				"asset_name": frm.doc.name
+				asset_name: frm.doc.name,
 			},
 			method: "erpnext.assets.doctype.asset.depreciation.scrap_asset",
-			callback: function(r) {
+			callback: function (r) {
 				cur_frm.reload_doc();
-			}
-		})
-	})
+			},
+		});
+	});
 };
 
-erpnext.asset.restore_asset = function(frm) {
+erpnext.asset.restore_asset = function (frm) {
 	frappe.confirm(__("Do you really want to restore this scrapped asset?"), function () {
 		frappe.call({
 			args: {
-				"asset_name": frm.doc.name
+				asset_name: frm.doc.name,
 			},
 			method: "erpnext.assets.doctype.asset.depreciation.restore_asset",
-			callback: function(r) {
+			callback: function (r) {
 				cur_frm.reload_doc();
-			}
-		})
-	})
+			},
+		});
+	});
 };
 
-erpnext.asset.transfer_asset = function() {
+erpnext.asset.transfer_asset = function () {
 	frappe.call({
 		method: "erpnext.assets.doctype.asset.asset.make_asset_movement",
 		freeze: true,
-		args:{
-			"assets": [{ name: cur_frm.doc.name }],
-			"purpose": "Transfer"
+		args: {
+			assets: [{ name: cur_frm.doc.name }],
+			purpose: "Transfer",
 		},
 		callback: function (r) {
 			if (r.message) {
 				var doc = frappe.model.sync(r.message)[0];
 				frappe.set_route("Form", doc.doctype, doc.name);
 			}
-		}
+		},
 	});
 };
diff --git a/erpnext/assets/doctype/asset/asset_list.js b/erpnext/assets/doctype/asset/asset_list.js
index 5f53b00..712958a 100644
--- a/erpnext/assets/doctype/asset/asset_list.js
+++ b/erpnext/assets/doctype/asset/asset_list.js
@@ -1,56 +1,46 @@
-frappe.listview_settings['Asset'] = {
-	add_fields: ['status'],
+frappe.listview_settings["Asset"] = {
+	add_fields: ["status"],
 	get_indicator: function (doc) {
 		if (doc.status === "Fully Depreciated") {
 			return [__("Fully Depreciated"), "green", "status,=,Fully Depreciated"];
-
 		} else if (doc.status === "Partially Depreciated") {
 			return [__("Partially Depreciated"), "grey", "status,=,Partially Depreciated"];
-
 		} else if (doc.status === "Sold") {
 			return [__("Sold"), "green", "status,=,Sold"];
-
 		} else if (["Capitalized", "Decapitalized"].includes(doc.status)) {
 			return [__(doc.status), "grey", "status,=," + doc.status];
-
 		} else if (doc.status === "Scrapped") {
 			return [__("Scrapped"), "grey", "status,=,Scrapped"];
-
 		} else if (doc.status === "In Maintenance") {
 			return [__("In Maintenance"), "orange", "status,=,In Maintenance"];
-
 		} else if (doc.status === "Out of Order") {
 			return [__("Out of Order"), "grey", "status,=,Out of Order"];
-
 		} else if (doc.status === "Issue") {
 			return [__("Issue"), "orange", "status,=,Issue"];
-
 		} else if (doc.status === "Receipt") {
 			return [__("Receipt"), "green", "status,=,Receipt"];
-
 		} else if (doc.status === "Submitted") {
 			return [__("Submitted"), "blue", "status,=,Submitted"];
-
 		} else if (doc.status === "Draft") {
 			return [__("Draft"), "red", "status,=,Draft"];
 		}
 	},
-	onload: function(me) {
-		me.page.add_action_item(__("Make Asset Movement"), function() {
+	onload: function (me) {
+		me.page.add_action_item(__("Make Asset Movement"), function () {
 			const assets = me.get_checked_items();
 			frappe.call({
 				method: "erpnext.assets.doctype.asset.asset.make_asset_movement",
 				freeze: true,
-				args:{
-					"assets": assets
+				args: {
+					assets: assets,
 				},
 				callback: function (r) {
 					if (r.message) {
 						var doc = frappe.model.sync(r.message)[0];
 						frappe.set_route("Form", doc.doctype, doc.name);
 					}
-				}
+				},
 			});
 		});
 	},
-}
+};
diff --git a/erpnext/assets/doctype/asset_capitalization/asset_capitalization.js b/erpnext/assets/doctype/asset_capitalization/asset_capitalization.js
index 110f2c4..651b75d 100644
--- a/erpnext/assets/doctype/asset_capitalization/asset_capitalization.js
+++ b/erpnext/assets/doctype/asset_capitalization/asset_capitalization.js
@@ -3,10 +3,9 @@
 
 frappe.provide("erpnext.assets");
 
-
 erpnext.assets.AssetCapitalization = class AssetCapitalization extends erpnext.stock.StockController {
 	setup() {
-		this.frm.ignore_doctypes_on_cancel_all = ['Serial and Batch Bundle', 'Asset Movement'];
+		this.frm.ignore_doctypes_on_cancel_all = ["Serial and Batch Bundle", "Asset Movement"];
 		this.setup_posting_date_time_check();
 	}
 
@@ -17,7 +16,10 @@
 	refresh() {
 		this.show_general_ledger();
 
-		if ((this.frm.doc.stock_items && this.frm.doc.stock_items.length) || !this.frm.doc.target_is_fixed_asset) {
+		if (
+			(this.frm.doc.stock_items && this.frm.doc.stock_items.length) ||
+			!this.frm.doc.target_is_fixed_asset
+		) {
 			this.show_stock_ledger();
 		}
 
@@ -32,32 +34,32 @@
 
 		me.setup_warehouse_query();
 
-		me.frm.set_query("target_item_code", function() {
+		me.frm.set_query("target_item_code", function () {
 			if (me.frm.doc.entry_type == "Capitalization") {
-				return erpnext.queries.item({"is_stock_item": 0, "is_fixed_asset": 1});
+				return erpnext.queries.item({ is_stock_item: 0, is_fixed_asset: 1 });
 			} else {
-				return erpnext.queries.item({"is_stock_item": 1, "is_fixed_asset": 0});
+				return erpnext.queries.item({ is_stock_item: 1, is_fixed_asset: 0 });
 			}
 		});
 
-		me.frm.set_query("target_asset", function() {
+		me.frm.set_query("target_asset", function () {
 			return {
-				filters: {'is_composite_asset': 1, 'docstatus': 0 }
-			}
+				filters: { is_composite_asset: 1, docstatus: 0 },
+			};
 		});
 
-		me.frm.set_query("asset", "asset_items", function() {
+		me.frm.set_query("asset", "asset_items", function () {
 			var filters = {
-				'status': ["not in", ["Draft", "Scrapped", "Sold", "Capitalized", "Decapitalized"]],
-				'docstatus': 1
+				status: ["not in", ["Draft", "Scrapped", "Sold", "Capitalized", "Decapitalized"]],
+				docstatus: 1,
 			};
 
 			if (me.frm.doc.target_asset) {
-				filters['name'] = ['!=', me.frm.doc.target_asset];
+				filters["name"] = ["!=", me.frm.doc.target_asset];
 			}
 
 			return {
-				filters: filters
+				filters: filters,
 			};
 		});
 
@@ -65,58 +67,67 @@
 			let row = locals[cdt][cdn];
 			return {
 				filters: {
-					'item_code': row.item_code,
-					'voucher_type': doc.doctype,
-					'voucher_no': ["in", [doc.name, ""]],
-					'is_cancelled': 0,
-				}
-			}
+					item_code: row.item_code,
+					voucher_type: doc.doctype,
+					voucher_no: ["in", [doc.name, ""]],
+					is_cancelled: 0,
+				},
+			};
 		});
 
-		me.frm.set_query("item_code", "stock_items", function() {
-			return erpnext.queries.item({"is_stock_item": 1});
+		me.frm.set_query("item_code", "stock_items", function () {
+			return erpnext.queries.item({ is_stock_item: 1 });
 		});
 
-		me.frm.set_query("item_code", "service_items", function() {
-			return erpnext.queries.item({"is_stock_item": 0, "is_fixed_asset": 0});
+		me.frm.set_query("item_code", "service_items", function () {
+			return erpnext.queries.item({ is_stock_item: 0, is_fixed_asset: 0 });
 		});
 
-		me.frm.set_query('batch_no', 'stock_items', function(doc, cdt, cdn) {
+		me.frm.set_query("batch_no", "stock_items", function (doc, cdt, cdn) {
 			var item = locals[cdt][cdn];
 			if (!item.item_code) {
 				frappe.throw(__("Please enter Item Code to get Batch Number"));
 			} else {
 				var filters = {
-					'item_code': item.item_code,
-					'posting_date': me.frm.doc.posting_date || frappe.datetime.nowdate(),
-					'warehouse': item.warehouse
+					item_code: item.item_code,
+					posting_date: me.frm.doc.posting_date || frappe.datetime.nowdate(),
+					warehouse: item.warehouse,
 				};
 
 				return {
 					query: "erpnext.controllers.queries.get_batch_no",
-					filters: filters
+					filters: filters,
 				};
 			}
 		});
 
-		me.frm.set_query('expense_account', 'service_items', function() {
+		me.frm.set_query("expense_account", "service_items", function () {
 			return {
 				filters: {
-					"account_type": ['in', ["Tax", "Expense Account", "Income Account", "Expenses Included In Valuation", "Expenses Included In Asset Valuation"]],
-					"is_group": 0,
-					"company": me.frm.doc.company
-				}
+					account_type: [
+						"in",
+						[
+							"Tax",
+							"Expense Account",
+							"Income Account",
+							"Expenses Included In Valuation",
+							"Expenses Included In Asset Valuation",
+						],
+					],
+					is_group: 0,
+					company: me.frm.doc.company,
+				},
 			};
 		});
 
-		let sbb_field = me.frm.get_docfield('stock_items', 'serial_and_batch_bundle');
+		let sbb_field = me.frm.get_docfield("stock_items", "serial_and_batch_bundle");
 		if (sbb_field) {
 			sbb_field.get_route_options_for_new_doc = (row) => {
 				return {
-					'item_code': row.doc.item_code,
-					'warehouse': row.doc.warehouse,
-					'voucher_type': me.frm.doc.doctype,
-				}
+					item_code: row.doc.item_code,
+					warehouse: row.doc.warehouse,
+					voucher_type: me.frm.doc.doctype,
+				};
 			};
 		}
 	}
@@ -126,7 +137,10 @@
 	}
 
 	target_asset() {
-		if (this.frm.doc.target_asset && this.frm.doc.capitalization_method === "Choose a WIP composite asset") {
+		if (
+			this.frm.doc.target_asset &&
+			this.frm.doc.capitalization_method === "Choose a WIP composite asset"
+		) {
 			this.set_consumed_stock_items_tagged_to_wip_composite_asset(this.frm.doc.target_asset);
 			this.get_target_asset_details();
 		}
@@ -143,7 +157,7 @@
 				},
 				callback: function (r) {
 					if (!r.exc && r.message) {
-						if(r.message[0] && r.message[0].length) {
+						if (r.message[0] && r.message[0].length) {
 							me.frm.clear_table("stock_items");
 							for (let item of r.message[0]) {
 								me.frm.add_child("stock_items", item);
@@ -160,7 +174,7 @@
 
 						me.calculate_totals();
 					}
-				}
+				},
 			});
 		}
 	}
@@ -192,7 +206,7 @@
 		if (this.frm.doc.posting_date) {
 			frappe.run_serially([
 				() => this.get_all_item_warehouse_details(),
-				() => this.get_all_asset_values()
+				() => this.get_all_asset_values(),
 			]);
 		}
 	}
@@ -248,15 +262,15 @@
 	}
 
 	stock_items_add(doc, cdt, cdn) {
-		erpnext.accounts.dimensions.copy_dimension_from_first_row(this.frm, cdt, cdn, 'stock_items');
+		erpnext.accounts.dimensions.copy_dimension_from_first_row(this.frm, cdt, cdn, "stock_items");
 	}
 
 	asset_items_add(doc, cdt, cdn) {
-		erpnext.accounts.dimensions.copy_dimension_from_first_row(this.frm, cdt, cdn, 'asset_items');
+		erpnext.accounts.dimensions.copy_dimension_from_first_row(this.frm, cdt, cdn, "asset_items");
 	}
 
 	serivce_items_add(doc, cdt, cdn) {
-		erpnext.accounts.dimensions.copy_dimension_from_first_row(this.frm, cdt, cdn, 'service_items');
+		erpnext.accounts.dimensions.copy_dimension_from_first_row(this.frm, cdt, cdn, "service_items");
 	}
 
 	get_target_item_details() {
@@ -274,7 +288,7 @@
 					if (!r.exc) {
 						me.frm.refresh_fields();
 					}
-				}
+				},
 			});
 		}
 	}
@@ -294,7 +308,7 @@
 					if (!r.exc) {
 						me.frm.refresh_fields();
 					}
-				}
+				},
 			});
 		}
 	}
@@ -316,13 +330,13 @@
 						company: me.frm.doc.company,
 						posting_date: me.frm.doc.posting_date,
 						posting_time: me.frm.doc.posting_time,
-					}
+					},
 				},
 				callback: function (r) {
 					if (!r.exc) {
 						me.calculate_totals();
 					}
-				}
+				},
 			});
 		}
 	}
@@ -343,13 +357,13 @@
 						finance_book: row.finance_book || me.frm.doc.finance_book,
 						posting_date: me.frm.doc.posting_date,
 						posting_time: me.frm.doc.posting_time,
-					}
+					},
 				},
 				callback: function (r) {
 					if (!r.exc) {
 						me.calculate_totals();
 					}
-				}
+				},
 			});
 		}
 	}
@@ -367,13 +381,13 @@
 						qty: flt(row.qty),
 						expense_account: row.expense_account,
 						company: me.frm.doc.company,
-					}
+					},
 				},
 				callback: function (r) {
 					if (!r.exc) {
 						me.calculate_totals();
 					}
-				}
+				},
 			});
 		}
 	}
@@ -386,23 +400,23 @@
 				child: item,
 				args: {
 					args: {
-						'item_code': item.item_code,
-						'warehouse': cstr(item.warehouse),
-						'qty': flt(item.stock_qty),
-						'serial_no': item.serial_no,
-						'posting_date': me.frm.doc.posting_date,
-						'posting_time': me.frm.doc.posting_time,
-						'company': me.frm.doc.company,
-						'voucher_type': me.frm.doc.doctype,
-						'voucher_no': me.frm.doc.name,
-						'allow_zero_valuation': 1
-					}
+						item_code: item.item_code,
+						warehouse: cstr(item.warehouse),
+						qty: flt(item.stock_qty),
+						serial_no: item.serial_no,
+						posting_date: me.frm.doc.posting_date,
+						posting_time: me.frm.doc.posting_time,
+						company: me.frm.doc.company,
+						voucher_type: me.frm.doc.doctype,
+						voucher_no: me.frm.doc.name,
+						allow_zero_valuation: 1,
+					},
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (!r.exc) {
 						me.calculate_totals();
 					}
-				}
+				},
 			});
 		}
 	}
@@ -412,11 +426,11 @@
 		return me.frm.call({
 			method: "set_warehouse_details",
 			doc: me.frm.doc,
-			callback: function(r) {
+			callback: function (r) {
 				if (!r.exc) {
 					me.calculate_totals();
 				}
-			}
+			},
 		});
 	}
 
@@ -425,11 +439,11 @@
 		return me.frm.call({
 			method: "set_asset_values",
 			doc: me.frm.doc,
-			callback: function(r) {
+			callback: function (r) {
 				if (!r.exc) {
 					me.calculate_totals();
 				}
-			}
+			},
 		});
 	}
 
@@ -441,33 +455,38 @@
 		me.frm.doc.service_items_total = 0;
 
 		$.each(me.frm.doc.stock_items || [], function (i, d) {
-			d.amount = flt(flt(d.stock_qty) * flt(d.valuation_rate), precision('amount', d));
+			d.amount = flt(flt(d.stock_qty) * flt(d.valuation_rate), precision("amount", d));
 			me.frm.doc.stock_items_total += d.amount;
 		});
 
 		$.each(me.frm.doc.asset_items || [], function (i, d) {
-			d.asset_value = flt(flt(d.asset_value), precision('asset_value', d));
+			d.asset_value = flt(flt(d.asset_value), precision("asset_value", d));
 			me.frm.doc.asset_items_total += d.asset_value;
 		});
 
 		$.each(me.frm.doc.service_items || [], function (i, d) {
-			d.amount = flt(flt(d.qty) * flt(d.rate), precision('amount', d));
+			d.amount = flt(flt(d.qty) * flt(d.rate), precision("amount", d));
 			me.frm.doc.service_items_total += d.amount;
 		});
 
-		me.frm.doc.stock_items_total = flt(me.frm.doc.stock_items_total, precision('stock_items_total'));
-		me.frm.doc.asset_items_total = flt(me.frm.doc.asset_items_total, precision('asset_items_total'));
-		me.frm.doc.service_items_total = flt(me.frm.doc.service_items_total, precision('service_items_total'));
+		me.frm.doc.stock_items_total = flt(me.frm.doc.stock_items_total, precision("stock_items_total"));
+		me.frm.doc.asset_items_total = flt(me.frm.doc.asset_items_total, precision("asset_items_total"));
+		me.frm.doc.service_items_total = flt(
+			me.frm.doc.service_items_total,
+			precision("service_items_total")
+		);
 
-		me.frm.doc.total_value = me.frm.doc.stock_items_total + me.frm.doc.asset_items_total + me.frm.doc.service_items_total;
-		me.frm.doc.total_value = flt(me.frm.doc.total_value, precision('total_value'));
+		me.frm.doc.total_value =
+			me.frm.doc.stock_items_total + me.frm.doc.asset_items_total + me.frm.doc.service_items_total;
+		me.frm.doc.total_value = flt(me.frm.doc.total_value, precision("total_value"));
 
-		me.frm.doc.target_qty = flt(me.frm.doc.target_qty, precision('target_qty'));
-		me.frm.doc.target_incoming_rate = me.frm.doc.target_qty ? me.frm.doc.total_value / flt(me.frm.doc.target_qty)
+		me.frm.doc.target_qty = flt(me.frm.doc.target_qty, precision("target_qty"));
+		me.frm.doc.target_incoming_rate = me.frm.doc.target_qty
+			? me.frm.doc.total_value / flt(me.frm.doc.target_qty)
 			: me.frm.doc.total_value;
 
 		me.frm.refresh_fields();
 	}
 };
 
-cur_frm.cscript = new erpnext.assets.AssetCapitalization({frm: cur_frm});
+cur_frm.cscript = new erpnext.assets.AssetCapitalization({ frm: cur_frm });
diff --git a/erpnext/assets/doctype/asset_category/asset_category.js b/erpnext/assets/doctype/asset_category/asset_category.js
index 7dde14e..046b62f 100644
--- a/erpnext/assets/doctype/asset_category/asset_category.js
+++ b/erpnext/assets/doctype/asset_category/asset_category.js
@@ -1,56 +1,55 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Asset Category', {
-	onload: function(frm) {
-		frm.add_fetch('company_name', 'accumulated_depreciation_account', 'accumulated_depreciation_account');
-		frm.add_fetch('company_name', 'depreciation_expense_account', 'depreciation_expense_account');
+frappe.ui.form.on("Asset Category", {
+	onload: function (frm) {
+		frm.add_fetch("company_name", "accumulated_depreciation_account", "accumulated_depreciation_account");
+		frm.add_fetch("company_name", "depreciation_expense_account", "depreciation_expense_account");
 
-		frm.set_query('fixed_asset_account', 'accounts', function(doc, cdt, cdn) {
-			var d  = locals[cdt][cdn];
+		frm.set_query("fixed_asset_account", "accounts", function (doc, cdt, cdn) {
+			var d = locals[cdt][cdn];
 			return {
-				"filters": {
-					"account_type": "Fixed Asset",
-					"root_type": "Asset",
-					"is_group": 0,
-					"company": d.company_name
-				}
+				filters: {
+					account_type: "Fixed Asset",
+					root_type: "Asset",
+					is_group: 0,
+					company: d.company_name,
+				},
 			};
 		});
 
-		frm.set_query('accumulated_depreciation_account', 'accounts', function(doc, cdt, cdn) {
-			var d  = locals[cdt][cdn];
+		frm.set_query("accumulated_depreciation_account", "accounts", function (doc, cdt, cdn) {
+			var d = locals[cdt][cdn];
 			return {
-				"filters": {
-					"account_type": "Accumulated Depreciation",
-					"is_group": 0,
-					"company": d.company_name
-				}
+				filters: {
+					account_type: "Accumulated Depreciation",
+					is_group: 0,
+					company: d.company_name,
+				},
 			};
 		});
 
-		frm.set_query('depreciation_expense_account', 'accounts', function(doc, cdt, cdn) {
-			var d  = locals[cdt][cdn];
+		frm.set_query("depreciation_expense_account", "accounts", function (doc, cdt, cdn) {
+			var d = locals[cdt][cdn];
 			return {
-				"filters": {
-					"account_type": "Depreciation",
-					"root_type": ["in", ["Expense", "Income"]],
-					"is_group": 0,
-					"company": d.company_name
-				}
+				filters: {
+					account_type: "Depreciation",
+					root_type: ["in", ["Expense", "Income"]],
+					is_group: 0,
+					company: d.company_name,
+				},
 			};
 		});
 
-		frm.set_query('capital_work_in_progress_account', 'accounts', function(doc, cdt, cdn) {
-			var d  = locals[cdt][cdn];
+		frm.set_query("capital_work_in_progress_account", "accounts", function (doc, cdt, cdn) {
+			var d = locals[cdt][cdn];
 			return {
-				"filters": {
-					"account_type": "Capital Work in Progress",
-					"is_group": 0,
-					"company": d.company_name
-				}
+				filters: {
+					account_type: "Capital Work in Progress",
+					is_group: 0,
+					company: d.company_name,
+				},
 			};
 		});
-
-	}
+	},
 });
diff --git a/erpnext/assets/doctype/asset_depreciation_schedule/asset_depreciation_schedule.js b/erpnext/assets/doctype/asset_depreciation_schedule/asset_depreciation_schedule.js
index c99297d..83b5c37 100644
--- a/erpnext/assets/doctype/asset_depreciation_schedule/asset_depreciation_schedule.js
+++ b/erpnext/assets/doctype/asset_depreciation_schedule/asset_depreciation_schedule.js
@@ -2,52 +2,63 @@
 // For license information, please see license.txt
 frappe.provide("erpnext.asset");
 
-frappe.ui.form.on('Asset Depreciation Schedule', {
-	onload: function(frm) {
+frappe.ui.form.on("Asset Depreciation Schedule", {
+	onload: function (frm) {
 		frm.events.make_schedules_editable(frm);
 	},
 
-	make_schedules_editable: function(frm) {
+	make_schedules_editable: function (frm) {
 		var is_manual_hence_editable = frm.doc.depreciation_method === "Manual" ? true : false;
 		var is_shift_hence_editable = frm.doc.shift_based ? true : false;
 
 		frm.toggle_enable("depreciation_schedule", is_manual_hence_editable || is_shift_hence_editable);
-		frm.fields_dict["depreciation_schedule"].grid.toggle_enable("schedule_date", is_manual_hence_editable);
-		frm.fields_dict["depreciation_schedule"].grid.toggle_enable("depreciation_amount", is_manual_hence_editable);
+		frm.fields_dict["depreciation_schedule"].grid.toggle_enable(
+			"schedule_date",
+			is_manual_hence_editable
+		);
+		frm.fields_dict["depreciation_schedule"].grid.toggle_enable(
+			"depreciation_amount",
+			is_manual_hence_editable
+		);
 		frm.fields_dict["depreciation_schedule"].grid.toggle_enable("shift", is_shift_hence_editable);
-	}
+	},
 });
 
-frappe.ui.form.on('Depreciation Schedule', {
-	make_depreciation_entry: function(frm, cdt, cdn) {
+frappe.ui.form.on("Depreciation Schedule", {
+	make_depreciation_entry: function (frm, cdt, cdn) {
 		var row = locals[cdt][cdn];
 		if (!row.journal_entry) {
 			frappe.call({
 				method: "erpnext.assets.doctype.asset.depreciation.make_depreciation_entry",
 				args: {
-					"asset_depr_schedule_name": frm.doc.name,
-					"date": row.schedule_date
+					asset_depr_schedule_name: frm.doc.name,
+					date: row.schedule_date,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					frappe.model.sync(r.message);
 					frm.refresh();
-				}
-			})
+				},
+			});
 		}
 	},
 
-	depreciation_amount: function(frm, cdt, cdn) {
+	depreciation_amount: function (frm, cdt, cdn) {
 		erpnext.asset.set_accumulated_depreciation(frm);
-	}
+	},
 });
 
-erpnext.asset.set_accumulated_depreciation = function(frm) {
-	if(frm.doc.depreciation_method != "Manual") return;
+erpnext.asset.set_accumulated_depreciation = function (frm) {
+	if (frm.doc.depreciation_method != "Manual") return;
 
 	var accumulated_depreciation = flt(frm.doc.opening_accumulated_depreciation);
 
-	$.each(frm.doc.depreciation_schedule || [], function(i, row) {
-		accumulated_depreciation  += flt(row.depreciation_amount);
-		frappe.model.set_value(row.doctype, row.name, "accumulated_depreciation_amount", accumulated_depreciation);
-	})
+	$.each(frm.doc.depreciation_schedule || [], function (i, row) {
+		accumulated_depreciation += flt(row.depreciation_amount);
+		frappe.model.set_value(
+			row.doctype,
+			row.name,
+			"accumulated_depreciation_amount",
+			accumulated_depreciation
+		);
+	});
 };
diff --git a/erpnext/assets/doctype/asset_maintenance/asset_maintenance.js b/erpnext/assets/doctype/asset_maintenance/asset_maintenance.js
index 5c03b98..83dabab 100644
--- a/erpnext/assets/doctype/asset_maintenance/asset_maintenance.js
+++ b/erpnext/assets/doctype/asset_maintenance/asset_maintenance.js
@@ -1,49 +1,47 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Asset Maintenance', {
+frappe.ui.form.on("Asset Maintenance", {
 	setup: (frm) => {
-		frm.set_query("assign_to", "asset_maintenance_tasks", function(doc) {
+		frm.set_query("assign_to", "asset_maintenance_tasks", function (doc) {
 			return {
 				query: "erpnext.assets.doctype.asset_maintenance.asset_maintenance.get_team_members",
 				filters: {
-					maintenance_team: doc.maintenance_team
-				}
+					maintenance_team: doc.maintenance_team,
+				},
 			};
 		});
 
-		frm.set_indicator_formatter('maintenance_status',
-			function(doc) {
-				let indicator = 'blue';
-				if (doc.maintenance_status == 'Overdue') {
-					indicator = 'orange';
-				}
-				if (doc.maintenance_status == 'Cancelled') {
-					indicator = 'red';
-				}
-				return indicator;
+		frm.set_indicator_formatter("maintenance_status", function (doc) {
+			let indicator = "blue";
+			if (doc.maintenance_status == "Overdue") {
+				indicator = "orange";
 			}
-		);
+			if (doc.maintenance_status == "Cancelled") {
+				indicator = "red";
+			}
+			return indicator;
+		});
 	},
 
 	refresh: (frm) => {
-		if(!frm.is_new()) {
-			frm.trigger('make_dashboard');
+		if (!frm.is_new()) {
+			frm.trigger("make_dashboard");
 		}
 	},
 	make_dashboard: (frm) => {
-		if(!frm.is_new()) {
+		if (!frm.is_new()) {
 			frappe.call({
-				method: 'erpnext.assets.doctype.asset_maintenance.asset_maintenance.get_maintenance_log',
-				args: {asset_name: frm.doc.asset_name},
+				method: "erpnext.assets.doctype.asset_maintenance.asset_maintenance.get_maintenance_log",
+				args: { asset_name: frm.doc.asset_name },
 				callback: (r) => {
-					if(!r.message) {
+					if (!r.message) {
 						return;
 					}
-					const section = frm.dashboard.add_section('', __("Maintenance Log"));
-					var rows = $('<div></div>').appendTo(section);
+					const section = frm.dashboard.add_section("", __("Maintenance Log"));
+					var rows = $("<div></div>").appendTo(section);
 					// show
-					(r.message || []).forEach(function(d) {
+					(r.message || []).forEach(function (d) {
 						$(`<div class='row' style='margin-bottom: 10px;'>
 							<div class='col-sm-3 small'>
 								<a onclick="frappe.set_route('List', 'Asset Maintenance Log',
@@ -54,47 +52,46 @@
 						</div>`).appendTo(rows);
 					});
 					frm.dashboard.show();
-				}
+				},
 			});
 		}
-	}
+	},
 });
 
-frappe.ui.form.on('Asset Maintenance Task', {
-	start_date: (frm, cdt, cdn)  => {
+frappe.ui.form.on("Asset Maintenance Task", {
+	start_date: (frm, cdt, cdn) => {
 		get_next_due_date(frm, cdt, cdn);
 	},
-	periodicity: (frm, cdt, cdn)  => {
+	periodicity: (frm, cdt, cdn) => {
 		get_next_due_date(frm, cdt, cdn);
 	},
-	last_completion_date: (frm, cdt, cdn)  => {
+	last_completion_date: (frm, cdt, cdn) => {
 		get_next_due_date(frm, cdt, cdn);
 	},
-	end_date: (frm, cdt, cdn)  => {
+	end_date: (frm, cdt, cdn) => {
 		get_next_due_date(frm, cdt, cdn);
-	}
+	},
 });
 
 var get_next_due_date = function (frm, cdt, cdn) {
 	var d = locals[cdt][cdn];
 	if (d.start_date && d.periodicity) {
 		return frappe.call({
-			method: 'erpnext.assets.doctype.asset_maintenance.asset_maintenance.calculate_next_due_date',
+			method: "erpnext.assets.doctype.asset_maintenance.asset_maintenance.calculate_next_due_date",
 			args: {
 				start_date: d.start_date,
 				periodicity: d.periodicity,
 				end_date: d.end_date,
 				last_completion_date: d.last_completion_date,
-				next_due_date: d.next_due_date
+				next_due_date: d.next_due_date,
 			},
-			callback: function(r) {
+			callback: function (r) {
 				if (r.message) {
 					frappe.model.set_value(cdt, cdn, "next_due_date", r.message);
-				}
-				else {
+				} else {
 					frappe.model.set_value(cdt, cdn, "next_due_date", "");
 				}
-			}
+			},
 		});
 	}
 };
diff --git a/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log.js b/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log.js
index bcdc3ac..47a2128 100644
--- a/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log.js
+++ b/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log.js
@@ -1,15 +1,15 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Asset Maintenance Log', {
+frappe.ui.form.on("Asset Maintenance Log", {
 	asset_maintenance: (frm) => {
-		frm.set_query('task', function(doc) {
+		frm.set_query("task", function (doc) {
 			return {
 				query: "erpnext.assets.doctype.asset_maintenance_log.asset_maintenance_log.get_maintenance_tasks",
 				filters: {
-					'asset_maintenance': doc.asset_maintenance
-				}
+					asset_maintenance: doc.asset_maintenance,
+				},
 			};
 		});
-	}
+	},
 });
diff --git a/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log_calendar.js b/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log_calendar.js
index c804b31..7b7b508 100644
--- a/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log_calendar.js
+++ b/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log_calendar.js
@@ -3,20 +3,20 @@
 
 frappe.views.calendar["Asset Maintenance Log"] = {
 	field_map: {
-		"start": "due_date",
-		"end": "due_date",
-		"id": "name",
-		"title": "task",
-		"allDay": "allDay",
-		"progress": "progress"
+		start: "due_date",
+		end: "due_date",
+		id: "name",
+		title: "task",
+		allDay: "allDay",
+		progress: "progress",
 	},
 	filters: [
 		{
-			"fieldtype": "Link",
-			"fieldname": "asset_name",
-			"options": "Asset Maintenance",
-			"label": __("Asset Maintenance")
-		}
+			fieldtype: "Link",
+			fieldname: "asset_name",
+			options: "Asset Maintenance",
+			label: __("Asset Maintenance"),
+		},
 	],
-	get_events_method: "frappe.desk.calendar.get_events"
+	get_events_method: "frappe.desk.calendar.get_events",
 };
diff --git a/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log_list.js b/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log_list.js
index 23000e6..13f2444 100644
--- a/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log_list.js
+++ b/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log_list.js
@@ -1,15 +1,15 @@
-frappe.listview_settings['Asset Maintenance Log'] = {
+frappe.listview_settings["Asset Maintenance Log"] = {
 	add_fields: ["maintenance_status"],
 	has_indicator_for_draft: 1,
-	get_indicator: function(doc) {
-		if (doc.maintenance_status=="Planned") {
+	get_indicator: function (doc) {
+		if (doc.maintenance_status == "Planned") {
 			return [__(doc.maintenance_status), "orange", "status,=," + doc.maintenance_status];
-		} else if (doc.maintenance_status=="Completed") {
+		} else if (doc.maintenance_status == "Completed") {
 			return [__(doc.maintenance_status), "green", "status,=," + doc.maintenance_status];
-		} else if (doc.maintenance_status=="Cancelled") {
+		} else if (doc.maintenance_status == "Cancelled") {
 			return [__(doc.maintenance_status), "red", "status,=," + doc.maintenance_status];
-		} else if (doc.maintenance_status=="Overdue") {
+		} else if (doc.maintenance_status == "Overdue") {
 			return [__(doc.maintenance_status), "red", "status,=," + doc.maintenance_status];
 		}
-	}
+	},
 };
diff --git a/erpnext/assets/doctype/asset_maintenance_team/asset_maintenance_team.js b/erpnext/assets/doctype/asset_maintenance_team/asset_maintenance_team.js
index c94e3db..8598765 100644
--- a/erpnext/assets/doctype/asset_maintenance_team/asset_maintenance_team.js
+++ b/erpnext/assets/doctype/asset_maintenance_team/asset_maintenance_team.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Asset Maintenance Team', {
-	refresh: function() {
-
-	}
+frappe.ui.form.on("Asset Maintenance Team", {
+	refresh: function () {},
 });
diff --git a/erpnext/assets/doctype/asset_movement/asset_movement.js b/erpnext/assets/doctype/asset_movement/asset_movement.js
index 4ccc3f8..e445c90 100644
--- a/erpnext/assets/doctype/asset_movement/asset_movement.js
+++ b/erpnext/assets/doctype/asset_movement/asset_movement.js
@@ -1,104 +1,107 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Asset Movement', {
+frappe.ui.form.on("Asset Movement", {
 	setup: (frm) => {
 		frm.set_query("to_employee", "assets", (doc) => {
 			return {
 				filters: {
-					company: doc.company
-				}
+					company: doc.company,
+				},
 			};
-		})
+		});
 		frm.set_query("from_employee", "assets", (doc) => {
 			return {
 				filters: {
-					company: doc.company
-				}
+					company: doc.company,
+				},
 			};
-		})
+		});
 		frm.set_query("reference_name", (doc) => {
 			return {
 				filters: {
 					company: doc.company,
-					docstatus: 1
-				}
+					docstatus: 1,
+				},
 			};
-		})
+		});
 		frm.set_query("reference_doctype", () => {
 			return {
 				filters: {
-					name: ["in", ["Purchase Receipt", "Purchase Invoice"]]
-				}
+					name: ["in", ["Purchase Receipt", "Purchase Invoice"]],
+				},
 			};
 		}),
-		frm.set_query("asset", "assets", () => {
-			return {
-				filters: {
-					status: ["not in", ["Draft"]]
-				}
-			}
-		})
+			frm.set_query("asset", "assets", () => {
+				return {
+					filters: {
+						status: ["not in", ["Draft"]],
+					},
+				};
+			});
 	},
 
 	onload: (frm) => {
-		frm.trigger('set_required_fields');
+		frm.trigger("set_required_fields");
 	},
 
 	purpose: (frm) => {
-		frm.trigger('set_required_fields');
+		frm.trigger("set_required_fields");
 	},
 
 	set_required_fields: (frm, cdt, cdn) => {
 		let fieldnames_to_be_altered;
-		if (frm.doc.purpose === 'Transfer') {
+		if (frm.doc.purpose === "Transfer") {
 			fieldnames_to_be_altered = {
 				target_location: { read_only: 0, reqd: 1 },
 				source_location: { read_only: 1, reqd: 1 },
 				from_employee: { read_only: 1, reqd: 0 },
-				to_employee: { read_only: 1, reqd: 0 }
+				to_employee: { read_only: 1, reqd: 0 },
 			};
-		}
-		else if (frm.doc.purpose === 'Receipt') {
+		} else if (frm.doc.purpose === "Receipt") {
 			fieldnames_to_be_altered = {
 				target_location: { read_only: 0, reqd: 1 },
 				source_location: { read_only: 1, reqd: 0 },
 				from_employee: { read_only: 0, reqd: 0 },
-				to_employee: { read_only: 1, reqd: 0 }
+				to_employee: { read_only: 1, reqd: 0 },
 			};
-		}
-		else if (frm.doc.purpose === 'Issue') {
+		} else if (frm.doc.purpose === "Issue") {
 			fieldnames_to_be_altered = {
 				target_location: { read_only: 1, reqd: 0 },
 				source_location: { read_only: 1, reqd: 0 },
 				from_employee: { read_only: 1, reqd: 0 },
-				to_employee: { read_only: 0, reqd: 1 }
+				to_employee: { read_only: 0, reqd: 1 },
 			};
 		}
 		if (fieldnames_to_be_altered) {
-			Object.keys(fieldnames_to_be_altered).forEach(fieldname => {
+			Object.keys(fieldnames_to_be_altered).forEach((fieldname) => {
 				let property_to_be_altered = fieldnames_to_be_altered[fieldname];
-				Object.keys(property_to_be_altered).forEach(property => {
+				Object.keys(property_to_be_altered).forEach((property) => {
 					let value = property_to_be_altered[property];
-					frm.fields_dict['assets'].grid.update_docfield_property(fieldname, property, value);
+					frm.fields_dict["assets"].grid.update_docfield_property(fieldname, property, value);
 				});
 			});
-			frm.refresh_field('assets');
+			frm.refresh_field("assets");
 		}
-	}
+	},
 });
 
-frappe.ui.form.on('Asset Movement Item', {
-	asset: function(frm, cdt, cdn) {
+frappe.ui.form.on("Asset Movement Item", {
+	asset: function (frm, cdt, cdn) {
 		// on manual entry of an asset auto sets their source location / employee
 		const asset_name = locals[cdt][cdn].asset;
-		if (asset_name){
-			frappe.db.get_doc('Asset', asset_name).then((asset_doc) => {
-				if(asset_doc.location) frappe.model.set_value(cdt, cdn, 'source_location', asset_doc.location);
-				if(asset_doc.custodian) frappe.model.set_value(cdt, cdn, 'from_employee', asset_doc.custodian);
-			}).catch((err) => {
-				console.log(err); // eslint-disable-line
-			});
+		if (asset_name) {
+			frappe.db
+				.get_doc("Asset", asset_name)
+				.then((asset_doc) => {
+					if (asset_doc.location)
+						frappe.model.set_value(cdt, cdn, "source_location", asset_doc.location);
+					if (asset_doc.custodian)
+						frappe.model.set_value(cdt, cdn, "from_employee", asset_doc.custodian);
+				})
+				.catch((err) => {
+					console.log(err); // eslint-disable-line
+				});
 		}
-	}
+	},
 });
diff --git a/erpnext/assets/doctype/asset_repair/asset_repair.js b/erpnext/assets/doctype/asset_repair/asset_repair.js
index 03afcb9..27a4eb6 100644
--- a/erpnext/assets/doctype/asset_repair/asset_repair.js
+++ b/erpnext/assets/doctype/asset_repair/asset_repair.js
@@ -1,31 +1,31 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Asset Repair', {
-	setup: function(frm) {
-		frm.fields_dict.cost_center.get_query = function(doc) {
+frappe.ui.form.on("Asset Repair", {
+	setup: function (frm) {
+		frm.fields_dict.cost_center.get_query = function (doc) {
 			return {
 				filters: {
-					'is_group': 0,
-					'company': doc.company
-				}
+					is_group: 0,
+					company: doc.company,
+				},
 			};
 		};
 
-		frm.fields_dict.project.get_query = function(doc) {
+		frm.fields_dict.project.get_query = function (doc) {
 			return {
 				filters: {
-					'company': doc.company
-				}
+					company: doc.company,
+				},
 			};
 		};
 
-		frm.fields_dict.warehouse.get_query = function(doc) {
+		frm.fields_dict.warehouse.get_query = function (doc) {
 			return {
 				filters: {
-					'is_group': 0,
-					'company': doc.company
-				}
+					is_group: 0,
+					company: doc.company,
+				},
 			};
 		};
 
@@ -33,87 +33,87 @@
 			let row = locals[cdt][cdn];
 			return {
 				filters: {
-					'item_code': row.item_code,
-					'voucher_type': doc.doctype,
-					'voucher_no': ["in", [doc.name, ""]],
-					'is_cancelled': 0,
-				}
-			}
+					item_code: row.item_code,
+					voucher_type: doc.doctype,
+					voucher_no: ["in", [doc.name, ""]],
+					is_cancelled: 0,
+				},
+			};
 		});
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		if (frm.doc.docstatus) {
-			frm.add_custom_button(__("View General Ledger"), function() {
+			frm.add_custom_button(__("View General Ledger"), function () {
 				frappe.route_options = {
-					"voucher_no": frm.doc.name
+					voucher_no: frm.doc.name,
 				};
 				frappe.set_route("query-report", "General Ledger");
 			});
 		}
 
-		let sbb_field = frm.get_docfield('stock_items', 'serial_and_batch_bundle');
+		let sbb_field = frm.get_docfield("stock_items", "serial_and_batch_bundle");
 		if (sbb_field) {
 			sbb_field.get_route_options_for_new_doc = (row) => {
 				return {
-					'item_code': row.doc.item_code,
-					'voucher_type': frm.doc.doctype,
-				}
+					item_code: row.doc.item_code,
+					voucher_type: frm.doc.doctype,
+				};
 			};
 		}
 	},
 
 	repair_status: (frm) => {
 		if (frm.doc.completion_date && frm.doc.repair_status == "Completed") {
-			frappe.call ({
+			frappe.call({
 				method: "erpnext.assets.doctype.asset_repair.asset_repair.get_downtime",
 				args: {
-					"failure_date":frm.doc.failure_date,
-					"completion_date":frm.doc.completion_date
+					failure_date: frm.doc.failure_date,
+					completion_date: frm.doc.completion_date,
 				},
-				callback: function(r) {
-					if(r.message) {
+				callback: function (r) {
+					if (r.message) {
 						frm.set_value("downtime", r.message + " Hrs");
 					}
-				}
+				},
 			});
 		}
 
 		if (frm.doc.repair_status == "Completed") {
-			frm.set_value('completion_date', frappe.datetime.now_datetime());
+			frm.set_value("completion_date", frappe.datetime.now_datetime());
 		}
 	},
 
 	stock_items_on_form_rendered() {
 		erpnext.setup_serial_or_batch_no();
-	}
+	},
 });
 
-frappe.ui.form.on('Asset Repair Consumed Item', {
-	item_code: function(frm, cdt, cdn) {
+frappe.ui.form.on("Asset Repair Consumed Item", {
+	item_code: function (frm, cdt, cdn) {
 		var item = locals[cdt][cdn];
 
 		let item_args = {
-			'item_code': item.item_code,
-			'warehouse': frm.doc.warehouse,
-			'qty': item.consumed_quantity,
-			'serial_no': item.serial_no,
-			'company': frm.doc.company,
+			item_code: item.item_code,
+			warehouse: frm.doc.warehouse,
+			qty: item.consumed_quantity,
+			serial_no: item.serial_no,
+			company: frm.doc.company,
 		};
 
 		frappe.call({
-			method: 'erpnext.stock.utils.get_incoming_rate',
+			method: "erpnext.stock.utils.get_incoming_rate",
 			args: {
-				args: item_args
+				args: item_args,
 			},
-			callback: function(r) {
-				frappe.model.set_value(cdt, cdn, 'valuation_rate', r.message);
-			}
+			callback: function (r) {
+				frappe.model.set_value(cdt, cdn, "valuation_rate", r.message);
+			},
 		});
 	},
 
-	consumed_quantity: function(frm, cdt, cdn) {
+	consumed_quantity: function (frm, cdt, cdn) {
 		var row = locals[cdt][cdn];
-		frappe.model.set_value(cdt, cdn, 'total_value', row.consumed_quantity * row.valuation_rate);
+		frappe.model.set_value(cdt, cdn, "total_value", row.consumed_quantity * row.valuation_rate);
 	},
 });
diff --git a/erpnext/assets/doctype/asset_repair/asset_repair_list.js b/erpnext/assets/doctype/asset_repair/asset_repair_list.js
index 86376f4..633c39b 100644
--- a/erpnext/assets/doctype/asset_repair/asset_repair_list.js
+++ b/erpnext/assets/doctype/asset_repair/asset_repair_list.js
@@ -1,12 +1,12 @@
-frappe.listview_settings['Asset Repair'] = {
+frappe.listview_settings["Asset Repair"] = {
 	add_fields: ["repair_status"],
-	get_indicator: function(doc) {
-		if(doc.repair_status=="Pending") {
+	get_indicator: function (doc) {
+		if (doc.repair_status == "Pending") {
 			return [__("Pending"), "orange"];
-		} else if(doc.repair_status=="Completed") {
+		} else if (doc.repair_status == "Completed") {
 			return [__("Completed"), "green"];
-		} else if(doc.repair_status=="Cancelled") {
+		} else if (doc.repair_status == "Cancelled") {
 			return [__("Cancelled"), "red"];
 		}
-	}
+	},
 };
diff --git a/erpnext/assets/doctype/asset_shift_allocation/asset_shift_allocation.js b/erpnext/assets/doctype/asset_shift_allocation/asset_shift_allocation.js
index 54df693..c22feb0 100644
--- a/erpnext/assets/doctype/asset_shift_allocation/asset_shift_allocation.js
+++ b/erpnext/assets/doctype/asset_shift_allocation/asset_shift_allocation.js
@@ -1,14 +1,14 @@
 // Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
-frappe.ui.form.on('Asset Shift Allocation', {
-	onload: function(frm) {
+frappe.ui.form.on("Asset Shift Allocation", {
+	onload: function (frm) {
 		frm.events.make_schedules_editable(frm);
 	},
 
-	make_schedules_editable: function(frm) {
+	make_schedules_editable: function (frm) {
 		frm.toggle_enable("depreciation_schedule", true);
 		frm.fields_dict["depreciation_schedule"].grid.toggle_enable("schedule_date", false);
 		frm.fields_dict["depreciation_schedule"].grid.toggle_enable("depreciation_amount", false);
 		frm.fields_dict["depreciation_schedule"].grid.toggle_enable("shift", true);
-	}
+	},
 });
diff --git a/erpnext/assets/doctype/asset_value_adjustment/asset_value_adjustment.js b/erpnext/assets/doctype/asset_value_adjustment/asset_value_adjustment.js
index d07f40c..7fbe6d0 100644
--- a/erpnext/assets/doctype/asset_value_adjustment/asset_value_adjustment.js
+++ b/erpnext/assets/doctype/asset_value_adjustment/asset_value_adjustment.js
@@ -3,61 +3,61 @@
 
 frappe.provide("erpnext.accounts.dimensions");
 
-frappe.ui.form.on('Asset Value Adjustment', {
-	setup: function(frm) {
-		frm.add_fetch('company', 'cost_center', 'cost_center');
-		frm.set_query('cost_center', function() {
+frappe.ui.form.on("Asset Value Adjustment", {
+	setup: function (frm) {
+		frm.add_fetch("company", "cost_center", "cost_center");
+		frm.set_query("cost_center", function () {
 			return {
 				filters: {
 					company: frm.doc.company,
-					is_group: 0
-				}
-			}
+					is_group: 0,
+				},
+			};
 		});
-		frm.set_query('asset', function() {
+		frm.set_query("asset", function () {
 			return {
 				filters: {
 					calculate_depreciation: 1,
-					docstatus: 1
-				}
+					docstatus: 1,
+				},
 			};
 		});
 	},
 
-	onload: function(frm) {
-		if(frm.is_new() && frm.doc.asset) {
+	onload: function (frm) {
+		if (frm.is_new() && frm.doc.asset) {
 			frm.trigger("set_current_asset_value");
 		}
 
 		erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
 	},
 
-	company: function(frm) {
+	company: function (frm) {
 		erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
 	},
 
-	asset: function(frm) {
+	asset: function (frm) {
 		frm.trigger("set_current_asset_value");
 	},
 
-	finance_book: function(frm) {
+	finance_book: function (frm) {
 		frm.trigger("set_current_asset_value");
 	},
 
-	set_current_asset_value: function(frm) {
+	set_current_asset_value: function (frm) {
 		if (frm.doc.asset) {
 			frm.call({
 				method: "erpnext.assets.doctype.asset.asset.get_asset_value_after_depreciation",
 				args: {
 					asset_name: frm.doc.asset,
-					finance_book: frm.doc.finance_book
+					finance_book: frm.doc.finance_book,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (r.message) {
-						frm.set_value('current_asset_value', r.message);
+						frm.set_value("current_asset_value", r.message);
 					}
-				}
+				},
 			});
 		}
-	}
+	},
 });
diff --git a/erpnext/assets/doctype/location/location.js b/erpnext/assets/doctype/location/location.js
index 0f069b2..97d7239 100644
--- a/erpnext/assets/doctype/location/location.js
+++ b/erpnext/assets/doctype/location/location.js
@@ -1,13 +1,13 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Location', {
+frappe.ui.form.on("Location", {
 	setup: function (frm) {
 		frm.set_query("parent_location", function () {
 			return {
-				"filters": {
-					"is_group": 1
-				}
+				filters: {
+					is_group: 1,
+				},
 			};
 		});
 	},
@@ -15,10 +15,9 @@
 	onload_post_render(frm) {
 		if (!frm.doc.location && frm.doc.latitude && frm.doc.longitude) {
 			frm.fields_dict.location.map.setView([frm.doc.latitude, frm.doc.longitude], 13);
-		}
-		else {
-			frm.doc.latitude = frm.fields_dict.location.map.getCenter()['lat'];
-			frm.doc.longitude = frm.fields_dict.location.map.getCenter()['lng'];
+		} else {
+			frm.doc.latitude = frm.fields_dict.location.map.getCenter()["lat"];
+			frm.doc.longitude = frm.fields_dict.location.map.getCenter()["lng"];
 		}
 	},
 });
diff --git a/erpnext/assets/doctype/location/location_tree.js b/erpnext/assets/doctype/location/location_tree.js
index 3e105f6..c3484c2 100644
--- a/erpnext/assets/doctype/location/location_tree.js
+++ b/erpnext/assets/doctype/location/location_tree.js
@@ -1,7 +1,7 @@
 frappe.treeview_settings["Location"] = {
 	ignore_fields: ["parent_location"],
-	get_tree_nodes: 'erpnext.assets.doctype.location.location.get_children',
-	add_tree_node: 'erpnext.assets.doctype.location.location.add_node',
+	get_tree_nodes: "erpnext.assets.doctype.location.location.get_children",
+	add_tree_node: "erpnext.assets.doctype.location.location.add_node",
 	filters: [
 		{
 			fieldname: "location",
@@ -10,9 +10,9 @@
 			label: __("Location"),
 			get_query: function () {
 				return {
-					filters: [["Location", "is_group", "=", 1]]
+					filters: [["Location", "is_group", "=", 1]],
 				};
-			}
+			},
 		},
 	],
 	breadcrumb: "Assets",
@@ -24,10 +24,10 @@
 			action: function () {
 				frappe.new_doc("Location", true);
 			},
-			condition: 'frappe.boot.user.can_create.indexOf("Location") !== -1'
-		}
+			condition: 'frappe.boot.user.can_create.indexOf("Location") !== -1',
+		},
 	],
 	onload: function (treeview) {
 		treeview.make_tree();
-	}
+	},
 };
diff --git a/erpnext/assets/doctype/maintenance_team_member/maintenance_team_member.js b/erpnext/assets/doctype/maintenance_team_member/maintenance_team_member.js
index 2db7125..6f3521f 100644
--- a/erpnext/assets/doctype/maintenance_team_member/maintenance_team_member.js
+++ b/erpnext/assets/doctype/maintenance_team_member/maintenance_team_member.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Maintenance Team Member', {
-	refresh: function() {
-
-	}
+frappe.ui.form.on("Maintenance Team Member", {
+	refresh: function () {},
 });
diff --git a/erpnext/assets/report/fixed_asset_register/fixed_asset_register.js b/erpnext/assets/report/fixed_asset_register/fixed_asset_register.js
index 812b7f7..c7fd8e0 100644
--- a/erpnext/assets/report/fixed_asset_register/fixed_asset_register.js
+++ b/erpnext/assets/report/fixed_asset_register/fixed_asset_register.js
@@ -1,105 +1,104 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Fixed Asset Register"] = {
-	"filters": [
+	filters: [
 		{
-			fieldname:"company",
+			fieldname: "company",
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
 			default: frappe.defaults.get_user_default("Company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"status",
+			fieldname: "status",
 			label: __("Status"),
 			fieldtype: "Select",
 			options: "\nIn Location\nDisposed",
-			default: 'In Location'
+			default: "In Location",
 		},
 		{
-			fieldname:"asset_category",
+			fieldname: "asset_category",
 			label: __("Asset Category"),
 			fieldtype: "Link",
-			options: "Asset Category"
+			options: "Asset Category",
 		},
 		{
-			fieldname:"cost_center",
+			fieldname: "cost_center",
 			label: __("Cost Center"),
 			fieldtype: "Link",
-			options: "Cost Center"
+			options: "Cost Center",
 		},
 		{
-			fieldname:"group_by",
+			fieldname: "group_by",
 			label: __("Group By"),
 			fieldtype: "Select",
 			options: ["--Select a group--", "Asset Category", "Location"],
 			default: "--Select a group--",
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"only_existing_assets",
+			fieldname: "only_existing_assets",
 			label: __("Only existing assets"),
-			fieldtype: "Check"
+			fieldtype: "Check",
 		},
 		{
-			fieldname:"finance_book",
+			fieldname: "finance_book",
 			label: __("Finance Book"),
 			fieldtype: "Link",
 			options: "Finance Book",
 		},
 		{
-			"fieldname": "include_default_book_assets",
-			"label": __("Include Default FB Assets"),
-			"fieldtype": "Check",
-			"default": 1
+			fieldname: "include_default_book_assets",
+			label: __("Include Default FB Assets"),
+			fieldtype: "Check",
+			default: 1,
 		},
 		{
-			"fieldname":"filter_based_on",
-			"label": __("Period Based On"),
-			"fieldtype": "Select",
-			"options": ["--Select a period--", "Fiscal Year", "Date Range"],
-			"default": "--Select a period--",
+			fieldname: "filter_based_on",
+			label: __("Period Based On"),
+			fieldtype: "Select",
+			options: ["--Select a period--", "Fiscal Year", "Date Range"],
+			default: "--Select a period--",
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("Start Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.add_months(frappe.datetime.nowdate(), -12),
-			"depends_on": "eval: doc.filter_based_on == 'Date Range'",
+			fieldname: "from_date",
+			label: __("Start Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.nowdate(), -12),
+			depends_on: "eval: doc.filter_based_on == 'Date Range'",
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("End Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.nowdate(),
-			"depends_on": "eval: doc.filter_based_on == 'Date Range'",
+			fieldname: "to_date",
+			label: __("End Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.nowdate(),
+			depends_on: "eval: doc.filter_based_on == 'Date Range'",
 		},
 		{
-			"fieldname":"from_fiscal_year",
-			"label": __("Start Year"),
-			"fieldtype": "Link",
-			"options": "Fiscal Year",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
-			"depends_on": "eval: doc.filter_based_on == 'Fiscal Year'",
+			fieldname: "from_fiscal_year",
+			label: __("Start Year"),
+			fieldtype: "Link",
+			options: "Fiscal Year",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
+			depends_on: "eval: doc.filter_based_on == 'Fiscal Year'",
 		},
 		{
-			"fieldname":"to_fiscal_year",
-			"label": __("End Year"),
-			"fieldtype": "Link",
-			"options": "Fiscal Year",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
-			"depends_on": "eval: doc.filter_based_on == 'Fiscal Year'",
+			fieldname: "to_fiscal_year",
+			label: __("End Year"),
+			fieldtype: "Link",
+			options: "Fiscal Year",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
+			depends_on: "eval: doc.filter_based_on == 'Fiscal Year'",
 		},
 		{
-			"fieldname":"date_based_on",
-			"label": __("Date Based On"),
-			"fieldtype": "Select",
-			"options": ["Purchase Date", "Available For Use Date"],
-			"default": "Purchase Date",
-			"depends_on": "eval: doc.filter_based_on == 'Date Range' || doc.filter_based_on == 'Fiscal Year'",
+			fieldname: "date_based_on",
+			label: __("Date Based On"),
+			fieldtype: "Select",
+			options: ["Purchase Date", "Available For Use Date"],
+			default: "Purchase Date",
+			depends_on: "eval: doc.filter_based_on == 'Date Range' || doc.filter_based_on == 'Fiscal Year'",
 		},
-	]
+	],
 };
diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js
index dc54d60..9ee0c49 100644
--- a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js
+++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js
@@ -3,17 +3,31 @@
 
 frappe.ui.form.on("Bulk Transaction Log", {
 	refresh(frm) {
-		frm.add_custom_button(__('Succeeded Entries'), function() {
-			frappe.set_route('List', 'Bulk Transaction Log Detail', {'date': frm.doc.date, 'transaction_status': "Success"});
-		}, __("View"));
-		frm.add_custom_button(__('Failed Entries'), function() {
-			frappe.set_route('List', 'Bulk Transaction Log Detail', {'date': frm.doc.date, 'transaction_status': "Failed"});
-		}, __("View"));
+		frm.add_custom_button(
+			__("Succeeded Entries"),
+			function () {
+				frappe.set_route("List", "Bulk Transaction Log Detail", {
+					date: frm.doc.date,
+					transaction_status: "Success",
+				});
+			},
+			__("View")
+		);
+		frm.add_custom_button(
+			__("Failed Entries"),
+			function () {
+				frappe.set_route("List", "Bulk Transaction Log Detail", {
+					date: frm.doc.date,
+					transaction_status: "Failed",
+				});
+			},
+			__("View")
+		);
 		if (frm.doc.failed) {
-			frm.add_custom_button(__('Retry Failed Transactions'), function() {
+			frm.add_custom_button(__("Retry Failed Transactions"), function () {
 				frappe.call({
 					method: "erpnext.utilities.bulk_transaction.retry",
-					args: {date: frm.doc.date}
+					args: { date: frm.doc.date },
 				});
 			});
 		}
diff --git a/erpnext/buying/doctype/buying_settings/buying_settings.js b/erpnext/buying/doctype/buying_settings/buying_settings.js
index 32431fc..11b920a 100644
--- a/erpnext/buying/doctype/buying_settings/buying_settings.js
+++ b/erpnext/buying/doctype/buying_settings/buying_settings.js
@@ -1,31 +1,38 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Buying Settings', {
+frappe.ui.form.on("Buying Settings", {
 	// refresh: function(frm) {
-
 	// }
 });
 
-frappe.tour['Buying Settings'] = [
+frappe.tour["Buying Settings"] = [
 	{
 		fieldname: "supp_master_name",
 		title: "Supplier Naming By",
-		description: __("By default, the Supplier Name is set as per the Supplier Name entered. If you want Suppliers to be named by a <a href='https://docs.erpnext.com/docs/user/manual/en/setting-up/settings/naming-series' target='_blank'>Naming Series</a> choose the 'Naming Series' option."),
+		description: __(
+			"By default, the Supplier Name is set as per the Supplier Name entered. If you want Suppliers to be named by a <a href='https://docs.erpnext.com/docs/user/manual/en/setting-up/settings/naming-series' target='_blank'>Naming Series</a> choose the 'Naming Series' option."
+		),
 	},
 	{
 		fieldname: "buying_price_list",
 		title: "Default Buying Price List",
-		description: __("Configure the default Price List when creating a new Purchase transaction. Item prices will be fetched from this Price List.")
+		description: __(
+			"Configure the default Price List when creating a new Purchase transaction. Item prices will be fetched from this Price List."
+		),
 	},
 	{
 		fieldname: "po_required",
 		title: "Purchase Order Required for Purchase Invoice & Receipt Creation",
-		description: __("If this option is configured 'Yes', ERPNext will prevent you from creating a Purchase Invoice or Receipt without creating a Purchase Order first. This configuration can be overridden for a particular supplier by enabling the 'Allow Purchase Invoice Creation Without Purchase Order' checkbox in the Supplier master.")
+		description: __(
+			"If this option is configured 'Yes', ERPNext will prevent you from creating a Purchase Invoice or Receipt without creating a Purchase Order first. This configuration can be overridden for a particular supplier by enabling the 'Allow Purchase Invoice Creation Without Purchase Order' checkbox in the Supplier master."
+		),
 	},
 	{
 		fieldname: "pr_required",
 		title: "Purchase Receipt Required for Purchase Invoice Creation",
-		description: __("If this option is configured 'Yes', ERPNext will prevent you from creating a Purchase Invoice without creating a Purchase Receipt first. This configuration can be overridden for a particular supplier by enabling the 'Allow Purchase Invoice Creation Without Purchase Receipt' checkbox in the Supplier master.")
-	}
+		description: __(
+			"If this option is configured 'Yes', ERPNext will prevent you from creating a Purchase Invoice without creating a Purchase Receipt first. This configuration can be overridden for a particular supplier by enabling the 'Allow Purchase Invoice Creation Without Purchase Receipt' checkbox in the Supplier master."
+		),
+	},
 ];
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js
index 3b671bb..7875646 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.js
@@ -9,52 +9,52 @@
 erpnext.buying.setup_buying_controller();
 
 frappe.ui.form.on("Purchase Order", {
-	setup: function(frm) {
-
+	setup: function (frm) {
 		if (frm.doc.is_old_subcontracting_flow) {
-			frm.set_query("reserve_warehouse", "supplied_items", function() {
+			frm.set_query("reserve_warehouse", "supplied_items", function () {
 				return {
 					filters: {
-						"company": frm.doc.company,
-						"name": ['!=', frm.doc.supplier_warehouse],
-						"is_group": 0
-					}
-				}
+						company: frm.doc.company,
+						name: ["!=", frm.doc.supplier_warehouse],
+						is_group: 0,
+					},
+				};
 			});
 		}
 
-		frm.set_indicator_formatter('item_code',
-			function(doc) { return (doc.qty<=doc.received_qty) ? "green" : "orange" })
-
-		frm.set_query("expense_account", "items", function() {
-			return {
-				query: "erpnext.controllers.queries.get_expense_account",
-				filters: {'company': frm.doc.company}
-			}
+		frm.set_indicator_formatter("item_code", function (doc) {
+			return doc.qty <= doc.received_qty ? "green" : "orange";
 		});
 
-		frm.set_query("fg_item", "items", function() {
+		frm.set_query("expense_account", "items", function () {
+			return {
+				query: "erpnext.controllers.queries.get_expense_account",
+				filters: { company: frm.doc.company },
+			};
+		});
+
+		frm.set_query("fg_item", "items", function () {
 			return {
 				filters: {
-					'is_stock_item': 1,
-					'is_sub_contracted_item': 1,
-					'default_bom': ['!=', '']
-				}
-			}
+					is_stock_item: 1,
+					is_sub_contracted_item: 1,
+					default_bom: ["!=", ""],
+				},
+			};
 		});
 	},
 
-	company: function(frm) {
+	company: function (frm) {
 		erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
 	},
 
-	refresh: function(frm) {
-		if(frm.doc.is_old_subcontracting_flow) {
-			frm.trigger('get_materials_from_supplier');
+	refresh: function (frm) {
+		if (frm.doc.is_old_subcontracting_flow) {
+			frm.trigger("get_materials_from_supplier");
 
-			$('a.grey-link').each(function () {
-				var id = $(this).children(':first-child').attr('data-label');
-				if (id == 'Duplicate') {
+			$("a.grey-link").each(function () {
+				var id = $(this).children(":first-child").attr("data-label");
+				if (id == "Duplicate") {
 					$(this).remove();
 					return false;
 				}
@@ -62,87 +62,91 @@
 		}
 	},
 
-	get_materials_from_supplier: function(frm) {
+	get_materials_from_supplier: function (frm) {
 		let po_details = [];
 
-		if (frm.doc.supplied_items && (flt(frm.doc.per_received, 2) == 100 || frm.doc.status === 'Closed')) {
-			frm.doc.supplied_items.forEach(d => {
+		if (frm.doc.supplied_items && (flt(frm.doc.per_received, 2) == 100 || frm.doc.status === "Closed")) {
+			frm.doc.supplied_items.forEach((d) => {
 				if (d.total_supplied_qty && d.total_supplied_qty != d.consumed_qty) {
-					po_details.push(d.name)
+					po_details.push(d.name);
 				}
 			});
 		}
 
 		if (po_details && po_details.length) {
-			frm.add_custom_button(__('Return of Components'), () => {
-				frm.call({
-					method: 'erpnext.controllers.subcontracting_controller.get_materials_from_supplier',
-					freeze: true,
-					freeze_message: __('Creating Stock Entry'),
-					args: {
-						subcontract_order: frm.doc.name,
-						rm_details: po_details,
-						order_doctype: cur_frm.doc.doctype
-					},
-					callback: function(r) {
-						if (r && r.message) {
-							const doc = frappe.model.sync(r.message);
-							frappe.set_route("Form", doc[0].doctype, doc[0].name);
-						}
-					}
-				});
-			}, __('Create'));
+			frm.add_custom_button(
+				__("Return of Components"),
+				() => {
+					frm.call({
+						method: "erpnext.controllers.subcontracting_controller.get_materials_from_supplier",
+						freeze: true,
+						freeze_message: __("Creating Stock Entry"),
+						args: {
+							subcontract_order: frm.doc.name,
+							rm_details: po_details,
+							order_doctype: cur_frm.doc.doctype,
+						},
+						callback: function (r) {
+							if (r && r.message) {
+								const doc = frappe.model.sync(r.message);
+								frappe.set_route("Form", doc[0].doctype, doc[0].name);
+							}
+						},
+					});
+				},
+				__("Create")
+			);
 		}
 	},
 
-	onload: function(frm) {
+	onload: function (frm) {
 		set_schedule_date(frm);
-		if (!frm.doc.transaction_date){
-			frm.set_value('transaction_date', frappe.datetime.get_today())
+		if (!frm.doc.transaction_date) {
+			frm.set_value("transaction_date", frappe.datetime.get_today());
 		}
 
-		erpnext.queries.setup_queries(frm, "Warehouse", function() {
+		erpnext.queries.setup_queries(frm, "Warehouse", function () {
 			return erpnext.queries.warehouse(frm.doc);
 		});
 
 		// On cancel and amending a purchase order with advance payment, reset advance paid amount
 		if (frm.is_new()) {
-			frm.set_value("advance_paid", 0)
+			frm.set_value("advance_paid", 0);
 		}
 	},
 
-	apply_tds: function(frm) {
+	apply_tds: function (frm) {
 		if (!frm.doc.apply_tds) {
-			frm.set_value("tax_withholding_category", '');
+			frm.set_value("tax_withholding_category", "");
 		} else {
 			frm.set_value("tax_withholding_category", frm.supplier_tds);
 		}
 	},
 
-	get_subcontracting_boms_for_finished_goods: function(fg_item) {
+	get_subcontracting_boms_for_finished_goods: function (fg_item) {
 		return frappe.call({
-			method:"erpnext.subcontracting.doctype.subcontracting_bom.subcontracting_bom.get_subcontracting_boms_for_finished_goods",
+			method: "erpnext.subcontracting.doctype.subcontracting_bom.subcontracting_bom.get_subcontracting_boms_for_finished_goods",
 			args: {
-				fg_items: fg_item
+				fg_items: fg_item,
 			},
 		});
 	},
 
-	get_subcontracting_boms_for_service_item: function(service_item) {
+	get_subcontracting_boms_for_service_item: function (service_item) {
 		return frappe.call({
-			method:"erpnext.subcontracting.doctype.subcontracting_bom.subcontracting_bom.get_subcontracting_boms_for_service_item",
+			method: "erpnext.subcontracting.doctype.subcontracting_bom.subcontracting_bom.get_subcontracting_boms_for_service_item",
 			args: {
-				service_item: service_item
+				service_item: service_item,
 			},
 		});
 	},
 });
 
 frappe.ui.form.on("Purchase Order Item", {
-	schedule_date: function(frm, cdt, cdn) {
+	schedule_date: function (frm, cdt, cdn) {
 		var row = locals[cdt][cdn];
 		if (row.schedule_date) {
-			if(!frm.doc.schedule_date) {
+			if (!frm.doc.schedule_date) {
 				erpnext.utils.copy_value_in_all_rows(frm.doc, cdt, cdn, "items", "schedule_date");
 			} else {
 				set_schedule_date(frm);
@@ -150,12 +154,12 @@
 		}
 	},
 
-	item_code: async function(frm, cdt, cdn) {
+	item_code: async function (frm, cdt, cdn) {
 		if (frm.doc.is_subcontracted && !frm.doc.is_old_subcontracting_flow) {
 			var row = locals[cdt][cdn];
 
 			if (row.item_code && !row.fg_item) {
-				var result = await frm.events.get_subcontracting_boms_for_service_item(row.item_code)
+				var result = await frm.events.get_subcontracting_boms_for_service_item(row.item_code);
 
 				if (result.message && Object.keys(result.message).length) {
 					var finished_goods = Object.keys(result.message);
@@ -175,7 +179,7 @@
 									fieldtype: "Autocomplete",
 									label: __("Finished Good"),
 									options: finished_goods,
-								}
+								},
 							],
 							primary_action_label: __("Select"),
 							primary_action: () => {
@@ -198,16 +202,21 @@
 		}
 	},
 
-	fg_item: async function(frm, cdt, cdn) {
+	fg_item: async function (frm, cdt, cdn) {
 		if (frm.doc.is_subcontracted && !frm.doc.is_old_subcontracting_flow) {
 			var row = locals[cdt][cdn];
 
 			if (row.fg_item) {
-				var result = await frm.events.get_subcontracting_boms_for_finished_goods(row.fg_item)
+				var result = await frm.events.get_subcontracting_boms_for_finished_goods(row.fg_item);
 
 				if (result.message && Object.keys(result.message).length) {
 					frappe.model.set_value(cdt, cdn, "item_code", result.message.service_item);
-					frappe.model.set_value(cdt, cdn, "qty", flt(row.fg_item_qty) * flt(result.message.conversion_factor));
+					frappe.model.set_value(
+						cdt,
+						cdn,
+						"qty",
+						flt(row.fg_item_qty) * flt(result.message.conversion_factor)
+					);
 					frappe.model.set_value(cdt, cdn, "uom", result.message.service_item_uom);
 				}
 			}
@@ -219,25 +228,36 @@
 			var row = locals[cdt][cdn];
 
 			if (row.fg_item) {
-				var result = await frm.events.get_subcontracting_boms_for_finished_goods(row.fg_item)
+				var result = await frm.events.get_subcontracting_boms_for_finished_goods(row.fg_item);
 
-				if (result.message && row.item_code == result.message.service_item && row.uom == result.message.service_item_uom) {
-					frappe.model.set_value(cdt, cdn, "fg_item_qty", flt(row.qty) / flt(result.message.conversion_factor));
+				if (
+					result.message &&
+					row.item_code == result.message.service_item &&
+					row.uom == result.message.service_item_uom
+				) {
+					frappe.model.set_value(
+						cdt,
+						cdn,
+						"fg_item_qty",
+						flt(row.qty) / flt(result.message.conversion_factor)
+					);
 				}
 			}
 		}
 	},
 });
 
-erpnext.buying.PurchaseOrderController = class PurchaseOrderController extends erpnext.buying.BuyingController {
+erpnext.buying.PurchaseOrderController = class PurchaseOrderController extends (
+	erpnext.buying.BuyingController
+) {
 	setup() {
 		this.frm.custom_make_buttons = {
-			'Purchase Receipt': 'Purchase Receipt',
-			'Purchase Invoice': 'Purchase Invoice',
-			'Payment Entry': 'Payment',
-			'Subcontracting Order': 'Subcontracting Order',
-			'Stock Entry': 'Material to Supplier'
-		}
+			"Purchase Receipt": "Purchase Receipt",
+			"Purchase Invoice": "Purchase Invoice",
+			"Payment Entry": "Payment",
+			"Subcontracting Order": "Subcontracting Order",
+			"Stock Entry": "Material to Supplier",
+		};
 
 		super.setup();
 	}
@@ -250,110 +270,155 @@
 
 		for (var i in cur_frm.doc.items) {
 			var item = cur_frm.doc.items[i];
-			if(item.delivered_by_supplier !== 1) {
+			if (item.delivered_by_supplier !== 1) {
 				allow_receipt = true;
 			} else {
 				is_drop_ship = true;
 			}
 
-			if(is_drop_ship && allow_receipt) {
+			if (is_drop_ship && allow_receipt) {
 				break;
 			}
 		}
 
 		this.frm.set_df_property("drop_ship", "hidden", !is_drop_ship);
 
-		if(doc.docstatus == 1) {
+		if (doc.docstatus == 1) {
 			this.frm.fields_dict.items_section.wrapper.addClass("hide-border");
-			if(!this.frm.doc.set_warehouse) {
+			if (!this.frm.doc.set_warehouse) {
 				this.frm.fields_dict.items_section.wrapper.removeClass("hide-border");
 			}
 
-			if(!in_list(["Closed", "Delivered"], doc.status)) {
-				if(this.frm.doc.status !== 'Closed' && flt(this.frm.doc.per_received, 2) < 100 && flt(this.frm.doc.per_billed, 2) < 100) {
+			if (!in_list(["Closed", "Delivered"], doc.status)) {
+				if (
+					this.frm.doc.status !== "Closed" &&
+					flt(this.frm.doc.per_received, 2) < 100 &&
+					flt(this.frm.doc.per_billed, 2) < 100
+				) {
 					if (!this.frm.doc.__onload || this.frm.doc.__onload.can_update_items) {
-						this.frm.add_custom_button(__('Update Items'), () => {
+						this.frm.add_custom_button(__("Update Items"), () => {
 							erpnext.utils.update_child_items({
 								frm: this.frm,
 								child_docname: "items",
 								child_doctype: "Purchase Order Detail",
 								cannot_add_row: false,
-							})
+							});
 						});
 					}
 				}
 				if (this.frm.has_perm("submit")) {
-					if(flt(doc.per_billed, 2) < 100 || flt(doc.per_received, 2) < 100) {
+					if (flt(doc.per_billed, 2) < 100 || flt(doc.per_received, 2) < 100) {
 						if (doc.status != "On Hold") {
-							this.frm.add_custom_button(__('Hold'), () => this.hold_purchase_order(), __("Status"));
-						} else{
-							this.frm.add_custom_button(__('Resume'), () => this.unhold_purchase_order(), __("Status"));
+							this.frm.add_custom_button(
+								__("Hold"),
+								() => this.hold_purchase_order(),
+								__("Status")
+							);
+						} else {
+							this.frm.add_custom_button(
+								__("Resume"),
+								() => this.unhold_purchase_order(),
+								__("Status")
+							);
 						}
-						this.frm.add_custom_button(__('Close'), () => this.close_purchase_order(), __("Status"));
+						this.frm.add_custom_button(
+							__("Close"),
+							() => this.close_purchase_order(),
+							__("Status")
+						);
 					}
 				}
 
-				if(is_drop_ship && doc.status!="Delivered") {
-					this.frm.add_custom_button(__('Delivered'),
-						this.delivered_by_supplier, __("Status"));
+				if (is_drop_ship && doc.status != "Delivered") {
+					this.frm.add_custom_button(__("Delivered"), this.delivered_by_supplier, __("Status"));
 
 					this.frm.page.set_inner_btn_group_as_primary(__("Status"));
 				}
-			} else if(in_list(["Closed", "Delivered"], doc.status)) {
+			} else if (in_list(["Closed", "Delivered"], doc.status)) {
 				if (this.frm.has_perm("submit")) {
-					this.frm.add_custom_button(__('Re-open'), () => this.unclose_purchase_order(), __("Status"));
+					this.frm.add_custom_button(
+						__("Re-open"),
+						() => this.unclose_purchase_order(),
+						__("Status")
+					);
 				}
 			}
-			if(doc.status != "Closed") {
+			if (doc.status != "Closed") {
 				if (doc.status != "On Hold") {
-					if(flt(doc.per_received, 2) < 100 && allow_receipt) {
-						cur_frm.add_custom_button(__('Purchase Receipt'), this.make_purchase_receipt, __('Create'));
+					if (flt(doc.per_received, 2) < 100 && allow_receipt) {
+						cur_frm.add_custom_button(
+							__("Purchase Receipt"),
+							this.make_purchase_receipt,
+							__("Create")
+						);
 						if (doc.is_subcontracted) {
 							if (doc.is_old_subcontracting_flow) {
 								if (me.has_unsupplied_items()) {
-									cur_frm.add_custom_button(__('Material to Supplier'), function() { me.make_stock_entry(); }, __("Transfer"));
+									cur_frm.add_custom_button(
+										__("Material to Supplier"),
+										function () {
+											me.make_stock_entry();
+										},
+										__("Transfer")
+									);
 								}
-							}
-							else {
-								cur_frm.add_custom_button(__('Subcontracting Order'), this.make_subcontracting_order, __('Create'));
+							} else {
+								cur_frm.add_custom_button(
+									__("Subcontracting Order"),
+									this.make_subcontracting_order,
+									__("Create")
+								);
 							}
 						}
 					}
-					if(flt(doc.per_billed, 2) < 100)
-						cur_frm.add_custom_button(__('Purchase Invoice'),
-							this.make_purchase_invoice, __('Create'));
+					if (flt(doc.per_billed, 2) < 100)
+						cur_frm.add_custom_button(
+							__("Purchase Invoice"),
+							this.make_purchase_invoice,
+							__("Create")
+						);
 
-					if(flt(doc.per_billed, 2) < 100 && doc.status != "Delivered") {
+					if (flt(doc.per_billed, 2) < 100 && doc.status != "Delivered") {
 						this.frm.add_custom_button(
-							__('Payment'),
+							__("Payment"),
 							() => this.make_payment_entry(),
-							__('Create')
+							__("Create")
 						);
 					}
 
-					if(flt(doc.per_billed, 2) < 100) {
-						this.frm.add_custom_button(__('Payment Request'),
-							function() { me.make_payment_request() }, __('Create'));
+					if (flt(doc.per_billed, 2) < 100) {
+						this.frm.add_custom_button(
+							__("Payment Request"),
+							function () {
+								me.make_payment_request();
+							},
+							__("Create")
+						);
 					}
 
 					if (doc.docstatus === 1 && !doc.inter_company_order_reference) {
 						let me = this;
 						let internal = me.frm.doc.is_internal_supplier;
 						if (internal) {
-							let button_label = (me.frm.doc.company === me.frm.doc.represents_company) ? "Internal Sales Order" :
-								"Inter Company Sales Order";
+							let button_label =
+								me.frm.doc.company === me.frm.doc.represents_company
+									? "Internal Sales Order"
+									: "Inter Company Sales Order";
 
-							me.frm.add_custom_button(button_label, function() {
-								me.make_inter_company_order(me.frm);
-							}, __('Create'));
+							me.frm.add_custom_button(
+								button_label,
+								function () {
+									me.make_inter_company_order(me.frm);
+								},
+								__("Create")
+							);
 						}
-
 					}
 				}
 
-				cur_frm.page.set_inner_btn_group_as_primary(__('Create'));
+				cur_frm.page.set_inner_btn_group_as_primary(__("Create"));
 			}
-		} else if(doc.docstatus===0) {
+		} else if (doc.docstatus === 0) {
 			cur_frm.cscript.add_from_mappers();
 		}
 	}
@@ -362,19 +427,20 @@
 		erpnext.utils.map_current_doc({
 			method: "erpnext.stock.doctype.material_request.material_request.make_purchase_order_based_on_supplier",
 			args: {
-				supplier: this.frm.doc.supplier
+				supplier: this.frm.doc.supplier,
 			},
 			source_doctype: "Material Request",
 			source_name: this.frm.doc.supplier,
 			target: this.frm,
 			setters: {
-				company: this.frm.doc.company
+				company: this.frm.doc.company,
 			},
 			get_query_filters: {
 				docstatus: ["!=", 2],
-				supplier: this.frm.doc.supplier
+				supplier: this.frm.doc.supplier,
 			},
-			get_query_method: "erpnext.stock.doctype.material_request.material_request.get_material_requests_based_on_supplier"
+			get_query_method:
+				"erpnext.stock.doctype.material_request.material_request.get_material_requests_based_on_supplier",
 		});
 	}
 
@@ -383,27 +449,27 @@
 	}
 
 	has_unsupplied_items() {
-		return this.frm.doc['supplied_items'].some(item => item.required_qty > item.supplied_qty);
+		return this.frm.doc["supplied_items"].some((item) => item.required_qty > item.supplied_qty);
 	}
 
 	make_stock_entry() {
 		frappe.call({
-			method:"erpnext.controllers.subcontracting_controller.make_rm_stock_entry",
+			method: "erpnext.controllers.subcontracting_controller.make_rm_stock_entry",
 			args: {
 				subcontract_order: cur_frm.doc.name,
-				order_doctype: cur_frm.doc.doctype
+				order_doctype: cur_frm.doc.doctype,
 			},
-			callback: function(r) {
+			callback: function (r) {
 				var doclist = frappe.model.sync(r.message);
 				frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
-			}
+			},
 		});
 	}
 
 	make_inter_company_order(frm) {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.buying.doctype.purchase_order.purchase_order.make_inter_company_sales_order",
-			frm: frm
+			frm: frm,
 		});
 	}
 
@@ -411,134 +477,163 @@
 		frappe.model.open_mapped_doc({
 			method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_receipt",
 			frm: cur_frm,
-			freeze_message: __("Creating Purchase Receipt ...")
-		})
+			freeze_message: __("Creating Purchase Receipt ..."),
+		});
 	}
 
 	make_purchase_invoice() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_invoice",
-			frm: cur_frm
-		})
+			frm: cur_frm,
+		});
 	}
 
 	make_subcontracting_order() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.buying.doctype.purchase_order.purchase_order.make_subcontracting_order",
 			frm: cur_frm,
-			freeze_message: __("Creating Subcontracting Order ...")
-		})
+			freeze_message: __("Creating Subcontracting Order ..."),
+		});
 	}
 
 	add_from_mappers() {
 		var me = this;
-		this.frm.add_custom_button(__('Material Request'),
-			function() {
+		this.frm.add_custom_button(
+			__("Material Request"),
+			function () {
 				erpnext.utils.map_current_doc({
 					method: "erpnext.stock.doctype.material_request.material_request.make_purchase_order",
 					source_doctype: "Material Request",
 					target: me.frm,
 					setters: {
 						schedule_date: undefined,
-						status: undefined
+						status: undefined,
 					},
 					get_query_filters: {
 						material_request_type: "Purchase",
 						docstatus: 1,
 						status: ["!=", "Stopped"],
 						per_ordered: ["<", 100],
-						company: me.frm.doc.company
+						company: me.frm.doc.company,
 					},
 					allow_child_item_selection: true,
 					child_fieldname: "items",
-					child_columns: ["item_code", "qty", "ordered_qty"]
-				})
-			}, __("Get Items From"));
+					child_columns: ["item_code", "qty", "ordered_qty"],
+				});
+			},
+			__("Get Items From")
+		);
 
-		this.frm.add_custom_button(__('Supplier Quotation'),
-			function() {
+		this.frm.add_custom_button(
+			__("Supplier Quotation"),
+			function () {
 				erpnext.utils.map_current_doc({
 					method: "erpnext.buying.doctype.supplier_quotation.supplier_quotation.make_purchase_order",
 					source_doctype: "Supplier Quotation",
 					target: me.frm,
 					setters: {
 						supplier: me.frm.doc.supplier,
-						valid_till: undefined
+						valid_till: undefined,
 					},
 					get_query_filters: {
 						docstatus: 1,
 						status: ["not in", ["Stopped", "Expired"]],
-					}
-				})
-			}, __("Get Items From"));
+					},
+				});
+			},
+			__("Get Items From")
+		);
 
-		this.frm.add_custom_button(__('Update Rate as per Last Purchase'),
-			function() {
+		this.frm.add_custom_button(
+			__("Update Rate as per Last Purchase"),
+			function () {
 				frappe.call({
-					"method": "get_last_purchase_rate",
-					"doc": me.frm.doc,
-					callback: function(r, rt) {
+					method: "get_last_purchase_rate",
+					doc: me.frm.doc,
+					callback: function (r, rt) {
 						me.frm.dirty();
 						me.frm.cscript.calculate_taxes_and_totals();
+					},
+				});
+			},
+			__("Tools")
+		);
+
+		this.frm.add_custom_button(
+			__("Link to Material Request"),
+			function () {
+				var my_items = [];
+				for (var i in me.frm.doc.items) {
+					if (!me.frm.doc.items[i].material_request) {
+						my_items.push(me.frm.doc.items[i].item_code);
 					}
-				})
-			}, __("Tools"));
-
-		this.frm.add_custom_button(__('Link to Material Request'),
-		function() {
-			var my_items = [];
-			for (var i in me.frm.doc.items) {
-				if(!me.frm.doc.items[i].material_request){
-					my_items.push(me.frm.doc.items[i].item_code);
 				}
-			}
-			frappe.call({
-				method: "erpnext.buying.utils.get_linked_material_requests",
-				args:{
-					items: my_items
-				},
-				callback: function(r) {
-					if(r.exc) return;
+				frappe.call({
+					method: "erpnext.buying.utils.get_linked_material_requests",
+					args: {
+						items: my_items,
+					},
+					callback: function (r) {
+						if (r.exc) return;
 
-					var i = 0;
-					var item_length = me.frm.doc.items.length;
-					while (i < item_length) {
-						var qty = me.frm.doc.items[i].qty;
-						(r.message[0] || []).forEach(function(d) {
-							if (d.qty > 0 && qty > 0 && me.frm.doc.items[i].item_code == d.item_code && !me.frm.doc.items[i].material_request_item)
-							{
-								me.frm.doc.items[i].material_request = d.mr_name;
-								me.frm.doc.items[i].material_request_item = d.mr_item;
-								var my_qty = Math.min(qty, d.qty);
-								qty = qty - my_qty;
-								d.qty = d.qty  - my_qty;
-								me.frm.doc.items[i].stock_qty = my_qty * me.frm.doc.items[i].conversion_factor;
-								me.frm.doc.items[i].qty = my_qty;
+						var i = 0;
+						var item_length = me.frm.doc.items.length;
+						while (i < item_length) {
+							var qty = me.frm.doc.items[i].qty;
+							(r.message[0] || []).forEach(function (d) {
+								if (
+									d.qty > 0 &&
+									qty > 0 &&
+									me.frm.doc.items[i].item_code == d.item_code &&
+									!me.frm.doc.items[i].material_request_item
+								) {
+									me.frm.doc.items[i].material_request = d.mr_name;
+									me.frm.doc.items[i].material_request_item = d.mr_item;
+									var my_qty = Math.min(qty, d.qty);
+									qty = qty - my_qty;
+									d.qty = d.qty - my_qty;
+									me.frm.doc.items[i].stock_qty =
+										my_qty * me.frm.doc.items[i].conversion_factor;
+									me.frm.doc.items[i].qty = my_qty;
 
-								frappe.msgprint("Assigning " + d.mr_name + " to " + d.item_code + " (row " + me.frm.doc.items[i].idx + ")");
-								if (qty > 0) {
-									frappe.msgprint("Splitting " + qty + " units of " + d.item_code);
-									var new_row = frappe.model.add_child(me.frm.doc, me.frm.doc.items[i].doctype, "items");
-									item_length++;
+									frappe.msgprint(
+										"Assigning " +
+											d.mr_name +
+											" to " +
+											d.item_code +
+											" (row " +
+											me.frm.doc.items[i].idx +
+											")"
+									);
+									if (qty > 0) {
+										frappe.msgprint("Splitting " + qty + " units of " + d.item_code);
+										var new_row = frappe.model.add_child(
+											me.frm.doc,
+											me.frm.doc.items[i].doctype,
+											"items"
+										);
+										item_length++;
 
-									for (var key in me.frm.doc.items[i]) {
-										new_row[key] = me.frm.doc.items[i][key];
+										for (var key in me.frm.doc.items[i]) {
+											new_row[key] = me.frm.doc.items[i][key];
+										}
+
+										new_row.idx = item_length;
+										new_row["stock_qty"] = new_row.conversion_factor * qty;
+										new_row["qty"] = qty;
+										new_row["material_request"] = "";
+										new_row["material_request_item"] = "";
 									}
-
-									new_row.idx = item_length;
-									new_row["stock_qty"] = new_row.conversion_factor * qty;
-									new_row["qty"] = qty;
-									new_row["material_request"] = "";
-									new_row["material_request_item"] = "";
 								}
-							}
-						});
-						i++;
-					}
-					refresh_field("items");
-				}
-			});
-		}, __("Tools"));
+							});
+							i++;
+						}
+						refresh_field("items");
+					},
+				});
+			},
+			__("Tools")
+		);
 	}
 
 	tc_name() {
@@ -547,7 +642,7 @@
 
 	items_add(doc, cdt, cdn) {
 		var row = frappe.get_doc(cdt, cdn);
-		if(doc.schedule_date) {
+		if (doc.schedule_date) {
 			row.schedule_date = doc.schedule_date;
 			refresh_field("schedule_date", cdn, "items");
 		} else {
@@ -555,24 +650,24 @@
 		}
 	}
 
-	unhold_purchase_order(){
-		cur_frm.cscript.update_status("Resume", "Draft")
+	unhold_purchase_order() {
+		cur_frm.cscript.update_status("Resume", "Draft");
 	}
 
-	hold_purchase_order(){
+	hold_purchase_order() {
 		var me = this;
 		var d = new frappe.ui.Dialog({
-			title: __('Reason for Hold'),
+			title: __("Reason for Hold"),
 			fields: [
 				{
-					"fieldname": "reason_for_hold",
-					"fieldtype": "Text",
-					"reqd": 1,
-				}
+					fieldname: "reason_for_hold",
+					fieldtype: "Text",
+					reqd: 1,
+				},
 			],
-			primary_action: function() {
+			primary_action: function () {
 				var data = d.get_values();
-				let reason_for_hold = 'Reason for hold: ' + data.reason_for_hold;
+				let reason_for_hold = "Reason for hold: " + data.reason_for_hold;
 
 				frappe.call({
 					method: "frappe.desk.form.utils.add_comment",
@@ -581,30 +676,30 @@
 						reference_name: me.frm.docname,
 						content: __(reason_for_hold),
 						comment_email: frappe.session.user,
-						comment_by: frappe.session.user_fullname
+						comment_by: frappe.session.user_fullname,
 					},
-					callback: function(r) {
-						if(!r.exc) {
-							me.update_status('Hold', 'On Hold')
+					callback: function (r) {
+						if (!r.exc) {
+							me.update_status("Hold", "On Hold");
 							d.hide();
 						}
-					}
+					},
 				});
-			}
+			},
 		});
 		d.show();
 	}
 
-	unclose_purchase_order(){
-		cur_frm.cscript.update_status('Re-open', 'Submitted')
+	unclose_purchase_order() {
+		cur_frm.cscript.update_status("Re-open", "Submitted");
 	}
 
-	close_purchase_order(){
-		cur_frm.cscript.update_status('Close', 'Closed')
+	close_purchase_order() {
+		cur_frm.cscript.update_status("Close", "Closed");
 	}
 
-	delivered_by_supplier(){
-		cur_frm.cscript.update_status('Deliver', 'Delivered')
+	delivered_by_supplier() {
+		cur_frm.cscript.update_status("Deliver", "Delivered");
 	}
 
 	items_on_form_rendered() {
@@ -617,51 +712,55 @@
 };
 
 // for backward compatibility: combine new and previous states
-extend_cscript(cur_frm.cscript, new erpnext.buying.PurchaseOrderController({frm: cur_frm}));
+extend_cscript(cur_frm.cscript, new erpnext.buying.PurchaseOrderController({ frm: cur_frm }));
 
-cur_frm.cscript.update_status= function(label, status){
+cur_frm.cscript.update_status = function (label, status) {
 	frappe.call({
 		method: "erpnext.buying.doctype.purchase_order.purchase_order.update_status",
-		args: {status: status, name: cur_frm.doc.name},
-		callback: function(r) {
+		args: { status: status, name: cur_frm.doc.name },
+		callback: function (r) {
 			cur_frm.set_value("status", status);
 			cur_frm.reload_doc();
-		}
-	})
-}
+		},
+	});
+};
 
-cur_frm.fields_dict['items'].grid.get_field('project').get_query = function(doc, cdt, cdn) {
+cur_frm.fields_dict["items"].grid.get_field("project").get_query = function (doc, cdt, cdn) {
 	return {
-		filters:[
-			['Project', 'status', 'not in', 'Completed, Cancelled']
-		]
-	}
-}
+		filters: [["Project", "status", "not in", "Completed, Cancelled"]],
+	};
+};
 
 if (cur_frm.doc.is_old_subcontracting_flow) {
-	cur_frm.fields_dict['items'].grid.get_field('bom').get_query = function(doc, cdt, cdn) {
-		var d = locals[cdt][cdn]
+	cur_frm.fields_dict["items"].grid.get_field("bom").get_query = function (doc, cdt, cdn) {
+		var d = locals[cdt][cdn];
 		return {
 			filters: [
-				['BOM', 'item', '=', d.item_code],
-				['BOM', 'is_active', '=', '1'],
-				['BOM', 'docstatus', '=', '1'],
-				['BOM', 'company', '=', doc.company]
-			]
-		}
-	}
+				["BOM", "item", "=", d.item_code],
+				["BOM", "is_active", "=", "1"],
+				["BOM", "docstatus", "=", "1"],
+				["BOM", "company", "=", doc.company],
+			],
+		};
+	};
 }
 
 function set_schedule_date(frm) {
-	if(frm.doc.schedule_date){
-		erpnext.utils.copy_value_in_all_rows(frm.doc, frm.doc.doctype, frm.doc.name, "items", "schedule_date");
+	if (frm.doc.schedule_date) {
+		erpnext.utils.copy_value_in_all_rows(
+			frm.doc,
+			frm.doc.doctype,
+			frm.doc.name,
+			"items",
+			"schedule_date"
+		);
 	}
 }
 
 frappe.provide("erpnext.buying");
 
-frappe.ui.form.on("Purchase Order", "is_subcontracted", function(frm) {
+frappe.ui.form.on("Purchase Order", "is_subcontracted", function (frm) {
 	if (frm.doc.is_old_subcontracting_flow) {
 		erpnext.buying.get_default_bom(frm);
 	}
-});
\ No newline at end of file
+});
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order_list.js b/erpnext/buying/doctype/purchase_order/purchase_order_list.js
index d39d7f9..5e33b42 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order_list.js
+++ b/erpnext/buying/doctype/purchase_order/purchase_order_list.js
@@ -1,6 +1,15 @@
-frappe.listview_settings['Purchase Order'] = {
-	add_fields: ["base_grand_total", "company", "currency", "supplier",
-		"supplier_name", "per_received", "per_billed", "status", "advance_payment_status"],
+frappe.listview_settings["Purchase Order"] = {
+	add_fields: [
+		"base_grand_total",
+		"company",
+		"currency",
+		"supplier",
+		"supplier_name",
+		"per_received",
+		"per_billed",
+		"status",
+		"advance_payment_status",
+	],
 	get_indicator: function (doc) {
 		if (doc.status === "Closed") {
 			return [__("Closed"), "green", "status,=,Closed"];
@@ -12,15 +21,25 @@
 			return [__("To Pay"), "gray", "advance_payment_status,=,Initiated"];
 		} else if (flt(doc.per_received, 2) < 100 && doc.status !== "Closed") {
 			if (flt(doc.per_billed, 2) < 100) {
-				return [__("To Receive and Bill"), "orange",
-					"per_received,<,100|per_billed,<,100|status,!=,Closed"];
+				return [
+					__("To Receive and Bill"),
+					"orange",
+					"per_received,<,100|per_billed,<,100|status,!=,Closed",
+				];
 			} else {
-				return [__("To Receive"), "orange",
-					"per_received,<,100|per_billed,=,100|status,!=,Closed"];
+				return [__("To Receive"), "orange", "per_received,<,100|per_billed,=,100|status,!=,Closed"];
 			}
-		} else if (flt(doc.per_received, 2) >= 100 && flt(doc.per_billed, 2) < 100 && doc.status !== "Closed") {
+		} else if (
+			flt(doc.per_received, 2) >= 100 &&
+			flt(doc.per_billed, 2) < 100 &&
+			doc.status !== "Closed"
+		) {
 			return [__("To Bill"), "orange", "per_received,=,100|per_billed,<,100|status,!=,Closed"];
-		} else if (flt(doc.per_received, 2) >= 100 && flt(doc.per_billed, 2) == 100 && doc.status !== "Closed") {
+		} else if (
+			flt(doc.per_received, 2) >= 100 &&
+			flt(doc.per_billed, 2) == 100 &&
+			doc.status !== "Closed"
+		) {
 			return [__("Completed"), "green", "per_received,=,100|per_billed,=,100|status,!=,Closed"];
 		}
 	},
@@ -28,25 +47,23 @@
 		var method = "erpnext.buying.doctype.purchase_order.purchase_order.close_or_unclose_purchase_orders";
 
 		listview.page.add_menu_item(__("Close"), function () {
-			listview.call_for_selected_items(method, { "status": "Closed" });
+			listview.call_for_selected_items(method, { status: "Closed" });
 		});
 
 		listview.page.add_menu_item(__("Reopen"), function () {
-			listview.call_for_selected_items(method, { "status": "Submitted" });
+			listview.call_for_selected_items(method, { status: "Submitted" });
 		});
 
-
-		listview.page.add_action_item(__("Purchase Invoice"), ()=>{
+		listview.page.add_action_item(__("Purchase Invoice"), () => {
 			erpnext.bulk_transaction_processing.create(listview, "Purchase Order", "Purchase Invoice");
 		});
 
-		listview.page.add_action_item(__("Purchase Receipt"), ()=>{
+		listview.page.add_action_item(__("Purchase Receipt"), () => {
 			erpnext.bulk_transaction_processing.create(listview, "Purchase Order", "Purchase Receipt");
 		});
 
-		listview.page.add_action_item(__("Advance Payment"), ()=>{
+		listview.page.add_action_item(__("Advance Payment"), () => {
 			erpnext.bulk_transaction_processing.create(listview, "Purchase Order", "Payment Entry");
 		});
-
-	}
+	},
 };
diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py
index d262783..c667ee8 100644
--- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py
+++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py
@@ -762,11 +762,94 @@
 		pe_doc = frappe.get_doc("Payment Entry", pe.name)
 		pe_doc.cancel()
 
+	def create_account(self, account_name, company, currency, parent):
+		if not frappe.db.get_value(
+			"Account", filters={"account_name": account_name, "company": company}
+		):
+			account = frappe.get_doc(
+				{
+					"doctype": "Account",
+					"account_name": account_name,
+					"parent_account": parent,
+					"company": company,
+					"account_currency": currency,
+					"is_group": 0,
+					"account_type": "Payable",
+				}
+			).insert()
+		else:
+			account = frappe.db.get_value(
+				"Account",
+				filters={"account_name": account_name, "company": company},
+				fieldname="name",
+				pluck=True,
+			)
+
+		return account
+
+	def test_advance_payment_with_separate_party_account_enabled(self):
+		"""
+		Test "Advance Paid" on Purchase Order, when "Book Advance Payments in Separate Party Account" is enabled and
+		the payment entry linked to the Order is allocated to Purchase Invoice.
+		"""
+		supplier = "_Test Supplier"
+		company = "_Test Company"
+
+		# Setup default 'Advance Paid' account
+		account = self.create_account(
+			"Advance Paid", company, "INR", "Application of Funds (Assets) - _TC"
+		)
+		company_doc = frappe.get_doc("Company", company)
+		company_doc.book_advance_payments_in_separate_party_account = True
+		company_doc.default_advance_paid_account = account.name
+		company_doc.save()
+
+		po_doc = create_purchase_order(supplier=supplier)
+
+		from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
+
+		pe = get_payment_entry("Purchase Order", po_doc.name)
+		pe.save().submit()
+
+		po_doc.reload()
+		self.assertEqual(po_doc.advance_paid, 5000)
+
+		from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_invoice
+
+		pi = make_purchase_invoice(po_doc.name)
+		pi.append(
+			"advances",
+			{
+				"reference_type": pe.doctype,
+				"reference_name": pe.name,
+				"reference_row": pe.references[0].name,
+				"advance_amount": 5000,
+				"allocated_amount": 5000,
+			},
+		)
+		pi.save().submit()
+		pe.reload()
+		po_doc.reload()
+		self.assertEqual(po_doc.advance_paid, 0)
+
+		company_doc.book_advance_payments_in_separate_party_account = False
+		company_doc.save()
+
 	@change_settings("Accounts Settings", {"unlink_advance_payment_on_cancelation_of_order": 1})
 	def test_advance_paid_upon_payment_entry_cancellation(self):
 		from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
 
-		po_doc = create_purchase_order(supplier="_Test Supplier USD", currency="USD", do_not_submit=1)
+		supplier = "_Test Supplier USD"
+		company = "_Test Company"
+
+		# Setup default USD payable account for Supplier
+		account = self.create_account("Creditors USD", company, "USD", "Accounts Payable - _TC")
+		supplier_doc = frappe.get_doc("Supplier", supplier)
+		if not [x for x in supplier_doc.accounts if x.company == company]:
+			supplier_doc.append("accounts", {"company": company, "account": account.name})
+			supplier_doc.save()
+
+		po_doc = create_purchase_order(supplier=supplier, currency="USD", do_not_submit=1)
 		po_doc.conversion_rate = 80
 		po_doc.submit()
 
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
index 31a06cf..272d077 100644
--- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
@@ -1,60 +1,70 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-cur_frm.add_fetch('contact', 'email_id', 'email_id')
+cur_frm.add_fetch("contact", "email_id", "email_id");
 
 erpnext.buying.setup_buying_controller();
 
-frappe.ui.form.on("Request for Quotation",{
-	setup: function(frm) {
+frappe.ui.form.on("Request for Quotation", {
+	setup: function (frm) {
 		frm.custom_make_buttons = {
-			'Supplier Quotation': 'Create'
-		}
+			"Supplier Quotation": "Create",
+		};
 
-		frm.fields_dict["suppliers"].grid.get_field("contact").get_query = function(doc, cdt, cdn) {
+		frm.fields_dict["suppliers"].grid.get_field("contact").get_query = function (doc, cdt, cdn) {
 			let d = locals[cdt][cdn];
 			return {
 				query: "frappe.contacts.doctype.contact.contact.contact_query",
 				filters: {
 					link_doctype: "Supplier",
-					link_name: d.supplier || ""
-				}
+					link_name: d.supplier || "",
+				},
 			};
-		}
+		};
 
-		frm.set_query('warehouse', 'items', () => ({
+		frm.set_query("warehouse", "items", () => ({
 			filters: {
 				company: frm.doc.company,
-				is_group: 0
-			}
+				is_group: 0,
+			},
 		}));
 	},
 
-	onload: function(frm) {
-		if(!frm.doc.message_for_supplier) {
-			frm.set_value("message_for_supplier", __("Please supply the specified items at the best possible rates"))
+	onload: function (frm) {
+		if (!frm.doc.message_for_supplier) {
+			frm.set_value(
+				"message_for_supplier",
+				__("Please supply the specified items at the best possible rates")
+			);
 		}
 	},
 
-	refresh: function(frm, cdt, cdn) {
+	refresh: function (frm, cdt, cdn) {
 		if (frm.doc.docstatus === 1) {
+			frm.add_custom_button(
+				__("Supplier Quotation"),
+				function () {
+					frm.trigger("make_supplier_quotation");
+				},
+				__("Create")
+			);
 
-			frm.add_custom_button(__('Supplier Quotation'),
-				function(){ frm.trigger("make_supplier_quotation") }, __("Create"));
-
-
-			frm.add_custom_button(__("Send Emails to Suppliers"), function() {
-				frappe.call({
-					method: 'erpnext.buying.doctype.request_for_quotation.request_for_quotation.send_supplier_emails',
-					freeze: true,
-					args: {
-						rfq_name: frm.doc.name
-					},
-					callback: function(r){
-						frm.reload_doc();
-					}
-				});
-			}, __("Tools"));
+			frm.add_custom_button(
+				__("Send Emails to Suppliers"),
+				function () {
+					frappe.call({
+						method: "erpnext.buying.doctype.request_for_quotation.request_for_quotation.send_supplier_emails",
+						freeze: true,
+						args: {
+							rfq_name: frm.doc.name,
+						},
+						callback: function (r) {
+							frm.reload_doc();
+						},
+					});
+				},
+				__("Tools")
+			);
 
 			frm.add_custom_button(
 				__("Download PDF"),
@@ -122,13 +132,13 @@
 							var w = window.open(
 								frappe.urllib.get_full_url(
 									"/api/method/erpnext.buying.doctype.request_for_quotation.request_for_quotation.get_pdf?" +
-									new URLSearchParams({
-										name: frm.doc.name,
-										supplier: data.supplier,
-										print_format: data.print_format || "Standard",
-										language: data.language || frappe.boot.lang,
-										letterhead: data.letter_head || frm.doc.letter_head || "",
-									}).toString()
+										new URLSearchParams({
+											name: frm.doc.name,
+											supplier: data.supplier,
+											print_format: data.print_format || "Standard",
+											language: data.language || frappe.boot.lang,
+											letterhead: data.letter_head || frm.doc.letter_head || "",
+										}).toString()
 								)
 							);
 							if (!w) {
@@ -147,101 +157,109 @@
 		}
 	},
 
-	make_supplier_quotation: function(frm) {
+	make_supplier_quotation: function (frm) {
 		var doc = frm.doc;
 		var dialog = new frappe.ui.Dialog({
 			title: __("Create Supplier Quotation"),
 			fields: [
-				{	"fieldtype": "Link",
-					"label": __("Supplier"),
-					"fieldname": "supplier",
-					"options": 'Supplier',
-					"reqd": 1,
+				{
+					fieldtype: "Link",
+					label: __("Supplier"),
+					fieldname: "supplier",
+					options: "Supplier",
+					reqd: 1,
 					get_query: () => {
 						return {
 							filters: [
-								["Supplier", "name", "in", frm.doc.suppliers.map((row) => {return row.supplier;})]
-							]
-						}
-					}
-				}
+								[
+									"Supplier",
+									"name",
+									"in",
+									frm.doc.suppliers.map((row) => {
+										return row.supplier;
+									}),
+								],
+							],
+						};
+					},
+				},
 			],
 			primary_action_label: __("Create"),
 			primary_action: (args) => {
-				if(!args) return;
+				if (!args) return;
 				dialog.hide();
 
 				return frappe.call({
 					type: "GET",
 					method: "erpnext.buying.doctype.request_for_quotation.request_for_quotation.make_supplier_quotation_from_rfq",
 					args: {
-						"source_name": doc.name,
-						"for_supplier": args.supplier
+						source_name: doc.name,
+						for_supplier: args.supplier,
 					},
 					freeze: true,
-					callback: function(r) {
-						if(!r.exc) {
+					callback: function (r) {
+						if (!r.exc) {
 							var doc = frappe.model.sync(r.message);
 							frappe.set_route("Form", r.message.doctype, r.message.name);
 						}
-					}
+					},
 				});
-			}
+			},
 		});
 
-		dialog.show()
+		dialog.show();
 	},
 
 	schedule_date(frm) {
-		if(frm.doc.schedule_date){
+		if (frm.doc.schedule_date) {
 			frm.doc.items.forEach((item) => {
 				item.schedule_date = frm.doc.schedule_date;
-			})
+			});
 		}
 		refresh_field("items");
 	},
 	preview: (frm) => {
 		let dialog = new frappe.ui.Dialog({
-			title: __('Preview Email'),
+			title: __("Preview Email"),
 			fields: [
 				{
-					label: __('Supplier'),
-					fieldtype: 'Select',
-					fieldname: 'supplier',
-					options: frm.doc.suppliers.map(row => row.supplier),
-					reqd: 1
+					label: __("Supplier"),
+					fieldtype: "Select",
+					fieldname: "supplier",
+					options: frm.doc.suppliers.map((row) => row.supplier),
+					reqd: 1,
 				},
 				{
-					fieldtype: 'Column Break',
-					fieldname: 'col_break_1',
+					fieldtype: "Column Break",
+					fieldname: "col_break_1",
 				},
 				{
-					label: __('Subject'),
-					fieldtype: 'Data',
-					fieldname: 'subject',
+					label: __("Subject"),
+					fieldtype: "Data",
+					fieldname: "subject",
 					read_only: 1,
-					depends_on: 'subject'
+					depends_on: "subject",
 				},
 				{
-					fieldtype: 'Section Break',
-					fieldname: 'sec_break_1',
-					hide_border: 1
+					fieldtype: "Section Break",
+					fieldname: "sec_break_1",
+					hide_border: 1,
 				},
 				{
-					label: __('Email'),
-					fieldtype: 'HTML',
-					fieldname: 'email_preview'
+					label: __("Email"),
+					fieldtype: "HTML",
+					fieldname: "email_preview",
 				},
 				{
-					fieldtype: 'Section Break',
-					fieldname: 'sec_break_2'
+					fieldtype: "Section Break",
+					fieldname: "sec_break_2",
 				},
 				{
-					label: __('Note'),
-					fieldtype: 'HTML',
-					fieldname: 'note'
-				}
-			]
+					label: __("Note"),
+					fieldtype: "HTML",
+					fieldname: "note",
+				},
+			],
 		});
 
 		dialog.fields_dict["supplier"].df.onchange = () => {
@@ -249,74 +267,78 @@
 				supplier: dialog.get_value("supplier"),
 			}).then(({ message }) => {
 				dialog.fields_dict.email_preview.$wrapper.empty();
-				dialog.fields_dict.email_preview.$wrapper.append(
-					message.message
-				);
+				dialog.fields_dict.email_preview.$wrapper.append(message.message);
 				dialog.set_value("subject", message.subject);
 			});
 		};
 
-		dialog.fields_dict.note.$wrapper.append(`<p class="small text-muted">This is a preview of the email to be sent. A PDF of the document will
+		dialog.fields_dict.note.$wrapper
+			.append(`<p class="small text-muted">This is a preview of the email to be sent. A PDF of the document will
 			automatically be attached with the email.</p>`);
 
 		dialog.show();
-	}
-})
+	},
+});
 frappe.ui.form.on("Request for Quotation Item", {
 	items_add(frm, cdt, cdn) {
 		if (frm.doc.schedule_date) {
-			frappe.model.set_value(cdt, cdn, 'schedule_date', frm.doc.schedule_date);
+			frappe.model.set_value(cdt, cdn, "schedule_date", frm.doc.schedule_date);
 		}
-	}
-});
-frappe.ui.form.on("Request for Quotation Supplier",{
-	supplier: function(frm, cdt, cdn) {
-		var d = locals[cdt][cdn]
-		frappe.call({
-			method:"erpnext.accounts.party.get_party_details",
-			args:{
-				party: d.supplier,
-				party_type: 'Supplier'
-			},
-			callback: function(r){
-				if(r.message){
-					frappe.model.set_value(cdt, cdn, 'contact', r.message.contact_person)
-					frappe.model.set_value(cdt, cdn, 'email_id', r.message.contact_email)
-				}
-			}
-		})
 	},
+});
+frappe.ui.form.on("Request for Quotation Supplier", {
+	supplier: function (frm, cdt, cdn) {
+		var d = locals[cdt][cdn];
+		frappe.call({
+			method: "erpnext.accounts.party.get_party_details",
+			args: {
+				party: d.supplier,
+				party_type: "Supplier",
+			},
+			callback: function (r) {
+				if (r.message) {
+					frappe.model.set_value(cdt, cdn, "contact", r.message.contact_person);
+					frappe.model.set_value(cdt, cdn, "email_id", r.message.contact_email);
+				}
+			},
+		});
+	},
+});
 
-})
-
-erpnext.buying.RequestforQuotationController = class RequestforQuotationController extends erpnext.buying.BuyingController {
+erpnext.buying.RequestforQuotationController = class RequestforQuotationController extends (
+	erpnext.buying.BuyingController
+) {
 	refresh() {
 		var me = this;
 		super.refresh();
-		if (this.frm.doc.docstatus===0) {
-			this.frm.add_custom_button(__('Material Request'),
-				function() {
+		if (this.frm.doc.docstatus === 0) {
+			this.frm.add_custom_button(
+				__("Material Request"),
+				function () {
 					erpnext.utils.map_current_doc({
 						method: "erpnext.stock.doctype.material_request.material_request.make_request_for_quotation",
 						source_doctype: "Material Request",
 						target: me.frm,
 						setters: {
 							schedule_date: undefined,
-							status: undefined
+							status: undefined,
 						},
 						get_query_filters: {
 							material_request_type: "Purchase",
 							docstatus: 1,
 							status: ["!=", "Stopped"],
 							per_ordered: ["<", 100],
-							company: me.frm.doc.company
-						}
-					})
-				}, __("Get Items From"));
+							company: me.frm.doc.company,
+						},
+					});
+				},
+				__("Get Items From")
+			);
 
 			// Get items from Opportunity
-			this.frm.add_custom_button(__('Opportunity'),
-				function() {
+			this.frm.add_custom_button(
+				__("Opportunity"),
+				function () {
 					erpnext.utils.map_current_doc({
 						method: "erpnext.crm.doctype.opportunity.opportunity.make_request_for_quotation",
 						source_doctype: "Opportunity",
@@ -324,67 +346,79 @@
 						setters: {
 							party_name: undefined,
 							opportunity_from: undefined,
-							status: undefined
+							status: undefined,
 						},
 						get_query_filters: {
 							status: ["not in", ["Closed", "Lost"]],
-							company: me.frm.doc.company
-						}
-					})
-				}, __("Get Items From"));
+							company: me.frm.doc.company,
+						},
+					});
+				},
+				__("Get Items From")
+			);
 
 			// Get items from open Material Requests based on supplier
-			this.frm.add_custom_button(__('Possible Supplier'), function() {
-				// Create a dialog window for the user to pick their supplier
-				var dialog = new frappe.ui.Dialog({
-					title: __('Select Possible Supplier'),
-					fields: [
-						{
-							fieldname: 'supplier',
-							fieldtype:'Link',
-							options:'Supplier',
-							label:'Supplier',
-							reqd:1,
-							description: __("Get Items from Material Requests against this Supplier")
-						}
-					],
-					primary_action_label: __("Get Items"),
-					primary_action: (args) => {
-						if(!args) return;
-						dialog.hide();
-
-						erpnext.utils.map_current_doc({
-							method: "erpnext.buying.doctype.request_for_quotation.request_for_quotation.get_item_from_material_requests_based_on_supplier",
-							source_name: args.supplier,
-							target: me.frm,
-							setters: {
-								company: me.frm.doc.company
+			this.frm.add_custom_button(
+				__("Possible Supplier"),
+				function () {
+					// Create a dialog window for the user to pick their supplier
+					var dialog = new frappe.ui.Dialog({
+						title: __("Select Possible Supplier"),
+						fields: [
+							{
+								fieldname: "supplier",
+								fieldtype: "Link",
+								options: "Supplier",
+								label: "Supplier",
+								reqd: 1,
+								description: __("Get Items from Material Requests against this Supplier"),
 							},
-							get_query_filters: {
-								material_request_type: "Purchase",
-								docstatus: 1,
-								status: ["!=", "Stopped"],
-								per_ordered: ["<", 100]
-							}
-						});
-						dialog.hide();
-					}
-				});
+						],
+						primary_action_label: __("Get Items"),
+						primary_action: (args) => {
+							if (!args) return;
+							dialog.hide();
 
-				dialog.show();
-			}, __("Get Items From"));
+							erpnext.utils.map_current_doc({
+								method: "erpnext.buying.doctype.request_for_quotation.request_for_quotation.get_item_from_material_requests_based_on_supplier",
+								source_name: args.supplier,
+								target: me.frm,
+								setters: {
+									company: me.frm.doc.company,
+								},
+								get_query_filters: {
+									material_request_type: "Purchase",
+									docstatus: 1,
+									status: ["!=", "Stopped"],
+									per_ordered: ["<", 100],
+								},
+							});
+							dialog.hide();
+						},
+					});
+
+					dialog.show();
+				},
+				__("Get Items From")
+			);
 
 			// Link Material Requests
-			this.frm.add_custom_button(__('Link to Material Requests'),
-				function() {
+			this.frm.add_custom_button(
+				__("Link to Material Requests"),
+				function () {
 					erpnext.buying.link_to_mrs(me.frm);
-				}, __("Tools"));
+				},
+				__("Tools")
+			);
 
 			// Get Suppliers
-			this.frm.add_custom_button(__('Get Suppliers'),
-				function() {
+			this.frm.add_custom_button(
+				__("Get Suppliers"),
+				function () {
 					me.get_suppliers_button(me.frm);
-				}, __("Tools"));
+				},
+				__("Tools")
+			);
 		}
 	}
 
@@ -396,70 +430,75 @@
 		this.get_terms();
 	}
 
-	get_suppliers_button (frm) {
+	get_suppliers_button(frm) {
 		var doc = frm.doc;
 		var dialog = new frappe.ui.Dialog({
 			title: __("Get Suppliers"),
 			fields: [
 				{
-					"fieldtype": "Select", "label": __("Get Suppliers By"),
-					"fieldname": "search_type",
-					"options": ["Supplier Group", "Tag"],
-					"reqd": 1,
+					fieldtype: "Select",
+					label: __("Get Suppliers By"),
+					fieldname: "search_type",
+					options: ["Supplier Group", "Tag"],
+					reqd: 1,
 					onchange() {
-						if(dialog.get_value('search_type') == 'Tag'){
-							frappe.call({
-								method: 'erpnext.buying.doctype.request_for_quotation.request_for_quotation.get_supplier_tag',
-							}).then(r => {
-								dialog.set_df_property("tag", "options", r.message)
-						});
+						if (dialog.get_value("search_type") == "Tag") {
+							frappe
+								.call({
+									method: "erpnext.buying.doctype.request_for_quotation.request_for_quotation.get_supplier_tag",
+								})
+								.then((r) => {
+									dialog.set_df_property("tag", "options", r.message);
+								});
 						}
-					}
+					},
 				},
 				{
-					"fieldtype": "Link", "label": __("Supplier Group"),
-					"fieldname": "supplier_group",
-					"options": "Supplier Group",
-					"reqd": 0,
-					"depends_on": "eval:doc.search_type == 'Supplier Group'"
+					fieldtype: "Link",
+					label: __("Supplier Group"),
+					fieldname: "supplier_group",
+					options: "Supplier Group",
+					reqd: 0,
+					depends_on: "eval:doc.search_type == 'Supplier Group'",
 				},
 				{
-					"fieldtype": "Select", "label": __("Tag"),
-					"fieldname": "tag",
-					"reqd": 0,
-					"depends_on": "eval:doc.search_type == 'Tag'",
-				}
+					fieldtype: "Select",
+					label: __("Tag"),
+					fieldname: "tag",
+					reqd: 0,
+					depends_on: "eval:doc.search_type == 'Tag'",
+				},
 			],
 			primary_action_label: __("Add Suppliers"),
-			primary_action : (args) => {
-				if(!args) return;
+			primary_action: (args) => {
+				if (!args) return;
 				dialog.hide();
 
 				//Remove blanks
 				for (var j = 0; j < frm.doc.suppliers.length; j++) {
-					if(!Object.prototype.hasOwnProperty.call(frm.doc.suppliers[j], "supplier")) {
+					if (!Object.prototype.hasOwnProperty.call(frm.doc.suppliers[j], "supplier")) {
 						frm.get_field("suppliers").grid.grid_rows[j].remove();
 					}
 				}
 
 				function load_suppliers(r) {
-					if(r.message) {
+					if (r.message) {
 						for (var i = 0; i < r.message.length; i++) {
 							var exists = false;
 							let supplier = "";
-							if (r.message[i].constructor === Array){
+							if (r.message[i].constructor === Array) {
 								supplier = r.message[i][0];
 							} else {
 								supplier = r.message[i].name;
 							}
 
-							for (var j = 0; j < doc.suppliers.length;j++) {
+							for (var j = 0; j < doc.suppliers.length; j++) {
 								if (supplier === doc.suppliers[j].supplier) {
 									exists = true;
 								}
 							}
-							if(!exists) {
-								var d = frm.add_child('suppliers');
+							if (!exists) {
+								var d = frm.add_child("suppliers");
 								d.supplier = supplier;
 								frm.script_manager.trigger("supplier", d.doctype, d.name);
 							}
@@ -473,10 +512,10 @@
 						type: "GET",
 						method: "frappe.desk.doctype.tag.tag.get_tagged_docs",
 						args: {
-							"doctype": "Supplier",
-							"tag": args.tag
+							doctype: "Supplier",
+							tag: args.tag,
 						},
-						callback: load_suppliers
+						callback: load_suppliers,
 					});
 				} else if (args.supplier_group) {
 					return frappe.call({
@@ -485,13 +524,12 @@
 							doctype: "Supplier",
 							order_by: "name",
 							fields: ["name"],
-							filters: [["Supplier", "supplier_group", "=", args.supplier_group]]
-
+							filters: [["Supplier", "supplier_group", "=", args.supplier_group]],
 						},
-						callback: load_suppliers
+						callback: load_suppliers,
 					});
 				}
-			}
+			},
 		});
 
 		dialog.show();
@@ -499,4 +537,4 @@
 };
 
 // for backward compatibility: combine new and previous states
-extend_cscript(cur_frm.cscript, new erpnext.buying.RequestforQuotationController({frm: cur_frm}));
+extend_cscript(cur_frm.cscript, new erpnext.buying.RequestforQuotationController({ frm: cur_frm }));
diff --git a/erpnext/buying/doctype/supplier/supplier.js b/erpnext/buying/doctype/supplier/supplier.js
index 70d2782..b74474b 100644
--- a/erpnext/buying/doctype/supplier/supplier.js
+++ b/erpnext/buying/doctype/supplier/supplier.js
@@ -3,65 +3,65 @@
 
 frappe.ui.form.on("Supplier", {
 	setup: function (frm) {
-		frm.set_query('default_price_list', { 'buying': 1 });
+		frm.set_query("default_price_list", { buying: 1 });
 		if (frm.doc.__islocal == 1) {
 			frm.set_value("represents_company", "");
 		}
-		frm.set_query('account', 'accounts', function (doc, cdt, cdn) {
+		frm.set_query("account", "accounts", function (doc, cdt, cdn) {
 			let d = locals[cdt][cdn];
 			return {
 				filters: {
-					'account_type': 'Payable',
-					'root_type': 'Liability',
-					'company': d.company,
-					"is_group": 0
-				}
-			}
+					account_type: "Payable",
+					root_type: "Liability",
+					company: d.company,
+					is_group: 0,
+				},
+			};
 		});
 
-		frm.set_query('advance_account', 'accounts', function (doc, cdt, cdn) {
+		frm.set_query("advance_account", "accounts", function (doc, cdt, cdn) {
 			let d = locals[cdt][cdn];
 			return {
 				filters: {
-					"account_type": "Payable",
-					"root_type": "Asset",
-					"company": d.company,
-					"is_group": 0
-				}
-			}
+					account_type: "Payable",
+					root_type: "Asset",
+					company: d.company,
+					is_group: 0,
+				},
+			};
 		});
 
-		frm.set_query("default_bank_account", function() {
+		frm.set_query("default_bank_account", function () {
 			return {
 				filters: {
-					"is_company_account":1
-				}
-			}
+					is_company_account: 1,
+				},
+			};
 		});
 
-		frm.set_query("supplier_primary_contact", function(doc) {
+		frm.set_query("supplier_primary_contact", function (doc) {
 			return {
 				query: "erpnext.buying.doctype.supplier.supplier.get_supplier_primary_contact",
 				filters: {
-					"supplier": doc.name
-				}
+					supplier: doc.name,
+				},
 			};
 		});
 
-		frm.set_query("supplier_primary_address", function(doc) {
+		frm.set_query("supplier_primary_address", function (doc) {
 			return {
 				filters: {
-					"link_doctype": "Supplier",
-					"link_name": doc.name
-				}
+					link_doctype: "Supplier",
+					link_name: doc.name,
+				},
 			};
 		});
 
-		frm.set_query("user", "portal_users", function(doc) {
+		frm.set_query("user", "portal_users", function (doc) {
 			return {
 				filters: {
-					"ignore_user_type": true,
-				}
+					ignore_user_type: true,
+				},
 			};
 		});
 	},
@@ -74,65 +74,94 @@
 		}
 
 		if (frm.doc.__islocal) {
-			hide_field(['address_html','contact_html']);
+			hide_field(["address_html", "contact_html"]);
 			frappe.contacts.clear_address_and_contact(frm);
-		}
-		else {
-			unhide_field(['address_html','contact_html']);
+		} else {
+			unhide_field(["address_html", "contact_html"]);
 			frappe.contacts.render_address_and_contact(frm);
 
 			// custom buttons
-			frm.add_custom_button(__('Accounting Ledger'), function () {
-				frappe.set_route('query-report', 'General Ledger',
-					{ party_type: 'Supplier', party: frm.doc.name, party_name: frm.doc.supplier_name });
-			}, __("View"));
+			frm.add_custom_button(
+				__("Accounting Ledger"),
+				function () {
+					frappe.set_route("query-report", "General Ledger", {
+						party_type: "Supplier",
+						party: frm.doc.name,
+						party_name: frm.doc.supplier_name,
+					});
+				},
+				__("View")
+			);
 
-			frm.add_custom_button(__('Accounts Payable'), function () {
-				frappe.set_route('query-report', 'Accounts Payable', { party_type: "Supplier", party: frm.doc.name });
-			}, __("View"));
+			frm.add_custom_button(
+				__("Accounts Payable"),
+				function () {
+					frappe.set_route("query-report", "Accounts Payable", {
+						party_type: "Supplier",
+						party: frm.doc.name,
+					});
+				},
+				__("View")
+			);
 
-			frm.add_custom_button(__('Bank Account'), function () {
-				erpnext.utils.make_bank_account(frm.doc.doctype, frm.doc.name);
-			}, __('Create'));
+			frm.add_custom_button(
+				__("Bank Account"),
+				function () {
+					erpnext.utils.make_bank_account(frm.doc.doctype, frm.doc.name);
+				},
+				__("Create")
+			);
 
-			frm.add_custom_button(__('Pricing Rule'), function () {
-				erpnext.utils.make_pricing_rule(frm.doc.doctype, frm.doc.name);
-			}, __('Create'));
+			frm.add_custom_button(
+				__("Pricing Rule"),
+				function () {
+					erpnext.utils.make_pricing_rule(frm.doc.doctype, frm.doc.name);
+				},
+				__("Create")
+			);
 
-			frm.add_custom_button(__('Get Supplier Group Details'), function () {
-				frm.trigger("get_supplier_group_details");
-			}, __('Actions'));
+			frm.add_custom_button(
+				__("Get Supplier Group Details"),
+				function () {
+					frm.trigger("get_supplier_group_details");
+				},
+				__("Actions")
+			);
 
 			if (cint(frappe.defaults.get_default("enable_common_party_accounting"))) {
-				frm.add_custom_button(__('Link with Customer'), function () {
-					frm.trigger('show_party_link_dialog');
-				}, __('Actions'));
+				frm.add_custom_button(
+					__("Link with Customer"),
+					function () {
+						frm.trigger("show_party_link_dialog");
+					},
+					__("Actions")
+				);
 			}
 
 			// indicators
 			erpnext.utils.set_party_dashboard_indicators(frm);
 		}
 	},
-	get_supplier_group_details: function(frm) {
+	get_supplier_group_details: function (frm) {
 		frappe.call({
 			method: "get_supplier_group_details",
 			doc: frm.doc,
-			callback: function() {
+			callback: function () {
 				frm.refresh();
-			}
+			},
 		});
 	},
 
-	supplier_primary_address: function(frm) {
+	supplier_primary_address: function (frm) {
 		if (frm.doc.supplier_primary_address) {
 			frappe.call({
-				method: 'frappe.contacts.doctype.address.address.get_address_display',
+				method: "frappe.contacts.doctype.address.address.get_address_display",
 				args: {
-					"address_dict": frm.doc.supplier_primary_address
+					address_dict: frm.doc.supplier_primary_address,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					frm.set_value("primary_address", r.message);
-				}
+				},
 			});
 		}
 		if (!frm.doc.supplier_primary_address) {
@@ -140,56 +169,60 @@
 		}
 	},
 
-	supplier_primary_contact: function(frm) {
+	supplier_primary_contact: function (frm) {
 		if (!frm.doc.supplier_primary_contact) {
 			frm.set_value("mobile_no", "");
 			frm.set_value("email_id", "");
 		}
 	},
 
-	is_internal_supplier: function(frm) {
+	is_internal_supplier: function (frm) {
 		if (frm.doc.is_internal_supplier == 1) {
 			frm.toggle_reqd("represents_company", true);
-		}
-		else {
+		} else {
 			frm.toggle_reqd("represents_company", false);
 		}
 	},
-	show_party_link_dialog: function(frm) {
+	show_party_link_dialog: function (frm) {
 		const dialog = new frappe.ui.Dialog({
-			title: __('Select a Customer'),
-			fields: [{
-				fieldtype: 'Link', label: __('Customer'),
-				options: 'Customer', fieldname: 'customer', reqd: 1
-			}],
-			primary_action: function({ customer }) {
+			title: __("Select a Customer"),
+			fields: [
+				{
+					fieldtype: "Link",
+					label: __("Customer"),
+					options: "Customer",
+					fieldname: "customer",
+					reqd: 1,
+				},
+			],
+			primary_action: function ({ customer }) {
 				frappe.call({
-					method: 'erpnext.accounts.doctype.party_link.party_link.create_party_link',
+					method: "erpnext.accounts.doctype.party_link.party_link.create_party_link",
 					args: {
-						primary_role: 'Supplier',
+						primary_role: "Supplier",
 						primary_party: frm.doc.name,
-						secondary_party: customer
+						secondary_party: customer,
 					},
 					freeze: true,
-					callback: function() {
+					callback: function () {
 						dialog.hide();
 						frappe.msgprint({
-							message: __('Successfully linked to Customer'),
-							alert: true
+							message: __("Successfully linked to Customer"),
+							alert: true,
 						});
 					},
-					error: function() {
+					error: function () {
 						dialog.hide();
 						frappe.msgprint({
-							message: __('Linking to Customer Failed. Please try again.'),
-							title: __('Linking Failed'),
-							indicator: 'red'
+							message: __("Linking to Customer Failed. Please try again."),
+							title: __("Linking Failed"),
+							indicator: "red",
 						});
-					}
+					},
 				});
 			},
-			primary_action_label: __('Create Link')
+			primary_action_label: __("Create Link"),
 		});
 		dialog.show();
-	}
+	},
 });
diff --git a/erpnext/buying/doctype/supplier/supplier_list.js b/erpnext/buying/doctype/supplier/supplier_list.js
index c776b00..987c1e0 100644
--- a/erpnext/buying/doctype/supplier/supplier_list.js
+++ b/erpnext/buying/doctype/supplier/supplier_list.js
@@ -1,8 +1,8 @@
-frappe.listview_settings['Supplier'] = {
+frappe.listview_settings["Supplier"] = {
 	add_fields: ["supplier_name", "supplier_group", "image", "on_hold"],
-	get_indicator: function(doc) {
-		if(cint(doc.on_hold)) {
+	get_indicator: function (doc) {
+		if (cint(doc.on_hold)) {
 			return [__("On Hold"), "red"];
 		}
-	}
+	},
 };
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js
index addf5a5..c169871 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js
@@ -2,12 +2,14 @@
 // License: GNU General Public License v3. See license.txt
 
 erpnext.buying.setup_buying_controller();
-erpnext.buying.SupplierQuotationController = class SupplierQuotationController extends erpnext.buying.BuyingController {
+erpnext.buying.SupplierQuotationController = class SupplierQuotationController extends (
+	erpnext.buying.BuyingController
+) {
 	setup() {
 		this.frm.custom_make_buttons = {
-			'Purchase Order': 'Purchase Order',
-			'Quotation': 'Quotation'
-		}
+			"Purchase Order": "Purchase Order",
+			Quotation: "Quotation",
+		};
 
 		super.setup();
 	}
@@ -17,89 +19,90 @@
 		super.refresh();
 
 		if (this.frm.doc.__islocal && !this.frm.doc.valid_till) {
-			this.frm.set_value('valid_till', frappe.datetime.add_months(this.frm.doc.transaction_date, 1));
+			this.frm.set_value("valid_till", frappe.datetime.add_months(this.frm.doc.transaction_date, 1));
 		}
 		if (this.frm.doc.docstatus === 1) {
-			cur_frm.add_custom_button(__("Purchase Order"), this.make_purchase_order,
-				__('Create'));
-			cur_frm.page.set_inner_btn_group_as_primary(__('Create'));
-			cur_frm.add_custom_button(__("Quotation"), this.make_quotation,
-				__('Create'));
-		}
-		else if (this.frm.doc.docstatus===0) {
-
-			this.frm.add_custom_button(__('Material Request'),
-				function() {
+			cur_frm.add_custom_button(__("Purchase Order"), this.make_purchase_order, __("Create"));
+			cur_frm.page.set_inner_btn_group_as_primary(__("Create"));
+			cur_frm.add_custom_button(__("Quotation"), this.make_quotation, __("Create"));
+		} else if (this.frm.doc.docstatus === 0) {
+			this.frm.add_custom_button(
+				__("Material Request"),
+				function () {
 					erpnext.utils.map_current_doc({
 						method: "erpnext.stock.doctype.material_request.material_request.make_supplier_quotation",
 						source_doctype: "Material Request",
 						target: me.frm,
 						setters: {
 							schedule_date: undefined,
-							status: undefined
+							status: undefined,
 						},
 						get_query_filters: {
 							material_request_type: "Purchase",
 							docstatus: 1,
 							status: ["!=", "Stopped"],
 							per_ordered: ["<", 100],
-							company: me.frm.doc.company
-						}
-					})
-				}, __("Get Items From"));
+							company: me.frm.doc.company,
+						},
+					});
+				},
+				__("Get Items From")
+			);
 
 			// Link Material Requests
-			this.frm.add_custom_button(__('Link to Material Requests'),
-				function() {
+			this.frm.add_custom_button(
+				__("Link to Material Requests"),
+				function () {
 					erpnext.buying.link_to_mrs(me.frm);
-				}, __("Tools"));
+				},
+				__("Tools")
+			);
 
-			this.frm.add_custom_button(__("Request for Quotation"),
-			function() {
-				if (!me.frm.doc.supplier) {
-					frappe.throw({message:__("Please select a Supplier"), title:__("Mandatory")})
-				}
-				erpnext.utils.map_current_doc({
-					method: "erpnext.buying.doctype.request_for_quotation.request_for_quotation.make_supplier_quotation_from_rfq",
-					source_doctype: "Request for Quotation",
-					target: me.frm,
-					setters: {
-						transaction_date: null
-					},
-					get_query_filters: {
-						supplier: me.frm.doc.supplier,
-						company: me.frm.doc.company
-					},
-					get_query_method: "erpnext.buying.doctype.request_for_quotation.request_for_quotation.get_rfq_containing_supplier"
-
-				})
-			}, __("Get Items From"));
+			this.frm.add_custom_button(
+				__("Request for Quotation"),
+				function () {
+					if (!me.frm.doc.supplier) {
+						frappe.throw({ message: __("Please select a Supplier"), title: __("Mandatory") });
+					}
+					erpnext.utils.map_current_doc({
+						method: "erpnext.buying.doctype.request_for_quotation.request_for_quotation.make_supplier_quotation_from_rfq",
+						source_doctype: "Request for Quotation",
+						target: me.frm,
+						setters: {
+							transaction_date: null,
+						},
+						get_query_filters: {
+							supplier: me.frm.doc.supplier,
+							company: me.frm.doc.company,
+						},
+						get_query_method:
+							"erpnext.buying.doctype.request_for_quotation.request_for_quotation.get_rfq_containing_supplier",
+					});
+				},
+				__("Get Items From")
+			);
 		}
 	}
 
 	make_purchase_order() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.buying.doctype.supplier_quotation.supplier_quotation.make_purchase_order",
-			frm: cur_frm
-		})
+			frm: cur_frm,
+		});
 	}
 	make_quotation() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.buying.doctype.supplier_quotation.supplier_quotation.make_quotation",
-			frm: cur_frm
-		})
-
+			frm: cur_frm,
+		});
 	}
 };
 
 // for backward compatibility: combine new and previous states
-extend_cscript(cur_frm.cscript, new erpnext.buying.SupplierQuotationController({frm: cur_frm}));
+extend_cscript(cur_frm.cscript, new erpnext.buying.SupplierQuotationController({ frm: cur_frm }));
 
-cur_frm.fields_dict['items'].grid.get_field('project').get_query =
-	function(doc, cdt, cdn) {
-		return{
-			filters:[
-				['Project', 'status', 'not in', 'Completed, Cancelled']
-			]
-		}
-	}
+cur_frm.fields_dict["items"].grid.get_field("project").get_query = function (doc, cdt, cdn) {
+	return {
+		filters: [["Project", "status", "not in", "Completed, Cancelled"]],
+	};
+};
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation_list.js b/erpnext/buying/doctype/supplier_quotation/supplier_quotation_list.js
index 73685ca..99fe24d 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation_list.js
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation_list.js
@@ -1,22 +1,22 @@
-frappe.listview_settings['Supplier Quotation'] = {
+frappe.listview_settings["Supplier Quotation"] = {
 	add_fields: ["supplier", "base_grand_total", "status", "company", "currency"],
-	get_indicator: function(doc) {
-		if(doc.status==="Ordered") {
+	get_indicator: function (doc) {
+		if (doc.status === "Ordered") {
 			return [__("Ordered"), "green", "status,=,Ordered"];
-		} else if(doc.status==="Rejected") {
+		} else if (doc.status === "Rejected") {
 			return [__("Lost"), "gray", "status,=,Lost"];
-		} else if(doc.status==="Expired") {
+		} else if (doc.status === "Expired") {
 			return [__("Expired"), "gray", "status,=,Expired"];
 		}
 	},
 
-	onload: function(listview) {
-		listview.page.add_action_item(__("Purchase Order"), ()=>{
+	onload: function (listview) {
+		listview.page.add_action_item(__("Purchase Order"), () => {
 			erpnext.bulk_transaction_processing.create(listview, "Supplier Quotation", "Purchase Order");
 		});
 
-		listview.page.add_action_item(__("Purchase Invoice"), ()=>{
+		listview.page.add_action_item(__("Purchase Invoice"), () => {
 			erpnext.bulk_transaction_processing.create(listview, "Supplier Quotation", "Purchase Invoice");
 		});
-	}
+	},
 };
diff --git a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.js b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.js
index e9d5678..ca806f8 100644
--- a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.js
+++ b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.js
@@ -2,55 +2,51 @@
 // For license information, please see license.txt
 
 frappe.ui.form.on("Supplier Scorecard", {
-	setup: function(frm) {
-		if (frm.doc.indicator_color !== "")	{
-			frm.set_indicator_formatter("status", function(doc) {
+	setup: function (frm) {
+		if (frm.doc.indicator_color !== "") {
+			frm.set_indicator_formatter("status", function (doc) {
 				return doc.indicator_color.toLowerCase();
 			});
 		}
 	},
-	onload: function(frm) {
-		if (frm.doc.__unsaved == 1)	{
+	onload: function (frm) {
+		if (frm.doc.__unsaved == 1) {
 			loadAllStandings(frm);
 		}
 	},
-	load_criteria: function(frm) {
+	load_criteria: function (frm) {
 		frappe.call({
 			method: "erpnext.buying.doctype.supplier_scorecard_criteria.supplier_scorecard_criteria.get_criteria_list",
-			callback: function(r) {
-				frm.set_value('criteria', []);
-				for (var i = 0; i < r.message.length; i++)
-				{
+			callback: function (r) {
+				frm.set_value("criteria", []);
+				for (var i = 0; i < r.message.length; i++) {
 					var row = frm.add_child("criteria");
 					row.criteria_name = r.message[i].name;
 					frm.script_manager.trigger("criteria_name", row.doctype, row.name);
 				}
 				refresh_field("criteria");
-			}
+			},
 		});
-	}
-
+	},
 });
 
 frappe.ui.form.on("Supplier Scorecard Scoring Standing", {
-
-	standing_name: function(frm, cdt, cdn) {
+	standing_name: function (frm, cdt, cdn) {
 		var d = frappe.get_doc(cdt, cdn);
 		if (d.standing_name) {
 			return frm.call({
 				method: "erpnext.buying.doctype.supplier_scorecard_standing.supplier_scorecard_standing.get_scoring_standing",
 				child: d,
 				args: {
-					standing_name: d.standing_name
-				}
+					standing_name: d.standing_name,
+				},
 			});
 		}
-	}
+	},
 });
 
 frappe.ui.form.on("Supplier Scorecard Scoring Criteria", {
-
-	criteria_name: function(frm, cdt, cdn) {
+	criteria_name: function (frm, cdt, cdn) {
 		var d = frappe.get_doc(cdt, cdn);
 		if (d.criteria_name) {
 			return frm.call({
@@ -58,36 +54,34 @@
 				args: {
 					fieldname: "weight",
 					doctype: "Supplier Scorecard Criteria",
-					filters: {name: d.criteria_name}
+					filters: { name: d.criteria_name },
 				},
-				callback: function(r) {
-					if(r.message){
+				callback: function (r) {
+					if (r.message) {
 						d.weight = r.message.weight;
-						frm.refresh_field('criteria', 'weight');
+						frm.refresh_field("criteria", "weight");
 					}
-				}
+				},
 			});
 		}
-	}
+	},
 });
 
-var loadAllStandings = function(frm) {
+var loadAllStandings = function (frm) {
 	frappe.call({
 		method: "erpnext.buying.doctype.supplier_scorecard_standing.supplier_scorecard_standing.get_standings_list",
-		callback: function(r) {
-			for (var j = 0; j < frm.doc.standings.length; j++)
-			{
-				if(!Object.prototype.hasOwnProperty.call(frm.doc.standings[j], "standing_name")) {
+		callback: function (r) {
+			for (var j = 0; j < frm.doc.standings.length; j++) {
+				if (!Object.prototype.hasOwnProperty.call(frm.doc.standings[j], "standing_name")) {
 					frm.get_field("standings").grid.grid_rows[j].remove();
 				}
 			}
-			for (var i = 0; i < r.message.length; i++)
-			{
+			for (var i = 0; i < r.message.length; i++) {
 				var new_row = frm.add_child("standings");
 				new_row.standing_name = r.message[i].name;
 				frm.script_manager.trigger("standing_name", new_row.doctype, new_row.name);
 			}
 			refresh_field("standings");
-		}
+		},
 	});
 };
diff --git a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard_list.js b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard_list.js
index edf0b04..87f43ab 100644
--- a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard_list.js
+++ b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard_list.js
@@ -1,16 +1,13 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.listview_settings["Supplier Scorecard"] = {
 	add_fields: ["indicator_color", "status"],
-	get_indicator: function(doc) {
-
+	get_indicator: function (doc) {
 		if (doc.indicator_color) {
 			return [__(doc.status), doc.indicator_color.toLowerCase(), "status,=," + doc.status];
 		} else {
 			return [__("Unknown"), "gray", "status,=,''"];
 		}
 	},
-
-}
+};
diff --git a/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.js b/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.js
index 2186cd8..70a0c0b 100644
--- a/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.js
+++ b/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.js
@@ -2,5 +2,5 @@
 // For license information, please see license.txt
 
 frappe.ui.form.on("Supplier Scorecard Criteria", {
-	refresh: function() {}
+	refresh: function () {},
 });
diff --git a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.js b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.js
index 62079cc..3b6f543 100644
--- a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.js
+++ b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.js
@@ -2,12 +2,12 @@
 // For license information, please see license.txt
 
 frappe.ui.form.on("Supplier Scorecard Period", {
-	onload: function(frm) {
+	onload: function (frm) {
 		let criteria_grid = frm.get_field("criteria").grid;
 		criteria_grid.toggle_enable("criteria_name", false);
 		criteria_grid.toggle_enable("weight", false);
 		criteria_grid.toggle_display("max_score", true);
 		criteria_grid.toggle_display("formula", true);
 		criteria_grid.toggle_display("score", true);
-	}
+	},
 });
diff --git a/erpnext/buying/doctype/supplier_scorecard_standing/supplier_scorecard_standing.js b/erpnext/buying/doctype/supplier_scorecard_standing/supplier_scorecard_standing.js
index 22756e7..9bdd670 100644
--- a/erpnext/buying/doctype/supplier_scorecard_standing/supplier_scorecard_standing.js
+++ b/erpnext/buying/doctype/supplier_scorecard_standing/supplier_scorecard_standing.js
@@ -1,9 +1,6 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.ui.form.on("Supplier Scorecard Standing", {
-	refresh: function() {
-
-	}
+	refresh: function () {},
 });
diff --git a/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.js b/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.js
index b3b4321..4423cab 100644
--- a/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.js
+++ b/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.js
@@ -2,7 +2,5 @@
 // For license information, please see license.txt
 
 frappe.ui.form.on("Supplier Scorecard Variable", {
-	refresh: function() {
-
-	}
+	refresh: function () {},
 });
diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.js b/erpnext/buying/report/procurement_tracker/procurement_tracker.js
index 7e4822c..ada528b 100644
--- a/erpnext/buying/report/procurement_tracker/procurement_tracker.js
+++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.js
@@ -1,9 +1,8 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Procurement Tracker"] = {
-	"filters": [
+	filters: [
 		{
 			fieldname: "company",
 			label: __("Company"),
@@ -30,10 +29,10 @@
 			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
 			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
 		},
-	]
-}
+	],
+};
diff --git a/erpnext/buying/report/purchase_analytics/purchase_analytics.js b/erpnext/buying/report/purchase_analytics/purchase_analytics.js
index 250b334..23a1880 100644
--- a/erpnext/buying/report/purchase_analytics/purchase_analytics.js
+++ b/erpnext/buying/report/purchase_analytics/purchase_analytics.js
@@ -1,49 +1,48 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Purchase Analytics"] = {
-	"filters": [
+	filters: [
 		{
 			fieldname: "tree_type",
 			label: __("Tree Type"),
 			fieldtype: "Select",
-			options: ["Supplier Group","Supplier","Item Group","Item"],
+			options: ["Supplier Group", "Supplier", "Item Group", "Item"],
 			default: "Supplier",
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "doc_type",
 			label: __("based_on"),
 			fieldtype: "Select",
-			options: ["Purchase Order","Purchase Receipt","Purchase Invoice"],
+			options: ["Purchase Order", "Purchase Receipt", "Purchase Invoice"],
 			default: "Purchase Invoice",
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "value_quantity",
 			label: __("Value Or Qty"),
 			fieldtype: "Select",
 			options: [
-				{ "value": "Value", "label": __("Value") },
-				{ "value": "Quantity", "label": __("Quantity") },
+				{ value: "Value", label: __("Value") },
+				{ value: "Quantity", label: __("Quantity") },
 			],
 			default: "Value",
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "from_date",
 			label: __("From Date"),
 			fieldtype: "Date",
 			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
 			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "company",
@@ -51,22 +50,21 @@
 			fieldtype: "Link",
 			options: "Company",
 			default: frappe.defaults.get_user_default("Company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "range",
 			label: __("Range"),
 			fieldtype: "Select",
 			options: [
-				{ "value": "Weekly", "label": __("Weekly") },
-				{ "value": "Monthly", "label": __("Monthly") },
-				{ "value": "Quarterly", "label": __("Quarterly") },
-				{ "value": "Yearly", "label": __("Yearly") }
+				{ value: "Weekly", label: __("Weekly") },
+				{ value: "Monthly", label: __("Monthly") },
+				{ value: "Quarterly", label: __("Quarterly") },
+				{ value: "Yearly", label: __("Yearly") },
 			],
 			default: "Monthly",
-			reqd: 1
-		}
-
+			reqd: 1,
+		},
 	],
 	get_datatable_options(options) {
 		return Object.assign(options, {
@@ -75,34 +73,26 @@
 				onCheckRow: function (data) {
 					if (!data) return;
 
-					const data_doctype = $(
-						data[2].html
-					)[0].attributes.getNamedItem("data-doctype").value;
+					const data_doctype = $(data[2].html)[0].attributes.getNamedItem("data-doctype").value;
 					const tree_type = frappe.query_report.filters[0].value;
 					if (data_doctype != tree_type) return;
 
 					let row_name = data[2].content;
 					let length = data.length;
-					let row_values = '';
+					let row_values = "";
 
 					if (tree_type == "Supplier") {
-						row_values = data
-							.slice(4, length - 1)
-							.map(function (column) {
-								return column.content;
-							});
+						row_values = data.slice(4, length - 1).map(function (column) {
+							return column.content;
+						});
 					} else if (tree_type == "Item") {
-						row_values = data
-							.slice(5, length - 1)
-							.map(function (column) {
-								return column.content;
-							});
+						row_values = data.slice(5, length - 1).map(function (column) {
+							return column.content;
+						});
 					} else {
-						row_values = data
-							.slice(3, length - 1)
-							.map(function (column) {
-								return column.content;
-							});
+						row_values = data.slice(3, length - 1).map(function (column) {
+							return column.content;
+						});
 					}
 
 					let entry = {
@@ -113,13 +103,13 @@
 					let raw_data = frappe.query_report.chart.data;
 					let new_datasets = raw_data.datasets;
 
-					let element_found = new_datasets.some((element, index, array)=>{
-						if(element.name == row_name){
-							array.splice(index, 1)
-							return true
+					let element_found = new_datasets.some((element, index, array) => {
+						if (element.name == row_name) {
+							array.splice(index, 1);
+							return true;
 						}
-						return false
-					})
+						return false;
+					});
 
 					if (!element_found) {
 						new_datasets.push(entry);
@@ -128,12 +118,14 @@
 						labels: raw_data.labels,
 						datasets: new_datasets,
 					};
-					const new_options = Object.assign({}, frappe.query_report.chart_options, {data: new_data});
+					const new_options = Object.assign({}, frappe.query_report.chart_options, {
+						data: new_data,
+					});
 					frappe.query_report.render_chart(new_options);
 
 					frappe.query_report.raw_chart_data = new_data;
 				},
 			},
 		});
-	}
-}
+	},
+};
diff --git a/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.js b/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.js
index 3bf4f2b..8575633 100644
--- a/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.js
+++ b/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.js
@@ -1,80 +1,79 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Purchase Order Analysis"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"width": "80",
-			"options": "Company",
-			"reqd": 1,
-			"default": frappe.defaults.get_default("company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_default("company"),
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"width": "80",
-			"reqd": 1,
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			width: "80",
+			reqd: 1,
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"width": "80",
-			"reqd": 1,
-			"default": frappe.datetime.get_today()
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			width: "80",
+			reqd: 1,
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname":"project",
-			"label": __("Project"),
-			"fieldtype": "Link",
-			"width": "80",
-			"options": "Project"
+			fieldname: "project",
+			label: __("Project"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Project",
 		},
 		{
-			"fieldname": "name",
-			"label": __("Purchase Order"),
-			"fieldtype": "Link",
-			"width": "80",
-			"options": "Purchase Order",
-			"get_query": () =>{
+			fieldname: "name",
+			label: __("Purchase Order"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Purchase Order",
+			get_query: () => {
 				return {
-					filters: { "docstatus": 1 }
-				}
-			}
+					filters: { docstatus: 1 },
+				};
+			},
 		},
 		{
-			"fieldname": "status",
-			"label": __("Status"),
-			"fieldtype": "MultiSelectList",
-			"width": "80",
-			get_data: function(txt) {
-				let status = ["To Pay", "To Bill", "To Receive", "To Receive and Bill", "Completed"]
-				let options = []
-				for (let option of status){
+			fieldname: "status",
+			label: __("Status"),
+			fieldtype: "MultiSelectList",
+			width: "80",
+			get_data: function (txt) {
+				let status = ["To Pay", "To Bill", "To Receive", "To Receive and Bill", "Completed"];
+				let options = [];
+				for (let option of status) {
 					options.push({
-						"value": option,
-						"label": __(option),
-						"description": ""
-					})
+						value: option,
+						label: __(option),
+						description: "",
+					});
 				}
-				return options
-			}
+				return options;
+			},
 		},
 		{
-			"fieldname": "group_by_po",
-			"label": __("Group by Purchase Order"),
-			"fieldtype": "Check",
-			"default": 0
-		}
+			fieldname: "group_by_po",
+			label: __("Group by Purchase Order"),
+			fieldtype: "Check",
+			default: 0,
+		},
 	],
 
-	"formatter": function (value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 		let format_fields = ["received_qty", "billed_amount"];
 
@@ -82,5 +81,5 @@
 			value = "<span style='color:green'>" + value + "</span>";
 		}
 		return value;
-	}
+	},
 };
diff --git a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.js b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.js
index 90919dc..366fff1 100644
--- a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.js
+++ b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.js
@@ -1,8 +1,8 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.require("assets/erpnext/js/purchase_trends_filters.js", function() {
+frappe.require("assets/erpnext/js/purchase_trends_filters.js", function () {
 	frappe.query_reports["Purchase Order Trends"] = {
-		filters: erpnext.get_purchase_trends_filters()
-	}
+		filters: erpnext.get_purchase_trends_filters(),
+	};
 });
diff --git a/erpnext/buying/report/requested_items_to_order_and_receive/requested_items_to_order_and_receive.js b/erpnext/buying/report/requested_items_to_order_and_receive/requested_items_to_order_and_receive.js
index cb05109..039ac2c 100644
--- a/erpnext/buying/report/requested_items_to_order_and_receive/requested_items_to_order_and_receive.js
+++ b/erpnext/buying/report/requested_items_to_order_and_receive/requested_items_to_order_and_receive.js
@@ -1,76 +1,75 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Requested Items to Order and Receive"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"width": "80",
-			"options": "Company",
-			"reqd": 1,
-			"default": frappe.defaults.get_default("company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_default("company"),
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"width": "80",
-			"reqd": 1,
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			width: "80",
+			reqd: 1,
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"width": "80",
-			"reqd": 1,
-			"default": frappe.datetime.get_today()
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			width: "80",
+			reqd: 1,
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname": "material_request",
-			"label": __("Material Request"),
-			"fieldtype": "Link",
-			"width": "80",
-			"options": "Material Request",
-			"get_query": () => {
+			fieldname: "material_request",
+			label: __("Material Request"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Material Request",
+			get_query: () => {
 				return {
 					filters: {
-						"docstatus": 1,
-						"material_request_type": "Purchase",
-						"per_received": ["<", 100]
-					}
-				}
-			}
+						docstatus: 1,
+						material_request_type: "Purchase",
+						per_received: ["<", 100],
+					},
+				};
+			},
 		},
 		{
-			"fieldname": "item_code",
-			"label": __("Item"),
-			"fieldtype": "Link",
-			"width": "80",
-			"options": "Item",
-			"get_query": () => {
+			fieldname: "item_code",
+			label: __("Item"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Item",
+			get_query: () => {
 				return {
-					query: "erpnext.controllers.queries.item_query"
-				}
-			}
+					query: "erpnext.controllers.queries.item_query",
+				};
+			},
 		},
 		{
-			"fieldname": "group_by_mr",
-			"label": __("Group by Material Request"),
-			"fieldtype": "Check",
-			"default": 0
-		}
+			fieldname: "group_by_mr",
+			label: __("Group by Material Request"),
+			fieldtype: "Check",
+			default: 0,
+		},
 	],
 
-	"formatter": function (value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 
 		if (column.fieldname == "ordered_qty" && data && data.ordered_qty > 0) {
 			value = "<span style='color:green'>" + value + "</span>";
 		}
 		return value;
-	}
+	},
 };
diff --git a/erpnext/buying/report/subcontract_order_summary/subcontract_order_summary.js b/erpnext/buying/report/subcontract_order_summary/subcontract_order_summary.js
index 800b8ab..8606fae 100644
--- a/erpnext/buying/report/subcontract_order_summary/subcontract_order_summary.js
+++ b/erpnext/buying/report/subcontract_order_summary/subcontract_order_summary.js
@@ -1,42 +1,41 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Subcontract Order Summary"] = {
-	"filters": [
+	filters: [
 		{
 			label: __("Company"),
 			fieldname: "company",
 			fieldtype: "Link",
 			options: "Company",
 			default: frappe.defaults.get_user_default("Company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			label: __("From Date"),
 			fieldname: "from_date",
 			fieldtype: "Date",
 			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			label: __("To Date"),
 			fieldname: "to_date",
 			fieldtype: "Date",
 			default: frappe.datetime.get_today(),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			label: __("Order Type"),
 			fieldname: "order_type",
 			fieldtype: "Select",
 			options: ["Purchase Order", "Subcontracting Order"],
-			default: "Subcontracting Order"
+			default: "Subcontracting Order",
 		},
 		{
 			label: __("Subcontract Order"),
 			fieldname: "name",
-			fieldtype: "Data"
-		}
-	]
-};
\ No newline at end of file
+			fieldtype: "Data",
+		},
+	],
+};
diff --git a/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.js b/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.js
index 35be2a9..f20d249 100644
--- a/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.js
+++ b/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.js
@@ -1,36 +1,35 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Subcontracted Item To Be Received"] = {
-	"filters": [
+	filters: [
 		{
 			label: __("Order Type"),
 			fieldname: "order_type",
 			fieldtype: "Select",
 			options: ["Purchase Order", "Subcontracting Order"],
-			default: "Subcontracting Order"
+			default: "Subcontracting Order",
 		},
 		{
 			fieldname: "supplier",
 			label: __("Supplier"),
 			fieldtype: "Link",
 			options: "Supplier",
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"from_date",
+			fieldname: "from_date",
 			label: __("From Date"),
 			fieldtype: "Date",
 			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
 			default: frappe.datetime.get_today(),
-			reqd: 1
+			reqd: 1,
 		},
-	]
+	],
 };
diff --git a/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.js b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.js
index 33b26dc..999fae5 100644
--- a/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.js
+++ b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.js
@@ -1,36 +1,35 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Subcontracted Raw Materials To Be Transferred"] = {
-	"filters": [
+	filters: [
 		{
 			label: __("Order Type"),
 			fieldname: "order_type",
 			fieldtype: "Select",
 			options: ["Purchase Order", "Subcontracting Order"],
-			default: "Subcontracting Order"
+			default: "Subcontracting Order",
 		},
 		{
 			fieldname: "supplier",
 			label: __("Supplier"),
 			fieldtype: "Link",
 			options: "Supplier",
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"from_date",
+			fieldname: "from_date",
 			label: __("From Date"),
 			fieldtype: "Date",
 			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
 			default: frappe.datetime.get_today(),
-			reqd: 1
+			reqd: 1,
 		},
-	]
-}
+	],
+};
diff --git a/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.js b/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.js
index 579c0a6..c109abd 100644
--- a/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.js
+++ b/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.js
@@ -9,23 +9,23 @@
 			options: "Company",
 			fieldname: "company",
 			default: frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			reqd: 1,
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"width": "80",
-			"reqd": 1,
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			width: "80",
+			reqd: 1,
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"width": "80",
-			"reqd": 1,
-			"default": frappe.datetime.get_today()
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			width: "80",
+			reqd: 1,
+			default: frappe.datetime.get_today(),
 		},
 		{
 			default: "",
@@ -34,34 +34,34 @@
 			fieldname: "item_code",
 			fieldtype: "Link",
 			get_query: () => {
-				let quote = frappe.query_report.get_filter_value('supplier_quotation');
+				let quote = frappe.query_report.get_filter_value("supplier_quotation");
 				if (quote != "") {
 					return {
 						query: "erpnext.stock.doctype.quality_inspection.quality_inspection.item_query",
 						filters: {
-							"from": "Supplier Quotation Item",
-							"parent": quote
-						}
-					}
+							from: "Supplier Quotation Item",
+							parent: quote,
+						},
+					};
 				}
-			}
+			},
 		},
 		{
 			fieldname: "supplier",
 			label: __("Supplier"),
 			fieldtype: "MultiSelectList",
-			get_data: function(txt) {
-				return frappe.db.get_link_options('Supplier', txt);
-			}
+			get_data: function (txt) {
+				return frappe.db.get_link_options("Supplier", txt);
+			},
 		},
 		{
 			fieldtype: "MultiSelectList",
 			label: __("Supplier Quotation"),
 			fieldname: "supplier_quotation",
 			default: "",
-			get_data: function(txt) {
-				return frappe.db.get_link_options('Supplier Quotation', txt, {'docstatus': ["<", 2]});
-			}
+			get_data: function (txt) {
+				return frappe.db.get_link_options("Supplier Quotation", txt, { docstatus: ["<", 2] });
+			},
 		},
 		{
 			fieldtype: "Link",
@@ -70,37 +70,36 @@
 			fieldname: "request_for_quotation",
 			default: "",
 			get_query: () => {
-				return { filters: { "docstatus": ["<", 2] } }
-			}
+				return { filters: { docstatus: ["<", 2] } };
+			},
 		},
 		{
-			"fieldname":"group_by",
-			"label": __("Group by"),
-			"fieldtype": "Select",
-			"options": [__("Group by Supplier"), __("Group by Item")],
-			"default": __("Group by Supplier")
+			fieldname: "group_by",
+			label: __("Group by"),
+			fieldtype: "Select",
+			options: [__("Group by Supplier"), __("Group by Item")],
+			default: __("Group by Supplier"),
 		},
 		{
 			fieldtype: "Check",
 			label: __("Include Expired"),
 			fieldname: "include_expired",
-			default: 0
-		}
+			default: 0,
+		},
 	],
 
 	formatter: (value, row, column, data, default_formatter) => {
 		value = default_formatter(value, row, column, data);
 
-		if(column.fieldname === "valid_till" && data.valid_till){
-			if(frappe.datetime.get_diff(data.valid_till, frappe.datetime.nowdate()) <= 1){
+		if (column.fieldname === "valid_till" && data.valid_till) {
+			if (frappe.datetime.get_diff(data.valid_till, frappe.datetime.nowdate()) <= 1) {
 				value = `<div style="color:red">${value}</div>`;
-			}
-			else if (frappe.datetime.get_diff(data.valid_till, frappe.datetime.nowdate()) <= 7){
+			} else if (frappe.datetime.get_diff(data.valid_till, frappe.datetime.nowdate()) <= 7) {
 				value = `<div style="color:darkorange">${value}</div>`;
 			}
 		}
 
-		if(column.fieldname === "price_per_unit" && data.price_per_unit && data.min && data.min === 1){
+		if (column.fieldname === "price_per_unit" && data.price_per_unit && data.min && data.min === 1) {
 			value = `<div style="color:green">${value}</div>`;
 		}
 		return value;
@@ -108,48 +107,53 @@
 
 	onload: (report) => {
 		// Create a button for setting the default supplier
-		report.page.add_inner_button(__("Select Default Supplier"), () => {
-			let reporter = frappe.query_reports["Supplier Quotation Comparison"];
+		report.page.add_inner_button(
+			__("Select Default Supplier"),
+			() => {
+				let reporter = frappe.query_reports["Supplier Quotation Comparison"];
 
-			//Always make a new one so that the latest values get updated
-			reporter.make_default_supplier_dialog(report);
-		}, __("Tools"));
-
+				//Always make a new one so that the latest values get updated
+				reporter.make_default_supplier_dialog(report);
+			},
+			__("Tools")
+		);
 	},
 	make_default_supplier_dialog: (report) => {
 		// Get the name of the item to change
-		if(!report.data) return;
+		if (!report.data) return;
 
 		let filters = report.get_values();
 		let item_code = filters.item_code;
 
 		// Get a list of the suppliers (with a blank as well) for the user to select
-		let suppliers = $.map(report.data, (row, idx)=>{ return row.supplier_name })
+		let suppliers = $.map(report.data, (row, idx) => {
+			return row.supplier_name;
+		});
 
 		// Create a dialog window for the user to pick their supplier
 		let dialog = new frappe.ui.Dialog({
-			title: __('Select Default Supplier'),
+			title: __("Select Default Supplier"),
 			fields: [
 				{
 					reqd: 1,
-					label: 'Supplier',
-					fieldtype: 'Link',
-					options: 'Supplier',
-					fieldname: 'supplier',
+					label: "Supplier",
+					fieldtype: "Link",
+					options: "Supplier",
+					fieldname: "supplier",
 					get_query: () => {
 						return {
 							filters: {
-								'name': ['in', suppliers]
-							}
-						}
-					}
-				}
-			]
+								name: ["in", suppliers],
+							},
+						};
+					},
+				},
+			],
 		});
 
 		dialog.set_primary_action(__("Set Default Supplier"), () => {
 			let values = dialog.get_values();
-			if(values) {
+			if (values) {
 				// Set the default_supplier field of the appropriate Item to the selected supplier
 				frappe.call({
 					method: "frappe.client.set_value",
@@ -163,10 +167,10 @@
 					callback: (r) => {
 						frappe.msgprint(__("Successfully Set Supplier"));
 						dialog.hide();
-					}
+					},
 				});
 			}
 		});
 		dialog.show();
-	}
-}
+	},
+};
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index a3db196..c543dfc 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -1864,7 +1864,7 @@
 				(ple.against_voucher_type == self.doctype)
 				& (ple.against_voucher_no == self.name)
 				& (ple.party == party)
-				& (ple.docstatus == 1)
+				& (ple.delinked == 0)
 				& (ple.company == self.company)
 			)
 			.run(as_dict=True)
@@ -1880,7 +1880,10 @@
 				advance_paid, precision=self.precision("advance_paid"), currency=advance.account_currency
 			)
 
-			frappe.db.set_value(self.doctype, self.name, "party_account_currency", advance.account_currency)
+			if advance.account_currency:
+				frappe.db.set_value(
+					self.doctype, self.name, "party_account_currency", advance.account_currency
+				)
 
 			if advance.account_currency == self.currency:
 				order_total = self.get("rounded_total") or self.grand_total
diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py
index a477a0d..0d64188 100644
--- a/erpnext/controllers/queries.py
+++ b/erpnext/controllers/queries.py
@@ -352,7 +352,9 @@
 	ifelse = CustomFunction("IF", ["condition", "then", "else"])
 
 	if filters and filters.get("customer"):
-		qb_filter_and_conditions.append(proj.customer == filters.get("customer"))
+		qb_filter_and_conditions.append(
+			(proj.customer == filters.get("customer")) | proj.customer.isnull() | proj.customer == ""
+		)
 
 	qb_filter_and_conditions.append(proj.status.notin(["Completed", "Cancelled"]))
 
diff --git a/erpnext/crm/doctype/appointment/appointment.js b/erpnext/crm/doctype/appointment/appointment.js
index ca38121..54aa9a6 100644
--- a/erpnext/crm/doctype/appointment/appointment.js
+++ b/erpnext/crm/doctype/appointment/appointment.js
@@ -1,26 +1,26 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Appointment', {
-	refresh: function(frm) {
-		if(frm.doc.lead){
-			frm.add_custom_button(frm.doc.lead,()=>{
+frappe.ui.form.on("Appointment", {
+	refresh: function (frm) {
+		if (frm.doc.lead) {
+			frm.add_custom_button(frm.doc.lead, () => {
 				frappe.set_route("Form", "Lead", frm.doc.lead);
 			});
 		}
-		if(frm.doc.calendar_event){
-			frm.add_custom_button(__(frm.doc.calendar_event),()=>{
+		if (frm.doc.calendar_event) {
+			frm.add_custom_button(__(frm.doc.calendar_event), () => {
 				frappe.set_route("Form", "Event", frm.doc.calendar_event);
 			});
 		}
 	},
-	onload: function(frm){
-		frm.set_query("appointment_with", function(){
+	onload: function (frm) {
+		frm.set_query("appointment_with", function () {
 			return {
-				filters : {
-					"name": ["in", ["Customer", "Lead"]]
-				}
+				filters: {
+					name: ["in", ["Customer", "Lead"]],
+				},
 			};
 		});
-	}
+	},
 });
diff --git a/erpnext/crm/doctype/appointment_booking_settings/appointment_booking_settings.js b/erpnext/crm/doctype/appointment_booking_settings/appointment_booking_settings.js
index 0c64eb8..255e665 100644
--- a/erpnext/crm/doctype/appointment_booking_settings/appointment_booking_settings.js
+++ b/erpnext/crm/doctype/appointment_booking_settings/appointment_booking_settings.js
@@ -1,10 +1,14 @@
-frappe.ui.form.on('Appointment Booking Settings', 'validate',check_times);
+frappe.ui.form.on("Appointment Booking Settings", "validate", check_times);
 function check_times(frm) {
 	$.each(frm.doc.availability_of_slots || [], function (i, d) {
-		let from_time = Date.parse('01/01/2019 ' + d.from_time);
-		let to_time = Date.parse('01/01/2019 ' + d.to_time);
+		let from_time = Date.parse("01/01/2019 " + d.from_time);
+		let to_time = Date.parse("01/01/2019 " + d.to_time);
 		if (from_time > to_time) {
-			frappe.throw(__('In row {0} of Appointment Booking Slots: "To Time" must be later than "From Time".', [i + 1]));
+			frappe.throw(
+				__('In row {0} of Appointment Booking Slots: "To Time" must be later than "From Time".', [
+					i + 1,
+				])
+			);
 		}
 	});
 }
diff --git a/erpnext/crm/doctype/campaign/campaign.js b/erpnext/crm/doctype/campaign/campaign.js
index cac45c6..9e4a0a9 100644
--- a/erpnext/crm/doctype/campaign/campaign.js
+++ b/erpnext/crm/doctype/campaign/campaign.js
@@ -1,17 +1,25 @@
 // Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Campaign', {
-	refresh: function(frm) {
+frappe.ui.form.on("Campaign", {
+	refresh: function (frm) {
 		erpnext.toggle_naming_series();
 
 		if (frm.is_new()) {
-			frm.toggle_display("naming_series", frappe.boot.sysdefaults.campaign_naming_by=="Naming Series");
+			frm.toggle_display(
+				"naming_series",
+				frappe.boot.sysdefaults.campaign_naming_by == "Naming Series"
+			);
 		} else {
-			cur_frm.add_custom_button(__("View Leads"), function() {
-				frappe.route_options = {"source": "Campaign", "campaign_name": frm.doc.name};
-				frappe.set_route("List", "Lead");
-			}, "fa fa-list", true);
+			cur_frm.add_custom_button(
+				__("View Leads"),
+				function () {
+					frappe.route_options = { source: "Campaign", campaign_name: frm.doc.name };
+					frappe.set_route("List", "Lead");
+				},
+				"fa fa-list",
+				true
+			);
 		}
-	}
+	},
 });
diff --git a/erpnext/crm/doctype/competitor/competitor.js b/erpnext/crm/doctype/competitor/competitor.js
index a5b617d..abd5934 100644
--- a/erpnext/crm/doctype/competitor/competitor.js
+++ b/erpnext/crm/doctype/competitor/competitor.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Competitor', {
+frappe.ui.form.on("Competitor", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/crm/doctype/contract/contract.js b/erpnext/crm/doctype/contract/contract.js
index 7848de7..8d44c22 100644
--- a/erpnext/crm/doctype/contract/contract.js
+++ b/erpnext/crm/doctype/contract/contract.js
@@ -5,12 +5,12 @@
 	contract_template: function (frm) {
 		if (frm.doc.contract_template) {
 			frappe.call({
-				method: 'erpnext.crm.doctype.contract_template.contract_template.get_contract_template',
+				method: "erpnext.crm.doctype.contract_template.contract_template.get_contract_template",
 				args: {
 					template_name: frm.doc.contract_template,
-					doc: frm.doc
+					doc: frm.doc,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (r && r.message) {
 						let contract_template = r.message.contract_template;
 						frm.set_value("contract_terms", r.message.contract_terms);
@@ -18,15 +18,15 @@
 
 						if (frm.doc.requires_fulfilment) {
 							// Populate the fulfilment terms table from a contract template, if any
-							r.message.contract_template.fulfilment_terms.forEach(element => {
+							r.message.contract_template.fulfilment_terms.forEach((element) => {
 								let d = frm.add_child("fulfilment_terms");
 								d.requirement = element.requirement;
 							});
 							frm.refresh_field("fulfilment_terms");
 						}
 					}
-				}
+				},
 			});
 		}
-	}
+	},
 });
diff --git a/erpnext/crm/doctype/contract/contract_list.js b/erpnext/crm/doctype/contract/contract_list.js
index 7d56096..e1f8c22 100644
--- a/erpnext/crm/doctype/contract/contract_list.js
+++ b/erpnext/crm/doctype/contract/contract_list.js
@@ -1,4 +1,4 @@
-frappe.listview_settings['Contract'] = {
+frappe.listview_settings["Contract"] = {
 	add_fields: ["status"],
 	get_indicator: function (doc) {
 		if (doc.status == "Unsigned") {
diff --git a/erpnext/crm/doctype/contract_fulfilment_checklist/contract_fulfilment_checklist.js b/erpnext/crm/doctype/contract_fulfilment_checklist/contract_fulfilment_checklist.js
index f0525b1..bdc3fcc 100644
--- a/erpnext/crm/doctype/contract_fulfilment_checklist/contract_fulfilment_checklist.js
+++ b/erpnext/crm/doctype/contract_fulfilment_checklist/contract_fulfilment_checklist.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Contract Fulfilment Checklist', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Contract Fulfilment Checklist", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/crm/doctype/contract_template/contract_template.js b/erpnext/crm/doctype/contract_template/contract_template.js
index 4f7c9a8..5044bbe 100644
--- a/erpnext/crm/doctype/contract_template/contract_template.js
+++ b/erpnext/crm/doctype/contract_template/contract_template.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Contract Template', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Contract Template", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/crm/doctype/crm_settings/crm_settings.js b/erpnext/crm/doctype/crm_settings/crm_settings.js
index c6569d8..0fb695a 100644
--- a/erpnext/crm/doctype/crm_settings/crm_settings.js
+++ b/erpnext/crm/doctype/crm_settings/crm_settings.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('CRM Settings', {
+frappe.ui.form.on("CRM Settings", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/crm/doctype/email_campaign/email_campaign.js b/erpnext/crm/doctype/email_campaign/email_campaign.js
index b0e9353..7b090a0 100644
--- a/erpnext/crm/doctype/email_campaign/email_campaign.js
+++ b/erpnext/crm/doctype/email_campaign/email_campaign.js
@@ -1,8 +1,8 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Email Campaign', {
-	email_campaign_for: function(frm) {
-		frm.set_value('recipient', '');
-	}
+frappe.ui.form.on("Email Campaign", {
+	email_campaign_for: function (frm) {
+		frm.set_value("recipient", "");
+	},
 });
diff --git a/erpnext/crm/doctype/email_campaign/email_campaign_list.js b/erpnext/crm/doctype/email_campaign/email_campaign_list.js
index adc399d..3020921 100644
--- a/erpnext/crm/doctype/email_campaign/email_campaign_list.js
+++ b/erpnext/crm/doctype/email_campaign/email_campaign_list.js
@@ -1,11 +1,11 @@
-frappe.listview_settings['Email Campaign'] = {
-	get_indicator: function(doc) {
+frappe.listview_settings["Email Campaign"] = {
+	get_indicator: function (doc) {
 		var colors = {
-			"Unsubscribed": "red",
-			"Scheduled": "blue",
+			Unsubscribed: "red",
+			Scheduled: "blue",
 			"In Progress": "orange",
-			"Completed": "green"
+			Completed: "green",
 		};
 		return [__(doc.status), colors[doc.status], "status,=," + doc.status];
-	}
+	},
 };
diff --git a/erpnext/crm/doctype/lead/lead.js b/erpnext/crm/doctype/lead/lead.js
index b1799ce..0b6cdf2 100644
--- a/erpnext/crm/doctype/lead/lead.js
+++ b/erpnext/crm/doctype/lead/lead.js
@@ -5,41 +5,45 @@
 cur_frm.email_field = "email_id";
 
 erpnext.LeadController = class LeadController extends frappe.ui.form.Controller {
-	setup () {
+	setup() {
 		this.frm.make_methods = {
-			'Customer': this.make_customer,
-			'Quotation': this.make_quotation,
-			'Opportunity': this.make_opportunity
+			Customer: this.make_customer,
+			Quotation: this.make_quotation,
+			Opportunity: this.make_opportunity,
 		};
 
 		// For avoiding integration issues.
-		this.frm.set_df_property('first_name', 'reqd', true);
+		this.frm.set_df_property("first_name", "reqd", true);
 	}
 
-	onload () {
+	onload() {
 		this.frm.set_query("customer", function (doc, cdt, cdn) {
-			return { query: "erpnext.controllers.queries.customer_query" }
+			return { query: "erpnext.controllers.queries.customer_query" };
 		});
 
 		this.frm.set_query("lead_owner", function (doc, cdt, cdn) {
-			return { query: "frappe.core.doctype.user.user.user_query" }
+			return { query: "frappe.core.doctype.user.user.user_query" };
 		});
 	}
 
-	refresh () {
+	refresh() {
 		var me = this;
 		let doc = this.frm.doc;
 		erpnext.toggle_naming_series();
 
 		if (!this.frm.is_new() && doc.__onload && !doc.__onload.is_customer) {
 			this.frm.add_custom_button(__("Customer"), this.make_customer, __("Create"));
-			this.frm.add_custom_button(__("Opportunity"), function() {
-				me.frm.trigger("make_opportunity");
-			}, __("Create"));
+			this.frm.add_custom_button(
+				__("Opportunity"),
+				function () {
+					me.frm.trigger("make_opportunity");
+				},
+				__("Create")
+			);
 			this.frm.add_custom_button(__("Quotation"), this.make_quotation, __("Create"));
 			if (!doc.__onload.linked_prospects.length) {
 				this.frm.add_custom_button(__("Prospect"), this.make_prospect, __("Create"));
-				this.frm.add_custom_button(__('Add to Prospect'), this.add_lead_to_prospect, __('Action'));
+				this.frm.add_custom_button(__("Add to Prospect"), this.add_lead_to_prospect, __("Action"));
 			}
 		}
 
@@ -53,51 +57,55 @@
 		this.show_activities();
 	}
 
-	add_lead_to_prospect () {
+	add_lead_to_prospect() {
 		let me = this;
-		frappe.prompt([
-			{
-				fieldname: 'prospect',
-				label: __('Prospect'),
-				fieldtype: 'Link',
-				options: 'Prospect',
-				reqd: 1
-			}
-		],
-		function(data) {
-			frappe.call({
-				method: 'erpnext.crm.doctype.lead.lead.add_lead_to_prospect',
-				args: {
-					'lead': me.frm.doc.name,
-					'prospect': data.prospect
+		frappe.prompt(
+			[
+				{
+					fieldname: "prospect",
+					label: __("Prospect"),
+					fieldtype: "Link",
+					options: "Prospect",
+					reqd: 1,
 				},
-				callback: function(r) {
-					if (!r.exc) {
-						me.frm.reload_doc();
-					}
-				},
-				freeze: true,
-				freeze_message: __('Adding Lead to Prospect...')
-			});
-		}, __('Add Lead to Prospect'), __('Add'));
+			],
+			function (data) {
+				frappe.call({
+					method: "erpnext.crm.doctype.lead.lead.add_lead_to_prospect",
+					args: {
+						lead: me.frm.doc.name,
+						prospect: data.prospect,
+					},
+					callback: function (r) {
+						if (!r.exc) {
+							me.frm.reload_doc();
+						}
+					},
+					freeze: true,
+					freeze_message: __("Adding Lead to Prospect..."),
+				});
+			},
+			__("Add Lead to Prospect"),
+			__("Add")
+		);
 	}
 
-	make_customer () {
+	make_customer() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.crm.doctype.lead.lead.make_customer",
-			frm: cur_frm
-		})
+			frm: cur_frm,
+		});
 	}
 
-	make_quotation () {
+	make_quotation() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.crm.doctype.lead.lead.make_quotation",
-			frm: cur_frm
-		})
+			frm: cur_frm,
+		});
 	}
 
-	make_prospect () {
-		frappe.model.with_doctype("Prospect", function() {
+	make_prospect() {
+		frappe.model.with_doctype("Prospect", function () {
 			let prospect = frappe.model.get_new_doc("Prospect");
 			prospect.company_name = cur_frm.doc.company_name;
 			prospect.no_of_employees = cur_frm.doc.no_of_employees;
@@ -109,14 +117,14 @@
 			prospect.prospect_owner = cur_frm.doc.lead_owner;
 			prospect.notes = cur_frm.doc.notes;
 
-			let leads_row = frappe.model.add_child(prospect, 'leads');
+			let leads_row = frappe.model.add_child(prospect, "leads");
 			leads_row.lead = cur_frm.doc.name;
 
 			frappe.set_route("Form", "Prospect", prospect.name);
 		});
 	}
 
-	company_name () {
+	company_name() {
 		if (!this.frm.doc.lead_name) {
 			this.frm.set_value("lead_name", this.frm.doc.company_name);
 		}
@@ -145,86 +153,91 @@
 	}
 };
 
-
 extend_cscript(cur_frm.cscript, new erpnext.LeadController({ frm: cur_frm }));
 
 frappe.ui.form.on("Lead", {
-	make_opportunity: async function(frm) {
-		let existing_prospect = (await frappe.db.get_value("Prospect Lead",
-			{
-				"lead": frm.doc.name
-			},
-			"name", null, "Prospect"
-		)).message.name;
+	make_opportunity: async function (frm) {
+		let existing_prospect = (
+			await frappe.db.get_value(
+				"Prospect Lead",
+				{
+					lead: frm.doc.name,
+				},
+				"name",
+				null,
+				"Prospect"
+			)
+		).message.name;
 
 		if (!existing_prospect) {
 			var fields = [
 				{
-					"label": "Create Prospect",
-					"fieldname": "create_prospect",
-					"fieldtype": "Check",
-					"default": 1
+					label: "Create Prospect",
+					fieldname: "create_prospect",
+					fieldtype: "Check",
+					default: 1,
 				},
 				{
-					"label": "Prospect Name",
-					"fieldname": "prospect_name",
-					"fieldtype": "Data",
-					"default": frm.doc.company_name,
-					"depends_on": "create_prospect"
-				}
+					label: "Prospect Name",
+					fieldname: "prospect_name",
+					fieldtype: "Data",
+					default: frm.doc.company_name,
+					depends_on: "create_prospect",
+				},
 			];
 		}
-		let existing_contact = (await frappe.db.get_value("Contact",
-			{
-				"first_name": frm.doc.first_name || frm.doc.lead_name,
-				"last_name": frm.doc.last_name
-			},
-			"name"
-		)).message.name;
+		let existing_contact = (
+			await frappe.db.get_value(
+				"Contact",
+				{
+					first_name: frm.doc.first_name || frm.doc.lead_name,
+					last_name: frm.doc.last_name,
+				},
+				"name"
+			)
+		).message.name;
 
 		if (!existing_contact) {
-			fields.push(
-				{
-					"label": "Create Contact",
-					"fieldname": "create_contact",
-					"fieldtype": "Check",
-					"default": "1"
-				}
-			);
+			fields.push({
+				label: "Create Contact",
+				fieldname: "create_contact",
+				fieldtype: "Check",
+				default: "1",
+			});
 		}
 
 		if (fields) {
 			var d = new frappe.ui.Dialog({
-				title: __('Create Opportunity'),
+				title: __("Create Opportunity"),
 				fields: fields,
-				primary_action: function() {
+				primary_action: function () {
 					var data = d.get_values();
 					frappe.call({
-						method: 'create_prospect_and_contact',
+						method: "create_prospect_and_contact",
 						doc: frm.doc,
 						args: {
 							data: data,
 						},
 						freeze: true,
-						callback: function(r) {
+						callback: function (r) {
 							if (!r.exc) {
 								frappe.model.open_mapped_doc({
 									method: "erpnext.crm.doctype.lead.lead.make_opportunity",
-									frm: frm
+									frm: frm,
 								});
 							}
 							d.hide();
-						}
+						},
 					});
 				},
-				primary_action_label: __('Create')
+				primary_action_label: __("Create"),
 			});
 			d.show();
 		} else {
 			frappe.model.open_mapped_doc({
 				method: "erpnext.crm.doctype.lead.lead.make_opportunity",
-				frm: frm
+				frm: frm,
 			});
 		}
-	}
-});
\ No newline at end of file
+	},
+});
diff --git a/erpnext/crm/doctype/lead/lead_list.js b/erpnext/crm/doctype/lead/lead_list.js
index dbeaf60..9741525 100644
--- a/erpnext/crm/doctype/lead/lead_list.js
+++ b/erpnext/crm/doctype/lead/lead_list.js
@@ -1,28 +1,42 @@
-frappe.listview_settings['Lead'] = {
-	onload: function(listview) {
+frappe.listview_settings["Lead"] = {
+	onload: function (listview) {
 		if (frappe.boot.user.can_create.includes("Prospect")) {
-			listview.page.add_action_item(__("Create Prospect"), function() {
-				frappe.model.with_doctype("Prospect", function() {
+			listview.page.add_action_item(__("Create Prospect"), function () {
+				frappe.model.with_doctype("Prospect", function () {
 					let prospect = frappe.model.get_new_doc("Prospect");
 					let leads = listview.get_checked_items();
-					frappe.db.get_value("Lead", leads[0].name, ["company_name", "no_of_employees", "industry", "market_segment", "territory", "fax", "website", "lead_owner"], (r) => {
-						prospect.company_name = r.company_name;
-						prospect.no_of_employees = r.no_of_employees;
-						prospect.industry = r.industry;
-						prospect.market_segment = r.market_segment;
-						prospect.territory = r.territory;
-						prospect.fax = r.fax;
-						prospect.website = r.website;
-						prospect.prospect_owner = r.lead_owner;
+					frappe.db.get_value(
+						"Lead",
+						leads[0].name,
+						[
+							"company_name",
+							"no_of_employees",
+							"industry",
+							"market_segment",
+							"territory",
+							"fax",
+							"website",
+							"lead_owner",
+						],
+						(r) => {
+							prospect.company_name = r.company_name;
+							prospect.no_of_employees = r.no_of_employees;
+							prospect.industry = r.industry;
+							prospect.market_segment = r.market_segment;
+							prospect.territory = r.territory;
+							prospect.fax = r.fax;
+							prospect.website = r.website;
+							prospect.prospect_owner = r.lead_owner;
 
-						leads.forEach(function(lead) {
-							let lead_prospect_row = frappe.model.add_child(prospect, 'leads');
-							lead_prospect_row.lead = lead.name;
-						});
-						frappe.set_route("Form", "Prospect", prospect.name);
-					});
+							leads.forEach(function (lead) {
+								let lead_prospect_row = frappe.model.add_child(prospect, "leads");
+								lead_prospect_row.lead = lead.name;
+							});
+							frappe.set_route("Form", "Prospect", prospect.name);
+						}
+					);
 				});
 			});
 		}
-	}
+	},
 };
diff --git a/erpnext/crm/doctype/lead_source/lead_source.js b/erpnext/crm/doctype/lead_source/lead_source.js
index 3cbe649..5efc750 100644
--- a/erpnext/crm/doctype/lead_source/lead_source.js
+++ b/erpnext/crm/doctype/lead_source/lead_source.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Lead Source', {
+frappe.ui.form.on("Lead Source", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/crm/doctype/lost_reason_detail/lost_reason_detail.js b/erpnext/crm/doctype/lost_reason_detail/lost_reason_detail.js
index 08fbdad..c3081f8 100644
--- a/erpnext/crm/doctype/lost_reason_detail/lost_reason_detail.js
+++ b/erpnext/crm/doctype/lost_reason_detail/lost_reason_detail.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Lost Reason Detail', {
-	refresh: function() {
-
-	}
+frappe.ui.form.on("Lost Reason Detail", {
+	refresh: function () {},
 });
diff --git a/erpnext/crm/doctype/market_segment/market_segment.js b/erpnext/crm/doctype/market_segment/market_segment.js
index 94ffdee..b089c52 100644
--- a/erpnext/crm/doctype/market_segment/market_segment.js
+++ b/erpnext/crm/doctype/market_segment/market_segment.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Market Segment', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Market Segment", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/crm/doctype/opportunity/opportunity.js b/erpnext/crm/doctype/opportunity/opportunity.js
index 0b485bb..1c8a80a 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.js
+++ b/erpnext/crm/doctype/opportunity/opportunity.js
@@ -4,38 +4,37 @@
 erpnext.pre_sales.set_as_lost("Opportunity");
 erpnext.sales_common.setup_selling_controller();
 
-
 frappe.ui.form.on("Opportunity", {
-	setup: function(frm) {
+	setup: function (frm) {
 		frm.custom_make_buttons = {
-			'Quotation': 'Quotation',
-			'Supplier Quotation': 'Supplier Quotation'
+			Quotation: "Quotation",
+			"Supplier Quotation": "Supplier Quotation",
 		};
 
-		frm.set_query("opportunity_from", function() {
-			return{
-				"filters": {
-					"name": ["in", ["Customer", "Lead", "Prospect"]],
-				}
-			}
+		frm.set_query("opportunity_from", function () {
+			return {
+				filters: {
+					name: ["in", ["Customer", "Lead", "Prospect"]],
+				},
+			};
 		});
 
 		frm.email_field = "contact_email";
 	},
 
-	validate: function(frm) {
+	validate: function (frm) {
 		if (frm.doc.status == "Lost" && !frm.doc.lost_reasons.length) {
-			frm.trigger('set_as_lost_dialog');
+			frm.trigger("set_as_lost_dialog");
 			frappe.throw(__("Lost Reasons are required in case opportunity is Lost."));
 		}
 	},
 
-	onload_post_render: function(frm) {
+	onload_post_render: function (frm) {
 		frm.get_field("items").grid.set_multiple_add("item_code", "qty");
 	},
 
-	party_name: function(frm) {
-		frm.trigger('set_contact_link');
+	party_name: function (frm) {
+		frm.trigger("set_contact_link");
 
 		if (frm.doc.opportunity_from == "Customer") {
 			erpnext.utils.get_party_details(frm);
@@ -43,75 +42,86 @@
 			erpnext.utils.map_current_doc({
 				method: "erpnext.crm.doctype.lead.lead.make_opportunity",
 				source_name: frm.doc.party_name,
-				frm: frm
+				frm: frm,
 			});
 		}
 	},
 
-	status:function(frm){
-		if (frm.doc.status == "Lost"){
-			frm.trigger('set_as_lost_dialog');
+	status: function (frm) {
+		if (frm.doc.status == "Lost") {
+			frm.trigger("set_as_lost_dialog");
 		}
-
 	},
 
-	customer_address: function(frm, cdt, cdn) {
-		erpnext.utils.get_address_display(frm, 'customer_address', 'address_display', false);
+	customer_address: function (frm, cdt, cdn) {
+		erpnext.utils.get_address_display(frm, "customer_address", "address_display", false);
 	},
 
 	contact_person: erpnext.utils.get_contact_details,
 
-	opportunity_from: function(frm) {
-		frm.trigger('setup_opportunity_from');
+	opportunity_from: function (frm) {
+		frm.trigger("setup_opportunity_from");
 
 		frm.set_value("party_name", "");
 	},
 
-	setup_opportunity_from: function(frm) {
-		frm.trigger('setup_queries');
+	setup_opportunity_from: function (frm) {
+		frm.trigger("setup_queries");
 		frm.trigger("set_dynamic_field_label");
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		var doc = frm.doc;
-		frm.trigger('setup_opportunity_from');
+		frm.trigger("setup_opportunity_from");
 		erpnext.toggle_naming_series();
 
-		if(!frm.is_new() && doc.status!=="Lost") {
-			if(doc.items){
-				frm.add_custom_button(__('Supplier Quotation'),
-					function() {
-						frm.trigger("make_supplier_quotation")
-					}, __('Create'));
+		if (!frm.is_new() && doc.status !== "Lost") {
+			if (doc.items) {
+				frm.add_custom_button(
+					__("Supplier Quotation"),
+					function () {
+						frm.trigger("make_supplier_quotation");
+					},
+					__("Create")
+				);
 
-				frm.add_custom_button(__('Request For Quotation'),
-					function() {
-						frm.trigger("make_request_for_quotation")
-					}, __('Create'));
+				frm.add_custom_button(
+					__("Request For Quotation"),
+					function () {
+						frm.trigger("make_request_for_quotation");
+					},
+					__("Create")
+				);
 			}
 
 			if (frm.doc.opportunity_from != "Customer") {
-				frm.add_custom_button(__('Customer'),
-					function() {
-						frm.trigger("make_customer")
-					}, __('Create'));
+				frm.add_custom_button(
+					__("Customer"),
+					function () {
+						frm.trigger("make_customer");
+					},
+					__("Create")
+				);
 			}
 
-			frm.add_custom_button(__('Quotation'),
-				function() {
-					frm.trigger("create_quotation")
-				}, __('Create'));
+			frm.add_custom_button(
+				__("Quotation"),
+				function () {
+					frm.trigger("create_quotation");
+				},
+				__("Create")
+			);
 		}
 
-		if(!frm.doc.__islocal && frm.perm[0].write && frm.doc.docstatus==0) {
-			if(frm.doc.status==="Open") {
-				frm.add_custom_button(__("Close"), function() {
+		if (!frm.doc.__islocal && frm.perm[0].write && frm.doc.docstatus == 0) {
+			if (frm.doc.status === "Open") {
+				frm.add_custom_button(__("Close"), function () {
 					frm.set_value("status", "Closed");
 					frm.save();
 				});
 			} else {
-				frm.add_custom_button(__("Reopen"), function() {
-					frm.set_value("lost_reasons",[])
+				frm.add_custom_button(__("Reopen"), function () {
+					frm.set_value("lost_reasons", []);
 					frm.set_value("status", "Open");
 					frm.save();
 				});
@@ -126,141 +136,149 @@
 		}
 
 		if (frm.doc.opportunity_from && frm.doc.party_name) {
-			frm.trigger('set_contact_link');
+			frm.trigger("set_contact_link");
 		}
 	},
 
-	set_contact_link: function(frm) {
-		if(frm.doc.opportunity_from == "Customer" && frm.doc.party_name) {
-			frappe.dynamic_link = {doc: frm.doc, fieldname: 'party_name', doctype: 'Customer'}
-		} else if(frm.doc.opportunity_from == "Lead" && frm.doc.party_name) {
-			frappe.dynamic_link = {doc: frm.doc, fieldname: 'party_name', doctype: 'Lead'}
+	set_contact_link: function (frm) {
+		if (frm.doc.opportunity_from == "Customer" && frm.doc.party_name) {
+			frappe.dynamic_link = { doc: frm.doc, fieldname: "party_name", doctype: "Customer" };
+		} else if (frm.doc.opportunity_from == "Lead" && frm.doc.party_name) {
+			frappe.dynamic_link = { doc: frm.doc, fieldname: "party_name", doctype: "Lead" };
 		} else if (frm.doc.opportunity_from == "Prospect" && frm.doc.party_name) {
-			frappe.dynamic_link = {doc: frm.doc, fieldname: 'party_name', doctype: 'Prospect'}
+			frappe.dynamic_link = { doc: frm.doc, fieldname: "party_name", doctype: "Prospect" };
 		}
 	},
 
-	currency: function(frm) {
+	currency: function (frm) {
 		let company_currency = erpnext.get_currency(frm.doc.company);
 		if (company_currency != frm.doc.company) {
 			frappe.call({
 				method: "erpnext.setup.utils.get_exchange_rate",
 				args: {
 					from_currency: frm.doc.currency,
-					to_currency: company_currency
+					to_currency: company_currency,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (r.message) {
-						frm.set_value('conversion_rate', flt(r.message));
-						frm.set_df_property('conversion_rate', 'description', '1 ' + frm.doc.currency
-						+ ' = [?] ' + company_currency);
+						frm.set_value("conversion_rate", flt(r.message));
+						frm.set_df_property(
+							"conversion_rate",
+							"description",
+							"1 " + frm.doc.currency + " = [?] " + company_currency
+						);
 					}
-				}
+				},
 			});
 		} else {
-			frm.set_value('conversion_rate', 1.0);
-			frm.set_df_property('conversion_rate', 'hidden', 1);
-			frm.set_df_property('conversion_rate', 'description', '');
+			frm.set_value("conversion_rate", 1.0);
+			frm.set_df_property("conversion_rate", "hidden", 1);
+			frm.set_df_property("conversion_rate", "description", "");
 		}
 
-		frm.trigger('opportunity_amount');
-		frm.trigger('set_dynamic_field_label');
+		frm.trigger("opportunity_amount");
+		frm.trigger("set_dynamic_field_label");
 	},
 
-	opportunity_amount: function(frm) {
-		frm.set_value('base_opportunity_amount', flt(frm.doc.opportunity_amount) * flt(frm.doc.conversion_rate));
+	opportunity_amount: function (frm) {
+		frm.set_value(
+			"base_opportunity_amount",
+			flt(frm.doc.opportunity_amount) * flt(frm.doc.conversion_rate)
+		);
 	},
 
-	set_dynamic_field_label: function(frm){
+	set_dynamic_field_label: function (frm) {
 		if (frm.doc.opportunity_from) {
 			frm.set_df_property("party_name", "label", frm.doc.opportunity_from);
 		}
-		frm.trigger('change_grid_labels');
-		frm.trigger('change_form_labels');
+		frm.trigger("change_grid_labels");
+		frm.trigger("change_form_labels");
 	},
 
-	make_supplier_quotation: function(frm) {
+	make_supplier_quotation: function (frm) {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.crm.doctype.opportunity.opportunity.make_supplier_quotation",
-			frm: frm
-		})
+			frm: frm,
+		});
 	},
 
-	make_request_for_quotation: function(frm) {
+	make_request_for_quotation: function (frm) {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.crm.doctype.opportunity.opportunity.make_request_for_quotation",
-			frm: frm
-		})
+			frm: frm,
+		});
 	},
 
-	change_form_labels: function(frm) {
+	change_form_labels: function (frm) {
 		let company_currency = erpnext.get_currency(frm.doc.company);
 		frm.set_currency_labels(["base_opportunity_amount", "base_total"], company_currency);
 		frm.set_currency_labels(["opportunity_amount", "total"], frm.doc.currency);
 
 		// toggle fields
-		frm.toggle_display(["conversion_rate", "base_opportunity_amount", "base_total"],
-			frm.doc.currency != company_currency);
+		frm.toggle_display(
+			["conversion_rate", "base_opportunity_amount", "base_total"],
+			frm.doc.currency != company_currency
+		);
 	},
 
-	change_grid_labels: function(frm) {
+	change_grid_labels: function (frm) {
 		let company_currency = erpnext.get_currency(frm.doc.company);
 		frm.set_currency_labels(["base_rate", "base_amount"], company_currency, "items");
 		frm.set_currency_labels(["rate", "amount"], frm.doc.currency, "items");
 
 		let item_grid = frm.fields_dict.items.grid;
-		$.each(["base_rate", "base_amount"], function(i, fname) {
-			if(frappe.meta.get_docfield(item_grid.doctype, fname))
+		$.each(["base_rate", "base_amount"], function (i, fname) {
+			if (frappe.meta.get_docfield(item_grid.doctype, fname))
 				item_grid.set_column_disp(fname, frm.doc.currency != company_currency);
 		});
 		frm.refresh_fields();
 	},
 
-	calculate_total: function(frm) {
-		let total = 0, base_total = 0;
-		frm.doc.items.forEach(item => {
+	calculate_total: function (frm) {
+		let total = 0,
+			base_total = 0;
+		frm.doc.items.forEach((item) => {
 			total += item.amount;
 			base_total += item.base_amount;
-		})
+		});
 
 		frm.set_value({
-			'total': flt(total),
-			'base_total': flt(base_total)
+			total: flt(total),
+			base_total: flt(base_total),
 		});
 	},
 });
 frappe.ui.form.on("Opportunity Item", {
-	calculate: function(frm, cdt, cdn) {
+	calculate: function (frm, cdt, cdn) {
 		let row = frappe.get_doc(cdt, cdn);
 		frappe.model.set_value(cdt, cdn, "amount", flt(row.qty) * flt(row.rate));
 		frappe.model.set_value(cdt, cdn, "base_rate", flt(frm.doc.conversion_rate) * flt(row.rate));
 		frappe.model.set_value(cdt, cdn, "base_amount", flt(frm.doc.conversion_rate) * flt(row.amount));
 		frm.trigger("calculate_total");
 	},
-	qty: function(frm, cdt, cdn) {
+	qty: function (frm, cdt, cdn) {
 		frm.trigger("calculate", cdt, cdn);
 	},
-	rate: function(frm, cdt, cdn) {
+	rate: function (frm, cdt, cdn) {
 		frm.trigger("calculate", cdt, cdn);
-	}
-})
+	},
+});
 
 // TODO commonify this code
 erpnext.crm.Opportunity = class Opportunity extends frappe.ui.form.Controller {
 	onload() {
-
-		if(!this.frm.doc.status) {
-			this.frm.set_value('status', 'Open');
+		if (!this.frm.doc.status) {
+			this.frm.set_value("status", "Open");
 		}
-		if(!this.frm.doc.company && frappe.defaults.get_user_default("Company")) {
-			this.frm.set_value('company', frappe.defaults.get_user_default("Company"));
+		if (!this.frm.doc.company && frappe.defaults.get_user_default("Company")) {
+			this.frm.set_value("company", frappe.defaults.get_user_default("Company"));
 		}
-		if(!this.frm.doc.currency) {
-			this.frm.set_value('currency', frappe.defaults.get_user_default("Currency"));
+		if (!this.frm.doc.currency) {
+			this.frm.set_value("currency", frappe.defaults.get_user_default("Currency"));
 		}
 
 		this.setup_queries();
-		this.frm.trigger('currency');
+		this.frm.trigger("currency");
 	}
 
 	refresh() {
@@ -271,28 +289,27 @@
 	setup_queries() {
 		var me = this;
 
-		me.frm.set_query('customer_address', erpnext.queries.address_query);
+		me.frm.set_query("customer_address", erpnext.queries.address_query);
 
-		this.frm.set_query("item_code", "items", function() {
+		this.frm.set_query("item_code", "items", function () {
 			return {
 				query: "erpnext.controllers.queries.item_query",
-				filters: {'is_sales_item': 1}
+				filters: { is_sales_item: 1 },
 			};
 		});
 
-		me.frm.set_query('contact_person', erpnext.queries['contact_query'])
+		me.frm.set_query("contact_person", erpnext.queries["contact_query"]);
 
 		if (me.frm.doc.opportunity_from == "Lead") {
-			me.frm.set_query('party_name', erpnext.queries['lead']);
-		}
-		else if (me.frm.doc.opportunity_from == "Customer") {
-			me.frm.set_query('party_name', erpnext.queries['customer']);
+			me.frm.set_query("party_name", erpnext.queries["lead"]);
+		} else if (me.frm.doc.opportunity_from == "Customer") {
+			me.frm.set_query("party_name", erpnext.queries["customer"]);
 		} else if (me.frm.doc.opportunity_from == "Prospect") {
-			me.frm.set_query('party_name', function() {
+			me.frm.set_query("party_name", function () {
 				return {
 					filters: {
-						"company": me.frm.doc.company
-					}
+						company: me.frm.doc.company,
+					},
 				};
 			});
 		}
@@ -301,15 +318,15 @@
 	create_quotation() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.crm.doctype.opportunity.opportunity.make_quotation",
-			frm: cur_frm
-		})
+			frm: cur_frm,
+		});
 	}
 
 	make_customer() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.crm.doctype.opportunity.opportunity.make_customer",
-			frm: cur_frm
-		})
+			frm: cur_frm,
+		});
 	}
 
 	show_notes() {
@@ -331,22 +348,22 @@
 	}
 };
 
-extend_cscript(cur_frm.cscript, new erpnext.crm.Opportunity({frm: cur_frm}));
+extend_cscript(cur_frm.cscript, new erpnext.crm.Opportunity({ frm: cur_frm }));
 
-cur_frm.cscript.item_code = function(doc, cdt, cdn) {
+cur_frm.cscript.item_code = function (doc, cdt, cdn) {
 	var d = locals[cdt][cdn];
 	if (d.item_code) {
 		return frappe.call({
 			method: "erpnext.crm.doctype.opportunity.opportunity.get_item_details",
-			args: {"item_code":d.item_code},
-			callback: function(r, rt) {
-				if(r.message) {
-					$.each(r.message, function(k, v) {
+			args: { item_code: d.item_code },
+			callback: function (r, rt) {
+				if (r.message) {
+					$.each(r.message, function (k, v) {
 						frappe.model.set_value(cdt, cdn, k, v);
 					});
-					refresh_field('image_view', d.name, 'items');
+					refresh_field("image_view", d.name, "items");
 				}
-			}
-		})
+			},
+		});
 	}
-}
+};
diff --git a/erpnext/crm/doctype/opportunity/opportunity_list.js b/erpnext/crm/doctype/opportunity/opportunity_list.js
index 24b0514..5028ae1 100644
--- a/erpnext/crm/doctype/opportunity/opportunity_list.js
+++ b/erpnext/crm/doctype/opportunity/opportunity_list.js
@@ -1,31 +1,31 @@
-frappe.listview_settings['Opportunity'] = {
+frappe.listview_settings["Opportunity"] = {
 	add_fields: ["customer_name", "opportunity_type", "opportunity_from", "status"],
-	get_indicator: function(doc) {
+	get_indicator: function (doc) {
 		var indicator = [__(doc.status), frappe.utils.guess_colour(doc.status), "status,=," + doc.status];
-		if(doc.status=="Quotation") {
+		if (doc.status == "Quotation") {
 			indicator[1] = "green";
 		}
 		return indicator;
 	},
-	onload: function(listview) {
+	onload: function (listview) {
 		var method = "erpnext.crm.doctype.opportunity.opportunity.set_multiple_status";
 
-		listview.page.add_menu_item(__("Set as Open"), function() {
-			listview.call_for_selected_items(method, {"status": "Open"});
+		listview.page.add_menu_item(__("Set as Open"), function () {
+			listview.call_for_selected_items(method, { status: "Open" });
 		});
 
-		listview.page.add_menu_item(__("Set as Closed"), function() {
-			listview.call_for_selected_items(method, {"status": "Closed"});
+		listview.page.add_menu_item(__("Set as Closed"), function () {
+			listview.call_for_selected_items(method, { status: "Closed" });
 		});
 
-		if(listview.page.fields_dict.opportunity_from) {
-			listview.page.fields_dict.opportunity_from.get_query = function() {
+		if (listview.page.fields_dict.opportunity_from) {
+			listview.page.fields_dict.opportunity_from.get_query = function () {
 				return {
-					"filters": {
-						"name": ["in", ["Customer", "Lead"]],
-					}
+					filters: {
+						name: ["in", ["Customer", "Lead"]],
+					},
 				};
 			};
 		}
-	}
+	},
 };
diff --git a/erpnext/crm/doctype/opportunity_lost_reason/opportunity_lost_reason.js b/erpnext/crm/doctype/opportunity_lost_reason/opportunity_lost_reason.js
index 877dd59..3f08355 100644
--- a/erpnext/crm/doctype/opportunity_lost_reason/opportunity_lost_reason.js
+++ b/erpnext/crm/doctype/opportunity_lost_reason/opportunity_lost_reason.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Opportunity Lost Reason', {
-	refresh: function() {
-
-	}
+frappe.ui.form.on("Opportunity Lost Reason", {
+	refresh: function () {},
 });
diff --git a/erpnext/crm/doctype/opportunity_type/opportunity_type.js b/erpnext/crm/doctype/opportunity_type/opportunity_type.js
index 174625e..18213ad 100644
--- a/erpnext/crm/doctype/opportunity_type/opportunity_type.js
+++ b/erpnext/crm/doctype/opportunity_type/opportunity_type.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Opportunity Type', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Opportunity Type", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/crm/doctype/prospect/prospect.js b/erpnext/crm/doctype/prospect/prospect.js
index c1a7ff5..1bf7f26 100644
--- a/erpnext/crm/doctype/prospect/prospect.js
+++ b/erpnext/crm/doctype/prospect/prospect.js
@@ -1,23 +1,31 @@
 // Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Prospect', {
-	refresh (frm) {
+frappe.ui.form.on("Prospect", {
+	refresh(frm) {
 		if (!frm.is_new() && frappe.boot.user.can_create.includes("Customer")) {
-			frm.add_custom_button(__("Customer"), function() {
-				frappe.model.open_mapped_doc({
-					method: "erpnext.crm.doctype.prospect.prospect.make_customer",
-					frm: frm
-				});
-			}, __("Create"));
+			frm.add_custom_button(
+				__("Customer"),
+				function () {
+					frappe.model.open_mapped_doc({
+						method: "erpnext.crm.doctype.prospect.prospect.make_customer",
+						frm: frm,
+					});
+				},
+				__("Create")
+			);
 		}
 		if (!frm.is_new() && frappe.boot.user.can_create.includes("Opportunity")) {
-			frm.add_custom_button(__("Opportunity"), function() {
-				frappe.model.open_mapped_doc({
-					method: "erpnext.crm.doctype.prospect.prospect.make_opportunity",
-					frm: frm
-				});
-			}, __("Create"));
+			frm.add_custom_button(
+				__("Opportunity"),
+				function () {
+					frappe.model.open_mapped_doc({
+						method: "erpnext.crm.doctype.prospect.prospect.make_opportunity",
+						frm: frm,
+					});
+				},
+				__("Create")
+			);
 		}
 
 		if (!frm.is_new()) {
@@ -29,7 +37,7 @@
 		frm.trigger("show_activities");
 	},
 
-	show_notes (frm) {
+	show_notes(frm) {
 		const crm_notes = new erpnext.utils.CRMNotes({
 			frm: frm,
 			notes_wrapper: $(frm.fields_dict.notes_html.wrapper),
@@ -37,7 +45,7 @@
 		crm_notes.refresh();
 	},
 
-	show_activities (frm) {
+	show_activities(frm) {
 		const crm_activities = new erpnext.utils.CRMActivities({
 			frm: frm,
 			open_activities_wrapper: $(frm.fields_dict.open_activities_html.wrapper),
@@ -45,6 +53,5 @@
 			form_wrapper: $(frm.wrapper),
 		});
 		crm_activities.refresh();
-	}
-
+	},
 });
diff --git a/erpnext/crm/doctype/sales_stage/sales_stage.js b/erpnext/crm/doctype/sales_stage/sales_stage.js
index 0447f78..c6811665 100644
--- a/erpnext/crm/doctype/sales_stage/sales_stage.js
+++ b/erpnext/crm/doctype/sales_stage/sales_stage.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Sales Stage', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Sales Stage", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js b/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js
index 0c4e7f2..a1e51f0 100644
--- a/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js
+++ b/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js
@@ -1,18 +1,18 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 frappe.query_reports["Campaign Efficiency"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
 		},
 		{
-			"fieldname": "to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
-		}
-	]
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
+		},
+	],
 };
diff --git a/erpnext/crm/report/first_response_time_for_opportunity/first_response_time_for_opportunity.js b/erpnext/crm/report/first_response_time_for_opportunity/first_response_time_for_opportunity.js
index 4bf8247..efaea49 100644
--- a/erpnext/crm/report/first_response_time_for_opportunity/first_response_time_for_opportunity.js
+++ b/erpnext/crm/report/first_response_time_for_opportunity/first_response_time_for_opportunity.js
@@ -1,43 +1,44 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["First Response Time for Opportunity"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"reqd": 1,
-			"default": frappe.datetime.add_days(frappe.datetime.nowdate(), -30)
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			default: frappe.datetime.add_days(frappe.datetime.nowdate(), -30),
 		},
 		{
-			"fieldname": "to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"reqd": 1,
-			"default": frappe.datetime.nowdate()
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			default: frappe.datetime.nowdate(),
 		},
 	],
 	get_chart_data: function (_columns, result) {
 		return {
 			data: {
-				labels: result.map(d => d.creation_date),
-				datasets: [{
-					name: "First Response Time",
-					values: result.map(d => d.first_response_time)
-				}]
+				labels: result.map((d) => d.creation_date),
+				datasets: [
+					{
+						name: "First Response Time",
+						values: result.map((d) => d.first_response_time),
+					},
+				],
 			},
 			type: "line",
 			tooltipOptions: {
-				formatTooltipY: d => {
+				formatTooltipY: (d) => {
 					let duration_options = {
 						hide_days: 0,
-						hide_seconds: 0
+						hide_seconds: 0,
 					};
 					return frappe.utils.get_formatted_duration(d, duration_options);
-				}
-			}
-		}
-	}
+				},
+			},
+		};
+	},
 };
diff --git a/erpnext/crm/report/lead_conversion_time/lead_conversion_time.js b/erpnext/crm/report/lead_conversion_time/lead_conversion_time.js
index d7ff9ad..0019337 100644
--- a/erpnext/crm/report/lead_conversion_time/lead_conversion_time.js
+++ b/erpnext/crm/report/lead_conversion_time/lead_conversion_time.js
@@ -1,22 +1,21 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Lead Conversion Time"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			'reqd': 1,
-			"default": frappe.datetime.add_days(frappe.datetime.nowdate(), -30)
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			default: frappe.datetime.add_days(frappe.datetime.nowdate(), -30),
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			'reqd': 1,
-			"default":frappe.datetime.nowdate()
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			default: frappe.datetime.nowdate(),
 		},
-	]
+	],
 };
diff --git a/erpnext/crm/report/lead_details/lead_details.js b/erpnext/crm/report/lead_details/lead_details.js
index 66611f6..feecc07 100644
--- a/erpnext/crm/report/lead_details/lead_details.js
+++ b/erpnext/crm/report/lead_details/lead_details.js
@@ -1,52 +1,51 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Lead Details"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -12),
-			"reqd": 1
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -12),
+			reqd: 1,
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
 		},
 		{
-			"fieldname":"status",
-			"label": __("Status"),
-			"fieldtype": "Select",
+			fieldname: "status",
+			label: __("Status"),
+			fieldtype: "Select",
 			options: [
-				{ "value": "Lead", "label": __("Lead") },
-				{ "value": "Open", "label": __("Open") },
-				{ "value": "Replied", "label": __("Replied") },
-				{ "value": "Opportunity", "label": __("Opportunity") },
-				{ "value": "Quotation", "label": __("Quotation") },
-				{ "value": "Lost Quotation", "label": __("Lost Quotation") },
-				{ "value": "Interested", "label": __("Interested") },
-				{ "value": "Converted", "label": __("Converted") },
-				{ "value": "Do Not Contact", "label": __("Do Not Contact") },
+				{ value: "Lead", label: __("Lead") },
+				{ value: "Open", label: __("Open") },
+				{ value: "Replied", label: __("Replied") },
+				{ value: "Opportunity", label: __("Opportunity") },
+				{ value: "Quotation", label: __("Quotation") },
+				{ value: "Lost Quotation", label: __("Lost Quotation") },
+				{ value: "Interested", label: __("Interested") },
+				{ value: "Converted", label: __("Converted") },
+				{ value: "Do Not Contact", label: __("Do Not Contact") },
 			],
 		},
 		{
-			"fieldname":"territory",
-			"label": __("Territory"),
-			"fieldtype": "Link",
-			"options": "Territory",
-		}
-	]
+			fieldname: "territory",
+			label: __("Territory"),
+			fieldtype: "Link",
+			options: "Territory",
+		},
+	],
 };
diff --git a/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.js b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.js
index 6fc52a1..bd64641 100644
--- a/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.js
+++ b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.js
@@ -1,17 +1,18 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
-	frappe.query_reports["Lead Owner Efficiency"] = {
-		"filters": [
-			{
-				"fieldname": "from_date",
-				"label": __("From Date"),
-				"fieldtype": "Date",
-				"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
-			},
-			{
-				"fieldname": "to_date",
-				"label": __("To Date"),
-				"fieldtype": "Date",
-				"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
-			}
-		]};
+frappe.query_reports["Lead Owner Efficiency"] = {
+	filters: [
+		{
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
+		},
+		{
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
+		},
+	],
+};
diff --git a/erpnext/crm/report/lost_opportunity/lost_opportunity.js b/erpnext/crm/report/lost_opportunity/lost_opportunity.js
index 8d59239..7932afe 100644
--- a/erpnext/crm/report/lost_opportunity/lost_opportunity.js
+++ b/erpnext/crm/report/lost_opportunity/lost_opportunity.js
@@ -1,61 +1,60 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Lost Opportunity"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -12),
-			"reqd": 1
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -12),
+			reqd: 1,
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
 		},
 		{
-			"fieldname":"lost_reason",
-			"label": __("Lost Reason"),
-			"fieldtype": "Link",
-			"options": "Opportunity Lost Reason"
+			fieldname: "lost_reason",
+			label: __("Lost Reason"),
+			fieldtype: "Link",
+			options: "Opportunity Lost Reason",
 		},
 		{
-			"fieldname":"territory",
-			"label": __("Territory"),
-			"fieldtype": "Link",
-			"options": "Territory"
+			fieldname: "territory",
+			label: __("Territory"),
+			fieldtype: "Link",
+			options: "Territory",
 		},
 		{
-			"fieldname":"opportunity_from",
-			"label": __("Opportunity From"),
-			"fieldtype": "Link",
-			"options": "DocType",
-			"get_query": function() {
+			fieldname: "opportunity_from",
+			label: __("Opportunity From"),
+			fieldtype: "Link",
+			options: "DocType",
+			get_query: function () {
 				return {
-					"filters": {
-						"name": ["in", ["Customer", "Lead"]],
-					}
-				}
-			}
+					filters: {
+						name: ["in", ["Customer", "Lead"]],
+					},
+				};
+			},
 		},
 		{
-			"fieldname":"party_name",
-			"label": __("Party"),
-			"fieldtype": "Dynamic Link",
-			"options": "opportunity_from"
+			fieldname: "party_name",
+			label: __("Party"),
+			fieldtype: "Dynamic Link",
+			options: "opportunity_from",
 		},
-	]
+	],
 };
diff --git a/erpnext/crm/report/opportunity_summary_by_sales_stage/opportunity_summary_by_sales_stage.js b/erpnext/crm/report/opportunity_summary_by_sales_stage/opportunity_summary_by_sales_stage.js
index 0aa2143..36361e5 100644
--- a/erpnext/crm/report/opportunity_summary_by_sales_stage/opportunity_summary_by_sales_stage.js
+++ b/erpnext/crm/report/opportunity_summary_by_sales_stage/opportunity_summary_by_sales_stage.js
@@ -1,28 +1,26 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Opportunity Summary by Sales Stage"] = {
-	"filters": [
+	filters: [
 		{
 			fieldname: "based_on",
 			label: __("Based On"),
 			fieldtype: "Select",
 			options: "Opportunity Owner\nSource\nOpportunity Type",
-			default: "Opportunity Owner"
+			default: "Opportunity Owner",
 		},
 		{
 			fieldname: "data_based_on",
 			label: __("Data Based On"),
 			fieldtype: "Select",
 			options: "Number\nAmount",
-			default: "Number"
+			default: "Number",
 		},
 		{
 			fieldname: "from_date",
 			label: __("From Date"),
 			fieldtype: "Date",
-
 		},
 		{
 			fieldname: "to_date",
@@ -33,14 +31,14 @@
 			fieldname: "status",
 			label: __("Status"),
 			fieldtype: "MultiSelectList",
-			get_data: function() {
+			get_data: function () {
 				return [
-					{value: "Open", description: "Status"},
-					{value: "Converted", description: "Status"},
-					{value: "Quotation", description: "Status"},
-					{value: "Replied", description: "Status"}
-				]
-			}
+					{ value: "Open", description: "Status" },
+					{ value: "Converted", description: "Status" },
+					{ value: "Quotation", description: "Status" },
+					{ value: "Replied", description: "Status" },
+				];
+			},
 		},
 		{
 			fieldname: "opportunity_source",
@@ -59,7 +57,7 @@
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
-			default: frappe.defaults.get_user_default("Company")
-		}
-	]
+			default: frappe.defaults.get_user_default("Company"),
+		},
+	],
 };
diff --git a/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.js b/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.js
index 6f37719..d625941 100644
--- a/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.js
+++ b/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.js
@@ -2,24 +2,24 @@
 // For license information, please see license.txt
 
 frappe.query_reports["Prospects Engaged But Not Converted"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "lead",
-			"label": __("Lead"),
-			"fieldtype": "Link",
-			"options": "Lead"
+			fieldname: "lead",
+			label: __("Lead"),
+			fieldtype: "Link",
+			options: "Lead",
 		},
 		{
-			"fieldname": "no_of_interaction",
-			"label": __("Number of Interaction"),
-			"fieldtype": "Int",
-			"default": 1
+			fieldname: "no_of_interaction",
+			label: __("Number of Interaction"),
+			fieldtype: "Int",
+			default: 1,
 		},
 		{
-			"fieldname": "lead_age",
-			"label": __("Minimum Lead Age (Days)"),
-			"fieldtype": "Int",
-			"default": 60
+			fieldname: "lead_age",
+			label: __("Minimum Lead Age (Days)"),
+			fieldtype: "Int",
+			default: 60,
 		},
-	]
-}
+	],
+};
diff --git a/erpnext/crm/report/sales_pipeline_analytics/sales_pipeline_analytics.js b/erpnext/crm/report/sales_pipeline_analytics/sales_pipeline_analytics.js
index 3111121..df035c1 100644
--- a/erpnext/crm/report/sales_pipeline_analytics/sales_pipeline_analytics.js
+++ b/erpnext/crm/report/sales_pipeline_analytics/sales_pipeline_analytics.js
@@ -1,70 +1,69 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Sales Pipeline Analytics"] = {
-	"filters": [
+	filters: [
 		{
 			fieldname: "pipeline_by",
 			label: __("Pipeline By"),
 			fieldtype: "Select",
 			options: "Owner\nSales Stage",
-			default: "Owner"
+			default: "Owner",
 		},
 		{
 			fieldname: "from_date",
 			label: __("From Date"),
-			fieldtype: "Date"
+			fieldtype: "Date",
 		},
 		{
 			fieldname: "to_date",
 			label: __("To Date"),
-			fieldtype: "Date"
+			fieldtype: "Date",
 		},
 		{
 			fieldname: "range",
 			label: __("Range"),
 			fieldtype: "Select",
 			options: "Monthly\nQuarterly",
-			default: "Monthly"
+			default: "Monthly",
 		},
 		{
 			fieldname: "assigned_to",
 			label: __("Assigned To"),
 			fieldtype: "Link",
-			options: "User"
+			options: "User",
 		},
 		{
 			fieldname: "status",
 			label: __("Status"),
 			fieldtype: "Select",
-			options: "Open\nQuotation\nConverted\nReplied"
+			options: "Open\nQuotation\nConverted\nReplied",
 		},
 		{
 			fieldname: "based_on",
 			label: __("Based On"),
 			fieldtype: "Select",
 			options: "Number\nAmount",
-			default: "Number"
+			default: "Number",
 		},
 		{
 			fieldname: "company",
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
-			default: frappe.defaults.get_user_default("Company")
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
 			fieldname: "opportunity_source",
 			label: __("Opportunity Source"),
 			fieldtype: "Link",
-			options: "Lead Source"
+			options: "Lead Source",
 		},
 		{
 			fieldname: "opportunity_type",
 			label: __("Opportunity Type"),
 			fieldtype: "Link",
-			options: "Opportunity Type"
+			options: "Opportunity Type",
 		},
-	]
+	],
 };
diff --git a/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.js b/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.js
index 015e943..fc3bf80 100644
--- a/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.js
+++ b/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.js
@@ -3,20 +3,20 @@
 
 frappe.provide("erpnext.integrations");
 
-frappe.ui.form.on('Plaid Settings', {
+frappe.ui.form.on("Plaid Settings", {
 	enabled: function (frm) {
-		frm.toggle_reqd('plaid_client_id', frm.doc.enabled);
-		frm.toggle_reqd('plaid_secret', frm.doc.enabled);
-		frm.toggle_reqd('plaid_env', frm.doc.enabled);
+		frm.toggle_reqd("plaid_client_id", frm.doc.enabled);
+		frm.toggle_reqd("plaid_secret", frm.doc.enabled);
+		frm.toggle_reqd("plaid_env", frm.doc.enabled);
 	},
 
 	refresh: function (frm) {
 		if (frm.doc.enabled) {
-			frm.add_custom_button(__('Link a new bank account'), () => {
+			frm.add_custom_button(__("Link a new bank account"), () => {
 				new erpnext.integrations.plaidLink(frm);
 			});
 
-			frm.add_custom_button(__('Reset Plaid Link'), () => {
+			frm.add_custom_button(__("Reset Plaid Link"), () => {
 				new erpnext.integrations.plaidLink(frm);
 			});
 
@@ -29,20 +29,23 @@
 
 						frappe.msgprint({
 							title: __("Sync Started"),
-							message: __("The sync has started in the background, please check the {0} list for new records.", [bank_transaction_link]),
-							alert: 1
+							message: __(
+								"The sync has started in the background, please check the {0} list for new records.",
+								[bank_transaction_link]
+							),
+							alert: 1,
 						});
-					}
+					},
 				});
 			}).addClass("btn-primary");
 		}
-	}
+	},
 });
 
 erpnext.integrations.plaidLink = class plaidLink {
 	constructor(parent) {
 		this.frm = parent;
-		this.plaidUrl = 'https://cdn.plaid.com/link/v2/stable/link-initialize.js';
+		this.plaidUrl = "https://cdn.plaid.com/link/v2/stable/link-initialize.js";
 		this.init_config();
 	}
 
@@ -55,9 +58,9 @@
 	}
 
 	async get_link_token() {
-		const token = await this.frm.call("get_link_token").then(resp => resp.message);
+		const token = await this.frm.call("get_link_token").then((resp) => resp.message);
 		if (!token) {
-			frappe.throw(__('Cannot retrieve link token. Check Error Log for more information'));
+			frappe.throw(__("Cannot retrieve link token. Check Error Log for more information"));
 		}
 		return token;
 	}
@@ -84,55 +87,74 @@
 				resolve();
 				return;
 			}
-			const el = document.createElement('script');
-			el.type = 'text/javascript';
+			const el = document.createElement("script");
+			el.type = "text/javascript";
 			el.async = true;
 			el.src = src;
-			el.addEventListener('load', resolve);
-			el.addEventListener('error', reject);
-			el.addEventListener('abort', reject);
+			el.addEventListener("load", resolve);
+			el.addEventListener("error", reject);
+			el.addEventListener("abort", reject);
 			document.head.appendChild(el);
 		});
 	}
 
 	onScriptLoaded(me) {
-		me.linkHandler = Plaid.create({ // eslint-disable-line no-undef
+		me.linkHandler = Plaid.create({
+			// eslint-disable-line no-undef
 			clientName: me.client_name,
 			product: me.product,
 			env: me.plaid_env,
 			token: me.token,
-			onSuccess: me.plaid_success
+			onSuccess: me.plaid_success,
 		});
 	}
 
 	onScriptError(error) {
-		frappe.msgprint(__("There was an issue connecting to Plaid's authentication server. Check browser console for more information"));
+		frappe.msgprint(
+			__(
+				"There was an issue connecting to Plaid's authentication server. Check browser console for more information"
+			)
+		);
 		console.log(error);
 	}
 
 	plaid_success(token, response) {
 		const me = this;
 
-		frappe.prompt({
-			fieldtype: "Link",
-			options: "Company",
-			label: __("Company"),
-			fieldname: "company",
-			reqd: 1
-		}, (data) => {
-			me.company = data.company;
-			frappe.xcall('erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.add_institution', {
-				token: token,
-				response: response
-			}).then((result) => {
-				frappe.xcall('erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.add_bank_accounts', {
-					response: response,
-					bank: result,
-					company: me.company
-				});
-			}).then(() => {
-				frappe.show_alert({ message: __("Bank accounts added"), indicator: 'green' });
-			});
-		}, __("Select a company"), __("Continue"));
+		frappe.prompt(
+			{
+				fieldtype: "Link",
+				options: "Company",
+				label: __("Company"),
+				fieldname: "company",
+				reqd: 1,
+			},
+			(data) => {
+				me.company = data.company;
+				frappe
+					.xcall(
+						"erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.add_institution",
+						{
+							token: token,
+							response: response,
+						}
+					)
+					.then((result) => {
+						frappe.xcall(
+							"erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.add_bank_accounts",
+							{
+								response: response,
+								bank: result,
+								company: me.company,
+							}
+						);
+					})
+					.then(() => {
+						frappe.show_alert({ message: __("Bank accounts added"), indicator: "green" });
+					});
+			},
+			__("Select a company"),
+			__("Continue")
+		);
 	}
 };
diff --git a/erpnext/erpnext_integrations/doctype/quickbooks_migrator/quickbooks_migrator.js b/erpnext/erpnext_integrations/doctype/quickbooks_migrator/quickbooks_migrator.js
index bfffcc5..f9364ed 100644
--- a/erpnext/erpnext_integrations/doctype/quickbooks_migrator/quickbooks_migrator.js
+++ b/erpnext/erpnext_integrations/doctype/quickbooks_migrator/quickbooks_migrator.js
@@ -1,71 +1,77 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('QuickBooks Migrator', {
-	connect: function(frm) {
+frappe.ui.form.on("QuickBooks Migrator", {
+	connect: function (frm) {
 		// OAuth requires user intervention to provide application access permissionsto requested scope
 		// Here we open a new window and redirect user to the authorization url.
 		// After user grants us permission to access. We will set authorization details on this doc which will force refresh.
-		window.open(frm.doc.authorization_url)
+		window.open(frm.doc.authorization_url);
 	},
-	fetch_data: function(frm) {
-		frm.call("migrate")
+	fetch_data: function (frm) {
+		frm.call("migrate");
 	},
-	onload: function(frm) {
-		frm.trigger("set_indicator")
-		var domain = frappe.urllib.get_base_url()
-		var redirect_url = `${domain}/api/method/erpnext.erpnext_integrations.doctype.quickbooks_migrator.quickbooks_migrator.callback`
+	onload: function (frm) {
+		frm.trigger("set_indicator");
+		var domain = frappe.urllib.get_base_url();
+		var redirect_url = `${domain}/api/method/erpnext.erpnext_integrations.doctype.quickbooks_migrator.quickbooks_migrator.callback`;
 		if (frm.doc.redirect_url != redirect_url) {
-			frm.set_value("redirect_url", redirect_url)
+			frm.set_value("redirect_url", redirect_url);
 		}
 		// Instead of changing percentage width and message of single progress bar
 		// Show a different porgress bar for every action after some time remove the finished progress bar
- 		// Former approach causes the progress bar to dance back and forth.
-		frm.trigger("set_indicator")
- 		frappe.realtime.on("quickbooks_progress_update", function (data) {
-			frm.dashboard.show_progress(data.message, (data.count / data.total) * 100, data.message)
+		// Former approach causes the progress bar to dance back and forth.
+		frm.trigger("set_indicator");
+		frappe.realtime.on("quickbooks_progress_update", function (data) {
+			frm.dashboard.show_progress(data.message, (data.count / data.total) * 100, data.message);
 			if (data.count == data.total) {
-				window.setTimeout( function(message) {frm.dashboard.hide_progress(message)}, 1500, data.messsage)
+				window.setTimeout(
+					function (message) {
+						frm.dashboard.hide_progress(message);
+					},
+					1500,
+					data.messsage
+				);
 			}
-		})
+		});
 	},
-	refresh: function(frm) {
-		frm.trigger("set_indicator")
+	refresh: function (frm) {
+		frm.trigger("set_indicator");
 		if (!frm.doc.access_token) {
 			// Unset access_token signifies that we don't have enough information to connect to quickbooks api and fetch data
 			if (frm.doc.authorization_url) {
 				frm.add_custom_button(__("Connect to Quickbooks"), function () {
-					frm.trigger("connect")
+					frm.trigger("connect");
 				});
 			}
 		}
 		if (frm.doc.access_token) {
 			// If we have access_token that means we also have refresh_token we don't need user intervention anymore
 			// All we need now is a Company from erpnext
-			frm.remove_custom_button(__("Connect to Quickbooks"))
+			frm.remove_custom_button(__("Connect to Quickbooks"));
 
-			frm.toggle_display("company_settings", 1)
-			frm.set_df_property("company", "reqd", 1)
+			frm.toggle_display("company_settings", 1);
+			frm.set_df_property("company", "reqd", 1);
 			if (frm.doc.company) {
-					frm.add_custom_button(__("Fetch Data"), function () {
-					frm.trigger("fetch_data")
+				frm.add_custom_button(__("Fetch Data"), function () {
+					frm.trigger("fetch_data");
 				});
 			}
 		}
 	},
-	set_indicator: function(frm) {
+	set_indicator: function (frm) {
 		var indicator_map = {
 			"Connecting to QuickBooks": [__("Connecting to QuickBooks"), "orange"],
 			"Connected to QuickBooks": [__("Connected to QuickBooks"), "green"],
 			"In Progress": [__("In Progress"), "orange"],
-			"Complete": [__("Complete"), "green"],
-			"Failed": [__("Failed"), "red"],
-		}
+			Complete: [__("Complete"), "green"],
+			Failed: [__("Failed"), "red"],
+		};
 		if (frm.doc.status) {
-			var indicator = indicator_map[frm.doc.status]
-			var label = indicator[0]
-			var color = indicator[1]
-			frm.page.set_indicator(label, color)
+			var indicator = indicator_map[frm.doc.status];
+			var label = indicator[0];
+			var color = indicator[1];
+			frm.page.set_indicator(label, color);
 		}
 	},
 });
diff --git a/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.js b/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.js
index af06b34..556c332 100644
--- a/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.js
+++ b/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.js
@@ -16,24 +16,29 @@
 			frm.dashboard.show_progress(data.title, (data.count / data.total) * 100, data.message);
 			let error_occurred = data.count === -1;
 			if (data.count == data.total || error_occurred) {
-				window.setTimeout((title) => {
-					frm.dashboard.hide_progress(title);
-					frm.reload_doc();
-					if (error_occurred) {
-						frappe.msgprint({
-							message: __("An error has occurred during {0}. Check {1} for more details",
-								[
-									repl("<a href='/app/tally-migration/%(tally_document)s' class='variant-click'>%(tally_document)s</a>", {
-										tally_document: frm.docname
-									}),
-									"<a href='/app/error-log' class='variant-click'>Error Log</a>"
-								]
-							),
-							title: __("Tally Migration Error"),
-							indicator: "red"
-						});
-					}
-				}, 2000, data.title);
+				window.setTimeout(
+					(title) => {
+						frm.dashboard.hide_progress(title);
+						frm.reload_doc();
+						if (error_occurred) {
+							frappe.msgprint({
+								message: __("An error has occurred during {0}. Check {1} for more details", [
+									repl(
+										"<a href='/app/tally-migration/%(tally_document)s' class='variant-click'>%(tally_document)s</a>",
+										{
+											tally_document: frm.docname,
+										}
+									),
+									"<a href='/app/error-log' class='variant-click'>Error Log</a>",
+								]),
+								title: __("Tally Migration Error"),
+								indicator: "red",
+							});
+						}
+					},
+					2000,
+					data.title
+				);
 			}
 		});
 	},
@@ -43,10 +48,10 @@
 		erpnext.tally_migration.failed_import_log = JSON.parse(frm.doc.failed_import_log);
 		erpnext.tally_migration.fixed_errors_log = JSON.parse(frm.doc.fixed_errors_log);
 
-		["default_round_off_account", "default_warehouse", "default_cost_center"].forEach(account => {
-			frm.toggle_reqd(account, frm.doc.is_master_data_imported === 1)
-			frm.toggle_enable(account, frm.doc.is_day_book_data_processed != 1)
-		})
+		["default_round_off_account", "default_warehouse", "default_cost_center"].forEach((account) => {
+			frm.toggle_reqd(account, frm.doc.is_master_data_imported === 1);
+			frm.toggle_enable(account, frm.doc.is_day_book_data_processed != 1);
+		});
 
 		if (frm.doc.master_data && !frm.doc.is_master_data_imported) {
 			if (frm.doc.is_master_data_processed) {
@@ -74,27 +79,27 @@
 	},
 
 	erpnext_company: function (frm) {
-		frappe.db.exists("Company", frm.doc.erpnext_company).then(exists => {
+		frappe.db.exists("Company", frm.doc.erpnext_company).then((exists) => {
 			if (exists) {
 				frappe.msgprint(
-					__("Company {0} already exists. Continuing will overwrite the Company and Chart of Accounts", [frm.doc.erpnext_company]),
+					__(
+						"Company {0} already exists. Continuing will overwrite the Company and Chart of Accounts",
+						[frm.doc.erpnext_company]
+					)
 				);
 			}
 		});
 	},
 
 	add_button: function (frm, label, method) {
-		frm.add_custom_button(
-			label,
-			() => {
-				frm.call({
-					doc: frm.doc,
-					method: method,
-					freeze: true
-				});
-				frm.reload_doc();
-			}
-		);
+		frm.add_custom_button(label, () => {
+			frm.call({
+				doc: frm.doc,
+				method: method,
+				freeze: true,
+			});
+			frm.reload_doc();
+		});
 	},
 
 	render_html_table(frm, shown_logs, hidden_logs, field) {
@@ -102,23 +107,26 @@
 			frm.toggle_display(field, true);
 		} else {
 			frm.toggle_display(field, false);
-			return
+			return;
 		}
 		let rows = erpnext.tally_migration.get_html_rows(shown_logs, field);
 		let rows_head, table_caption;
 
-		let table_footer = (hidden_logs && (hidden_logs.length > 0)) ? `<tr class="text-muted">
+		let table_footer =
+			hidden_logs && hidden_logs.length > 0
+				? `<tr class="text-muted">
 				<td colspan="4">And ${hidden_logs.length} more others</td>
-			</tr>`: "";
+			</tr>`
+				: "";
 
 		if (field === "fixed_error_log_preview") {
 			rows_head = `<th width="75%">${__("Meta Data")}</th>
-			<th width="10%">${__("Unresolve")}</th>`
-			table_caption = "Resolved Issues"
+			<th width="10%">${__("Unresolve")}</th>`;
+			table_caption = "Resolved Issues";
 		} else {
 			rows_head = `<th width="75%">${__("Error Message")}</th>
-			<th width="10%">${__("Create")}</th>`
-			table_caption = "Error Log"
+			<th width="10%">${__("Create")}</th>`;
+			table_caption = "Error Log";
 		}
 
 		frm.get_field(field).$wrapper.html(`
@@ -144,7 +152,7 @@
 					summary[row.doc.doctype] = 1;
 				}
 			}
-			return summary
+			return summary;
 		}, {});
 		console.table(summary);
 	},
@@ -177,7 +185,7 @@
 		let hidden_logs = completed_log.slice(20);
 
 		frm.events.render_html_table(frm, logs, hidden_logs, "fixed_error_log_preview");
-	}
+	},
 });
 
 erpnext.tally_migration.getError = (traceback) => {
@@ -186,31 +194,33 @@
 	let message;
 
 	if (is_multiline) {
-		let exc_error_idx = traceback.trim().lastIndexOf("\n") + 1
-		let error_line = traceback.substr(exc_error_idx)
-		let split_str_idx = (error_line.indexOf(':') > 0) ? error_line.indexOf(':') + 1 : 0;
+		let exc_error_idx = traceback.trim().lastIndexOf("\n") + 1;
+		let error_line = traceback.substr(exc_error_idx);
+		let split_str_idx = error_line.indexOf(":") > 0 ? error_line.indexOf(":") + 1 : 0;
 		message = error_line.slice(split_str_idx).trim();
 	} else {
 		message = traceback;
 	}
 
-	return message
-}
+	return message;
+};
 
 erpnext.tally_migration.cleanDoc = (obj) => {
 	/* Strips all null and empty values of your JSON object */
 	let temp = obj;
-	$.each(temp, function(key, value){
-		if (value === "" || value === null){
+	$.each(temp, function (key, value) {
+		if (value === "" || value === null) {
 			delete obj[key];
-		} else if (Object.prototype.toString.call(value) === '[object Object]') {
+		} else if (Object.prototype.toString.call(value) === "[object Object]") {
 			erpnext.tally_migration.cleanDoc(value);
 		} else if ($.isArray(value)) {
-			$.each(value, function (k,v) { erpnext.tally_migration.cleanDoc(v); });
+			$.each(value, function (k, v) {
+				erpnext.tally_migration.cleanDoc(v);
+			});
 		}
 	});
 	return temp;
-}
+};
 
 erpnext.tally_migration.unresolve = (document) => {
 	/* Mark document migration as unresolved ie. move to failed error log */
@@ -218,9 +228,9 @@
 	let failed_log = erpnext.tally_migration.failed_import_log;
 	let fixed_log = erpnext.tally_migration.fixed_errors_log;
 
-	let modified_fixed_log = fixed_log.filter(row => {
+	let modified_fixed_log = fixed_log.filter((row) => {
 		if (!frappe.utils.deep_equal(erpnext.tally_migration.cleanDoc(row.doc), document)) {
-			return row
+			return row;
 		}
 	});
 
@@ -231,7 +241,7 @@
 
 	frm.dirty();
 	frm.save();
-}
+};
 
 erpnext.tally_migration.resolve = (document) => {
 	/* Mark document migration as resolved ie. move to fixed error log */
@@ -239,9 +249,9 @@
 	let failed_log = erpnext.tally_migration.failed_import_log;
 	let fixed_log = erpnext.tally_migration.fixed_errors_log;
 
-	let modified_failed_log = failed_log.filter(row => {
+	let modified_failed_log = failed_log.filter((row) => {
 		if (!frappe.utils.deep_equal(erpnext.tally_migration.cleanDoc(row.doc), document)) {
-			return row
+			return row;
 		}
 	});
 	fixed_log.push({ doc: document, exc: `Solved on ${Date()}` });
@@ -251,27 +261,27 @@
 
 	frm.dirty();
 	frm.save();
-}
+};
 
 erpnext.tally_migration.create_new_doc = (document) => {
 	/* Mark as resolved and create new document */
 	erpnext.tally_migration.resolve(document);
 	return frappe.call({
 		type: "POST",
-		method: 'erpnext.erpnext_integrations.doctype.tally_migration.tally_migration.new_doc',
+		method: "erpnext.erpnext_integrations.doctype.tally_migration.tally_migration.new_doc",
 		args: {
-			document
+			document,
 		},
 		freeze: true,
-		callback: function(r) {
-			if(!r.exc) {
+		callback: function (r) {
+			if (!r.exc) {
 				frappe.model.sync(r.message);
 				frappe.get_doc(r.message.doctype, r.message.name).__run_link_triggers = true;
 				frappe.set_route("Form", r.message.doctype, r.message.name);
 			}
-		}
+		},
 	});
-}
+};
 
 erpnext.tally_migration.get_html_rows = (logs, field) => {
 	let index = 0;
@@ -304,14 +314,18 @@
 				</div>`;
 
 			let create_button = `
-				<button class='btn btn-default btn-xs m-3' type='button' onclick='erpnext.tally_migration.create_new_doc(${JSON.stringify(doc)})'>
+				<button class='btn btn-default btn-xs m-3' type='button' onclick='erpnext.tally_migration.create_new_doc(${JSON.stringify(
+					doc
+				)})'>
 					${__("Create Document")}
-				</button>`
+				</button>`;
 
 			let mark_as_unresolved = `
-				<button class='btn btn-default btn-xs m-3' type='button' onclick='erpnext.tally_migration.unresolve(${JSON.stringify(doc)})'>
+				<button class='btn btn-default btn-xs m-3' type='button' onclick='erpnext.tally_migration.unresolve(${JSON.stringify(
+					doc
+				)})'>
 					${__("Mark as unresolved")}
-				</button>`
+				</button>`;
 
 			if (field === "fixed_error_log_preview") {
 				return `<tr>
@@ -343,7 +357,8 @@
 							</td>
 						</tr>`;
 			}
-		}).join("");
+		})
+		.join("");
 
-	return rows
-}
+	return rows;
+};
diff --git a/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.js b/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.js
index 4480ae5..43c7e1c 100644
--- a/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.js
+++ b/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.js
@@ -2,28 +2,28 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.provide("erpnext.maintenance");
-frappe.ui.form.on('Maintenance Schedule', {
+frappe.ui.form.on("Maintenance Schedule", {
 	setup: function (frm) {
-		frm.set_query('contact_person', erpnext.queries.contact_query);
-		frm.set_query('customer_address', erpnext.queries.address_query);
-		frm.set_query('customer', erpnext.queries.customer);
+		frm.set_query("contact_person", erpnext.queries.contact_query);
+		frm.set_query("customer_address", erpnext.queries.address_query);
+		frm.set_query("customer", erpnext.queries.customer);
 
-		frm.set_query('serial_and_batch_bundle', 'items', (doc, cdt, cdn) => {
+		frm.set_query("serial_and_batch_bundle", "items", (doc, cdt, cdn) => {
 			let item = locals[cdt][cdn];
 
 			return {
 				filters: {
-					'item_code': item.item_code,
-					'voucher_type': 'Maintenance Schedule',
-					'type_of_transaction': 'Maintenance',
-					'company': doc.company,
-				}
-			}
+					item_code: item.item_code,
+					voucher_type: "Maintenance Schedule",
+					type_of_transaction: "Maintenance",
+					company: doc.company,
+				},
+			};
 		});
 	},
 	onload: function (frm) {
 		if (!frm.doc.status) {
-			frm.set_value({ status: 'Draft' });
+			frm.set_value({ status: "Draft" });
 		}
 		if (frm.doc.__islocal) {
 			frm.set_value({ transaction_date: frappe.datetime.get_today() });
@@ -31,128 +31,136 @@
 	},
 	refresh: function (frm) {
 		setTimeout(() => {
-			frm.toggle_display('generate_schedule', !(frm.is_new() || frm.doc.docstatus));
-			frm.toggle_display('schedule', !(frm.is_new()));
+			frm.toggle_display("generate_schedule", !(frm.is_new() || frm.doc.docstatus));
+			frm.toggle_display("schedule", !frm.is_new());
 		}, 10);
 	},
 	customer: function (frm) {
-		erpnext.utils.get_party_details(frm)
+		erpnext.utils.get_party_details(frm);
 	},
 	customer_address: function (frm) {
-		erpnext.utils.get_address_display(frm, 'customer_address', 'address_display');
+		erpnext.utils.get_address_display(frm, "customer_address", "address_display");
 	},
 	contact_person: function (frm) {
 		erpnext.utils.get_contact_details(frm);
 	},
 	generate_schedule: function (frm) {
 		if (frm.is_new()) {
-			frappe.msgprint(__('Please save first'));
+			frappe.msgprint(__("Please save first"));
 		} else {
-			frm.call('generate_schedule');
+			frm.call("generate_schedule");
 		}
-	}
-})
+	},
+});
 
 // TODO commonify this code
 erpnext.maintenance.MaintenanceSchedule = class MaintenanceSchedule extends frappe.ui.form.Controller {
 	refresh() {
-		frappe.dynamic_link = {doc: this.frm.doc, fieldname: 'customer', doctype: 'Customer'}
+		frappe.dynamic_link = { doc: this.frm.doc, fieldname: "customer", doctype: "Customer" };
 
 		var me = this;
 
 		if (this.frm.doc.docstatus === 0) {
-			this.frm.add_custom_button(__('Sales Order'),
+			this.frm.add_custom_button(
+				__("Sales Order"),
 				function () {
 					erpnext.utils.map_current_doc({
 						method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_schedule",
 						source_doctype: "Sales Order",
 						target: me.frm,
 						setters: {
-							customer: me.frm.doc.customer || undefined
+							customer: me.frm.doc.customer || undefined,
 						},
 						get_query_filters: {
 							docstatus: 1,
-							company: me.frm.doc.company
-						}
+							company: me.frm.doc.company,
+						},
 					});
-				}, __("Get Items From"));
+				},
+				__("Get Items From")
+			);
 		} else if (this.frm.doc.docstatus === 1) {
 			let schedules = me.frm.doc.schedules;
-			let flag = schedules.some(schedule => schedule.completion_status === "Pending");
+			let flag = schedules.some((schedule) => schedule.completion_status === "Pending");
 			if (flag) {
-				this.frm.add_custom_button(__('Maintenance Visit'), function () {
-					let options = "";
+				this.frm.add_custom_button(
+					__("Maintenance Visit"),
+					function () {
+						let options = "";
 
-					me.frm.call('get_pending_data', {data_type: "items"}).then(r => {
-						options = r.message;
+						me.frm.call("get_pending_data", { data_type: "items" }).then((r) => {
+							options = r.message;
 
-						let schedule_id = "";
-						let d = new frappe.ui.Dialog({
-							title: __("Enter Visit Details"),
-							fields: [{
-								fieldtype: "Select",
-								fieldname: "item_name",
-								label: __("Item Name"),
-								options: options,
-								reqd: 1,
-								onchange: function () {
-									let field = d.get_field("scheduled_date");
-									me.frm.call('get_pending_data',
-										{
-											item_name: this.value,
-											data_type: "date"
-										}).then(r => {
-										field.df.options = r.message;
-										field.refresh();
-									});
-								}
-							},
-							{
-								label: __('Scheduled Date'),
-								fieldname: 'scheduled_date',
-								fieldtype: 'Select',
-								options: "",
-								reqd: 1,
-								onchange: function () {
-									let field = d.get_field('item_name');
-									me.frm.call(
-										'get_pending_data',
-										{
-											item_name: field.value,
-											s_date: this.value,
-											data_type: "id"
-										}).then(r => {
-										schedule_id = r.message;
-									});
-								}
-							},
-							],
-							primary_action_label: 'Create Visit',
-							primary_action(values) {
-								frappe.call({
-									method: "erpnext.maintenance.doctype.maintenance_schedule.maintenance_schedule.make_maintenance_visit",
-									args: {
-										item_name: values.item_name,
-										s_id: schedule_id,
-										source_name: me.frm.doc.name,
+							let schedule_id = "";
+							let d = new frappe.ui.Dialog({
+								title: __("Enter Visit Details"),
+								fields: [
+									{
+										fieldtype: "Select",
+										fieldname: "item_name",
+										label: __("Item Name"),
+										options: options,
+										reqd: 1,
+										onchange: function () {
+											let field = d.get_field("scheduled_date");
+											me.frm
+												.call("get_pending_data", {
+													item_name: this.value,
+													data_type: "date",
+												})
+												.then((r) => {
+													field.df.options = r.message;
+													field.refresh();
+												});
+										},
 									},
-									callback: function (r) {
-										if (!r.exc) {
-											frappe.model.sync(r.message);
-											frappe.set_route("Form", r.message.doctype, r.message.name);
-										}
-									}
-								});
-								d.hide();
-							}
+									{
+										label: __("Scheduled Date"),
+										fieldname: "scheduled_date",
+										fieldtype: "Select",
+										options: "",
+										reqd: 1,
+										onchange: function () {
+											let field = d.get_field("item_name");
+											me.frm
+												.call("get_pending_data", {
+													item_name: field.value,
+													s_date: this.value,
+													data_type: "id",
+												})
+												.then((r) => {
+													schedule_id = r.message;
+												});
+										},
+									},
+								],
+								primary_action_label: "Create Visit",
+								primary_action(values) {
+									frappe.call({
+										method: "erpnext.maintenance.doctype.maintenance_schedule.maintenance_schedule.make_maintenance_visit",
+										args: {
+											item_name: values.item_name,
+											s_id: schedule_id,
+											source_name: me.frm.doc.name,
+										},
+										callback: function (r) {
+											if (!r.exc) {
+												frappe.model.sync(r.message);
+												frappe.set_route("Form", r.message.doctype, r.message.name);
+											}
+										},
+									});
+									d.hide();
+								},
+							});
+							d.show();
 						});
-						d.show();
-				});
-				}, __('Create'));
+					},
+					__("Create")
+				);
 			}
 		}
 	}
-
 };
 
-extend_cscript(cur_frm.cscript, new erpnext.maintenance.MaintenanceSchedule({frm: cur_frm}));
+extend_cscript(cur_frm.cscript, new erpnext.maintenance.MaintenanceSchedule({ frm: cur_frm }));
diff --git a/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.js b/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.js
index e2f6cb3..0a05791 100644
--- a/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.js
+++ b/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.js
@@ -2,11 +2,11 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.provide("erpnext.maintenance");
-frappe.ui.form.on('Maintenance Visit', {
+frappe.ui.form.on("Maintenance Visit", {
 	setup: function (frm) {
-		frm.set_query('contact_person', erpnext.queries.contact_query);
-		frm.set_query('customer_address', erpnext.queries.address_query);
-		frm.set_query('customer', erpnext.queries.customer);
+		frm.set_query("contact_person", erpnext.queries.contact_query);
+		frm.set_query("customer_address", erpnext.queries.address_query);
+		frm.set_query("customer", erpnext.queries.customer);
 	},
 	onload: function (frm) {
 		// filters for serial no based on item code
@@ -15,42 +15,44 @@
 			if (!item_code) {
 				return;
 			}
-			frappe.call({
-				method: "erpnext.maintenance.doctype.maintenance_schedule.maintenance_schedule.get_serial_nos_from_schedule",
-				args: {
-					schedule: frm.doc.maintenance_schedule,
-					item_code: item_code
-				}
-			}).then((r) => {
-				let serial_nos = r.message;
-				frm.set_query('serial_no', 'purposes', () => {
-					if (serial_nos.length > 0) {
+			frappe
+				.call({
+					method: "erpnext.maintenance.doctype.maintenance_schedule.maintenance_schedule.get_serial_nos_from_schedule",
+					args: {
+						schedule: frm.doc.maintenance_schedule,
+						item_code: item_code,
+					},
+				})
+				.then((r) => {
+					let serial_nos = r.message;
+					frm.set_query("serial_no", "purposes", () => {
+						if (serial_nos.length > 0) {
+							return {
+								filters: {
+									item_code: item_code,
+									name: ["in", serial_nos],
+								},
+							};
+						}
 						return {
 							filters: {
-								'item_code': item_code,
-								'name': ["in", serial_nos]
-							}
+								item_code: item_code,
+							},
 						};
-					}
-					return {
-						filters: {
-							'item_code': item_code
-						}
-					};
+					});
 				});
-			});
 		} else {
-			frm.set_query('serial_no', 'purposes', (frm, cdt, cdn) => {
+			frm.set_query("serial_no", "purposes", (frm, cdt, cdn) => {
 				let row = locals[cdt][cdn];
 				return {
 					filters: {
-						'item_code': row.item_code
-					}
+						item_code: row.item_code,
+					},
 				};
 			});
 		}
 		if (!frm.doc.status) {
-			frm.set_value({ status: 'Draft' });
+			frm.set_value({ status: "Draft" });
 		}
 		if (frm.doc.__islocal) {
 			frm.set_value({ mntc_date: frappe.datetime.get_today() });
@@ -60,25 +62,26 @@
 		erpnext.utils.get_party_details(frm);
 	},
 	customer_address: function (frm) {
-		erpnext.utils.get_address_display(frm, 'customer_address', 'address_display');
+		erpnext.utils.get_address_display(frm, "customer_address", "address_display");
 	},
 	contact_person: function (frm) {
 		erpnext.utils.get_contact_details(frm);
-	}
-})
+	},
+});
 
 // TODO commonify this code
 erpnext.maintenance.MaintenanceVisit = class MaintenanceVisit extends frappe.ui.form.Controller {
 	refresh() {
-		frappe.dynamic_link = {doc: this.frm.doc, fieldname: 'customer', doctype: 'Customer'}
+		frappe.dynamic_link = { doc: this.frm.doc, fieldname: "customer", doctype: "Customer" };
 
 		var me = this;
 
 		if (this.frm.doc.docstatus === 0) {
-			this.frm.add_custom_button(__('Maintenance Schedule'),
+			this.frm.add_custom_button(
+				__("Maintenance Schedule"),
 				function () {
 					if (!me.frm.doc.customer) {
-						frappe.msgprint(__('Please select Customer first'));
+						frappe.msgprint(__("Please select Customer first"));
 						return;
 					}
 					erpnext.utils.map_current_doc({
@@ -90,11 +93,14 @@
 						},
 						get_query_filters: {
 							docstatus: 1,
-							company: me.frm.doc.company
-						}
-					})
-				}, __("Get Items From"));
-			this.frm.add_custom_button(__('Warranty Claim'),
+							company: me.frm.doc.company,
+						},
+					});
+				},
+				__("Get Items From")
+			);
+			this.frm.add_custom_button(
+				__("Warranty Claim"),
 				function () {
 					erpnext.utils.map_current_doc({
 						method: "erpnext.support.doctype.warranty_claim.warranty_claim.make_maintenance_visit",
@@ -106,14 +112,17 @@
 						},
 						get_query_filters: {
 							status: ["in", "Open, Work in Progress"],
-							company: me.frm.doc.company
-						}
-					})
-				}, __("Get Items From"));
-			this.frm.add_custom_button(__('Sales Order'),
+							company: me.frm.doc.company,
+						},
+					});
+				},
+				__("Get Items From")
+			);
+			this.frm.add_custom_button(
+				__("Sales Order"),
 				function () {
 					if (!me.frm.doc.customer) {
-						frappe.msgprint(__('Please select Customer first'));
+						frappe.msgprint(__("Please select Customer first"));
 						return;
 					}
 					erpnext.utils.map_current_doc({
@@ -127,11 +136,13 @@
 							docstatus: 1,
 							company: me.frm.doc.company,
 							order_type: me.frm.doc.order_type,
-						}
-					})
-				}, __("Get Items From"));
+						},
+					});
+				},
+				__("Get Items From")
+			);
 		}
 	}
 };
 
-extend_cscript(cur_frm.cscript, new erpnext.maintenance.MaintenanceVisit({frm: cur_frm}));
+extend_cscript(cur_frm.cscript, new erpnext.maintenance.MaintenanceVisit({ frm: cur_frm }));
diff --git a/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit_list.js b/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit_list.js
index e98979d..c47706e 100644
--- a/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit_list.js
+++ b/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit_list.js
@@ -1,11 +1,15 @@
-frappe.listview_settings['Maintenance Visit'] = {
+frappe.listview_settings["Maintenance Visit"] = {
 	add_fields: ["customer", "customer_name", "completion_status", "maintenance_type"],
-	get_indicator: function(doc) {
+	get_indicator: function (doc) {
 		var s = doc.completion_status || "Pending";
-		return [__(s), {
-			"Pending": "blue",
-			"Partially Completed": "orange",
-			"Fully Completed": "green"
-		}[s], "completion_status,=," + doc.completion_status];
-	}
+		return [
+			__(s),
+			{
+				Pending: "blue",
+				"Partially Completed": "orange",
+				"Fully Completed": "green",
+			}[s],
+			"completion_status,=," + doc.completion_status,
+		];
+	},
 };
diff --git a/erpnext/manufacturing/doctype/blanket_order/blanket_order.js b/erpnext/manufacturing/doctype/blanket_order/blanket_order.js
index 716af85..9130109 100644
--- a/erpnext/manufacturing/doctype/blanket_order/blanket_order.js
+++ b/erpnext/manufacturing/doctype/blanket_order/blanket_order.js
@@ -1,60 +1,72 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Blanket Order', {
-	onload: function(frm) {
-		frm.trigger('set_tc_name_filter');
+frappe.ui.form.on("Blanket Order", {
+	onload: function (frm) {
+		frm.trigger("set_tc_name_filter");
 	},
 
-	setup: function(frm) {
+	setup: function (frm) {
 		frm.custom_make_buttons = {
-			'Purchase Order': 'Purchase Order',
-			'Sales Order': 'Sales Order',
-			'Quotation': 'Quotation',
+			"Purchase Order": "Purchase Order",
+			"Sales Order": "Sales Order",
+			Quotation: "Quotation",
 		};
 
 		frm.add_fetch("customer", "customer_name", "customer_name");
 		frm.add_fetch("supplier", "supplier_name", "supplier_name");
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		erpnext.hide_company(frm);
 		if (frm.doc.customer && frm.doc.docstatus === 1 && frm.doc.to_date > frappe.datetime.get_today()) {
-			frm.add_custom_button(__("Sales Order"), function() {
-				frappe.model.open_mapped_doc({
-					method: "erpnext.manufacturing.doctype.blanket_order.blanket_order.make_order",
-					frm: frm,
-					args: {
-						doctype: 'Sales Order'
-					}
-				});
-			}, __('Create'));
+			frm.add_custom_button(
+				__("Sales Order"),
+				function () {
+					frappe.model.open_mapped_doc({
+						method: "erpnext.manufacturing.doctype.blanket_order.blanket_order.make_order",
+						frm: frm,
+						args: {
+							doctype: "Sales Order",
+						},
+					});
+				},
+				__("Create")
+			);
 
-			frm.add_custom_button(__("Quotation"), function() {
-				frappe.model.open_mapped_doc({
-					method: "erpnext.manufacturing.doctype.blanket_order.blanket_order.make_order",
-					frm: frm,
-					args: {
-						doctype: 'Quotation'
-					}
-				});
-			}, __('Create'));
+			frm.add_custom_button(
+				__("Quotation"),
+				function () {
+					frappe.model.open_mapped_doc({
+						method: "erpnext.manufacturing.doctype.blanket_order.blanket_order.make_order",
+						frm: frm,
+						args: {
+							doctype: "Quotation",
+						},
+					});
+				},
+				__("Create")
+			);
 		}
 
 		if (frm.doc.supplier && frm.doc.docstatus === 1) {
-			frm.add_custom_button(__("Purchase Order"), function(){
-				frappe.model.open_mapped_doc({
-					method: "erpnext.manufacturing.doctype.blanket_order.blanket_order.make_order",
-					frm: frm,
-					args: {
-						doctype: 'Purchase Order'
-					}
-				});
-			}, __('Create'));
+			frm.add_custom_button(
+				__("Purchase Order"),
+				function () {
+					frappe.model.open_mapped_doc({
+						method: "erpnext.manufacturing.doctype.blanket_order.blanket_order.make_order",
+						frm: frm,
+						args: {
+							doctype: "Purchase Order",
+						},
+					});
+				},
+				__("Create")
+			);
 		}
 	},
 
-	onload_post_render: function(frm) {
+	onload_post_render: function (frm) {
 		frm.get_field("items").grid.set_multiple_add("item_code", "qty");
 	},
 
@@ -66,28 +78,28 @@
 		});
 	},
 
-	set_tc_name_filter: function(frm) {
-		if (frm.doc.blanket_order_type === 'Selling') {
-			frm.set_df_property("customer","reqd", 1);
-			frm.set_df_property("supplier","reqd", 0);
+	set_tc_name_filter: function (frm) {
+		if (frm.doc.blanket_order_type === "Selling") {
+			frm.set_df_property("customer", "reqd", 1);
+			frm.set_df_property("supplier", "reqd", 0);
 			frm.set_value("supplier", "");
 
-			frm.set_query("tc_name", function() {
+			frm.set_query("tc_name", function () {
 				return { filters: { selling: 1 } };
 			});
 		}
-		if (frm.doc.blanket_order_type === 'Purchasing') {
-			frm.set_df_property("supplier","reqd", 1);
-			frm.set_df_property("customer","reqd", 0);
+		if (frm.doc.blanket_order_type === "Purchasing") {
+			frm.set_df_property("supplier", "reqd", 1);
+			frm.set_df_property("customer", "reqd", 0);
 			frm.set_value("customer", "");
 
-			frm.set_query("tc_name", function() {
+			frm.set_query("tc_name", function () {
 				return { filters: { buying: 1 } };
 			});
 		}
 	},
 
 	blanket_order_type: function (frm) {
-		frm.trigger('set_tc_name_filter');
-	}
+		frm.trigger("set_tc_name_filter");
+	},
 });
diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js
index 8c671e2..2ac28ea 100644
--- a/erpnext/manufacturing/doctype/bom/bom.js
+++ b/erpnext/manufacturing/doctype/bom/bom.js
@@ -6,139 +6,150 @@
 frappe.ui.form.on("BOM", {
 	setup(frm) {
 		frm.custom_make_buttons = {
-			'Work Order': 'Work Order',
-			'Quality Inspection': 'Quality Inspection'
+			"Work Order": "Work Order",
+			"Quality Inspection": "Quality Inspection",
 		};
 
-		frm.set_query("bom_no", "items", function() {
+		frm.set_query("bom_no", "items", function () {
 			return {
 				filters: {
-					'currency': frm.doc.currency,
-					'company': frm.doc.company
-				}
+					currency: frm.doc.currency,
+					company: frm.doc.company,
+				},
 			};
 		});
 
-		frm.set_query("source_warehouse", "items", function() {
+		frm.set_query("source_warehouse", "items", function () {
 			return {
 				filters: {
-					'company': frm.doc.company
-				}
+					company: frm.doc.company,
+				},
 			};
 		});
 
-		frm.set_query("item", function() {
+		frm.set_query("item", function () {
 			return {
 				query: "erpnext.manufacturing.doctype.bom.bom.item_query",
 				filters: {
-					"is_stock_item": 1
-				}
+					is_stock_item: 1,
+				},
 			};
 		});
 
-		frm.set_query("project", function() {
-			return{
-				filters:[
-					['Project', 'status', 'not in', 'Completed, Cancelled']
-				]
+		frm.set_query("project", function () {
+			return {
+				filters: [["Project", "status", "not in", "Completed, Cancelled"]],
 			};
 		});
 
-		frm.set_query("item_code", "items", function(doc) {
+		frm.set_query("item_code", "items", function (doc) {
 			return {
 				query: "erpnext.manufacturing.doctype.bom.bom.item_query",
 				filters: {
-					"include_item_in_manufacturing": 1,
-					"is_fixed_asset": 0
-				}
+					include_item_in_manufacturing: 1,
+					is_fixed_asset: 0,
+				},
 			};
 		});
 
-		frm.set_query("bom_no", "items", function(doc, cdt, cdn) {
+		frm.set_query("bom_no", "items", function (doc, cdt, cdn) {
 			var d = locals[cdt][cdn];
 			return {
 				filters: {
-					'item': d.item_code,
-					'is_active': 1,
-					'docstatus': 1
-				}
+					item: d.item_code,
+					is_active: 1,
+					docstatus: 1,
+				},
 			};
 		});
 	},
 
-	validate: function(frm) {
+	validate: function (frm) {
 		if (frm.doc.fg_based_operating_cost && frm.doc.with_operations) {
-			frappe.throw({message: __("Please check either with operations or FG Based Operating Cost."), title: __("Mandatory")});
+			frappe.throw({
+				message: __("Please check either with operations or FG Based Operating Cost."),
+				title: __("Mandatory"),
+			});
 		}
 	},
 
-	with_operations: function(frm) {
+	with_operations: function (frm) {
 		frm.set_df_property("fg_based_operating_cost", "hidden", frm.doc.with_operations ? 1 : 0);
 	},
 
-	fg_based_operating_cost: function(frm) {
+	fg_based_operating_cost: function (frm) {
 		frm.set_df_property("with_operations", "hidden", frm.doc.fg_based_operating_cost ? 1 : 0);
 	},
 
-	onload_post_render: function(frm) {
+	onload_post_render: function (frm) {
 		frm.get_field("items").grid.set_multiple_add("item_code", "qty");
 	},
 
 	refresh(frm) {
 		frm.toggle_enable("item", frm.doc.__islocal);
 
-		frm.set_indicator_formatter('item_code',
-			function(doc) {
-				if (doc.original_item){
-					return (doc.item_code != doc.original_item) ? "orange" : ""
-				}
-				return ""
+		frm.set_indicator_formatter("item_code", function (doc) {
+			if (doc.original_item) {
+				return doc.item_code != doc.original_item ? "orange" : "";
 			}
-		)
+			return "";
+		});
 
-		if (!frm.is_new() && frm.doc.docstatus<2) {
-			frm.add_custom_button(__("Update Cost"), function() {
+		if (!frm.is_new() && frm.doc.docstatus < 2) {
+			frm.add_custom_button(__("Update Cost"), function () {
 				frm.events.update_cost(frm, true);
 			});
-			frm.add_custom_button(__("Browse BOM"), function() {
+			frm.add_custom_button(__("Browse BOM"), function () {
 				frappe.route_options = {
-					"bom": frm.doc.name
+					bom: frm.doc.name,
 				};
 				frappe.set_route("Tree", "BOM");
 			});
 		}
 
 		if (!frm.is_new() && !frm.doc.docstatus == 0) {
-			frm.add_custom_button(__("New Version"), function() {
+			frm.add_custom_button(__("New Version"), function () {
 				let new_bom = frappe.model.copy_doc(frm.doc);
 				frappe.set_route("Form", "BOM", new_bom.name);
 			});
 		}
 
-		if(frm.doc.docstatus==1) {
-			frm.add_custom_button(__("Work Order"), function() {
-				frm.trigger("make_work_order");
-			}, __("Create"));
+		if (frm.doc.docstatus == 1) {
+			frm.add_custom_button(
+				__("Work Order"),
+				function () {
+					frm.trigger("make_work_order");
+				},
+				__("Create")
+			);
 
 			if (frm.doc.has_variants) {
-				frm.add_custom_button(__("Variant BOM"), function() {
-					frm.trigger("make_variant_bom");
-				}, __("Create"));
+				frm.add_custom_button(
+					__("Variant BOM"),
+					function () {
+						frm.trigger("make_variant_bom");
+					},
+					__("Create")
+				);
 			}
 
 			if (frm.doc.inspection_required) {
-				frm.add_custom_button(__("Quality Inspection"), function() {
-					frm.trigger("make_quality_inspection");
-				}, __("Create"));
+				frm.add_custom_button(
+					__("Quality Inspection"),
+					function () {
+						frm.trigger("make_quality_inspection");
+					},
+					__("Create")
+				);
 			}
 
-			frm.page.set_inner_btn_group_as_primary(__('Create'));
+			frm.page.set_inner_btn_group_as_primary(__("Create"));
 		}
 
-		if(frm.doc.items && frm.doc.allow_alternative_item) {
-			const has_alternative = frm.doc.items.find(i => i.allow_alternative_item === 1);
+		if (frm.doc.items && frm.doc.allow_alternative_item) {
+			const has_alternative = frm.doc.items.find((i) => i.allow_alternative_item === 1);
 			if (frm.doc.docstatus == 0 && has_alternative) {
-				frm.add_custom_button(__('Alternate Item'), () => {
+				frm.add_custom_button(__("Alternate Item"), () => {
 					erpnext.utils.select_alternate_items({
 						frm: frm,
 						child_docname: "items",
@@ -146,23 +157,26 @@
 						child_doctype: "BOM Item",
 						original_item_field: "original_item",
 						condition: (d) => {
-							if (d.allow_alternative_item) {return true;}
-						}
-					})
+							if (d.allow_alternative_item) {
+								return true;
+							}
+						},
+					});
 				});
 			}
 		}
 
-
 		if (frm.doc.has_variants) {
-			frm.set_intro(__('This is a Template BOM and will be used to make the work order for {0} of the item {1}',
-				[
+			frm.set_intro(
+				__("This is a Template BOM and will be used to make the work order for {0} of the item {1}", [
 					`<a class="variants-intro">variants</a>`,
 					`<a href="/app/item/${frm.doc.item}">${frm.doc.item}</a>`,
-				]), true);
+				]),
+				true
+			);
 
 			frm.$wrapper.find(".variants-intro").on("click", () => {
-				frappe.set_route("List", "Item", {"variant_of": frm.doc.item});
+				frappe.set_route("List", "Item", { variant_of: frm.doc.item });
 			});
 		}
 	},
@@ -176,38 +190,43 @@
 					item: item,
 					qty: data.qty || 0.0,
 					project: frm.doc.project,
-					variant_items: variant_items
+					variant_items: variant_items,
 				},
 				freeze: true,
 				callback(r) {
-					if(r.message) {
+					if (r.message) {
 						let doc = frappe.model.sync(r.message)[0];
 						frappe.set_route("Form", doc.doctype, doc.name);
 					}
-				}
+				},
 			});
 		});
 	},
 
 	make_variant_bom(frm) {
-		frm.events.setup_variant_prompt(frm, "Variant BOM", (frm, item, data, variant_items) => {
-			frappe.call({
-				method: "erpnext.manufacturing.doctype.bom.bom.make_variant_bom",
-				args: {
-					source_name: frm.doc.name,
-					bom_no: frm.doc.name,
-					item: item,
-					variant_items: variant_items
-				},
-				freeze: true,
-				callback(r) {
-					if(r.message) {
-						let doc = frappe.model.sync(r.message)[0];
-						frappe.set_route("Form", doc.doctype, doc.name);
-					}
-				}
-			});
-		}, true);
+		frm.events.setup_variant_prompt(
+			frm,
+			"Variant BOM",
+			(frm, item, data, variant_items) => {
+				frappe.call({
+					method: "erpnext.manufacturing.doctype.bom.bom.make_variant_bom",
+					args: {
+						source_name: frm.doc.name,
+						bom_no: frm.doc.name,
+						item: item,
+						variant_items: variant_items,
+					},
+					freeze: true,
+					callback(r) {
+						if (r.message) {
+							let doc = frappe.model.sync(r.message)[0];
+							frappe.set_route("Form", doc.doctype, doc.name);
+						}
+					},
+				});
+			},
+			true
+		);
 	},
 
 	setup_variant_prompt(frm, title, callback, skip_qty_field) {
@@ -215,27 +234,27 @@
 
 		if (frm.doc.has_variants) {
 			fields.push({
-				fieldtype: 'Link',
-				label: __('Variant Item'),
-				fieldname: 'item',
+				fieldtype: "Link",
+				label: __("Variant Item"),
+				fieldname: "item",
 				options: "Item",
 				reqd: 1,
 				get_query() {
 					return {
 						query: "erpnext.controllers.queries.item_query",
 						filters: {
-							"variant_of": frm.doc.item
-						}
+							variant_of: frm.doc.item,
+						},
 					};
-				}
+				},
 			});
 		}
 
 		if (!skip_qty_field) {
 			fields.push({
-				fieldtype: 'Float',
-				label: __('Qty To Manufacture'),
-				fieldname: 'qty',
+				fieldtype: "Float",
+				label: __("Qty To Manufacture"),
+				fieldname: "qty",
 				reqd: 1,
 				default: 1,
 				onchange: () => {
@@ -244,29 +263,23 @@
 						acc[item.item_code] = item.qty;
 						return acc;
 					}, {});
-					const mf_qty = cur_dialog.fields_list.filter(
-						(f) => f.df.fieldname === "qty"
-					)[0]?.value;
-					const items = cur_dialog.fields.filter(
-						(f) => f.fieldname === "items"
-					)[0]?.data;
+					const mf_qty = cur_dialog.fields_list.filter((f) => f.df.fieldname === "qty")[0]?.value;
+					const items = cur_dialog.fields.filter((f) => f.fieldname === "items")[0]?.data;
 
 					if (!items) {
 						return;
 					}
 
 					items.forEach((item) => {
-						item.qty =
-							(variant_items_map[item.item_code] * mf_qty) /
-							quantity;
+						item.qty = (variant_items_map[item.item_code] * mf_qty) / quantity;
 					});
 
 					cur_dialog.refresh();
-				}
+				},
 			});
 		}
 
-		var has_template_rm = frm.doc.items.filter(d => d.has_variants === 1) || [];
+		var has_template_rm = frm.doc.items.filter((d) => d.has_variants === 1) || [];
 		if (has_template_rm && has_template_rm.length > 0) {
 			fields.push({
 				fieldname: "items",
@@ -296,10 +309,10 @@
 							return {
 								query: "erpnext.controllers.queries.item_query",
 								filters: {
-									"variant_of": data.item_code
-								}
+									variant_of: data.item_code,
+								},
 							};
-						}
+						},
 					},
 					{
 						fieldname: "qty",
@@ -312,44 +325,48 @@
 						fieldname: "source_warehouse",
 						label: __("Source Warehouse"),
 						fieldtype: "Link",
-						options: "Warehouse"
+						options: "Warehouse",
 					},
 					{
 						fieldname: "operation",
 						label: __("Operation"),
 						fieldtype: "Data",
 						hidden: 1,
-					}
+					},
 				],
 				in_place_edit: true,
 				data: [],
-				get_data () {
+				get_data() {
 					return [];
 				},
 			});
 		}
 
-		let dialog = frappe.prompt(fields, data => {
-			let item = data.item || frm.doc.item;
-			let variant_items = data.items || [];
+		let dialog = frappe.prompt(
+			fields,
+			(data) => {
+				let item = data.item || frm.doc.item;
+				let variant_items = data.items || [];
 
-			variant_items.forEach(d => {
-				if (!d.variant_item_code) {
-					frappe.throw(__("Select variant item code for the template item {0}", [d.item_code]));
-				}
-			})
+				variant_items.forEach((d) => {
+					if (!d.variant_item_code) {
+						frappe.throw(__("Select variant item code for the template item {0}", [d.item_code]));
+					}
+				});
 
-			callback(frm, item, data, variant_items);
+				callback(frm, item, data, variant_items);
+			},
+			__(title),
+			__("Create")
+		);
 
-		}, __(title), __("Create"));
-
-		has_template_rm.forEach(d => {
+		has_template_rm.forEach((d) => {
 			dialog.fields_dict.items.df.data.push({
-				"item_code": d.item_code,
-				"variant_item_code": "",
-				"qty": d.qty,
-				"source_warehouse": d.source_warehouse,
-				"operation": d.operation
+				item_code: d.item_code,
+				variant_item_code: "",
+				qty: d.qty,
+				source_warehouse: d.source_warehouse,
+				operation: d.operation,
 			});
 		});
 
@@ -361,11 +378,11 @@
 	make_quality_inspection(frm) {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.stock.doctype.quality_inspection.quality_inspection.make_quality_inspection",
-			frm: frm
-		})
+			frm: frm,
+		});
 	},
 
-	update_cost(frm, save_doc=false) {
+	update_cost(frm, save_doc = false) {
 		return frappe.call({
 			doc: frm.doc,
 			method: "update_cost",
@@ -373,12 +390,12 @@
 			args: {
 				update_parent: true,
 				save: save_doc,
-				from_child_bom: false
+				from_child_bom: false,
 			},
 			callback(r) {
 				refresh_field("items");
-				if(!r.exc) frm.refresh_fields();
-			}
+				if (!r.exc) frm.refresh_fields();
+			},
 		});
 	},
 
@@ -400,39 +417,39 @@
 						erpnext.bom.calculate_op_cost(frm.doc);
 						erpnext.bom.calculate_total(frm.doc);
 					}
-				}
+				},
 			});
 		}
 	},
 
 	process_loss_percentage(frm) {
-		let qty = 0.0
+		let qty = 0.0;
 		if (frm.doc.process_loss_percentage) {
 			qty = (frm.doc.quantity * frm.doc.process_loss_percentage) / 100;
 		}
 
 		frm.set_value("process_loss_qty", qty);
-	}
+	},
 });
 
 erpnext.bom.BomController = class BomController extends erpnext.TransactionController {
 	conversion_rate(doc) {
-		if(this.frm.doc.currency === this.get_company_currency()) {
+		if (this.frm.doc.currency === this.get_company_currency()) {
 			this.frm.set_value("conversion_rate", 1.0);
 		} else {
 			erpnext.bom.update_cost(doc);
 		}
 	}
 
-	item_code(doc, cdt, cdn){
+	item_code(doc, cdt, cdn) {
 		var scrap_items = false;
 		var child = locals[cdt][cdn];
-		if (child.doctype == 'BOM Scrap Item') {
+		if (child.doctype == "BOM Scrap Item") {
 			scrap_items = true;
 		}
 
 		if (child.bom_no) {
-			child.bom_no = '';
+			child.bom_no = "";
 		}
 
 		get_bom_material_detail(doc, cdt, cdn, scrap_items);
@@ -460,26 +477,26 @@
 	}
 };
 
-extend_cscript(cur_frm.cscript, new erpnext.bom.BomController({frm: cur_frm}));
+extend_cscript(cur_frm.cscript, new erpnext.bom.BomController({ frm: cur_frm }));
 
-cur_frm.cscript.hour_rate = function(doc) {
+cur_frm.cscript.hour_rate = function (doc) {
 	erpnext.bom.calculate_op_cost(doc);
 	erpnext.bom.calculate_total(doc);
 };
 
 cur_frm.cscript.time_in_mins = cur_frm.cscript.hour_rate;
 
-cur_frm.cscript.bom_no = function(doc, cdt, cdn) {
+cur_frm.cscript.bom_no = function (doc, cdt, cdn) {
 	get_bom_material_detail(doc, cdt, cdn, false);
 };
 
-cur_frm.cscript.is_default = function(doc) {
+cur_frm.cscript.is_default = function (doc) {
 	if (doc.is_default) cur_frm.set_value("is_active", 1);
 };
 
-var get_bom_material_detail = function(doc, cdt, cdn, scrap_items) {
+var get_bom_material_detail = function (doc, cdt, cdn, scrap_items) {
 	if (!doc.company) {
-		frappe.throw({message: __("Please select a Company first."), title: __("Mandatory")});
+		frappe.throw({ message: __("Please select a Company first."), title: __("Mandatory") });
 	}
 
 	var d = locals[cdt][cdn];
@@ -488,20 +505,20 @@
 			doc: doc,
 			method: "get_bom_material_detail",
 			args: {
-				"company": doc.company,
-				"item_code": d.item_code,
-				"bom_no": d.bom_no != null ? d.bom_no: '',
-				"scrap_items": scrap_items,
-				"qty": d.qty,
-				"stock_qty": d.stock_qty,
-				"include_item_in_manufacturing": d.include_item_in_manufacturing,
-				"uom": d.uom,
-				"stock_uom": d.stock_uom,
-				"conversion_factor": d.conversion_factor,
-				"sourced_by_supplier": d.sourced_by_supplier,
-				"do_not_explode": d.do_not_explode
+				company: doc.company,
+				item_code: d.item_code,
+				bom_no: d.bom_no != null ? d.bom_no : "",
+				scrap_items: scrap_items,
+				qty: d.qty,
+				stock_qty: d.stock_qty,
+				include_item_in_manufacturing: d.include_item_in_manufacturing,
+				uom: d.uom,
+				stock_uom: d.stock_uom,
+				conversion_factor: d.conversion_factor,
+				sourced_by_supplier: d.sourced_by_supplier,
+				do_not_explode: d.do_not_explode,
 			},
-			callback: function(r) {
+			callback: function (r) {
 				d = locals[cdt][cdn];
 
 				$.extend(d, r.message);
@@ -513,18 +530,18 @@
 				erpnext.bom.calculate_scrap_materials_cost(doc);
 				erpnext.bom.calculate_total(doc);
 			},
-			freeze: true
+			freeze: true,
 		});
 	}
 };
 
-cur_frm.cscript.qty = function(doc) {
+cur_frm.cscript.qty = function (doc) {
 	erpnext.bom.calculate_rm_cost(doc);
 	erpnext.bom.calculate_scrap_materials_cost(doc);
 	erpnext.bom.calculate_total(doc);
 };
 
-cur_frm.cscript.rate = function(doc, cdt, cdn) {
+cur_frm.cscript.rate = function (doc, cdt, cdn) {
 	var d = locals[cdt][cdn];
 	const is_scrap_item = cdt == "BOM Scrap Item";
 
@@ -538,52 +555,60 @@
 	}
 };
 
-erpnext.bom.update_cost = function(doc) {
+erpnext.bom.update_cost = function (doc) {
 	erpnext.bom.calculate_op_cost(doc);
 	erpnext.bom.calculate_rm_cost(doc);
 	erpnext.bom.calculate_scrap_materials_cost(doc);
 	erpnext.bom.calculate_total(doc);
 };
 
-erpnext.bom.calculate_op_cost = function(doc) {
+erpnext.bom.calculate_op_cost = function (doc) {
 	doc.operating_cost = 0.0;
 	doc.base_operating_cost = 0.0;
 
-	if(doc.with_operations) {
+	if (doc.with_operations) {
 		doc.operations.forEach((item) => {
-			let operating_cost = flt(flt(item.hour_rate) * flt(item.time_in_mins) / 60, 2);
+			let operating_cost = flt((flt(item.hour_rate) * flt(item.time_in_mins)) / 60, 2);
 			let base_operating_cost = flt(operating_cost * doc.conversion_rate, 2);
-			frappe.model.set_value('BOM Operation',item.name, {
-				"operating_cost": operating_cost,
-				"base_operating_cost": base_operating_cost
+			frappe.model.set_value("BOM Operation", item.name, {
+				operating_cost: operating_cost,
+				base_operating_cost: base_operating_cost,
 			});
 
 			doc.operating_cost += operating_cost;
 			doc.base_operating_cost += base_operating_cost;
 		});
-	} else if(doc.fg_based_operating_cost) {
+	} else if (doc.fg_based_operating_cost) {
 		let total_operating_cost = doc.quantity * flt(doc.operating_cost_per_bom_quantity);
 		doc.operating_cost = total_operating_cost;
 		doc.base_operating_cost = flt(total_operating_cost * doc.conversion_rate, 2);
 	}
-	refresh_field(['operating_cost', 'base_operating_cost']);
+	refresh_field(["operating_cost", "base_operating_cost"]);
 };
 
 // rm : raw material
-erpnext.bom.calculate_rm_cost = function(doc) {
+erpnext.bom.calculate_rm_cost = function (doc) {
 	var rm = doc.items || [];
 	var total_rm_cost = 0;
 	var base_total_rm_cost = 0;
-	for(var i=0;i<rm.length;i++) {
+	for (var i = 0; i < rm.length; i++) {
 		var amount = flt(rm[i].rate) * flt(rm[i].qty);
 		var base_amount = amount * flt(doc.conversion_rate);
 
-		frappe.model.set_value('BOM Item', rm[i].name, 'base_rate',
-			flt(rm[i].rate) * flt(doc.conversion_rate));
-		frappe.model.set_value('BOM Item', rm[i].name, 'amount', amount);
-		frappe.model.set_value('BOM Item', rm[i].name, 'base_amount', base_amount);
-		frappe.model.set_value('BOM Item', rm[i].name,
-			'qty_consumed_per_unit', flt(rm[i].stock_qty)/flt(doc.quantity));
+		frappe.model.set_value(
+			"BOM Item",
+			rm[i].name,
+			"base_rate",
+			flt(rm[i].rate) * flt(doc.conversion_rate)
+		);
+		frappe.model.set_value("BOM Item", rm[i].name, "amount", amount);
+		frappe.model.set_value("BOM Item", rm[i].name, "base_amount", base_amount);
+		frappe.model.set_value(
+			"BOM Item",
+			rm[i].name,
+			"qty_consumed_per_unit",
+			flt(rm[i].stock_qty) / flt(doc.quantity)
+		);
 
 		total_rm_cost += amount;
 		base_total_rm_cost += base_amount;
@@ -593,19 +618,19 @@
 };
 
 // sm : scrap material
-erpnext.bom.calculate_scrap_materials_cost = function(doc) {
+erpnext.bom.calculate_scrap_materials_cost = function (doc) {
 	var sm = doc.scrap_items || [];
 	var total_sm_cost = 0;
 	var base_total_sm_cost = 0;
 
-	for(var i=0;i<sm.length;i++) {
+	for (var i = 0; i < sm.length; i++) {
 		var base_rate = flt(sm[i].rate) * flt(doc.conversion_rate);
 		var amount = flt(sm[i].rate) * flt(sm[i].stock_qty);
 		var base_amount = amount * flt(doc.conversion_rate);
 
-		frappe.model.set_value('BOM Scrap Item',sm[i].name, 'base_rate', base_rate);
-		frappe.model.set_value('BOM Scrap Item',sm[i].name, 'amount', amount);
-		frappe.model.set_value('BOM Scrap Item',sm[i].name, 'base_amount', base_amount);
+		frappe.model.set_value("BOM Scrap Item", sm[i].name, "base_rate", base_rate);
+		frappe.model.set_value("BOM Scrap Item", sm[i].name, "amount", amount);
+		frappe.model.set_value("BOM Scrap Item", sm[i].name, "base_amount", base_amount);
 
 		total_sm_cost += amount;
 		base_total_sm_cost += base_amount;
@@ -616,83 +641,87 @@
 };
 
 // Calculate Total Cost
-erpnext.bom.calculate_total = function(doc) {
+erpnext.bom.calculate_total = function (doc) {
 	var total_cost = flt(doc.operating_cost) + flt(doc.raw_material_cost) - flt(doc.scrap_material_cost);
-	var base_total_cost = flt(doc.base_operating_cost) + flt(doc.base_raw_material_cost)
-		- flt(doc.base_scrap_material_cost);
+	var base_total_cost =
+		flt(doc.base_operating_cost) + flt(doc.base_raw_material_cost) - flt(doc.base_scrap_material_cost);
 
 	cur_frm.set_value("total_cost", total_cost);
 	cur_frm.set_value("base_total_cost", base_total_cost);
 };
 
-cur_frm.cscript.validate = function(doc) {
+cur_frm.cscript.validate = function (doc) {
 	erpnext.bom.update_cost(doc);
 };
 
-frappe.ui.form.on("BOM Operation", "operation", function(frm, cdt, cdn) {
+frappe.ui.form.on("BOM Operation", "operation", function (frm, cdt, cdn) {
 	var d = locals[cdt][cdn];
 
-	if(!d.operation) return;
+	if (!d.operation) return;
 
 	frappe.call({
-		"method": "frappe.client.get",
+		method: "frappe.client.get",
 		args: {
 			doctype: "Operation",
-			name: d.operation
+			name: d.operation,
 		},
 		callback: function (data) {
-			if(data.message.description) {
+			if (data.message.description) {
 				frappe.model.set_value(d.doctype, d.name, "description", data.message.description);
 			}
-			if(data.message.workstation) {
+			if (data.message.workstation) {
 				frappe.model.set_value(d.doctype, d.name, "workstation", data.message.workstation);
 			}
-		}
+		},
 	});
 });
 
-frappe.ui.form.on("BOM Operation", "workstation", function(frm, cdt, cdn) {
+frappe.ui.form.on("BOM Operation", "workstation", function (frm, cdt, cdn) {
 	var d = locals[cdt][cdn];
-	if(!d.workstation) return;
+	if (!d.workstation) return;
 	frappe.call({
-		"method": "frappe.client.get",
+		method: "frappe.client.get",
 		args: {
 			doctype: "Workstation",
-			name: d.workstation
+			name: d.workstation,
 		},
 		callback: function (data) {
 			frappe.model.set_value(d.doctype, d.name, "base_hour_rate", data.message.hour_rate);
-			frappe.model.set_value(d.doctype, d.name, "hour_rate",
-				flt(flt(data.message.hour_rate) / flt(frm.doc.conversion_rate)), 2);
+			frappe.model.set_value(
+				d.doctype,
+				d.name,
+				"hour_rate",
+				flt(flt(data.message.hour_rate) / flt(frm.doc.conversion_rate)),
+				2
+			);
 
 			erpnext.bom.calculate_op_cost(frm.doc);
 			erpnext.bom.calculate_total(frm.doc);
-		}
+		},
 	});
 });
 
 frappe.ui.form.on("BOM Item", {
-	do_not_explode: function(frm, cdt, cdn) {
+	do_not_explode: function (frm, cdt, cdn) {
 		get_bom_material_detail(frm.doc, cdt, cdn, false);
-	}
-})
+	},
+});
 
-
-frappe.ui.form.on("BOM Item", "qty", function(frm, cdt, cdn) {
+frappe.ui.form.on("BOM Item", "qty", function (frm, cdt, cdn) {
 	var d = locals[cdt][cdn];
 	d.stock_qty = d.qty * d.conversion_factor;
 	refresh_field("stock_qty", d.name, d.parentfield);
 });
 
-frappe.ui.form.on("BOM Item", "item_code", function(frm, cdt, cdn) {
+frappe.ui.form.on("BOM Item", "item_code", function (frm, cdt, cdn) {
 	var d = locals[cdt][cdn];
-	frappe.db.get_value('Item', {name: d.item_code}, 'allow_alternative_item', (r) => {
-		d.allow_alternative_item = r.allow_alternative_item
-	})
+	frappe.db.get_value("Item", { name: d.item_code }, "allow_alternative_item", (r) => {
+		d.allow_alternative_item = r.allow_alternative_item;
+	});
 	refresh_field("allow_alternative_item", d.name, d.parentfield);
 });
 
-frappe.ui.form.on("BOM Item", "sourced_by_supplier", function(frm, cdt, cdn) {
+frappe.ui.form.on("BOM Item", "sourced_by_supplier", function (frm, cdt, cdn) {
 	var d = locals[cdt][cdn];
 	if (d.sourced_by_supplier) {
 		d.rate = 0;
@@ -700,7 +729,7 @@
 	}
 });
 
-frappe.ui.form.on("BOM Item", "rate", function(frm, cdt, cdn) {
+frappe.ui.form.on("BOM Item", "rate", function (frm, cdt, cdn) {
 	var d = locals[cdt][cdn];
 	if (d.sourced_by_supplier) {
 		d.rate = 0;
@@ -708,37 +737,41 @@
 	}
 });
 
-frappe.ui.form.on("BOM Operation", "operations_remove", function(frm) {
+frappe.ui.form.on("BOM Operation", "operations_remove", function (frm) {
 	erpnext.bom.calculate_op_cost(frm.doc);
 	erpnext.bom.calculate_total(frm.doc);
 });
 
-frappe.ui.form.on("BOM Item", "items_remove", function(frm) {
+frappe.ui.form.on("BOM Item", "items_remove", function (frm) {
 	erpnext.bom.calculate_rm_cost(frm.doc);
 	erpnext.bom.calculate_total(frm.doc);
 });
 
-frappe.tour['BOM'] = [
+frappe.tour["BOM"] = [
 	{
 		fieldname: "item",
 		title: "Item",
-		description: __("Select the Item to be manufactured. The Item name, UoM, Company, and Currency will be fetched automatically.")
+		description: __(
+			"Select the Item to be manufactured. The Item name, UoM, Company, and Currency will be fetched automatically."
+		),
 	},
 	{
 		fieldname: "quantity",
 		title: "Quantity",
-		description: __("Enter the quantity of the Item that will be manufactured from this Bill of Materials.")
+		description: __(
+			"Enter the quantity of the Item that will be manufactured from this Bill of Materials."
+		),
 	},
 	{
 		fieldname: "with_operations",
 		title: "With Operations",
-		description: __("To add Operations tick the 'With Operations' checkbox.")
+		description: __("To add Operations tick the 'With Operations' checkbox."),
 	},
 	{
 		fieldname: "items",
 		title: "Raw Materials",
-		description: __("Select the raw materials (Items) required to manufacture the Item")
-	}
+		description: __("Select the raw materials (Items) required to manufacture the Item"),
+	},
 ];
 
 frappe.ui.form.on("BOM Scrap Item", {
diff --git a/erpnext/manufacturing/doctype/bom/bom_list.js b/erpnext/manufacturing/doctype/bom/bom_list.js
index 4b5887f..a26df54 100644
--- a/erpnext/manufacturing/doctype/bom/bom_list.js
+++ b/erpnext/manufacturing/doctype/bom/bom_list.js
@@ -1,16 +1,16 @@
-frappe.listview_settings['BOM'] = {
+frappe.listview_settings["BOM"] = {
 	add_fields: ["is_active", "is_default", "total_cost", "has_variants"],
-	get_indicator: function(doc) {
-		if(doc.is_active && doc.has_variants) {
+	get_indicator: function (doc) {
+		if (doc.is_active && doc.has_variants) {
 			return [__("Template"), "orange", "has_variants,=,Yes"];
-		} else if(doc.is_default) {
+		} else if (doc.is_default) {
 			return [__("Default"), "green", "is_default,=,Yes"];
-		} else if(doc.is_active) {
+		} else if (doc.is_active) {
 			return [__("Active"), "blue", "is_active,=,Yes"];
-		} else if(!doc.is_active) {
+		} else if (!doc.is_active) {
 			return [__("Not active"), "gray", "is_active,=,No"];
 		}
-	}
+	},
 };
 
 frappe.help.youtube_id["BOM"] = "hDV0c1OeWLo";
diff --git a/erpnext/manufacturing/doctype/bom/bom_tree.js b/erpnext/manufacturing/doctype/bom/bom_tree.js
index fb99add..534de0e 100644
--- a/erpnext/manufacturing/doctype/bom/bom_tree.js
+++ b/erpnext/manufacturing/doctype/bom/bom_tree.js
@@ -1,12 +1,12 @@
 frappe.treeview_settings["BOM"] = {
-	get_tree_nodes: 'erpnext.manufacturing.doctype.bom.bom.get_children',
+	get_tree_nodes: "erpnext.manufacturing.doctype.bom.bom.get_children",
 	filters: [
 		{
 			fieldname: "bom",
-			fieldtype:"Link",
+			fieldtype: "Link",
 			options: "BOM",
-			label: __("BOM")
-		}
+			label: __("BOM"),
+		},
 	],
 	title: "BOM",
 	breadcrumb: "Manufacturing",
@@ -14,21 +14,21 @@
 	root_label: "BOM", //fieldname from filters
 	get_tree_root: false,
 	show_expand_all: false,
-	get_label: function(node) {
-		if(node.data.qty) {
+	get_label: function (node) {
+		if (node.data.qty) {
 			return node.data.qty + " x " + node.data.item_code;
 		} else {
 			return node.data.item_code || node.data.value;
 		}
 	},
-	onload: function(me) {
+	onload: function (me) {
 		var label = frappe.get_route()[0] + "/" + frappe.get_route()[1];
-		if(frappe.pages[label]) {
+		if (frappe.pages[label]) {
 			delete frappe.pages[label];
 		}
 
 		var filter = me.opts.filters[0];
-		if(frappe.route_options && frappe.route_options[filter.fieldname]) {
+		if (frappe.route_options && frappe.route_options[filter.fieldname]) {
 			var val = frappe.route_options[filter.fieldname];
 			delete frappe.route_options[filter.fieldname];
 			filter.default = "";
@@ -41,28 +41,27 @@
 	toolbar: [
 		{ toggle_btn: true },
 		{
-			label:__("Edit"),
-			condition: function(node) {
+			label: __("Edit"),
+			condition: function (node) {
 				return node.expandable;
 			},
-			click: function(node) {
-
+			click: function (node) {
 				frappe.set_route("Form", "BOM", node.data.value);
-			}
-		}
+			},
+		},
 	],
 	menu_items: [
 		{
 			label: __("New BOM"),
-			action: function() {
-				frappe.new_doc("BOM", true)
+			action: function () {
+				frappe.new_doc("BOM", true);
 			},
-			condition: 'frappe.boot.user.can_create.indexOf("BOM") !== -1'
-		}
+			condition: 'frappe.boot.user.can_create.indexOf("BOM") !== -1',
+		},
 	],
-	onrender: function(node) {
-		if(node.is_root && node.data.value!="BOM") {
-			frappe.model.with_doc("BOM", node.data.value, function() {
+	onrender: function (node) {
+		if (node.is_root && node.data.value != "BOM") {
+			frappe.model.with_doc("BOM", node.data.value, function () {
 				var bom = frappe.model.get_doc("BOM", node.data.value);
 				node.data.image = escape(bom.image) || "";
 				node.data.description = bom.description || "";
@@ -70,5 +69,5 @@
 			});
 		}
 	},
-	view_template: 'bom_item_preview'
-}
+	view_template: "bom_item_preview",
+};
diff --git a/erpnext/manufacturing/doctype/bom_creator/bom_creator.js b/erpnext/manufacturing/doctype/bom_creator/bom_creator.js
index 3bd2021..32231aa 100644
--- a/erpnext/manufacturing/doctype/bom_creator/bom_creator.js
+++ b/erpnext/manufacturing/doctype/bom_creator/bom_creator.js
@@ -11,11 +11,10 @@
 		frm.dashboard.clear_comment();
 
 		if (!frm.is_new()) {
-			if ((!frappe.bom_configurator
-				|| frappe.bom_configurator.bom_configurator !== frm.doc.name)) {
+			if (!frappe.bom_configurator || frappe.bom_configurator.bom_configurator !== frm.doc.name) {
 				frm.trigger("build_tree");
 			}
-		} else if (!frm.doc.items?.length ) {
+		} else if (!frm.doc.items?.length) {
 			let $parent = $(frm.fields_dict["bom_creator"].wrapper);
 			$parent.empty();
 			frm.trigger("make_new_entry");
@@ -27,7 +26,7 @@
 		$parent.empty();
 		frm.toggle_enable("item_code", false);
 
-		frappe.require('bom_configurator.bundle.js').then(() => {
+		frappe.require("bom_configurator.bundle.js").then(() => {
 			frappe.bom_configurator = new frappe.ui.BOMConfigurator({
 				wrapper: $parent,
 				page: $parent,
@@ -45,7 +44,7 @@
 					label: __("Name"),
 					fieldtype: "Data",
 					fieldname: "name",
-					reqd: 1
+					reqd: 1,
 				},
 				{ fieldtype: "Column Break" },
 				{
@@ -62,7 +61,7 @@
 					fieldtype: "Link",
 					fieldname: "item_code",
 					options: "Item",
-					reqd: 1
+					reqd: 1,
 				},
 				{ fieldtype: "Column Break" },
 				{
@@ -70,7 +69,7 @@
 					fieldtype: "Float",
 					fieldname: "qty",
 					reqd: 1,
-					default: 1.0
+					default: 1.0,
 				},
 				{ fieldtype: "Section Break" },
 				{
@@ -79,7 +78,7 @@
 					fieldname: "currency",
 					options: "Currency",
 					reqd: 1,
-					default: frappe.defaults.get_global_default("currency")
+					default: frappe.defaults.get_global_default("currency"),
 				},
 				{ fieldtype: "Column Break" },
 				{
@@ -87,42 +86,40 @@
 					fieldtype: "Float",
 					fieldname: "conversion_rate",
 					reqd: 1,
-					default: 1.0
+					default: 1.0,
 				},
 			],
 			primary_action_label: __("Create"),
 			primary_action: (values) => {
 				values.doctype = frm.doc.doctype;
-				frappe.db
-					.insert(values)
-					.then((doc) => {
-						frappe.set_route("Form", doc.doctype, doc.name);
-					});
-			}
-		})
+				frappe.db.insert(values).then((doc) => {
+					frappe.set_route("Form", doc.doctype, doc.name);
+				});
+			},
+		});
 
 		dialog.fields_dict.item_code.get_query = "erpnext.controllers.queries.item_query";
 		dialog.show();
 	},
 
 	set_queries(frm) {
-		frm.set_query("bom_no", "items", function(doc, cdt, cdn) {
+		frm.set_query("bom_no", "items", function (doc, cdt, cdn) {
 			let item = frappe.get_doc(cdt, cdn);
 			return {
 				filters: {
 					item: item.item_code,
-				}
-			}
+				},
+			};
 		});
-		frm.set_query("item_code", "items", function() {
+		frm.set_query("item_code", "items", function () {
 			return {
 				query: "erpnext.controllers.queries.item_query",
-			}
+			};
 		});
-		frm.set_query("fg_item", "items", function() {
+		frm.set_query("fg_item", "items", function () {
 			return {
 				query: "erpnext.controllers.queries.item_query",
-			}
+			};
 		});
 	},
 
@@ -134,8 +131,7 @@
 
 	set_root_item(frm) {
 		if (frm.is_new() && frm.doc.items?.length) {
-			frappe.model.set_value(frm.doc.items[0].doctype,
-				frm.doc.items[0].name, "is_root", 1);
+			frappe.model.set_value(frm.doc.items[0].doctype, frm.doc.items[0].name, "is_root", 1);
 		}
 	},
 
@@ -157,8 +153,8 @@
 		frm.call({
 			method: "enqueue_create_boms",
 			doc: frm.doc,
-		})
-	}
+		});
+	},
 });
 
 frappe.ui.form.on("BOM Creator Item", {
@@ -176,24 +172,23 @@
 				method: "get_default_bom",
 				doc: frm.doc,
 				args: {
-					item_code: item.item_code
+					item_code: item.item_code,
 				},
 				callback(r) {
 					if (r.message) {
 						frappe.model.set_value(cdt, cdn, "bom_no", r.message);
 					}
-				}
-			})
+				},
+			});
 		} else {
 			frappe.model.set_value(cdt, cdn, "bom_no", "");
 		}
-	}
+	},
 });
 
-
 erpnext.bom.BomConfigurator = class BomConfigurator extends erpnext.TransactionController {
 	conversion_rate(doc) {
-		if(this.frm.doc.currency === this.get_company_currency()) {
+		if (this.frm.doc.currency === this.get_company_currency()) {
 			this.frm.set_value("conversion_rate", 1.0);
 		} else {
 			erpnext.bom.update_cost(doc);
@@ -222,4 +217,4 @@
 	}
 };
 
-extend_cscript(cur_frm.cscript, new erpnext.bom.BomConfigurator({frm: cur_frm}));
+extend_cscript(cur_frm.cscript, new erpnext.bom.BomConfigurator({ frm: cur_frm }));
diff --git a/erpnext/manufacturing/doctype/bom_creator/bom_creator_list.js b/erpnext/manufacturing/doctype/bom_creator/bom_creator_list.js
index 423b721..880994c 100644
--- a/erpnext/manufacturing/doctype/bom_creator/bom_creator_list.js
+++ b/erpnext/manufacturing/doctype/bom_creator/bom_creator_list.js
@@ -1,4 +1,4 @@
-frappe.listview_settings['BOM Creator'] = {
+frappe.listview_settings["BOM Creator"] = {
 	add_fields: ["status"],
 	get_indicator: function (doc) {
 		if (doc.status === "Draft") {
diff --git a/erpnext/manufacturing/doctype/bom_update_log/bom_update_log.js b/erpnext/manufacturing/doctype/bom_update_log/bom_update_log.js
index 6da808e..7664c29 100644
--- a/erpnext/manufacturing/doctype/bom_update_log/bom_update_log.js
+++ b/erpnext/manufacturing/doctype/bom_update_log/bom_update_log.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('BOM Update Log', {
+frappe.ui.form.on("BOM Update Log", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/manufacturing/doctype/bom_update_log/bom_update_log_list.js b/erpnext/manufacturing/doctype/bom_update_log/bom_update_log_list.js
index bc709d8..cdaee70 100644
--- a/erpnext/manufacturing/doctype/bom_update_log/bom_update_log_list.js
+++ b/erpnext/manufacturing/doctype/bom_update_log/bom_update_log_list.js
@@ -1,11 +1,11 @@
-frappe.listview_settings['BOM Update Log'] = {
+frappe.listview_settings["BOM Update Log"] = {
 	add_fields: ["status"],
 	get_indicator: (doc) => {
 		let status_map = {
-			"Queued": "orange",
+			Queued: "orange",
 			"In Progress": "blue",
-			"Completed": "green",
-			"Failed": "red"
+			Completed: "green",
+			Failed: "red",
 		};
 
 		return [__(doc.status), status_map[doc.status], "status,=," + doc.status];
@@ -15,16 +15,14 @@
 			return;
 		}
 
-		let sidebar_entry = $(
-			'<ul class="list-unstyled sidebar-menu log-retention-note"></ul>'
-		).appendTo(cur_list.page.sidebar);
+		let sidebar_entry = $('<ul class="list-unstyled sidebar-menu log-retention-note"></ul>').appendTo(
+			cur_list.page.sidebar
+		);
 		let message = __("Note: Automatic log deletion only applies to logs of type <i>Update Cost</i>");
 		$(`<hr><div class='text-muted'>${message}</div>`).appendTo(sidebar_entry);
 
 		frappe.require("logtypes.bundle.js", () => {
 			frappe.utils.logtypes.show_log_retention_message(cur_list.doctype);
 		});
-
-
 	},
-};
\ No newline at end of file
+};
diff --git a/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.js b/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.js
index 7ba6517..5cdb425 100644
--- a/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.js
+++ b/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.js
@@ -1,24 +1,24 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('BOM Update Tool', {
-	setup: function(frm) {
-		frm.set_query("current_bom", function() {
+frappe.ui.form.on("BOM Update Tool", {
+	setup: function (frm) {
+		frm.set_query("current_bom", function () {
 			return {
 				query: "erpnext.controllers.queries.bom",
-				filters: {name: "!" + frm.doc.new_bom}
+				filters: { name: "!" + frm.doc.new_bom },
 			};
 		});
 
-		frm.set_query("new_bom", function() {
+		frm.set_query("new_bom", function () {
 			return {
 				query: "erpnext.controllers.queries.bom",
-				filters: {name: "!" + frm.doc.current_bom}
+				filters: { name: "!" + frm.doc.current_bom },
 			};
 		});
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		frm.disable_save();
 		frm.events.disable_button(frm, "replace");
 
@@ -27,7 +27,7 @@
 		});
 	},
 
-	disable_button: (frm, field, disable=true) => {
+	disable_button: (frm, field, disable = true) => {
 		frm.get_field(field).input.disabled = disable;
 	},
 
@@ -50,15 +50,15 @@
 				freeze: true,
 				args: {
 					boms: {
-						"current_bom": frm.doc.current_bom,
-						"new_bom": frm.doc.new_bom
-					}
+						current_bom: frm.doc.current_bom,
+						new_bom: frm.doc.new_bom,
+					},
 				},
-				callback: result => {
+				callback: (result) => {
 					if (result && result.message && !result.exc) {
 						frm.events.confirm_job_start(frm, result.message);
 					}
-				}
+				},
 			});
 		}
 	},
@@ -67,20 +67,22 @@
 		frappe.call({
 			method: "erpnext.manufacturing.doctype.bom_update_tool.bom_update_tool.enqueue_update_cost",
 			freeze: true,
-			callback: result => {
+			callback: (result) => {
 				if (result && result.message && !result.exc) {
 					frm.events.confirm_job_start(frm, result.message);
 				}
-			}
+			},
 		});
 	},
 
 	confirm_job_start: (frm, log_data) => {
 		let log_link = frappe.utils.get_form_link("BOM Update Log", log_data.name, true);
 		frappe.msgprint({
-			"message": __("BOM Updation is queued and may take a few minutes. Check {0} for progress.", [log_link]),
-			"title": __("BOM Update Initiated"),
-			"indicator": "blue"
+			message: __("BOM Updation is queued and may take a few minutes. Check {0} for progress.", [
+				log_link,
+			]),
+			title: __("BOM Update Initiated"),
+			indicator: "blue",
 		});
-	}
+	},
 });
diff --git a/erpnext/manufacturing/doctype/downtime_entry/downtime_entry.js b/erpnext/manufacturing/doctype/downtime_entry/downtime_entry.js
index 3b7f5ba..516e33c 100644
--- a/erpnext/manufacturing/doctype/downtime_entry/downtime_entry.js
+++ b/erpnext/manufacturing/doctype/downtime_entry/downtime_entry.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Downtime Entry', {
+frappe.ui.form.on("Downtime Entry", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/manufacturing/doctype/job_card/job_card.js b/erpnext/manufacturing/doctype/job_card/job_card.js
index 6621275..4cc60a3 100644
--- a/erpnext/manufacturing/doctype/job_card/job_card.js
+++ b/erpnext/manufacturing/doctype/job_card/job_card.js
@@ -1,40 +1,38 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Job Card', {
-	setup: function(frm) {
-		frm.set_query('operation', function() {
+frappe.ui.form.on("Job Card", {
+	setup: function (frm) {
+		frm.set_query("operation", function () {
 			return {
-				query: 'erpnext.manufacturing.doctype.job_card.job_card.get_operations',
+				query: "erpnext.manufacturing.doctype.job_card.job_card.get_operations",
 				filters: {
-					'work_order': frm.doc.work_order
-				}
+					work_order: frm.doc.work_order,
+				},
 			};
 		});
 
 		frm.set_query("serial_and_batch_bundle", () => {
 			return {
 				filters: {
-					'item_code': frm.doc.production_item,
-					'voucher_type': frm.doc.doctype,
-					'voucher_no': ["in", [frm.doc.name, ""]],
-					'is_cancelled': 0,
-				}
-			}
+					item_code: frm.doc.production_item,
+					voucher_type: frm.doc.doctype,
+					voucher_no: ["in", [frm.doc.name, ""]],
+					is_cancelled: 0,
+				},
+			};
 		});
 
-		frm.set_indicator_formatter('sub_operation',
-			function(doc) {
-				if (doc.status == "Pending") {
-					return "red";
-				} else {
-					return doc.status === "Complete" ? "green" : "orange";
-				}
+		frm.set_indicator_formatter("sub_operation", function (doc) {
+			if (doc.status == "Pending") {
+				return "red";
+			} else {
+				return doc.status === "Complete" ? "green" : "orange";
 			}
-		);
+		});
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		frappe.flags.pause_job = 0;
 		frappe.flags.resume_job = 0;
 		let has_items = frm.doc.items && frm.doc.items.length;
@@ -44,8 +42,7 @@
 			return;
 		}
 
-		let has_stock_entry = frm.doc.__onload &&
-			frm.doc.__onload.has_stock_entry ? true : false;
+		let has_stock_entry = frm.doc.__onload && frm.doc.__onload.has_stock_entry ? true : false;
 
 		frm.toggle_enable("for_quantity", !has_stock_entry);
 
@@ -71,33 +68,45 @@
 		}
 
 		if (frm.doc.docstatus == 1 && !frm.doc.is_corrective_job_card) {
-			frm.trigger('setup_corrective_job_card');
+			frm.trigger("setup_corrective_job_card");
 		}
 
-		frm.set_query("quality_inspection", function() {
+		frm.set_query("quality_inspection", function () {
 			return {
 				query: "erpnext.stock.doctype.quality_inspection.quality_inspection.quality_inspection_query",
 				filters: {
-					"item_code": frm.doc.production_item,
-					"reference_name": frm.doc.name
-				}
+					item_code: frm.doc.production_item,
+					reference_name: frm.doc.name,
+				},
 			};
 		});
 
 		frm.trigger("toggle_operation_number");
 
-		if (frm.doc.docstatus == 0 && !frm.is_new() &&
-			(frm.doc.for_quantity > frm.doc.total_completed_qty || !frm.doc.for_quantity)
-			&& (frm.doc.items || !frm.doc.items.length || frm.doc.for_quantity == frm.doc.transferred_qty)) {
-
+		if (
+			frm.doc.docstatus == 0 &&
+			!frm.is_new() &&
+			(frm.doc.for_quantity > frm.doc.total_completed_qty || !frm.doc.for_quantity) &&
+			(frm.doc.items || !frm.doc.items.length || frm.doc.for_quantity == frm.doc.transferred_qty)
+		) {
 			// if Job Card is link to Work Order, the job card must not be able to start if Work Order not "Started"
 			// and if stock mvt for WIP is required
 			if (frm.doc.work_order) {
-				frappe.db.get_value('Work Order', frm.doc.work_order, ['skip_transfer', 'status'], (result) => {
-					if (result.skip_transfer === 1 || result.status == 'In Process' || frm.doc.transferred_qty > 0 || !frm.doc.items.length) {
-						frm.trigger("prepare_timer_buttons");
+				frappe.db.get_value(
+					"Work Order",
+					frm.doc.work_order,
+					["skip_transfer", "status"],
+					(result) => {
+						if (
+							result.skip_transfer === 1 ||
+							result.status == "In Process" ||
+							frm.doc.transferred_qty > 0 ||
+							!frm.doc.items.length
+						) {
+							frm.trigger("prepare_timer_buttons");
+						}
 					}
-				});
+				);
 			} else {
 				frm.trigger("prepare_timer_buttons");
 			}
@@ -106,100 +115,114 @@
 		frm.trigger("setup_quality_inspection");
 
 		if (frm.doc.work_order) {
-			frappe.db.get_value('Work Order', frm.doc.work_order,
-				'transfer_material_against').then((r) => {
-				if (r.message.transfer_material_against == 'Work Order') {
-					frm.set_df_property('items', 'hidden', 1);
+			frappe.db.get_value("Work Order", frm.doc.work_order, "transfer_material_against").then((r) => {
+				if (r.message.transfer_material_against == "Work Order") {
+					frm.set_df_property("items", "hidden", 1);
 				}
 			});
 		}
 
-		let sbb_field = frm.get_docfield('serial_and_batch_bundle');
+		let sbb_field = frm.get_docfield("serial_and_batch_bundle");
 		if (sbb_field) {
 			sbb_field.get_route_options_for_new_doc = () => {
 				return {
-					'item_code': frm.doc.production_item,
-					'warehouse': frm.doc.wip_warehouse,
-					'voucher_type': frm.doc.doctype,
-				}
+					item_code: frm.doc.production_item,
+					warehouse: frm.doc.wip_warehouse,
+					voucher_type: frm.doc.doctype,
+				};
 			};
 		}
 	},
 
-	setup_quality_inspection: function(frm) {
+	setup_quality_inspection: function (frm) {
 		let quality_inspection_field = frm.get_docfield("quality_inspection");
-		quality_inspection_field.get_route_options_for_new_doc = function(frm) {
-			return  {
-				"inspection_type": "In Process",
-				"reference_type": "Job Card",
-				"reference_name": frm.doc.name,
-				"item_code": frm.doc.production_item,
-				"item_name": frm.doc.item_name,
-				"item_serial_no": frm.doc.serial_no,
-				"batch_no": frm.doc.batch_no,
-				"quality_inspection_template": frm.doc.quality_inspection_template,
+		quality_inspection_field.get_route_options_for_new_doc = function (frm) {
+			return {
+				inspection_type: "In Process",
+				reference_type: "Job Card",
+				reference_name: frm.doc.name,
+				item_code: frm.doc.production_item,
+				item_name: frm.doc.item_name,
+				item_serial_no: frm.doc.serial_no,
+				batch_no: frm.doc.batch_no,
+				quality_inspection_template: frm.doc.quality_inspection_template,
 			};
 		};
 	},
 
-	setup_corrective_job_card: function(frm) {
-		frm.add_custom_button(__('Corrective Job Card'), () => {
-			let operations = frm.doc.sub_operations.map(d => d.sub_operation).concat(frm.doc.operation);
+	setup_corrective_job_card: function (frm) {
+		frm.add_custom_button(
+			__("Corrective Job Card"),
+			() => {
+				let operations = frm.doc.sub_operations.map((d) => d.sub_operation).concat(frm.doc.operation);
 
-			let fields = [
-				{
-					fieldtype: 'Link', label: __('Corrective Operation'), options: 'Operation',
-					fieldname: 'operation', get_query() {
-						return {
-							filters: {
-								"is_corrective_operation": 1
-							}
-						};
-					}
-				}, {
-					fieldtype: 'Link', label: __('For Operation'), options: 'Operation',
-					fieldname: 'for_operation', get_query() {
-						return {
-							filters: {
-								"name": ["in", operations]
-							}
-						};
-					}
-				}
-			];
+				let fields = [
+					{
+						fieldtype: "Link",
+						label: __("Corrective Operation"),
+						options: "Operation",
+						fieldname: "operation",
+						get_query() {
+							return {
+								filters: {
+									is_corrective_operation: 1,
+								},
+							};
+						},
+					},
+					{
+						fieldtype: "Link",
+						label: __("For Operation"),
+						options: "Operation",
+						fieldname: "for_operation",
+						get_query() {
+							return {
+								filters: {
+									name: ["in", operations],
+								},
+							};
+						},
+					},
+				];
 
-			frappe.prompt(fields, d => {
-				frm.events.make_corrective_job_card(frm, d.operation, d.for_operation);
-			}, __("Select Corrective Operation"));
-		}, __('Make'));
+				frappe.prompt(
+					fields,
+					(d) => {
+						frm.events.make_corrective_job_card(frm, d.operation, d.for_operation);
+					},
+					__("Select Corrective Operation")
+				);
+			},
+			__("Make")
+		);
 	},
 
-	make_corrective_job_card: function(frm, operation, for_operation) {
+	make_corrective_job_card: function (frm, operation, for_operation) {
 		frappe.call({
-			method: 'erpnext.manufacturing.doctype.job_card.job_card.make_corrective_job_card',
+			method: "erpnext.manufacturing.doctype.job_card.job_card.make_corrective_job_card",
 			args: {
 				source_name: frm.doc.name,
 				operation: operation,
-				for_operation: for_operation
+				for_operation: for_operation,
 			},
-			callback: function(r) {
+			callback: function (r) {
 				if (r.message) {
 					frappe.model.sync(r.message);
 					frappe.set_route("Form", r.message.doctype, r.message.name);
 				}
-			}
+			},
 		});
 	},
 
-	operation: function(frm) {
+	operation: function (frm) {
 		frm.trigger("toggle_operation_number");
 
 		if (frm.doc.operation && frm.doc.work_order) {
 			frappe.call({
 				method: "erpnext.manufacturing.doctype.job_card.job_card.get_operation_details",
 				args: {
-					"work_order":frm.doc.work_order,
-					"operation":frm.doc.operation
+					work_order: frm.doc.work_order,
+					operation: frm.doc.operation,
 				},
 				callback: function (r) {
 					if (r.message) {
@@ -209,11 +232,13 @@
 							let args = [];
 
 							r.message.forEach((row) => {
-								args.push({ "label": row.idx, "value": row.name });
+								args.push({ label: row.idx, value: row.name });
 							});
 
-							let description = __("Operation {0} added multiple times in the work order {1}",
-								[frm.doc.operation, frm.doc.work_order]);
+							let description = __("Operation {0} added multiple times in the work order {1}", [
+								frm.doc.operation,
+								frm.doc.work_order,
+							]);
 
 							frm.set_df_property("operation_row_number", "options", args);
 							frm.set_df_property("operation_row_number", "description", description);
@@ -221,8 +246,8 @@
 
 						frm.trigger("toggle_operation_number");
 					}
-				}
-			})
+				},
+			});
 		}
 	},
 
@@ -237,16 +262,24 @@
 		frm.toggle_reqd("operation_row_number", !frm.doc.operation_id && frm.doc.operation);
 	},
 
-	prepare_timer_buttons: function(frm) {
+	prepare_timer_buttons: function (frm) {
 		frm.trigger("make_dashboard");
 
 		if (!frm.doc.started_time && !frm.doc.current_time) {
 			frm.add_custom_button(__("Start Job"), () => {
 				if ((frm.doc.employee && !frm.doc.employee.length) || !frm.doc.employee) {
-					frappe.prompt({fieldtype: 'Table MultiSelect', label: __('Select Employees'),
-						options: "Job Card Time Log", fieldname: 'employees'}, d => {
-						frm.events.start_job(frm, "Work In Progress", d.employees);
-					}, __("Assign Job to Employee"));
+					frappe.prompt(
+						{
+							fieldtype: "Table MultiSelect",
+							label: __("Select Employees"),
+							options: "Job Card Time Log",
+							fieldname: "employees",
+						},
+						(d) => {
+							frm.events.start_job(frm, "Work In Progress", d.employees);
+						},
+						__("Assign Job to Employee")
+					);
 				} else {
 					frm.events.start_job(frm, "Work In Progress", frm.doc.employee);
 				}
@@ -268,16 +301,24 @@
 					set_qty = false;
 					let last_op_row = sub_operations[sub_operations.length - 2];
 
-					if (last_op_row.status == 'Complete') {
+					if (last_op_row.status == "Complete") {
 						set_qty = true;
 					}
 				}
 
 				if (set_qty) {
-					frappe.prompt({fieldtype: 'Float', label: __('Completed Quantity'),
-						fieldname: 'qty', default: frm.doc.for_quantity}, data => {
-						frm.events.complete_job(frm, "Complete", data.qty);
-					}, __("Enter Value"));
+					frappe.prompt(
+						{
+							fieldtype: "Float",
+							label: __("Completed Quantity"),
+							fieldname: "qty",
+							default: frm.doc.for_quantity,
+						},
+						(data) => {
+							frm.events.complete_job(frm, "Complete", data.qty);
+						},
+						__("Enter Value")
+					);
 				} else {
 					frm.events.complete_job(frm, "Complete", 0.0);
 				}
@@ -285,64 +326,63 @@
 		}
 	},
 
-	start_job: function(frm, status, employee) {
+	start_job: function (frm, status, employee) {
 		const args = {
 			job_card_id: frm.doc.name,
 			start_time: frappe.datetime.now_datetime(),
 			employees: employee,
-			status: status
+			status: status,
 		};
 		frm.events.make_time_log(frm, args);
 	},
 
-	complete_job: function(frm, status, completed_qty) {
+	complete_job: function (frm, status, completed_qty) {
 		const args = {
 			job_card_id: frm.doc.name,
 			complete_time: frappe.datetime.now_datetime(),
 			status: status,
-			completed_qty: completed_qty
+			completed_qty: completed_qty,
 		};
 		frm.events.make_time_log(frm, args);
 	},
 
-	make_time_log: function(frm, args) {
+	make_time_log: function (frm, args) {
 		frm.events.update_sub_operation(frm, args);
 
 		frappe.call({
 			method: "erpnext.manufacturing.doctype.job_card.job_card.make_time_log",
 			args: {
-				args: args
+				args: args,
 			},
 			freeze: true,
 			callback: function () {
 				frm.reload_doc();
 				frm.trigger("make_dashboard");
-			}
+			},
 		});
 	},
 
-	update_sub_operation: function(frm, args) {
+	update_sub_operation: function (frm, args) {
 		if (frm.doc.sub_operations && frm.doc.sub_operations.length) {
-			let sub_operations = frm.doc.sub_operations.filter(d => d.status != 'Complete');
+			let sub_operations = frm.doc.sub_operations.filter((d) => d.status != "Complete");
 			if (sub_operations && sub_operations.length) {
 				args["sub_operation"] = sub_operations[0].sub_operation;
 			}
 		}
 	},
 
-	validate: function(frm) {
+	validate: function (frm) {
 		if ((!frm.doc.time_logs || !frm.doc.time_logs.length) && frm.doc.started_time) {
 			frm.trigger("reset_timer");
 		}
 	},
 
-	reset_timer: function(frm) {
-		frm.set_value('started_time' , '');
+	reset_timer: function (frm) {
+		frm.set_value("started_time", "");
 	},
 
-	make_dashboard: function(frm) {
-		if(frm.doc.__islocal)
-			return;
+	make_dashboard: function (frm) {
+		if (frm.doc.__islocal) return;
 
 		function setCurrentIncrement() {
 			currentIncrement += 1;
@@ -351,16 +391,22 @@
 
 		function updateStopwatch(increment) {
 			var hours = Math.floor(increment / 3600);
-			var minutes = Math.floor((increment - (hours * 3600)) / 60);
-			var seconds = increment - (hours * 3600) - (minutes * 60);
+			var minutes = Math.floor((increment - hours * 3600) / 60);
+			var seconds = increment - hours * 3600 - minutes * 60;
 
-			$(section).find(".hours").text(hours < 10 ? ("0" + hours.toString()) : hours.toString());
-			$(section).find(".minutes").text(minutes < 10 ? ("0" + minutes.toString()) : minutes.toString());
-			$(section).find(".seconds").text(seconds < 10 ? ("0" + seconds.toString()) : seconds.toString());
+			$(section)
+				.find(".hours")
+				.text(hours < 10 ? "0" + hours.toString() : hours.toString());
+			$(section)
+				.find(".minutes")
+				.text(minutes < 10 ? "0" + minutes.toString() : minutes.toString());
+			$(section)
+				.find(".seconds")
+				.text(seconds < 10 ? "0" + seconds.toString() : seconds.toString());
 		}
 
 		function initialiseTimer() {
-			const interval = setInterval(function() {
+			const interval = setInterval(function () {
 				var current = setCurrentIncrement();
 				updateStopwatch(current);
 			}, 1000);
@@ -384,75 +430,76 @@
 			if (frm.doc.status == "On Hold") {
 				updateStopwatch(currentIncrement);
 			} else {
-				currentIncrement += moment(frappe.datetime.now_datetime()).diff(moment(frm.doc.started_time),"seconds");
+				currentIncrement += moment(frappe.datetime.now_datetime()).diff(
+					moment(frm.doc.started_time),
+					"seconds"
+				);
 				initialiseTimer();
 			}
 		}
 	},
 
-	hide_timer: function(frm) {
+	hide_timer: function (frm) {
 		frm.toolbar.page.inner_toolbar.find(".stopwatch").remove();
 	},
 
-	for_quantity: function(frm) {
+	for_quantity: function (frm) {
 		frm.doc.items = [];
 		frm.call({
 			method: "get_required_items",
 			doc: frm.doc,
-			callback: function() {
+			callback: function () {
 				refresh_field("items");
-			}
-		})
+			},
+		});
 	},
 
-	make_material_request: function(frm) {
+	make_material_request: function (frm) {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.manufacturing.doctype.job_card.job_card.make_material_request",
 			frm: frm,
-			run_link_triggers: true
+			run_link_triggers: true,
 		});
 	},
 
-	make_stock_entry: function(frm) {
+	make_stock_entry: function (frm) {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.manufacturing.doctype.job_card.job_card.make_stock_entry",
 			frm: frm,
-			run_link_triggers: true
+			run_link_triggers: true,
 		});
 	},
 
-	timer: function(frm) {
-		return `<button> Start </button>`
+	timer: function (frm) {
+		return `<button> Start </button>`;
 	},
 
-	set_total_completed_qty: function(frm) {
+	set_total_completed_qty: function (frm) {
 		frm.doc.total_completed_qty = 0;
-		frm.doc.time_logs.forEach(d => {
+		frm.doc.time_logs.forEach((d) => {
 			if (d.completed_qty) {
 				frm.doc.total_completed_qty += d.completed_qty;
 			}
 		});
 
 		if (frm.doc.total_completed_qty && frm.doc.for_quantity > frm.doc.total_completed_qty) {
-			let flt_precision = precision('for_quantity', frm.doc);
-			let process_loss_qty = (
-				flt(frm.doc.for_quantity, flt_precision)
-				- flt(frm.doc.total_completed_qty, flt_precision)
-			);
+			let flt_precision = precision("for_quantity", frm.doc);
+			let process_loss_qty =
+				flt(frm.doc.for_quantity, flt_precision) - flt(frm.doc.total_completed_qty, flt_precision);
 
-			frm.set_value('process_loss_qty', process_loss_qty);
+			frm.set_value("process_loss_qty", process_loss_qty);
 		}
 
 		refresh_field("total_completed_qty");
-	}
+	},
 });
 
-frappe.ui.form.on('Job Card Time Log', {
-	completed_qty: function(frm) {
+frappe.ui.form.on("Job Card Time Log", {
+	completed_qty: function (frm) {
 		frm.events.set_total_completed_qty(frm);
 	},
 
-	to_time: function(frm) {
-		frm.set_value('started_time', '');
-	}
-})
+	to_time: function (frm) {
+		frm.set_value("started_time", "");
+	},
+});
diff --git a/erpnext/manufacturing/doctype/job_card/job_card_calendar.js b/erpnext/manufacturing/doctype/job_card/job_card_calendar.js
index 9e32085..7b32a6e 100644
--- a/erpnext/manufacturing/doctype/job_card/job_card_calendar.js
+++ b/erpnext/manufacturing/doctype/job_card/job_card_calendar.js
@@ -1,31 +1,31 @@
 frappe.views.calendar["Job Card"] = {
 	field_map: {
-		"start": "from_time",
-		"end": "to_time",
-		"id": "name",
-		"title": "subject",
-		"color": "color",
-		"allDay": "allDay",
-		"progress": "progress"
+		start: "from_time",
+		end: "to_time",
+		id: "name",
+		title: "subject",
+		color: "color",
+		allDay: "allDay",
+		progress: "progress",
 	},
 	gantt: {
 		field_map: {
-			"start": "expected_start_date",
-			"end": "expected_end_date",
-			"id": "name",
-			"title": "subject",
-			"color": "color",
-			"allDay": "allDay",
-			"progress": "progress"
-		}
+			start: "expected_start_date",
+			end: "expected_end_date",
+			id: "name",
+			title: "subject",
+			color: "color",
+			allDay: "allDay",
+			progress: "progress",
+		},
 	},
 	filters: [
 		{
-			"fieldtype": "Link",
-			"fieldname": "employee",
-			"options": "Employee",
-			"label": __("Employee")
-		}
+			fieldtype: "Link",
+			fieldname: "employee",
+			options: "Employee",
+			label: __("Employee"),
+		},
 	],
-	get_events_method: "erpnext.manufacturing.doctype.job_card.job_card.get_job_details"
+	get_events_method: "erpnext.manufacturing.doctype.job_card.job_card.get_job_details",
 };
diff --git a/erpnext/manufacturing/doctype/job_card/job_card_list.js b/erpnext/manufacturing/doctype/job_card/job_card_list.js
index 99fca95..e417b7f 100644
--- a/erpnext/manufacturing/doctype/job_card/job_card_list.js
+++ b/erpnext/manufacturing/doctype/job_card/job_card_list.js
@@ -1,17 +1,17 @@
-frappe.listview_settings['Job Card'] = {
+frappe.listview_settings["Job Card"] = {
 	has_indicator_for_draft: true,
 	add_fields: ["expected_start_date", "expected_end_date"],
-	get_indicator: function(doc) {
+	get_indicator: function (doc) {
 		const status_colors = {
 			"Work In Progress": "orange",
-			"Completed": "green",
-			"Cancelled": "red",
+			Completed: "green",
+			Cancelled: "red",
 			"Material Transferred": "blue",
-			"Open": "red",
+			Open: "red",
 		};
 		const status = doc.status || "Open";
 		const color = status_colors[status] || "blue";
 
 		return [__(status), color, `status,=,${status}`];
-	}
+	},
 };
diff --git a/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.js b/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.js
index a0122a4..f54478a 100644
--- a/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.js
+++ b/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.js
@@ -1,33 +1,40 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Manufacturing Settings', {
-});
+frappe.ui.form.on("Manufacturing Settings", {});
 
 frappe.tour["Manufacturing Settings"] = [
 	{
 		fieldname: "material_consumption",
 		title: __("Allow Multiple Material Consumption"),
-		description: __("If ticked, multiple materials can be used for a single Work Order. This is useful if one or more time consuming products are being manufactured.")
+		description: __(
+			"If ticked, multiple materials can be used for a single Work Order. This is useful if one or more time consuming products are being manufactured."
+		),
 	},
 	{
 		fieldname: "backflush_raw_materials_based_on",
 		title: __("Backflush Raw Materials"),
-		description: __("The Stock Entry of type 'Manufacture' is known as backflush. Raw materials being consumed to manufacture finished goods is known as backflushing. <br><br> When creating Manufacture Entry, raw-material items are backflushed based on BOM of production item. If you want raw-material items to be backflushed based on Material Transfer entry made against that Work Order instead, then you can set it under this field.")
+		description: __(
+			"The Stock Entry of type 'Manufacture' is known as backflush. Raw materials being consumed to manufacture finished goods is known as backflushing. <br><br> When creating Manufacture Entry, raw-material items are backflushed based on BOM of production item. If you want raw-material items to be backflushed based on Material Transfer entry made against that Work Order instead, then you can set it under this field."
+		),
 	},
 	{
 		fieldname: "default_wip_warehouse",
 		title: __("Work In Progress Warehouse"),
-		description: __("This Warehouse will be auto-updated in the Work In Progress Warehouse field of Work Orders.")
+		description: __(
+			"This Warehouse will be auto-updated in the Work In Progress Warehouse field of Work Orders."
+		),
 	},
 	{
 		fieldname: "default_fg_warehouse",
 		title: __("Finished Goods Warehouse"),
-		description: __("This Warehouse will be auto-updated in the Target Warehouse field of Work Order.")
+		description: __("This Warehouse will be auto-updated in the Target Warehouse field of Work Order."),
 	},
 	{
 		fieldname: "update_bom_costs_automatically",
 		title: __("Update BOM Cost Automatically"),
-		description: __("If ticked, the BOM cost will be automatically updated based on Valuation Rate / Price List Rate / last purchase rate of raw materials.")
-	}
+		description: __(
+			"If ticked, the BOM cost will be automatically updated based on Valuation Rate / Price List Rate / last purchase rate of raw materials."
+		),
+	},
 ];
diff --git a/erpnext/manufacturing/doctype/material_request_plan_item/material_request_plan_item.js b/erpnext/manufacturing/doctype/material_request_plan_item/material_request_plan_item.js
index 61c0a99..7a9e2b9 100644
--- a/erpnext/manufacturing/doctype/material_request_plan_item/material_request_plan_item.js
+++ b/erpnext/manufacturing/doctype/material_request_plan_item/material_request_plan_item.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Material Request Plan Item', {
-	refresh: function() {
-
-	}
+frappe.ui.form.on("Material Request Plan Item", {
+	refresh: function () {},
 });
diff --git a/erpnext/manufacturing/doctype/operation/operation.js b/erpnext/manufacturing/doctype/operation/operation.js
index ea73fd6..c51ea72 100644
--- a/erpnext/manufacturing/doctype/operation/operation.js
+++ b/erpnext/manufacturing/doctype/operation/operation.js
@@ -1,32 +1,34 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Operation', {
-	setup: function(frm) {
-		frm.set_query('operation', 'sub_operations', function() {
+frappe.ui.form.on("Operation", {
+	setup: function (frm) {
+		frm.set_query("operation", "sub_operations", function () {
 			return {
 				filters: {
-					'name': ['not in', [frm.doc.name]]
-				}
+					name: ["not in", [frm.doc.name]],
+				},
 			};
 		});
-	}
+	},
 });
 
-frappe.tour['Operation'] = [
+frappe.tour["Operation"] = [
 	{
 		fieldname: "__newname",
 		title: "Operation Name",
-		description: __("Enter a name for the Operation, for example, Cutting.")
+		description: __("Enter a name for the Operation, for example, Cutting."),
 	},
 	{
 		fieldname: "workstation",
 		title: "Default Workstation",
-		description: __("Select the Default Workstation where the Operation will be performed. This will be fetched in BOMs and Work Orders.")
+		description: __(
+			"Select the Default Workstation where the Operation will be performed. This will be fetched in BOMs and Work Orders."
+		),
 	},
 	{
 		fieldname: "sub_operations",
 		title: "Sub Operations",
-		description: __("If an operation is divided into sub operations, they can be added here.")
-	}
+		description: __("If an operation is divided into sub operations, they can be added here."),
+	},
 ];
diff --git a/erpnext/manufacturing/doctype/plant_floor/plant_floor.js b/erpnext/manufacturing/doctype/plant_floor/plant_floor.js
index 67e5acd..becdbdb 100644
--- a/erpnext/manufacturing/doctype/plant_floor/plant_floor.js
+++ b/erpnext/manufacturing/doctype/plant_floor/plant_floor.js
@@ -14,16 +14,16 @@
 
 			return {
 				filters: {
-					"is_group": 0,
-					"company": doc.company
-				}
-			}
+					is_group: 0,
+					company: doc.company,
+				},
+			};
 		});
 	},
 
 	refresh(frm) {
-		frm.trigger('prepare_stock_dashboard')
-		frm.trigger('prepare_workstation_dashboard')
+		frm.trigger("prepare_stock_dashboard");
+		frm.trigger("prepare_workstation_dashboard");
 	},
 
 	prepare_workstation_dashboard(frm) {
@@ -52,7 +52,6 @@
 	},
 });
 
-
 class VisualStock {
 	constructor(opts) {
 		Object.assign(this, opts);
@@ -62,7 +61,7 @@
 	make() {
 		this.prepare_filters();
 		this.prepare_stock_summary({
-			start:0
+			start: 0,
 		});
 	}
 
@@ -81,17 +80,18 @@
 				fieldname: "item_code",
 				placeholder: __("Item"),
 				options: "Item",
-				onchange: () => this.prepare_stock_summary({
-					start:0,
-					item_code: this.item_filter.value
-				})
+				onchange: () =>
+					this.prepare_stock_summary({
+						start: 0,
+						item_code: this.item_filter.value,
+					}),
 			},
-			parent: this.wrapper.find('.filter-section'),
+			parent: this.wrapper.find(".filter-section"),
 			render_input: true,
 		});
 
-		this.item_filter.$wrapper.addClass('form-column col-sm-3');
-		this.item_filter.$wrapper.find('.clearfix').hide();
+		this.item_filter.$wrapper.addClass("form-column col-sm-3");
+		this.item_filter.$wrapper.find(".clearfix").hide();
 
 		this.item_group_filter = frappe.ui.form.make_control({
 			df: {
@@ -99,25 +99,28 @@
 				fieldname: "item_group",
 				placeholder: __("Item Group"),
 				options: "Item Group",
-				change: () => this.prepare_stock_summary({
-					start:0,
-					item_group: this.item_group_filter.value
-				})
+				change: () =>
+					this.prepare_stock_summary({
+						start: 0,
+						item_group: this.item_group_filter.value,
+					}),
 			},
-			parent: this.wrapper.find('.filter-section'),
+			parent: this.wrapper.find(".filter-section"),
 			render_input: true,
 		});
 
-		this.item_group_filter.$wrapper.addClass('form-column col-sm-3');
-		this.item_group_filter.$wrapper.find('.clearfix').hide();
+		this.item_group_filter.$wrapper.addClass("form-column col-sm-3");
+		this.item_group_filter.$wrapper.find(".clearfix").hide();
 	}
 
 	prepare_stock_summary(args) {
-		let {start, item_code, item_group} = args;
+		let { start, item_code, item_group } = args;
 
-		this.get_stock_summary(start, item_code, item_group).then(stock_summary => {
-			this.wrapper.find('.stock-summary-container').remove();
-			this.wrapper.append(`<div class="col-sm-12 stock-summary-container" style="margin-bottom:20px"></div>`);
+		this.get_stock_summary(start, item_code, item_group).then((stock_summary) => {
+			this.wrapper.find(".stock-summary-container").remove();
+			this.wrapper.append(
+				`<div class="col-sm-12 stock-summary-container" style="margin-bottom:20px"></div>`
+			);
 			this.stock_summary = stock_summary.message;
 			this.render_stock_summary();
 			this.bind_events();
@@ -131,8 +134,8 @@
 				warehouse: this.frm.doc.warehouse,
 				start: start,
 				item_code: item_code,
-				item_group: item_group
-			}
+				item_group: item_group,
+			},
 		});
 
 		return stock_summary;
@@ -140,71 +143,80 @@
 
 	render_stock_summary() {
 		let template = frappe.render_template("stock_summary_template", {
-			stock_summary: this.stock_summary
+			stock_summary: this.stock_summary,
 		});
 
-		this.wrapper.find('.stock-summary-container').append(template);
+		this.wrapper.find(".stock-summary-container").append(template);
 	}
 
 	bind_events() {
-		this.wrapper.find('.btn-add').click((e) => {
-			this.item_code = decodeURI($(e.currentTarget).attr('data-item-code'));
+		this.wrapper.find(".btn-add").click((e) => {
+			this.item_code = decodeURI($(e.currentTarget).attr("data-item-code"));
 
-			this.make_stock_entry([
-				{
-					label: __("For Item"),
-					fieldname: "item_code",
-					fieldtype: "Data",
-					read_only: 1,
-					default: this.item_code
-				},
-				{
-					label: __("Quantity"),
-					fieldname: "qty",
-					fieldtype: "Float",
-					reqd: 1
-				}
-			], __("Add Stock"), "Material Receipt")
+			this.make_stock_entry(
+				[
+					{
+						label: __("For Item"),
+						fieldname: "item_code",
+						fieldtype: "Data",
+						read_only: 1,
+						default: this.item_code,
+					},
+					{
+						label: __("Quantity"),
+						fieldname: "qty",
+						fieldtype: "Float",
+						reqd: 1,
+					},
+				],
+				__("Add Stock"),
+				"Material Receipt"
+			);
 		});
 
-		this.wrapper.find('.btn-move').click((e) => {
-			this.item_code = decodeURI($(e.currentTarget).attr('data-item-code'));
+		this.wrapper.find(".btn-move").click((e) => {
+			this.item_code = decodeURI($(e.currentTarget).attr("data-item-code"));
 
-			this.make_stock_entry([
-				{
-					label: __("For Item"),
-					fieldname: "item_code",
-					fieldtype: "Data",
-					read_only: 1,
-					default: this.item_code
-				},
-				{
-					label: __("Quantity"),
-					fieldname: "qty",
-					fieldtype: "Float",
-					reqd: 1
-				},
-				{
-					label: __("To Warehouse"),
-					fieldname: "to_warehouse",
-					fieldtype: "Link",
-					options: "Warehouse",
-					reqd: 1,
-					get_query: () => {
-						return {
-							filters: {
-								"is_group": 0,
-								"company": this.frm.doc.company
-							}
-						}
-					}
-				}
-			], __("Move Stock"), "Material Transfer")
+			this.make_stock_entry(
+				[
+					{
+						label: __("For Item"),
+						fieldname: "item_code",
+						fieldtype: "Data",
+						read_only: 1,
+						default: this.item_code,
+					},
+					{
+						label: __("Quantity"),
+						fieldname: "qty",
+						fieldtype: "Float",
+						reqd: 1,
+					},
+					{
+						label: __("To Warehouse"),
+						fieldname: "to_warehouse",
+						fieldtype: "Link",
+						options: "Warehouse",
+						reqd: 1,
+						get_query: () => {
+							return {
+								filters: {
+									is_group: 0,
+									company: this.frm.doc.company,
+								},
+							};
+						},
+					},
+				],
+				__("Move Stock"),
+				"Material Transfer"
+			);
 		});
 	}
 
 	make_stock_entry(fields, title, stock_entry_type) {
-		frappe.prompt(fields,
+		frappe.prompt(
+			fields,
 			(values) => {
 				this.values = values;
 				this.stock_entry_type = stock_entry_type;
@@ -221,9 +233,11 @@
 							var doc = frappe.model.sync(r.message);
 							frappe.set_route("Form", r.message.doctype, r.message.name);
 						}
-					}
-				})
-			}, __(title), __("Create")
+					},
+				});
+			},
+			__(title),
+			__("Create")
 		);
 	}
 
@@ -245,12 +259,12 @@
 		this.values = {
 			...this.values,
 			...{
-				"company": this.frm.doc.company,
-				"item_code": this.item_code,
-				"from_warehouse": from_warehouse,
-				"to_warehouse": to_warehouse,
-				"purpose": this.stock_entry_type,
-			}
-		}
+				company: this.frm.doc.company,
+				item_code: this.item_code,
+				from_warehouse: from_warehouse,
+				to_warehouse: to_warehouse,
+				purpose: this.stock_entry_type,
+			},
+		};
 	}
-}
\ No newline at end of file
+}
diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.js b/erpnext/manufacturing/doctype/production_plan/production_plan.js
index 667ece2..54d1414 100644
--- a/erpnext/manufacturing/doctype/production_plan/production_plan.js
+++ b/erpnext/manufacturing/doctype/production_plan/production_plan.js
@@ -1,11 +1,10 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Production Plan', {
-
+frappe.ui.form.on("Production Plan", {
 	before_save(frm) {
 		// preserve temporary names on production plan item to re-link sub-assembly items
-		frm.doc.po_items.forEach(item => {
+		frm.doc.po_items.forEach((item) => {
 			item.temporary_name = item.name;
 		});
 	},
@@ -14,8 +13,8 @@
 		frm.trigger("setup_queries");
 
 		frm.custom_make_buttons = {
-			'Work Order': 'Work Order / Subcontract PO',
-			'Material Request': 'Material Request',
+			"Work Order": "Work Order / Subcontract PO",
+			"Material Request": "Material Request",
 		};
 	},
 
@@ -25,36 +24,36 @@
 				query: "erpnext.manufacturing.doctype.production_plan.production_plan.sales_order_query",
 				filters: {
 					company: frm.doc.company,
-				}
-			}
+				},
+			};
 		});
 
-		frm.set_query('for_warehouse', function(doc) {
+		frm.set_query("for_warehouse", function (doc) {
 			return {
 				filters: {
 					company: doc.company,
-					is_group: 0
-				}
-			}
+					is_group: 0,
+				},
+			};
 		});
 
-		frm.set_query('material_request', 'material_requests', function() {
+		frm.set_query("material_request", "material_requests", function () {
 			return {
 				filters: {
 					material_request_type: "Manufacture",
 					docstatus: 1,
 					status: ["!=", "Stopped"],
-				}
+				},
 			};
 		});
 
 		frm.set_query("item_code", "po_items", (doc, cdt, cdn) => {
 			return {
 				query: "erpnext.controllers.queries.item_query",
-				filters:{
-					'is_stock_item': 1,
-				}
-			}
+				filters: {
+					is_stock_item: 1,
+				},
+			};
 		});
 
 		frm.set_query("bom_no", "po_items", (doc, cdt, cdn) => {
@@ -62,25 +61,25 @@
 			if (d.item_code) {
 				return {
 					query: "erpnext.controllers.queries.bom",
-					filters:{'item': d.item_code, 'docstatus': 1}
-				}
+					filters: { item: d.item_code, docstatus: 1 },
+				};
 			} else frappe.msgprint(__("Please enter Item first"));
 		});
 
 		frm.set_query("warehouse", "mr_items", (doc) => {
 			return {
 				filters: {
-					company: doc.company
-				}
-			}
+					company: doc.company,
+				},
+			};
 		});
 
 		frm.set_query("warehouse", "po_items", (doc) => {
 			return {
 				filters: {
-					company: doc.company
-				}
-			}
+					company: doc.company,
+				},
+			};
 		});
 	},
 
@@ -89,36 +88,62 @@
 			frm.trigger("show_progress");
 
 			if (frm.doc.status !== "Completed") {
-				frm.add_custom_button(__("Production Plan Summary"), ()=> {
-					frappe.set_route('query-report', 'Production Plan Summary', {production_plan: frm.doc.name});
-				}, __('View'));
+				frm.add_custom_button(
+					__("Production Plan Summary"),
+					() => {
+						frappe.set_route("query-report", "Production Plan Summary", {
+							production_plan: frm.doc.name,
+						});
+					},
+					__("View")
+				);
 
-				if  (frm.doc.status === "Closed") {
-					frm.add_custom_button(__("Re-open"), function() {
-						frm.events.close_open_production_plan(frm, false);
-					}, __("Status"));
+				if (frm.doc.status === "Closed") {
+					frm.add_custom_button(
+						__("Re-open"),
+						function () {
+							frm.events.close_open_production_plan(frm, false);
+						},
+						__("Status")
+					);
 				} else {
-					frm.add_custom_button(__("Close"), function() {
-						frm.events.close_open_production_plan(frm, true);
-					}, __("Status"));
+					frm.add_custom_button(
+						__("Close"),
+						function () {
+							frm.events.close_open_production_plan(frm, true);
+						},
+						__("Status")
+					);
 				}
 
 				if (frm.doc.po_items && frm.doc.status !== "Closed") {
-					frm.add_custom_button(__("Work Order / Subcontract PO"), ()=> {
-						frm.trigger("make_work_order");
-					}, __('Create'));
+					frm.add_custom_button(
+						__("Work Order / Subcontract PO"),
+						() => {
+							frm.trigger("make_work_order");
+						},
+						__("Create")
+					);
 				}
 
-				if (frm.doc.mr_items && frm.doc.mr_items.length && !in_list(['Material Requested', 'Closed'], frm.doc.status)) {
-					frm.add_custom_button(__("Material Request"), ()=> {
-						frm.trigger("make_material_request");
-					}, __('Create'));
+				if (
+					frm.doc.mr_items &&
+					frm.doc.mr_items.length &&
+					!in_list(["Material Requested", "Closed"], frm.doc.status)
+				) {
+					frm.add_custom_button(
+						__("Material Request"),
+						() => {
+							frm.trigger("make_material_request");
+						},
+						__("Create")
+					);
 				}
 			}
 		}
 
 		if (frm.doc.status !== "Closed") {
-			frm.page.set_inner_btn_group_as_primary(__('Create'));
+			frm.page.set_inner_btn_group_as_primary(__("Create"));
 		}
 		frm.trigger("material_requirement");
 
@@ -145,19 +170,19 @@
 								${__("Planned Qty: Quantity, for which, Work Order has been raised, but is pending to be manufactured.")}
 							</li>
 							<li>
-								${__('Requested Qty: Quantity requested for purchase, but not ordered.')}
+								${__("Requested Qty: Quantity requested for purchase, but not ordered.")}
 							</li>
 							<li>
-								${__('Ordered Qty: Quantity ordered for purchase, but not received.')}
+								${__("Ordered Qty: Quantity ordered for purchase, but not received.")}
 							</li>
 							<li>
 								${__("Reserved Qty: Quantity ordered for sale, but not delivered.")}
 							</li>
 							<li>
-								${__('Reserved Qty for Production: Raw materials quantity to make manufacturing items.')}
+								${__("Reserved Qty for Production: Raw materials quantity to make manufacturing items.")}
 							</li>
 							<li>
-								${__('Reserved Qty for Subcontract: Raw materials quantity to make subcontracted items.')}
+								${__("Reserved Qty for Subcontract: Raw materials quantity to make subcontracted items.")}
 							</li>
 						</ul>
 					</div>
@@ -168,15 +193,15 @@
 		set_field_options("projected_qty_formula", projected_qty_formula);
 	},
 
-	close_open_production_plan(frm, close=false) {
+	close_open_production_plan(frm, close = false) {
 		frappe.call({
 			method: "set_status",
 			freeze: true,
 			doc: frm.doc,
-			args: {close : close, update_bin: true},
-			callback: function() {
+			args: { close: close, update_bin: true },
+			callback: function () {
 				frm.reload_doc();
-			}
+			},
 		});
 	},
 
@@ -185,19 +210,19 @@
 			method: "make_work_order",
 			freeze: true,
 			doc: frm.doc,
-			callback: function() {
+			callback: function () {
 				frm.reload_doc();
-			}
+			},
 		});
 	},
 
 	make_material_request(frm) {
-
-		frappe.confirm(__("Do you want to submit the material request"),
-			function() {
+		frappe.confirm(
+			__("Do you want to submit the material request"),
+			function () {
 				frm.events.create_material_request(frm, 1);
 			},
-			function() {
+			function () {
 				frm.events.create_material_request(frm, 0);
 			}
 		);
@@ -210,9 +235,9 @@
 			method: "make_material_request",
 			freeze: true,
 			doc: frm.doc,
-			callback: function(r) {
+			callback: function (r) {
 				frm.reload_doc();
-			}
+			},
 		});
 	},
 
@@ -220,9 +245,9 @@
 		frappe.call({
 			method: "get_open_sales_orders",
 			doc: frm.doc,
-			callback: function(r) {
+			callback: function (r) {
 				refresh_field("sales_orders");
-			}
+			},
 		});
 	},
 
@@ -230,22 +255,22 @@
 		frappe.call({
 			method: "get_pending_material_requests",
 			doc: frm.doc,
-			callback: function() {
-				refresh_field('material_requests');
-			}
+			callback: function () {
+				refresh_field("material_requests");
+			},
 		});
 	},
 
 	get_items(frm) {
-		frm.clear_table('prod_plan_references');
+		frm.clear_table("prod_plan_references");
 
 		frappe.call({
 			method: "get_items",
 			freeze: true,
 			doc: frm.doc,
 			callback: function () {
-				refresh_field('po_items');
-			}
+				refresh_field("po_items");
+			},
 		});
 	},
 	combine_items(frm) {
@@ -255,12 +280,12 @@
 			method: "get_items",
 			freeze: true,
 			doc: frm.doc,
-			callback: function() {
+			callback: function () {
 				frm.refresh_field("po_items");
 				if (frm.doc.sub_assembly_items.length > 0) {
 					frm.trigger("get_sub_assembly_items");
 				}
-			}
+			},
 		});
 	},
 
@@ -278,9 +303,9 @@
 			method: "get_sub_assembly_items",
 			freeze: true,
 			doc: frm.doc,
-			callback: function() {
+			callback: function () {
 				refresh_field("sub_assembly_items");
-			}
+			},
 		});
 	},
 
@@ -294,9 +319,11 @@
 			frappe.throw(__("Select the Warehouse"));
 		}
 
-		frm.events.get_items_for_material_requests(frm, [{
-			warehouse: frm.doc.for_warehouse
-		}]);
+		frm.events.get_items_for_material_requests(frm, [
+			{
+				warehouse: frm.doc.for_warehouse,
+			},
+		]);
 	},
 
 	transfer_materials(frm) {
@@ -315,26 +342,26 @@
 				title: title,
 				fields: [
 					{
-						'label': __('Transfer From Warehouses'),
-						'fieldtype': 'Table MultiSelect',
-						'fieldname': 'warehouses',
-						'options': 'Production Plan Material Request Warehouse',
+						label: __("Transfer From Warehouses"),
+						fieldtype: "Table MultiSelect",
+						fieldname: "warehouses",
+						options: "Production Plan Material Request Warehouse",
 						get_query: function () {
 							return {
 								filters: {
-									company: frm.doc.company
-								}
+									company: frm.doc.company,
+								},
 							};
 						},
 					},
 					{
-						'label': __('For Warehouse'),
-						'fieldtype': 'Link',
-						'fieldname': 'target_warehouse',
-						'read_only': true,
-						'default': frm.doc.for_warehouse
-					}
-				]
+						label: __("For Warehouse"),
+						fieldtype: "Link",
+						fieldname: "target_warehouse",
+						read_only: true,
+						default: frm.doc.for_warehouse,
+					},
+				],
 			});
 
 			dialog.show();
@@ -353,82 +380,90 @@
 			freeze: true,
 			args: {
 				doc: frm.doc,
-				warehouses: warehouses || []
+				warehouses: warehouses || [],
 			},
-			callback: function(r) {
-				if(r.message) {
-					frm.set_value('mr_items', []);
-					r.message.forEach(row => {
-						let d = frm.add_child('mr_items');
+			callback: function (r) {
+				if (r.message) {
+					frm.set_value("mr_items", []);
+					r.message.forEach((row) => {
+						let d = frm.add_child("mr_items");
 						for (let field in row) {
-							if (field !== 'name') {
+							if (field !== "name") {
 								d[field] = row[field];
 							}
 						}
 					});
 				}
-				refresh_field('mr_items');
-			}
+				refresh_field("mr_items");
+			},
 		});
 	},
 
 	download_materials_required(frm) {
-		const fields = [{
-			fieldname: 'warehouses',
-			fieldtype: 'Table MultiSelect',
-			label: __('Warehouses'),
-			default: frm.doc.from_warehouse,
-			options: "Production Plan Material Request Warehouse",
-			get_query: function () {
-				return {
-					filters: {
-						company: frm.doc.company
-					}
-				};
+		const fields = [
+			{
+				fieldname: "warehouses",
+				fieldtype: "Table MultiSelect",
+				label: __("Warehouses"),
+				default: frm.doc.from_warehouse,
+				options: "Production Plan Material Request Warehouse",
+				get_query: function () {
+					return {
+						filters: {
+							company: frm.doc.company,
+						},
+					};
+				},
 			},
-		}];
+		];
 
-		frappe.prompt(fields, (row) => {
-			let get_template_url = 'erpnext.manufacturing.doctype.production_plan.production_plan.download_raw_materials';
-			open_url_post(frappe.request.url, {
-				cmd: get_template_url,
-				doc: frm.doc,
-				warehouses: row.warehouses
-			});
-		}, __('Select Warehouses to get Stock for Materials Planning'), __('Get Stock'));
+		frappe.prompt(
+			fields,
+			(row) => {
+				let get_template_url =
+					"erpnext.manufacturing.doctype.production_plan.production_plan.download_raw_materials";
+				open_url_post(frappe.request.url, {
+					cmd: get_template_url,
+					doc: frm.doc,
+					warehouses: row.warehouses,
+				});
+			},
+			__("Select Warehouses to get Stock for Materials Planning"),
+			__("Get Stock")
+		);
 	},
 
 	show_progress(frm) {
 		var bars = [];
-		var message = '';
-		var title = '';
+		var message = "";
+		var title = "";
 
 		// produced qty
 		let item_wise_qty = {};
 		frm.doc.po_items.forEach((data) => {
-			if(!item_wise_qty[data.item_code]) {
+			if (!item_wise_qty[data.item_code]) {
 				item_wise_qty[data.item_code] = data.produced_qty;
 			} else {
 				item_wise_qty[data.item_code] += data.produced_qty;
 			}
-		})
+		});
 
 		if (item_wise_qty) {
 			for (var key in item_wise_qty) {
-				title += __('Item {0}: {1} qty produced. ', [key, item_wise_qty[key]]);
+				title += __("Item {0}: {1} qty produced. ", [key, item_wise_qty[key]]);
 			}
 		}
 
 		bars.push({
-			'title': title,
-			'width': (frm.doc.total_produced_qty / frm.doc.total_planned_qty * 100) + '%',
-			'progress_class': 'progress-bar-success'
+			title: title,
+			width: (frm.doc.total_produced_qty / frm.doc.total_planned_qty) * 100 + "%",
+			progress_class: "progress-bar-success",
 		});
-		if (bars[0].width == '0%') {
-			bars[0].width = '0.5%';
+		if (bars[0].width == "0%") {
+			bars[0].width = "0.5%";
 		}
 		message = title;
-		frm.dashboard.add_progress(__('Status'), bars, message);
+		frm.dashboard.add_progress(__("Status"), bars, message);
 	},
 });
 
@@ -439,13 +474,13 @@
 			frappe.call({
 				method: "erpnext.manufacturing.doctype.production_plan.production_plan.get_item_data",
 				args: {
-					item_code: row.item_code
+					item_code: row.item_code,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					for (let key in r.message) {
 						frappe.model.set_value(cdt, cdn, key, r.message[key]);
 					}
-				}
+				},
 			});
 		}
 	},
@@ -460,30 +495,29 @@
 				args: {
 					row: row,
 					company: frm.doc.company,
-					for_warehouse: row.warehouse
+					for_warehouse: row.warehouse,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (r.message) {
-						let {projected_qty, actual_qty} = r.message[0];
+						let { projected_qty, actual_qty } = r.message[0];
 
 						frappe.model.set_value(cdt, cdn, {
-							'projected_qty': projected_qty,
-							'actual_qty': actual_qty
+							projected_qty: projected_qty,
+							actual_qty: actual_qty,
 						});
 					}
-				}
-			})
+				},
+			});
 		}
 	},
 
 	material_request_type(frm, cdt, cdn) {
 		let row = locals[cdt][cdn];
 
-		if (row.from_warehouse &&
-			row.material_request_type !== "Material Transfer") {
-				frappe.model.set_value(cdt, cdn, 'from_warehouse', '');
+		if (row.from_warehouse && row.material_request_type !== "Material Transfer") {
+			frappe.model.set_value(cdt, cdn, "from_warehouse", "");
 		}
-	}
+	},
 });
 
 frappe.ui.form.on("Production Plan Sales Order", {
@@ -506,53 +540,61 @@
 						method: "erpnext.manufacturing.doctype.production_plan.production_plan.get_so_details",
 						args: { sales_order },
 						callback(r) {
-							const {transaction_date, customer, grand_total} = r.message;
-							frappe.model.set_value(cdt, cdn, 'sales_order_date', transaction_date);
-							frappe.model.set_value(cdt, cdn, 'customer', customer);
-							frappe.model.set_value(cdt, cdn, 'grand_total', grand_total);
-						}
+							const { transaction_date, customer, grand_total } = r.message;
+							frappe.model.set_value(cdt, cdn, "sales_order_date", transaction_date);
+							frappe.model.set_value(cdt, cdn, "customer", customer);
+							frappe.model.set_value(cdt, cdn, "grand_total", grand_total);
+						},
 					});
-				}
+				},
 			});
 		}
-	}
+	},
 });
 
 frappe.ui.form.on("Production Plan Sub Assembly Item", {
 	fg_warehouse(frm, cdt, cdn) {
 		erpnext.utils.copy_value_in_all_rows(frm.doc, cdt, cdn, "sub_assembly_items", "fg_warehouse");
 	},
-})
+});
 
-frappe.tour['Production Plan'] = [
+frappe.tour["Production Plan"] = [
 	{
 		fieldname: "get_items_from",
 		title: "Get Items From",
-		description: __("Select whether to get items from a Sales Order or a Material Request. For now select <b>Sales Order</b>.\n A Production Plan can also be created manually where you can select the Items to manufacture.")
+		description: __(
+			"Select whether to get items from a Sales Order or a Material Request. For now select <b>Sales Order</b>.\n A Production Plan can also be created manually where you can select the Items to manufacture."
+		),
 	},
 	{
 		fieldname: "get_sales_orders",
 		title: "Get Sales Orders",
-		description: __("Click on Get Sales Orders to fetch sales orders based on the above filters.")
+		description: __("Click on Get Sales Orders to fetch sales orders based on the above filters."),
 	},
 	{
 		fieldname: "get_items",
 		title: "Get Finished Goods for Manufacture",
-		description: __("Click on 'Get Finished Goods for Manufacture' to fetch the items from the above Sales Orders. Items only for which a BOM is present will be fetched.")
+		description: __(
+			"Click on 'Get Finished Goods for Manufacture' to fetch the items from the above Sales Orders. Items only for which a BOM is present will be fetched."
+		),
 	},
 	{
 		fieldname: "po_items",
 		title: "Finished Goods",
-		description: __("On expanding a row in the Items to Manufacture table, you'll see an option to 'Include Exploded Items'. Ticking this includes raw materials of the sub-assembly items in the production process.")
+		description: __(
+			"On expanding a row in the Items to Manufacture table, you'll see an option to 'Include Exploded Items'. Ticking this includes raw materials of the sub-assembly items in the production process."
+		),
 	},
 	{
 		fieldname: "include_non_stock_items",
 		title: "Include Non Stock Items",
-		description: __("To include non-stock items in the material request planning. i.e. Items for which 'Maintain Stock' checkbox is unticked.")
+		description: __(
+			"To include non-stock items in the material request planning. i.e. Items for which 'Maintain Stock' checkbox is unticked."
+		),
 	},
 	{
 		fieldname: "include_subcontracted_items",
 		title: "Include Subcontracted Items",
-		description: __("To add subcontracted Item's raw materials if include exploded items is disabled.")
-	}
+		description: __("To add subcontracted Item's raw materials if include exploded items is disabled."),
+	},
 ];
diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan_list.js b/erpnext/manufacturing/doctype/production_plan/production_plan_list.js
index 8f94686..bfef6e1 100644
--- a/erpnext/manufacturing/doctype/production_plan/production_plan_list.js
+++ b/erpnext/manufacturing/doctype/production_plan/production_plan_list.js
@@ -1,4 +1,4 @@
-frappe.listview_settings['Production Plan'] = {
+frappe.listview_settings["Production Plan"] = {
 	hide_name_column: true,
 	add_fields: ["status"],
 	filters: [["status", "!=", "Closed"]],
@@ -6,14 +6,18 @@
 		if (doc.status === "Submitted") {
 			return [__("Not Started"), "orange", "status,=,Submitted"];
 		} else {
-			return [__(doc.status), {
-				"Draft": "red",
-				"In Process": "orange",
-				"Completed": "green",
-				"Material Requested": "yellow",
-				"Cancelled": "gray",
-				"Closed": "grey"
-			}[doc.status], "status,=," + doc.status];
+			return [
+				__(doc.status),
+				{
+					Draft: "red",
+					"In Process": "orange",
+					Completed: "green",
+					"Material Requested": "yellow",
+					Cancelled: "gray",
+					Closed: "grey",
+				}[doc.status],
+				"status,=," + doc.status,
+			];
 		}
-	}
+	},
 };
diff --git a/erpnext/manufacturing/doctype/production_plan_material_request_warehouse/production_plan_material_request_warehouse.js b/erpnext/manufacturing/doctype/production_plan_material_request_warehouse/production_plan_material_request_warehouse.js
index 53f8758..d4e74fa 100644
--- a/erpnext/manufacturing/doctype/production_plan_material_request_warehouse/production_plan_material_request_warehouse.js
+++ b/erpnext/manufacturing/doctype/production_plan_material_request_warehouse/production_plan_material_request_warehouse.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Production Plan Material Request Warehouse', {
+frappe.ui.form.on("Production Plan Material Request Warehouse", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/manufacturing/doctype/routing/routing.js b/erpnext/manufacturing/doctype/routing/routing.js
index 784e83a..fe67fe3 100644
--- a/erpnext/manufacturing/doctype/routing/routing.js
+++ b/erpnext/manufacturing/doctype/routing/routing.js
@@ -1,38 +1,39 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Routing', {
-	refresh: function(frm) {
+frappe.ui.form.on("Routing", {
+	refresh: function (frm) {
 		frm.trigger("display_sequence_id_column");
 	},
 
-	onload: function(frm) {
+	onload: function (frm) {
 		frm.trigger("display_sequence_id_column");
 	},
 
-	display_sequence_id_column: function(frm) {
-		frm.fields_dict.operations.grid.update_docfield_property(
-			'sequence_id', 	'in_list_view', 1
+	display_sequence_id_column: function (frm) {
+		frm.fields_dict.operations.grid.update_docfield_property("sequence_id", "in_list_view", 1);
+	},
+
+	calculate_operating_cost: function (frm, child) {
+		const operating_cost = flt(
+			(flt(child.hour_rate) * flt(child.time_in_mins)) / 60,
+			precision("operating_cost", child)
 		);
-	},
-
-	calculate_operating_cost: function(frm, child) {
-		const operating_cost = flt(flt(child.hour_rate) * flt(child.time_in_mins) / 60, precision("operating_cost", child));
 		frappe.model.set_value(child.doctype, child.name, "operating_cost", operating_cost);
-	}
+	},
 });
 
-frappe.ui.form.on('BOM Operation', {
-	operation: function(frm, cdt, cdn) {
+frappe.ui.form.on("BOM Operation", {
+	operation: function (frm, cdt, cdn) {
 		const d = locals[cdt][cdn];
 
-		if(!d.operation) return;
+		if (!d.operation) return;
 
 		frappe.call({
-			"method": "frappe.client.get",
+			method: "frappe.client.get",
 			args: {
 				doctype: "Operation",
-				name: d.operation
+				name: d.operation,
 			},
 			callback: function (data) {
 				if (data.message.description) {
@@ -44,41 +45,43 @@
 				}
 
 				frm.events.calculate_operating_cost(frm, d);
-			}
+			},
 		});
 	},
 
-	workstation: function(frm, cdt, cdn) {
+	workstation: function (frm, cdt, cdn) {
 		const d = locals[cdt][cdn];
-		if(!d.workstation) return;
+		if (!d.workstation) return;
 		frappe.call({
-			"method": "frappe.client.get",
+			method: "frappe.client.get",
 			args: {
 				doctype: "Workstation",
-				name: d.workstation
+				name: d.workstation,
 			},
 			callback: function (data) {
 				frappe.model.set_value(d.doctype, d.name, "hour_rate", data.message.hour_rate);
 				frm.events.calculate_operating_cost(frm, d);
-			}
+			},
 		});
 	},
 
-	time_in_mins: function(frm, cdt, cdn) {
+	time_in_mins: function (frm, cdt, cdn) {
 		const d = locals[cdt][cdn];
 		frm.events.calculate_operating_cost(frm, d);
-	}
+	},
 });
 
-frappe.tour['Routing'] = [
+frappe.tour["Routing"] = [
 	{
 		fieldname: "routing_name",
 		title: "Routing Name",
-		description: __("Enter a name for Routing.")
+		description: __("Enter a name for Routing."),
 	},
 	{
 		fieldname: "operations",
 		title: "BOM Operations",
-		description: __("Enter the Operation, the table will fetch the Operation details like Hourly Rate, Workstation automatically.\n\n After that, set the Operation Time in minutes and the table will calculate the Operation Costs based on the Hourly Rate and Operation Time.")
-	}
+		description: __(
+			"Enter the Operation, the table will fetch the Operation details like Hourly Rate, Workstation automatically.\n\n After that, set the Operation Time in minutes and the table will calculate the Operation Costs based on the Hourly Rate and Operation Time."
+		),
+	},
 ];
diff --git a/erpnext/manufacturing/doctype/sub_operation/sub_operation.js b/erpnext/manufacturing/doctype/sub_operation/sub_operation.js
index be9db6a..8d6d3dd 100644
--- a/erpnext/manufacturing/doctype/sub_operation/sub_operation.js
+++ b/erpnext/manufacturing/doctype/sub_operation/sub_operation.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Sub Operation', {
+frappe.ui.form.on("Sub Operation", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/manufacturing/doctype/work_order/work_order.js b/erpnext/manufacturing/doctype/work_order/work_order.js
index d9cc212..42f6943 100644
--- a/erpnext/manufacturing/doctype/work_order/work_order.js
+++ b/erpnext/manufacturing/doctype/work_order/work_order.js
@@ -2,70 +2,70 @@
 // For license information, please see license.txt
 
 frappe.ui.form.on("Work Order", {
-	setup: function(frm) {
+	setup: function (frm) {
 		frm.custom_make_buttons = {
-			'Stock Entry': 'Start',
-			'Pick List': 'Create Pick List',
-			'Job Card': 'Create Job Card'
+			"Stock Entry": "Start",
+			"Pick List": "Create Pick List",
+			"Job Card": "Create Job Card",
 		};
 
 		// Set query for warehouses
-		frm.set_query("wip_warehouse", function() {
+		frm.set_query("wip_warehouse", function () {
 			return {
 				filters: {
-					'company': frm.doc.company,
-				}
+					company: frm.doc.company,
+				},
 			};
 		});
 
-		frm.set_query("source_warehouse", function() {
+		frm.set_query("source_warehouse", function () {
 			return {
 				filters: {
-					'company': frm.doc.company,
-				}
+					company: frm.doc.company,
+				},
 			};
 		});
 
-		frm.set_query("source_warehouse", "required_items", function() {
+		frm.set_query("source_warehouse", "required_items", function () {
 			return {
 				filters: {
-					'company': frm.doc.company,
-				}
+					company: frm.doc.company,
+				},
 			};
 		});
 
-		frm.set_query("sales_order", function() {
+		frm.set_query("sales_order", function () {
 			return {
 				filters: {
-					"status": ["not in", ["Closed", "On Hold"]]
-				}
+					status: ["not in", ["Closed", "On Hold"]],
+				},
 			};
 		});
 
-		frm.set_query("fg_warehouse", function() {
+		frm.set_query("fg_warehouse", function () {
 			return {
 				filters: {
-					'company': frm.doc.company,
-					'is_group': 0
-				}
+					company: frm.doc.company,
+					is_group: 0,
+				},
 			};
 		});
 
-		frm.set_query("scrap_warehouse", function() {
+		frm.set_query("scrap_warehouse", function () {
 			return {
 				filters: {
-					'company': frm.doc.company,
-					'is_group': 0
-				}
+					company: frm.doc.company,
+					is_group: 0,
+				},
 			};
 		});
 
 		// Set query for BOM
-		frm.set_query("bom_no", function() {
+		frm.set_query("bom_no", function () {
 			if (frm.doc.production_item) {
 				return {
 					query: "erpnext.controllers.queries.bom",
-					filters: {item: cstr(frm.doc.production_item)}
+					filters: { item: cstr(frm.doc.production_item) },
 				};
 			} else {
 				frappe.msgprint(__("Please enter Production Item first"));
@@ -73,60 +73,62 @@
 		});
 
 		// Set query for FG Item
-		frm.set_query("production_item", function() {
+		frm.set_query("production_item", function () {
 			return {
 				query: "erpnext.controllers.queries.item_query",
 				filters: {
-					"is_stock_item": 1,
-				}
+					is_stock_item: 1,
+				},
 			};
 		});
 
 		// Set query for FG Item
-		frm.set_query("project", function() {
-			return{
-				filters:[
-					['Project', 'status', 'not in', 'Completed, Cancelled']
-				]
+		frm.set_query("project", function () {
+			return {
+				filters: [["Project", "status", "not in", "Completed, Cancelled"]],
 			};
 		});
 
-		frm.set_query("operation", "required_items", function() {
+		frm.set_query("operation", "required_items", function () {
 			return {
 				query: "erpnext.manufacturing.doctype.work_order.work_order.get_bom_operations",
 				filters: {
-					'parent': frm.doc.bom_no,
-					'parenttype': 'BOM'
-				}
+					parent: frm.doc.bom_no,
+					parenttype: "BOM",
+				},
 			};
 		});
 
 		// formatter for work order operation
-		frm.set_indicator_formatter('operation',
-			function(doc) { return (frm.doc.qty==doc.completed_qty) ? "green" : "orange"; });
+		frm.set_indicator_formatter("operation", function (doc) {
+			return frm.doc.qty == doc.completed_qty ? "green" : "orange";
+		});
 	},
 
-	onload: function(frm) {
-		if (!frm.doc.status)
-			frm.doc.status = 'Draft';
+	onload: function (frm) {
+		if (!frm.doc.status) frm.doc.status = "Draft";
 
 		frm.add_fetch("sales_order", "project", "project");
 
-		if(frm.doc.__islocal) {
+		if (frm.doc.__islocal) {
 			frm.set_value({
-				"actual_start_date": "",
-				"actual_end_date": ""
+				actual_start_date: "",
+				actual_end_date: "",
 			});
 			erpnext.work_order.set_default_warehouse(frm);
 		}
 	},
 
-	source_warehouse: function(frm) {
+	source_warehouse: function (frm) {
 		let transaction_controller = new erpnext.TransactionController();
-		transaction_controller.autofill_warehouse(frm.doc.required_items, "source_warehouse", frm.doc.source_warehouse);
+		transaction_controller.autofill_warehouse(
+			frm.doc.required_items,
+			"source_warehouse",
+			frm.doc.source_warehouse
+		);
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		erpnext.toggle_naming_series();
 		erpnext.work_order.set_custom_buttons(frm);
 		frm.set_intro("");
@@ -139,27 +141,30 @@
 		}
 
 		if (frm.doc.status != "Closed") {
-			if (frm.doc.docstatus === 1 && frm.doc.status !== "Completed"
-				&& frm.doc.operations && frm.doc.operations.length) {
-
-				const not_completed = frm.doc.operations.filter(d => {
-					if (d.status != 'Completed') {
+			if (
+				frm.doc.docstatus === 1 &&
+				frm.doc.status !== "Completed" &&
+				frm.doc.operations &&
+				frm.doc.operations.length
+			) {
+				const not_completed = frm.doc.operations.filter((d) => {
+					if (d.status != "Completed") {
 						return true;
 					}
 				});
 
 				if (not_completed && not_completed.length) {
-					frm.add_custom_button(__('Create Job Card'), () => {
+					frm.add_custom_button(__("Create Job Card"), () => {
 						frm.trigger("make_job_card");
-					}).addClass('btn-primary');
+					}).addClass("btn-primary");
 				}
 			}
 		}
 
-		if(frm.doc.required_items && frm.doc.allow_alternative_item) {
-			const has_alternative = frm.doc.required_items.find(i => i.allow_alternative_item === 1);
+		if (frm.doc.required_items && frm.doc.allow_alternative_item) {
+			const has_alternative = frm.doc.required_items.find((i) => i.allow_alternative_item === 1);
 			if (frm.doc.docstatus == 0 && has_alternative) {
-				frm.add_custom_button(__('Alternate Item'), () => {
+				frm.add_custom_button(__("Alternate Item"), () => {
 					erpnext.utils.select_alternate_items({
 						frm: frm,
 						child_docname: "required_items",
@@ -167,16 +172,20 @@
 						child_doctype: "Work Order Item",
 						original_item_field: "original_item",
 						condition: (d) => {
-							if (d.allow_alternative_item) {return true;}
-						}
+							if (d.allow_alternative_item) {
+								return true;
+							}
+						},
 					});
 				});
 			}
 		}
 
-		if (frm.doc.status == "Completed" &&
-			frm.doc.__onload.backflush_raw_materials_based_on == "Material Transferred for Manufacture") {
-			frm.add_custom_button(__('Create BOM'), () => {
+		if (
+			frm.doc.status == "Completed" &&
+			frm.doc.__onload.backflush_raw_materials_based_on == "Material Transferred for Manufacture"
+		) {
+			frm.add_custom_button(__("Create BOM"), () => {
 				frm.trigger("make_bom");
 			});
 		}
@@ -184,120 +193,128 @@
 		frm.trigger("add_custom_button_to_return_components");
 	},
 
-	add_custom_button_to_return_components: function(frm) {
+	add_custom_button_to_return_components: function (frm) {
 		if (frm.doc.docstatus === 1 && in_list(["Closed", "Completed"], frm.doc.status)) {
-			let non_consumed_items = frm.doc.required_items.filter(d =>{
-				return flt(d.consumed_qty) < flt(d.transferred_qty - d.returned_qty)
+			let non_consumed_items = frm.doc.required_items.filter((d) => {
+				return flt(d.consumed_qty) < flt(d.transferred_qty - d.returned_qty);
 			});
 
 			if (non_consumed_items && non_consumed_items.length) {
-				frm.add_custom_button(__("Return Components"), function() {
+				frm.add_custom_button(__("Return Components"), function () {
 					frm.trigger("create_stock_return_entry");
 				}).addClass("btn-primary");
 			}
 		}
 	},
 
-	create_stock_return_entry: function(frm) {
+	create_stock_return_entry: function (frm) {
 		frappe.call({
 			method: "erpnext.manufacturing.doctype.work_order.work_order.make_stock_return_entry",
 			args: {
-				"work_order": frm.doc.name,
+				work_order: frm.doc.name,
 			},
-			callback: function(r) {
-				if(!r.exc) {
+			callback: function (r) {
+				if (!r.exc) {
 					let doc = frappe.model.sync(r.message);
 					frappe.set_route("Form", doc[0].doctype, doc[0].name);
 				}
-			}
+			},
 		});
 	},
 
-	make_job_card: function(frm) {
+	make_job_card: function (frm) {
 		let qty = 0;
 		let operations_data = [];
 
-		const dialog = frappe.prompt({fieldname: 'operations', fieldtype: 'Table', label: __('Operations'),
-			fields: [
-				{
-					fieldtype: 'Link',
-					fieldname: 'operation',
-					label: __('Operation'),
-					read_only: 1,
-					in_list_view: 1
+		const dialog = frappe.prompt(
+			{
+				fieldname: "operations",
+				fieldtype: "Table",
+				label: __("Operations"),
+				fields: [
+					{
+						fieldtype: "Link",
+						fieldname: "operation",
+						label: __("Operation"),
+						read_only: 1,
+						in_list_view: 1,
+					},
+					{
+						fieldtype: "Link",
+						fieldname: "workstation",
+						label: __("Workstation"),
+						read_only: 1,
+						in_list_view: 1,
+					},
+					{
+						fieldtype: "Data",
+						fieldname: "name",
+						label: __("Operation Id"),
+					},
+					{
+						fieldtype: "Float",
+						fieldname: "pending_qty",
+						label: __("Pending Qty"),
+					},
+					{
+						fieldtype: "Float",
+						fieldname: "qty",
+						label: __("Quantity to Manufacture"),
+						read_only: 0,
+						in_list_view: 1,
+					},
+					{
+						fieldtype: "Float",
+						fieldname: "batch_size",
+						label: __("Batch Size"),
+						read_only: 1,
+					},
+					{
+						fieldtype: "Int",
+						fieldname: "sequence_id",
+						label: __("Sequence Id"),
+						read_only: 1,
+					},
+				],
+				data: operations_data,
+				in_place_edit: true,
+				get_data: function () {
+					return operations_data;
 				},
-				{
-					fieldtype: 'Link',
-					fieldname: 'workstation',
-					label: __('Workstation'),
-					read_only: 1,
-					in_list_view: 1
-				},
-				{
-					fieldtype: 'Data',
-					fieldname: 'name',
-					label: __('Operation Id')
-				},
-				{
-					fieldtype: 'Float',
-					fieldname: 'pending_qty',
-					label: __('Pending Qty'),
-				},
-				{
-					fieldtype: 'Float',
-					fieldname: 'qty',
-					label: __('Quantity to Manufacture'),
-					read_only: 0,
-					in_list_view: 1,
-				},
-				{
-					fieldtype: 'Float',
-					fieldname: 'batch_size',
-					label: __('Batch Size'),
-					read_only: 1
-				},
-				{
-					fieldtype: 'Int',
-					fieldname: 'sequence_id',
-					label: __('Sequence Id'),
-					read_only: 1
-				},
-			],
-			data: operations_data,
-			in_place_edit: true,
-			get_data: function() {
-				return operations_data;
-			}
-		}, function(data) {
-			frappe.call({
-				method: "erpnext.manufacturing.doctype.work_order.work_order.make_job_card",
-				freeze: true,
-				args: {
-					work_order: frm.doc.name,
-					operations: data.operations,
-				},
-				callback: function() {
-					frm.reload_doc();
-				}
-			});
-		}, __("Job Card"), __("Create"));
+			},
+			function (data) {
+				frappe.call({
+					method: "erpnext.manufacturing.doctype.work_order.work_order.make_job_card",
+					freeze: true,
+					args: {
+						work_order: frm.doc.name,
+						operations: data.operations,
+					},
+					callback: function () {
+						frm.reload_doc();
+					},
+				});
+			},
+			__("Job Card"),
+			__("Create")
+		);
 
-		dialog.fields_dict["operations"].grid.wrapper.find('.grid-add-row').hide();
+		dialog.fields_dict["operations"].grid.wrapper.find(".grid-add-row").hide();
 
 		var pending_qty = 0;
-		frm.doc.operations.forEach(data => {
-			if(data.completed_qty + data.process_loss_qty != frm.doc.qty) {
+		frm.doc.operations.forEach((data) => {
+			if (data.completed_qty + data.process_loss_qty != frm.doc.qty) {
 				pending_qty = frm.doc.qty - flt(data.completed_qty) - flt(data.process_loss_qty);
 
 				if (pending_qty) {
 					dialog.fields_dict.operations.df.data.push({
-						'name': data.name,
-						'operation': data.operation,
-						'workstation': data.workstation,
-						'batch_size': data.batch_size,
-						'qty': pending_qty,
-						'pending_qty': pending_qty,
-						'sequence_id': data.sequence_id
+						name: data.name,
+						operation: data.operation,
+						workstation: data.workstation,
+						batch_size: data.batch_size,
+						qty: pending_qty,
+						pending_qty: pending_qty,
+						sequence_id: data.sequence_id,
 					});
 				}
 			}
@@ -305,202 +322,212 @@
 		dialog.fields_dict.operations.grid.refresh();
 	},
 
-	make_bom: function(frm) {
+	make_bom: function (frm) {
 		frappe.call({
 			method: "make_bom",
 			doc: frm.doc,
-			callback: function(r){
+			callback: function (r) {
 				if (r.message) {
 					var doc = frappe.model.sync(r.message)[0];
 					frappe.set_route("Form", doc.doctype, doc.name);
 				}
-			}
+			},
 		});
 	},
 
-	show_progress_for_items: function(frm) {
+	show_progress_for_items: function (frm) {
 		var bars = [];
-		var message = '';
+		var message = "";
 		var added_min = false;
 
 		// produced qty
-		var title = __('{0} items produced', [frm.doc.produced_qty]);
+		var title = __("{0} items produced", [frm.doc.produced_qty]);
 		bars.push({
-			'title': title,
-			'width': (frm.doc.produced_qty / frm.doc.qty * 100) + '%',
-			'progress_class': 'progress-bar-success'
+			title: title,
+			width: (frm.doc.produced_qty / frm.doc.qty) * 100 + "%",
+			progress_class: "progress-bar-success",
 		});
-		if (bars[0].width == '0%') {
-			bars[0].width = '0.5%';
+		if (bars[0].width == "0%") {
+			bars[0].width = "0.5%";
 			added_min = 0.5;
 		}
 		message = title;
 		// pending qty
-		if(!frm.doc.skip_transfer){
+		if (!frm.doc.skip_transfer) {
 			var pending_complete = frm.doc.material_transferred_for_manufacturing - frm.doc.produced_qty;
-			if(pending_complete) {
-				var width = ((pending_complete / frm.doc.qty * 100) - added_min);
-				title = __('{0} items in progress', [pending_complete]);
+			if (pending_complete) {
+				var width = (pending_complete / frm.doc.qty) * 100 - added_min;
+				title = __("{0} items in progress", [pending_complete]);
 				bars.push({
-					'title': title,
-					'width': (width > 100 ? "99.5" : width)  + '%',
-					'progress_class': 'progress-bar-warning'
+					title: title,
+					width: (width > 100 ? "99.5" : width) + "%",
+					progress_class: "progress-bar-warning",
 				});
-				message = message + '. ' + title;
+				message = message + ". " + title;
 			}
 		}
-		frm.dashboard.add_progress(__('Status'), bars, message);
+		frm.dashboard.add_progress(__("Status"), bars, message);
 	},
 
-	show_progress_for_operations: function(frm) {
+	show_progress_for_operations: function (frm) {
 		if (frm.doc.operations && frm.doc.operations.length) {
-
 			let progress_class = {
 				"Work in Progress": "progress-bar-warning",
-				"Completed": "progress-bar-success"
+				Completed: "progress-bar-success",
 			};
 
 			let bars = [];
-			let message = '';
-			let title = '';
+			let message = "";
+			let title = "";
 			let status_wise_oprtation_data = {};
 			let total_completed_qty = frm.doc.qty * frm.doc.operations.length;
 
-			frm.doc.operations.forEach(d => {
+			frm.doc.operations.forEach((d) => {
 				if (!status_wise_oprtation_data[d.status]) {
 					status_wise_oprtation_data[d.status] = [d.completed_qty, d.operation];
 				} else {
 					status_wise_oprtation_data[d.status][0] += d.completed_qty;
-					status_wise_oprtation_data[d.status][1] += ', ' + d.operation;
+					status_wise_oprtation_data[d.status][1] += ", " + d.operation;
 				}
 			});
 
 			for (let key in status_wise_oprtation_data) {
 				title = __("{0} Operations: {1}", [key, status_wise_oprtation_data[key][1].bold()]);
 				bars.push({
-					'title': title,
-					'width': status_wise_oprtation_data[key][0] / total_completed_qty * 100  + '%',
-					'progress_class': progress_class[key]
+					title: title,
+					width: (status_wise_oprtation_data[key][0] / total_completed_qty) * 100 + "%",
+					progress_class: progress_class[key],
 				});
 
-				message += title + '. ';
+				message += title + ". ";
 			}
 
-			frm.dashboard.add_progress(__('Status'), bars, message);
+			frm.dashboard.add_progress(__("Status"), bars, message);
 		}
 	},
 
-	production_item: function(frm) {
+	production_item: function (frm) {
 		if (frm.doc.production_item) {
 			frappe.call({
 				method: "erpnext.manufacturing.doctype.work_order.work_order.get_item_details",
 				args: {
 					item: frm.doc.production_item,
-					project: frm.doc.project
+					project: frm.doc.project,
 				},
 				freeze: true,
-				callback: function(r) {
-					if(r.message) {
-						frm.set_value('sales_order', "");
-						frm.trigger('set_sales_order');
+				callback: function (r) {
+					if (r.message) {
+						frm.set_value("sales_order", "");
+						frm.trigger("set_sales_order");
 						erpnext.in_production_item_onchange = true;
 
-						$.each(["description", "stock_uom", "project", "bom_no", "allow_alternative_item",
-							"transfer_material_against", "item_name"], function(i, field) {
-							frm.set_value(field, r.message[field]);
-						});
+						$.each(
+							[
+								"description",
+								"stock_uom",
+								"project",
+								"bom_no",
+								"allow_alternative_item",
+								"transfer_material_against",
+								"item_name",
+							],
+							function (i, field) {
+								frm.set_value(field, r.message[field]);
+							}
+						);
 
-						if(r.message["set_scrap_wh_mandatory"]){
+						if (r.message["set_scrap_wh_mandatory"]) {
 							frm.toggle_reqd("scrap_warehouse", true);
 						}
 						erpnext.in_production_item_onchange = false;
 					}
-				}
+				},
 			});
 		}
 	},
 
-	project: function(frm) {
-		if(!erpnext.in_production_item_onchange && !frm.doc.bom_no) {
+	project: function (frm) {
+		if (!erpnext.in_production_item_onchange && !frm.doc.bom_no) {
 			frm.trigger("production_item");
 		}
 	},
 
-	bom_no: function(frm) {
+	bom_no: function (frm) {
 		return frm.call({
 			doc: frm.doc,
 			method: "get_items_and_operations_from_bom",
 			freeze: true,
-			callback: function(r) {
-				if(r.message["set_scrap_wh_mandatory"]){
+			callback: function (r) {
+				if (r.message["set_scrap_wh_mandatory"]) {
 					frm.toggle_reqd("scrap_warehouse", true);
 				}
-			}
+			},
 		});
 	},
 
-	use_multi_level_bom: function(frm) {
-		if(frm.doc.bom_no) {
+	use_multi_level_bom: function (frm) {
+		if (frm.doc.bom_no) {
 			frm.trigger("bom_no");
 		}
 	},
 
-	qty: function(frm) {
-		frm.trigger('bom_no');
+	qty: function (frm) {
+		frm.trigger("bom_no");
 	},
 
-	before_submit: function(frm) {
+	before_submit: function (frm) {
 		frm.fields_dict.required_items.grid.toggle_reqd("source_warehouse", true);
-		frm.toggle_reqd("transfer_material_against",
-			frm.doc.operations && frm.doc.operations.length > 0);
+		frm.toggle_reqd("transfer_material_against", frm.doc.operations && frm.doc.operations.length > 0);
 	},
 
-	set_sales_order: function(frm) {
-		if(frm.doc.production_item) {
+	set_sales_order: function (frm) {
+		if (frm.doc.production_item) {
 			frappe.call({
 				method: "erpnext.manufacturing.doctype.work_order.work_order.query_sales_order",
 				args: { production_item: frm.doc.production_item },
-				callback: function(r) {
-					frm.set_query("sales_order", function() {
+				callback: function (r) {
+					frm.set_query("sales_order", function () {
 						erpnext.in_production_item_onchange = true;
 						return {
-							filters: [
-								["Sales Order","name", "in", r.message]
-							]
+							filters: [["Sales Order", "name", "in", r.message]],
 						};
 					});
-				}
+				},
 			});
 		}
 	},
 
-	additional_operating_cost: function(frm) {
+	additional_operating_cost: function (frm) {
 		erpnext.work_order.calculate_cost(frm.doc);
 		erpnext.work_order.calculate_total_cost(frm);
 	},
 });
 
 frappe.ui.form.on("Work Order Item", {
-	source_warehouse: function(frm, cdt, cdn) {
+	source_warehouse: function (frm, cdt, cdn) {
 		var row = locals[cdt][cdn];
-		if(!row.item_code) {
+		if (!row.item_code) {
 			frappe.throw(__("Please set the Item Code first"));
-		} else if(row.source_warehouse) {
+		} else if (row.source_warehouse) {
 			frappe.call({
-				"method": "erpnext.stock.utils.get_latest_stock_qty",
+				method: "erpnext.stock.utils.get_latest_stock_qty",
 				args: {
 					item_code: row.item_code,
-					warehouse: row.source_warehouse
+					warehouse: row.source_warehouse,
 				},
 				callback: function (r) {
-					frappe.model.set_value(row.doctype, row.name,
-						"available_qty_at_source_warehouse", r.message);
-				}
+					frappe.model.set_value(
+						row.doctype,
+						row.name,
+						"available_qty_at_source_warehouse",
+						r.message
+					);
+				},
 			});
 		}
 	},
 
-	item_code: function(frm, cdt, cdn) {
+	item_code: function (frm, cdt, cdn) {
 		let row = locals[cdt][cdn];
 
 		if (row.item_code) {
@@ -508,94 +535,104 @@
 				method: "erpnext.stock.doctype.item.item.get_item_details",
 				args: {
 					item_code: row.item_code,
-					company: frm.doc.company
+					company: frm.doc.company,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (r.message) {
 						frappe.model.set_value(cdt, cdn, {
-							"required_qty": row.required_qty || 1,
-							"item_name": r.message.item_name,
-							"description": r.message.description,
-							"source_warehouse": r.message.default_warehouse,
-							"allow_alternative_item": r.message.allow_alternative_item,
-							"include_item_in_manufacturing": r.message.include_item_in_manufacturing
+							required_qty: row.required_qty || 1,
+							item_name: r.message.item_name,
+							description: r.message.description,
+							source_warehouse: r.message.default_warehouse,
+							allow_alternative_item: r.message.allow_alternative_item,
+							include_item_in_manufacturing: r.message.include_item_in_manufacturing,
 						});
 					}
-				}
+				},
 			});
 		}
-	}
+	},
 });
 
 frappe.ui.form.on("Work Order Operation", {
-	workstation: function(frm, cdt, cdn) {
+	workstation: function (frm, cdt, cdn) {
 		var d = locals[cdt][cdn];
 		if (d.workstation) {
 			frappe.call({
-				"method": "frappe.client.get",
+				method: "frappe.client.get",
 				args: {
 					doctype: "Workstation",
-					name: d.workstation
+					name: d.workstation,
 				},
 				callback: function (data) {
 					frappe.model.set_value(d.doctype, d.name, "hour_rate", data.message.hour_rate);
 					erpnext.work_order.calculate_cost(frm.doc);
 					erpnext.work_order.calculate_total_cost(frm);
-				}
+				},
 			});
 		}
 	},
-	time_in_mins: function(frm, cdt, cdn) {
+	time_in_mins: function (frm, cdt, cdn) {
 		erpnext.work_order.calculate_cost(frm.doc);
 		erpnext.work_order.calculate_total_cost(frm);
 	},
 });
 
 erpnext.work_order = {
-	set_custom_buttons: function(frm) {
+	set_custom_buttons: function (frm) {
 		var doc = frm.doc;
 
 		if (doc.status !== "Closed") {
-			frm.add_custom_button(__('Close'), function() {
-				frappe.confirm(__("Once the Work Order is Closed. It can't be resumed."),
-					() => {
+			frm.add_custom_button(
+				__("Close"),
+				function () {
+					frappe.confirm(__("Once the Work Order is Closed. It can't be resumed."), () => {
 						erpnext.work_order.change_work_order_status(frm, "Closed");
-					}
-				);
-			}, __("Status"));
+					});
+				},
+				__("Status")
+			);
 		}
 
 		if (doc.docstatus === 1 && !in_list(["Closed", "Completed"], doc.status)) {
-			if (doc.status != 'Stopped' && doc.status != 'Completed') {
-				frm.add_custom_button(__('Stop'), function() {
-					erpnext.work_order.change_work_order_status(frm, "Stopped");
-				}, __("Status"));
-			} else if (doc.status == 'Stopped') {
-				frm.add_custom_button(__('Re-open'), function() {
-					erpnext.work_order.change_work_order_status(frm, "Resumed");
-				}, __("Status"));
+			if (doc.status != "Stopped" && doc.status != "Completed") {
+				frm.add_custom_button(
+					__("Stop"),
+					function () {
+						erpnext.work_order.change_work_order_status(frm, "Stopped");
+					},
+					__("Status")
+				);
+			} else if (doc.status == "Stopped") {
+				frm.add_custom_button(
+					__("Re-open"),
+					function () {
+						erpnext.work_order.change_work_order_status(frm, "Resumed");
+					},
+					__("Status")
+				);
 			}
 
-			const show_start_btn = (frm.doc.skip_transfer
-				|| frm.doc.transfer_material_against == 'Job Card') ? 0 : 1;
+			const show_start_btn =
+				frm.doc.skip_transfer || frm.doc.transfer_material_against == "Job Card" ? 0 : 1;
 
 			if (show_start_btn) {
 				let pending_to_transfer = frm.doc.required_items.some(
-					item => flt(item.transferred_qty) < flt(item.required_qty)
+					(item) => flt(item.transferred_qty) < flt(item.required_qty)
 				);
-				if (pending_to_transfer && frm.doc.status != 'Stopped') {
+				if (pending_to_transfer && frm.doc.status != "Stopped") {
 					frm.has_start_btn = true;
-					frm.add_custom_button(__('Create Pick List'), function() {
+					frm.add_custom_button(__("Create Pick List"), function () {
 						erpnext.work_order.create_pick_list(frm);
 					});
-					var start_btn = frm.add_custom_button(__('Start'), function() {
-						erpnext.work_order.make_se(frm, 'Material Transfer for Manufacture');
+					var start_btn = frm.add_custom_button(__("Start"), function () {
+						erpnext.work_order.make_se(frm, "Material Transfer for Manufacture");
 					});
-					start_btn.addClass('btn-primary');
+					start_btn.addClass("btn-primary");
 				}
 			}
 
-			if (frm.doc.status != 'Stopped') {
+			if (frm.doc.status != "Stopped") {
 				// If "Material Consumption is check in Manufacturing Settings, allow Material Consumption
 				if (frm.doc.__onload && frm.doc.__onload.material_consumption == 1) {
 					if (flt(doc.material_transferred_for_manufacturing) > 0 || frm.doc.skip_transfer) {
@@ -604,89 +641,102 @@
 						var tbl = frm.doc.required_items || [];
 						var tbl_lenght = tbl.length;
 						for (var i = 0, len = tbl_lenght; i < len; i++) {
-							let wo_item_qty = frm.doc.required_items[i].transferred_qty || frm.doc.required_items[i].required_qty;
+							let wo_item_qty =
+								frm.doc.required_items[i].transferred_qty ||
+								frm.doc.required_items[i].required_qty;
 							if (flt(wo_item_qty) > flt(frm.doc.required_items[i].consumed_qty)) {
 								counter += 1;
 							}
 						}
 						if (counter > 0) {
-							var consumption_btn = frm.add_custom_button(__('Material Consumption'), function() {
-								const backflush_raw_materials_based_on = frm.doc.__onload.backflush_raw_materials_based_on;
-								erpnext.work_order.make_consumption_se(frm, backflush_raw_materials_based_on);
-							});
-							consumption_btn.addClass('btn-primary');
+							var consumption_btn = frm.add_custom_button(
+								__("Material Consumption"),
+								function () {
+									const backflush_raw_materials_based_on =
+										frm.doc.__onload.backflush_raw_materials_based_on;
+									erpnext.work_order.make_consumption_se(
+										frm,
+										backflush_raw_materials_based_on
+									);
+								}
+							);
+							consumption_btn.addClass("btn-primary");
 						}
 					}
 				}
 
-				if(!frm.doc.skip_transfer){
+				if (!frm.doc.skip_transfer) {
 					if (flt(doc.material_transferred_for_manufacturing) > 0) {
-						if ((flt(doc.produced_qty) < flt(doc.material_transferred_for_manufacturing))) {
+						if (flt(doc.produced_qty) < flt(doc.material_transferred_for_manufacturing)) {
 							frm.has_finish_btn = true;
 
-							let finish_btn = frm.add_custom_button(__('Finish'), function() {
-								erpnext.work_order.make_se(frm, 'Manufacture');
+							let finish_btn = frm.add_custom_button(__("Finish"), function () {
+								erpnext.work_order.make_se(frm, "Manufacture");
 							});
 
-							if(doc.material_transferred_for_manufacturing>=doc.qty) {
+							if (doc.material_transferred_for_manufacturing >= doc.qty) {
 								// all materials transferred for manufacturing, make this primary
-								finish_btn.addClass('btn-primary');
+								finish_btn.addClass("btn-primary");
 							}
 						} else if (frm.doc.__onload && frm.doc.__onload.overproduction_percentage) {
 							let allowance_percentage = frm.doc.__onload.overproduction_percentage;
 
 							if (allowance_percentage > 0) {
-								let allowed_qty = frm.doc.qty + ((allowance_percentage / 100) * frm.doc.qty);
+								let allowed_qty = frm.doc.qty + (allowance_percentage / 100) * frm.doc.qty;
 
-								if ((flt(doc.produced_qty) < allowed_qty)) {
-									frm.add_custom_button(__('Finish'), function() {
-										erpnext.work_order.make_se(frm, 'Manufacture');
+								if (flt(doc.produced_qty) < allowed_qty) {
+									frm.add_custom_button(__("Finish"), function () {
+										erpnext.work_order.make_se(frm, "Manufacture");
 									});
 								}
 							}
 						}
 					}
 				} else {
-					if ((flt(doc.produced_qty) < flt(doc.qty))) {
-						let finish_btn = frm.add_custom_button(__('Finish'), function() {
-							erpnext.work_order.make_se(frm, 'Manufacture');
+					if (flt(doc.produced_qty) < flt(doc.qty)) {
+						let finish_btn = frm.add_custom_button(__("Finish"), function () {
+							erpnext.work_order.make_se(frm, "Manufacture");
 						});
-						finish_btn.addClass('btn-primary');
+						finish_btn.addClass("btn-primary");
 					}
 				}
 			}
 		}
 	},
-	calculate_cost: function(doc) {
-		if (doc.operations){
+	calculate_cost: function (doc) {
+		if (doc.operations) {
 			var op = doc.operations;
 			doc.planned_operating_cost = 0.0;
-			for(var i=0;i<op.length;i++) {
-				var planned_operating_cost = flt(flt(op[i].hour_rate) * flt(op[i].time_in_mins) / 60, 2);
-				frappe.model.set_value('Work Order Operation', op[i].name,
-					"planned_operating_cost", planned_operating_cost);
+			for (var i = 0; i < op.length; i++) {
+				var planned_operating_cost = flt((flt(op[i].hour_rate) * flt(op[i].time_in_mins)) / 60, 2);
+				frappe.model.set_value(
+					"Work Order Operation",
+					op[i].name,
+					"planned_operating_cost",
+					planned_operating_cost
+				);
 				doc.planned_operating_cost += planned_operating_cost;
 			}
-			refresh_field('planned_operating_cost');
+			refresh_field("planned_operating_cost");
 		}
 	},
 
-	calculate_total_cost: function(frm) {
+	calculate_total_cost: function (frm) {
 		let variable_cost = flt(frm.doc.actual_operating_cost) || flt(frm.doc.planned_operating_cost);
-		frm.set_value("total_operating_cost", (flt(frm.doc.additional_operating_cost) + variable_cost));
+		frm.set_value("total_operating_cost", flt(frm.doc.additional_operating_cost) + variable_cost);
 	},
 
-	set_default_warehouse: function(frm) {
+	set_default_warehouse: function (frm) {
 		if (!(frm.doc.wip_warehouse || frm.doc.fg_warehouse)) {
 			frappe.call({
 				method: "erpnext.manufacturing.doctype.work_order.work_order.get_default_warehouse",
-				callback: function(r) {
+				callback: function (r) {
 					if (!r.exe) {
 						frm.set_value("wip_warehouse", r.message.wip_warehouse);
 						frm.set_value("fg_warehouse", r.message.fg_warehouse);
 						frm.set_value("scrap_warehouse", r.message.scrap_warehouse);
 					}
-				}
+				},
 			});
 		}
 	},
@@ -696,166 +746,187 @@
 		if (frm.doc.skip_transfer) {
 			max = flt(frm.doc.qty) - flt(frm.doc.produced_qty);
 		} else {
-			if (purpose === 'Manufacture') {
+			if (purpose === "Manufacture") {
 				max = flt(frm.doc.material_transferred_for_manufacturing) - flt(frm.doc.produced_qty);
 			} else {
 				max = flt(frm.doc.qty) - flt(frm.doc.material_transferred_for_manufacturing);
 			}
 		}
-		return flt(max, precision('qty'));
+		return flt(max, precision("qty"));
 	},
 
-	show_prompt_for_qty_input: function(frm, purpose) {
+	show_prompt_for_qty_input: function (frm, purpose) {
 		let max = this.get_max_transferable_qty(frm, purpose);
 		return new Promise((resolve, reject) => {
-			frappe.prompt({
-				fieldtype: 'Float',
-				label: __('Qty for {0}', [__(purpose)]),
-				fieldname: 'qty',
-				description: __('Max: {0}', [max]),
-				default: max
-			}, data => {
-				max += (frm.doc.qty * (frm.doc.__onload.overproduction_percentage || 0.0)) / 100;
+			frappe.prompt(
+				{
+					fieldtype: "Float",
+					label: __("Qty for {0}", [__(purpose)]),
+					fieldname: "qty",
+					description: __("Max: {0}", [max]),
+					default: max,
+				},
+				(data) => {
+					max += (frm.doc.qty * (frm.doc.__onload.overproduction_percentage || 0.0)) / 100;
 
-				if (data.qty > max) {
-					frappe.msgprint(__('Quantity must not be more than {0}', [max]));
-					reject();
-				}
-				data.purpose = purpose;
-				resolve(data);
-			}, __('Select Quantity'), __('Create'));
+					if (data.qty > max) {
+						frappe.msgprint(__("Quantity must not be more than {0}", [max]));
+						reject();
+					}
+					data.purpose = purpose;
+					resolve(data);
+				},
+				__("Select Quantity"),
+				__("Create")
+			);
 		});
 	},
 
-	make_se: function(frm, purpose) {
+	make_se: function (frm, purpose) {
 		this.show_prompt_for_qty_input(frm, purpose)
-			.then(data => {
-				return frappe.xcall('erpnext.manufacturing.doctype.work_order.work_order.make_stock_entry', {
-					'work_order_id': frm.doc.name,
-					'purpose': purpose,
-					'qty': data.qty
+			.then((data) => {
+				return frappe.xcall("erpnext.manufacturing.doctype.work_order.work_order.make_stock_entry", {
+					work_order_id: frm.doc.name,
+					purpose: purpose,
+					qty: data.qty,
 				});
-			}).then(stock_entry => {
+			})
+			.then((stock_entry) => {
 				frappe.model.sync(stock_entry);
-				frappe.set_route('Form', stock_entry.doctype, stock_entry.name);
+				frappe.set_route("Form", stock_entry.doctype, stock_entry.name);
 			});
-
 	},
 
-	create_pick_list: function(frm, purpose='Material Transfer for Manufacture') {
+	create_pick_list: function (frm, purpose = "Material Transfer for Manufacture") {
 		this.show_prompt_for_qty_input(frm, purpose)
-			.then(data => {
-				return frappe.xcall('erpnext.manufacturing.doctype.work_order.work_order.create_pick_list', {
-					'source_name': frm.doc.name,
-					'for_qty': data.qty
+			.then((data) => {
+				return frappe.xcall("erpnext.manufacturing.doctype.work_order.work_order.create_pick_list", {
+					source_name: frm.doc.name,
+					for_qty: data.qty,
 				});
-			}).then(pick_list => {
+			})
+			.then((pick_list) => {
 				frappe.model.sync(pick_list);
-				frappe.set_route('Form', pick_list.doctype, pick_list.name);
+				frappe.set_route("Form", pick_list.doctype, pick_list.name);
 			});
 	},
 
-	make_consumption_se: function(frm, backflush_raw_materials_based_on) {
+	make_consumption_se: function (frm, backflush_raw_materials_based_on) {
 		let max = 0;
-		if(!frm.doc.skip_transfer){
-			max = (backflush_raw_materials_based_on === "Material Transferred for Manufacture") ?
-				flt(frm.doc.material_transferred_for_manufacturing) - flt(frm.doc.produced_qty) :
-				flt(frm.doc.qty) - flt(frm.doc.produced_qty);
-				// flt(frm.doc.qty) - flt(frm.doc.material_transferred_for_manufacturing);
+		if (!frm.doc.skip_transfer) {
+			max =
+				backflush_raw_materials_based_on === "Material Transferred for Manufacture"
+					? flt(frm.doc.material_transferred_for_manufacturing) - flt(frm.doc.produced_qty)
+					: flt(frm.doc.qty) - flt(frm.doc.produced_qty);
+			// flt(frm.doc.qty) - flt(frm.doc.material_transferred_for_manufacturing);
 		} else {
 			max = flt(frm.doc.qty) - flt(frm.doc.produced_qty);
 		}
 
 		frappe.call({
-			method:"erpnext.manufacturing.doctype.work_order.work_order.make_stock_entry",
+			method: "erpnext.manufacturing.doctype.work_order.work_order.make_stock_entry",
 			args: {
-				"work_order_id": frm.doc.name,
-				"purpose": "Material Consumption for Manufacture",
-				"qty": max
+				work_order_id: frm.doc.name,
+				purpose: "Material Consumption for Manufacture",
+				qty: max,
 			},
-			callback: function(r) {
+			callback: function (r) {
 				var doclist = frappe.model.sync(r.message);
 				frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
-			}
+			},
 		});
 	},
 
-	change_work_order_status: function(frm, status) {
-		let method_name = status=="Closed" ? "close_work_order" : "stop_unstop";
+	change_work_order_status: function (frm, status) {
+		let method_name = status == "Closed" ? "close_work_order" : "stop_unstop";
 		frappe.call({
 			method: `erpnext.manufacturing.doctype.work_order.work_order.${method_name}`,
 			freeze: true,
 			freeze_message: __("Updating Work Order status"),
 			args: {
 				work_order: frm.doc.name,
-				status: status
+				status: status,
 			},
-			callback: function(r) {
-				if(r.message) {
+			callback: function (r) {
+				if (r.message) {
 					frm.set_value("status", r.message);
 					frm.reload_doc();
 				}
-			}
+			},
 		});
-	}
+	},
 };
 
-frappe.tour['Work Order'] = [
+frappe.tour["Work Order"] = [
 	{
 		fieldname: "production_item",
 		title: "Item to Manufacture",
-		description: __("Select the Item to be manufactured.")
+		description: __("Select the Item to be manufactured."),
 	},
 	{
 		fieldname: "bom_no",
 		title: "BOM No",
-		description: __("The default BOM for that item will be fetched by the system. You can also change the BOM.")
+		description: __(
+			"The default BOM for that item will be fetched by the system. You can also change the BOM."
+		),
 	},
 	{
 		fieldname: "qty",
 		title: "Qty to Manufacture",
-		description: __("Enter the quantity to manufacture. Raw material Items will be fetched only when this is set.")
+		description: __(
+			"Enter the quantity to manufacture. Raw material Items will be fetched only when this is set."
+		),
 	},
 	{
 		fieldname: "use_multi_level_bom",
 		title: "Use Multi-Level BOM",
-		description: __("This is enabled by default. If you want to plan materials for sub-assemblies of the Item you're manufacturing leave this enabled. If you plan and manufacture the sub-assemblies separately, you can disable this checkbox.")
+		description: __(
+			"This is enabled by default. If you want to plan materials for sub-assemblies of the Item you're manufacturing leave this enabled. If you plan and manufacture the sub-assemblies separately, you can disable this checkbox."
+		),
 	},
 	{
 		fieldname: "source_warehouse",
 		title: "Source Warehouse",
-		description: __("The warehouse where you store your raw materials. Each required item can have a separate source warehouse. Group warehouse also can be selected as source warehouse. On submission of the Work Order, the raw materials will be reserved in these warehouses for production usage.")
+		description: __(
+			"The warehouse where you store your raw materials. Each required item can have a separate source warehouse. Group warehouse also can be selected as source warehouse. On submission of the Work Order, the raw materials will be reserved in these warehouses for production usage."
+		),
 	},
 	{
 		fieldname: "fg_warehouse",
 		title: "Target Warehouse",
-		description: __("The warehouse where you store finished Items before they are shipped.")
+		description: __("The warehouse where you store finished Items before they are shipped."),
 	},
 	{
 		fieldname: "wip_warehouse",
 		title: "Work-in-Progress Warehouse",
-		description: __("The warehouse where your Items will be transferred when you begin production. Group Warehouse can also be selected as a Work in Progress warehouse.")
+		description: __(
+			"The warehouse where your Items will be transferred when you begin production. Group Warehouse can also be selected as a Work in Progress warehouse."
+		),
 	},
 	{
 		fieldname: "scrap_warehouse",
 		title: "Scrap Warehouse",
-		description: __("If the BOM results in Scrap material, the Scrap Warehouse needs to be selected.")
+		description: __("If the BOM results in Scrap material, the Scrap Warehouse needs to be selected."),
 	},
 	{
 		fieldname: "required_items",
 		title: "Required Items",
-		description: __("All the required items (raw materials) will be fetched from BOM and populated in this table. Here you can also change the Source Warehouse for any item. And during the production, you can track transferred raw materials from this table.")
+		description: __(
+			"All the required items (raw materials) will be fetched from BOM and populated in this table. Here you can also change the Source Warehouse for any item. And during the production, you can track transferred raw materials from this table."
+		),
 	},
 	{
 		fieldname: "planned_start_date",
 		title: "Planned Start Date",
-		description: __("Set the Planned Start Date (an Estimated Date at which you want the Production to begin)")
+		description: __(
+			"Set the Planned Start Date (an Estimated Date at which you want the Production to begin)"
+		),
 	},
 	{
 		fieldname: "operations",
 		title: "Operations",
-		description: __("If the selected BOM has Operations mentioned in it, the system will fetch all Operations from BOM, these values can be changed.")
+		description: __(
+			"If the selected BOM has Operations mentioned in it, the system will fetch all Operations from BOM, these values can be changed."
+		),
 	},
-
-
 ];
diff --git a/erpnext/manufacturing/doctype/work_order/work_order_calendar.js b/erpnext/manufacturing/doctype/work_order/work_order_calendar.js
index 7ce05e9..90ce74c 100644
--- a/erpnext/manufacturing/doctype/work_order/work_order_calendar.js
+++ b/erpnext/manufacturing/doctype/work_order/work_order_calendar.js
@@ -2,23 +2,23 @@
 // For license information, please see license.txt
 
 frappe.views.calendar["Work Order"] = {
-	fields:  ["planned_start_date", "planned_end_date", "status", "produced_qty", "qty", "name", "name"],
+	fields: ["planned_start_date", "planned_end_date", "status", "produced_qty", "qty", "name", "name"],
 	field_map: {
-		"start": "planned_start_date",
-		"end": "planned_end_date",
-		"id": "name",
-		"title": "name",
-		"status": "status",
-		"allDay": "allDay",
-		"progress": function(data) {
-			return flt(data.produced_qty) / data.qty * 100;
-		}
+		start: "planned_start_date",
+		end: "planned_end_date",
+		id: "name",
+		title: "name",
+		status: "status",
+		allDay: "allDay",
+		progress: function (data) {
+			return (flt(data.produced_qty) / data.qty) * 100;
+		},
 	},
 	gantt: true,
-	get_css_class: function(data) {
-		if(data.status==="Completed") {
+	get_css_class: function (data) {
+		if (data.status === "Completed") {
 			return "success";
-		} else if(data.status==="In Process") {
+		} else if (data.status === "In Process") {
 			return "warning";
 		} else {
 			return "danger";
@@ -26,23 +26,23 @@
 	},
 	filters: [
 		{
-			"fieldtype": "Link",
-			"fieldname": "sales_order",
-			"options": "Sales Order",
-			"label": __("Sales Order")
+			fieldtype: "Link",
+			fieldname: "sales_order",
+			options: "Sales Order",
+			label: __("Sales Order"),
 		},
 		{
-			"fieldtype": "Link",
-			"fieldname": "production_item",
-			"options": "Item",
-			"label": __("Production Item")
+			fieldtype: "Link",
+			fieldname: "production_item",
+			options: "Item",
+			label: __("Production Item"),
 		},
 		{
-			"fieldtype": "Link",
-			"fieldname": "wip_warehouse",
-			"options": "Warehouse",
-			"label": __("WIP Warehouse")
-		}
+			fieldtype: "Link",
+			fieldname: "wip_warehouse",
+			options: "Warehouse",
+			label: __("WIP Warehouse"),
+		},
 	],
-	get_events_method: "frappe.desk.calendar.get_events"
-}
+	get_events_method: "frappe.desk.calendar.get_events",
+};
diff --git a/erpnext/manufacturing/doctype/work_order/work_order_list.js b/erpnext/manufacturing/doctype/work_order/work_order_list.js
index 81c23bb..1e1e566 100644
--- a/erpnext/manufacturing/doctype/work_order/work_order_list.js
+++ b/erpnext/manufacturing/doctype/work_order/work_order_list.js
@@ -1,19 +1,31 @@
-frappe.listview_settings['Work Order'] = {
-	add_fields: ["bom_no", "status", "sales_order", "qty",
-		"produced_qty", "expected_delivery_date", "planned_start_date", "planned_end_date"],
+frappe.listview_settings["Work Order"] = {
+	add_fields: [
+		"bom_no",
+		"status",
+		"sales_order",
+		"qty",
+		"produced_qty",
+		"expected_delivery_date",
+		"planned_start_date",
+		"planned_end_date",
+	],
 	filters: [["status", "!=", "Stopped"]],
-	get_indicator: function(doc) {
-		if(doc.status==="Submitted") {
+	get_indicator: function (doc) {
+		if (doc.status === "Submitted") {
 			return [__("Not Started"), "orange", "status,=,Submitted"];
 		} else {
-			return [__(doc.status), {
-				"Draft": "red",
-				"Stopped": "red",
-				"Not Started": "red",
-				"In Process": "orange",
-				"Completed": "green",
-				"Cancelled": "gray"
-			}[doc.status], "status,=," + doc.status];
+			return [
+				__(doc.status),
+				{
+					Draft: "red",
+					Stopped: "red",
+					"Not Started": "red",
+					"In Process": "orange",
+					Completed: "green",
+					Cancelled: "gray",
+				}[doc.status],
+				"status,=," + doc.status,
+			];
 		}
-	}
+	},
 };
diff --git a/erpnext/manufacturing/doctype/workstation/_test_workstation.js b/erpnext/manufacturing/doctype/workstation/_test_workstation.js
index f2dced8..8d0a75c 100644
--- a/erpnext/manufacturing/doctype/workstation/_test_workstation.js
+++ b/erpnext/manufacturing/doctype/workstation/_test_workstation.js
@@ -1,4 +1,3 @@
-
 // rename this file from _test_[name] to test_[name] to activate
 // and remove above this line
 
@@ -8,16 +7,16 @@
 	// number of asserts
 	assert.expect(1);
 
-	frappe.run_serially('Workstation', [
+	frappe.run_serially("Workstation", [
 		// insert a new Workstation
-		() => frappe.tests.make([
-			// values to be set
-			{key: 'value'}
-		]),
+		() =>
+			frappe.tests.make([
+				// values to be set
+				{ key: "value" },
+			]),
 		() => {
-			assert.equal(cur_frm.doc.key, 'value');
+			assert.equal(cur_frm.doc.key, "value");
 		},
-		() => done()
+		() => done(),
 	]);
-
 });
diff --git a/erpnext/manufacturing/doctype/workstation/workstation.js b/erpnext/manufacturing/doctype/workstation/workstation.js
index e3ad3fe..255383b 100644
--- a/erpnext/manufacturing/doctype/workstation/workstation.js
+++ b/erpnext/manufacturing/doctype/workstation/workstation.js
@@ -3,7 +3,8 @@
 
 frappe.ui.form.on("Workstation", {
 	set_illustration_image(frm) {
-		let status_image_field = frm.doc.status == "Production" ? frm.doc.on_status_image : frm.doc.off_status_image;
+		let status_image_field =
+			frm.doc.status == "Production" ? frm.doc.on_status_image : frm.doc.off_status_image;
 		if (status_image_field) {
 			frm.sidebar.image_wrapper.find(".sidebar-image").attr("src", status_image_field);
 		}
@@ -20,22 +21,21 @@
 
 		let workstation_dashboard = new WorkstationDashboard({
 			wrapper: $parent,
-			frm: frm
+			frm: frm,
 		});
 	},
 
 	onload(frm) {
-		if(frm.is_new())
-		{
+		if (frm.is_new()) {
 			frappe.call({
-				type:"GET",
-				method:"erpnext.manufacturing.doctype.workstation.workstation.get_default_holiday_list",
-				callback: function(r) {
-					if(!r.exe && r.message){
+				type: "GET",
+				method: "erpnext.manufacturing.doctype.workstation.workstation.get_default_holiday_list",
+				callback: function (r) {
+					if (!r.exe && r.message) {
 						cur_frm.set_value("holiday_list", r.message);
 					}
-				}
-			})
+				},
+			});
 		}
 	},
 
@@ -44,40 +44,43 @@
 			frm.call({
 				method: "set_data_based_on_workstation_type",
 				doc: frm.doc,
-				callback: function(r) {
+				callback: function (r) {
 					frm.refresh_fields();
-				}
-			})
+				},
+			});
 		}
-	}
+	},
 });
 
-frappe.tour['Workstation'] = [
+frappe.tour["Workstation"] = [
 	{
 		fieldname: "workstation_name",
 		title: "Workstation Name",
-		description: __("You can set it as a machine name or operation type. For example, stiching machine 12")
+		description: __(
+			"You can set it as a machine name or operation type. For example, stiching machine 12"
+		),
 	},
 	{
 		fieldname: "production_capacity",
 		title: "Production Capacity",
-		description: __("No. of parallel job cards which can be allowed on this workstation. Example: 2 would mean this workstation can process production for two Work Orders at a time.")
+		description: __(
+			"No. of parallel job cards which can be allowed on this workstation. Example: 2 would mean this workstation can process production for two Work Orders at a time."
+		),
 	},
 	{
 		fieldname: "holiday_list",
 		title: "Holiday List",
-		description: __("A Holiday List can be added to exclude counting these days for the Workstation.")
+		description: __("A Holiday List can be added to exclude counting these days for the Workstation."),
 	},
 	{
 		fieldname: "working_hours",
 		title: "Working Hours",
-		description: __("Under Working Hours table, you can add start and end times for a Workstation. For example, a Workstation may be active from 9 am to 1 pm, then 2 pm to 5 pm. You can also specify the working hours based on shifts. While scheduling a Work Order, the system will check for the availability of the Workstation based on the working hours specified.")
+		description: __(
+			"Under Working Hours table, you can add start and end times for a Workstation. For example, a Workstation may be active from 9 am to 1 pm, then 2 pm to 5 pm. You can also specify the working hours based on shifts. While scheduling a Work Order, the system will check for the availability of the Workstation based on the working hours specified."
+		),
 	},
-
-
 ];
 
-
 class WorkstationDashboard {
 	constructor({ wrapper, frm }) {
 		this.$wrapper = $(wrapper);
@@ -90,20 +93,20 @@
 		frappe.call({
 			method: "erpnext.manufacturing.doctype.workstation.workstation.get_job_cards",
 			args: {
-				workstation: this.frm.doc.name
+				workstation: this.frm.doc.name,
 			},
 			callback: (r) => {
 				if (r.message) {
 					this.job_cards = r.message;
 					this.render_job_cards();
 				}
-			}
+			},
 		});
 	}
 
 	render_job_cards() {
-		let template  = frappe.render_template("workstation_job_card", {
-			data: this.job_cards
+		let template = frappe.render_template("workstation_job_card", {
+			data: this.job_cards,
 		});
 
 		this.$wrapper.html(template);
@@ -114,11 +117,18 @@
 
 	toggle_job_card() {
 		this.$wrapper.find(".collapse-indicator-job").on("click", (e) => {
-			$(e.currentTarget).closest(".form-dashboard-section").find(".section-body-job-card").toggleClass("hide")
-			if ($(e.currentTarget).closest(".form-dashboard-section").find(".section-body-job-card").hasClass("hide"))
-				$(e.currentTarget).html(frappe.utils.icon("es-line-down", "sm", "mb-1"))
-			else
-				$(e.currentTarget).html(frappe.utils.icon("es-line-up", "sm", "mb-1"))
+			$(e.currentTarget)
+				.closest(".form-dashboard-section")
+				.find(".section-body-job-card")
+				.toggleClass("hide");
+			if (
+				$(e.currentTarget)
+					.closest(".form-dashboard-section")
+					.find(".section-body-job-card")
+					.hasClass("hide")
+			)
+				$(e.currentTarget).html(frappe.utils.icon("es-line-down", "sm", "mb-1"));
+			else $(e.currentTarget).html(frappe.utils.icon("es-line-up", "sm", "mb-1"));
 		});
 	}
 
@@ -142,80 +152,90 @@
 
 	start_job(job_card) {
 		let me = this;
-		frappe.prompt([
-			{
-				fieldtype: 'Datetime',
-				label: __('Start Time'),
-				fieldname: 'start_time',
-				reqd: 1,
-				default: frappe.datetime.now_datetime()
-			},
-			{
-				label: __('Operator'),
-				fieldname: 'employee',
-				fieldtype: 'Link',
-				options: 'Employee',
-			}
-		], data => {
-			this.frm.call({
-				method: "start_job",
-				doc: this.frm.doc,
-				args: {
-					job_card: job_card,
-					from_time: data.start_time,
-					employee: data.employee,
+		frappe.prompt(
+			[
+				{
+					fieldtype: "Datetime",
+					label: __("Start Time"),
+					fieldname: "start_time",
+					reqd: 1,
+					default: frappe.datetime.now_datetime(),
 				},
-				callback(r) {
-					if (r.message) {
-						me.job_cards = [r.message];
-						me.prepare_timer()
-						me.update_job_card_details();
-					}
-				}
-			});
-		}, __("Enter Value"), __("Start Job"));
+				{
+					label: __("Operator"),
+					fieldname: "employee",
+					fieldtype: "Link",
+					options: "Employee",
+				},
+			],
+			(data) => {
+				this.frm.call({
+					method: "start_job",
+					doc: this.frm.doc,
+					args: {
+						job_card: job_card,
+						from_time: data.start_time,
+						employee: data.employee,
+					},
+					callback(r) {
+						if (r.message) {
+							me.job_cards = [r.message];
+							me.prepare_timer();
+							me.update_job_card_details();
+						}
+					},
+				});
+			},
+			__("Enter Value"),
+			__("Start Job")
+		);
 	}
 
 	complete_job(job_card, qty_to_manufacture) {
 		let me = this;
 		let fields = [
 			{
-				fieldtype: 'Float',
-				label: __('Completed Quantity'),
-				fieldname: 'qty',
+				fieldtype: "Float",
+				label: __("Completed Quantity"),
+				fieldname: "qty",
 				reqd: 1,
-				default: flt(qty_to_manufacture || 0)
+				default: flt(qty_to_manufacture || 0),
 			},
 			{
-				fieldtype: 'Datetime',
-				label: __('End Time'),
-				fieldname: 'end_time',
-				default: frappe.datetime.now_datetime()
+				fieldtype: "Datetime",
+				label: __("End Time"),
+				fieldname: "end_time",
+				default: frappe.datetime.now_datetime(),
 			},
 		];
 
-		frappe.prompt(fields, data => {
-			if (data.qty <= 0) {
-				frappe.throw(__("Quantity should be greater than 0"));
-			}
-
-			this.frm.call({
-				method: "complete_job",
-				doc: this.frm.doc,
-				args: {
-					job_card: job_card,
-					qty: data.qty,
-					to_time: data.end_time,
-				},
-				callback: function(r) {
-					if (r.message) {
-						me.job_cards = [r.message];
-						me.prepare_timer()
-						me.update_job_card_details();
-					}
+		frappe.prompt(
+			fields,
+			(data) => {
+				if (data.qty <= 0) {
+					frappe.throw(__("Quantity should be greater than 0"));
 				}
-			});
-		}, __("Enter Value"), __("Submit"));
+
+				this.frm.call({
+					method: "complete_job",
+					doc: this.frm.doc,
+					args: {
+						job_card: job_card,
+						qty: data.qty,
+						to_time: data.end_time,
+					},
+					callback: function (r) {
+						if (r.message) {
+							me.job_cards = [r.message];
+							me.prepare_timer();
+							me.update_job_card_details();
+						}
+					},
+				});
+			},
+			__("Enter Value"),
+			__("Submit")
+		);
 	}
 
 	make_material_request(job_card) {
@@ -229,7 +249,7 @@
 					var doc = frappe.model.sync(r.message)[0];
 					frappe.set_route("Form", doc.doctype, doc.name);
 				}
-			}
+			},
 		});
 	}
 
@@ -248,18 +268,17 @@
 
 	update_job_card_details() {
 		let color_map = {
-			"Pending": "var(--bg-blue)",
+			Pending: "var(--bg-blue)",
 			"In Process": "var(--bg-yellow)",
-			"Submitted": "var(--bg-blue)",
-			"Open": "var(--bg-gray)",
-			"Closed": "var(--bg-green)",
+			Submitted: "var(--bg-blue)",
+			Open: "var(--bg-gray)",
+			Closed: "var(--bg-green)",
 			"Work In Progress": "var(--bg-orange)",
-		}
+		};
 
 		this.job_cards.forEach((data) => {
-			let job_card_selector =  this.$wrapper.find(`
-				[data-name='${data.name}']`
-			);
+			let job_card_selector = this.$wrapper.find(`
+				[data-name='${data.name}']`);
 
 			$(job_card_selector).find(".job-card-status").text(data.status);
 			$(job_card_selector).find(".job-card-status").css("backgroundColor", color_map[data.status]);
@@ -284,20 +303,26 @@
 	updateStopwatch(data) {
 		let increment = data._current_time;
 		let hours = Math.floor(increment / 3600);
-		let minutes = Math.floor((increment - (hours * 3600)) / 60);
-		let seconds = cint(increment - (hours * 3600) - (minutes * 60));
+		let minutes = Math.floor((increment - hours * 3600) / 60);
+		let seconds = cint(increment - hours * 3600 - minutes * 60);
 
-		let job_card_selector = `[data-job-card='${data.name}']`
-		let timer_selector =  this.$wrapper.find(job_card_selector)
+		let job_card_selector = `[data-job-card='${data.name}']`;
+		let timer_selector = this.$wrapper.find(job_card_selector);
 
-		$(timer_selector).find(".hours").text(hours < 10 ? ("0" + hours.toString()) : hours.toString());
-		$(timer_selector).find(".minutes").text(minutes < 10 ? ("0" + minutes.toString()) : minutes.toString());
-		$(timer_selector).find(".seconds").text(seconds < 10 ? ("0" + seconds.toString()) : seconds.toString());
+		$(timer_selector)
+			.find(".hours")
+			.text(hours < 10 ? "0" + hours.toString() : hours.toString());
+		$(timer_selector)
+			.find(".minutes")
+			.text(minutes < 10 ? "0" + minutes.toString() : minutes.toString());
+		$(timer_selector)
+			.find(".seconds")
+			.text(seconds < 10 ? "0" + seconds.toString() : seconds.toString());
 	}
 
 	get_current_time(data) {
 		let current_time = 0.0;
-		data.time_logs.forEach(d => {
+		data.time_logs.forEach((d) => {
 			if (d.to_time) {
 				if (d.time_in_mins) {
 					current_time += flt(d.time_in_mins, 2) * 60;
@@ -315,4 +340,4 @@
 	get_seconds_diff(d1, d2) {
 		return moment(d1).diff(d2, "seconds");
 	}
-}
\ No newline at end of file
+}
diff --git a/erpnext/manufacturing/doctype/workstation/workstation_list.js b/erpnext/manufacturing/doctype/workstation/workstation_list.js
index 86928ca..3372263 100644
--- a/erpnext/manufacturing/doctype/workstation/workstation_list.js
+++ b/erpnext/manufacturing/doctype/workstation/workstation_list.js
@@ -1,16 +1,15 @@
-
-frappe.listview_settings['Workstation'] = {
+frappe.listview_settings["Workstation"] = {
 	add_fields: ["status"],
-	get_indicator: function(doc) {
+	get_indicator: function (doc) {
 		let color_map = {
-			"Production": "green",
-			"Off": "gray",
-			"Idle": "gray",
-			"Problem": "red",
-			"Maintenance": "yellow",
-			"Setup": "blue",
-		}
+			Production: "green",
+			Off: "gray",
+			Idle: "gray",
+			Problem: "red",
+			Maintenance: "yellow",
+			Setup: "blue",
+		};
 
 		return [__(doc.status), color_map[doc.status], true];
-	}
+	},
 };
diff --git a/erpnext/manufacturing/doctype/workstation_type/workstation_type.js b/erpnext/manufacturing/doctype/workstation_type/workstation_type.js
index 419fa6c..f0b3ed3 100644
--- a/erpnext/manufacturing/doctype/workstation_type/workstation_type.js
+++ b/erpnext/manufacturing/doctype/workstation_type/workstation_type.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Workstation Type', {
+frappe.ui.form.on("Workstation Type", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/manufacturing/page/bom_comparison_tool/bom_comparison_tool.js b/erpnext/manufacturing/page/bom_comparison_tool/bom_comparison_tool.js
index 1bcb1ef..fcb7e88 100644
--- a/erpnext/manufacturing/page/bom_comparison_tool/bom_comparison_tool.js
+++ b/erpnext/manufacturing/page/bom_comparison_tool/bom_comparison_tool.js
@@ -1,12 +1,12 @@
-frappe.pages['bom-comparison-tool'].on_page_load = function(wrapper) {
+frappe.pages["bom-comparison-tool"].on_page_load = function (wrapper) {
 	var page = frappe.ui.make_app_page({
 		parent: wrapper,
-		title: __('BOM Comparison Tool'),
-		single_column: true
+		title: __("BOM Comparison Tool"),
+		single_column: true,
 	});
 
 	new erpnext.BOMComparisonTool(page);
-}
+};
 
 erpnext.BOMComparisonTool = class BOMComparisonTool {
 	constructor(page) {
@@ -18,45 +18,45 @@
 		this.form = new frappe.ui.FieldGroup({
 			fields: [
 				{
-					label: __('BOM 1'),
-					fieldname: 'name1',
-					fieldtype: 'Link',
-					options: 'BOM',
+					label: __("BOM 1"),
+					fieldname: "name1",
+					fieldtype: "Link",
+					options: "BOM",
 					change: () => this.fetch_and_render(),
 					get_query: () => {
 						return {
 							filters: {
-								"name": ["not in", [this.form.get_value("name2") || ""]]
-							}
-						}
-					}
+								name: ["not in", [this.form.get_value("name2") || ""]],
+							},
+						};
+					},
 				},
 				{
-					fieldtype: 'Column Break'
+					fieldtype: "Column Break",
 				},
 				{
-					label: __('BOM 2'),
-					fieldname: 'name2',
-					fieldtype: 'Link',
-					options: 'BOM',
+					label: __("BOM 2"),
+					fieldname: "name2",
+					fieldtype: "Link",
+					options: "BOM",
 					change: () => this.fetch_and_render(),
 					get_query: () => {
 						return {
 							filters: {
-								"name": ["not in", [this.form.get_value("name1") || ""]]
-							}
-						}
-					}
+								name: ["not in", [this.form.get_value("name1") || ""]],
+							},
+						};
+					},
 				},
 				{
-					fieldtype: 'Section Break'
+					fieldtype: "Section Break",
 				},
 				{
-					fieldtype: 'HTML',
-					fieldname: 'preview'
-				}
+					fieldtype: "HTML",
+					fieldname: "preview",
+				},
 			],
-			body: this.page.body
+			body: this.page.body,
 		});
 		this.form.make();
 	}
@@ -64,33 +64,34 @@
 	fetch_and_render() {
 		let { name1, name2 } = this.form.get_values();
 		if (!(name1 && name2)) {
-			this.form.get_field('preview').html('');
+			this.form.get_field("preview").html("");
 			return;
 		}
 
 		// set working state
-		this.form.get_field('preview').html(`
+		this.form.get_field("preview").html(`
 			<div class="text-muted margin-top">
 				${__("Fetching...")}
 			</div>
 		`);
 
-		frappe.call('erpnext.manufacturing.doctype.bom.bom.get_bom_diff', {
-			bom1: name1,
-			bom2: name2
-		}).then(r => {
-			let diff = r.message;
-			frappe.model.with_doctype('BOM', () => {
-				this.render('BOM', name1, name2, diff);
+		frappe
+			.call("erpnext.manufacturing.doctype.bom.bom.get_bom_diff", {
+				bom1: name1,
+				bom2: name2,
+			})
+			.then((r) => {
+				let diff = r.message;
+				frappe.model.with_doctype("BOM", () => {
+					this.render("BOM", name1, name2, diff);
+				});
 			});
-		});
 	}
 
 	render(doctype, name1, name2, diff) {
-
 		let change_html = (title, doctype, changed) => {
 			let values_changed = this.get_changed_values(doctype, changed)
-				.map(change => {
+				.map((change) => {
 					let [fieldname, value1, value2] = change;
 					return `
 						<tr>
@@ -100,14 +101,14 @@
 						</tr>
 					`;
 				})
-				.join('');
+				.join("");
 
 			return `
 				<h4 class="margin-top">${title}</h4>
 				<div>
 					<table class="table table-bordered">
 						<tr>
-							<th width="33%">${__('Field')}</th>
+							<th width="33%">${__("Field")}</th>
 							<th width="33%">${name1}</th>
 							<th width="33%">${name2}</th>
 						</tr>
@@ -115,28 +116,30 @@
 					</table>
 				</div>
 			`;
-		}
+		};
 
-		let value_changes = change_html(__('Values Changed'), doctype, diff.changed);
+		let value_changes = change_html(__("Values Changed"), doctype, diff.changed);
 
-		let row_changes_by_fieldname = group_items(diff.row_changed, change => change[0]);
+		let row_changes_by_fieldname = group_items(diff.row_changed, (change) => change[0]);
 
-		let table_changes = Object.keys(row_changes_by_fieldname).map(fieldname => {
-			let changes = row_changes_by_fieldname[fieldname];
-			let df = frappe.meta.get_docfield(doctype, fieldname);
-
-			let html = changes.map(change => {
-				let [fieldname,, item_code, changes] = change;
+		let table_changes = Object.keys(row_changes_by_fieldname)
+			.map((fieldname) => {
+				let changes = row_changes_by_fieldname[fieldname];
 				let df = frappe.meta.get_docfield(doctype, fieldname);
-				let child_doctype = df.options;
-				let values_changed = this.get_changed_values(child_doctype, changes);
 
-				return values_changed.map((change, i) => {
-					let [fieldname, value1, value2] = change;
-					let th = i === 0
-						? `<th rowspan="${values_changed.length}">${item_code}</th>`
-						: '';
-					return `
+				let html = changes
+					.map((change) => {
+						let [fieldname, , item_code, changes] = change;
+						let df = frappe.meta.get_docfield(doctype, fieldname);
+						let child_doctype = df.options;
+						let values_changed = this.get_changed_values(child_doctype, changes);
+
+						return values_changed
+							.map((change, i) => {
+								let [fieldname, value1, value2] = change;
+								let th =
+									i === 0 ? `<th rowspan="${values_changed.length}">${item_code}</th>` : "";
+								return `
 						<tr>
 							${th}
 							<td>${frappe.meta.get_label(child_doctype, fieldname)}</td>
@@ -144,54 +147,58 @@
 							<td>${value2}</td>
 						</tr>
 					`;
-				}).join('');
-			}).join('');
+							})
+							.join("");
+					})
+					.join("");
 
-			return `
-				<h4 class="margin-top">${__('Changes in {0}', [df.label])}</h4>
+				return `
+				<h4 class="margin-top">${__("Changes in {0}", [df.label])}</h4>
 				<table class="table table-bordered">
 					<tr>
-						<th width="25%">${__('Item Code')}</th>
-						<th width="25%">${__('Field')}</th>
+						<th width="25%">${__("Item Code")}</th>
+						<th width="25%">${__("Field")}</th>
 						<th width="25%">${name1}</th>
 						<th width="25%">${name2}</th>
 					</tr>
 					${html}
 				</table>
 			`;
-		}).join('');
+			})
+			.join("");
 
 		let get_added_removed_html = (title, grouped_items) => {
-			return Object.keys(grouped_items).map(fieldname => {
-				let rows = grouped_items[fieldname];
-				let df = frappe.meta.get_docfield(doctype, fieldname);
-				let fields = frappe.meta.get_docfields(df.options)
-					.filter(df => df.in_list_view);
+			return Object.keys(grouped_items)
+				.map((fieldname) => {
+					let rows = grouped_items[fieldname];
+					let df = frappe.meta.get_docfield(doctype, fieldname);
+					let fields = frappe.meta.get_docfields(df.options).filter((df) => df.in_list_view);
 
-				let html = rows.map(row => {
-					let [, doc] = row;
-					let cells = fields
-						.map(df => `<td>${doc[df.fieldname]}</td>`)
-						.join('');
-					return `<tr>${cells}</tr>`;
-				}).join('');
+					let html = rows
+						.map((row) => {
+							let [, doc] = row;
+							let cells = fields.map((df) => `<td>${doc[df.fieldname]}</td>`).join("");
+							return `<tr>${cells}</tr>`;
+						})
+						.join("");
 
-				let header = fields.map(df => `<th>${df.label}</th>`).join('');
-				return `
+					let header = fields.map((df) => `<th>${df.label}</th>`).join("");
+					return `
 					<h4 class="margin-top">${$.format(title, [df.label])}</h4>
 					<table class="table table-bordered">
 						<tr>${header}</tr>
 						${html}
 					</table>
 				`;
-			}).join('');
+				})
+				.join("");
 		};
 
-		let added_by_fieldname = group_items(diff.added, change => change[0]);
-		let removed_by_fieldname = group_items(diff.removed, change => change[0]);
+		let added_by_fieldname = group_items(diff.added, (change) => change[0]);
+		let removed_by_fieldname = group_items(diff.removed, (change) => change[0]);
 
-		let added_html = get_added_removed_html(__('Rows Added in {0}'), added_by_fieldname);
-		let removed_html = get_added_removed_html(__('Rows Removed in {0}'), removed_by_fieldname);
+		let added_html = get_added_removed_html(__("Rows Added in {0}"), added_by_fieldname);
+		let removed_html = get_added_removed_html(__("Rows Removed in {0}"), removed_by_fieldname);
 
 		let html = `
 			${value_changes}
@@ -200,14 +207,14 @@
 			${removed_html}
 		`;
 
-		this.form.get_field('preview').html(html);
+		this.form.get_field("preview").html(html);
 	}
 
 	get_changed_values(doctype, changed) {
-		return changed.filter(change => {
+		return changed.filter((change) => {
 			let [fieldname, value1, value2] = change;
-			if (!value1) value1 = '';
-			if (!value2) value2 = '';
+			if (!value1) value1 = "";
+			if (!value2) value2 = "";
 			if (value1 === value2) return false;
 			let df = frappe.meta.get_docfield(doctype, fieldname);
 			if (!df) return false;
diff --git a/erpnext/manufacturing/page/visual_plant_floor/visual_plant_floor.js b/erpnext/manufacturing/page/visual_plant_floor/visual_plant_floor.js
index 38667e8..0d2c090 100644
--- a/erpnext/manufacturing/page/visual_plant_floor/visual_plant_floor.js
+++ b/erpnext/manufacturing/page/visual_plant_floor/visual_plant_floor.js
@@ -1,13 +1,12 @@
-
-
-frappe.pages['visual-plant-floor'].on_page_load = function(wrapper) {
+frappe.pages["visual-plant-floor"].on_page_load = function (wrapper) {
 	var page = frappe.ui.make_app_page({
 		parent: wrapper,
-		title: 'Visual Plant Floor',
-		single_column: true
+		title: "Visual Plant Floor",
+		single_column: true,
 	});
 
 	frappe.visual_plant_floor = new frappe.ui.VisualPlantFloor(
-		{wrapper: $(wrapper).find('.layout-main-section')}, wrapper.page
+		{ wrapper: $(wrapper).find(".layout-main-section") },
+		wrapper.page
 	);
-}
\ No newline at end of file
+};
diff --git a/erpnext/manufacturing/report/bom_explorer/bom_explorer.js b/erpnext/manufacturing/report/bom_explorer/bom_explorer.js
index 50191bf..f9feb01 100644
--- a/erpnext/manufacturing/report/bom_explorer/bom_explorer.js
+++ b/erpnext/manufacturing/report/bom_explorer/bom_explorer.js
@@ -1,15 +1,14 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["BOM Explorer"] = {
-	"filters": [
+	filters: [
 		{
 			fieldname: "bom",
 			label: __("BOM"),
 			fieldtype: "Link",
 			options: "BOM",
-			reqd: 1
+			reqd: 1,
 		},
-	]
+	],
 };
diff --git a/erpnext/manufacturing/report/bom_operations_time/bom_operations_time.js b/erpnext/manufacturing/report/bom_operations_time/bom_operations_time.js
index 8729775..27bccf6 100644
--- a/erpnext/manufacturing/report/bom_operations_time/bom_operations_time.js
+++ b/erpnext/manufacturing/report/bom_operations_time/bom_operations_time.js
@@ -1,42 +1,41 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["BOM Operations Time"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "item_code",
-			"label": __("Item Code"),
-			"fieldtype": "Link",
-			"width": "100",
-			"options": "Item",
-			"get_query": () =>{
+			fieldname: "item_code",
+			label: __("Item Code"),
+			fieldtype: "Link",
+			width: "100",
+			options: "Item",
+			get_query: () => {
 				return {
-					filters: { "is_stock_item": 1 }
-				}
-			}
+					filters: { is_stock_item: 1 },
+				};
+			},
 		},
 		{
-			"fieldname": "bom_id",
-			"label": __("BOM ID"),
-			"fieldtype": "MultiSelectList",
-			"width": "100",
-			"options": "BOM",
-			"get_data": function(txt) {
+			fieldname: "bom_id",
+			label: __("BOM ID"),
+			fieldtype: "MultiSelectList",
+			width: "100",
+			options: "BOM",
+			get_data: function (txt) {
 				return frappe.db.get_link_options("BOM", txt);
 			},
-			"get_query": () =>{
+			get_query: () => {
 				return {
-					filters: { "docstatus": 1, "is_active": 1, "with_operations": 1 }
-				}
-			}
+					filters: { docstatus: 1, is_active: 1, with_operations: 1 },
+				};
+			},
 		},
 		{
-			"fieldname": "workstation",
-			"label": __("Workstation"),
-			"fieldtype": "Link",
-			"width": "100",
-			"options": "Workstation"
+			fieldname: "workstation",
+			label: __("Workstation"),
+			fieldtype: "Link",
+			width: "100",
+			options: "Workstation",
 		},
-	]
+	],
 };
diff --git a/erpnext/manufacturing/report/bom_stock_calculated/bom_stock_calculated.js b/erpnext/manufacturing/report/bom_stock_calculated/bom_stock_calculated.js
index 8e66f70..76a9512 100644
--- a/erpnext/manufacturing/report/bom_stock_calculated/bom_stock_calculated.js
+++ b/erpnext/manufacturing/report/bom_stock_calculated/bom_stock_calculated.js
@@ -1,34 +1,33 @@
 // Copyright (c) 2016, Epoch Consulting and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["BOM Stock Calculated"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "bom",
-			"label": __("BOM"),
-			"fieldtype": "Link",
-			"options": "BOM",
-			"reqd": 1
+			fieldname: "bom",
+			label: __("BOM"),
+			fieldtype: "Link",
+			options: "BOM",
+			reqd: 1,
 		},
 		{
-			"fieldname": "warehouse",
-			"label": __("Warehouse"),
-			"fieldtype": "Link",
-			"options": "Warehouse",
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			options: "Warehouse",
 		},
 		{
-			"fieldname": "qty_to_make",
-			"label": __("Quantity to Make"),
-			"fieldtype": "Float",
-			"default": "1.0",
-			"reqd": 1
+			fieldname: "qty_to_make",
+			label: __("Quantity to Make"),
+			fieldtype: "Float",
+			default: "1.0",
+			reqd: 1,
 		},
 		{
-			"fieldname": "show_exploded_view",
-			"label": __("Show exploded view"),
-			"fieldtype": "Check",
-			"default": false,
-		}
-	]
-}
+			fieldname: "show_exploded_view",
+			label: __("Show exploded view"),
+			fieldtype: "Check",
+			default: false,
+		},
+	],
+};
diff --git a/erpnext/manufacturing/report/bom_stock_report/bom_stock_report.js b/erpnext/manufacturing/report/bom_stock_report/bom_stock_report.js
index e7f67ca..91d73d0 100644
--- a/erpnext/manufacturing/report/bom_stock_report/bom_stock_report.js
+++ b/erpnext/manufacturing/report/bom_stock_report/bom_stock_report.js
@@ -1,38 +1,41 @@
 frappe.query_reports["BOM Stock Report"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "bom",
-			"label": __("BOM"),
-			"fieldtype": "Link",
-			"options": "BOM",
-			"reqd": 1
-		}, {
-			"fieldname": "warehouse",
-			"label": __("Warehouse"),
-			"fieldtype": "Link",
-			"options": "Warehouse",
-			"reqd": 1
-		}, {
-			"fieldname": "show_exploded_view",
-			"label": __("Show exploded view"),
-			"fieldtype": "Check"
-		}, {
-			"fieldname": "qty_to_produce",
-			"label": __("Quantity to Produce"),
-			"fieldtype": "Int",
-			"default": "1"
-		 },
+			fieldname: "bom",
+			label: __("BOM"),
+			fieldtype: "Link",
+			options: "BOM",
+			reqd: 1,
+		},
+		{
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			options: "Warehouse",
+			reqd: 1,
+		},
+		{
+			fieldname: "show_exploded_view",
+			label: __("Show exploded view"),
+			fieldtype: "Check",
+		},
+		{
+			fieldname: "qty_to_produce",
+			label: __("Quantity to Produce"),
+			fieldtype: "Int",
+			default: "1",
+		},
 	],
-	"formatter": function(value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 
 		if (column.id == "item") {
 			if (data["in_stock_qty"] >= data["required_qty"]) {
-				value = `<a style='color:green' href="/app/item/${data['item']}" data-doctype="Item">${data['item']}</a>`;
+				value = `<a style='color:green' href="/app/item/${data["item"]}" data-doctype="Item">${data["item"]}</a>`;
 			} else {
-				value = `<a style='color:red' href="/app/item/${data['item']}" data-doctype="Item">${data['item']}</a>`;
+				value = `<a style='color:red' href="/app/item/${data["item"]}" data-doctype="Item">${data["item"]}</a>`;
 			}
 		}
-		return value
-	}
-}
+		return value;
+	},
+};
diff --git a/erpnext/manufacturing/report/bom_variance_report/bom_variance_report.js b/erpnext/manufacturing/report/bom_variance_report/bom_variance_report.js
index db6f4d7..58d8d1f 100644
--- a/erpnext/manufacturing/report/bom_variance_report/bom_variance_report.js
+++ b/erpnext/manufacturing/report/bom_variance_report/bom_variance_report.js
@@ -1,29 +1,28 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["BOM Variance Report"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"bom_no",
-			"label": __("BOM No"),
-			"fieldtype": "Link",
-			"options": "BOM"
+			fieldname: "bom_no",
+			label: __("BOM No"),
+			fieldtype: "Link",
+			options: "BOM",
 		},
 		{
-			"fieldname":"work_order",
-			"label": __("Work Order"),
-			"fieldtype": "Link",
-			"options": "Work Order",
-			"get_query": function() {
-				var bom_no = frappe.query_report.get_filter_value('bom_no');
-				return{
+			fieldname: "work_order",
+			label: __("Work Order"),
+			fieldtype: "Link",
+			options: "Work Order",
+			get_query: function () {
+				var bom_no = frappe.query_report.get_filter_value("bom_no");
+				return {
 					query: "erpnext.manufacturing.report.bom_variance_report.bom_variance_report.get_work_orders",
 					filters: {
-						'bom_no': bom_no
-					}
-				}
-			}
+						bom_no: bom_no,
+					},
+				};
+			},
 		},
-	]
-}
+	],
+};
diff --git a/erpnext/manufacturing/report/cost_of_poor_quality_report/cost_of_poor_quality_report.js b/erpnext/manufacturing/report/cost_of_poor_quality_report/cost_of_poor_quality_report.js
index d0249ba..d534513 100644
--- a/erpnext/manufacturing/report/cost_of_poor_quality_report/cost_of_poor_quality_report.js
+++ b/erpnext/manufacturing/report/cost_of_poor_quality_report/cost_of_poor_quality_report.js
@@ -1,26 +1,27 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Cost of Poor Quality Report"] = {
-	"filters": [
+	filters: [
 		{
 			label: __("Company"),
 			fieldname: "company",
 			fieldtype: "Link",
 			options: "Company",
 			default: frappe.defaults.get_user_default("Company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			label: __("From Date"),
-			fieldname:"from_date",
+			fieldname: "from_date",
 			fieldtype: "Datetime",
-			default: frappe.datetime.convert_to_system_tz(frappe.datetime.add_months(frappe.datetime.now_datetime(), -1)),
+			default: frappe.datetime.convert_to_system_tz(
+				frappe.datetime.add_months(frappe.datetime.now_datetime(), -1)
+			),
 		},
 		{
 			label: __("To Date"),
-			fieldname:"to_date",
+			fieldname: "to_date",
 			fieldtype: "Datetime",
 			default: frappe.datetime.now_datetime(),
 		},
@@ -29,45 +30,45 @@
 			fieldname: "name",
 			fieldtype: "Link",
 			options: "Job Card",
-			get_query: function() {
+			get_query: function () {
 				return {
 					filters: {
 						is_corrective_job_card: 1,
-						docstatus: 1
-					}
-				}
-			}
+						docstatus: 1,
+					},
+				};
+			},
 		},
 		{
 			label: __("Work Order"),
 			fieldname: "work_order",
 			fieldtype: "Link",
-			options: "Work Order"
+			options: "Work Order",
 		},
 		{
 			label: __("Operation"),
 			fieldname: "operation",
 			fieldtype: "Link",
 			options: "Operation",
-			get_query: function() {
+			get_query: function () {
 				return {
 					filters: {
-						is_corrective_operation: 1
-					}
-				}
-			}
+						is_corrective_operation: 1,
+					},
+				};
+			},
 		},
 		{
 			label: __("Workstation"),
 			fieldname: "workstation",
 			fieldtype: "Link",
-			options: "Workstation"
+			options: "Workstation",
 		},
 		{
 			label: __("Item"),
 			fieldname: "production_item",
 			fieldtype: "Link",
-			options: "Item"
+			options: "Item",
 		},
 		{
 			label: __("Serial No"),
@@ -75,14 +76,14 @@
 			fieldtype: "Link",
 			options: "Serial No",
 			depends_on: "eval: doc.production_item",
-			get_query: function() {
-				var item_code = frappe.query_report.get_filter_value('production_item');
+			get_query: function () {
+				var item_code = frappe.query_report.get_filter_value("production_item");
 				return {
 					filters: {
-						item_code: item_code
-					}
-				}
-			}
+						item_code: item_code,
+					},
+				};
+			},
 		},
 		{
 			label: __("Batch No"),
@@ -90,14 +91,14 @@
 			fieldtype: "Link",
 			options: "Batch No",
 			depends_on: "eval: doc.production_item",
-			get_query: function() {
-				var item_code = frappe.query_report.get_filter_value('production_item');
+			get_query: function () {
+				var item_code = frappe.query_report.get_filter_value("production_item");
 				return {
 					filters: {
-						item: item_code
-					}
-				}
-			}
+						item: item_code,
+					},
+				};
+			},
 		},
-	]
+	],
 };
diff --git a/erpnext/manufacturing/report/downtime_analysis/downtime_analysis.js b/erpnext/manufacturing/report/downtime_analysis/downtime_analysis.js
index 0589260..0eadc72 100644
--- a/erpnext/manufacturing/report/downtime_analysis/downtime_analysis.js
+++ b/erpnext/manufacturing/report/downtime_analysis/downtime_analysis.js
@@ -1,19 +1,20 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Downtime Analysis"] = {
-	"filters": [
+	filters: [
 		{
 			label: __("From Date"),
-			fieldname:"from_date",
+			fieldname: "from_date",
 			fieldtype: "Datetime",
-			default: frappe.datetime.convert_to_system_tz(frappe.datetime.add_months(frappe.datetime.now_datetime(), -1)),
-			reqd: 1
+			default: frappe.datetime.convert_to_system_tz(
+				frappe.datetime.add_months(frappe.datetime.now_datetime(), -1)
+			),
+			reqd: 1,
 		},
 		{
 			label: __("To Date"),
-			fieldname:"to_date",
+			fieldname: "to_date",
 			fieldtype: "Datetime",
 			default: frappe.datetime.now_datetime(),
 			reqd: 1,
@@ -22,7 +23,7 @@
 			label: __("Machine"),
 			fieldname: "workstation",
 			fieldtype: "Link",
-			options: "Workstation"
-		}
-	]
+			options: "Workstation",
+		},
+	],
 };
diff --git a/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.js b/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.js
index 3795bd3..23fa9ab 100644
--- a/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.js
+++ b/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.js
@@ -1,97 +1,96 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Exponential Smoothing Forecasting"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"reqd": 1,
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), 12),
-			"reqd": 1
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), 12),
+			reqd: 1,
 		},
 		{
-			"fieldname":"based_on_document",
-			"label": __("Based On Document"),
-			"fieldtype": "Select",
-			"options": ["Sales Order", "Sales Invoice", "Delivery Note", "Quotation"],
-			"default": "Sales Order",
-			"reqd": 1
+			fieldname: "based_on_document",
+			label: __("Based On Document"),
+			fieldtype: "Select",
+			options: ["Sales Order", "Sales Invoice", "Delivery Note", "Quotation"],
+			default: "Sales Order",
+			reqd: 1,
 		},
 		{
-			"fieldname":"based_on_field",
-			"label": __("Based On"),
-			"fieldtype": "Select",
-			"options": ["Qty", "Amount"],
-			"default": "Qty",
-			"reqd": 1
+			fieldname: "based_on_field",
+			label: __("Based On"),
+			fieldtype: "Select",
+			options: ["Qty", "Amount"],
+			default: "Qty",
+			reqd: 1,
 		},
 		{
-			"fieldname":"no_of_years",
-			"label": __("Based On Data ( in years )"),
-			"fieldtype": "Select",
-			"options": [3, 6, 9],
-			"default": 3,
-			"reqd": 1
+			fieldname: "no_of_years",
+			label: __("Based On Data ( in years )"),
+			fieldtype: "Select",
+			options: [3, 6, 9],
+			default: 3,
+			reqd: 1,
 		},
 		{
-			"fieldname": "periodicity",
-			"label": __("Periodicity"),
-			"fieldtype": "Select",
-			"options": [
-				{ "value": "Monthly", "label": __("Monthly") },
-				{ "value": "Quarterly", "label": __("Quarterly") },
-				{ "value": "Half-Yearly", "label": __("Half-Yearly") },
-				{ "value": "Yearly", "label": __("Yearly") }
+			fieldname: "periodicity",
+			label: __("Periodicity"),
+			fieldtype: "Select",
+			options: [
+				{ value: "Monthly", label: __("Monthly") },
+				{ value: "Quarterly", label: __("Quarterly") },
+				{ value: "Half-Yearly", label: __("Half-Yearly") },
+				{ value: "Yearly", label: __("Yearly") },
 			],
-			"default": "Yearly",
-			"reqd": 1
+			default: "Yearly",
+			reqd: 1,
 		},
 		{
-			"fieldname":"smoothing_constant",
-			"label": __("Smoothing Constant"),
-			"fieldtype": "Select",
-			"options": [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0],
-			"reqd": 1,
-			"default": 0.3
+			fieldname: "smoothing_constant",
+			label: __("Smoothing Constant"),
+			fieldtype: "Select",
+			options: [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0],
+			reqd: 1,
+			default: 0.3,
 		},
 		{
-			"fieldname":"item_code",
-			"label": __("Item Code"),
-			"fieldtype": "Link",
-			"options": "Item"
+			fieldname: "item_code",
+			label: __("Item Code"),
+			fieldtype: "Link",
+			options: "Item",
 		},
 		{
-			"fieldname":"warehouse",
-			"label": __("Warehouse"),
-			"fieldtype": "Link",
-			"options": "Warehouse",
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			options: "Warehouse",
 			get_query: () => {
-				var company = frappe.query_report.get_filter_value('company');
+				var company = frappe.query_report.get_filter_value("company");
 				if (company) {
 					return {
 						filters: {
-							'company': company
-						}
+							company: company,
+						},
 					};
 				}
-			}
-		}
-	]
+			},
+		},
+	],
 };
diff --git a/erpnext/manufacturing/report/job_card_summary/job_card_summary.js b/erpnext/manufacturing/report/job_card_summary/job_card_summary.js
index 4b3f86f..2196500 100644
--- a/erpnext/manufacturing/report/job_card_summary/job_card_summary.js
+++ b/erpnext/manufacturing/report/job_card_summary/job_card_summary.js
@@ -1,16 +1,15 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Job Card Summary"] = {
-	"filters": [
+	filters: [
 		{
 			label: __("Company"),
 			fieldname: "company",
 			fieldtype: "Link",
 			options: "Company",
 			default: frappe.defaults.get_user_default("Company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "fiscal_year",
@@ -19,30 +18,30 @@
 			options: "Fiscal Year",
 			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
 			reqd: 1,
-			on_change: function(query_report) {
+			on_change: function (query_report) {
 				var fiscal_year = query_report.get_values().fiscal_year;
 				if (!fiscal_year) {
 					return;
 				}
-				frappe.model.with_doc("Fiscal Year", fiscal_year, function(r) {
+				frappe.model.with_doc("Fiscal Year", fiscal_year, function (r) {
 					var fy = frappe.model.get_doc("Fiscal Year", fiscal_year);
 					frappe.query_report.set_filter_value({
 						from_date: fy.year_start_date,
-						to_date: fy.year_end_date
+						to_date: fy.year_end_date,
 					});
 				});
-			}
+			},
 		},
 		{
 			label: __("From Posting Date"),
-			fieldname:"from_date",
+			fieldname: "from_date",
 			fieldtype: "Date",
 			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			label: __("To Posting Date"),
-			fieldname:"to_date",
+			fieldname: "to_date",
 			fieldtype: "Date",
 			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
 			reqd: 1,
@@ -51,35 +50,35 @@
 			label: __("Status"),
 			fieldname: "status",
 			fieldtype: "Select",
-			options: ["", "Open", "Work In Progress", "Completed", "On Hold"]
+			options: ["", "Open", "Work In Progress", "Completed", "On Hold"],
 		},
 		{
 			label: __("Work Orders"),
 			fieldname: "work_order",
 			fieldtype: "MultiSelectList",
-			get_data: function(txt) {
-				return frappe.db.get_link_options('Work Order', txt);
-			}
+			get_data: function (txt) {
+				return frappe.db.get_link_options("Work Order", txt);
+			},
 		},
 		{
 			label: __("Production Item"),
 			fieldname: "production_item",
 			fieldtype: "MultiSelectList",
-			get_data: function(txt) {
-				return frappe.db.get_link_options('Item', txt);
-			}
+			get_data: function (txt) {
+				return frappe.db.get_link_options("Item", txt);
+			},
 		},
 		{
 			label: __("Workstation"),
 			fieldname: "workstation",
 			fieldtype: "Link",
-			options: "Workstation"
+			options: "Workstation",
 		},
 		{
 			label: __("Operation"),
 			fieldname: "operation",
 			fieldtype: "Link",
-			options: "Operation"
-		}
-	]
+			options: "Operation",
+		},
+	],
 };
diff --git a/erpnext/manufacturing/report/process_loss_report/process_loss_report.js b/erpnext/manufacturing/report/process_loss_report/process_loss_report.js
index c08413d..89cc558 100644
--- a/erpnext/manufacturing/report/process_loss_report/process_loss_report.js
+++ b/erpnext/manufacturing/report/process_loss_report/process_loss_report.js
@@ -1,44 +1,43 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Process Loss Report"] = {
 	filters: [
-    {
-      label: __("Company"),
-      fieldname: "company",
-      fieldtype: "Link",
-      options: "Company",
-      mandatory: true,
-      default: frappe.defaults.get_user_default("Company"),
-    },
 		{
-      label: __("Item"),
-      fieldname: "item",
-      fieldtype: "Link",
-      options: "Item",
-      mandatory: false,
+			label: __("Company"),
+			fieldname: "company",
+			fieldtype: "Link",
+			options: "Company",
+			mandatory: true,
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-      label: __("Work Order"),
-      fieldname: "work_order",
-      fieldtype: "Link",
-      options: "Work Order",
-      mandatory: false,
+			label: __("Item"),
+			fieldname: "item",
+			fieldtype: "Link",
+			options: "Item",
+			mandatory: false,
 		},
-    {
-      label: __("From Date"),
-      fieldname: "from_date",
-      fieldtype: "Date",
-      mandatory: true,
-      default: frappe.datetime.year_start(),
-    },
-    {
-      label: __("To Date"),
-      fieldname: "to_date",
-      fieldtype: "Date",
-      mandatory: true,
-      default: frappe.datetime.get_today(),
-    },
-	]
+		{
+			label: __("Work Order"),
+			fieldname: "work_order",
+			fieldtype: "Link",
+			options: "Work Order",
+			mandatory: false,
+		},
+		{
+			label: __("From Date"),
+			fieldname: "from_date",
+			fieldtype: "Date",
+			mandatory: true,
+			default: frappe.datetime.year_start(),
+		},
+		{
+			label: __("To Date"),
+			fieldname: "to_date",
+			fieldtype: "Date",
+			mandatory: true,
+			default: frappe.datetime.get_today(),
+		},
+	],
 };
diff --git a/erpnext/manufacturing/report/production_analytics/production_analytics.js b/erpnext/manufacturing/report/production_analytics/production_analytics.js
index 77529a5..208cd32 100644
--- a/erpnext/manufacturing/report/production_analytics/production_analytics.js
+++ b/erpnext/manufacturing/report/production_analytics/production_analytics.js
@@ -1,43 +1,42 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Production Analytics"] = {
-	"filters": [
+	filters: [
 		{
 			fieldname: "company",
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
 			default: frappe.defaults.get_user_default("Company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "from_date",
 			label: __("From Date"),
 			fieldtype: "Date",
 			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
 			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "range",
 			label: __("Range"),
 			fieldtype: "Select",
 			options: [
-				{ "value": "Weekly", "label": __("Weekly") },
-				{ "value": "Monthly", "label": __("Monthly") },
-				{ "value": "Quarterly", "label": __("Quarterly") },
-				{ "value": "Yearly", "label": __("Yearly") }
+				{ value: "Weekly", label: __("Weekly") },
+				{ value: "Monthly", label: __("Monthly") },
+				{ value: "Quarterly", label: __("Quarterly") },
+				{ value: "Yearly", label: __("Yearly") },
 			],
 			default: "Monthly",
-			reqd: 1
-		}
-	]
-}
+			reqd: 1,
+		},
+	],
+};
diff --git a/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.js b/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.js
index afe4a6e..0e89a25 100644
--- a/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.js
+++ b/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.js
@@ -1,30 +1,29 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Production Plan Summary"] = {
-	"filters": [
+	filters: [
 		{
 			fieldname: "production_plan",
 			label: __("Production Plan"),
 			fieldtype: "Link",
 			options: "Production Plan",
 			reqd: 1,
-			get_query: function() {
+			get_query: function () {
 				return {
 					filters: {
-						"docstatus": 1
-					}
+						docstatus: 1,
+					},
 				};
-			}
-		}
+			},
+		},
 	],
-	"formatter": function(value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 
 		if (column.fieldname == "item_code") {
-			var color = data.pending_qty > 0 ? 'red': 'green';
-			value = `<a style='color:${color}' href="/app/item/${data['item_code']}" data-doctype="Item">${data['item_code']}</a>`;
+			var color = data.pending_qty > 0 ? "red" : "green";
+			value = `<a style='color:${color}' href="/app/item/${data["item_code"]}" data-doctype="Item">${data["item_code"]}</a>`;
 		}
 
 		return value;
diff --git a/erpnext/manufacturing/report/production_planning_report/production_planning_report.js b/erpnext/manufacturing/report/production_planning_report/production_planning_report.js
index 4225832..d6ca248 100644
--- a/erpnext/manufacturing/report/production_planning_report/production_planning_report.js
+++ b/erpnext/manufacturing/report/production_planning_report/production_planning_report.js
@@ -1,108 +1,111 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Production Planning Report"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"reqd": 1,
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname":"based_on",
-			"label": __("Based On"),
-			"fieldtype": "Select",
-			"options": ["Sales Order", "Material Request", "Work Order"],
-			"default": "Sales Order",
-			"reqd": 1,
-			on_change: function() {
+			fieldname: "based_on",
+			label: __("Based On"),
+			fieldtype: "Select",
+			options: ["Sales Order", "Material Request", "Work Order"],
+			default: "Sales Order",
+			reqd: 1,
+			on_change: function () {
 				let filters = frappe.query_report.filters;
-				let based_on = frappe.query_report.get_filter_value('based_on');
+				let based_on = frappe.query_report.get_filter_value("based_on");
 				let options = {
 					"Sales Order": ["Delivery Date", "Total Amount"],
 					"Material Request": ["Required Date"],
-					"Work Order": ["Planned Start Date"]
-				}
+					"Work Order": ["Planned Start Date"],
+				};
 
-				filters.forEach(d => {
+				filters.forEach((d) => {
 					if (d.fieldname == "order_by") {
 						d.df.options = options[based_on];
-						d.set_input(d.df.options)
+						d.set_input(d.df.options);
 					}
 				});
 
 				frappe.query_report.refresh();
-			}
+			},
 		},
 		{
-			"fieldname":"docnames",
-			"label": __("Document Name"),
-			"fieldtype": "MultiSelectList",
-			"options": "Sales Order",
-			"get_data": function(txt) {
+			fieldname: "docnames",
+			label: __("Document Name"),
+			fieldtype: "MultiSelectList",
+			options: "Sales Order",
+			get_data: function (txt) {
 				if (!frappe.query_report.filters) return;
 
-				let based_on = frappe.query_report.get_filter_value('based_on');
+				let based_on = frappe.query_report.get_filter_value("based_on");
 				if (!based_on) return;
 
 				return frappe.db.get_link_options(based_on, txt);
 			},
-			"get_query": function() {
-				var company = frappe.query_report.get_filter_value('company');
+			get_query: function () {
+				var company = frappe.query_report.get_filter_value("company");
 				return {
 					filters: {
-						"docstatus": 1,
-						"company": company
-					}
+						docstatus: 1,
+						company: company,
+					},
 				};
-			}
+			},
 		},
 		{
-			"fieldname":"raw_material_warehouse",
-			"label": __("Raw Material Warehouse"),
-			"fieldtype": "Link",
-			"options": "Warehouse",
-			"depends_on": "eval: doc.based_on != 'Work Order'",
-			"get_query": function() {
-				var company = frappe.query_report.get_filter_value('company');
+			fieldname: "raw_material_warehouse",
+			label: __("Raw Material Warehouse"),
+			fieldtype: "Link",
+			options: "Warehouse",
+			depends_on: "eval: doc.based_on != 'Work Order'",
+			get_query: function () {
+				var company = frappe.query_report.get_filter_value("company");
 				return {
 					filters: {
-						"company": company
-					}
+						company: company,
+					},
 				};
-			}
+			},
 		},
 		{
-			"fieldname":"order_by",
-			"label": __("Order By"),
-			"fieldtype": "Select",
-			"options": ["Delivery Date", "Total Amount"],
-			"default": "Delivery Date"
+			fieldname: "order_by",
+			label: __("Order By"),
+			fieldtype: "Select",
+			options: ["Delivery Date", "Total Amount"],
+			default: "Delivery Date",
 		},
 		{
-			"fieldname":"include_subassembly_raw_materials",
-			"label": __("Include Sub-assembly Raw Materials"),
-			"fieldtype": "Check",
-			"depends_on": "eval: doc.based_on != 'Work Order'",
-			"default": 0
+			fieldname: "include_subassembly_raw_materials",
+			label: __("Include Sub-assembly Raw Materials"),
+			fieldtype: "Check",
+			depends_on: "eval: doc.based_on != 'Work Order'",
+			default: 0,
 		},
 	],
-	"formatter": function(value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 
-		if (column.fieldname == "production_item_name" && data && data.qty_to_manufacture > data.available_qty ) {
+		if (
+			column.fieldname == "production_item_name" &&
+			data &&
+			data.qty_to_manufacture > data.available_qty
+		) {
 			value = `<div style="color:red">${value}</div>`;
 		}
 
-		if (column.fieldname == "production_item" && !data.name ) {
+		if (column.fieldname == "production_item" && !data.name) {
 			value = "";
 		}
 
-		if (column.fieldname == "raw_material_name" && data && data.required_qty > data.allotted_qty ) {
+		if (column.fieldname == "raw_material_name" && data && data.required_qty > data.allotted_qty) {
 			value = `<div style="color:red">${value}</div>`;
 		}
 
diff --git a/erpnext/manufacturing/report/quality_inspection_summary/quality_inspection_summary.js b/erpnext/manufacturing/report/quality_inspection_summary/quality_inspection_summary.js
index 905d185..6c237d6 100644
--- a/erpnext/manufacturing/report/quality_inspection_summary/quality_inspection_summary.js
+++ b/erpnext/manufacturing/report/quality_inspection_summary/quality_inspection_summary.js
@@ -1,19 +1,18 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Quality Inspection Summary"] = {
-	"filters": [
+	filters: [
 		{
 			label: __("From Date"),
-			fieldname:"from_date",
+			fieldname: "from_date",
 			fieldtype: "Date",
 			default: frappe.datetime.add_months(frappe.datetime.get_today(), -12),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			label: __("To Date"),
-			fieldname:"to_date",
+			fieldname: "to_date",
 			fieldtype: "Date",
 			default: frappe.datetime.get_today(),
 			reqd: 1,
@@ -22,19 +21,19 @@
 			label: __("Status"),
 			fieldname: "status",
 			fieldtype: "Select",
-			options: ["", "Accepted", "Rejected"]
+			options: ["", "Accepted", "Rejected"],
 		},
 		{
 			label: __("Item Code"),
 			fieldname: "item_code",
 			fieldtype: "Link",
-			options: "Item"
+			options: "Item",
 		},
 		{
 			label: __("Inspected By"),
 			fieldname: "inspected_by",
 			fieldtype: "Link",
-			options: "User"
-		}
-	]
+			options: "User",
+		},
+	],
 };
diff --git a/erpnext/manufacturing/report/work_order_consumed_materials/work_order_consumed_materials.js b/erpnext/manufacturing/report/work_order_consumed_materials/work_order_consumed_materials.js
index 70d7f92..b9ad4e2 100644
--- a/erpnext/manufacturing/report/work_order_consumed_materials/work_order_consumed_materials.js
+++ b/erpnext/manufacturing/report/work_order_consumed_materials/work_order_consumed_materials.js
@@ -1,67 +1,66 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Work Order Consumed Materials"] = {
-	"filters": [
+	filters: [
 		{
 			label: __("Company"),
 			fieldname: "company",
 			fieldtype: "Link",
 			options: "Company",
 			default: frappe.defaults.get_user_default("Company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			label: __("From Date"),
-			fieldname:"from_date",
+			fieldname: "from_date",
 			fieldtype: "Date",
 			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
 			default: frappe.datetime.get_today(),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			label: __("Work Order"),
 			fieldname: "name",
 			fieldtype: "Link",
 			options: "Work Order",
-			get_query: function() {
+			get_query: function () {
 				return {
 					filters: {
-						status: ["in", ["In Process", "Completed", "Stopped"]]
-					}
-				}
-			}
+						status: ["in", ["In Process", "Completed", "Stopped"]],
+					},
+				};
+			},
 		},
 		{
 			label: __("Production Item"),
 			fieldname: "production_item",
 			fieldtype: "Link",
 			depends_on: "eval: !doc.name",
-			options: "Item"
+			options: "Item",
 		},
 		{
 			label: __("Status"),
 			fieldname: "status",
 			fieldtype: "Select",
-			options: ["", "In Process", "Completed", "Stopped"]
+			options: ["", "In Process", "Completed", "Stopped"],
 		},
 		{
 			label: __("Excess Materials Consumed"),
 			fieldname: "show_extra_consumed_materials",
-			fieldtype: "Check"
-		}
+			fieldtype: "Check",
+		},
 	],
-	"formatter": function(value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 
-		if (column.fieldname == "raw_material_name" && data && data.extra_consumed_qty > 0 ) {
+		if (column.fieldname == "raw_material_name" && data && data.extra_consumed_qty > 0) {
 			value = `<div style="color:red">${value}</div>`;
 		}
 
diff --git a/erpnext/manufacturing/report/work_order_stock_report/work_order_stock_report.js b/erpnext/manufacturing/report/work_order_stock_report/work_order_stock_report.js
index cf651cb..758056a 100644
--- a/erpnext/manufacturing/report/work_order_stock_report/work_order_stock_report.js
+++ b/erpnext/manufacturing/report/work_order_stock_report/work_order_stock_report.js
@@ -1,14 +1,13 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Work Order Stock Report"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "warehouse",
-			"label": __("Warehouse"),
-			"fieldtype": "Link",
-			"options": "Warehouse"
-		}
-	]
-}
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			options: "Warehouse",
+		},
+	],
+};
diff --git a/erpnext/manufacturing/report/work_order_summary/work_order_summary.js b/erpnext/manufacturing/report/work_order_summary/work_order_summary.js
index d0242f4..f48f8b7 100644
--- a/erpnext/manufacturing/report/work_order_summary/work_order_summary.js
+++ b/erpnext/manufacturing/report/work_order_summary/work_order_summary.js
@@ -1,34 +1,33 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Work Order Summary"] = {
-	"filters": [
+	filters: [
 		{
 			label: __("Company"),
 			fieldname: "company",
 			fieldtype: "Link",
 			options: "Company",
 			default: frappe.defaults.get_user_default("Company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			label: __("Based On"),
-			fieldname:"based_on",
+			fieldname: "based_on",
 			fieldtype: "Select",
 			options: "Creation Date\nPlanned Date\nActual Date",
-			default: "Creation Date"
+			default: "Creation Date",
 		},
 		{
 			label: __("From Posting Date"),
-			fieldname:"from_date",
+			fieldname: "from_date",
 			fieldtype: "Date",
 			default: frappe.datetime.add_months(frappe.datetime.get_today(), -3),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			label: __("To Posting Date"),
-			fieldname:"to_date",
+			fieldname: "to_date",
 			fieldtype: "Date",
 			default: frappe.datetime.get_today(),
 			reqd: 1,
@@ -37,36 +36,36 @@
 			label: __("Status"),
 			fieldname: "status",
 			fieldtype: "Select",
-			options: ["", "Not Started", "In Process", "Completed", "Stopped", "Closed"]
+			options: ["", "Not Started", "In Process", "Completed", "Stopped", "Closed"],
 		},
 		{
 			label: __("Sales Orders"),
 			fieldname: "sales_order",
 			fieldtype: "MultiSelectList",
-			get_data: function(txt) {
-				return frappe.db.get_link_options('Sales Order', txt);
-			}
+			get_data: function (txt) {
+				return frappe.db.get_link_options("Sales Order", txt);
+			},
 		},
 		{
 			label: __("Production Item"),
 			fieldname: "production_item",
 			fieldtype: "MultiSelectList",
-			get_data: function(txt) {
-				return frappe.db.get_link_options('Item', txt);
-			}
+			get_data: function (txt) {
+				return frappe.db.get_link_options("Item", txt);
+			},
 		},
 		{
 			label: __("Age"),
-			fieldname:"age",
+			fieldname: "age",
 			fieldtype: "Int",
-			default: "0"
+			default: "0",
 		},
 		{
 			label: __("Charts Based On"),
-			fieldname:"charts_based_on",
+			fieldname: "charts_based_on",
 			fieldtype: "Select",
 			options: ["Status", "Age", "Quantity"],
-			default: "Status"
+			default: "Status",
 		},
-	]
+	],
 };
diff --git a/erpnext/projects/doctype/activity_cost/activity_cost.js b/erpnext/projects/doctype/activity_cost/activity_cost.js
index 2d22caa..d47b574 100644
--- a/erpnext/projects/doctype/activity_cost/activity_cost.js
+++ b/erpnext/projects/doctype/activity_cost/activity_cost.js
@@ -1 +1 @@
-cur_frm.add_fetch('employee', 'employee_name', 'employee_name');
+cur_frm.add_fetch("employee", "employee_name", "employee_name");
diff --git a/erpnext/projects/doctype/activity_type/activity_type.js b/erpnext/projects/doctype/activity_type/activity_type.js
index f1ba882..b620cdd 100644
--- a/erpnext/projects/doctype/activity_type/activity_type.js
+++ b/erpnext/projects/doctype/activity_type/activity_type.js
@@ -1,12 +1,15 @@
 frappe.ui.form.on("Activity Type", {
-	onload: function(frm) {
-		frm.set_currency_labels(["billing_rate", "costing_rate"], frappe.defaults.get_global_default('currency'));
+	onload: function (frm) {
+		frm.set_currency_labels(
+			["billing_rate", "costing_rate"],
+			frappe.defaults.get_global_default("currency")
+		);
 	},
 
-	refresh: function(frm) {
-		frm.add_custom_button(__("Activity Cost per Employee"), function() {
-			frappe.route_options = {"activity_type": frm.doc.name};
+	refresh: function (frm) {
+		frm.add_custom_button(__("Activity Cost per Employee"), function () {
+			frappe.route_options = { activity_type: frm.doc.name };
 			frappe.set_route("List", "Activity Cost");
 		});
-	}
+	},
 });
diff --git a/erpnext/projects/doctype/project/project.js b/erpnext/projects/doctype/project/project.js
index e0dd198..16ac8db 100644
--- a/erpnext/projects/doctype/project/project.js
+++ b/erpnext/projects/doctype/project/project.js
@@ -3,16 +3,16 @@
 frappe.ui.form.on("Project", {
 	setup(frm) {
 		frm.make_methods = {
-			'Timesheet': () => {
+			Timesheet: () => {
 				open_form(frm, "Timesheet", "Timesheet Detail", "time_logs");
 			},
-			'Purchase Order': () => {
+			"Purchase Order": () => {
 				open_form(frm, "Purchase Order", "Purchase Order Item", "items");
 			},
-			'Purchase Receipt': () => {
+			"Purchase Receipt": () => {
 				open_form(frm, "Purchase Receipt", "Purchase Receipt Item", "items");
 			},
-			'Purchase Invoice': () => {
+			"Purchase Invoice": () => {
 				open_form(frm, "Purchase Invoice", "Purchase Invoice Item", "items");
 			},
 		};
@@ -22,31 +22,31 @@
 		so.get_route_options_for_new_doc = () => {
 			if (frm.is_new()) return {};
 			return {
-				"customer": frm.doc.customer,
-				"project_name": frm.doc.name
+				customer: frm.doc.customer,
+				project_name: frm.doc.name,
 			};
 		};
 
-		frm.set_query('customer', 'erpnext.controllers.queries.customer_query');
+		frm.set_query("customer", "erpnext.controllers.queries.customer_query");
 
 		frm.set_query("user", "users", function () {
 			return {
-				query: "erpnext.projects.doctype.project.project.get_users_for_project"
+				query: "erpnext.projects.doctype.project.project.get_users_for_project",
 			};
 		});
 
 		frm.set_query("department", function (doc) {
 			return {
 				filters: {
-					"company": doc.company,
-				}
+					company: doc.company,
+				},
 			};
 		});
 
 		// sales order
-		frm.set_query('sales_order', function () {
+		frm.set_query("sales_order", function () {
 			var filters = {
-				'project': ["in", frm.doc.__islocal ? [""] : [frm.doc.name, ""]]
+				project: ["in", frm.doc.__islocal ? [""] : [frm.doc.name, ""]],
 			};
 
 			if (frm.doc.customer) {
@@ -54,7 +54,7 @@
 			}
 
 			return {
-				filters: filters
+				filters: filters,
 			};
 		});
 	},
@@ -65,108 +65,133 @@
 		} else {
 			frm.add_web_link("/projects?project=" + encodeURIComponent(frm.doc.name));
 
-			frm.trigger('show_dashboard');
+			frm.trigger("show_dashboard");
 		}
 		frm.trigger("set_custom_buttons");
 	},
 
-	set_custom_buttons: function(frm) {
+	set_custom_buttons: function (frm) {
 		if (!frm.is_new()) {
-			frm.add_custom_button(__('Duplicate Project with Tasks'), () => {
-				frm.events.create_duplicate(frm);
-			}, __("Actions"));
+			frm.add_custom_button(
+				__("Duplicate Project with Tasks"),
+				() => {
+					frm.events.create_duplicate(frm);
+				},
+				__("Actions")
+			);
 
-			frm.add_custom_button(__('Update Total Purchase Cost'), () => {
-				frm.events.update_total_purchase_cost(frm);
-			}, __("Actions"));
+			frm.add_custom_button(
+				__("Update Total Purchase Cost"),
+				() => {
+					frm.events.update_total_purchase_cost(frm);
+				},
+				__("Actions")
+			);
 
 			frm.trigger("set_project_status_button");
 
-
 			if (frappe.model.can_read("Task")) {
-				frm.add_custom_button(__("Gantt Chart"), function () {
-					frappe.route_options = {
-						"project": frm.doc.name
-					};
-					frappe.set_route("List", "Task", "Gantt");
-				}, __("View"));
+				frm.add_custom_button(
+					__("Gantt Chart"),
+					function () {
+						frappe.route_options = {
+							project: frm.doc.name,
+						};
+						frappe.set_route("List", "Task", "Gantt");
+					},
+					__("View")
+				);
 
-				frm.add_custom_button(__("Kanban Board"), () => {
-					frappe.call('erpnext.projects.doctype.project.project.create_kanban_board_if_not_exists', {
-						project: frm.doc.name
-					}).then(() => {
-						frappe.set_route('List', 'Task', 'Kanban', frm.doc.project_name);
-					});
-				}, __("View"));
+				frm.add_custom_button(
+					__("Kanban Board"),
+					() => {
+						frappe
+							.call(
+								"erpnext.projects.doctype.project.project.create_kanban_board_if_not_exists",
+								{
+									project: frm.doc.name,
+								}
+							)
+							.then(() => {
+								frappe.set_route("List", "Task", "Kanban", frm.doc.project_name);
+							});
+					},
+					__("View")
+				);
 			}
 		}
-
-
 	},
 
-	update_total_purchase_cost: function(frm) {
+	update_total_purchase_cost: function (frm) {
 		frappe.call({
 			method: "erpnext.projects.doctype.project.project.recalculate_project_total_purchase_cost",
-			args: {project: frm.doc.name},
+			args: { project: frm.doc.name },
 			freeze: true,
-			freeze_message: __('Recalculating Purchase Cost against this Project...'),
-			callback: function(r) {
+			freeze_message: __("Recalculating Purchase Cost against this Project..."),
+			callback: function (r) {
 				if (r && !r.exc) {
-					frappe.msgprint(__('Total Purchase Cost has been updated'));
+					frappe.msgprint(__("Total Purchase Cost has been updated"));
 					frm.refresh();
 				}
-			}
-
+			},
 		});
 	},
 
-	set_project_status_button: function(frm) {
-		frm.add_custom_button(__('Set Project Status'), () => {
-			let d = new frappe.ui.Dialog({
-				"title": __("Set Project Status"),
-				"fields": [
-					{
-						"fieldname": "status",
-						"fieldtype": "Select",
-						"label": "Status",
-						"reqd": 1,
-						"options": "Completed\nCancelled",
+	set_project_status_button: function (frm) {
+		frm.add_custom_button(
+			__("Set Project Status"),
+			() => {
+				let d = new frappe.ui.Dialog({
+					title: __("Set Project Status"),
+					fields: [
+						{
+							fieldname: "status",
+							fieldtype: "Select",
+							label: "Status",
+							reqd: 1,
+							options: "Completed\nCancelled",
+						},
+					],
+					primary_action: function () {
+						frm.events.set_status(frm, d.get_values().status);
+						d.hide();
 					},
-				],
-				primary_action: function() {
-					frm.events.set_status(frm, d.get_values().status);
-					d.hide();
-				},
-				primary_action_label: __("Set Project Status")
-			}).show();
-		}, __("Actions"));
+					primary_action_label: __("Set Project Status"),
+				}).show();
+			},
+			__("Actions")
+		);
 	},
 
-	create_duplicate: function(frm) {
-		return new Promise(resolve => {
-			frappe.prompt('Project Name', (data) => {
-				frappe.xcall('erpnext.projects.doctype.project.project.create_duplicate_project',
-					{
+	create_duplicate: function (frm) {
+		return new Promise((resolve) => {
+			frappe.prompt("Project Name", (data) => {
+				frappe
+					.xcall("erpnext.projects.doctype.project.project.create_duplicate_project", {
 						prev_doc: frm.doc,
-						project_name: data.value
-					}).then(() => {
-					frappe.set_route('Form', "Project", data.value);
-					frappe.show_alert(__("Duplicate project has been created"));
-				});
+						project_name: data.value,
+					})
+					.then(() => {
+						frappe.set_route("Form", "Project", data.value);
+						frappe.show_alert(__("Duplicate project has been created"));
+					});
 				resolve();
 			});
 		});
 	},
 
-	set_status: function(frm, status) {
-		frappe.confirm(__('Set Project and all Tasks to status {0}?', [status.bold()]), () => {
-			frappe.xcall('erpnext.projects.doctype.project.project.set_project_status',
-				{project: frm.doc.name, status: status}).then(() => {
-				frm.reload_doc();
-			});
+	set_status: function (frm, status) {
+		frappe.confirm(__("Set Project and all Tasks to status {0}?", [status.bold()]), () => {
+			frappe
+				.xcall("erpnext.projects.doctype.project.project.set_project_status", {
+					project: frm.doc.name,
+					status: status,
+				})
+				.then(() => {
+					frm.reload_doc();
+				});
 		});
 	},
-
 });
 
 function open_form(frm, doctype, child_doctype, parentfield) {
@@ -184,5 +209,4 @@
 
 		frappe.ui.form.make_quick_entry(doctype, null, null, new_doc);
 	});
-
 }
diff --git a/erpnext/projects/doctype/project/project_list.js b/erpnext/projects/doctype/project/project_list.js
index 5ad4bb7..1503b1e 100644
--- a/erpnext/projects/doctype/project/project_list.js
+++ b/erpnext/projects/doctype/project/project_list.js
@@ -1,11 +1,11 @@
-frappe.listview_settings['Project'] = {
+frappe.listview_settings["Project"] = {
 	add_fields: ["status", "priority", "is_active", "percent_complete", "expected_end_date", "project_name"],
-	filters:[["status","=", "Open"]],
-	get_indicator: function(doc) {
-		if(doc.status=="Open" && doc.percent_complete) {
+	filters: [["status", "=", "Open"]],
+	get_indicator: function (doc) {
+		if (doc.status == "Open" && doc.percent_complete) {
 			return [__("{0}%", [cint(doc.percent_complete)]), "orange", "percent_complete,>,0|status,=,Open"];
 		} else {
 			return [__(doc.status), frappe.utils.guess_colour(doc.status), "status,=," + doc.status];
 		}
-	}
+	},
 };
diff --git a/erpnext/projects/doctype/project/project_timesheet.js b/erpnext/projects/doctype/project/project_timesheet.js
index 32df04f..bc6de31 100644
--- a/erpnext/projects/doctype/project/project_timesheet.js
+++ b/erpnext/projects/doctype/project/project_timesheet.js
@@ -1,53 +1,63 @@
-
-QUnit.test("test project", function(assert) {
+QUnit.test("test project", function (assert) {
 	assert.expect(6);
 	let done = assert.async();
-	var task_title = ["Documentation","Implementation","Testing"];
+	var task_title = ["Documentation", "Implementation", "Testing"];
 
 	// To create a timesheet with different tasks and costs
-	let timesheet = (title,start_time,end_time,bill_rate,cost_rate) => {
+	let timesheet = (title, start_time, end_time, bill_rate, cost_rate) => {
 		return frappe.run_serially([
-			() => frappe.db.get_value('Task', {'subject': title}, 'name'),
+			() => frappe.db.get_value("Task", { subject: title }, "name"),
 			(task) => {
 				// Creating timesheet for a project
-				return frappe.tests.make('Timesheet', [
-					{time_logs:[
-						[
-							{activity_type: 'Communication'},
-							{from_time: start_time},
-							{to_time: end_time},
-							{hours: 2},
-							{project: 'Test App'},
-							{task: task.name},
-							{billable: '1'},
-							{billing_rate: bill_rate},
-							{costing_rate: cost_rate}
-						]
-					]}
+				return frappe.tests.make("Timesheet", [
+					{
+						time_logs: [
+							[
+								{ activity_type: "Communication" },
+								{ from_time: start_time },
+								{ to_time: end_time },
+								{ hours: 2 },
+								{ project: "Test App" },
+								{ task: task.name },
+								{ billable: "1" },
+								{ billing_rate: bill_rate },
+								{ costing_rate: cost_rate },
+							],
+						],
+					},
 				]);
 			},
 			// To check if a correct billable and costing amount is calculated for every task
 			() => {
-				if(title=== 'Documentation')
-				{
-					assert.ok(cur_frm.get_field('total_billable_amount').get_value()==20,
-						'Billable amount for Documentation task is correctly calculated');
-					assert.ok(cur_frm.get_field('total_costing_amount').get_value()==16,
-						'Costing amount for Documentation task is correctly calculated');
+				if (title === "Documentation") {
+					assert.ok(
+						cur_frm.get_field("total_billable_amount").get_value() == 20,
+						"Billable amount for Documentation task is correctly calculated"
+					);
+					assert.ok(
+						cur_frm.get_field("total_costing_amount").get_value() == 16,
+						"Costing amount for Documentation task is correctly calculated"
+					);
 				}
-				if(title=== 'Implementation')
-				{
-					assert.ok(cur_frm.get_field('total_billable_amount').get_value()==40,
-						'Billable amount for Implementation task is correctly calculated');
-					assert.ok(cur_frm.get_field('total_costing_amount').get_value()==32,
-						'Costing amount for Implementation task is correctly calculated');
+				if (title === "Implementation") {
+					assert.ok(
+						cur_frm.get_field("total_billable_amount").get_value() == 40,
+						"Billable amount for Implementation task is correctly calculated"
+					);
+					assert.ok(
+						cur_frm.get_field("total_costing_amount").get_value() == 32,
+						"Costing amount for Implementation task is correctly calculated"
+					);
 				}
-				if(title=== 'Testing')
-				{
-					assert.ok(cur_frm.get_field('total_billable_amount').get_value()==60,
-						'Billable amount for Testing task correctly calculated');
-					assert.ok(cur_frm.get_field('total_costing_amount').get_value()==50,
-						'Costing amount for Testing task is correctly calculated');
+				if (title === "Testing") {
+					assert.ok(
+						cur_frm.get_field("total_billable_amount").get_value() == 60,
+						"Billable amount for Testing task correctly calculated"
+					);
+					assert.ok(
+						cur_frm.get_field("total_costing_amount").get_value() == 50,
+						"Costing amount for Testing task is correctly calculated"
+					);
 				}
 			},
 		]);
@@ -55,37 +65,39 @@
 	frappe.run_serially([
 		() => {
 			// Creating project with task
-			return frappe.tests.make('Project', [
-				{ project_name: 'Test App'},
-				{ expected_start_date: '2017-07-22'},
-				{ expected_end_date: '2017-09-22'},
-				{ estimated_costing: '10,000.00'},
-				{ tasks:[
-					[
-						{title: 'Documentation'},
-						{start_date: '2017-07-24'},
-						{end_date: '2017-07-31'},
-						{description: 'To make a proper documentation defining requirements etc'}
+			return frappe.tests.make("Project", [
+				{ project_name: "Test App" },
+				{ expected_start_date: "2017-07-22" },
+				{ expected_end_date: "2017-09-22" },
+				{ estimated_costing: "10,000.00" },
+				{
+					tasks: [
+						[
+							{ title: "Documentation" },
+							{ start_date: "2017-07-24" },
+							{ end_date: "2017-07-31" },
+							{ description: "To make a proper documentation defining requirements etc" },
+						],
+						[
+							{ title: "Implementation" },
+							{ start_date: "2017-08-01" },
+							{ end_date: "2017-08-01" },
+							{ description: "Writing algorithms and to code the functionalities" },
+						],
+						[
+							{ title: "Testing" },
+							{ start_date: "2017-08-01" },
+							{ end_date: "2017-08-15" },
+							{ description: "To make the test cases and test the functionalities" },
+						],
 					],
-					[
-						{title: 'Implementation'},
-						{start_date: '2017-08-01'},
-						{end_date: '2017-08-01'},
-						{description: 'Writing algorithms and to code the functionalities'}
-					],
-					[
-						{title: 'Testing'},
-						{start_date: '2017-08-01'},
-						{end_date: '2017-08-15'},
-						{description: 'To make the test cases and test the functionalities'}
-					]
-				]}
+				},
 			]);
 		},
 		// Creating Timesheet with different tasks
-		() => timesheet(task_title[0],'2017-07-24 13:00:00','2017-07-24 13:00:00',10,8),
-		() => timesheet(task_title[1],'2017-07-25 13:00:00','2017-07-25 15:00:00',20,16),
-		() => timesheet(task_title[2],'2017-07-26 13:00:00','2017-07-26 15:00:00',30,25),
-		() => done()
+		() => timesheet(task_title[0], "2017-07-24 13:00:00", "2017-07-24 13:00:00", 10, 8),
+		() => timesheet(task_title[1], "2017-07-25 13:00:00", "2017-07-25 15:00:00", 20, 16),
+		() => timesheet(task_title[2], "2017-07-26 13:00:00", "2017-07-26 15:00:00", 30, 25),
+		() => done(),
 	]);
 });
diff --git a/erpnext/projects/doctype/project_template/project_template.js b/erpnext/projects/doctype/project_template/project_template.js
index 3d3c15c..a2d008a 100644
--- a/erpnext/projects/doctype/project_template/project_template.js
+++ b/erpnext/projects/doctype/project_template/project_template.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Project Template', {
+frappe.ui.form.on("Project Template", {
 	// refresh: function(frm) {
 
 	// }
@@ -9,19 +9,19 @@
 		frm.set_query("task", "tasks", function () {
 			return {
 				filters: {
-					"is_template": 1
-				}
+					is_template: 1,
+				},
 			};
 		});
-	}
+	},
 });
 
-frappe.ui.form.on('Project Template Task', {
+frappe.ui.form.on("Project Template Task", {
 	task: function (frm, cdt, cdn) {
 		var row = locals[cdt][cdn];
 		frappe.db.get_value("Task", row.task, "subject", (value) => {
 			row.subject = value.subject;
 			refresh_field("tasks");
 		});
-	}
+	},
 });
diff --git a/erpnext/projects/doctype/project_type/project_type.js b/erpnext/projects/doctype/project_type/project_type.js
index e3dda5e..8506c78 100644
--- a/erpnext/projects/doctype/project_type/project_type.js
+++ b/erpnext/projects/doctype/project_type/project_type.js
@@ -1,6 +1,4 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Project Type', {
-
-});
+frappe.ui.form.on("Project Type", {});
diff --git a/erpnext/projects/doctype/project_update/project_update.js b/erpnext/projects/doctype/project_update/project_update.js
index 990c1af..4e3f0fa 100644
--- a/erpnext/projects/doctype/project_update/project_update.js
+++ b/erpnext/projects/doctype/project_update/project_update.js
@@ -1,10 +1,8 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Project Update', {
-	refresh: function() {
-
-	},
+frappe.ui.form.on("Project Update", {
+	refresh: function () {},
 
 	onload: function (frm) {
 		frm.set_value("naming_series", "UPDATE-.project.-.YY.MM.DD.-.####");
@@ -13,5 +11,5 @@
 	validate: function (frm) {
 		frm.set_value("time", frappe.datetime.now_time());
 		frm.set_value("date", frappe.datetime.nowdate());
-	}
+	},
 });
diff --git a/erpnext/projects/doctype/projects_settings/projects_settings.js b/erpnext/projects/doctype/projects_settings/projects_settings.js
index 9902b83..08f50a6 100644
--- a/erpnext/projects/doctype/projects_settings/projects_settings.js
+++ b/erpnext/projects/doctype/projects_settings/projects_settings.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Projects Settings', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Projects Settings", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/projects/doctype/task/task.js b/erpnext/projects/doctype/task/task.js
index 3cd92ee..c56c998 100644
--- a/erpnext/projects/doctype/task/task.js
+++ b/erpnext/projects/doctype/task/task.js
@@ -6,33 +6,34 @@
 frappe.ui.form.on("Task", {
 	setup: function (frm) {
 		frm.make_methods = {
-			'Timesheet': () => frappe.model.open_mapped_doc({
-				method: 'erpnext.projects.doctype.task.task.make_timesheet',
-				frm: frm
-			})
-		}
+			Timesheet: () =>
+				frappe.model.open_mapped_doc({
+					method: "erpnext.projects.doctype.task.task.make_timesheet",
+					frm: frm,
+				}),
+		};
 	},
 
 	onload: function (frm) {
 		frm.set_query("task", "depends_on", function () {
 			let filters = {
-				name: ["!=", frm.doc.name]
+				name: ["!=", frm.doc.name],
 			};
 			if (frm.doc.project) filters["project"] = frm.doc.project;
 			return {
-				filters: filters
+				filters: filters,
 			};
-		})
+		});
 
 		frm.set_query("parent_task", function () {
 			let filters = {
-				"is_group": 1,
-				"name": ["!=", frm.doc.name]
+				is_group: 1,
+				name: ["!=", frm.doc.name],
 			};
 			if (frm.doc.project) filters["project"] = frm.doc.project;
 			return {
-				filters: filters
-			}
+				filters: filters,
+			};
 		});
 	},
 
@@ -40,22 +41,22 @@
 		frappe.call({
 			method: "erpnext.projects.doctype.task.task.check_if_child_exists",
 			args: {
-				name: frm.doc.name
+				name: frm.doc.name,
 			},
 			callback: function (r) {
 				if (r.message.length > 0) {
-					let message = __('Cannot convert Task to non-group because the following child Tasks exist: {0}.',
+					let message = __(
+						"Cannot convert Task to non-group because the following child Tasks exist: {0}.",
 						[r.message.join(", ")]
 					);
 					frappe.msgprint(message);
 					frm.reload_doc();
 				}
-			}
-		})
+			},
+		});
 	},
 
 	validate: function (frm) {
-		frm.doc.project && frappe.model.remove_from_locals("Project",
-			frm.doc.project);
-	}
+		frm.doc.project && frappe.model.remove_from_locals("Project", frm.doc.project);
+	},
 });
diff --git a/erpnext/projects/doctype/task/task_calendar.js b/erpnext/projects/doctype/task/task_calendar.js
index 49dbb76..768eb15 100644
--- a/erpnext/projects/doctype/task/task_calendar.js
+++ b/erpnext/projects/doctype/task/task_calendar.js
@@ -3,21 +3,21 @@
 
 frappe.views.calendar["Task"] = {
 	field_map: {
-		"start": "exp_start_date",
-		"end": "exp_end_date",
-		"id": "name",
-		"title": "subject",
-		"allDay": "allDay",
-		"progress": "progress"
+		start: "exp_start_date",
+		end: "exp_end_date",
+		id: "name",
+		title: "subject",
+		allDay: "allDay",
+		progress: "progress",
 	},
 	gantt: true,
 	filters: [
 		{
-			"fieldtype": "Link",
-			"fieldname": "project",
-			"options": "Project",
-			"label": __("Project")
-		}
+			fieldtype: "Link",
+			fieldname: "project",
+			options: "Project",
+			label: __("Project"),
+		},
 	],
-	get_events_method: "frappe.desk.calendar.get_events"
-}
+	get_events_method: "frappe.desk.calendar.get_events",
+};
diff --git a/erpnext/projects/doctype/task/task_list.js b/erpnext/projects/doctype/task/task_list.js
index 5ab8bae..17b0ed2 100644
--- a/erpnext/projects/doctype/task/task_list.js
+++ b/erpnext/projects/doctype/task/task_list.js
@@ -1,28 +1,36 @@
-frappe.listview_settings['Task'] = {
-	add_fields: ["project", "status", "priority", "exp_start_date",
-		"exp_end_date", "subject", "progress", "depends_on_tasks"],
+frappe.listview_settings["Task"] = {
+	add_fields: [
+		"project",
+		"status",
+		"priority",
+		"exp_start_date",
+		"exp_end_date",
+		"subject",
+		"progress",
+		"depends_on_tasks",
+	],
 	filters: [["status", "=", "Open"]],
-	onload: function(listview) {
+	onload: function (listview) {
 		var method = "erpnext.projects.doctype.task.task.set_multiple_status";
 
-		listview.page.add_menu_item(__("Set as Open"), function() {
-			listview.call_for_selected_items(method, {"status": "Open"});
+		listview.page.add_menu_item(__("Set as Open"), function () {
+			listview.call_for_selected_items(method, { status: "Open" });
 		});
 
-		listview.page.add_menu_item(__("Set as Completed"), function() {
-			listview.call_for_selected_items(method, {"status": "Completed"});
+		listview.page.add_menu_item(__("Set as Completed"), function () {
+			listview.call_for_selected_items(method, { status: "Completed" });
 		});
 	},
-	get_indicator: function(doc) {
+	get_indicator: function (doc) {
 		var colors = {
-			"Open": "orange",
-			"Overdue": "red",
+			Open: "orange",
+			Overdue: "red",
 			"Pending Review": "orange",
-			"Working": "orange",
-			"Completed": "green",
-			"Cancelled": "dark grey",
-			"Template": "blue"
-		}
+			Working: "orange",
+			Completed: "green",
+			Cancelled: "dark grey",
+			Template: "blue",
+		};
 		return [__(doc.status), colors[doc.status], "status,=," + doc.status];
 	},
 	gantt_custom_popup_html: function (ganttobj, task) {
diff --git a/erpnext/projects/doctype/task/task_tree.js b/erpnext/projects/doctype/task/task_tree.js
index 9ebfcdd..fba1b30 100644
--- a/erpnext/projects/doctype/task/task_tree.js
+++ b/erpnext/projects/doctype/task/task_tree.js
@@ -1,84 +1,88 @@
 frappe.provide("frappe.treeview_settings");
 
-frappe.treeview_settings['Task'] = {
+frappe.treeview_settings["Task"] = {
 	get_tree_nodes: "erpnext.projects.doctype.task.task.get_children",
 	add_tree_node: "erpnext.projects.doctype.task.task.add_node",
 	filters: [
 		{
 			fieldname: "project",
-			fieldtype:"Link",
+			fieldtype: "Link",
 			options: "Project",
 			label: __("Project"),
 		},
 		{
 			fieldname: "task",
-			fieldtype:"Link",
+			fieldtype: "Link",
 			options: "Task",
 			label: __("Task"),
-			get_query: function() {
-				var me = frappe.treeview_settings['Task'];
+			get_query: function () {
+				var me = frappe.treeview_settings["Task"];
 				var project = me.page.fields_dict.project.get_value();
-				var args = [["Task", 'is_group', '=', 1]];
-				if(project){
-					args.push(["Task", 'project', "=", project]);
+				var args = [["Task", "is_group", "=", 1]];
+				if (project) {
+					args.push(["Task", "project", "=", project]);
 				}
 				return {
-					filters: args
+					filters: args,
 				};
-			}
-		}
+			},
+		},
 	],
 	breadcrumb: "Projects",
 	get_tree_root: false,
 	root_label: "All Tasks",
 	ignore_fields: ["parent_task"],
-	onload: function(me) {
-		frappe.treeview_settings['Task'].page = {};
-		$.extend(frappe.treeview_settings['Task'].page, me.page);
+	onload: function (me) {
+		frappe.treeview_settings["Task"].page = {};
+		$.extend(frappe.treeview_settings["Task"].page, me.page);
 		me.make_tree();
 	},
 	toolbar: [
 		{
-			label:__("Add Multiple"),
-			condition: function(node) {
+			label: __("Add Multiple"),
+			condition: function (node) {
 				return node.expandable;
 			},
-			click: function(node) {
+			click: function (node) {
 				this.data = [];
 				const dialog = new frappe.ui.Dialog({
 					title: __("Add Multiple Tasks"),
 					fields: [
 						{
-							fieldname: "multiple_tasks", fieldtype: "Table",
-							in_place_edit: true, data: this.data,
+							fieldname: "multiple_tasks",
+							fieldtype: "Table",
+							in_place_edit: true,
+							data: this.data,
 							get_data: () => {
 								return this.data;
 							},
-							fields: [{
-								fieldtype:'Data',
-								fieldname:"subject",
-								in_list_view: 1,
-								reqd: 1,
-								label: __("Subject")
-							}]
+							fields: [
+								{
+									fieldtype: "Data",
+									fieldname: "subject",
+									in_list_view: 1,
+									reqd: 1,
+									label: __("Subject"),
+								},
+							],
 						},
 					],
-					primary_action: function() {
+					primary_action: function () {
 						dialog.hide();
 						return frappe.call({
 							method: "erpnext.projects.doctype.task.task.add_multiple_tasks",
 							args: {
 								data: dialog.get_values()["multiple_tasks"],
-								parent: node.data.value
+								parent: node.data.value,
 							},
-							callback: function() { }
+							callback: function () {},
 						});
 					},
-					primary_action_label: __('Create')
+					primary_action_label: __("Create"),
 				});
 				dialog.show();
-			}
-		}
+			},
+		},
 	],
-	extend_toolbar: true
+	extend_toolbar: true,
 };
diff --git a/erpnext/projects/doctype/task_type/task_type.js b/erpnext/projects/doctype/task_type/task_type.js
index c1be5da..9c6176d 100644
--- a/erpnext/projects/doctype/task_type/task_type.js
+++ b/erpnext/projects/doctype/task_type/task_type.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Task Type', {
+frappe.ui.form.on("Task Type", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/projects/doctype/timesheet/timesheet.js b/erpnext/projects/doctype/timesheet/timesheet.js
index eb7a97e..9aba75b 100644
--- a/erpnext/projects/doctype/timesheet/timesheet.js
+++ b/erpnext/projects/doctype/timesheet/timesheet.js
@@ -2,39 +2,39 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.ui.form.on("Timesheet", {
-	setup: function(frm) {
+	setup: function (frm) {
 		frappe.require("/assets/erpnext/js/projects/timer.js");
 
-		frm.ignore_doctypes_on_cancel_all = ['Sales Invoice'];
+		frm.ignore_doctypes_on_cancel_all = ["Sales Invoice"];
 
-		frm.fields_dict.employee.get_query = function() {
+		frm.fields_dict.employee.get_query = function () {
 			return {
-				filters:{
-					'status': 'Active'
-				}
+				filters: {
+					status: "Active",
+				},
 			};
 		};
 
-		frm.fields_dict['time_logs'].grid.get_field('task').get_query = function(frm, cdt, cdn) {
+		frm.fields_dict["time_logs"].grid.get_field("task").get_query = function (frm, cdt, cdn) {
 			var child = locals[cdt][cdn];
-			return{
+			return {
 				filters: {
-					'project': child.project,
-					'status': ["!=", "Cancelled"]
-				}
+					project: child.project,
+					status: ["!=", "Cancelled"],
+				},
 			};
 		};
 
-		frm.fields_dict['time_logs'].grid.get_field('project').get_query = function() {
-			return{
+		frm.fields_dict["time_logs"].grid.get_field("project").get_query = function () {
+			return {
 				filters: {
-					'company': frm.doc.company
-				}
+					company: frm.doc.company,
+				},
 			};
 		};
 	},
 
-	onload: function(frm) {
+	onload: function (frm) {
 		if (frm.doc.__islocal && frm.doc.time_logs) {
 			calculate_time_and_amount(frm);
 		}
@@ -44,33 +44,32 @@
 		}
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		if (frm.doc.docstatus == 1) {
 			if (
-				(frm.doc.per_billed < 100)
-				&& (frm.doc.total_billable_hours)
-				&& (frm.doc.total_billable_hours > frm.doc.total_billed_hours)
+				frm.doc.per_billed < 100 &&
+				frm.doc.total_billable_hours &&
+				frm.doc.total_billable_hours > frm.doc.total_billed_hours
 			) {
-				frm.add_custom_button(__("Create Sales Invoice"), function() {
+				frm.add_custom_button(__("Create Sales Invoice"), function () {
 					frm.trigger("make_invoice");
 				});
 			}
 		}
 
 		if (frm.doc.docstatus < 1) {
-
-			let button = 'Start Timer';
-			$.each(frm.doc.time_logs || [], function(i, row) {
-				if ((row.from_time <= frappe.datetime.now_datetime()) && !row.completed) {
-					button = 'Resume Timer';
+			let button = "Start Timer";
+			$.each(frm.doc.time_logs || [], function (i, row) {
+				if (row.from_time <= frappe.datetime.now_datetime() && !row.completed) {
+					button = "Resume Timer";
 				}
 			});
 
-			frm.add_custom_button(__(button), function() {
+			frm.add_custom_button(__(button), function () {
 				var flag = true;
-				$.each(frm.doc.time_logs || [], function(i, row) {
+				$.each(frm.doc.time_logs || [], function (i, row) {
 					// Fetch the row for which from_time is not present
-					if (flag && row.activity_type && !row.from_time){
+					if (flag && row.activity_type && !row.from_time) {
 						erpnext.timesheet.timer(frm, row);
 						row.from_time = frappe.datetime.now_datetime();
 						frm.refresh_fields("time_logs");
@@ -79,7 +78,10 @@
 					}
 					// Fetch the row for timer where activity is not completed and from_time is before now_time
 					if (flag && row.from_time <= frappe.datetime.now_datetime() && !row.completed) {
-						let timestamp = moment(frappe.datetime.now_datetime()).diff(moment(row.from_time),"seconds");
+						let timestamp = moment(frappe.datetime.now_datetime()).diff(
+							moment(row.from_time),
+							"seconds"
+						);
 						erpnext.timesheet.timer(frm, row, timestamp);
 						flag = false;
 					}
@@ -90,152 +92,177 @@
 				}
 			}).addClass("btn-primary");
 		}
-		if(frm.doc.per_billed > 0) {
+		if (frm.doc.per_billed > 0) {
 			frm.fields_dict["time_logs"].grid.toggle_enable("billing_hours", false);
 			frm.fields_dict["time_logs"].grid.toggle_enable("is_billable", false);
 		}
 
 		let filters = {
-			"status": "Open"
+			status: "Open",
 		};
 
 		if (frm.doc.customer) {
 			filters["customer"] = frm.doc.customer;
 		}
 
-		frm.set_query('parent_project', function(doc) {
+		frm.set_query("parent_project", function (doc) {
 			return {
-				filters: filters
+				filters: filters,
 			};
 		});
 
-		frm.trigger('setup_filters');
-		frm.trigger('set_dynamic_field_label');
-		frm.trigger('set_route_options_for_new_task');
+		frm.trigger("setup_filters");
+		frm.trigger("set_dynamic_field_label");
+		frm.trigger("set_route_options_for_new_task");
 	},
 
-	customer: function(frm) {
-		frm.set_query('project', 'time_logs', function(doc) {
+	customer: function (frm) {
+		frm.set_query("project", "time_logs", function (doc) {
 			return {
 				filters: {
-					"customer": doc.customer
-				}
+					customer: doc.customer,
+				},
 			};
 		});
 		frm.refresh();
 	},
 
-	currency: function(frm) {
-		let base_currency = frappe.defaults.get_global_default('currency');
-		if (frm.doc.currency && (base_currency != frm.doc.currency)) {
+	currency: function (frm) {
+		let base_currency = frappe.defaults.get_global_default("currency");
+		if (frm.doc.currency && base_currency != frm.doc.currency) {
 			frappe.call({
 				method: "erpnext.setup.utils.get_exchange_rate",
 				args: {
 					from_currency: frm.doc.currency,
-					to_currency: base_currency
+					to_currency: base_currency,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (r.message) {
-						frm.set_value('exchange_rate', flt(r.message));
-						frm.set_df_property("exchange_rate", "description", "1 " + frm.doc.currency + " = [?] " + base_currency);
+						frm.set_value("exchange_rate", flt(r.message));
+						frm.set_df_property(
+							"exchange_rate",
+							"description",
+							"1 " + frm.doc.currency + " = [?] " + base_currency
+						);
 					}
-				}
+				},
 			});
 		}
-		frm.trigger('set_dynamic_field_label');
+		frm.trigger("set_dynamic_field_label");
 	},
 
-	exchange_rate: function(frm) {
-		$.each(frm.doc.time_logs, function(i, d) {
+	exchange_rate: function (frm) {
+		$.each(frm.doc.time_logs, function (i, d) {
 			calculate_billing_costing_amount(frm, d.doctype, d.name);
 		});
 		calculate_time_and_amount(frm);
 	},
 
-	set_dynamic_field_label: function(frm) {
-		let base_currency = frappe.defaults.get_global_default('currency');
-		frm.set_currency_labels(["base_total_costing_amount", "base_total_billable_amount", "base_total_billed_amount"], base_currency);
-		frm.set_currency_labels(["total_costing_amount", "total_billable_amount", "total_billed_amount"], frm.doc.currency);
+	set_dynamic_field_label: function (frm) {
+		let base_currency = frappe.defaults.get_global_default("currency");
+		frm.set_currency_labels(
+			["base_total_costing_amount", "base_total_billable_amount", "base_total_billed_amount"],
+			base_currency
+		);
+		frm.set_currency_labels(
+			["total_costing_amount", "total_billable_amount", "total_billed_amount"],
+			frm.doc.currency
+		);
 
-		frm.toggle_display(["base_total_costing_amount", "base_total_billable_amount", "base_total_billed_amount"],
-			frm.doc.currency != base_currency);
+		frm.toggle_display(
+			["base_total_costing_amount", "base_total_billable_amount", "base_total_billed_amount"],
+			frm.doc.currency != base_currency
+		);
 
 		if (frm.doc.time_logs.length > 0) {
-			frm.set_currency_labels(["base_billing_rate", "base_billing_amount", "base_costing_rate", "base_costing_amount"], base_currency, "time_logs");
-			frm.set_currency_labels(["billing_rate", "billing_amount", "costing_rate", "costing_amount"], frm.doc.currency, "time_logs");
+			frm.set_currency_labels(
+				["base_billing_rate", "base_billing_amount", "base_costing_rate", "base_costing_amount"],
+				base_currency,
+				"time_logs"
+			);
+			frm.set_currency_labels(
+				["billing_rate", "billing_amount", "costing_rate", "costing_amount"],
+				frm.doc.currency,
+				"time_logs"
+			);
 
 			let time_logs_grid = frm.fields_dict.time_logs.grid;
-			$.each(["base_billing_rate", "base_billing_amount", "base_costing_rate", "base_costing_amount"], function(i, d) {
-				if (frappe.meta.get_docfield(time_logs_grid.doctype, d))
-					time_logs_grid.set_column_disp(d, frm.doc.currency != base_currency);
-			});
+			$.each(
+				["base_billing_rate", "base_billing_amount", "base_costing_rate", "base_costing_amount"],
+				function (i, d) {
+					if (frappe.meta.get_docfield(time_logs_grid.doctype, d))
+						time_logs_grid.set_column_disp(d, frm.doc.currency != base_currency);
+				}
+			);
 		}
 		frm.refresh_fields();
 	},
 
 	set_route_options_for_new_task: (frm) => {
-		let task_field = frm.get_docfield('time_logs', 'task');
+		let task_field = frm.get_docfield("time_logs", "task");
 
 		if (task_field) {
-			task_field.get_route_options_for_new_doc = (row) => ({'project': row.doc.project});
+			task_field.get_route_options_for_new_doc = (row) => ({ project: row.doc.project });
 		}
 	},
 
-	make_invoice: function(frm) {
-		let fields = [{
-			"fieldtype": "Link",
-			"label": __("Item Code"),
-			"fieldname": "item_code",
-			"options": "Item"
-		}];
+	make_invoice: function (frm) {
+		let fields = [
+			{
+				fieldtype: "Link",
+				label: __("Item Code"),
+				fieldname: "item_code",
+				options: "Item",
+			},
+		];
 
 		if (!frm.doc.customer) {
 			fields.push({
-				"fieldtype": "Link",
-				"label": __("Customer"),
-				"fieldname": "customer",
-				"options": "Customer",
-				"default": frm.doc.customer
+				fieldtype: "Link",
+				label: __("Customer"),
+				fieldname: "customer",
+				options: "Customer",
+				default: frm.doc.customer,
 			});
 		}
 
 		let dialog = new frappe.ui.Dialog({
 			title: __("Create Sales Invoice"),
-			fields: fields
+			fields: fields,
 		});
 
-		dialog.set_primary_action(__('Create Sales Invoice'), () => {
+		dialog.set_primary_action(__("Create Sales Invoice"), () => {
 			var args = dialog.get_values();
-			if(!args) return;
+			if (!args) return;
 			dialog.hide();
 			return frappe.call({
 				type: "GET",
 				method: "erpnext.projects.doctype.timesheet.timesheet.make_sales_invoice",
 				args: {
-					"source_name": frm.doc.name,
-					"item_code": args.item_code,
-					"customer": frm.doc.customer || args.customer,
-					"currency": frm.doc.currency
+					source_name: frm.doc.name,
+					item_code: args.item_code,
+					customer: frm.doc.customer || args.customer,
+					currency: frm.doc.currency,
 				},
 				freeze: true,
-				callback: function(r) {
-					if(!r.exc) {
+				callback: function (r) {
+					if (!r.exc) {
 						frappe.model.sync(r.message);
 						frappe.set_route("Form", r.message.doctype, r.message.name);
 					}
-				}
+				},
 			});
 		});
 		dialog.show();
 	},
 
-	parent_project: function(frm) {
+	parent_project: function (frm) {
 		set_project_in_timelog(frm);
-	}
+	},
 });
 
 frappe.ui.form.on("Timesheet Detail", {
-	time_logs_remove: function(frm) {
+	time_logs_remove: function (frm) {
 		calculate_time_and_amount(frm);
 	},
 
@@ -248,47 +275,47 @@
 		}
 	},
 
-	from_time: function(frm, cdt, cdn) {
+	from_time: function (frm, cdt, cdn) {
 		calculate_end_time(frm, cdt, cdn);
 	},
 
-	to_time: function(frm, cdt, cdn) {
+	to_time: function (frm, cdt, cdn) {
 		var child = locals[cdt][cdn];
 
-		if(frm._setting_hours) return;
+		if (frm._setting_hours) return;
 
 		var hours = moment(child.to_time).diff(moment(child.from_time), "seconds") / 3600;
 		frappe.model.set_value(cdt, cdn, "hours", hours);
 	},
 
-	time_logs_add: function(frm, cdt, cdn) {
-		if(frm.doc.parent_project) {
-			frappe.model.set_value(cdt, cdn, 'project', frm.doc.parent_project);
+	time_logs_add: function (frm, cdt, cdn) {
+		if (frm.doc.parent_project) {
+			frappe.model.set_value(cdt, cdn, "project", frm.doc.parent_project);
 		}
 	},
 
-	hours: function(frm, cdt, cdn) {
+	hours: function (frm, cdt, cdn) {
 		calculate_end_time(frm, cdt, cdn);
 		calculate_billing_costing_amount(frm, cdt, cdn);
 		calculate_time_and_amount(frm);
 	},
 
-	billing_hours: function(frm, cdt, cdn) {
+	billing_hours: function (frm, cdt, cdn) {
 		calculate_billing_costing_amount(frm, cdt, cdn);
 		calculate_time_and_amount(frm);
 	},
 
-	billing_rate: function(frm, cdt, cdn) {
+	billing_rate: function (frm, cdt, cdn) {
 		calculate_billing_costing_amount(frm, cdt, cdn);
 		calculate_time_and_amount(frm);
 	},
 
-	costing_rate: function(frm, cdt, cdn) {
+	costing_rate: function (frm, cdt, cdn) {
 		calculate_billing_costing_amount(frm, cdt, cdn);
 		calculate_time_and_amount(frm);
 	},
 
-	is_billable: function(frm, cdt, cdn) {
+	is_billable: function (frm, cdt, cdn) {
 		update_billing_hours(frm, cdt, cdn);
 		update_time_rates(frm, cdt, cdn);
 		calculate_billing_costing_amount(frm, cdt, cdn);
@@ -303,7 +330,7 @@
 			args: {
 				employee: frm.doc.employee,
 				activity_type: frm.selected_doc.activity_type,
-				currency: frm.doc.currency
+				currency: frm.doc.currency,
 			},
 			callback: function (r) {
 				if (r.message) {
@@ -311,72 +338,71 @@
 					frappe.model.set_value(cdt, cdn, "costing_rate", r.message["costing_rate"]);
 					calculate_billing_costing_amount(frm, cdt, cdn);
 				}
-			}
+			},
 		});
-	}
+	},
 });
 
-var calculate_end_time = function(frm, cdt, cdn) {
+var calculate_end_time = function (frm, cdt, cdn) {
 	let child = locals[cdt][cdn];
 
-	if(!child.from_time) {
+	if (!child.from_time) {
 		// if from_time value is not available then set the current datetime
 		frappe.model.set_value(cdt, cdn, "from_time", frappe.datetime.get_datetime_as_string());
 	}
 
 	let d = moment(child.from_time);
-	if(child.hours) {
+	if (child.hours) {
 		d.add(child.hours, "hours");
 		frm._setting_hours = true;
-		frappe.model.set_value(cdt, cdn, "to_time",
-			d.format(frappe.defaultDatetimeFormat)).then(() => {
+		frappe.model.set_value(cdt, cdn, "to_time", d.format(frappe.defaultDatetimeFormat)).then(() => {
 			frm._setting_hours = false;
 		});
 	}
 };
 
-var update_billing_hours = function(frm, cdt, cdn) {
+var update_billing_hours = function (frm, cdt, cdn) {
 	let child = frappe.get_doc(cdt, cdn);
 	if (!child.is_billable) {
-		frappe.model.set_value(cdt, cdn, 'billing_hours', 0.0);
+		frappe.model.set_value(cdt, cdn, "billing_hours", 0.0);
 	} else {
 		// bill all hours by default
 		frappe.model.set_value(cdt, cdn, "billing_hours", child.hours);
 	}
 };
 
-var update_time_rates = function(frm, cdt, cdn) {
+var update_time_rates = function (frm, cdt, cdn) {
 	let child = frappe.get_doc(cdt, cdn);
 	if (!child.is_billable) {
-		frappe.model.set_value(cdt, cdn, 'billing_rate', 0.0);
+		frappe.model.set_value(cdt, cdn, "billing_rate", 0.0);
 	}
 };
 
-var calculate_billing_costing_amount = function(frm, cdt, cdn) {
+var calculate_billing_costing_amount = function (frm, cdt, cdn) {
 	let row = frappe.get_doc(cdt, cdn);
 	let billing_amount = 0.0;
 	let base_billing_amount = 0.0;
 	let exchange_rate = flt(frm.doc.exchange_rate);
-	frappe.model.set_value(cdt, cdn, 'base_billing_rate', flt(row.billing_rate) * exchange_rate);
-	frappe.model.set_value(cdt, cdn, 'base_costing_rate', flt(row.costing_rate) * exchange_rate);
+	frappe.model.set_value(cdt, cdn, "base_billing_rate", flt(row.billing_rate) * exchange_rate);
+	frappe.model.set_value(cdt, cdn, "base_costing_rate", flt(row.costing_rate) * exchange_rate);
 	if (row.billing_hours && row.is_billable) {
 		base_billing_amount = flt(row.billing_hours) * flt(row.base_billing_rate);
 		billing_amount = flt(row.billing_hours) * flt(row.billing_rate);
 	}
 
-	frappe.model.set_value(cdt, cdn, 'base_billing_amount', base_billing_amount);
-	frappe.model.set_value(cdt, cdn, 'base_costing_amount', flt(row.base_costing_rate) * flt(row.hours));
-	frappe.model.set_value(cdt, cdn, 'billing_amount', billing_amount);
-	frappe.model.set_value(cdt, cdn, 'costing_amount', flt(row.costing_rate) * flt(row.hours));
+	frappe.model.set_value(cdt, cdn, "base_billing_amount", base_billing_amount);
+	frappe.model.set_value(cdt, cdn, "base_costing_amount", flt(row.base_costing_rate) * flt(row.hours));
+	frappe.model.set_value(cdt, cdn, "billing_amount", billing_amount);
+	frappe.model.set_value(cdt, cdn, "costing_amount", flt(row.costing_rate) * flt(row.hours));
 };
 
-var calculate_time_and_amount = function(frm) {
+var calculate_time_and_amount = function (frm) {
 	let tl = frm.doc.time_logs || [];
 	let total_working_hr = 0;
 	let total_billing_hr = 0;
 	let total_billable_amount = 0;
 	let total_costing_amount = 0;
-	for(var i=0; i<tl.length; i++) {
+	for (var i = 0; i < tl.length; i++) {
 		if (tl[i].hours) {
 			total_working_hr += tl[i].hours;
 			total_billable_amount += tl[i].billing_amount;
@@ -395,10 +421,10 @@
 };
 
 // set employee (and company) to the one that's currently logged in
-const set_employee_and_company = function(frm) {
+const set_employee_and_company = function (frm) {
 	const options = { user_id: frappe.session.user };
-	const fields = ['name', 'company'];
-	frappe.db.get_value('Employee', options, fields).then(({ message }) => {
+	const fields = ["name", "company"];
+	frappe.db.get_value("Employee", options, fields).then(({ message }) => {
 		if (message) {
 			// there is an employee with the currently logged in user_id
 			frm.set_value("employee", message.name);
@@ -408,8 +434,8 @@
 };
 
 function set_project_in_timelog(frm) {
-	if(frm.doc.parent_project) {
-		$.each(frm.doc.time_logs || [], function(i, item) {
+	if (frm.doc.parent_project) {
+		$.each(frm.doc.time_logs || [], function (i, item) {
 			frappe.model.set_value(item.doctype, item.name, "project", frm.doc.parent_project);
 		});
 	}
diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py
index e26d04a..d701496 100644
--- a/erpnext/projects/doctype/timesheet/timesheet.py
+++ b/erpnext/projects/doctype/timesheet/timesheet.py
@@ -256,6 +256,16 @@
 		if not ts_detail.is_billable:
 			ts_detail.billing_rate = 0.0
 
+	def unlink_sales_invoice(self, sales_invoice: str):
+		"""Remove link to Sales Invoice from all time logs."""
+		for time_log in self.time_logs:
+			if time_log.sales_invoice == sales_invoice:
+				time_log.sales_invoice = None
+
+		self.calculate_total_amounts()
+		self.calculate_percentage_billed()
+		self.set_status()
+
 
 @frappe.whitelist()
 def get_projectwise_timesheet_data(project=None, parent=None, from_time=None, to_time=None):
diff --git a/erpnext/projects/doctype/timesheet/timesheet_calendar.js b/erpnext/projects/doctype/timesheet/timesheet_calendar.js
index 80967ed..27992a1 100644
--- a/erpnext/projects/doctype/timesheet/timesheet_calendar.js
+++ b/erpnext/projects/doctype/timesheet/timesheet_calendar.js
@@ -1,32 +1,32 @@
 frappe.views.calendar["Timesheet"] = {
 	field_map: {
-		"start": "start_date",
-		"end": "end_date",
-		"name": "parent",
-		"id": "name",
-		"allDay": "allDay",
-		"child_name": "name",
-		"title": "title"
+		start: "start_date",
+		end: "end_date",
+		name: "parent",
+		id: "name",
+		allDay: "allDay",
+		child_name: "name",
+		title: "title",
 	},
 	style_map: {
-		"0": "info",
-		"1": "standard",
-		"2": "danger"
+		0: "info",
+		1: "standard",
+		2: "danger",
 	},
 	gantt: true,
 	filters: [
 		{
-			"fieldtype": "Link",
-			"fieldname": "project",
-			"options": "Project",
-			"label": __("Project")
+			fieldtype: "Link",
+			fieldname: "project",
+			options: "Project",
+			label: __("Project"),
 		},
 		{
-			"fieldtype": "Link",
-			"fieldname": "employee",
-			"options": "Employee",
-			"label": __("Employee")
-		}
+			fieldtype: "Link",
+			fieldname: "employee",
+			options: "Employee",
+			label: __("Employee"),
+		},
 	],
-	get_events_method: "erpnext.projects.doctype.timesheet.timesheet.get_events"
-}
+	get_events_method: "erpnext.projects.doctype.timesheet.timesheet.get_events",
+};
diff --git a/erpnext/projects/doctype/timesheet/timesheet_list.js b/erpnext/projects/doctype/timesheet/timesheet_list.js
index b59fdc9..0de568c 100644
--- a/erpnext/projects/doctype/timesheet/timesheet_list.js
+++ b/erpnext/projects/doctype/timesheet/timesheet_list.js
@@ -1,16 +1,16 @@
-frappe.listview_settings['Timesheet'] = {
+frappe.listview_settings["Timesheet"] = {
 	add_fields: ["status", "total_hours", "start_date", "end_date"],
-	get_indicator: function(doc) {
-		if (doc.status== "Billed") {
-			return [__("Billed"), "green", "status,=," + "Billed"]
+	get_indicator: function (doc) {
+		if (doc.status == "Billed") {
+			return [__("Billed"), "green", "status,=," + "Billed"];
 		}
 
-		if (doc.status== "Payslip") {
-			return [__("Payslip"), "green", "status,=," + "Payslip"]
+		if (doc.status == "Payslip") {
+			return [__("Payslip"), "green", "status,=," + "Payslip"];
 		}
 
-		if (doc.status== "Completed") {
-			return [__("Completed"), "green", "status,=," + "Completed"]
+		if (doc.status == "Completed") {
+			return [__("Completed"), "green", "status,=," + "Completed"];
 		}
-	}
+	},
 };
diff --git a/erpnext/projects/report/daily_timesheet_summary/daily_timesheet_summary.js b/erpnext/projects/report/daily_timesheet_summary/daily_timesheet_summary.js
index 93cb940..60525a1 100644
--- a/erpnext/projects/report/daily_timesheet_summary/daily_timesheet_summary.js
+++ b/erpnext/projects/report/daily_timesheet_summary/daily_timesheet_summary.js
@@ -2,18 +2,18 @@
 // For license information, please see license.txt
 
 frappe.query_reports["Daily Timesheet Summary"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today()
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today()
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
 		},
-	]
-}
+	],
+};
diff --git a/erpnext/projects/report/delayed_tasks_summary/delayed_tasks_summary.js b/erpnext/projects/report/delayed_tasks_summary/delayed_tasks_summary.js
index fa70b93..ad90d04 100644
--- a/erpnext/projects/report/delayed_tasks_summary/delayed_tasks_summary.js
+++ b/erpnext/projects/report/delayed_tasks_summary/delayed_tasks_summary.js
@@ -1,33 +1,32 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Delayed Tasks Summary"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date"
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
 		},
 		{
-			"fieldname": "to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date"
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
 		},
 		{
-			"fieldname": "priority",
-			"label": __("Priority"),
-			"fieldtype": "Select",
-			"options": ["", "Low", "Medium", "High", "Urgent"]
+			fieldname: "priority",
+			label: __("Priority"),
+			fieldtype: "Select",
+			options: ["", "Low", "Medium", "High", "Urgent"],
 		},
 		{
-			"fieldname": "status",
-			"label": __("Status"),
-			"fieldtype": "Select",
-			"options": ["", "Open", "Working","Pending Review","Overdue","Completed"]
+			fieldname: "status",
+			label: __("Status"),
+			fieldtype: "Select",
+			options: ["", "Open", "Working", "Pending Review", "Overdue", "Completed"],
 		},
 	],
-	"formatter": function(value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 		if (column.id == "delay") {
 			if (data["delay"] > 0) {
@@ -36,6 +35,6 @@
 				value = `<p style="color: green; font-weight: bold">${value}</p>`;
 			}
 		}
-		return value
-	}
+		return value;
+	},
 };
diff --git a/erpnext/projects/report/project_summary/project_summary.js b/erpnext/projects/report/project_summary/project_summary.js
index 21dbfda..072098d 100644
--- a/erpnext/projects/report/project_summary/project_summary.js
+++ b/erpnext/projects/report/project_summary/project_summary.js
@@ -1,42 +1,41 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Project Summary"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname": "is_active",
-			"label": __("Is Active"),
-			"fieldtype": "Select",
-			"options": "\nYes\nNo",
-			"default": "Yes",
+			fieldname: "is_active",
+			label: __("Is Active"),
+			fieldtype: "Select",
+			options: "\nYes\nNo",
+			default: "Yes",
 		},
 		{
-			"fieldname": "status",
-			"label": __("Status"),
-			"fieldtype": "Select",
-			"options": "\nOpen\nCompleted\nCancelled",
-			"default": "Open"
+			fieldname: "status",
+			label: __("Status"),
+			fieldtype: "Select",
+			options: "\nOpen\nCompleted\nCancelled",
+			default: "Open",
 		},
 		{
-			"fieldname": "project_type",
-			"label": __("Project Type"),
-			"fieldtype": "Link",
-			"options": "Project Type"
+			fieldname: "project_type",
+			label: __("Project Type"),
+			fieldtype: "Link",
+			options: "Project Type",
 		},
 		{
-			"fieldname": "priority",
-			"label": __("Priority"),
-			"fieldtype": "Select",
-			"options": "\nLow\nMedium\nHigh"
-		}
-	]
+			fieldname: "priority",
+			label: __("Priority"),
+			fieldtype: "Select",
+			options: "\nLow\nMedium\nHigh",
+		},
+	],
 };
diff --git a/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.js b/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.js
index ccca264..dcadcc0 100644
--- a/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.js
+++ b/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.js
@@ -2,7 +2,5 @@
 // For license information, please see license.txt
 
 frappe.query_reports["Project wise Stock Tracking"] = {
-	"filters": [
-
-	]
-}
+	filters: [],
+};
diff --git a/erpnext/projects/report/timesheet_billing_summary/timesheet_billing_summary.js b/erpnext/projects/report/timesheet_billing_summary/timesheet_billing_summary.js
index 1efd0c6..2cd1cd9 100644
--- a/erpnext/projects/report/timesheet_billing_summary/timesheet_billing_summary.js
+++ b/erpnext/projects/report/timesheet_billing_summary/timesheet_billing_summary.js
@@ -27,21 +27,16 @@
 			fieldname: "from_date",
 			label: __("From Date"),
 			fieldtype: "Date",
-			default: frappe.datetime.add_months(
-				frappe.datetime.month_start(),
-				-1
-			),
+			default: frappe.datetime.add_months(frappe.datetime.month_start(), -1),
 		},
 		{
 			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
-			default: frappe.datetime.add_days(
-				frappe.datetime.month_start(),
-				-1
-			),
+			default: frappe.datetime.add_days(frappe.datetime.month_start(), -1),
 		},
-		{  // NOTE: `update_group_by_options` expects this filter to be the fifth in the list
+		{
+			// NOTE: `update_group_by_options` expects this filter to be the fifth in the list
 			fieldname: "group_by",
 			label: __("Group By"),
 			fieldtype: "Select",
diff --git a/erpnext/projects/web_form/tasks/tasks.js b/erpnext/projects/web_form/tasks/tasks.js
index ffc5e98..8f56ebb 100644
--- a/erpnext/projects/web_form/tasks/tasks.js
+++ b/erpnext/projects/web_form/tasks/tasks.js
@@ -1,3 +1,3 @@
-frappe.ready(function() {
+frappe.ready(function () {
 	// bind events here
-})
+});
diff --git a/erpnext/public/js/address.js b/erpnext/public/js/address.js
index 57f7163..606e0b1 100644
--- a/erpnext/public/js/address.js
+++ b/erpnext/public/js/address.js
@@ -2,24 +2,23 @@
 // For license information, please see license.txt
 
 frappe.ui.form.on("Address", {
-	is_your_company_address: function(frm) {
-		frm.clear_table('links');
-		if(frm.doc.is_your_company_address) {
-			frm.add_child('links', {
-				link_doctype: 'Company',
-				link_name: frappe.defaults.get_user_default('Company')
+	is_your_company_address: function (frm) {
+		frm.clear_table("links");
+		if (frm.doc.is_your_company_address) {
+			frm.add_child("links", {
+				link_doctype: "Company",
+				link_name: frappe.defaults.get_user_default("Company"),
 			});
-			frm.set_query('link_doctype', 'links', () => {
+			frm.set_query("link_doctype", "links", () => {
 				return {
 					filters: {
-						name: 'Company'
-					}
+						name: "Company",
+					},
 				};
 			});
-			frm.refresh_field('links');
+			frm.refresh_field("links");
+		} else {
+			frm.trigger("refresh");
 		}
-		else {
-			frm.trigger('refresh');
-		}
-	}
+	},
 });
diff --git a/erpnext/public/js/bank_reconciliation_tool/data_table_manager.js b/erpnext/public/js/bank_reconciliation_tool/data_table_manager.js
index 5e5742a..4aa087e 100644
--- a/erpnext/public/js/bank_reconciliation_tool/data_table_manager.js
+++ b/erpnext/public/js/bank_reconciliation_tool/data_table_manager.js
@@ -18,12 +18,11 @@
 	make_dt() {
 		var me = this;
 		frappe.call({
-			method:
-				"erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_bank_transactions",
+			method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_bank_transactions",
 			args: {
 				bank_account: this.bank_account,
 				from_date: this.bank_statement_from_date,
-				to_date: this.bank_statement_to_date
+				to_date: this.bank_statement_to_date,
 			},
 			callback: function (response) {
 				me.format_data(response.message);
@@ -62,18 +61,14 @@
 				editable: false,
 				width: 100,
 				format: (value) =>
-					"<span style='color:green;'>" +
-					format_currency(value, this.currency) +
-					"</span>",
+					"<span style='color:green;'>" + format_currency(value, this.currency) + "</span>",
 			},
 			{
 				name: __("Withdrawal"),
 				editable: false,
 				width: 100,
 				format: (value) =>
-					"<span style='color:red;'>" +
-					format_currency(value, this.currency) +
-					"</span>",
+					"<span style='color:red;'>" + format_currency(value, this.currency) + "</span>",
 			},
 			{
 				name: __("Unallocated Amount"),
@@ -117,13 +112,15 @@
 		return [
 			row["date"],
 			row["party_type"],
-			frappe.form.formatters.Link(row["party"], {options: row["party_type"]}),
+			frappe.form.formatters.Link(row["party"], { options: row["party_type"] }),
 			row["description"],
 			row["deposit"],
 			row["withdrawal"],
 			row["unallocated_amount"],
 			row["reference_number"],
-			`<button class="btn btn-primary btn-xs center" data-name="${row["name"]}">${__("Actions")}</button>`
+			`<button class="btn btn-primary btn-xs center" data-name="${row["name"]}">${__(
+				"Actions"
+			)}</button>`,
 		];
 	}
 
@@ -135,14 +132,8 @@
 			checkboxColumn: false,
 			inlineFilters: true,
 		};
-		this.datatable = new frappe.DataTable(
-			this.$reconciliation_tool_dt.get(0),
-			datatable_options
-		);
-		$(`.${this.datatable.style.scopeClass} .dt-scrollable`).css(
-			"max-height",
-			"calc(100vh - 400px)"
-		);
+		this.datatable = new frappe.DataTable(this.$reconciliation_tool_dt.get(0), datatable_options);
+		$(`.${this.datatable.style.scopeClass} .dt-scrollable`).css("max-height", "calc(100vh - 400px)");
 
 		if (this.transactions.length > 0) {
 			this.$reconciliation_tool_dt.show();
@@ -155,27 +146,18 @@
 
 	set_listeners() {
 		var me = this;
-		$(`.${this.datatable.style.scopeClass} .dt-scrollable`).on(
-			"click",
-			`.btn`,
-			function () {
-				me.dialog_manager.show_dialog(
-					$(this).attr("data-name"),
-					(bank_transaction) => me.update_dt_cards(bank_transaction)
-				);
-				return true;
-			}
-		);
+		$(`.${this.datatable.style.scopeClass} .dt-scrollable`).on("click", `.btn`, function () {
+			me.dialog_manager.show_dialog($(this).attr("data-name"), (bank_transaction) =>
+				me.update_dt_cards(bank_transaction)
+			);
+			return true;
+		});
 	}
 
 	update_dt_cards(bank_transaction) {
-		const transaction_index = this.transaction_dt_map[
-			bank_transaction.name
-		];
+		const transaction_index = this.transaction_dt_map[bank_transaction.name];
 		if (bank_transaction.unallocated_amount > 0) {
-			this.transactions[transaction_index] = this.format_row(
-				bank_transaction
-			);
+			this.transactions[transaction_index] = this.format_row(bank_transaction);
 		} else {
 			this.transactions.splice(transaction_index, 1);
 			for (const [k, v] of Object.entries(this.transaction_dt_map)) {
@@ -191,14 +173,9 @@
 
 		// this.make_dt();
 		this.get_cleared_balance().then(() => {
-			this.cards_manager.$cards[1].set_value(
-				format_currency(this.cleared_balance),
-				this.currency
-			);
+			this.cards_manager.$cards[1].set_value(format_currency(this.cleared_balance), this.currency);
 			this.cards_manager.$cards[2].set_value(
-				format_currency(
-					this.bank_statement_closing_balance - this.cleared_balance
-				),
+				format_currency(this.bank_statement_closing_balance - this.cleared_balance),
 				this.currency
 			);
 			this.cards_manager.$cards[2].set_value_color(
@@ -212,14 +189,12 @@
 	get_cleared_balance() {
 		if (this.bank_account && this.bank_statement_to_date) {
 			return frappe.call({
-				method:
-					"erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_account_balance",
+				method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_account_balance",
 				args: {
 					bank_account: this.bank_account,
 					till_date: this.bank_statement_to_date,
 				},
-				callback: (response) =>
-					(this.cleared_balance = response.message),
+				callback: (response) => (this.cleared_balance = response.message),
 			});
 		}
 	}
diff --git a/erpnext/public/js/bank_reconciliation_tool/dialog_manager.js b/erpnext/public/js/bank_reconciliation_tool/dialog_manager.js
index 1f47347..6ff38f9 100644
--- a/erpnext/public/js/bank_reconciliation_tool/dialog_manager.js
+++ b/erpnext/public/js/bank_reconciliation_tool/dialog_manager.js
@@ -1,7 +1,15 @@
 frappe.provide("erpnext.accounts.bank_reconciliation");
 
 erpnext.accounts.bank_reconciliation.DialogManager = class DialogManager {
-	constructor(company, bank_account, bank_statement_from_date, bank_statement_to_date, filter_by_reference_date, from_reference_date, to_reference_date) {
+	constructor(
+		company,
+		bank_account,
+		bank_statement_from_date,
+		bank_statement_to_date,
+		filter_by_reference_date,
+		from_reference_date,
+		to_reference_date
+	) {
 		this.bank_account = bank_account;
 		this.company = company;
 		this.make_dialog();
@@ -61,16 +69,15 @@
 
 	get_linked_vouchers(document_types) {
 		frappe.call({
-			method:
-				"erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_linked_payments",
+			method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_linked_payments",
 			args: {
 				bank_transaction_name: this.bank_transaction_name,
 				document_types: document_types,
 				from_date: this.bank_statement_from_date,
 				to_date: this.bank_statement_to_date,
 				filter_by_reference_date: this.filter_by_reference_date,
-				from_reference_date:this.from_reference_date,
-				to_reference_date:this.to_reference_date
+				from_reference_date: this.from_reference_date,
+				to_reference_date: this.to_reference_date,
 			},
 
 			callback: (result) => {
@@ -105,7 +112,7 @@
 				editable: false,
 				width: 1,
 				format: (value, row) => {
-					return frappe.form.formatters.Link(value, {options: row[2].content});
+					return frappe.form.formatters.Link(value, { options: row[2].content });
 				},
 			},
 			{
@@ -152,10 +159,7 @@
 				checkboxColumn: true,
 				inlineFilters: true,
 			};
-			this.datatable = new frappe.DataTable(
-				proposals_wrapper.get(0),
-				datatable_options
-			);
+			this.datatable = new frappe.DataTable(proposals_wrapper.get(0), datatable_options);
 		} else {
 			this.datatable.refresh(this.data, this.columns);
 			this.datatable.rowmanager.checkMap = [];
@@ -217,10 +221,9 @@
 					title: __("Reconcile the Bank Transaction"),
 					fields: fields,
 					size: "large",
-					primary_action: (values) =>
-						this.reconciliation_dialog_primary_action(values),
+					primary_action: (values) => this.reconciliation_dialog_primary_action(values),
 				});
-			}
+			},
 		});
 	}
 
@@ -255,7 +258,9 @@
 			{
 				fieldtype: "HTML",
 				fieldname: "no_matching_vouchers",
-				options: __("<div class=\"text-muted text-center\">{0}</div>", [__("No Matching Vouchers Found")])
+				options: __('<div class="text-muted text-center">{0}</div>', [
+					__("No Matching Vouchers Found"),
+				]),
 			},
 			{
 				fieldtype: "Section Break",
@@ -299,8 +304,7 @@
 				click: () => {
 					this.edit_in_full_page();
 				},
-				depends_on:
-					"eval:doc.action=='Create Voucher'",
+				depends_on: "eval:doc.action=='Create Voucher'",
 			},
 			{
 				fieldname: "column_break_7",
@@ -313,8 +317,7 @@
 				label: "Journal Entry Type",
 				options:
 					"Journal Entry\nInter Company Journal Entry\nBank Entry\nCash Entry\nCredit Card Entry\nDebit Note\nCredit Note\nContra Entry\nExcise Entry\nWrite Off Entry\nOpening Entry\nDepreciation Entry\nExchange Rate Revaluation\nDeferred Revenue\nDeferred Expense",
-				depends_on:
-					"eval:doc.action=='Create Voucher' &&  doc.document_type=='Journal Entry'",
+				depends_on: "eval:doc.action=='Create Voucher' &&  doc.document_type=='Journal Entry'",
 				mandatory_depends_on:
 					"eval:doc.action=='Create Voucher' &&  doc.document_type=='Journal Entry'",
 			},
@@ -323,8 +326,7 @@
 				fieldtype: "Link",
 				label: "Account",
 				options: "Account",
-				depends_on:
-					"eval:doc.action=='Create Voucher' &&  doc.document_type=='Journal Entry'",
+				depends_on: "eval:doc.action=='Create Voucher' &&  doc.document_type=='Journal Entry'",
 				mandatory_depends_on:
 					"eval:doc.action=='Create Voucher' &&  doc.document_type=='Journal Entry'",
 				get_query: () => {
@@ -342,14 +344,11 @@
 				label: "Party Type",
 				options: "DocType",
 				mandatory_depends_on:
-				"eval:doc.action=='Create Voucher' &&  doc.document_type=='Payment Entry'",
+					"eval:doc.action=='Create Voucher' &&  doc.document_type=='Payment Entry'",
 				get_query: function () {
 					return {
 						filters: {
-							name: [
-								"in",
-								Object.keys(frappe.boot.party_account_types),
-							],
+							name: ["in", Object.keys(frappe.boot.party_account_types)],
 						},
 					};
 				},
@@ -367,16 +366,14 @@
 				fieldtype: "Link",
 				label: "Project",
 				options: "Project",
-				depends_on:
-					"eval:doc.action=='Create Voucher' && doc.document_type=='Payment Entry'",
+				depends_on: "eval:doc.action=='Create Voucher' && doc.document_type=='Payment Entry'",
 			},
 			{
 				fieldname: "cost_center",
 				fieldtype: "Link",
 				label: "Cost Center",
 				options: "Cost Center",
-				depends_on:
-					"eval:doc.action=='Create Voucher' && doc.document_type=='Payment Entry'",
+				depends_on: "eval:doc.action=='Create Voucher' && doc.document_type=='Payment Entry'",
 			},
 			{
 				fieldtype: "Section Break",
@@ -435,7 +432,7 @@
 				options: "Currency",
 				read_only: 1,
 				hidden: 1,
-			}
+			},
 		];
 	}
 
@@ -457,18 +454,11 @@
 
 	reconciliation_dialog_primary_action(values) {
 		if (values.action == "Match Against Voucher") this.match(values);
-		if (
-			values.action == "Create Voucher" &&
-			values.document_type == "Payment Entry"
-		)
+		if (values.action == "Create Voucher" && values.document_type == "Payment Entry")
 			this.add_payment_entry(values);
-		if (
-			values.action == "Create Voucher" &&
-			values.document_type == "Journal Entry"
-		)
+		if (values.action == "Create Voucher" && values.document_type == "Journal Entry")
 			this.add_journal_entry(values);
-		else if (values.action == "Update Bank Transaction")
-			this.update_transaction(values);
+		else if (values.action == "Update Bank Transaction") this.update_transaction(values);
 	}
 
 	match() {
@@ -486,8 +476,7 @@
 			});
 		});
 		frappe.call({
-			method:
-				"erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.reconcile_vouchers",
+			method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.reconcile_vouchers",
 			args: {
 				bank_transaction_name: this.bank_transaction.name,
 				vouchers: vouchers,
@@ -503,8 +492,7 @@
 
 	add_payment_entry(values) {
 		frappe.call({
-			method:
-				"erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.create_payment_entry_bts",
+			method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.create_payment_entry_bts",
 			args: {
 				bank_transaction_name: this.bank_transaction.name,
 				reference_number: values.reference_number,
@@ -517,7 +505,9 @@
 				cost_center: values.cost_center,
 			},
 			callback: (response) => {
-				const alert_string = __("Bank Transaction {0} added as Payment Entry", [this.bank_transaction.name]);
+				const alert_string = __("Bank Transaction {0} added as Payment Entry", [
+					this.bank_transaction.name,
+				]);
 				frappe.show_alert(alert_string);
 				this.update_dt_cards(response.message);
 				this.dialog.hide();
@@ -527,8 +517,7 @@
 
 	add_journal_entry(values) {
 		frappe.call({
-			method:
-				"erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.create_journal_entry_bts",
+			method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.create_journal_entry_bts",
 			args: {
 				bank_transaction_name: this.bank_transaction.name,
 				reference_number: values.reference_number,
@@ -541,7 +530,9 @@
 				second_account: values.second_account,
 			},
 			callback: (response) => {
-				const alert_string = __("Bank Transaction {0} added as Journal Entry", [this.bank_transaction.name]);
+				const alert_string = __("Bank Transaction {0} added as Journal Entry", [
+					this.bank_transaction.name,
+				]);
 				frappe.show_alert(alert_string);
 				this.update_dt_cards(response.message);
 				this.dialog.hide();
@@ -551,8 +542,7 @@
 
 	update_transaction(values) {
 		frappe.call({
-			method:
-				"erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.update_bank_transaction",
+			method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.update_bank_transaction",
 			args: {
 				bank_transaction_name: this.bank_transaction.name,
 				reference_number: values.reference_number,
@@ -572,8 +562,7 @@
 		const values = this.dialog.get_values(true);
 		if (values.document_type == "Payment Entry") {
 			frappe.call({
-				method:
-					"erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.create_payment_entry_bts",
+				method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.create_payment_entry_bts",
 				args: {
 					bank_transaction_name: this.bank_transaction.name,
 					reference_number: values.reference_number,
@@ -584,7 +573,7 @@
 					mode_of_payment: values.mode_of_payment,
 					project: values.project,
 					cost_center: values.cost_center,
-					allow_edit: true
+					allow_edit: true,
 				},
 				callback: (r) => {
 					const doc = frappe.model.sync(r.message);
@@ -593,8 +582,7 @@
 			});
 		} else {
 			frappe.call({
-				method:
-					"erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.create_journal_entry_bts",
+				method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.create_journal_entry_bts",
 				args: {
 					bank_transaction_name: this.bank_transaction.name,
 					reference_number: values.reference_number,
@@ -605,7 +593,7 @@
 					mode_of_payment: values.mode_of_payment,
 					entry_type: values.journal_entry_type,
 					second_account: values.second_account,
-					allow_edit: true
+					allow_edit: true,
 				},
 				callback: (r) => {
 					var doc = frappe.model.sync(r.message);
@@ -614,5 +602,4 @@
 			});
 		}
 	}
-
 };
diff --git a/erpnext/public/js/bank_reconciliation_tool/number_card.js b/erpnext/public/js/bank_reconciliation_tool/number_card.js
index 7e1b269..d39884c 100644
--- a/erpnext/public/js/bank_reconciliation_tool/number_card.js
+++ b/erpnext/public/js/bank_reconciliation_tool/number_card.js
@@ -26,8 +26,7 @@
 				currency: this.currency,
 			},
 			{
-				value:
-					this.bank_statement_closing_balance - this.cleared_balance,
+				value: this.bank_statement_closing_balance - this.cleared_balance,
 				label: __("Difference"),
 				datatype: "Currency",
 				currency: this.currency,
@@ -41,11 +40,9 @@
 			number_card.$card.appendTo(this.$summary);
 		});
 		this.$cards[2].set_value_color(
-			this.bank_statement_closing_balance - this.cleared_balance == 0
-				? "text-success"
-				: "text-danger"
+			this.bank_statement_closing_balance - this.cleared_balance == 0 ? "text-success" : "text-danger"
 		);
-		this.$summary.css({"border-bottom": "0px", "margin-left": "0px", "margin-right": "0px"});
+		this.$summary.css({ "border-bottom": "0px", "margin-left": "0px", "margin-right": "0px" });
 		this.$summary.show();
 	}
 };
@@ -60,16 +57,10 @@
 	}
 
 	set_value_color(color) {
-		this.$card
-			.find("div")
-			.removeClass("text-danger text-success")
-			.addClass(`${color}`);
+		this.$card.find("div").removeClass("text-danger text-success").addClass(`${color}`);
 	}
 
 	set_indicator(color) {
-		this.$card
-			.find("span")
-			.removeClass("indicator red green")
-			.addClass(`indicator ${color}`);
+		this.$card.find("span").removeClass("indicator red green").addClass(`indicator ${color}`);
 	}
 };
diff --git a/erpnext/public/js/bom_configurator/bom_configurator.bundle.js b/erpnext/public/js/bom_configurator/bom_configurator.bundle.js
index 582b487..454a2a4 100644
--- a/erpnext/public/js/bom_configurator/bom_configurator.bundle.js
+++ b/erpnext/public/js/bom_configurator/bom_configurator.bundle.js
@@ -39,14 +39,14 @@
 			edit_qty: this.edit_qty,
 			load_tree: this.load_tree,
 			set_default_qty: this.set_default_qty,
-		}
+		};
 	}
 
 	tree_options() {
 		return {
 			parent: this.$wrapper.get(0),
 			body: this.$wrapper.get(0),
-			doctype: 'BOM Configurator',
+			doctype: "BOM Configurator",
 			page: this.page,
 			expandable: true,
 			title: __("Configure Product Assembly"),
@@ -59,7 +59,7 @@
 			extend_toolbar: false,
 			do_not_make_page: true,
 			do_not_setup_menu: true,
-		}
+		};
 	}
 
 	tree_methods() {
@@ -67,7 +67,7 @@
 		let view = frappe.views.trees["BOM Configurator"];
 
 		return {
-			onload: function(me) {
+			onload: function (me) {
 				me.args["parent_id"] = frm_obj.frm.doc.name;
 				me.args["parent"] = frm_obj.frm.doc.item_code;
 				me.parent = frm_obj.$wrapper.get(0);
@@ -103,126 +103,133 @@
 
 				`).insertBefore(node.$ul);
 			},
-			toolbar: this.frm?.doc.docstatus === 0 ? [
-				{
-					label:__(frappe.utils.icon('edit', 'sm') + " Qty"),
-					click: function(node) {
-						let view = frappe.views.trees["BOM Configurator"];
-						view.events.edit_qty(node, view);
-					},
-					btnClass: "hidden-xs"
-				},
-				{
-					label:__(frappe.utils.icon('add', 'sm') + " Raw Material"),
-					click: function(node) {
-						let view = frappe.views.trees["BOM Configurator"];
-						view.events.add_item(node, view);
-					},
-					condition: function(node) {
-						return node.expandable;
-					},
-					btnClass: "hidden-xs"
-				},
-				{
-					label:__(frappe.utils.icon('add', 'sm') + " Sub Assembly"),
-					click: function(node) {
-						let view = frappe.views.trees["BOM Configurator"];
-						view.events.add_sub_assembly(node, view);
-					},
-					condition: function(node) {
-						return node.expandable;
-					},
-					btnClass: "hidden-xs"
-				},
-				{
-					label:__("Expand All"),
-					click: function(node) {
-						let view = frappe.views.trees["BOM Configurator"];
+			toolbar:
+				this.frm?.doc.docstatus === 0
+					? [
+							{
+								label: __(frappe.utils.icon("edit", "sm") + " Qty"),
+								click: function (node) {
+									let view = frappe.views.trees["BOM Configurator"];
+									view.events.edit_qty(node, view);
+								},
+								btnClass: "hidden-xs",
+							},
+							{
+								label: __(frappe.utils.icon("add", "sm") + " Raw Material"),
+								click: function (node) {
+									let view = frappe.views.trees["BOM Configurator"];
+									view.events.add_item(node, view);
+								},
+								condition: function (node) {
+									return node.expandable;
+								},
+								btnClass: "hidden-xs",
+							},
+							{
+								label: __(frappe.utils.icon("add", "sm") + " Sub Assembly"),
+								click: function (node) {
+									let view = frappe.views.trees["BOM Configurator"];
+									view.events.add_sub_assembly(node, view);
+								},
+								condition: function (node) {
+									return node.expandable;
+								},
+								btnClass: "hidden-xs",
+							},
+							{
+								label: __("Expand All"),
+								click: function (node) {
+									let view = frappe.views.trees["BOM Configurator"];
 
-						if (!node.expanded) {
-							view.tree.load_children(node, true);
-							$(node.parent[0]).find(".tree-children").show();
-							node.$toolbar.find(".expand-all-btn").html("Collapse All");
-						} else {
-							node.$tree_link.trigger("click");
-							node.$toolbar.find(".expand-all-btn").html("Expand All");
-						}
-					},
-					condition: function(node) {
-						return node.expandable && node.is_root;
-					},
-					btnClass: "hidden-xs expand-all-btn"
-				},
-				{
-					label:__(frappe.utils.icon('move', 'sm') + " Sub Assembly"),
-					click: function(node) {
-						let view = frappe.views.trees["BOM Configurator"];
-						view.events.convert_to_sub_assembly(node, view);
-					},
-					condition: function(node) {
-						return !node.expandable;
-					},
-					btnClass: "hidden-xs"
-				},
-				{
-					label:__(frappe.utils.icon('delete', 'sm') + __(" Item")),
-					click: function(node) {
-						let view = frappe.views.trees["BOM Configurator"];
-						view.events.delete_node(node, view);
-					},
-					condition: function(node) {
-						return !node.is_root;
-					},
-					btnClass: "hidden-xs"
-				},
-			] : [{
-				label:__("Expand All"),
-				click: function(node) {
-					let view = frappe.views.trees["BOM Configurator"];
+									if (!node.expanded) {
+										view.tree.load_children(node, true);
+										$(node.parent[0]).find(".tree-children").show();
+										node.$toolbar.find(".expand-all-btn").html("Collapse All");
+									} else {
+										node.$tree_link.trigger("click");
+										node.$toolbar.find(".expand-all-btn").html("Expand All");
+									}
+								},
+								condition: function (node) {
+									return node.expandable && node.is_root;
+								},
+								btnClass: "hidden-xs expand-all-btn",
+							},
+							{
+								label: __(frappe.utils.icon("move", "sm") + " Sub Assembly"),
+								click: function (node) {
+									let view = frappe.views.trees["BOM Configurator"];
+									view.events.convert_to_sub_assembly(node, view);
+								},
+								condition: function (node) {
+									return !node.expandable;
+								},
+								btnClass: "hidden-xs",
+							},
+							{
+								label: __(frappe.utils.icon("delete", "sm") + __(" Item")),
+								click: function (node) {
+									let view = frappe.views.trees["BOM Configurator"];
+									view.events.delete_node(node, view);
+								},
+								condition: function (node) {
+									return !node.is_root;
+								},
+								btnClass: "hidden-xs",
+							},
+					  ]
+					: [
+							{
+								label: __("Expand All"),
+								click: function (node) {
+									let view = frappe.views.trees["BOM Configurator"];
 
-					if (!node.expanded) {
-						view.tree.load_children(node, true);
-						$(node.parent[0]).find(".tree-children").show();
-						node.$toolbar.find(".expand-all-btn").html("Collapse All");
-					} else {
-						node.$tree_link.trigger("click");
-						node.$toolbar.find(".expand-all-btn").html("Expand All");
-					}
-				},
-				condition: function(node) {
-					return node.expandable && node.is_root;
-				},
-				btnClass: "hidden-xs expand-all-btn"
-			}],
-		}
+									if (!node.expanded) {
+										view.tree.load_children(node, true);
+										$(node.parent[0]).find(".tree-children").show();
+										node.$toolbar.find(".expand-all-btn").html("Collapse All");
+									} else {
+										node.$tree_link.trigger("click");
+										node.$toolbar.find(".expand-all-btn").html("Expand All");
+									}
+								},
+								condition: function (node) {
+									return node.expandable && node.is_root;
+								},
+								btnClass: "hidden-xs expand-all-btn",
+							},
+					  ],
+		};
 	}
 
 	add_item(node, view) {
-		frappe.prompt([
-			{ label: __("Item"), fieldname: "item_code", fieldtype: "Link", options: "Item", reqd: 1 },
-			{ label: __("Qty"), fieldname: "qty", default: 1.0, fieldtype: "Float", reqd: 1 },
-		],
-		(data) => {
-			if (!node.data.parent_id) {
-				node.data.parent_id = this.frm.doc.name;
-			}
-
-			frappe.call({
-				method: "erpnext.manufacturing.doctype.bom_creator.bom_creator.add_item",
-				args: {
-					parent: node.data.parent_id,
-					fg_item: node.data.value,
-					item_code: data.item_code,
-					fg_reference_id: node.data.name || this.frm.doc.name,
-					qty: data.qty,
-				},
-				callback: (r) => {
-					view.events.load_tree(r, node);
+		frappe.prompt(
+			[
+				{ label: __("Item"), fieldname: "item_code", fieldtype: "Link", options: "Item", reqd: 1 },
+				{ label: __("Qty"), fieldname: "qty", default: 1.0, fieldtype: "Float", reqd: 1 },
+			],
+			(data) => {
+				if (!node.data.parent_id) {
+					node.data.parent_id = this.frm.doc.name;
 				}
-			});
-		},
-		__("Add Item"),
-		__("Add"));
+
+				frappe.call({
+					method: "erpnext.manufacturing.doctype.bom_creator.bom_creator.add_item",
+					args: {
+						parent: node.data.parent_id,
+						fg_item: node.data.value,
+						item_code: data.item_code,
+						fg_reference_id: node.data.name || this.frm.doc.name,
+						qty: data.qty,
+					},
+					callback: (r) => {
+						view.events.load_tree(r, node);
+					},
+				});
+			},
+			__("Add Item"),
+			__("Add")
+		);
 	}
 
 	add_sub_assembly(node, view) {
@@ -251,27 +258,58 @@
 				},
 				callback: (r) => {
 					view.events.load_tree(r, node);
-				}
+				},
 			});
 
 			dialog.hide();
 		});
-
 	}
 
-	get_sub_assembly_modal_fields(read_only=false) {
+	get_sub_assembly_modal_fields(read_only = false) {
 		return [
-			{ label: __("Sub Assembly Item"), fieldname: "item_code", fieldtype: "Link", options: "Item", reqd: 1, read_only: read_only },
-			{ fieldtype: "Column Break" },
-			{ label: __("Qty"), fieldname: "qty", default: 1.0, fieldtype: "Float", reqd: 1, read_only: read_only },
-			{ fieldtype: "Section Break" },
-			{ label: __("Raw Materials"), fieldname: "items", fieldtype: "Table", reqd: 1,
-				fields: [
-					{ label: __("Item"), fieldname: "item_code", fieldtype: "Link", options: "Item", reqd: 1, in_list_view: 1 },
-					{ label: __("Qty"), fieldname: "qty", default: 1.0, fieldtype: "Float", reqd: 1, in_list_view: 1 },
-				]
+			{
+				label: __("Sub Assembly Item"),
+				fieldname: "item_code",
+				fieldtype: "Link",
+				options: "Item",
+				reqd: 1,
+				read_only: read_only,
 			},
-		]
+			{ fieldtype: "Column Break" },
+			{
+				label: __("Qty"),
+				fieldname: "qty",
+				default: 1.0,
+				fieldtype: "Float",
+				reqd: 1,
+				read_only: read_only,
+			},
+			{ fieldtype: "Section Break" },
+			{
+				label: __("Raw Materials"),
+				fieldname: "items",
+				fieldtype: "Table",
+				reqd: 1,
+				fields: [
+					{
+						label: __("Item"),
+						fieldname: "item_code",
+						fieldtype: "Link",
+						options: "Item",
+						reqd: 1,
+						in_list_view: 1,
+					},
+					{
+						label: __("Qty"),
+						fieldname: "qty",
+						default: 1.0,
+						fieldtype: "Float",
+						reqd: 1,
+						in_list_view: 1,
+					},
+				],
+			},
+		];
 	}
 
 	convert_to_sub_assembly(node, view) {
@@ -303,7 +341,7 @@
 				callback: (r) => {
 					node.expandable = true;
 					view.events.load_tree(r, node);
-				}
+				},
 			});
 
 			dialog.hide();
@@ -313,12 +351,12 @@
 	set_default_qty(dialog) {
 		dialog.fields_dict.items.grid.fields_map.item_code.onchange = function (event) {
 			if (event) {
-				let name = $(event.currentTarget).closest('.grid-row').attr("data-name")
+				let name = $(event.currentTarget).closest(".grid-row").attr("data-name");
 				let item_row = dialog.fields_dict.items.grid.grid_rows_by_docname[name].doc;
 				item_row.qty = 1;
-				dialog.fields_dict.items.grid.refresh()
+				dialog.fields_dict.items.grid.refresh();
 			}
-		}
+		};
 	}
 
 	delete_node(node, view) {
@@ -333,38 +371,40 @@
 				},
 				callback: (r) => {
 					view.events.load_tree(r, node.parent_node);
-				}
+				},
 			});
 		});
 	}
 
 	edit_qty(node, view) {
 		let qty = node.data.qty || this.frm.doc.qty;
-		frappe.prompt([
-			{ label: __("Qty"), fieldname: "qty", default: qty, fieldtype: "Float", reqd: 1 },
-		],
-		(data) => {
-			let doctype = node.data.doctype || this.frm.doc.doctype;
-			let docname = node.data.name || this.frm.doc.name;
+		frappe.prompt(
+			[{ label: __("Qty"), fieldname: "qty", default: qty, fieldtype: "Float", reqd: 1 }],
+			(data) => {
+				let doctype = node.data.doctype || this.frm.doc.doctype;
+				let docname = node.data.name || this.frm.doc.name;
 
-			frappe.call({
-				method: "erpnext.manufacturing.doctype.bom_creator.bom_creator.edit_qty",
-				args: {
-					doctype: doctype,
-					docname: docname,
-					qty: data.qty,
-					parent: node.data.parent_id,
-				},
-				callback: (r) => {
-					node.data.qty = data.qty;
-					let uom = node.data.uom || this.frm.doc.uom;
-					$(node.parent.get(0)).find(`[data-bom-qty-docname='${docname}']`).html(data.qty + " " + uom);
-					view.events.load_tree(r, node);
-				}
-			});
-		},
-		__("Edit Qty"),
-		__("Update"));
+				frappe.call({
+					method: "erpnext.manufacturing.doctype.bom_creator.bom_creator.edit_qty",
+					args: {
+						doctype: doctype,
+						docname: docname,
+						qty: data.qty,
+						parent: node.data.parent_id,
+					},
+					callback: (r) => {
+						node.data.qty = data.qty;
+						let uom = node.data.uom || this.frm.doc.uom;
+						$(node.parent.get(0))
+							.find(`[data-bom-qty-docname='${docname}']`)
+							.html(data.qty + " " + uom);
+						view.events.load_tree(r, node);
+					},
+				});
+			},
+			__("Edit Qty"),
+			__("Update")
+		);
 	}
 
 	prepare_layout() {
@@ -378,35 +418,31 @@
 
 	load_tree(response, node) {
 		let item_row = "";
-		let parent_dom = ""
+		let parent_dom = "";
 		let total_amount = response.message.raw_material_cost;
 
 		frappe.views.trees["BOM Configurator"].tree.load_children(node);
 
 		while (node) {
-			item_row = response.message.items.filter(item => item.name === node.data.name);
+			item_row = response.message.items.filter((item) => item.name === node.data.name);
 
 			if (item_row?.length) {
 				node.data.amount = item_row[0].amount;
-				total_amount = node.data.amount
+				total_amount = node.data.amount;
 			} else {
 				total_amount = response.message.raw_material_cost;
 			}
 
 			parent_dom = $(node.parent.get(0));
-			total_amount = frappe.format(
-				total_amount, {
-					fieldtype: "Currency",
-					currency: this.frm.doc.currency
-				}
-			);
+			total_amount = frappe.format(total_amount, {
+				fieldtype: "Currency",
+				currency: this.frm.doc.currency,
+			});
 
 			$($(parent_dom).find(".fg-item-amt")[0]).html(total_amount);
 			node = node.parent_node;
-
 		}
-
 	}
 }
 
-frappe.ui.BOMConfigurator = BOMConfigurator;
\ No newline at end of file
+frappe.ui.BOMConfigurator = BOMConfigurator;
diff --git a/erpnext/public/js/bulk_transaction_processing.js b/erpnext/public/js/bulk_transaction_processing.js
index 3ae5a5d..e1906c4 100644
--- a/erpnext/public/js/bulk_transaction_processing.js
+++ b/erpnext/public/js/bulk_transaction_processing.js
@@ -1,30 +1,38 @@
 frappe.provide("erpnext.bulk_transaction_processing");
 
 $.extend(erpnext.bulk_transaction_processing, {
-	create: function(listview, from_doctype, to_doctype, args) {
+	create: function (listview, from_doctype, to_doctype, args) {
 		let checked_items = listview.get_checked_items();
 		const doc_name = [];
-		checked_items.forEach((Item)=> {
+		checked_items.forEach((Item) => {
 			if (Item.docstatus == 0) {
 				doc_name.push(Item.name);
 			}
 		});
 
 		let count_of_rows = checked_items.length;
-		frappe.confirm(__("Create {0} {1} ?", [count_of_rows, __(to_doctype)]), ()=>{
+		frappe.confirm(__("Create {0} {1} ?", [count_of_rows, __(to_doctype)]), () => {
 			if (doc_name.length == 0) {
-				frappe.call({
-					method: "erpnext.utilities.bulk_transaction.transaction_processing",
-					args: {data: checked_items, from_doctype: from_doctype, to_doctype: to_doctype, args: args}
-				}).then(()=> {
-
-				});
+				frappe
+					.call({
+						method: "erpnext.utilities.bulk_transaction.transaction_processing",
+						args: {
+							data: checked_items,
+							from_doctype: from_doctype,
+							to_doctype: to_doctype,
+							args: args,
+						},
+					})
+					.then(() => {});
 				if (count_of_rows > 10) {
-					frappe.show_alert("Starting a background job to create {0} {1}", [count_of_rows, __(to_doctype)]);
+					frappe.show_alert("Starting a background job to create {0} {1}", [
+						count_of_rows,
+						__(to_doctype),
+					]);
 				}
 			} else {
 				frappe.msgprint(__("Selected document must be in submitted state"));
 			}
 		});
-	}
+	},
 });
diff --git a/erpnext/public/js/call_popup/call_popup.js b/erpnext/public/js/call_popup/call_popup.js
index 2dbe999..7155c79 100644
--- a/erpnext/public/js/call_popup/call_popup.js
+++ b/erpnext/public/js/call_popup/call_popup.js
@@ -7,17 +7,17 @@
 	}
 
 	make() {
-		frappe.utils.play_sound('incoming-call');
+		frappe.utils.play_sound("incoming-call");
 		this.dialog = new frappe.ui.Dialog({
-			'static': true,
-			'minimizable': true
+			static: true,
+			minimizable: true,
 		});
 		this.dialog.get_close_btn().show();
 		this.setup_dialog();
 		this.set_call_status();
 		frappe.utils.bind_actions_with_object(this.dialog.$body, this);
-		this.dialog.$wrapper.addClass('call-popup');
-		this.dialog.get_close_btn().unbind('click').click(this.close_modal.bind(this));
+		this.dialog.$wrapper.addClass("call-popup");
+		this.dialog.get_close_btn().unbind("click").click(this.close_modal.bind(this));
 		this.dialog.show();
 	}
 
@@ -26,28 +26,28 @@
 		this.dialog.$body.empty().append(this.caller_info);
 	}
 
-	set_indicator(color, blink=false) {
-		let classes = `indicator ${color} ${blink ? 'blink': ''}`;
-		this.dialog.header.find('.indicator').attr('class', classes);
+	set_indicator(color, blink = false) {
+		let classes = `indicator ${color} ${blink ? "blink" : ""}`;
+		this.dialog.header.find(".indicator").attr("class", classes);
 	}
 
 	set_call_status(call_status) {
-		let title = '';
+		let title = "";
 		call_status = call_status || this.call_log.status;
-		if (['Ringing'].includes(call_status) || !call_status) {
-			title = __('Incoming call from {0}', [this.get_caller_name() || this.caller_number]);
-			this.set_indicator('blue', true);
-		} else if (call_status === 'In Progress') {
-			title = __('Call Connected');
-			this.set_indicator('green');
-		} else if (['No Answer', 'Missed'].includes(call_status)) {
-			this.set_indicator('yellow');
-			title = __('Call Missed');
-		} else if (['Completed', 'Busy', 'Failed'].includes(call_status)) {
-			this.set_indicator('red');
-			title = __('Call Ended');
+		if (["Ringing"].includes(call_status) || !call_status) {
+			title = __("Incoming call from {0}", [this.get_caller_name() || this.caller_number]);
+			this.set_indicator("blue", true);
+		} else if (call_status === "In Progress") {
+			title = __("Call Connected");
+			this.set_indicator("green");
+		} else if (["No Answer", "Missed"].includes(call_status)) {
+			this.set_indicator("yellow");
+			title = __("Call Missed");
+		} else if (["Completed", "Busy", "Failed"].includes(call_status)) {
+			this.set_indicator("red");
+			title = __("Call Ended");
 		} else {
-			this.set_indicator('blue');
+			this.set_indicator("blue");
 			title = call_status;
 		}
 		this.dialog.set_title(title);
@@ -55,7 +55,7 @@
 
 	update_call_log(call_log, missed) {
 		this.call_log = call_log;
-		this.set_call_status(missed ? 'Missed': null);
+		this.set_call_status(missed ? "Missed" : null);
 	}
 
 	close_modal() {
@@ -64,10 +64,10 @@
 	}
 
 	call_ended(call_log, missed) {
-		frappe.utils.play_sound('call-disconnect');
+		frappe.utils.play_sound("call-disconnect");
 		this.update_call_log(call_log, missed);
 		setTimeout(() => {
-			if (!this.dialog.get_value('call_summary')) {
+			if (!this.dialog.get_value("call_summary")) {
 				this.close_modal();
 			}
 		}, 60000);
@@ -81,16 +81,16 @@
 
 	get_contact_link() {
 		let log = this.call_log;
-		let contact_link = log.links.find(d => d.link_doctype === 'Contact');
+		let contact_link = log.links.find((d) => d.link_doctype === "Contact");
 		return contact_link || {};
 	}
 
 	setup_listener() {
-		frappe.realtime.on(`call_${this.call_log.id}_ended`, call_log => {
+		frappe.realtime.on(`call_${this.call_log.id}_ended`, (call_log) => {
 			this.call_ended(call_log);
 		});
 
-		frappe.realtime.on(`call_${this.call_log.id}_missed`, call_log => {
+		frappe.realtime.on(`call_${this.call_log.id}_missed`, (call_log) => {
 			this.call_ended(call_log, true);
 		});
 	}
@@ -103,84 +103,102 @@
 	setup_call_details() {
 		this.caller_info = $(`<div></div>`);
 		this.call_details = new frappe.ui.FieldGroup({
-			fields: [{
-				'fieldname': 'name',
-				'label': 'Name',
-				'default': this.get_caller_name() || __('Unknown Caller'),
-				'fieldtype': 'Data',
-				'read_only': 1
-			}, {
-				'fieldtype': 'Button',
-				'label': __('Open Contact'),
-				'click': () => frappe.set_route('Form', 'Contact', this.get_contact_link().link_name),
-				'depends_on': () => this.get_caller_name()
-			}, {
-				'fieldtype': 'Button',
-				'label': __('Create New Contact'),
-				'click': this.create_new_contact.bind(this),
-				'depends_on': () => !this.get_caller_name()
-			}, {
-				'fieldtype': 'Button',
-				'label': __('Create New Customer'),
-				'click': this.create_new_customer.bind(this),
-				'depends_on': () => !this.get_caller_name()
-			}, {
-				'fieldtype': 'Button',
-				'label': __('Create New Lead'),
-				'click': () => frappe.new_doc('Lead', { 'mobile_no': this.caller_number }),
-				'depends_on': () => !this.get_caller_name()
-			}, {
-				'fieldtype': 'Column Break',
-			}, {
-				'fieldname': 'number',
-				'label': 'Phone Number',
-				'fieldtype': 'Data',
-				'default': this.caller_number,
-				'read_only': 1
-			}, {
-				'fieldtype': 'Section Break',
-				'hide_border': 1,
-			}, {
-				'fieldname': 'call_type',
-				'label': 'Call Type',
-				'fieldtype': 'Link',
-				'options': 'Telephony Call Type',
-			}, {
-				'fieldtype': 'Section Break',
-				'hide_border': 1,
-			}, {
-				'fieldtype': 'Small Text',
-				'label': __('Call Summary'),
-				'fieldname': 'call_summary',
-			}, {
-				'fieldtype': 'Button',
-				'label': __('Save'),
-				'click': () => {
-					const call_summary = this.call_details.get_value('call_summary');
-					const call_type = this.call_details.get_value('call_type');
-					if (!call_summary) return;
-					frappe.xcall('erpnext.telephony.doctype.call_log.call_log.add_call_summary_and_call_type', {
-						'call_log': this.call_log.name,
-						'summary': call_summary,
-						'call_type': call_type,
-					}).then(() => {
-						this.close_modal();
-						frappe.show_alert({
-							message: `
-								${__('Call Summary Saved')}
+			fields: [
+				{
+					fieldname: "name",
+					label: "Name",
+					default: this.get_caller_name() || __("Unknown Caller"),
+					fieldtype: "Data",
+					read_only: 1,
+				},
+				{
+					fieldtype: "Button",
+					label: __("Open Contact"),
+					click: () => frappe.set_route("Form", "Contact", this.get_contact_link().link_name),
+					depends_on: () => this.get_caller_name(),
+				},
+				{
+					fieldtype: "Button",
+					label: __("Create New Contact"),
+					click: this.create_new_contact.bind(this),
+					depends_on: () => !this.get_caller_name(),
+				},
+				{
+					fieldtype: "Button",
+					label: __("Create New Customer"),
+					click: this.create_new_customer.bind(this),
+					depends_on: () => !this.get_caller_name(),
+				},
+				{
+					fieldtype: "Button",
+					label: __("Create New Lead"),
+					click: () => frappe.new_doc("Lead", { mobile_no: this.caller_number }),
+					depends_on: () => !this.get_caller_name(),
+				},
+				{
+					fieldtype: "Column Break",
+				},
+				{
+					fieldname: "number",
+					label: "Phone Number",
+					fieldtype: "Data",
+					default: this.caller_number,
+					read_only: 1,
+				},
+				{
+					fieldtype: "Section Break",
+					hide_border: 1,
+				},
+				{
+					fieldname: "call_type",
+					label: "Call Type",
+					fieldtype: "Link",
+					options: "Telephony Call Type",
+				},
+				{
+					fieldtype: "Section Break",
+					hide_border: 1,
+				},
+				{
+					fieldtype: "Small Text",
+					label: __("Call Summary"),
+					fieldname: "call_summary",
+				},
+				{
+					fieldtype: "Button",
+					label: __("Save"),
+					click: () => {
+						const call_summary = this.call_details.get_value("call_summary");
+						const call_type = this.call_details.get_value("call_type");
+						if (!call_summary) return;
+						frappe
+							.xcall(
+								"erpnext.telephony.doctype.call_log.call_log.add_call_summary_and_call_type",
+								{
+									call_log: this.call_log.name,
+									summary: call_summary,
+									call_type: call_type,
+								}
+							)
+							.then(() => {
+								this.close_modal();
+								frappe.show_alert({
+									message: `
+								${__("Call Summary Saved")}
 								<br>
 								<a
 									class="text-small text-muted"
 									href="/app/call-log/${this.call_log.name}">
-									${__('View call log')}
+									${__("View call log")}
 								</a>
 							`,
-							indicator: 'green'
-						});
-					});
-				}
-			}],
-			body: this.caller_info
+									indicator: "green",
+								});
+							});
+					},
+				},
+			],
+			body: this.caller_info,
 		});
 		this.call_details.make();
 	}
@@ -191,23 +209,23 @@
 
 	create_new_customer() {
 		// to avoid quick entry form
-		const new_customer = frappe.model.get_new_doc('Customer');
+		const new_customer = frappe.model.get_new_doc("Customer");
 		new_customer.mobile_no = this.caller_number;
-		frappe.set_route('Form', new_customer.doctype, new_customer.name);
+		frappe.set_route("Form", new_customer.doctype, new_customer.name);
 	}
 
 	create_new_contact() {
 		// TODO: fix new_doc, it should accept child table values
-		const new_contact = frappe.model.get_new_doc('Contact');
-		const phone_no = frappe.model.add_child(new_contact, 'Contact Phone', 'phone_nos');
+		const new_contact = frappe.model.get_new_doc("Contact");
+		const phone_no = frappe.model.add_child(new_contact, "Contact Phone", "phone_nos");
 		phone_no.phone = this.caller_number;
 		phone_no.is_primary_mobile_no = 1;
-		frappe.set_route('Form', new_contact.doctype, new_contact.name);
+		frappe.set_route("Form", new_contact.doctype, new_contact.name);
 	}
 }
 
-$(document).on('app_ready', function () {
-	frappe.realtime.on('show_call_popup', call_log => {
+$(document).on("app_ready", function () {
+	frappe.realtime.on("show_call_popup", (call_log) => {
 		let call_popup = erpnext.call_popup;
 		if (call_popup && call_log.name === call_popup.call_log.name) {
 			call_popup.update_call_log(call_log);
diff --git a/erpnext/public/js/communication.js b/erpnext/public/js/communication.js
index f205d88..d9187f8b 100644
--- a/erpnext/public/js/communication.js
+++ b/erpnext/public/js/communication.js
@@ -1,33 +1,45 @@
 frappe.ui.form.on("Communication", {
 	refresh: (frm) => {
 		// setup custom Make button only if Communication is Email
-		if(frm.doc.communication_medium == "Email" && frm.doc.sent_or_received == "Received") {
+		if (frm.doc.communication_medium == "Email" && frm.doc.sent_or_received == "Received") {
 			frm.events.setup_custom_buttons(frm);
 		}
 	},
 
 	setup_custom_buttons: (frm) => {
 		let confirm_msg = "Are you sure you want to create {0} from this email?";
-		if(frm.doc.reference_doctype !== "Issue") {
-			frm.add_custom_button(__("Issue"), () => {
-				frappe.confirm(__(confirm_msg, [__("Issue")]), () => {
-					frm.trigger('make_issue_from_communication');
-				})
-			}, __("Create"));
+		if (frm.doc.reference_doctype !== "Issue") {
+			frm.add_custom_button(
+				__("Issue"),
+				() => {
+					frappe.confirm(__(confirm_msg, [__("Issue")]), () => {
+						frm.trigger("make_issue_from_communication");
+					});
+				},
+				__("Create")
+			);
 		}
 
-		if(!in_list(["Lead", "Opportunity"], frm.doc.reference_doctype)) {
-			frm.add_custom_button(__("Lead"), () => {
-				frappe.confirm(__(confirm_msg, [__("Lead")]), () => {
-					frm.trigger('make_lead_from_communication');
-				})
-			}, __('Create'));
+		if (!in_list(["Lead", "Opportunity"], frm.doc.reference_doctype)) {
+			frm.add_custom_button(
+				__("Lead"),
+				() => {
+					frappe.confirm(__(confirm_msg, [__("Lead")]), () => {
+						frm.trigger("make_lead_from_communication");
+					});
+				},
+				__("Create")
+			);
 
-			frm.add_custom_button(__("Opportunity"), () => {
-				frappe.confirm(__(confirm_msg, [__("Opportunity")]), () => {
-					frm.trigger('make_opportunity_from_communication');
-				})
-			}, __('Create'));
+			frm.add_custom_button(
+				__("Opportunity"),
+				() => {
+					frappe.confirm(__(confirm_msg, [__("Opportunity")]), () => {
+						frm.trigger("make_opportunity_from_communication");
+					});
+				},
+				__("Create")
+			);
 		}
 	},
 
@@ -35,63 +47,69 @@
 		return frappe.call({
 			method: "erpnext.crm.doctype.lead.lead.make_lead_from_communication",
 			args: {
-				communication: frm.doc.name
+				communication: frm.doc.name,
 			},
 			freeze: true,
 			callback: (r) => {
-				if(r.message) {
-					frm.reload_doc()
+				if (r.message) {
+					frm.reload_doc();
 				}
-			}
-		})
+			},
+		});
 	},
 
 	make_issue_from_communication: (frm) => {
 		return frappe.call({
 			method: "erpnext.support.doctype.issue.issue.make_issue_from_communication",
 			args: {
-				communication: frm.doc.name
+				communication: frm.doc.name,
 			},
 			freeze: true,
 			callback: (r) => {
-				if(r.message) {
-					frm.reload_doc()
+				if (r.message) {
+					frm.reload_doc();
 				}
-			}
-		})
+			},
+		});
 	},
 
 	make_opportunity_from_communication: (frm) => {
-		const fields = [{
-			fieldtype: 'Link',
-			label: __('Select a Company'),
-			fieldname: 'company',
-			options: 'Company',
-			reqd: 1,
-			default: frappe.defaults.get_user_default("Company")
-		}];
+		const fields = [
+			{
+				fieldtype: "Link",
+				label: __("Select a Company"),
+				fieldname: "company",
+				options: "Company",
+				reqd: 1,
+				default: frappe.defaults.get_user_default("Company"),
+			},
+		];
 
-		frappe.prompt(fields, data => {
-			frappe.call({
-				method: "erpnext.crm.doctype.opportunity.opportunity.make_opportunity_from_communication",
-				args: {
-					communication: frm.doc.name,
-					company: data.company
-				},
-				freeze: true,
-				callback: (r) => {
-					if(r.message) {
-						frm.reload_doc();
-						frappe.show_alert({
-							message: __("Opportunity {0} created",
-								['<a href="/app/opportunity/'+r.message+'">' + r.message + '</a>']),
-							indicator: 'green'
-						});
-					}
-				}
-			});
-		},
-		'Create an Opportunity',
-		'Create');
-	}
+		frappe.prompt(
+			fields,
+			(data) => {
+				frappe.call({
+					method: "erpnext.crm.doctype.opportunity.opportunity.make_opportunity_from_communication",
+					args: {
+						communication: frm.doc.name,
+						company: data.company,
+					},
+					freeze: true,
+					callback: (r) => {
+						if (r.message) {
+							frm.reload_doc();
+							frappe.show_alert({
+								message: __("Opportunity {0} created", [
+									'<a href="/app/opportunity/' + r.message + '">' + r.message + "</a>",
+								]),
+								indicator: "green",
+							});
+						}
+					},
+				});
+			},
+			"Create an Opportunity",
+			"Create"
+		);
+	},
 });
diff --git a/erpnext/public/js/conf.js b/erpnext/public/js/conf.js
index a0f56a2..2e6e9ba 100644
--- a/erpnext/public/js/conf.js
+++ b/erpnext/public/js/conf.js
@@ -1,26 +1,26 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.provide('erpnext');
+frappe.provide("erpnext");
 
 // preferred modules for breadcrumbs
 $.extend(frappe.breadcrumbs.preferred, {
 	"Item Group": "Stock",
 	"Customer Group": "Selling",
 	"Supplier Group": "Buying",
-	"Territory": "Selling",
+	Territory: "Selling",
 	"Sales Person": "Selling",
 	"Sales Partner": "Selling",
-	"Brand": "Stock",
+	Brand: "Stock",
 	"Maintenance Schedule": "Support",
-	"Maintenance Visit": "Support"
+	"Maintenance Visit": "Support",
 });
 
 $.extend(frappe.breadcrumbs.module_map, {
-	'ERPNext Integrations': 'Integrations',
-	'Geo': 'Settings',
-	'Portal': 'Website',
-	'Utilities': 'Settings',
-	'E-commerce': 'Website',
-	'Contacts': 'CRM'
+	"ERPNext Integrations": "Integrations",
+	Geo: "Settings",
+	Portal: "Website",
+	Utilities: "Settings",
+	"E-commerce": "Website",
+	Contacts: "CRM",
 });
diff --git a/erpnext/public/js/contact.js b/erpnext/public/js/contact.js
index 41a0e8a..ecfc4ee 100644
--- a/erpnext/public/js/contact.js
+++ b/erpnext/public/js/contact.js
@@ -1,16 +1,14 @@
-
-
 frappe.ui.form.on("Contact", {
 	refresh(frm) {
-		frm.set_query('link_doctype', "links", function() {
+		frm.set_query("link_doctype", "links", function () {
 			return {
 				query: "frappe.contacts.address_and_contact.filter_dynamic_link_doctypes",
 				filters: {
 					fieldtype: ["in", ["HTML", "Text Editor"]],
 					fieldname: ["in", ["contact_html", "company_description"]],
-				}
+				},
 			};
 		});
 		frm.refresh_field("links");
-	}
+	},
 });
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index 7739110..f43e3e7 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -17,7 +17,7 @@
 
 			frappe.model.round_floats_in(item, ["rate", "price_list_rate"]);
 
-			if(item.price_list_rate) {
+			if(item.price_list_rate && !item.blanket_order_rate) {
 				if(item.rate > item.price_list_rate && has_margin_field) {
 					// if rate is greater than price_list_rate, set margin
 					// or set discount
diff --git a/erpnext/public/js/erpnext.bundle.js b/erpnext/public/js/erpnext.bundle.js
index b847e57..b75a21b 100644
--- a/erpnext/public/js/erpnext.bundle.js
+++ b/erpnext/public/js/erpnext.bundle.js
@@ -27,7 +27,7 @@
 import "./utils/crm_activities";
 import "./templates/crm_activities.html";
 import "./templates/crm_notes.html";
-import "./controllers/accounts.js"
+import "./controllers/accounts.js";
 import "./utils/landed_taxes_and_charges_common.js";
 import "./utils/sales_common.js";
 import "./controllers/buying.js";
diff --git a/erpnext/public/js/event.js b/erpnext/public/js/event.js
index 665c8fb..a673391 100644
--- a/erpnext/public/js/event.js
+++ b/erpnext/public/js/event.js
@@ -3,33 +3,53 @@
 frappe.provide("frappe.desk");
 
 frappe.ui.form.on("Event", {
-	refresh: function(frm) {
-		frm.set_query('reference_doctype', "event_participants", function() {
+	refresh: function (frm) {
+		frm.set_query("reference_doctype", "event_participants", function () {
 			return {
-				"filters": {
-					"name": ["in", ["Contact", "Lead", "Customer", "Supplier", "Employee", "Sales Partner"]]
-				}
+				filters: {
+					name: ["in", ["Contact", "Lead", "Customer", "Supplier", "Employee", "Sales Partner"]],
+				},
 			};
 		});
 
-		frm.add_custom_button(__('Add Leads'), function() {
-			new frappe.desk.eventParticipants(frm, "Lead");
-		}, __("Add Participants"));
+		frm.add_custom_button(
+			__("Add Leads"),
+			function () {
+				new frappe.desk.eventParticipants(frm, "Lead");
+			},
+			__("Add Participants")
+		);
 
-		frm.add_custom_button(__('Add Customers'), function() {
-			new frappe.desk.eventParticipants(frm, "Customer");
-		}, __("Add Participants"));
+		frm.add_custom_button(
+			__("Add Customers"),
+			function () {
+				new frappe.desk.eventParticipants(frm, "Customer");
+			},
+			__("Add Participants")
+		);
 
-		frm.add_custom_button(__('Add Suppliers'), function() {
-			new frappe.desk.eventParticipants(frm, "Supplier");
-		}, __("Add Participants"));
+		frm.add_custom_button(
+			__("Add Suppliers"),
+			function () {
+				new frappe.desk.eventParticipants(frm, "Supplier");
+			},
+			__("Add Participants")
+		);
 
-		frm.add_custom_button(__('Add Employees'), function() {
-			new frappe.desk.eventParticipants(frm, "Employee");
-		}, __("Add Participants"));
+		frm.add_custom_button(
+			__("Add Employees"),
+			function () {
+				new frappe.desk.eventParticipants(frm, "Employee");
+			},
+			__("Add Participants")
+		);
 
-		frm.add_custom_button(__('Add Sales Partners'), function() {
-			new frappe.desk.eventParticipants(frm, "Sales Partners");
-		}, __("Add Participants"));
-	}
+		frm.add_custom_button(
+			__("Add Sales Partners"),
+			function () {
+				new frappe.desk.eventParticipants(frm, "Sales Partners");
+			},
+			__("Add Participants")
+		);
+	},
 });
diff --git a/erpnext/public/js/financial_statements.js b/erpnext/public/js/financial_statements.js
index 43e58c2..bd8b70a 100644
--- a/erpnext/public/js/financial_statements.js
+++ b/erpnext/public/js/financial_statements.js
@@ -1,60 +1,58 @@
 frappe.provide("erpnext.financial_statements");
 
 erpnext.financial_statements = {
-	"filters": get_filters(),
-	"baseData": null,
-	"formatter": function(value, row, column, data, default_formatter, filter) {
-		if(frappe.query_report.get_filter_value("selected_view") == "Growth" && data && column.colIndex >= 3){
+	filters: get_filters(),
+	baseData: null,
+	formatter: function (value, row, column, data, default_formatter, filter) {
+		if (
+			frappe.query_report.get_filter_value("selected_view") == "Growth" &&
+			data &&
+			column.colIndex >= 3
+		) {
 			//Assuming that the first three columns are s.no, account name and the very first year of the accounting values, to calculate the relative percentage values of the successive columns.
 			const lastAnnualValue = row[column.colIndex - 1].content;
 			const currentAnnualvalue = data[column.fieldname];
-			if(currentAnnualvalue == undefined) return 'NA'; //making this not applicable for undefined/null values
+			if (currentAnnualvalue == undefined) return "NA"; //making this not applicable for undefined/null values
 			let annualGrowth = 0;
-			if(lastAnnualValue == 0 && currentAnnualvalue > 0){
+			if (lastAnnualValue == 0 && currentAnnualvalue > 0) {
 				//If the previous year value is 0 and the current value is greater than 0
 				annualGrowth = 1;
-			}
-			else if(lastAnnualValue > 0){
-				annualGrowth  = (currentAnnualvalue - lastAnnualValue) / lastAnnualValue;
+			} else if (lastAnnualValue > 0) {
+				annualGrowth = (currentAnnualvalue - lastAnnualValue) / lastAnnualValue;
 			}
 
-			const growthPercent = (Math.round(annualGrowth*10000)/100); //calculating the rounded off percentage
+			const growthPercent = Math.round(annualGrowth * 10000) / 100; //calculating the rounded off percentage
 
-			value = $(`<span>${((growthPercent >=0)? '+':'' )+growthPercent+'%'}</span>`);
-			if(growthPercent < 0){
+			value = $(`<span>${(growthPercent >= 0 ? "+" : "") + growthPercent + "%"}</span>`);
+			if (growthPercent < 0) {
 				value = $(value).addClass("text-danger");
-			}
-			else{
+			} else {
 				value = $(value).addClass("text-success");
 			}
 			value = $(value).wrap("<p></p>").parent().html();
 
 			return value;
-		}
-		else if(frappe.query_report.get_filter_value("selected_view") == "Margin" && data){
-			if(column.fieldname =="account" && data.account_name == __("Income")){
+		} else if (frappe.query_report.get_filter_value("selected_view") == "Margin" && data) {
+			if (column.fieldname == "account" && data.account_name == __("Income")) {
 				//Taking the total income from each column (for all the financial years) as the base (100%)
 				this.baseData = row;
 			}
-			if(column.colIndex >= 2){
+			if (column.colIndex >= 2) {
 				//Assuming that the first two columns are s.no and account name, to calculate the relative percentage values of the successive columns.
 				const currentAnnualvalue = data[column.fieldname];
 				const baseValue = this.baseData[column.colIndex].content;
-				if(currentAnnualvalue == undefined || baseValue <= 0) return 'NA';
-				const marginPercent = Math.round((currentAnnualvalue/baseValue)*10000)/100;
+				if (currentAnnualvalue == undefined || baseValue <= 0) return "NA";
+				const marginPercent = Math.round((currentAnnualvalue / baseValue) * 10000) / 100;
 
-				value = $(`<span>${marginPercent+'%'}</span>`);
-				if(marginPercent < 0)
-					value = $(value).addClass("text-danger");
-				else
-					value = $(value).addClass("text-success");
+				value = $(`<span>${marginPercent + "%"}</span>`);
+				if (marginPercent < 0) value = $(value).addClass("text-danger");
+				else value = $(value).addClass("text-success");
 				value = $(value).wrap("<p></p>").parent().html();
 				return value;
 			}
-
 		}
 
-		if (data && column.fieldname=="account") {
+		if (data && column.fieldname == "account") {
 			value = data.account_name || value;
 
 			if (filter && filter?.text && filter?.type == "contains") {
@@ -85,16 +83,18 @@
 
 		return value;
 	},
-	"open_general_ledger": function(data) {
+	open_general_ledger: function (data) {
 		if (!data.account) return;
-		let project = $.grep(frappe.query_report.filters, function(e){ return e.df.fieldname == 'project'; });
+		let project = $.grep(frappe.query_report.filters, function (e) {
+			return e.df.fieldname == "project";
+		});
 
 		frappe.route_options = {
-			"account": data.account,
-			"company": frappe.query_report.get_filter_value('company'),
-			"from_date": data.from_date || data.year_start_date,
-			"to_date": data.to_date || data.year_end_date,
-			"project": (project && project.length > 0) ? project[0].$input.val() : ""
+			account: data.account,
+			company: frappe.query_report.get_filter_value("company"),
+			from_date: data.from_date || data.year_start_date,
+			to_date: data.to_date || data.year_end_date,
+			project: project && project.length > 0 ? project[0].$input.val() : "",
 		};
 
 		let report = "General Ledger";
@@ -107,159 +107,172 @@
 
 		frappe.set_route("query-report", report);
 	},
-	"tree": true,
-	"name_field": "account",
-	"parent_field": "parent_account",
-	"initial_depth": 3,
-	onload: function(report) {
+	tree: true,
+	name_field: "account",
+	parent_field: "parent_account",
+	initial_depth: 3,
+	onload: function (report) {
 		// dropdown for links to other financial statements
-		erpnext.financial_statements.filters = get_filters()
+		erpnext.financial_statements.filters = get_filters();
 
 		let fiscal_year = erpnext.utils.get_fiscal_year(frappe.datetime.get_today());
 
-		frappe.model.with_doc("Fiscal Year", fiscal_year, function(r) {
+		frappe.model.with_doc("Fiscal Year", fiscal_year, function (r) {
 			var fy = frappe.model.get_doc("Fiscal Year", fiscal_year);
 			frappe.query_report.set_filter_value({
 				period_start_date: fy.year_start_date,
-				period_end_date: fy.year_end_date
+				period_end_date: fy.year_end_date,
 			});
 		});
 
-		if (report.page){
-			const views_menu = report.page.add_custom_button_group(__('Financial Statements'));
+		if (report.page) {
+			const views_menu = report.page.add_custom_button_group(__("Financial Statements"));
 
-			report.page.add_custom_menu_item(views_menu, __("Balance Sheet"), function() {
+			report.page.add_custom_menu_item(views_menu, __("Balance Sheet"), function () {
 				var filters = report.get_values();
-				frappe.set_route('query-report', 'Balance Sheet', {company: filters.company});
+				frappe.set_route("query-report", "Balance Sheet", { company: filters.company });
 			});
 
-			report.page.add_custom_menu_item(views_menu, __("Profit and Loss"), function() {
+			report.page.add_custom_menu_item(views_menu, __("Profit and Loss"), function () {
 				var filters = report.get_values();
-				frappe.set_route('query-report', 'Profit and Loss Statement', {company: filters.company});
+				frappe.set_route("query-report", "Profit and Loss Statement", { company: filters.company });
 			});
 
-			report.page.add_custom_menu_item(views_menu, __("Cash Flow Statement"), function() {
+			report.page.add_custom_menu_item(views_menu, __("Cash Flow Statement"), function () {
 				var filters = report.get_values();
-				frappe.set_route('query-report', 'Cash Flow', {company: filters.company});
+				frappe.set_route("query-report", "Cash Flow", { company: filters.company });
 			});
 		}
-	}
+	},
 };
 
 function get_filters() {
 	let filters = [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname":"finance_book",
-			"label": __("Finance Book"),
-			"fieldtype": "Link",
-			"options": "Finance Book"
+			fieldname: "finance_book",
+			label: __("Finance Book"),
+			fieldtype: "Link",
+			options: "Finance Book",
 		},
 		{
-			"fieldname":"filter_based_on",
-			"label": __("Filter Based On"),
-			"fieldtype": "Select",
-			"options": ["Fiscal Year", "Date Range"],
-			"default": ["Fiscal Year"],
-			"reqd": 1,
-			on_change: function() {
-				let filter_based_on = frappe.query_report.get_filter_value('filter_based_on');
-				frappe.query_report.toggle_filter_display('from_fiscal_year', filter_based_on === 'Date Range');
-				frappe.query_report.toggle_filter_display('to_fiscal_year', filter_based_on === 'Date Range');
-				frappe.query_report.toggle_filter_display('period_start_date', filter_based_on === 'Fiscal Year');
-				frappe.query_report.toggle_filter_display('period_end_date', filter_based_on === 'Fiscal Year');
+			fieldname: "filter_based_on",
+			label: __("Filter Based On"),
+			fieldtype: "Select",
+			options: ["Fiscal Year", "Date Range"],
+			default: ["Fiscal Year"],
+			reqd: 1,
+			on_change: function () {
+				let filter_based_on = frappe.query_report.get_filter_value("filter_based_on");
+				frappe.query_report.toggle_filter_display(
+					"from_fiscal_year",
+					filter_based_on === "Date Range"
+				);
+				frappe.query_report.toggle_filter_display("to_fiscal_year", filter_based_on === "Date Range");
+				frappe.query_report.toggle_filter_display(
+					"period_start_date",
+					filter_based_on === "Fiscal Year"
+				);
+				frappe.query_report.toggle_filter_display(
+					"period_end_date",
+					filter_based_on === "Fiscal Year"
+				);
 
 				frappe.query_report.refresh();
-			}
+			},
 		},
 		{
-			"fieldname":"period_start_date",
-			"label": __("Start Date"),
-			"fieldtype": "Date",
-			"reqd": 1,
-			"depends_on": "eval:doc.filter_based_on == 'Date Range'"
+			fieldname: "period_start_date",
+			label: __("Start Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			depends_on: "eval:doc.filter_based_on == 'Date Range'",
 		},
 		{
-			"fieldname":"period_end_date",
-			"label": __("End Date"),
-			"fieldtype": "Date",
-			"reqd": 1,
-			"depends_on": "eval:doc.filter_based_on == 'Date Range'"
+			fieldname: "period_end_date",
+			label: __("End Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			depends_on: "eval:doc.filter_based_on == 'Date Range'",
 		},
 		{
-			"fieldname":"from_fiscal_year",
-			"label": __("Start Year"),
-			"fieldtype": "Link",
-			"options": "Fiscal Year",
-			"reqd": 1,
-			"depends_on": "eval:doc.filter_based_on == 'Fiscal Year'"
+			fieldname: "from_fiscal_year",
+			label: __("Start Year"),
+			fieldtype: "Link",
+			options: "Fiscal Year",
+			reqd: 1,
+			depends_on: "eval:doc.filter_based_on == 'Fiscal Year'",
 		},
 		{
-			"fieldname":"to_fiscal_year",
-			"label": __("End Year"),
-			"fieldtype": "Link",
-			"options": "Fiscal Year",
-			"reqd": 1,
-			"depends_on": "eval:doc.filter_based_on == 'Fiscal Year'"
+			fieldname: "to_fiscal_year",
+			label: __("End Year"),
+			fieldtype: "Link",
+			options: "Fiscal Year",
+			reqd: 1,
+			depends_on: "eval:doc.filter_based_on == 'Fiscal Year'",
 		},
 		{
-			"fieldname": "periodicity",
-			"label": __("Periodicity"),
-			"fieldtype": "Select",
-			"options": [
-				{ "value": "Monthly", "label": __("Monthly") },
-				{ "value": "Quarterly", "label": __("Quarterly") },
-				{ "value": "Half-Yearly", "label": __("Half-Yearly") },
-				{ "value": "Yearly", "label": __("Yearly") }
+			fieldname: "periodicity",
+			label: __("Periodicity"),
+			fieldtype: "Select",
+			options: [
+				{ value: "Monthly", label: __("Monthly") },
+				{ value: "Quarterly", label: __("Quarterly") },
+				{ value: "Half-Yearly", label: __("Half-Yearly") },
+				{ value: "Yearly", label: __("Yearly") },
 			],
-			"default": "Yearly",
-			"reqd": 1
+			default: "Yearly",
+			reqd: 1,
 		},
 		// Note:
 		// If you are modifying this array such that the presentation_currency object
 		// is no longer the last object, please make adjustments in cash_flow.js
 		// accordingly.
 		{
-			"fieldname": "presentation_currency",
-			"label": __("Currency"),
-			"fieldtype": "Select",
-			"options": erpnext.get_presentation_currency_list()
+			fieldname: "presentation_currency",
+			label: __("Currency"),
+			fieldtype: "Select",
+			options: erpnext.get_presentation_currency_list(),
 		},
 		{
-			"fieldname": "cost_center",
-			"label": __("Cost Center"),
-			"fieldtype": "MultiSelectList",
-			get_data: function(txt) {
-				return frappe.db.get_link_options('Cost Center', txt, {
-					company: frappe.query_report.get_filter_value("company")
-				});
-			}
-		},
-		{
-			"fieldname": "project",
-			"label": __("Project"),
-			"fieldtype": "MultiSelectList",
-			get_data: function(txt) {
-				return frappe.db.get_link_options('Project', txt, {
-					company: frappe.query_report.get_filter_value("company")
+			fieldname: "cost_center",
+			label: __("Cost Center"),
+			fieldtype: "MultiSelectList",
+			get_data: function (txt) {
+				return frappe.db.get_link_options("Cost Center", txt, {
+					company: frappe.query_report.get_filter_value("company"),
 				});
 			},
-		}
-	]
+		},
+		{
+			fieldname: "project",
+			label: __("Project"),
+			fieldtype: "MultiSelectList",
+			get_data: function (txt) {
+				return frappe.db.get_link_options("Project", txt, {
+					company: frappe.query_report.get_filter_value("company"),
+				});
+			},
+		},
+	];
 
 	// Dynamically set 'default' values for fiscal year filters
-	let fy_filters = filters.filter(x=>{return ["from_fiscal_year", "to_fiscal_year"].includes(x.fieldname);})
+	let fy_filters = filters.filter((x) => {
+		return ["from_fiscal_year", "to_fiscal_year"].includes(x.fieldname);
+	});
 	let fiscal_year = erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), false, true);
 	if (fiscal_year) {
 		let fy = erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), false, false);
-		fy_filters.forEach(x=>{x.default = fy;})
+		fy_filters.forEach((x) => {
+			x.default = fy;
+		});
 	}
 
 	return filters;
diff --git a/erpnext/public/js/help_links.js b/erpnext/public/js/help_links.js
index 6742761..f9dbea9 100644
--- a/erpnext/public/js/help_links.js
+++ b/erpnext/public/js/help_links.js
@@ -332,13 +332,9 @@
 
 //Buying
 
-frappe.help.help_links["List/Supplier"] = [
-	{ label: "Supplier", url: docsUrl + "user/manual/en/supplier" },
-];
+frappe.help.help_links["List/Supplier"] = [{ label: "Supplier", url: docsUrl + "user/manual/en/supplier" }];
 
-frappe.help.help_links["Form/Supplier"] = [
-	{ label: "Supplier", url: docsUrl + "user/manual/en/supplier" },
-];
+frappe.help.help_links["Form/Supplier"] = [{ label: "Supplier", url: docsUrl + "user/manual/en/supplier" }];
 
 frappe.help.help_links["Form/Request for Quotation"] = [
 	{
@@ -441,9 +437,7 @@
 	},
 ];
 
-frappe.help.help_links["List/Workflow"] = [
-	{ label: "Workflow", url: docsUrl + "user/manual/en/workflows" },
-];
+frappe.help.help_links["List/Workflow"] = [{ label: "Workflow", url: docsUrl + "user/manual/en/workflows" }];
 
 frappe.help.help_links["List/Company"] = [
 	{
@@ -620,9 +614,7 @@
 	},
 	{
 		label: "Item Valuation",
-		url:
-			docsUrl +
-			"user/manual/en/calculation-of-valuation-rate-in-fifo-and-moving-average",
+		url: docsUrl + "user/manual/en/calculation-of-valuation-rate-in-fifo-and-moving-average",
 	},
 ];
 
@@ -706,9 +698,7 @@
 	},
 ];
 
-frappe.help.help_links["List/Budget"] = [
-	{ label: "Budgeting", url: docsUrl + "user/manual/en/budgeting" },
-];
+frappe.help.help_links["List/Budget"] = [{ label: "Budgeting", url: docsUrl + "user/manual/en/budgeting" }];
 
 frappe.help.help_links["List/Material Request"] = [
 	{
@@ -768,13 +758,9 @@
 	{ label: "Serial No", url: docsUrl + "user/manual/en/serial-no" },
 ];
 
-frappe.help.help_links["List/Batch"] = [
-	{ label: "Batch", url: docsUrl + "user/manual/en/batch" },
-];
+frappe.help.help_links["List/Batch"] = [{ label: "Batch", url: docsUrl + "user/manual/en/batch" }];
 
-frappe.help.help_links["Form/Batch"] = [
-	{ label: "Batch", url: docsUrl + "user/manual/en/batch" },
-];
+frappe.help.help_links["Form/Batch"] = [{ label: "Batch", url: docsUrl + "user/manual/en/batch" }];
 
 frappe.help.help_links["Form/Packing Slip"] = [
 	{
@@ -827,29 +813,21 @@
 
 //CRM
 
-frappe.help.help_links["Form/Lead"] = [
-	{ label: "Lead", url: docsUrl + "user/manual/en/lead" },
-];
+frappe.help.help_links["Form/Lead"] = [{ label: "Lead", url: docsUrl + "user/manual/en/lead" }];
 
 frappe.help.help_links["Form/Opportunity"] = [
 	{ label: "Opportunity", url: docsUrl + "user/manual/en/opportunity" },
 ];
 
-frappe.help.help_links["Form/Address"] = [
-	{ label: "Address", url: docsUrl + "user/manual/en/address" },
-];
+frappe.help.help_links["Form/Address"] = [{ label: "Address", url: docsUrl + "user/manual/en/address" }];
 
-frappe.help.help_links["Form/Contact"] = [
-	{ label: "Contact", url: docsUrl + "user/manual/en/contact" },
-];
+frappe.help.help_links["Form/Contact"] = [{ label: "Contact", url: docsUrl + "user/manual/en/contact" }];
 
 frappe.help.help_links["Form/Newsletter"] = [
 	{ label: "Newsletter", url: docsUrl + "user/manual/en/newsletter" },
 ];
 
-frappe.help.help_links["Form/Campaign"] = [
-	{ label: "Campaign", url: docsUrl + "user/manual/en/campaign" },
-];
+frappe.help.help_links["Form/Campaign"] = [{ label: "Campaign", url: docsUrl + "user/manual/en/campaign" }];
 
 frappe.help.help_links["Tree/Sales Person"] = [
 	{
diff --git a/erpnext/public/js/newsletter.js b/erpnext/public/js/newsletter.js
index 3a4dbf8..96c65de 100644
--- a/erpnext/public/js/newsletter.js
+++ b/erpnext/public/js/newsletter.js
@@ -1,8 +1,8 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.ui.form.on('Newsletter', {
+frappe.ui.form.on("Newsletter", {
 	refresh() {
 		erpnext.toggle_naming_series();
-	}
+	},
 });
diff --git a/erpnext/public/js/payment/payments.js b/erpnext/public/js/payment/payments.js
index 4c23669..0e58420 100644
--- a/erpnext/public/js/payment/payments.js
+++ b/erpnext/public/js/payment/payments.js
@@ -6,7 +6,7 @@
 		var me = this;
 
 		this.dialog = new frappe.ui.Dialog({
-			title: 'Payment'
+			title: "Payment",
 		});
 
 		this.dialog.show();
@@ -17,15 +17,17 @@
 	}
 
 	select_text() {
-		$(this.$body).find('.form-control').click(function() {
-			$(this).select();
-		});
+		$(this.$body)
+			.find(".form-control")
+			.click(function () {
+				$(this).select();
+			});
 	}
 
 	set_payment_primary_action() {
 		var me = this;
 
-		this.dialog.set_primary_action(__("Submit"), function() {
+		this.dialog.set_primary_action(__("Submit"), function () {
 			// Allow no ZERO payment
 			$.each(me.frm.doc.payments, function (index, data) {
 				if (data.amount != 0) {
@@ -34,131 +36,147 @@
 					return;
 				}
 			});
-		})
+		});
 	}
 
-	make_keyboard(){
+	make_keyboard() {
 		var me = this;
 		$(this.$body).empty();
-		$(this.$body).html(frappe.render_template('pos_payment', this.frm.doc))
+		$(this.$body).html(frappe.render_template("pos_payment", this.frm.doc));
 		this.show_payment_details();
-		this.bind_keyboard_event()
-		this.clear_amount()
+		this.bind_keyboard_event();
+		this.clear_amount();
 	}
 
-	make_multimode_payment(){
+	make_multimode_payment() {
 		var me = this;
 
 		if (this.frm.doc.change_amount > 0) {
 			me.payment_val = me.doc.outstanding_amount;
 		}
 
-		this.payments = frappe.model.add_child(this.frm.doc, 'Multi Mode Payment', "payments");
+		this.payments = frappe.model.add_child(this.frm.doc, "Multi Mode Payment", "payments");
 		this.payments.mode_of_payment = this.dialog.fields_dict.mode_of_payment.get_value();
 		this.payments.amount = flt(this.payment_val);
 	}
 
-	show_payment_details(){
+	show_payment_details() {
 		var me = this;
-		var multimode_payments = $(this.$body).find('.multimode-payments').empty();
+		var multimode_payments = $(this.$body).find(".multimode-payments").empty();
 		if (this.frm.doc.payments.length) {
-			$.each(this.frm.doc.payments, function(index, data) {
-				$(frappe.render_template('payment_details', {
-					mode_of_payment: data.mode_of_payment,
-					amount: data.amount,
-					idx: data.idx,
-					currency: me.frm.doc.currency,
-					type: data.type
-				})).appendTo(multimode_payments)
+			$.each(this.frm.doc.payments, function (index, data) {
+				$(
+					frappe.render_template("payment_details", {
+						mode_of_payment: data.mode_of_payment,
+						amount: data.amount,
+						idx: data.idx,
+						currency: me.frm.doc.currency,
+						type: data.type,
+					})
+				).appendTo(multimode_payments);
 
-				if (data.type == 'Cash' && data.amount == me.frm.doc.paid_amount) {
+				if (data.type == "Cash" && data.amount == me.frm.doc.paid_amount) {
 					me.idx = data.idx;
-					me.selected_mode = $(me.$body).find(repl("input[idx='%(idx)s']",{'idx': me.idx}));
+					me.selected_mode = $(me.$body).find(repl("input[idx='%(idx)s']", { idx: me.idx }));
 					me.highlight_selected_row();
 					me.bind_amount_change_event();
 				}
-			})
-		}else{
-			$("<p>No payment mode selected in pos profile</p>").appendTo(multimode_payments)
+			});
+		} else {
+			$("<p>No payment mode selected in pos profile</p>").appendTo(multimode_payments);
 		}
 	}
 
-	set_outstanding_amount(){
-		this.selected_mode = $(this.$body).find(repl("input[idx='%(idx)s']",{'idx': this.idx}));
+	set_outstanding_amount() {
+		this.selected_mode = $(this.$body).find(repl("input[idx='%(idx)s']", { idx: this.idx }));
 		this.highlight_selected_row();
 		this.payment_val = 0.0;
 		if (this.frm.doc.outstanding_amount > 0 && flt(this.selected_mode.val()) == 0.0) {
 			//When user first time click on row
-			this.payment_val = flt(this.frm.doc.outstanding_amount / this.frm.doc.conversion_rate, precision("outstanding_amount"))
+			this.payment_val = flt(
+				this.frm.doc.outstanding_amount / this.frm.doc.conversion_rate,
+				precision("outstanding_amount")
+			);
 			this.selected_mode.val(format_currency(this.payment_val, this.frm.doc.currency));
 			this.update_payment_amount();
 		} else if (flt(this.selected_mode.val()) > 0) {
 			//If user click on existing row which has value
 			this.payment_val = flt(this.selected_mode.val());
 		}
-		this.selected_mode.select()
+		this.selected_mode.select();
 		this.bind_amount_change_event();
 	}
 
-	bind_keyboard_event(){
+	bind_keyboard_event() {
 		var me = this;
-		this.payment_val = '';
+		this.payment_val = "";
 		this.bind_form_control_event();
 		this.bind_numeric_keys_event();
 	}
 
 	bind_form_control_event() {
 		var me = this;
-		$(this.$body).find('.pos-payment-row').click(function() {
-			me.idx = $(this).attr("idx");
-			me.set_outstanding_amount();
-		});
+		$(this.$body)
+			.find(".pos-payment-row")
+			.click(function () {
+				me.idx = $(this).attr("idx");
+				me.set_outstanding_amount();
+			});
 
-		$(this.$body).find('.form-control').click(function() {
-			me.idx = $(this).attr("idx");
-			me.set_outstanding_amount();
-			me.update_paid_amount(true);
-		});
+		$(this.$body)
+			.find(".form-control")
+			.click(function () {
+				me.idx = $(this).attr("idx");
+				me.set_outstanding_amount();
+				me.update_paid_amount(true);
+			});
 
-		$(this.$body).find('.write_off_amount').change(function() {
-			me.write_off_amount(flt($(this).val()), precision("write_off_amount"));
-		});
+		$(this.$body)
+			.find(".write_off_amount")
+			.change(function () {
+				me.write_off_amount(flt($(this).val()), precision("write_off_amount"));
+			});
 
-		$(this.$body).find('.change_amount').change(function() {
-			me.change_amount(flt($(this).val()), precision("change_amount"));
-		});
+		$(this.$body)
+			.find(".change_amount")
+			.change(function () {
+				me.change_amount(flt($(this).val()), precision("change_amount"));
+			});
 	}
 
 	highlight_selected_row() {
-		var selected_row = $(this.$body).find(repl(".pos-payment-row[idx='%(idx)s']", {'idx': this.idx}));
-		$(this.$body).find('.pos-payment-row').removeClass('selected-payment-mode');
-		selected_row.addClass('selected-payment-mode');
-		$(this.$body).find('.amount').attr('disabled', true);
-		this.selected_mode.attr('disabled', false);
+		var selected_row = $(this.$body).find(repl(".pos-payment-row[idx='%(idx)s']", { idx: this.idx }));
+		$(this.$body).find(".pos-payment-row").removeClass("selected-payment-mode");
+		selected_row.addClass("selected-payment-mode");
+		$(this.$body).find(".amount").attr("disabled", true);
+		this.selected_mode.attr("disabled", false);
 	}
 
 	bind_numeric_keys_event() {
 		var me = this;
-		$(this.$body).find('.pos-keyboard-key').click(function(){
-			me.payment_val += $(this).text();
-			me.selected_mode.val(format_currency(me.payment_val, me.frm.doc.currency));
-			me.idx = me.selected_mode.attr("idx");
-			me.update_paid_amount();
-		});
+		$(this.$body)
+			.find(".pos-keyboard-key")
+			.click(function () {
+				me.payment_val += $(this).text();
+				me.selected_mode.val(format_currency(me.payment_val, me.frm.doc.currency));
+				me.idx = me.selected_mode.attr("idx");
+				me.update_paid_amount();
+			});
 
-		$(this.$body).find('.delete-btn').click(function() {
-			me.payment_val =  cstr(flt(me.selected_mode.val())).slice(0, -1);
-			me.selected_mode.val(format_currency(me.payment_val, me.frm.doc.currency));
-			me.idx = me.selected_mode.attr("idx");
-			me.update_paid_amount();
-		})
-
+		$(this.$body)
+			.find(".delete-btn")
+			.click(function () {
+				me.payment_val = cstr(flt(me.selected_mode.val())).slice(0, -1);
+				me.selected_mode.val(format_currency(me.payment_val, me.frm.doc.currency));
+				me.idx = me.selected_mode.attr("idx");
+				me.update_paid_amount();
+			});
 	}
 
 	bind_amount_change_event() {
 		var me = this;
-		this.selected_mode.change(function() {
-			me.payment_val =  flt($(this).val()) || 0.0;
+		this.selected_mode.change(function () {
+			me.payment_val = flt($(this).val()) || 0.0;
 			me.selected_mode.val(format_currency(me.payment_val, me.frm.doc.currency));
 			me.idx = me.selected_mode.attr("idx");
 			me.update_payment_amount();
@@ -167,21 +185,25 @@
 
 	clear_amount() {
 		var me = this;
-		$(this.$body).find('.clr').click(function(e) {
-			e.stopPropagation();
-			me.idx = $(this).attr("idx");
-			me.selected_mode = $(me.$body).find(repl("input[idx='%(idx)s']",{'idx': me.idx}));
-			me.payment_val = 0.0;
-			me.selected_mode.val(0.0);
-			me.highlight_selected_row();
-			me.update_payment_amount();
-		});
+		$(this.$body)
+			.find(".clr")
+			.click(function (e) {
+				e.stopPropagation();
+				me.idx = $(this).attr("idx");
+				me.selected_mode = $(me.$body).find(repl("input[idx='%(idx)s']", { idx: me.idx }));
+				me.payment_val = 0.0;
+				me.selected_mode.val(0.0);
+				me.highlight_selected_row();
+				me.update_payment_amount();
+			});
 	}
 
 	write_off_amount(write_off_amount) {
 		this.frm.doc.write_off_amount = flt(write_off_amount, precision("write_off_amount"));
-		this.frm.doc.base_write_off_amount = flt(this.frm.doc.write_off_amount * this.frm.doc.conversion_rate,
-			precision("base_write_off_amount"));
+		this.frm.doc.base_write_off_amount = flt(
+			this.frm.doc.write_off_amount * this.frm.doc.conversion_rate,
+			precision("base_write_off_amount")
+		);
 		this.calculate_outstanding_amount(false);
 		this.show_amounts();
 	}
@@ -196,13 +218,16 @@
 
 	update_paid_amount(update_write_off) {
 		var me = this;
-		if (in_list(['change_amount', 'write_off_amount'], this.idx)) {
+		if (in_list(["change_amount", "write_off_amount"], this.idx)) {
 			var value = me.selected_mode.val();
-			if (me.idx == 'change_amount') {
+			if (me.idx == "change_amount") {
 				me.change_amount(value);
 			} else {
-				if(flt(value) == 0 && update_write_off && me.frm.doc.outstanding_amount > 0) {
-					value = flt(me.frm.doc.outstanding_amount / me.frm.doc.conversion_rate, precision(me.idx));
+				if (flt(value) == 0 && update_write_off && me.frm.doc.outstanding_amount > 0) {
+					value = flt(
+						me.frm.doc.outstanding_amount / me.frm.doc.conversion_rate,
+						precision(me.idx)
+					);
 				}
 				me.write_off_amount(value);
 			}
@@ -211,25 +236,38 @@
 		}
 	}
 
-	update_payment_amount(){
+	update_payment_amount() {
 		var me = this;
 
-		$.each(this.frm.doc.payments, function(index, data) {
+		$.each(this.frm.doc.payments, function (index, data) {
 			if (cint(me.idx) == cint(data.idx)) {
 				data.amount = flt(me.selected_mode.val(), 2);
 			}
-		})
+		});
 
 		this.calculate_outstanding_amount(false);
 		this.show_amounts();
 	}
 
-	show_amounts(){
+	show_amounts() {
 		var me = this;
-		$(this.$body).find(".write_off_amount").val(format_currency(this.frm.doc.write_off_amount, this.frm.doc.currency));
-		$(this.$body).find('.paid_amount').text(format_currency(this.frm.doc.paid_amount, this.frm.doc.currency));
-		$(this.$body).find('.change_amount').val(format_currency(this.frm.doc.change_amount, this.frm.doc.currency));
-		$(this.$body).find('.outstanding_amount').text(format_currency(this.frm.doc.outstanding_amount, frappe.get_doc(":Company", this.frm.doc.company).default_currency));
+		$(this.$body)
+			.find(".write_off_amount")
+			.val(format_currency(this.frm.doc.write_off_amount, this.frm.doc.currency));
+		$(this.$body)
+			.find(".paid_amount")
+			.text(format_currency(this.frm.doc.paid_amount, this.frm.doc.currency));
+		$(this.$body)
+			.find(".change_amount")
+			.val(format_currency(this.frm.doc.change_amount, this.frm.doc.currency));
+		$(this.$body)
+			.find(".outstanding_amount")
+			.text(
+				format_currency(
+					this.frm.doc.outstanding_amount,
+					frappe.get_doc(":Company", this.frm.doc.company).default_currency
+				)
+			);
 		this.update_invoice();
 	}
-}
+};
diff --git a/erpnext/public/js/plant_floor_visual/visual_plant.js b/erpnext/public/js/plant_floor_visual/visual_plant.js
index 8cd73ad..7e6ee65 100644
--- a/erpnext/public/js/plant_floor_visual/visual_plant.js
+++ b/erpnext/public/js/plant_floor_visual/visual_plant.js
@@ -1,5 +1,5 @@
 class VisualPlantFloor {
-	constructor({wrapper, skip_filters=false, plant_floor=null}, page=null) {
+	constructor({ wrapper, skip_filters = false, plant_floor = null }, page = null) {
 		this.wrapper = wrapper;
 		this.plant_floor = plant_floor;
 		this.skip_filters = skip_filters;
@@ -23,67 +23,67 @@
 		`);
 
 		if (!this.skip_filters) {
-			this.filter_wrapper = this.wrapper.find('.plant-floor-filter');
-			this.visualization_wrapper = this.wrapper.find('.plant-floor-visualization');
-		} else if(this.plant_floor) {
-			this.wrapper.find('.plant-floor').css('border', 'none');
+			this.filter_wrapper = this.wrapper.find(".plant-floor-filter");
+			this.visualization_wrapper = this.wrapper.find(".plant-floor-visualization");
+		} else if (this.plant_floor) {
+			this.wrapper.find(".plant-floor").css("border", "none");
 			this.prepare_data();
 		}
 	}
 
 	prepare_data() {
 		frappe.call({
-			method: 'erpnext.manufacturing.doctype.workstation.workstation.get_workstations',
+			method: "erpnext.manufacturing.doctype.workstation.workstation.get_workstations",
 			args: {
 				plant_floor: this.plant_floor,
 			},
 			callback: (r) => {
 				this.workstations = r.message;
 				this.render_workstations();
-			}
+			},
 		});
 	}
 
 	add_filter() {
 		this.plant_floor = frappe.ui.form.make_control({
 			df: {
-				fieldtype: 'Link',
-				options: 'Plant Floor',
-				fieldname: 'plant_floor',
-				label: __('Plant Floor'),
+				fieldtype: "Link",
+				options: "Plant Floor",
+				fieldname: "plant_floor",
+				label: __("Plant Floor"),
 				reqd: 1,
 				onchange: () => {
 					this.render_plant_visualization();
-				}
+				},
 			},
 			parent: this.filter_wrapper,
 			render_input: true,
 		});
 
-		this.plant_floor.$wrapper.addClass('form-column col-sm-2');
+		this.plant_floor.$wrapper.addClass("form-column col-sm-2");
 
 		this.workstation_type = frappe.ui.form.make_control({
 			df: {
-				fieldtype: 'Link',
-				options: 'Workstation Type',
-				fieldname: 'workstation_type',
-				label: __('Machine Type'),
+				fieldtype: "Link",
+				options: "Workstation Type",
+				fieldname: "workstation_type",
+				label: __("Machine Type"),
 				onchange: () => {
 					this.render_plant_visualization();
-				}
+				},
 			},
 			parent: this.filter_wrapper,
 			render_input: true,
 		});
 
-		this.workstation_type.$wrapper.addClass('form-column col-sm-2');
+		this.workstation_type.$wrapper.addClass("form-column col-sm-2");
 
 		this.workstation = frappe.ui.form.make_control({
 			df: {
-				fieldtype: 'Link',
-				options: 'Workstation',
-				fieldname: 'workstation',
-				label: __('Machine'),
+				fieldtype: "Link",
+				options: "Workstation",
+				fieldname: "workstation",
+				label: __("Machine"),
 				onchange: () => {
 					this.render_plant_visualization();
 				},
@@ -91,24 +91,24 @@
 					if (this.workstation_type.get_value()) {
 						return {
 							filters: {
-								'workstation_type': this.workstation_type.get_value() || ''
-							}
-						}
+								workstation_type: this.workstation_type.get_value() || "",
+							},
+						};
 					}
-				}
+				},
 			},
 			parent: this.filter_wrapper,
 			render_input: true,
 		});
 
-		this.workstation.$wrapper.addClass('form-column col-sm-2');
+		this.workstation.$wrapper.addClass("form-column col-sm-2");
 
 		this.workstation_status = frappe.ui.form.make_control({
 			df: {
-				fieldtype: 'Select',
-				options: '\nProduction\nOff\nIdle\nProblem\nMaintenance\nSetup',
-				fieldname: 'workstation_status',
-				label: __('Status'),
+				fieldtype: "Select",
+				options: "\nProduction\nOff\nIdle\nProblem\nMaintenance\nSetup",
+				fieldname: "workstation_status",
+				label: __("Status"),
 				onchange: () => {
 					this.render_plant_visualization();
 				},
@@ -123,35 +123,35 @@
 
 		if (plant_floor) {
 			frappe.call({
-				method: 'erpnext.manufacturing.doctype.workstation.workstation.get_workstations',
+				method: "erpnext.manufacturing.doctype.workstation.workstation.get_workstations",
 				args: {
 					plant_floor: plant_floor,
 					workstation_type: this.workstation_type.get_value(),
 					workstation: this.workstation.get_value(),
-					workstation_status: this.workstation_status.get_value()
+					workstation_status: this.workstation_status.get_value(),
 				},
 				callback: (r) => {
 					this.workstations = r.message;
 					this.render_workstations();
-				}
+				},
 			});
 		}
 	}
 
 	render_workstations() {
-		this.wrapper.find('.plant-floor-container').empty();
-		let template  = frappe.render_template("visual_plant_floor_template", {
-			workstations: this.workstations
+		this.wrapper.find(".plant-floor-container").empty();
+		let template = frappe.render_template("visual_plant_floor_template", {
+			workstations: this.workstations,
 		});
 
-		$(template).appendTo(this.wrapper.find('.plant-floor-container'));
+		$(template).appendTo(this.wrapper.find(".plant-floor-container"));
 	}
 
 	prepare_menu() {
-		this.page.add_menu_item(__('Refresh'), () => {
+		this.page.add_menu_item(__("Refresh"), () => {
 			this.render_plant_visualization();
 		});
 	}
 }
 
-frappe.ui.VisualPlantFloor = VisualPlantFloor;
\ No newline at end of file
+frappe.ui.VisualPlantFloor = VisualPlantFloor;
diff --git a/erpnext/public/js/projects/timer.js b/erpnext/public/js/projects/timer.js
index 0209f4c..8370cc6 100644
--- a/erpnext/public/js/projects/timer.js
+++ b/erpnext/public/js/projects/timer.js
@@ -1,26 +1,30 @@
 frappe.provide("erpnext.timesheet");
 
-erpnext.timesheet.timer = function(frm, row, timestamp=0) {
+erpnext.timesheet.timer = function (frm, row, timestamp = 0) {
 	let dialog = new frappe.ui.Dialog({
 		title: __("Timer"),
-		fields:
-		[
-			{"fieldtype": "Link", "label": __("Activity Type"), "fieldname": "activity_type",
-				"reqd": 1, "options": "Activity Type"},
-			{"fieldtype": "Link", "label": __("Project"), "fieldname": "project", "options": "Project"},
-			{"fieldtype": "Link", "label": __("Task"), "fieldname": "task", "options": "Task"},
-			{"fieldtype": "Float", "label": __("Expected Hrs"), "fieldname": "expected_hours"},
-			{"fieldtype": "Section Break"},
-			{"fieldtype": "HTML", "fieldname": "timer_html"}
-		]
+		fields: [
+			{
+				fieldtype: "Link",
+				label: __("Activity Type"),
+				fieldname: "activity_type",
+				reqd: 1,
+				options: "Activity Type",
+			},
+			{ fieldtype: "Link", label: __("Project"), fieldname: "project", options: "Project" },
+			{ fieldtype: "Link", label: __("Task"), fieldname: "task", options: "Task" },
+			{ fieldtype: "Float", label: __("Expected Hrs"), fieldname: "expected_hours" },
+			{ fieldtype: "Section Break" },
+			{ fieldtype: "HTML", fieldname: "timer_html" },
+		],
 	});
 
 	if (row) {
 		dialog.set_values({
-			'activity_type': row.activity_type,
-			'project': row.project,
-			'task': row.task,
-			'expected_hours': row.expected_hours
+			activity_type: row.activity_type,
+			project: row.project,
+			task: row.task,
+			expected_hours: row.expected_hours,
 		});
 	}
 	dialog.get_field("timer_html").$wrapper.append(get_timer_html());
@@ -34,8 +38,8 @@
 				<span class="seconds">00</span>
 			</div>
 			<div class="playpause text-center">
-				<button class= "btn btn-primary btn-start"> ${ __("Start") } </button>
-				<button class= "btn btn-primary btn-complete"> ${ __("Complete") } </button>
+				<button class= "btn btn-primary btn-start"> ${__("Start")} </button>
+				<button class= "btn btn-primary btn-complete"> ${__("Complete")} </button>
 			</div>
 		`;
 	}
@@ -43,7 +47,7 @@
 	dialog.show();
 };
 
-erpnext.timesheet.control_timer = function(frm, dialog, row, timestamp=0) {
+erpnext.timesheet.control_timer = function (frm, dialog, row, timestamp = 0) {
 	var $btn_start = dialog.$wrapper.find(".playpause .btn-start");
 	var $btn_complete = dialog.$wrapper.find(".playpause .btn-complete");
 	var interval = null;
@@ -63,12 +67,16 @@
 		$btn_complete.hide();
 	}
 
-	$btn_start.click(function(e) {
+	$btn_start.click(function (e) {
 		if (!initialized) {
 			// New activity if no activities found
 			var args = dialog.get_values();
-			if(!args) return;
-			if (frm.doc.time_logs.length == 1 && !frm.doc.time_logs[0].activity_type && !frm.doc.time_logs[0].from_time) {
+			if (!args) return;
+			if (
+				frm.doc.time_logs.length == 1 &&
+				!frm.doc.time_logs[0].activity_type &&
+				!frm.doc.time_logs[0].from_time
+			) {
 				frm.doc.time_logs = [];
 			}
 			row = frappe.model.add_child(frm.doc, "Timesheet Detail", "time_logs");
@@ -79,7 +87,7 @@
 			row.expected_hours = args.expected_hours;
 			row.completed = 0;
 			let d = moment(row.from_time);
-			if(row.expected_hours) {
+			if (row.expected_hours) {
 				d.add(row.expected_hours, "hours");
 				row.to_time = d.format(frappe.defaultDatetimeFormat);
 			}
@@ -101,8 +109,8 @@
 	});
 
 	// Stop the timer and update the time logged by the timer on click of 'Complete' button
-	$btn_complete.click(function() {
-		var grid_row = cur_frm.fields_dict['time_logs'].grid.get_row(row.idx - 1);
+	$btn_complete.click(function () {
+		var grid_row = cur_frm.fields_dict["time_logs"].grid.get_row(row.idx - 1);
 		var args = dialog.get_values();
 		grid_row.doc.completed = 1;
 		grid_row.doc.activity_type = args.activity_type;
@@ -119,7 +127,7 @@
 	});
 
 	function initializeTimer() {
-		interval = setInterval(function() {
+		interval = setInterval(function () {
 			var current = setCurrentIncrement();
 			updateStopwatch(current);
 		}, 1000);
@@ -127,25 +135,24 @@
 
 	function updateStopwatch(increment) {
 		var hours = Math.floor(increment / 3600);
-		var minutes = Math.floor((increment - (hours * 3600)) / 60);
-		var seconds = increment - (hours * 3600) - (minutes * 60);
+		var minutes = Math.floor((increment - hours * 3600) / 60);
+		var seconds = increment - hours * 3600 - minutes * 60;
 
 		// If modal is closed by clicking anywhere outside, reset the timer
-		if (!$('.modal-dialog').is(':visible')) {
+		if (!$(".modal-dialog").is(":visible")) {
 			reset();
 		}
-		if(hours > 99999)
-			reset();
-		if(cur_dialog && cur_dialog.get_value('expected_hours') > 0) {
-			if(flag && (currentIncrement >= (cur_dialog.get_value('expected_hours') * 3600))) {
+		if (hours > 99999) reset();
+		if (cur_dialog && cur_dialog.get_value("expected_hours") > 0) {
+			if (flag && currentIncrement >= cur_dialog.get_value("expected_hours") * 3600) {
 				frappe.utils.play_sound("alert");
 				frappe.msgprint(__("Timer exceeded the given hours."));
 				flag = false;
 			}
 		}
-		$(".hours").text(hours < 10 ? ("0" + hours.toString()) : hours.toString());
-		$(".minutes").text(minutes < 10 ? ("0" + minutes.toString()) : minutes.toString());
-		$(".seconds").text(seconds < 10 ? ("0" + seconds.toString()) : seconds.toString());
+		$(".hours").text(hours < 10 ? "0" + hours.toString() : hours.toString());
+		$(".minutes").text(minutes < 10 ? "0" + minutes.toString() : minutes.toString());
+		$(".seconds").text(seconds < 10 ? "0" + seconds.toString() : seconds.toString());
 	}
 
 	function setCurrentIncrement() {
diff --git a/erpnext/public/js/purchase_trends_filters.js b/erpnext/public/js/purchase_trends_filters.js
index 77f1d2b..14ffaf8 100644
--- a/erpnext/public/js/purchase_trends_filters.js
+++ b/erpnext/public/js/purchase_trends_filters.js
@@ -1,71 +1,67 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-erpnext.get_purchase_trends_filters = function() {
+erpnext.get_purchase_trends_filters = function () {
 	return [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"reqd": 1,
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname":"period",
-			"label": __("Period"),
-			"fieldtype": "Select",
-			"options": [
-				{ "value": "Monthly", "label": __("Monthly") },
-				{ "value": "Quarterly", "label": __("Quarterly") },
-				{ "value": "Half-Yearly", "label": __("Half-Yearly") },
-				{ "value": "Yearly", "label": __("Yearly") }
+			fieldname: "period",
+			label: __("Period"),
+			fieldtype: "Select",
+			options: [
+				{ value: "Monthly", label: __("Monthly") },
+				{ value: "Quarterly", label: __("Quarterly") },
+				{ value: "Half-Yearly", label: __("Half-Yearly") },
+				{ value: "Yearly", label: __("Yearly") },
 			],
-			"default": "Monthly"
+			default: "Monthly",
 		},
 		{
-			"fieldname":"fiscal_year",
-			"label": __("Fiscal Year"),
-			"fieldtype": "Link",
-			"options":'Fiscal Year',
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today())
+			fieldname: "fiscal_year",
+			label: __("Fiscal Year"),
+			fieldtype: "Link",
+			options: "Fiscal Year",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
 		},
 		{
-			"fieldname":"period_based_on",
-			"label": __("Period based On"),
-			"fieldtype": "Select",
-			"options": [
-				{ "value": "posting_date", "label": __("Posting Date") },
-				{ "value": "bill_date", "label": __("Billing Date") },
+			fieldname: "period_based_on",
+			label: __("Period based On"),
+			fieldtype: "Select",
+			options: [
+				{ value: "posting_date", label: __("Posting Date") },
+				{ value: "bill_date", label: __("Billing Date") },
 			],
-			"default": "posting_date"
+			default: "posting_date",
 		},
 		{
-			"fieldname":"based_on",
-			"label": __("Based On"),
-			"fieldtype": "Select",
-			"options": [
-				{ "value": "Item", "label": __("Item") },
-				{ "value": "Item Group", "label": __("Item Group") },
-				{ "value": "Supplier", "label": __("Supplier") },
-				{ "value": "Supplier Group", "label": __("Supplier Group") },
-				{ "value": "Project", "label": __("Project") }
+			fieldname: "based_on",
+			label: __("Based On"),
+			fieldtype: "Select",
+			options: [
+				{ value: "Item", label: __("Item") },
+				{ value: "Item Group", label: __("Item Group") },
+				{ value: "Supplier", label: __("Supplier") },
+				{ value: "Supplier Group", label: __("Supplier Group") },
+				{ value: "Project", label: __("Project") },
 			],
-			"default": "Item",
-			"dashboard_config": {
-				"read_only": 1
-			}
+			default: "Item",
+			dashboard_config: {
+				read_only: 1,
+			},
 		},
 		{
-			"fieldname":"group_by",
-			"label": __("Group By"),
-			"fieldtype": "Select",
-			"options": [
-				"",
-				{ "value": "Item", "label": __("Item") },
-				{ "value": "Supplier", "label": __("Supplier") }
-			],
-			"default": ""
+			fieldname: "group_by",
+			label: __("Group By"),
+			fieldtype: "Select",
+			options: ["", { value: "Item", label: __("Item") }, { value: "Supplier", label: __("Supplier") }],
+			default: "",
 		},
 	];
-}
+};
diff --git a/erpnext/public/js/queries.js b/erpnext/public/js/queries.js
index b7d880a..b7e685c 100644
--- a/erpnext/public/js/queries.js
+++ b/erpnext/public/js/queries.js
@@ -4,129 +4,139 @@
 // searches for enabled users
 frappe.provide("erpnext.queries");
 $.extend(erpnext.queries, {
-	user: function() {
+	user: function () {
 		return { query: "frappe.core.doctype.user.user.user_query" };
 	},
 
-	lead: function() {
+	lead: function () {
 		return { query: "erpnext.controllers.queries.lead_query" };
 	},
 
-	customer: function() {
+	customer: function () {
 		return { query: "erpnext.controllers.queries.customer_query" };
 	},
 
-	supplier: function() {
+	supplier: function () {
 		return { query: "erpnext.controllers.queries.supplier_query" };
 	},
 
-	item: function(filters) {
+	item: function (filters) {
 		var args = { query: "erpnext.controllers.queries.item_query" };
-		if(filters) args["filters"] = filters;
+		if (filters) args["filters"] = filters;
 		return args;
 	},
 
-	bom: function() {
+	bom: function () {
 		return { query: "erpnext.controllers.queries.bom" };
 	},
 
-	task: function() {
+	task: function () {
 		return { query: "erpnext.projects.utils.query_task" };
 	},
 
-	customer_filter: function(doc) {
-		if(!doc.customer) {
-			frappe.throw(__("Please set {0}", [__(frappe.meta.get_label(doc.doctype, "customer", doc.name))]));
+	customer_filter: function (doc) {
+		if (!doc.customer) {
+			frappe.throw(
+				__("Please set {0}", [__(frappe.meta.get_label(doc.doctype, "customer", doc.name))])
+			);
 		}
 
 		return { filters: { customer: doc.customer } };
 	},
 
-	contact_query: function(doc) {
-		if(frappe.dynamic_link) {
-			if(!doc[frappe.dynamic_link.fieldname]) {
-				frappe.throw(__("Please set {0}",
-					[__(frappe.meta.get_label(doc.doctype, frappe.dynamic_link.fieldname, doc.name))]));
+	contact_query: function (doc) {
+		if (frappe.dynamic_link) {
+			if (!doc[frappe.dynamic_link.fieldname]) {
+				frappe.throw(
+					__("Please set {0}", [
+						__(frappe.meta.get_label(doc.doctype, frappe.dynamic_link.fieldname, doc.name)),
+					])
+				);
 			}
 
 			return {
-				query: 'frappe.contacts.doctype.contact.contact.contact_query',
+				query: "frappe.contacts.doctype.contact.contact.contact_query",
 				filters: {
 					link_doctype: frappe.dynamic_link.doctype,
-					link_name: doc[frappe.dynamic_link.fieldname]
-				}
+					link_name: doc[frappe.dynamic_link.fieldname],
+				},
 			};
 		}
 	},
 
-	address_query: function(doc) {
-		if(frappe.dynamic_link) {
-			if(!doc[frappe.dynamic_link.fieldname]) {
-				frappe.throw(__("Please set {0}",
-					[__(frappe.meta.get_label(doc.doctype, frappe.dynamic_link.fieldname, doc.name))]));
+	address_query: function (doc) {
+		if (frappe.dynamic_link) {
+			if (!doc[frappe.dynamic_link.fieldname]) {
+				frappe.throw(
+					__("Please set {0}", [
+						__(frappe.meta.get_label(doc.doctype, frappe.dynamic_link.fieldname, doc.name)),
+					])
+				);
 			}
 
 			return {
-				query: 'frappe.contacts.doctype.address.address.address_query',
+				query: "frappe.contacts.doctype.address.address.address_query",
 				filters: {
 					link_doctype: frappe.dynamic_link.doctype,
-					link_name: doc[frappe.dynamic_link.fieldname]
-				}
+					link_name: doc[frappe.dynamic_link.fieldname],
+				},
 			};
 		}
 	},
 
-	company_address_query: function(doc) {
+	company_address_query: function (doc) {
 		return {
-			query: 'frappe.contacts.doctype.address.address.address_query',
-			filters: { is_your_company_address: 1, link_doctype: 'Company', link_name: doc.company || '' }
+			query: "frappe.contacts.doctype.address.address.address_query",
+			filters: { is_your_company_address: 1, link_doctype: "Company", link_name: doc.company || "" },
 		};
 	},
 
-	dispatch_address_query: function(doc) {
+	dispatch_address_query: function (doc) {
 		return {
-			query: 'frappe.contacts.doctype.address.address.address_query',
-			filters: { link_doctype: 'Company', link_name: doc.company || '' }
+			query: "frappe.contacts.doctype.address.address.address_query",
+			filters: { link_doctype: "Company", link_name: doc.company || "" },
 		};
 	},
 
-	supplier_filter: function(doc) {
-		if(!doc.supplier) {
-			frappe.throw(__("Please set {0}", [__(frappe.meta.get_label(doc.doctype, "supplier", doc.name))]));
+	supplier_filter: function (doc) {
+		if (!doc.supplier) {
+			frappe.throw(
+				__("Please set {0}", [__(frappe.meta.get_label(doc.doctype, "supplier", doc.name))])
+			);
 		}
 
 		return { filters: { supplier: doc.supplier } };
 	},
 
-	lead_filter: function(doc) {
-		if(!doc.lead) {
-			frappe.throw(__("Please specify a {0}",
-				[__(frappe.meta.get_label(doc.doctype, "lead", doc.name))]));
+	lead_filter: function (doc) {
+		if (!doc.lead) {
+			frappe.throw(
+				__("Please specify a {0}", [__(frappe.meta.get_label(doc.doctype, "lead", doc.name))])
+			);
 		}
 
 		return { filters: { lead: doc.lead } };
 	},
 
-	not_a_group_filter: function() {
+	not_a_group_filter: function () {
 		return { filters: { is_group: 0 } };
 	},
 
-	employee: function() {
-		return { query: "erpnext.controllers.queries.employee_query" }
+	employee: function () {
+		return { query: "erpnext.controllers.queries.employee_query" };
 	},
 
-	warehouse: function(doc) {
+	warehouse: function (doc) {
 		return {
 			filters: [
 				["Warehouse", "company", "in", ["", cstr(doc.company)]],
-				["Warehouse", "is_group", "=",0]
-
-			]
+				["Warehouse", "is_group", "=", 0],
+			],
 		};
 	},
 
-	get_filtered_dimensions: function(doc, child_fields, dimension, company) {
-		let account = '';
+	get_filtered_dimensions: function (doc, child_fields, dimension, company) {
+		let account = "";
 
 		child_fields.forEach((field) => {
 			if (!account) {
@@ -137,21 +147,23 @@
 		return {
 			query: "erpnext.controllers.queries.get_filtered_dimensions",
 			filters: {
-				'dimension': dimension,
-				'account': account,
-				'company': company
-			}
+				dimension: dimension,
+				account: account,
+				company: company,
+			},
 		};
-	}
+	},
 });
 
-erpnext.queries.setup_queries = function(frm, options, query_fn) {
+erpnext.queries.setup_queries = function (frm, options, query_fn) {
 	var me = this;
-	var set_query = function(doctype, parentfield) {
-		var link_fields = frappe.meta.get_docfields(doctype, frm.doc.name,
-			{"fieldtype": "Link", "options": options});
-		$.each(link_fields, function(i, df) {
-			if(parentfield) {
+	var set_query = function (doctype, parentfield) {
+		var link_fields = frappe.meta.get_docfields(doctype, frm.doc.name, {
+			fieldtype: "Link",
+			options: options,
+		});
+		$.each(link_fields, function (i, df) {
+			if (parentfield) {
 				frm.set_query(df.fieldname, parentfield, query_fn);
 			} else {
 				frm.set_query(df.fieldname, query_fn);
@@ -162,24 +174,26 @@
 	set_query(frm.doc.doctype);
 
 	// warehouse field in tables
-	$.each(frappe.meta.get_docfields(frm.doc.doctype, frm.doc.name, {"fieldtype": "Table"}),
-		function(i, df) {
+	$.each(
+		frappe.meta.get_docfields(frm.doc.doctype, frm.doc.name, { fieldtype: "Table" }),
+		function (i, df) {
 			set_query(df.options, df.fieldname);
-		});
-}
+		}
+	);
+};
 
 /* 	if item code is selected in child table
 	then list down warehouses with its quantity
 	else apply default filters.
 */
-erpnext.queries.setup_warehouse_query = function(frm){
-	frm.set_query('warehouse', 'items', function(doc, cdt, cdn) {
-		var row  = locals[cdt][cdn];
+erpnext.queries.setup_warehouse_query = function (frm) {
+	frm.set_query("warehouse", "items", function (doc, cdt, cdn) {
+		var row = locals[cdt][cdn];
 		var filters = erpnext.queries.warehouse(frm.doc);
-		if(row.item_code){
-			$.extend(filters, {"query":"erpnext.controllers.queries.warehouse_query"});
+		if (row.item_code) {
+			$.extend(filters, { query: "erpnext.controllers.queries.warehouse_query" });
 			filters["filters"].push(["Bin", "item_code", "=", row.item_code]);
 		}
-		return filters
+		return filters;
 	});
-}
+};
diff --git a/erpnext/public/js/sales_trends_filters.js b/erpnext/public/js/sales_trends_filters.js
index b73747a..85daa01 100644
--- a/erpnext/public/js/sales_trends_filters.js
+++ b/erpnext/public/js/sales_trends_filters.js
@@ -1,61 +1,57 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-erpnext.get_sales_trends_filters = function() {
-	return[
+erpnext.get_sales_trends_filters = function () {
+	return [
 		{
-			"fieldname":"period",
-			"label": __("Period"),
-			"fieldtype": "Select",
-			"options": [
-				{ "value": "Monthly", "label": __("Monthly") },
-				{ "value": "Quarterly", "label": __("Quarterly") },
-				{ "value": "Half-Yearly", "label": __("Half-Yearly") },
-				{ "value": "Yearly", "label": __("Yearly") }
+			fieldname: "period",
+			label: __("Period"),
+			fieldtype: "Select",
+			options: [
+				{ value: "Monthly", label: __("Monthly") },
+				{ value: "Quarterly", label: __("Quarterly") },
+				{ value: "Half-Yearly", label: __("Half-Yearly") },
+				{ value: "Yearly", label: __("Yearly") },
 			],
-			"default": "Monthly"
+			default: "Monthly",
 		},
 		{
-			"fieldname":"based_on",
-			"label": __("Based On"),
-			"fieldtype": "Select",
-			"options": [
-				{ "value": "Item", "label": __("Item") },
-				{ "value": "Item Group", "label": __("Item Group") },
-				{ "value": "Customer", "label": __("Customer") },
-				{ "value": "Customer Group", "label": __("Customer Group") },
-				{ "value": "Territory", "label": __("Territory") },
-				{ "value": "Project", "label": __("Project") }
+			fieldname: "based_on",
+			label: __("Based On"),
+			fieldtype: "Select",
+			options: [
+				{ value: "Item", label: __("Item") },
+				{ value: "Item Group", label: __("Item Group") },
+				{ value: "Customer", label: __("Customer") },
+				{ value: "Customer Group", label: __("Customer Group") },
+				{ value: "Territory", label: __("Territory") },
+				{ value: "Project", label: __("Project") },
 			],
-			"default": "Item",
-			"dashboard_config": {
-				"read_only": 1,
-			}
+			default: "Item",
+			dashboard_config: {
+				read_only: 1,
+			},
 		},
 		{
-			"fieldname":"group_by",
-			"label": __("Group By"),
-			"fieldtype": "Select",
-			"options": [
-				"",
-				{ "value": "Item", "label": __("Item") },
-				{ "value": "Customer", "label": __("Customer") }
-			],
-			"default": ""
+			fieldname: "group_by",
+			label: __("Group By"),
+			fieldtype: "Select",
+			options: ["", { value: "Item", label: __("Item") }, { value: "Customer", label: __("Customer") }],
+			default: "",
 		},
 		{
-			"fieldname":"fiscal_year",
-			"label": __("Fiscal Year"),
-			"fieldtype": "Link",
-			"options":'Fiscal Year',
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
+			fieldname: "fiscal_year",
+			label: __("Fiscal Year"),
+			fieldtype: "Link",
+			options: "Fiscal Year",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
 		},
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
 		},
 	];
-}
+};
diff --git a/erpnext/public/js/setup_wizard.js b/erpnext/public/js/setup_wizard.js
index 3cbec3e..3879b38 100644
--- a/erpnext/public/js/setup_wizard.js
+++ b/erpnext/public/js/setup_wizard.js
@@ -1,7 +1,7 @@
 frappe.provide("erpnext.setup");
 
-frappe.pages['setup-wizard'].on_page_load = function(wrapper) {
-	if(frappe.sys_defaults.company) {
+frappe.pages["setup-wizard"].on_page_load = function (wrapper) {
+	if (frappe.sys_defaults.company) {
 		frappe.set_route("desk");
 		return;
 	}
@@ -14,38 +14,42 @@
 erpnext.setup.slides_settings = [
 	{
 		// Organization
-		name: 'organization',
+		name: "organization",
 		title: __("Setup your organization"),
 		icon: "fa fa-building",
 		fields: [
 			{
-				fieldname: 'company_name',
-				label: __('Company Name'),
-				fieldtype: 'Data',
-				reqd: 1
+				fieldname: "company_name",
+				label: __("Company Name"),
+				fieldtype: "Data",
+				reqd: 1,
 			},
 			{ fieldtype: "Column Break" },
 			{
-				fieldname: 'company_abbr',
-				label: __('Company Abbreviation'),
-				fieldtype: 'Data',
-				reqd: 1
+				fieldname: "company_abbr",
+				label: __("Company Abbreviation"),
+				fieldtype: "Data",
+				reqd: 1,
 			},
 			{ fieldtype: "Section Break" },
 			{
-				fieldname: 'chart_of_accounts', label: __('Chart of Accounts'),
-				options: "", fieldtype: 'Select'
+				fieldname: "chart_of_accounts",
+				label: __("Chart of Accounts"),
+				options: "",
+				fieldtype: "Select",
 			},
-			{ fieldname: 'view_coa', label: __('View Chart of Accounts'), fieldtype: 'Button' },
-			{ fieldname: 'fy_start_date', label: __('Financial Year Begins On'), fieldtype: 'Date', reqd: 1 },
+			{ fieldname: "view_coa", label: __("View Chart of Accounts"), fieldtype: "Button" },
+			{ fieldname: "fy_start_date", label: __("Financial Year Begins On"), fieldtype: "Date", reqd: 1 },
 			// end date should be hidden (auto calculated)
-			{ fieldname: 'fy_end_date', label: __('End Date'), fieldtype: 'Date', reqd: 1, hidden: 1 },
+			{ fieldname: "fy_end_date", label: __("End Date"), fieldtype: "Date", reqd: 1, hidden: 1 },
 			{ fieldtype: "Section Break" },
 			{
-				fieldname: 'setup_demo',
-				label: __('Generate Demo Data for Exploration'),
-				fieldtype: 'Check',
-				description: __('If checked, we will create demo data for you to explore the system. This demo data can be erased later.')
+				fieldname: "setup_demo",
+				label: __("Generate Demo Data for Exploration"),
+				fieldtype: "Check",
+				description: __(
+					"If checked, we will create demo data for you to explore the system. This demo data can be erased later."
+				),
 			},
 		],
 
@@ -73,10 +77,10 @@
 			return true;
 		},
 
-		validate_fy_dates: function() {
+		validate_fy_dates: function () {
 			// validate fiscal year start and end dates
-			const invalid = this.values.fy_start_date == 'Invalid date' ||
-				this.values.fy_end_date == 'Invalid date';
+			const invalid =
+				this.values.fy_start_date == "Invalid date" || this.values.fy_end_date == "Invalid date";
 			const start_greater_than_end = this.values.fy_start_date > this.values.fy_end_date;
 
 			if (invalid || start_greater_than_end) {
@@ -104,26 +108,24 @@
 					next_year = current_year;
 					current_year -= 1;
 				}
-				slide.get_field("fy_start_date").set_value(current_year + '-' + fy[0]);
-				slide.get_field("fy_end_date").set_value(next_year + '-' + fy[1]);
+				slide.get_field("fy_start_date").set_value(current_year + "-" + fy[0]);
+				slide.get_field("fy_end_date").set_value(next_year + "-" + fy[1]);
 			}
 		},
 
-
 		load_chart_of_accounts: function (slide) {
 			let country = frappe.wizard.values.country;
 
 			if (country) {
 				frappe.call({
 					method: "erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts.get_charts_for_country",
-					args: { "country": country, with_standard: true },
+					args: { country: country, with_standard: true },
 					callback: function (r) {
 						if (r.message) {
-							slide.get_input("chart_of_accounts").empty()
-								.add_options(r.message);
+							slide.get_input("chart_of_accounts").empty().add_options(r.message);
 						}
-					}
-				})
+					},
+				});
 			}
 		},
 
@@ -131,56 +133,74 @@
 			let me = this;
 			slide.get_input("fy_start_date").on("change", function () {
 				var start_date = slide.form.fields_dict.fy_start_date.get_value();
-				var year_end_date =
-					frappe.datetime.add_days(frappe.datetime.add_months(start_date, 12), -1);
+				var year_end_date = frappe.datetime.add_days(frappe.datetime.add_months(start_date, 12), -1);
 				slide.form.fields_dict.fy_end_date.set_value(year_end_date);
 			});
 
-			slide.get_input("view_coa").on("click", function() {
+			slide.get_input("view_coa").on("click", function () {
 				let chart_template = slide.form.fields_dict.chart_of_accounts.get_value();
-				if(!chart_template) return;
+				if (!chart_template) return;
 
 				me.charts_modal(slide, chart_template);
 			});
 
-			slide.get_input("company_name").on("input", function () {
-				let parts = slide.get_input("company_name").val().split(" ");
-				let abbr = $.map(parts, function (p) { return p ? p.substr(0, 1) : null }).join("");
-				slide.get_field("company_abbr").set_value(abbr.slice(0, 10).toUpperCase());
-			}).val(frappe.boot.sysdefaults.company_name || "").trigger("change");
+			slide
+				.get_input("company_name")
+				.on("input", function () {
+					let parts = slide.get_input("company_name").val().split(" ");
+					let abbr = $.map(parts, function (p) {
+						return p ? p.substr(0, 1) : null;
+					}).join("");
+					slide.get_field("company_abbr").set_value(abbr.slice(0, 10).toUpperCase());
+				})
+				.val(frappe.boot.sysdefaults.company_name || "")
+				.trigger("change");
 
-			slide.get_input("company_abbr").on("change", function () {
-				let abbr = slide.get_input("company_abbr").val();
-				if (abbr.length > 10) {
-					frappe.msgprint(__("Company Abbreviation cannot have more than 5 characters"));
-					abbr = abbr.slice(0, 10);
-				}
-				slide.get_field("company_abbr").set_value(abbr);
-			}).val(frappe.boot.sysdefaults.company_abbr || "").trigger("change");
+			slide
+				.get_input("company_abbr")
+				.on("change", function () {
+					let abbr = slide.get_input("company_abbr").val();
+					if (abbr.length > 10) {
+						frappe.msgprint(__("Company Abbreviation cannot have more than 5 characters"));
+						abbr = abbr.slice(0, 10);
+					}
+					slide.get_field("company_abbr").set_value(abbr);
+				})
+				.val(frappe.boot.sysdefaults.company_abbr || "")
+				.trigger("change");
 		},
 
-		charts_modal: function(slide, chart_template) {
-			let parent = __('All Accounts');
+		charts_modal: function (slide, chart_template) {
+			let parent = __("All Accounts");
 
 			let dialog = new frappe.ui.Dialog({
 				title: chart_template,
 				fields: [
-					{'fieldname': 'expand_all', 'label': __('Expand All'), 'fieldtype': 'Button',
-						click: function() {
+					{
+						fieldname: "expand_all",
+						label: __("Expand All"),
+						fieldtype: "Button",
+						click: function () {
 							// expand all nodes on button click
 							coa_tree.load_children(coa_tree.root_node, true);
-						}
+						},
 					},
-					{'fieldname': 'collapse_all', 'label': __('Collapse All'), 'fieldtype': 'Button',
-						click: function() {
+					{
+						fieldname: "collapse_all",
+						label: __("Collapse All"),
+						fieldtype: "Button",
+						click: function () {
 							// collapse all nodes
-							coa_tree.get_all_nodes(coa_tree.root_node.data.value, coa_tree.root_node.is_root)
-								.then(data_list => {
-									data_list.map(d => { coa_tree.toggle_node(coa_tree.nodes[d.parent]); });
+							coa_tree
+								.get_all_nodes(coa_tree.root_node.data.value, coa_tree.root_node.is_root)
+								.then((data_list) => {
+									data_list.map((d) => {
+										coa_tree.toggle_node(coa_tree.nodes[d.parent]);
+									});
 								});
-						}
-					}
-				]
+						},
+					},
+				],
 			});
 
 			// render tree structure in the dialog modal
@@ -188,49 +208,49 @@
 				parent: $(dialog.body),
 				label: parent,
 				expandable: true,
-				method: 'erpnext.accounts.utils.get_coa',
+				method: "erpnext.accounts.utils.get_coa",
 				args: {
 					chart: chart_template,
 					parent: parent,
-					doctype: 'Account'
+					doctype: "Account",
 				},
-				onclick: function(node) {
+				onclick: function (node) {
 					parent = node.value;
-				}
+				},
 			});
 
 			// add class to show buttons side by side
-			const form_container = $(dialog.body).find('form');
-			const buttons = $(form_container).find('.frappe-control');
-			form_container.addClass('flex');
+			const form_container = $(dialog.body).find("form");
+			const buttons = $(form_container).find(".frappe-control");
+			form_container.addClass("flex");
 			buttons.map((index, button) => {
-				$(button).css({"margin-right": "1em"});
-			})
+				$(button).css({ "margin-right": "1em" });
+			});
 
 			dialog.show();
 			coa_tree.load_children(coa_tree.root_node, true); // expand all node trigger
-		}
-	}
+		},
+	},
 ];
 
 // Source: https://en.wikipedia.org/wiki/Fiscal_year
 // default 1st Jan - 31st Dec
 
 erpnext.setup.fiscal_years = {
-	"Afghanistan": ["12-21", "12-20"],
-	"Australia": ["07-01", "06-30"],
-	"Bangladesh": ["07-01", "06-30"],
-	"Canada": ["04-01", "03-31"],
+	Afghanistan: ["12-21", "12-20"],
+	Australia: ["07-01", "06-30"],
+	Bangladesh: ["07-01", "06-30"],
+	Canada: ["04-01", "03-31"],
 	"Costa Rica": ["10-01", "09-30"],
-	"Egypt": ["07-01", "06-30"],
+	Egypt: ["07-01", "06-30"],
 	"Hong Kong": ["04-01", "03-31"],
-	"India": ["04-01", "03-31"],
-	"Iran": ["06-23", "06-22"],
-	"Myanmar": ["04-01", "03-31"],
+	India: ["04-01", "03-31"],
+	Iran: ["06-23", "06-22"],
+	Myanmar: ["04-01", "03-31"],
 	"New Zealand": ["04-01", "03-31"],
-	"Pakistan": ["07-01", "06-30"],
-	"Singapore": ["04-01", "03-31"],
+	Pakistan: ["07-01", "06-30"],
+	Singapore: ["04-01", "03-31"],
 	"South Africa": ["03-01", "02-28"],
-	"Thailand": ["10-01", "09-30"],
+	Thailand: ["10-01", "09-30"],
 	"United Kingdom": ["04-01", "03-31"],
 };
diff --git a/erpnext/public/js/sms_manager.js b/erpnext/public/js/sms_manager.js
index a058da2..d3147bb 100644
--- a/erpnext/public/js/sms_manager.js
+++ b/erpnext/public/js/sms_manager.js
@@ -3,104 +3,114 @@
 
 erpnext.SMSManager = function SMSManager(doc) {
 	var me = this;
-	this.setup = function() {
+	this.setup = function () {
 		var default_msg = {
-			'Lead'				: '',
-			'Opportunity'			: 'Your enquiry has been logged into the system. Ref No: ' + doc.name,
-			'Quotation'			: 'Quotation ' + doc.name + ' has been sent via email. Thanks!',
-			'Sales Order'		: 'Sales Order ' + doc.name + ' has been created against '
-						+ (doc.quotation_no ? ('Quote No:' + doc.quotation_no) : '')
-						+ (doc.po_no ? (' for your PO: ' + doc.po_no) : ''),
-			'Delivery Note'		: 'Items has been delivered against delivery note: ' + doc.name
-						+ (doc.po_no ? (' for your PO: ' + doc.po_no) : ''),
-			'Sales Invoice': 'Invoice ' + doc.name + ' has been sent via email '
-						+ (doc.po_no ? (' for your PO: ' + doc.po_no) : ''),
-			'Material Request'			: 'Material Request ' + doc.name + ' has been raised in the system',
-			'Purchase Order'	: 'Purchase Order ' + doc.name + ' has been sent via email',
-			'Purchase Receipt'	: 'Items has been received against purchase receipt: ' + doc.name
-		}
+			Lead: "",
+			Opportunity: "Your enquiry has been logged into the system. Ref No: " + doc.name,
+			Quotation: "Quotation " + doc.name + " has been sent via email. Thanks!",
+			"Sales Order":
+				"Sales Order " +
+				doc.name +
+				" has been created against " +
+				(doc.quotation_no ? "Quote No:" + doc.quotation_no : "") +
+				(doc.po_no ? " for your PO: " + doc.po_no : ""),
+			"Delivery Note":
+				"Items has been delivered against delivery note: " +
+				doc.name +
+				(doc.po_no ? " for your PO: " + doc.po_no : ""),
+			"Sales Invoice":
+				"Invoice " +
+				doc.name +
+				" has been sent via email " +
+				(doc.po_no ? " for your PO: " + doc.po_no : ""),
+			"Material Request": "Material Request " + doc.name + " has been raised in the system",
+			"Purchase Order": "Purchase Order " + doc.name + " has been sent via email",
+			"Purchase Receipt": "Items has been received against purchase receipt: " + doc.name,
+		};
 
-		if (in_list(['Sales Order', 'Delivery Note', 'Sales Invoice'], doc.doctype))
-			this.show(doc.contact_person, 'Customer', doc.customer, '', default_msg[doc.doctype]);
-		else if (doc.doctype === 'Quotation')
-			this.show(doc.contact_person, 'Customer', doc.party_name, '', default_msg[doc.doctype]);
-		else if (in_list(['Purchase Order', 'Purchase Receipt'], doc.doctype))
-			this.show(doc.contact_person, 'Supplier', doc.supplier, '', default_msg[doc.doctype]);
-		else if (doc.doctype == 'Lead')
-			this.show('', '', '', doc.mobile_no, default_msg[doc.doctype]);
-		else if (doc.doctype == 'Opportunity')
-			this.show('', '', '', doc.contact_no, default_msg[doc.doctype]);
-		else if (doc.doctype == 'Material Request')
-			this.show('', '', '', '', default_msg[doc.doctype]);
-
+		if (in_list(["Sales Order", "Delivery Note", "Sales Invoice"], doc.doctype))
+			this.show(doc.contact_person, "Customer", doc.customer, "", default_msg[doc.doctype]);
+		else if (doc.doctype === "Quotation")
+			this.show(doc.contact_person, "Customer", doc.party_name, "", default_msg[doc.doctype]);
+		else if (in_list(["Purchase Order", "Purchase Receipt"], doc.doctype))
+			this.show(doc.contact_person, "Supplier", doc.supplier, "", default_msg[doc.doctype]);
+		else if (doc.doctype == "Lead") this.show("", "", "", doc.mobile_no, default_msg[doc.doctype]);
+		else if (doc.doctype == "Opportunity")
+			this.show("", "", "", doc.contact_no, default_msg[doc.doctype]);
+		else if (doc.doctype == "Material Request") this.show("", "", "", "", default_msg[doc.doctype]);
 	};
 
-	this.get_contact_number = function(contact, ref_doctype, ref_name) {
+	this.get_contact_number = function (contact, ref_doctype, ref_name) {
 		frappe.call({
 			method: "frappe.core.doctype.sms_settings.sms_settings.get_contact_number",
 			args: {
 				contact_name: contact,
 				ref_doctype: ref_doctype,
-				ref_name: ref_name
+				ref_name: ref_name,
 			},
-			callback: function(r) {
-				if(r.exc) { frappe.msgprint(r.exc); return; }
+			callback: function (r) {
+				if (r.exc) {
+					frappe.msgprint(r.exc);
+					return;
+				}
 				me.number = r.message;
 				me.show_dialog();
-			}
+			},
 		});
 	};
 
-	this.show = function(contact, ref_doctype, ref_name, mobile_nos, message) {
+	this.show = function (contact, ref_doctype, ref_name, mobile_nos, message) {
 		this.message = message;
 		if (mobile_nos) {
 			me.number = mobile_nos;
 			me.show_dialog();
-		} else if (contact){
-			this.get_contact_number(contact, ref_doctype, ref_name)
+		} else if (contact) {
+			this.get_contact_number(contact, ref_doctype, ref_name);
 		} else {
 			me.show_dialog();
 		}
-	}
-	this.show_dialog = function() {
-		if(!me.dialog)
-			me.make_dialog();
+	};
+	this.show_dialog = function () {
+		if (!me.dialog) me.make_dialog();
 		me.dialog.set_values({
-			'message': me.message,
-			'number': me.number
-		})
+			message: me.message,
+			number: me.number,
+		});
 		me.dialog.show();
-	}
-	this.make_dialog = function() {
+	};
+	this.make_dialog = function () {
 		var d = new frappe.ui.Dialog({
-			title: 'Send SMS',
+			title: "Send SMS",
 			width: 400,
 			fields: [
-				{fieldname:'number', fieldtype:'Data', label:'Mobile Number', reqd:1},
-				{fieldname:'message', fieldtype:'Text', label:'Message', reqd:1},
-				{fieldname:'send', fieldtype:'Button', label:'Send'}
-			]
-		})
-		d.fields_dict.send.input.onclick = function() {
+				{ fieldname: "number", fieldtype: "Data", label: "Mobile Number", reqd: 1 },
+				{ fieldname: "message", fieldtype: "Text", label: "Message", reqd: 1 },
+				{ fieldname: "send", fieldtype: "Button", label: "Send" },
+			],
+		});
+		d.fields_dict.send.input.onclick = function () {
 			var btn = d.fields_dict.send.input;
 			var v = me.dialog.get_values();
-			if(v) {
+			if (v) {
 				$(btn).set_working();
 				frappe.call({
 					method: "frappe.core.doctype.sms_settings.sms_settings.send_sms",
 					args: {
 						receiver_list: [v.number],
-						msg: v.message
+						msg: v.message,
 					},
-					callback: function(r) {
+					callback: function (r) {
 						$(btn).done_working();
-						if(r.exc) {frappe.msgprint(r.exc); return; }
+						if (r.exc) {
+							frappe.msgprint(r.exc);
+							return;
+						}
 						me.dialog.hide();
-					}
+					},
 				});
 			}
-		}
+		};
 		this.dialog = d;
-	}
+	};
 	this.setup();
-}
+};
diff --git a/erpnext/public/js/stock_analytics.js b/erpnext/public/js/stock_analytics.js
index 98e7f78..37f6379 100644
--- a/erpnext/public/js/stock_analytics.js
+++ b/erpnext/public/js/stock_analytics.js
@@ -1,68 +1,104 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-
 erpnext.StockAnalytics = class StockAnalytics extends erpnext.StockGridReport {
 	constructor(wrapper, opts) {
 		var args = {
 			title: __("Stock Analytics"),
-			parent: $(wrapper).find('.layout-main'),
+			parent: $(wrapper).find(".layout-main"),
 			page: wrapper.page,
-			doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand",
-				"Fiscal Year", "Serial No"],
+			doctypes: [
+				"Item",
+				"Item Group",
+				"Warehouse",
+				"Stock Ledger Entry",
+				"Brand",
+				"Fiscal Year",
+				"Serial No",
+			],
 			tree_grid: {
 				show: true,
 				parent_field: "parent_item_group",
-				formatter: function(item) {
-					if(!item.is_group) {
-						return repl("<a \
+				formatter: function (item) {
+					if (!item.is_group) {
+						return repl(
+							"<a \
 							onclick='frappe.cur_grid_report.show_stock_ledger(\"%(value)s\")'>\
-							%(value)s</a>", {
+							%(value)s</a>",
+							{
 								value: item.name,
-							});
+							}
+						);
 					} else {
 						return item.name;
 					}
-
-				}
+				},
 			},
-		}
+		};
 
-		if(opts) $.extend(args, opts);
+		if (opts) $.extend(args, opts);
 
 		super(args);
 
 		this.filters = [
-			{fieldtype:"Select", label: __("Value or Qty"), fieldname: "value_or_qty",
-				options:[{label:__("Value"), value:"Value"}, {label:__("Quantity"), value:"Quantity"}],
-				filter: function(val, item, opts, me) {
+			{
+				fieldtype: "Select",
+				label: __("Value or Qty"),
+				fieldname: "value_or_qty",
+				options: [
+					{ label: __("Value"), value: "Value" },
+					{ label: __("Quantity"), value: "Quantity" },
+				],
+				filter: function (val, item, opts, me) {
 					return me.apply_zero_filter(val, item, opts, me);
-				}},
-			{fieldtype:"Select", label: __("Brand"), link:"Brand", fieldname: "brand",
-				default_value: __("Select Brand..."), filter: function(val, item, opts) {
+				},
+			},
+			{
+				fieldtype: "Select",
+				label: __("Brand"),
+				link: "Brand",
+				fieldname: "brand",
+				default_value: __("Select Brand..."),
+				filter: function (val, item, opts) {
 					return val == opts.default_value || item.brand == val || item._show;
-				}, link_formatter: {filter_input: "brand"}},
-			{fieldtype:"Select", label: __("Warehouse"), link:"Warehouse", fieldname: "warehouse",
-				default_value: __("Select Warehouse...")},
-			{fieldtype:"Date", label: __("From Date"), fieldname: "from_date"},
-			{fieldtype:"Date", label: __("To Date"), fieldname: "to_date"},
-			{fieldtype:"Select", label: __("Range"), fieldname: "range",
-				options:[
-					{label:__("Daily"), value:"Daily"},
-					{label:__("Weekly"), value:"Weekly"},
-					{label:__("Monthly"), value:"Monthly"},
-					{label:__("Quarterly"), value:"Quarterly"},
-					{label:__("Yearly"), value:"Yearly"},
-				]}
+				},
+				link_formatter: { filter_input: "brand" },
+			},
+			{
+				fieldtype: "Select",
+				label: __("Warehouse"),
+				link: "Warehouse",
+				fieldname: "warehouse",
+				default_value: __("Select Warehouse..."),
+			},
+			{ fieldtype: "Date", label: __("From Date"), fieldname: "from_date" },
+			{ fieldtype: "Date", label: __("To Date"), fieldname: "to_date" },
+			{
+				fieldtype: "Select",
+				label: __("Range"),
+				fieldname: "range",
+				options: [
+					{ label: __("Daily"), value: "Daily" },
+					{ label: __("Weekly"), value: "Weekly" },
+					{ label: __("Monthly"), value: "Monthly" },
+					{ label: __("Quarterly"), value: "Quarterly" },
+					{ label: __("Yearly"), value: "Yearly" },
+				],
+			},
 		];
 	}
 	setup_columns() {
 		var std_columns = [
-			{id: "name", name: __("Item"), field: "name", width: 300},
-			{id: "brand", name: __("Brand"), field: "brand", width: 100},
-			{id: "stock_uom", name: __("UOM"), field: "stock_uom", width: 100},
-			{id: "opening", name: __("Opening"), field: "opening", hidden: true,
-				formatter: this.currency_formatter}
+			{ id: "name", name: __("Item"), field: "name", width: 300 },
+			{ id: "brand", name: __("Brand"), field: "brand", width: 100 },
+			{ id: "stock_uom", name: __("UOM"), field: "stock_uom", width: 100 },
+			{
+				id: "opening",
+				name: __("Opening"),
+				field: "opening",
+				hidden: true,
+				formatter: this.currency_formatter,
+			},
 		];
 
 		this.make_date_range_columns();
@@ -79,24 +115,24 @@
 	}
 	init_filter_values() {
 		super.init_filter_values();
-		this.filter_inputs.range && this.filter_inputs.range.val('Monthly');
+		this.filter_inputs.range && this.filter_inputs.range.val("Monthly");
 	}
 	prepare_data() {
 		var me = this;
 
-		if(!this.data) {
+		if (!this.data) {
 			var items = this.prepare_tree("Item", "Item Group");
 
 			me.parent_map = {};
 			me.item_by_name = {};
 			me.data = [];
 
-			$.each(items, function(i, v) {
+			$.each(items, function (i, v) {
 				var d = copy_dict(v);
 
 				me.data.push(d);
 				me.item_by_name[d.name] = d;
-				if(d.parent_item_group) {
+				if (d.parent_item_group) {
 					me.parent_map[d.name] = d.parent_item_group;
 				}
 				me.reset_item_values(d);
@@ -105,7 +141,7 @@
 			this.data[0].checked = true;
 		} else {
 			// otherwise, only reset values
-			$.each(this.data, function(i, d) {
+			$.each(this.data, function (i, d) {
 				me.reset_item_values(d);
 				d["closing_qty_value"] = 0;
 			});
@@ -113,7 +149,6 @@
 
 		this.prepare_balances();
 		this.update_groups();
-
 	}
 	prepare_balances() {
 		var me = this;
@@ -124,24 +159,25 @@
 		this.item_warehouse = {};
 		this.serialized_buying_rates = this.get_serialized_buying_rates();
 
-		for(var i=0, j=data.length; i<j; i++) {
+		for (var i = 0, j = data.length; i < j; i++) {
 			let diff = 0;
 			var sl = data[i];
 			sl.posting_datetime = sl.posting_date + " " + sl.posting_time;
 			var posting_datetime = frappe.datetime.str_to_obj(sl.posting_datetime);
 
-			if(me.is_default("warehouse") ? true : me.warehouse == sl.warehouse) {
+			if (me.is_default("warehouse") ? true : me.warehouse == sl.warehouse) {
 				var item = me.item_by_name[sl.item_code];
-				if(item.closing_qty_value==undefined) item.closing_qty_value = 0;
+				if (item.closing_qty_value == undefined) item.closing_qty_value = 0;
 
-				if(me.value_or_qty!="Quantity") {
+				if (me.value_or_qty != "Quantity") {
 					var wh = me.get_item_warehouse(sl.warehouse, sl.item_code);
-					var valuation_method = item.valuation_method ?
-						item.valuation_method : frappe.sys_defaults.valuation_method;
+					var valuation_method = item.valuation_method
+						? item.valuation_method
+						: frappe.sys_defaults.valuation_method;
 					var is_fifo = valuation_method == "FIFO";
 
-					if(sl.voucher_type=="Stock Reconciliation") {
-						diff = (sl.qty_after_transaction * sl.valuation_rate) - item.closing_qty_value;
+					if (sl.voucher_type == "Stock Reconciliation") {
+						diff = sl.qty_after_transaction * sl.valuation_rate - item.closing_qty_value;
 						wh.fifo_stack = [[sl.qty_after_transaction, sl.valuation_rate, sl.posting_date]];
 						wh.balance_qty = sl.qty_after_transaction;
 						wh.balance_value = sl.valuation_rate * sl.qty_after_transaction;
@@ -149,16 +185,16 @@
 						diff = me.get_value_diff(wh, sl, is_fifo);
 					}
 				} else {
-					if(sl.voucher_type=="Stock Reconciliation") {
+					if (sl.voucher_type == "Stock Reconciliation") {
 						diff = sl.qty_after_transaction - item.closing_qty_value;
 					} else {
 						diff = sl.qty;
 					}
 				}
 
-				if(posting_datetime < from_date) {
+				if (posting_datetime < from_date) {
 					item.opening += diff;
-				} else if(posting_datetime <= to_date) {
+				} else if (posting_datetime <= to_date) {
 					item[me.column_map[sl.posting_date].field] += diff;
 				} else {
 					break;
@@ -170,25 +206,23 @@
 	}
 	update_groups() {
 		var me = this;
-		$.each(this.data, function(i, item) {
+		$.each(this.data, function (i, item) {
 			// update groups
-			if(!item.is_group && me.apply_filter(item, "brand")) {
+			if (!item.is_group && me.apply_filter(item, "brand")) {
 				var balance = item.opening;
-				$.each(me.columns, function(i, col) {
-					if(col.formatter==me.currency_formatter && !col.hidden) {
+				$.each(me.columns, function (i, col) {
+					if (col.formatter == me.currency_formatter && !col.hidden) {
 						item[col.field] = balance + item[col.field];
 						balance = item[col.field];
 					}
 				});
 
 				var parent = me.parent_map[item.name];
-				while(parent) {
+				while (parent) {
 					var parent_group = me.item_by_name[parent];
-					$.each(me.columns, function(c, col) {
+					$.each(me.columns, function (c, col) {
 						if (col.formatter == me.currency_formatter) {
-							parent_group[col.field] =
-								flt(parent_group[col.field])
-								+ flt(item[col.field]);
+							parent_group[col.field] = flt(parent_group[col.field]) + flt(item[col.field]);
 						}
 					});
 					parent = me.parent_map[parent];
@@ -200,7 +234,7 @@
 		frappe.route_options = {
 			item_code: item_code,
 			from_date: this.from_date,
-			to_date: this.to_date
+			to_date: this.to_date,
 		};
 		frappe.set_route("query-report", "Stock Ledger");
 	}
diff --git a/erpnext/public/js/stock_grid_report.js b/erpnext/public/js/stock_grid_report.js
index c7867d0..e45f6dd 100644
--- a/erpnext/public/js/stock_grid_report.js
+++ b/erpnext/public/js/stock_grid_report.js
@@ -3,10 +3,13 @@
 
 erpnext.StockGridReport = class StockGridReport extends frappe.views.TreeGridReport {
 	get_item_warehouse(warehouse, item) {
-		if(!this.item_warehouse[item]) this.item_warehouse[item] = {};
-		if(!this.item_warehouse[item][warehouse]) this.item_warehouse[item][warehouse] = {
-			balance_qty: 0.0, balance_value: 0.0, fifo_stack: []
-		};
+		if (!this.item_warehouse[item]) this.item_warehouse[item] = {};
+		if (!this.item_warehouse[item][warehouse])
+			this.item_warehouse[item][warehouse] = {
+				balance_qty: 0.0,
+				balance_value: 0.0,
+				fifo_stack: [],
+			};
 		return this.item_warehouse[item][warehouse];
 	}
 
@@ -14,47 +17,43 @@
 		// value
 		let value_diff = 0;
 
-		if(sl.qty > 0) {
+		if (sl.qty > 0) {
 			// incoming - rate is given
 			let rate = sl.incoming_rate;
 			let add_qty = sl.qty;
-			if(wh.balance_qty < 0) {
+			if (wh.balance_qty < 0) {
 				// negative valuation
 				// only add value of quantity if
 				// the balance goes above 0
 				add_qty = wh.balance_qty + sl.qty;
-				if(add_qty < 0) {
+				if (add_qty < 0) {
 					add_qty = 0;
 				}
 			}
 
-			if(sl.serial_no) {
+			if (sl.serial_no) {
 				value_diff = this.get_serialized_value_diff(sl);
 			} else {
-				value_diff = (rate * add_qty);
+				value_diff = rate * add_qty;
 			}
 
-			if(add_qty)
-				wh.fifo_stack.push([add_qty, sl.incoming_rate, sl.posting_date]);
+			if (add_qty) wh.fifo_stack.push([add_qty, sl.incoming_rate, sl.posting_date]);
 		} else {
 			// called everytime for maintaining fifo stack
 			var fifo_value_diff = this.get_fifo_value_diff(wh, sl);
 
 			// outgoing
-			if(sl.serial_no) {
+			if (sl.serial_no) {
 				value_diff = -1 * this.get_serialized_value_diff(sl);
-			} else if(is_fifo) {
+			} else if (is_fifo) {
 				value_diff = fifo_value_diff;
 			} else {
 				// average rate for weighted average
-				let rate = (wh.balance_qty.toFixed(2) == 0.00 ? 0 :
-					flt(wh.balance_value) / flt(wh.balance_qty));
+				let rate = wh.balance_qty.toFixed(2) == 0.0 ? 0 : flt(wh.balance_value) / flt(wh.balance_qty);
 
 				// no change in value if negative qty
-				if((wh.balance_qty + sl.qty).toFixed(2) >= 0.00)
-					value_diff = (rate * sl.qty);
-				else
-					value_diff = -wh.balance_value;
+				if ((wh.balance_qty + sl.qty).toFixed(2) >= 0.0) value_diff = rate * sl.qty;
+				else value_diff = -wh.balance_value;
 			}
 		}
 
@@ -69,14 +68,14 @@
 		var fifo_value_diff = 0.0;
 		var qty = -sl.qty;
 
-		for(var i=0, j=fifo_stack.length; i<j; i++) {
+		for (var i = 0, j = fifo_stack.length; i < j; i++) {
 			var batch = fifo_stack.pop();
-			if(batch[0] >= qty) {
+			if (batch[0] >= qty) {
 				batch[0] = batch[0] - qty;
-				fifo_value_diff += (qty * batch[1]);
+				fifo_value_diff += qty * batch[1];
 
 				qty = 0.0;
-				if(batch[0]) {
+				if (batch[0]) {
 					// batch still has qty put it back
 					fifo_stack.push(batch);
 				}
@@ -85,7 +84,7 @@
 				break;
 			} else {
 				// consume this batch fully
-				fifo_value_diff += (batch[0] * batch[1]);
+				fifo_value_diff += batch[0] * batch[1];
 				qty = qty - batch[0];
 			}
 		}
@@ -99,8 +98,8 @@
 
 		var value_diff = 0.0;
 
-		$.each(sl.serial_no.trim().split("\n"), function(i, sr) {
-			if(sr) {
+		$.each(sl.serial_no.trim().split("\n"), function (i, sr) {
+			if (sr) {
 				value_diff += flt(me.serialized_buying_rates[sr.trim().toLowerCase()]);
 			}
 		});
@@ -112,7 +111,7 @@
 		var serialized_buying_rates = {};
 
 		if (frappe.report_dump.data["Serial No"]) {
-			$.each(frappe.report_dump.data["Serial No"], function(i, sn) {
+			$.each(frappe.report_dump.data["Serial No"], function (i, sn) {
 				serialized_buying_rates[sn.name.toLowerCase()] = flt(sn.incoming_rate);
 			});
 		}
diff --git a/erpnext/public/js/telephony.js b/erpnext/public/js/telephony.js
index f4b0b18..39d9c0f 100644
--- a/erpnext/public/js/telephony.js
+++ b/erpnext/public/js/telephony.js
@@ -1,13 +1,17 @@
-frappe.ui.form.ControlData = class ControlData extends frappe.ui.form.ControlData  {
+frappe.ui.form.ControlData = class ControlData extends frappe.ui.form.ControlData {
 	make_input() {
 		super.make_input();
-		if (this.df.options == 'Phone') {
+		if (this.df.options == "Phone") {
 			this.setup_phone();
 		}
 		if (this.frm && this.frm.fields_dict) {
-			Object.values(this.frm.fields_dict).forEach(function(field) {
-				if (field.df.read_only === 1 && field.df.options === 'Phone'
-					&& field.disp_area.style[0] != 'display' && !field.has_icon) {
+			Object.values(this.frm.fields_dict).forEach(function (field) {
+				if (
+					field.df.read_only === 1 &&
+					field.df.options === "Phone" &&
+					field.disp_area.style[0] != "display" &&
+					!field.has_icon
+				) {
 					field.setup_phone && field.setup_phone();
 					field.has_icon = true;
 				}
@@ -16,15 +20,18 @@
 	}
 	setup_phone() {
 		if (frappe.phone_call.handler) {
-			let control = this.df.read_only ? '.control-value' : '.control-input';
-			this.$wrapper.find(control)
-				.append(`
+			let control = this.df.read_only ? ".control-value" : ".control-input";
+			this.$wrapper
+				.find(control)
+				.append(
+					`
 					<span class="phone-btn">
-						<a class="btn-open no-decoration" title="${__('Make a call')}">
-							${frappe.utils.icon('call')}
+						<a class="btn-open no-decoration" title="${__("Make a call")}">
+							${frappe.utils.icon("call")}
 					</span>
-				`)
-				.find('.phone-btn')
+				`
+				)
+				.find(".phone-btn")
 				.click(() => {
 					frappe.phone_call.handler(this.get_value(), this.frm);
 				});
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index 61b8f35..f17f60a 100755
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -4,44 +4,42 @@
 frappe.provide("erpnext.utils");
 
 $.extend(erpnext, {
-	get_currency: function(company) {
-		if(!company && cur_frm)
-			company = cur_frm.doc.company;
-		if(company)
+	get_currency: function (company) {
+		if (!company && cur_frm) company = cur_frm.doc.company;
+		if (company)
 			return frappe.get_doc(":Company", company)?.default_currency || frappe.boot.sysdefaults.currency;
-		else
-			return frappe.boot.sysdefaults.currency;
+		else return frappe.boot.sysdefaults.currency;
 	},
 
 	get_presentation_currency_list: () => {
 		const docs = frappe.boot.docs;
-		let currency_list = docs.filter(d => d.doctype === ":Currency").map(d => d.name);
+		let currency_list = docs.filter((d) => d.doctype === ":Currency").map((d) => d.name);
 		currency_list.unshift("");
 		return currency_list;
 	},
 
-	toggle_naming_series: function() {
-		if(cur_frm && cur_frm.fields_dict.naming_series) {
-			cur_frm.toggle_display("naming_series", cur_frm.doc.__islocal?true:false);
+	toggle_naming_series: function () {
+		if (cur_frm && cur_frm.fields_dict.naming_series) {
+			cur_frm.toggle_display("naming_series", cur_frm.doc.__islocal ? true : false);
 		}
 	},
 
-	hide_company: function(frm) {
-		if(frm?.fields_dict.company) {
+	hide_company: function (frm) {
+		if (frm?.fields_dict.company) {
 			var companies = Object.keys(locals[":Company"] || {});
-			if(companies.length === 1) {
-				if(!frm.doc.company) frm.set_value("company", companies[0]);
+			if (companies.length === 1) {
+				if (!frm.doc.company) frm.set_value("company", companies[0]);
 				frm.toggle_display("company", false);
-			} else if(erpnext.last_selected_company) {
-				if(!frm.doc.company) frm.set_value("company", erpnext.last_selected_company);
+			} else if (erpnext.last_selected_company) {
+				if (!frm.doc.company) frm.set_value("company", erpnext.last_selected_company);
 			}
 		}
 	},
 
-	is_perpetual_inventory_enabled: function(company) {
-		if(company) {
+	is_perpetual_inventory_enabled: function (company) {
+		if (company) {
 			let company_local = locals[":Company"] && locals[":Company"][company];
-			if(company_local) {
+			if (company_local) {
 				return cint(company_local.enable_perpetual_inventory);
 			}
 		}
@@ -51,301 +49,346 @@
 		return cint(frappe.boot.sysdefaults.allow_stale);
 	},
 
-	setup_serial_or_batch_no: function() {
+	setup_serial_or_batch_no: function () {
 		let grid_row = cur_frm.open_grid_row();
-		if (!grid_row || !grid_row.grid_form.fields_dict.serial_no ||
-			grid_row.grid_form.fields_dict.serial_no.get_status() !== "Write") return;
+		if (
+			!grid_row ||
+			!grid_row.grid_form.fields_dict.serial_no ||
+			grid_row.grid_form.fields_dict.serial_no.get_status() !== "Write"
+		)
+			return;
 
-		frappe.model.get_value('Item', {'name': grid_row.doc.item_code},
-			['has_serial_no', 'has_batch_no'], ({has_serial_no, has_batch_no}) => {
-				Object.assign(grid_row.doc, {has_serial_no, has_batch_no});
+		frappe.model.get_value(
+			"Item",
+			{ name: grid_row.doc.item_code },
+			["has_serial_no", "has_batch_no"],
+			({ has_serial_no, has_batch_no }) => {
+				Object.assign(grid_row.doc, { has_serial_no, has_batch_no });
 
 				if (has_serial_no) {
-					attach_selector_button(__("Add Serial No"),
-						grid_row.grid_form.fields_dict.serial_no.$wrapper, this, grid_row);
+					attach_selector_button(
+						__("Add Serial No"),
+						grid_row.grid_form.fields_dict.serial_no.$wrapper,
+						this,
+						grid_row
+					);
 				} else if (has_batch_no) {
-					attach_selector_button(__("Pick Batch No"),
-						grid_row.grid_form.fields_dict.batch_no.$wrapper, this, grid_row);
+					attach_selector_button(
+						__("Pick Batch No"),
+						grid_row.grid_form.fields_dict.batch_no.$wrapper,
+						this,
+						grid_row
+					);
 				}
 			}
 		);
 	},
 
 	route_to_adjustment_jv: (args) => {
-		frappe.model.with_doctype('Journal Entry', () => {
+		frappe.model.with_doctype("Journal Entry", () => {
 			// route to adjustment Journal Entry to handle Account Balance and Stock Value mismatch
-			let journal_entry = frappe.model.get_new_doc('Journal Entry');
+			let journal_entry = frappe.model.get_new_doc("Journal Entry");
 
 			args.accounts.forEach((je_account) => {
 				let child_row = frappe.model.add_child(journal_entry, "accounts");
 				child_row.account = je_account.account;
 				child_row.debit_in_account_currency = je_account.debit_in_account_currency;
 				child_row.credit_in_account_currency = je_account.credit_in_account_currency;
-				child_row.party_type = "" ;
+				child_row.party_type = "";
 			});
-			frappe.set_route('Form','Journal Entry', journal_entry.name);
+			frappe.set_route("Form", "Journal Entry", journal_entry.name);
 		});
 	},
 
 	route_to_pending_reposts: (args) => {
-		frappe.set_route('List', 'Repost Item Valuation', args);
+		frappe.set_route("List", "Repost Item Valuation", args);
 	},
 });
 
-
 $.extend(erpnext.utils, {
-	set_party_dashboard_indicators: function(frm) {
-		if(frm.doc.__onload && frm.doc.__onload.dashboard_info) {
+	set_party_dashboard_indicators: function (frm) {
+		if (frm.doc.__onload && frm.doc.__onload.dashboard_info) {
 			var company_wise_info = frm.doc.__onload.dashboard_info;
-			if(company_wise_info.length > 1) {
-				company_wise_info.forEach(function(info) {
+			if (company_wise_info.length > 1) {
+				company_wise_info.forEach(function (info) {
 					erpnext.utils.add_indicator_for_multicompany(frm, info);
 				});
 			} else if (company_wise_info.length === 1) {
-				frm.dashboard.add_indicator(__('Annual Billing: {0}',
-					[format_currency(company_wise_info[0].billing_this_year, company_wise_info[0].currency)]), 'blue');
-				frm.dashboard.add_indicator(__('Total Unpaid: {0}',
-					[format_currency(company_wise_info[0].total_unpaid, company_wise_info[0].currency)]),
-				company_wise_info[0].total_unpaid ? 'orange' : 'green');
+				frm.dashboard.add_indicator(
+					__("Annual Billing: {0}", [
+						format_currency(
+							company_wise_info[0].billing_this_year,
+							company_wise_info[0].currency
+						),
+					]),
+					"blue"
+				);
+				frm.dashboard.add_indicator(
+					__("Total Unpaid: {0}", [
+						format_currency(company_wise_info[0].total_unpaid, company_wise_info[0].currency),
+					]),
+					company_wise_info[0].total_unpaid ? "orange" : "green"
+				);
 
-				if(company_wise_info[0].loyalty_points) {
-					frm.dashboard.add_indicator(__('Loyalty Points: {0}',
-						[company_wise_info[0].loyalty_points]), 'blue');
+				if (company_wise_info[0].loyalty_points) {
+					frm.dashboard.add_indicator(
+						__("Loyalty Points: {0}", [company_wise_info[0].loyalty_points]),
+						"blue"
+					);
 				}
 			}
 		}
 	},
 
-	view_serial_batch_nos: function(frm) {
+	view_serial_batch_nos: function (frm) {
 		if (!frm.doc?.items) {
 			return;
 		}
 
-		let bundle_ids = frm.doc.items.filter(d => d.serial_and_batch_bundle);
+		let bundle_ids = frm.doc.items.filter((d) => d.serial_and_batch_bundle);
 
 		if (bundle_ids?.length) {
-			frm.add_custom_button(__('Serial / Batch Nos'), () => {
-				frappe.route_options = {
-					"voucher_no": frm.doc.name,
-					"voucher_type": frm.doc.doctype,
-					"from_date": frm.doc.posting_date || frm.doc.transaction_date,
-					"to_date": frm.doc.posting_date || frm.doc.transaction_date,
-					"company": frm.doc.company,
-				};
-				frappe.set_route("query-report", "Serial and Batch Summary");
-			}, __('View'));
+			frm.add_custom_button(
+				__("Serial / Batch Nos"),
+				() => {
+					frappe.route_options = {
+						voucher_no: frm.doc.name,
+						voucher_type: frm.doc.doctype,
+						from_date: frm.doc.posting_date || frm.doc.transaction_date,
+						to_date: frm.doc.posting_date || frm.doc.transaction_date,
+						company: frm.doc.company,
+					};
+					frappe.set_route("query-report", "Serial and Batch Summary");
+				},
+				__("View")
+			);
 		}
 	},
 
-	add_indicator_for_multicompany: function(frm, info) {
+	add_indicator_for_multicompany: function (frm, info) {
 		frm.dashboard.stats_area.show();
-		frm.dashboard.stats_area_row.addClass('flex');
-		frm.dashboard.stats_area_row.css('flex-wrap', 'wrap');
+		frm.dashboard.stats_area_row.addClass("flex");
+		frm.dashboard.stats_area_row.css("flex-wrap", "wrap");
 
-		var color = info.total_unpaid ? 'orange' : 'green';
+		var color = info.total_unpaid ? "orange" : "green";
 
-		var indicator = $('<div class="flex-column col-xs-6">'+
-			'<div style="margin-top:10px"><h6>'+info.company+'</h6></div>'+
+		var indicator = $(
+			'<div class="flex-column col-xs-6">' +
+				'<div style="margin-top:10px"><h6>' +
+				info.company +
+				"</h6></div>" +
+				'<div class="badge-link small" style="margin-bottom:10px"><span class="indicator blue">' +
+				"Annual Billing: " +
+				format_currency(info.billing_this_year, info.currency) +
+				"</span></div>" +
+				'<div class="badge-link small" style="margin-bottom:10px">' +
+				'<span class="indicator ' +
+				color +
+				'">Total Unpaid: ' +
+				format_currency(info.total_unpaid, info.currency) +
+				"</span></div>" +
+				"</div>"
+		).appendTo(frm.dashboard.stats_area_row);
 
-			'<div class="badge-link small" style="margin-bottom:10px"><span class="indicator blue">'+
-			'Annual Billing: '+format_currency(info.billing_this_year, info.currency)+'</span></div>'+
-
-			'<div class="badge-link small" style="margin-bottom:10px">'+
-			'<span class="indicator '+color+'">Total Unpaid: '
-			+format_currency(info.total_unpaid, info.currency)+'</span></div>'+
-
-
-			'</div>').appendTo(frm.dashboard.stats_area_row);
-
-		if(info.loyalty_points){
-			$('<div class="badge-link small" style="margin-bottom:10px"><span class="indicator blue">'+
-			'Loyalty Points: '+info.loyalty_points+'</span></div>').appendTo(indicator);
+		if (info.loyalty_points) {
+			$(
+				'<div class="badge-link small" style="margin-bottom:10px"><span class="indicator blue">' +
+					"Loyalty Points: " +
+					info.loyalty_points +
+					"</span></div>"
+			).appendTo(indicator);
 		}
 
 		return indicator;
 	},
 
-	get_party_name: function(party_type) {
-		var dict = {'Customer': 'customer_name', 'Supplier': 'supplier_name', 'Employee': 'employee_name',
-			'Member': 'member_name'};
+	get_party_name: function (party_type) {
+		var dict = {
+			Customer: "customer_name",
+			Supplier: "supplier_name",
+			Employee: "employee_name",
+			Member: "member_name",
+		};
 		return dict[party_type];
 	},
 
-	copy_value_in_all_rows: function(doc, dt, dn, table_fieldname, fieldname) {
+	copy_value_in_all_rows: function (doc, dt, dn, table_fieldname, fieldname) {
 		var d = locals[dt][dn];
-		if(d[fieldname]){
+		if (d[fieldname]) {
 			var cl = doc[table_fieldname] || [];
-			for(var i = 0; i < cl.length; i++) {
-				if(!cl[i][fieldname]) cl[i][fieldname] = d[fieldname];
+			for (var i = 0; i < cl.length; i++) {
+				if (!cl[i][fieldname]) cl[i][fieldname] = d[fieldname];
 			}
 		}
 		refresh_field(table_fieldname);
 	},
 
-	get_terms: function(tc_name, doc, callback) {
-		if(tc_name) {
+	get_terms: function (tc_name, doc, callback) {
+		if (tc_name) {
 			return frappe.call({
-				method: 'erpnext.setup.doctype.terms_and_conditions.terms_and_conditions.get_terms_and_conditions',
+				method: "erpnext.setup.doctype.terms_and_conditions.terms_and_conditions.get_terms_and_conditions",
 				args: {
 					template_name: tc_name,
-					doc: doc
+					doc: doc,
 				},
-				callback: function(r) {
-					callback(r)
-				}
+				callback: function (r) {
+					callback(r);
+				},
 			});
 		}
 	},
 
-	make_bank_account: function(doctype, docname) {
+	make_bank_account: function (doctype, docname) {
 		frappe.call({
 			method: "erpnext.accounts.doctype.bank_account.bank_account.make_bank_account",
 			args: {
 				doctype: doctype,
-				docname: docname
+				docname: docname,
 			},
 			freeze: true,
-			callback: function(r) {
+			callback: function (r) {
 				var doclist = frappe.model.sync(r.message);
 				frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
-			}
-		})
+			},
+		});
 	},
 
-	add_dimensions: function(report_name, index) {
+	add_dimensions: function (report_name, index) {
 		let filters = frappe.query_reports[report_name].filters;
 
 		frappe.call({
 			method: "erpnext.accounts.doctype.accounting_dimension.accounting_dimension.get_dimensions",
-			callback: function(r) {
+			callback: function (r) {
 				let accounting_dimensions = r.message[0];
 				accounting_dimensions.forEach((dimension) => {
-					let found = filters.some(el => el.fieldname === dimension['fieldname']);
+					let found = filters.some((el) => el.fieldname === dimension["fieldname"]);
 
 					if (!found) {
 						filters.splice(index, 0, {
-							"fieldname": dimension["fieldname"],
-							"label": __(dimension["label"]),
-							"fieldtype": "MultiSelectList",
-							get_data: function(txt) {
+							fieldname: dimension["fieldname"],
+							label: __(dimension["label"]),
+							fieldtype: "MultiSelectList",
+							get_data: function (txt) {
 								return frappe.db.get_link_options(dimension["document_type"], txt);
 							},
 						});
 					}
 				});
-			}
+			},
 		});
 	},
 
-	add_inventory_dimensions: function(report_name, index) {
+	add_inventory_dimensions: function (report_name, index) {
 		let filters = frappe.query_reports[report_name].filters;
 
 		frappe.call({
 			method: "erpnext.stock.doctype.inventory_dimension.inventory_dimension.get_inventory_dimensions",
-			callback: function(r) {
+			callback: function (r) {
 				if (r.message && r.message.length) {
 					r.message.forEach((dimension) => {
-						let existing_filter = filters.filter(el => el.fieldname === dimension['fieldname']);
+						let existing_filter = filters.filter((el) => el.fieldname === dimension["fieldname"]);
 
 						if (!existing_filter.length) {
 							filters.splice(index, 0, {
-								"fieldname": dimension["fieldname"],
-								"label": __(dimension["doctype"]),
-								"fieldtype": "MultiSelectList",
-								get_data: function(txt) {
+								fieldname: dimension["fieldname"],
+								label: __(dimension["doctype"]),
+								fieldtype: "MultiSelectList",
+								get_data: function (txt) {
 									return frappe.db.get_link_options(dimension["doctype"], txt);
 								},
 							});
 						} else {
-							existing_filter[0]['fieldtype'] = "MultiSelectList";
-							existing_filter[0]['get_data'] = function(txt) {
+							existing_filter[0]["fieldtype"] = "MultiSelectList";
+							existing_filter[0]["get_data"] = function (txt) {
 								return frappe.db.get_link_options(dimension["doctype"], txt);
-							}
+							};
 						}
 					});
 				}
-			}
+			},
 		});
 	},
 
-	make_subscription: function(doctype, docname) {
+	make_subscription: function (doctype, docname) {
 		frappe.call({
 			method: "frappe.automation.doctype.auto_repeat.auto_repeat.make_auto_repeat",
 			args: {
 				doctype: doctype,
-				docname: docname
+				docname: docname,
 			},
-			callback: function(r) {
+			callback: function (r) {
 				var doclist = frappe.model.sync(r.message);
 				frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
-			}
-		})
+			},
+		});
 	},
 
-	make_pricing_rule: function(doctype, docname) {
+	make_pricing_rule: function (doctype, docname) {
 		frappe.call({
 			method: "erpnext.accounts.doctype.pricing_rule.pricing_rule.make_pricing_rule",
 			args: {
 				doctype: doctype,
-				docname: docname
+				docname: docname,
 			},
-			callback: function(r) {
+			callback: function (r) {
 				var doclist = frappe.model.sync(r.message);
 				frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
-			}
-		})
+			},
+		});
 	},
 
 	/**
-	* Checks if the first row of a given child table is empty
-	* @param child_table - Child table Doctype
-	* @return {Boolean}
-	**/
-	first_row_is_empty: function(child_table){
-		if($.isArray(child_table) && child_table.length > 0) {
+	 * Checks if the first row of a given child table is empty
+	 * @param child_table - Child table Doctype
+	 * @return {Boolean}
+	 **/
+	first_row_is_empty: function (child_table) {
+		if ($.isArray(child_table) && child_table.length > 0) {
 			return !child_table[0].item_code;
 		}
 		return false;
 	},
 
 	/**
-	* Removes the first row of a child table if it is empty
-	* @param {_Frm} frm - The current form
-	* @param {String} child_table_name - The child table field name
-	* @return {Boolean}
-	**/
-	remove_empty_first_row: function(frm, child_table_name){
-		const rows = frm['doc'][child_table_name];
-		if (this.first_row_is_empty(rows)){
-			frm['doc'][child_table_name] = rows.splice(1);
+	 * Removes the first row of a child table if it is empty
+	 * @param {_Frm} frm - The current form
+	 * @param {String} child_table_name - The child table field name
+	 * @return {Boolean}
+	 **/
+	remove_empty_first_row: function (frm, child_table_name) {
+		const rows = frm["doc"][child_table_name];
+		if (this.first_row_is_empty(rows)) {
+			frm["doc"][child_table_name] = rows.splice(1);
 		}
 		return rows;
 	},
-	get_tree_options: function(option) {
+	get_tree_options: function (option) {
 		// get valid options for tree based on user permission & locals dict
 		let unscrub_option = frappe.model.unscrub(option);
 		let user_permission = frappe.defaults.get_user_permissions();
 		let options;
 
-		if(user_permission && user_permission[unscrub_option]) {
-			options = user_permission[unscrub_option].map(perm => perm.doc);
+		if (user_permission && user_permission[unscrub_option]) {
+			options = user_permission[unscrub_option].map((perm) => perm.doc);
 		} else {
-			options = $.map(locals[`:${unscrub_option}`], function(c) { return c.name; }).sort();
+			options = $.map(locals[`:${unscrub_option}`], function (c) {
+				return c.name;
+			}).sort();
 		}
 
 		// filter unique values, as there may be multiple user permissions for any value
 		return options.filter((value, index, self) => self.indexOf(value) === index);
 	},
-	get_tree_default: function(option) {
+	get_tree_default: function (option) {
 		// set default for a field based on user permission
 		let options = this.get_tree_options(option);
-		if(options.includes(frappe.defaults.get_default(option))) {
+		if (options.includes(frappe.defaults.get_default(option))) {
 			return frappe.defaults.get_default(option);
 		} else {
 			return options[0];
 		}
 	},
-	overrides_parent_value_in_all_rows: function(doc, dt, dn, table_fieldname, fieldname, parent_fieldname) {
+	overrides_parent_value_in_all_rows: function (doc, dt, dn, table_fieldname, fieldname, parent_fieldname) {
 		if (doc[parent_fieldname]) {
 			let cl = doc[table_fieldname] || [];
 			for (let i = 0; i < cl.length; i++) {
@@ -355,7 +398,7 @@
 		}
 	},
 	create_new_doc: function (doctype, update_fields) {
-		frappe.model.with_doctype(doctype, function() {
+		frappe.model.with_doctype(doctype, function () {
 			var new_doc = frappe.model.get_new_doc(doctype);
 			for (let [key, value] of Object.entries(update_fields)) {
 				new_doc[key] = value;
@@ -367,183 +410,194 @@
 	// check if payments app is installed on site, if not warn user.
 	check_payments_app: () => {
 		if (frappe.boot.versions && !frappe.boot.versions.payments) {
-			const marketplace_link = '<a href="https://frappecloud.com/marketplace/apps/payments">Marketplace</a>'
-			const github_link = '<a href="https://github.com/frappe/payments/">GitHub</a>'
-			const msg = __("payments app is not installed. Please install it from {0} or {1}", [marketplace_link, github_link])
+			const marketplace_link =
+				'<a href="https://frappecloud.com/marketplace/apps/payments">Marketplace</a>';
+			const github_link = '<a href="https://github.com/frappe/payments/">GitHub</a>';
+			const msg = __("payments app is not installed. Please install it from {0} or {1}", [
+				marketplace_link,
+				github_link,
+			]);
 			frappe.msgprint(msg);
 		}
-
 	},
 
 	pick_serial_and_batch_bundle(frm, cdt, cdn, type_of_transaction, warehouse_field) {
 		let item_row = frappe.get_doc(cdt, cdn);
 		item_row.type_of_transaction = type_of_transaction;
 
-		frappe.db.get_value("Item", item_row.item_code, ["has_batch_no", "has_serial_no"])
-			.then((r) => {
-				item_row.has_batch_no = r.message.has_batch_no;
-				item_row.has_serial_no = r.message.has_serial_no;
+		frappe.db.get_value("Item", item_row.item_code, ["has_batch_no", "has_serial_no"]).then((r) => {
+			item_row.has_batch_no = r.message.has_batch_no;
+			item_row.has_serial_no = r.message.has_serial_no;
 
-				frappe.require("assets/erpnext/js/utils/serial_no_batch_selector.js", function() {
-					new erpnext.SerialBatchPackageSelector(frm, item_row, (r) => {
-						if (r) {
-							let update_values = {
-								"serial_and_batch_bundle": r.name,
-								"qty": Math.abs(r.total_qty)
-							}
+			frappe.require("assets/erpnext/js/utils/serial_no_batch_selector.js", function () {
+				new erpnext.SerialBatchPackageSelector(frm, item_row, (r) => {
+					if (r) {
+						let update_values = {
+							serial_and_batch_bundle: r.name,
+							qty: Math.abs(r.total_qty),
+						};
 
-							if (!warehouse_field) {
-								warehouse_field = "warehouse";
-							}
-
-							if (r.warehouse) {
-								update_values[warehouse_field] = r.warehouse;
-							}
-
-							frappe.model.set_value(item_row.doctype, item_row.name, update_values);
+						if (!warehouse_field) {
+							warehouse_field = "warehouse";
 						}
-					});
+
+						if (r.warehouse) {
+							update_values[warehouse_field] = r.warehouse;
+						}
+
+						frappe.model.set_value(item_row.doctype, item_row.name, update_values);
+					}
 				});
+			});
 		});
 	},
 
-	get_fiscal_year: function(date, with_dates=false, boolean=false) {
-		if(!date) {
+	get_fiscal_year: function (date, with_dates = false, boolean = false) {
+		if (!date) {
 			date = frappe.datetime.get_today();
 		}
 
-		let fiscal_year = '';
+		let fiscal_year = "";
 		frappe.call({
 			method: "erpnext.accounts.utils.get_fiscal_year",
 			args: {
 				date: date,
-				boolean: boolean
+				boolean: boolean,
 			},
 			async: false,
-			callback: function(r) {
+			callback: function (r) {
 				if (r.message) {
-					if (with_dates)
-						fiscal_year = r.message;
-					else
-						fiscal_year = r.message[0];
+					if (with_dates) fiscal_year = r.message;
+					else fiscal_year = r.message[0];
 				}
-			}
+			},
 		});
 		return fiscal_year;
-	}
+	},
 });
 
-erpnext.utils.select_alternate_items = function(opts) {
+erpnext.utils.select_alternate_items = function (opts) {
 	const frm = opts.frm;
-	const warehouse_field = opts.warehouse_field || 'warehouse';
-	const item_field = opts.item_field || 'item_code';
+	const warehouse_field = opts.warehouse_field || "warehouse";
+	const item_field = opts.item_field || "item_code";
 
 	this.data = [];
 	const dialog = new frappe.ui.Dialog({
 		title: __("Select Alternate Item"),
 		fields: [
-			{fieldtype:'Section Break', label: __('Items')},
+			{ fieldtype: "Section Break", label: __("Items") },
 			{
-				fieldname: "alternative_items", fieldtype: "Table", cannot_add_rows: true,
-				in_place_edit: true, data: this.data,
+				fieldname: "alternative_items",
+				fieldtype: "Table",
+				cannot_add_rows: true,
+				in_place_edit: true,
+				data: this.data,
 				get_data: () => {
 					return this.data;
 				},
-				fields: [{
-					fieldtype:'Data',
-					fieldname:"docname",
-					hidden: 1
-				}, {
-					fieldtype:'Link',
-					fieldname:"item_code",
-					options: 'Item',
-					in_list_view: 1,
-					read_only: 1,
-					label: __('Item Code')
-				}, {
-					fieldtype:'Link',
-					fieldname:"alternate_item",
-					options: 'Item',
-					default: "",
-					in_list_view: 1,
-					label: __('Alternate Item'),
-					onchange: function() {
-						const item_code = this.get_value();
-						const warehouse = this.grid_row.on_grid_fields_dict.warehouse.get_value();
-						if (item_code && warehouse) {
-							frappe.call({
-								method: "erpnext.stock.utils.get_latest_stock_qty",
-								args: {
-									item_code: item_code,
-									warehouse: warehouse
-								},
-								callback: (r) => {
-									this.grid_row.on_grid_fields_dict
-										.actual_qty.set_value(r.message || 0);
-								}
-							})
-						}
+				fields: [
+					{
+						fieldtype: "Data",
+						fieldname: "docname",
+						hidden: 1,
 					},
-					get_query: (e) => {
-						return {
-							query: "erpnext.stock.doctype.item_alternative.item_alternative.get_alternative_items",
-							filters: {
-								item_code: e.item_code
+					{
+						fieldtype: "Link",
+						fieldname: "item_code",
+						options: "Item",
+						in_list_view: 1,
+						read_only: 1,
+						label: __("Item Code"),
+					},
+					{
+						fieldtype: "Link",
+						fieldname: "alternate_item",
+						options: "Item",
+						default: "",
+						in_list_view: 1,
+						label: __("Alternate Item"),
+						onchange: function () {
+							const item_code = this.get_value();
+							const warehouse = this.grid_row.on_grid_fields_dict.warehouse.get_value();
+							if (item_code && warehouse) {
+								frappe.call({
+									method: "erpnext.stock.utils.get_latest_stock_qty",
+									args: {
+										item_code: item_code,
+										warehouse: warehouse,
+									},
+									callback: (r) => {
+										this.grid_row.on_grid_fields_dict.actual_qty.set_value(
+											r.message || 0
+										);
+									},
+								});
 							}
-						};
-					}
-				}, {
-					fieldtype:'Link',
-					fieldname:"warehouse",
-					options: 'Warehouse',
-					default: "",
-					in_list_view: 1,
-					label: __('Warehouse'),
-					onchange: function() {
-						const warehouse = this.get_value();
-						const item_code = this.grid_row.on_grid_fields_dict.item_code.get_value();
-						if (item_code && warehouse) {
-							frappe.call({
-								method: "erpnext.stock.utils.get_latest_stock_qty",
-								args: {
-									item_code: item_code,
-									warehouse: warehouse
+						},
+						get_query: (e) => {
+							return {
+								query: "erpnext.stock.doctype.item_alternative.item_alternative.get_alternative_items",
+								filters: {
+									item_code: e.item_code,
 								},
-								callback: (r) => {
-									this.grid_row.on_grid_fields_dict
-										.actual_qty.set_value(r.message || 0);
-								}
-							})
-						}
+							};
+						},
 					},
-				}, {
-					fieldtype:'Float',
-					fieldname:"actual_qty",
-					default: 0,
-					read_only: 1,
-					in_list_view: 1,
-					label: __('Available Qty')
-				}]
+					{
+						fieldtype: "Link",
+						fieldname: "warehouse",
+						options: "Warehouse",
+						default: "",
+						in_list_view: 1,
+						label: __("Warehouse"),
+						onchange: function () {
+							const warehouse = this.get_value();
+							const item_code = this.grid_row.on_grid_fields_dict.item_code.get_value();
+							if (item_code && warehouse) {
+								frappe.call({
+									method: "erpnext.stock.utils.get_latest_stock_qty",
+									args: {
+										item_code: item_code,
+										warehouse: warehouse,
+									},
+									callback: (r) => {
+										this.grid_row.on_grid_fields_dict.actual_qty.set_value(
+											r.message || 0
+										);
+									},
+								});
+							}
+						},
+					},
+					{
+						fieldtype: "Float",
+						fieldname: "actual_qty",
+						default: 0,
+						read_only: 1,
+						in_list_view: 1,
+						label: __("Available Qty"),
+					},
+				],
 			},
 		],
-		primary_action: function() {
+		primary_action: function () {
 			const args = this.get_values()["alternative_items"];
-			const alternative_items = args.filter(d => {
+			const alternative_items = args.filter((d) => {
 				if (d.alternate_item && d.item_code != d.alternate_item) {
 					return true;
 				}
 			});
 
-			alternative_items.forEach(d => {
+			alternative_items.forEach((d) => {
 				let row = frappe.get_doc(opts.child_doctype, d.docname);
 				let qty = null;
-				if (row.doctype === 'Work Order Item') {
+				if (row.doctype === "Work Order Item") {
 					qty = row.required_qty;
 				} else {
 					qty = row.qty;
 				}
 				row[item_field] = d.alternate_item;
-				frappe.model.set_value(row.doctype, row.name, 'qty', qty);
+				frappe.model.set_value(row.doctype, row.name, "qty", qty);
 				frappe.model.set_value(row.doctype, row.name, opts.original_item_field, d.item_code);
 				frm.trigger(item_field, row.doctype, row.name);
 			});
@@ -551,174 +605,187 @@
 			refresh_field(opts.child_docname);
 			this.hide();
 		},
-		primary_action_label: __('Update')
+		primary_action_label: __("Update"),
 	});
 
-	frm.doc[opts.child_docname].forEach(d => {
+	frm.doc[opts.child_docname].forEach((d) => {
 		if (!opts.condition || opts.condition(d)) {
 			dialog.fields_dict.alternative_items.df.data.push({
-				"docname": d.name,
-				"item_code": d[item_field],
-				"warehouse": d[warehouse_field],
-				"actual_qty": d.actual_qty
+				docname: d.name,
+				item_code: d[item_field],
+				warehouse: d[warehouse_field],
+				actual_qty: d.actual_qty,
 			});
 		}
-	})
+	});
 
 	this.data = dialog.fields_dict.alternative_items.df.data;
 	dialog.fields_dict.alternative_items.grid.refresh();
 	dialog.show();
-}
+};
 
-erpnext.utils.update_child_items = function(opts) {
+erpnext.utils.update_child_items = function (opts) {
 	const frm = opts.frm;
-	const cannot_add_row = (typeof opts.cannot_add_row === 'undefined') ? true : opts.cannot_add_row;
-	const child_docname = (typeof opts.cannot_add_row === 'undefined') ? "items" : opts.child_docname;
+	const cannot_add_row = typeof opts.cannot_add_row === "undefined" ? true : opts.cannot_add_row;
+	const child_docname = typeof opts.cannot_add_row === "undefined" ? "items" : opts.child_docname;
 	const child_meta = frappe.get_meta(`${frm.doc.doctype} Item`);
 	const has_reserved_stock = opts.has_reserved_stock ? true : false;
-	const get_precision = (fieldname) => child_meta.fields.find(f => f.fieldname == fieldname).precision;
+	const get_precision = (fieldname) => child_meta.fields.find((f) => f.fieldname == fieldname).precision;
 
 	this.data = frm.doc[opts.child_docname].map((d) => {
 		return {
-			"docname": d.name,
-			"name": d.name,
-			"item_code": d.item_code,
-			"delivery_date": d.delivery_date,
-			"schedule_date": d.schedule_date,
-			"conversion_factor": d.conversion_factor,
-			"qty": d.qty,
-			"rate": d.rate,
-			"uom": d.uom,
-			"fg_item": d.fg_item,
-			"fg_item_qty": d.fg_item_qty,
-		}
+			docname: d.name,
+			name: d.name,
+			item_code: d.item_code,
+			delivery_date: d.delivery_date,
+			schedule_date: d.schedule_date,
+			conversion_factor: d.conversion_factor,
+			qty: d.qty,
+			rate: d.rate,
+			uom: d.uom,
+			fg_item: d.fg_item,
+			fg_item_qty: d.fg_item_qty,
+		};
 	});
 
-	const fields = [{
-		fieldtype:'Data',
-		fieldname:"docname",
-		read_only: 1,
-		hidden: 1,
-	}, {
-		fieldtype:'Link',
-		fieldname:"item_code",
-		options: 'Item',
-		in_list_view: 1,
-		read_only: 0,
-		disabled: 0,
-		label: __('Item Code'),
-		get_query: function() {
-			let filters;
-			if (frm.doc.doctype == 'Sales Order') {
-				filters = {"is_sales_item": 1};
-			} else if (frm.doc.doctype == 'Purchase Order') {
-				if (frm.doc.is_subcontracted) {
-					if (frm.doc.is_old_subcontracting_flow) {
-						filters = {"is_sub_contracted_item": 1};
-					} else {
-						filters = {"is_stock_item": 0};
-					}
-				} else {
-					filters = {"is_purchase_item": 1};
-				}
-			}
-			return {
-				query: "erpnext.controllers.queries.item_query",
-				filters: filters
-			};
-		}
-	}, {
-		fieldtype:'Link',
-		fieldname:'uom',
-		options: 'UOM',
-		read_only: 0,
-		label: __('UOM'),
-		reqd: 1,
-		onchange: function () {
-			frappe.call({
-				method: "erpnext.stock.get_item_details.get_conversion_factor",
-				args: { item_code: this.doc.item_code, uom: this.value },
-				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) {
-								doc.conversion_factor = r.message.conversion_factor;
-								dialog.fields_dict.trans_items.grid.refresh();
-								return true;
-							}
-						})
-					}
-				}
-			});
-		}
-	}, {
-		fieldtype:'Float',
-		fieldname:"qty",
-		default: 0,
-		read_only: 0,
-		in_list_view: 1,
-		label: __('Qty'),
-		precision: get_precision("qty")
-	}, {
-		fieldtype:'Currency',
-		fieldname:"rate",
-		options: "currency",
-		default: 0,
-		read_only: 0,
-		in_list_view: 1,
-		label: __('Rate'),
-		precision: get_precision("rate")
-	}];
-
-	if (frm.doc.doctype == 'Sales Order' || frm.doc.doctype == 'Purchase Order' ) {
-		fields.splice(2, 0, {
-			fieldtype: 'Date',
-			fieldname: frm.doc.doctype == 'Sales Order' ? "delivery_date" : "schedule_date",
+	const fields = [
+		{
+			fieldtype: "Data",
+			fieldname: "docname",
+			read_only: 1,
+			hidden: 1,
+		},
+		{
+			fieldtype: "Link",
+			fieldname: "item_code",
+			options: "Item",
 			in_list_view: 1,
-			label: frm.doc.doctype == 'Sales Order' ? __("Delivery Date") : __("Reqd by date"),
-			default: frm.doc.doctype == 'Sales Order' ? frm.doc.delivery_date : frm.doc.schedule_date,
-			reqd: 1
-		})
-		fields.splice(3, 0, {
-			fieldtype: 'Float',
-			fieldname: "conversion_factor",
-			label: __("Conversion Factor"),
-			precision: get_precision('conversion_factor')
-		})
-	}
-
-	if (frm.doc.doctype == 'Purchase Order' && frm.doc.is_subcontracted && !frm.doc.is_old_subcontracting_flow) {
-		fields.push({
-			fieldtype:'Link',
-			fieldname:'fg_item',
-			options: 'Item',
-			reqd: 1,
-			in_list_view: 0,
 			read_only: 0,
 			disabled: 0,
-			label: __('Finished Good Item'),
-			get_query: () => {
-				return {
-					filters: {
-						'is_stock_item': 1,
-						'is_sub_contracted_item': 1,
-						'default_bom': ['!=', '']
+			label: __("Item Code"),
+			get_query: function () {
+				let filters;
+				if (frm.doc.doctype == "Sales Order") {
+					filters = { is_sales_item: 1 };
+				} else if (frm.doc.doctype == "Purchase Order") {
+					if (frm.doc.is_subcontracted) {
+						if (frm.doc.is_old_subcontracting_flow) {
+							filters = { is_sub_contracted_item: 1 };
+						} else {
+							filters = { is_stock_item: 0 };
+						}
+					} else {
+						filters = { is_purchase_item: 1 };
 					}
 				}
+				return {
+					query: "erpnext.controllers.queries.item_query",
+					filters: filters,
+				};
 			},
-		}, {
-			fieldtype:'Float',
-			fieldname:'fg_item_qty',
+		},
+		{
+			fieldtype: "Link",
+			fieldname: "uom",
+			options: "UOM",
+			read_only: 0,
+			label: __("UOM"),
 			reqd: 1,
+			onchange: function () {
+				frappe.call({
+					method: "erpnext.stock.get_item_details.get_conversion_factor",
+					args: { item_code: this.doc.item_code, uom: this.value },
+					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) {
+									doc.conversion_factor = r.message.conversion_factor;
+									dialog.fields_dict.trans_items.grid.refresh();
+									return true;
+								}
+							});
+						}
+					},
+				});
+			},
+		},
+		{
+			fieldtype: "Float",
+			fieldname: "qty",
 			default: 0,
 			read_only: 0,
-			in_list_view: 0,
-			label: __('Finished Good Item Qty'),
-			precision: get_precision('fg_item_qty')
-		})
+			in_list_view: 1,
+			label: __("Qty"),
+			precision: get_precision("qty"),
+		},
+		{
+			fieldtype: "Currency",
+			fieldname: "rate",
+			options: "currency",
+			default: 0,
+			read_only: 0,
+			in_list_view: 1,
+			label: __("Rate"),
+			precision: get_precision("rate"),
+		},
+	];
+
+	if (frm.doc.doctype == "Sales Order" || frm.doc.doctype == "Purchase Order") {
+		fields.splice(2, 0, {
+			fieldtype: "Date",
+			fieldname: frm.doc.doctype == "Sales Order" ? "delivery_date" : "schedule_date",
+			in_list_view: 1,
+			label: frm.doc.doctype == "Sales Order" ? __("Delivery Date") : __("Reqd by date"),
+			default: frm.doc.doctype == "Sales Order" ? frm.doc.delivery_date : frm.doc.schedule_date,
+			reqd: 1,
+		});
+		fields.splice(3, 0, {
+			fieldtype: "Float",
+			fieldname: "conversion_factor",
+			label: __("Conversion Factor"),
+			precision: get_precision("conversion_factor"),
+		});
+	}
+
+	if (
+		frm.doc.doctype == "Purchase Order" &&
+		frm.doc.is_subcontracted &&
+		!frm.doc.is_old_subcontracting_flow
+	) {
+		fields.push(
+			{
+				fieldtype: "Link",
+				fieldname: "fg_item",
+				options: "Item",
+				reqd: 1,
+				in_list_view: 0,
+				read_only: 0,
+				disabled: 0,
+				label: __("Finished Good Item"),
+				get_query: () => {
+					return {
+						filters: {
+							is_stock_item: 1,
+							is_sub_contracted_item: 1,
+							default_bom: ["!=", ""],
+						},
+					};
+				},
+			},
+			{
+				fieldtype: "Float",
+				fieldname: "fg_item_qty",
+				reqd: 1,
+				default: 0,
+				read_only: 0,
+				in_list_view: 0,
+				label: __("Finished Good Item Qty"),
+				precision: get_precision("fg_item_qty"),
+			}
+		);
 	}
 
 	let dialog = new frappe.ui.Dialog({
@@ -736,99 +803,97 @@
 				get_data: () => {
 					return this.data;
 				},
-				fields: fields
+				fields: fields,
 			},
 		],
-		primary_action: function() {
+		primary_action: function () {
 			if (frm.doctype == "Sales Order" && has_reserved_stock) {
 				this.hide();
 				frappe.confirm(
-					__('The reserved stock will be released when you update items. Are you certain you wish to proceed?'),
-					() => this.update_items(),
-				)
+					__(
+						"The reserved stock will be released when you update items. Are you certain you wish to proceed?"
+					),
+					() => this.update_items()
+				);
 			} else {
 				this.update_items();
 			}
 		},
-		update_items: function() {
+		update_items: function () {
 			const trans_items = this.get_values()["trans_items"].filter((item) => !!item.item_code);
 			frappe.call({
-				method: 'erpnext.controllers.accounts_controller.update_child_qty_rate',
+				method: "erpnext.controllers.accounts_controller.update_child_qty_rate",
 				freeze: true,
 				args: {
-					'parent_doctype': frm.doc.doctype,
-					'trans_items': trans_items,
-					'parent_doctype_name': frm.doc.name,
-					'child_docname': child_docname
+					parent_doctype: frm.doc.doctype,
+					trans_items: trans_items,
+					parent_doctype_name: frm.doc.name,
+					child_docname: child_docname,
 				},
-				callback: function() {
+				callback: function () {
 					frm.reload_doc();
-				}
+				},
 			});
 			this.hide();
 			refresh_field("items");
 		},
-		primary_action_label: __('Update')
-	})
+		primary_action_label: __("Update"),
+	});
 
 	dialog.show();
-}
+};
 
-
-
-
-erpnext.utils.map_current_doc = function(opts) {
+erpnext.utils.map_current_doc = function (opts) {
 	function _map() {
-		if($.isArray(cur_frm.doc.items) && cur_frm.doc.items.length > 0) {
+		if ($.isArray(cur_frm.doc.items) && cur_frm.doc.items.length > 0) {
 			// remove first item row if empty
-			if(!cur_frm.doc.items[0].item_code) {
+			if (!cur_frm.doc.items[0].item_code) {
 				cur_frm.doc.items = cur_frm.doc.items.splice(1);
 			}
 
 			// find the doctype of the items table
-			var items_doctype = frappe.meta.get_docfield(cur_frm.doctype, 'items').options;
+			var items_doctype = frappe.meta.get_docfield(cur_frm.doctype, "items").options;
 
 			// find the link fieldname from items table for the given
 			// source_doctype
 			var link_fieldname = null;
-			frappe.get_meta(items_doctype).fields.forEach(function(d) {
-				if(d.options===opts.source_doctype) link_fieldname = d.fieldname; });
+			frappe.get_meta(items_doctype).fields.forEach(function (d) {
+				if (d.options === opts.source_doctype) link_fieldname = d.fieldname;
+			});
 
 			// search in existing items if the source_name is already set and full qty fetched
 			var already_set = false;
 			var item_qty_map = {};
 
-			$.each(cur_frm.doc.items, function(i, d) {
-				opts.source_name.forEach(function(src) {
-					if(d[link_fieldname]==src) {
+			$.each(cur_frm.doc.items, function (i, d) {
+				opts.source_name.forEach(function (src) {
+					if (d[link_fieldname] == src) {
 						already_set = true;
-						if (item_qty_map[d.item_code])
-							item_qty_map[d.item_code] += flt(d.qty);
-						else
-							item_qty_map[d.item_code] = flt(d.qty);
+						if (item_qty_map[d.item_code]) item_qty_map[d.item_code] += flt(d.qty);
+						else item_qty_map[d.item_code] = flt(d.qty);
 					}
 				});
 			});
 
-			if(already_set) {
-				opts.source_name.forEach(function(src) {
-					frappe.model.with_doc(opts.source_doctype, src, function(r) {
+			if (already_set) {
+				opts.source_name.forEach(function (src) {
+					frappe.model.with_doc(opts.source_doctype, src, function (r) {
 						var source_doc = frappe.model.get_doc(opts.source_doctype, src);
-						$.each(source_doc.items || [], function(i, row) {
-							if(row.qty > flt(item_qty_map[row.item_code])) {
+						$.each(source_doc.items || [], function (i, row) {
+							if (row.qty > flt(item_qty_map[row.item_code])) {
 								already_set = false;
 								return false;
 							}
-						})
-					})
+						});
+					});
 
-					if(already_set) {
-						frappe.msgprint(__("You have already selected items from {0} {1}",
-							[opts.source_doctype, src]));
+					if (already_set) {
+						frappe.msgprint(
+							__("You have already selected items from {0} {1}", [opts.source_doctype, src])
+						);
 						return;
 					}
-
-				})
+				});
 			}
 		}
 
@@ -836,22 +901,22 @@
 			// Sometimes we hit the limit for URL length of a GET request
 			// as we send the full target_doc. Hence this is a POST request.
 			type: "POST",
-			method: 'frappe.model.mapper.map_docs',
+			method: "frappe.model.mapper.map_docs",
 			args: {
-				"method": opts.method,
-				"source_names": opts.source_name,
-				"target_doc": cur_frm.doc,
-				"args": opts.args
+				method: opts.method,
+				source_names: opts.source_name,
+				target_doc: cur_frm.doc,
+				args: opts.args,
 			},
 			freeze: true,
 			freeze_message: __("Mapping {0} ...", [opts.source_doctype]),
-			callback: function(r) {
-				if(!r.exc) {
+			callback: function (r) {
+				if (!r.exc) {
 					frappe.model.sync(r.message);
 					cur_frm.dirty();
 					cur_frm.refresh();
 				}
-			}
+			},
 		});
 	}
 
@@ -870,11 +935,11 @@
 
 	if (opts.source_doctype) {
 		let data_fields = [];
-		if(opts.source_doctype == "Purchase Receipt") {
+		if (opts.source_doctype == "Purchase Receipt") {
 			data_fields.push({
-				fieldname: 'merge_taxes',
-				fieldtype: 'Check',
-				label: __('Merge taxes from multiple documents'),
+				fieldname: "merge_taxes",
+				fieldtype: "Check",
+				label: __("Merge taxes from multiple documents"),
 			});
 		}
 		const d = new frappe.ui.form.MultiSelectDialog({
@@ -889,10 +954,10 @@
 			child_fieldname: opts.child_fieldname,
 			child_columns: opts.child_columns,
 			size: opts.size,
-			action: function(selections, args) {
+			action: function (selections, args) {
 				let values = selections;
 				if (values.length === 0) {
-					frappe.msgprint(__("Please select {0}", [opts.source_doctype]))
+					frappe.msgprint(__("Please select {0}", [opts.source_doctype]));
 					return;
 				}
 				opts.source_name = values;
@@ -912,11 +977,11 @@
 		opts.source_name = [opts.source_name];
 		_map();
 	}
-}
+};
 
-frappe.form.link_formatters['Item'] = function(value, doc) {
+frappe.form.link_formatters["Item"] = function (value, doc) {
 	if (doc && value && doc.item_name && doc.item_name !== value && doc.item_code === value) {
-		return value + ': ' + doc.item_name;
+		return value + ": " + doc.item_name;
 	} else if (!value && doc.doctype && doc.item_name) {
 		// format blank value in child table
 		return doc.item_name;
@@ -924,11 +989,11 @@
 		// if value is blank in report view or item code and name are the same, return as is
 		return value;
 	}
-}
+};
 
-frappe.form.link_formatters['Employee'] = function(value, doc) {
+frappe.form.link_formatters["Employee"] = function (value, doc) {
 	if (doc && value && doc.employee_name && doc.employee_name !== value && doc.employee === value) {
-		return value + ': ' + doc.employee_name;
+		return value + ": " + doc.employee_name;
 	} else if (!value && doc.doctype && doc.employee_name) {
 		// format blank value in child table
 		return doc.employee;
@@ -936,11 +1001,11 @@
 		// if value is blank in report view or project name and name are the same, return as is
 		return value;
 	}
-}
+};
 
-frappe.form.link_formatters['Project'] = function(value, doc) {
+frappe.form.link_formatters["Project"] = function (value, doc) {
 	if (doc && value && doc.project_name && doc.project_name !== value && doc.project === value) {
-		return value + ': ' + doc.project_name;
+		return value + ": " + doc.project_name;
 	} else if (!value && doc.doctype && doc.project_name) {
 		// format blank value in child table
 		return doc.project;
@@ -951,64 +1016,74 @@
 };
 
 // add description on posting time
-$(document).on('app_ready', function() {
-	if(!frappe.datetime.is_timezone_same()) {
-		$.each(["Stock Reconciliation", "Stock Entry", "Stock Ledger Entry",
-			"Delivery Note", "Purchase Receipt", "Sales Invoice"], function(i, d) {
-			frappe.ui.form.on(d, "onload", function(frm) {
-				cur_frm.set_df_property("posting_time", "description",
-					frappe.sys_defaults.time_zone);
-			});
-		});
+$(document).on("app_ready", function () {
+	if (!frappe.datetime.is_timezone_same()) {
+		$.each(
+			[
+				"Stock Reconciliation",
+				"Stock Entry",
+				"Stock Ledger Entry",
+				"Delivery Note",
+				"Purchase Receipt",
+				"Sales Invoice",
+			],
+			function (i, d) {
+				frappe.ui.form.on(d, "onload", function (frm) {
+					cur_frm.set_df_property("posting_time", "description", frappe.sys_defaults.time_zone);
+				});
+			}
+		);
 	}
 });
 
 // Show SLA dashboard
-$(document).on('app_ready', function() {
-	$.each(frappe.boot.service_level_agreement_doctypes, function(_i, d) {
+$(document).on("app_ready", function () {
+	$.each(frappe.boot.service_level_agreement_doctypes, function (_i, d) {
 		frappe.ui.form.on(d, {
-			onload: function(frm) {
-				if (!frm.doc.service_level_agreement)
-					return;
+			onload: function (frm) {
+				if (!frm.doc.service_level_agreement) return;
 
 				frappe.call({
-					method: 'erpnext.support.doctype.service_level_agreement.service_level_agreement.get_service_level_agreement_filters',
+					method: "erpnext.support.doctype.service_level_agreement.service_level_agreement.get_service_level_agreement_filters",
 					args: {
 						doctype: frm.doc.doctype,
 						name: frm.doc.service_level_agreement,
-						customer: frm.doc.customer
+						customer: frm.doc.customer,
 					},
 					callback: function (r) {
 						if (r && r.message) {
-							frm.set_query('priority', function() {
+							frm.set_query("priority", function () {
 								return {
 									filters: {
-										'name': ['in', r.message.priority],
-									}
+										name: ["in", r.message.priority],
+									},
 								};
 							});
-							frm.set_query('service_level_agreement', function() {
+							frm.set_query("service_level_agreement", function () {
 								return {
 									filters: {
-										'name': ['in', r.message.service_level_agreements],
-									}
+										name: ["in", r.message.service_level_agreements],
+									},
 								};
 							});
 						}
-					}
+					},
 				});
 			},
 
-			refresh: function(frm) {
-				if (frm.doc.status !== 'Closed' && frm.doc.service_level_agreement
-					&& ['First Response Due', 'Resolution Due'].includes(frm.doc.agreement_status)) {
+			refresh: function (frm) {
+				if (
+					frm.doc.status !== "Closed" &&
+					frm.doc.service_level_agreement &&
+					["First Response Due", "Resolution Due"].includes(frm.doc.agreement_status)
+				) {
 					frappe.call({
-						'method': 'frappe.client.get',
+						method: "frappe.client.get",
 						args: {
-							doctype: 'Service Level Agreement',
-							name: frm.doc.service_level_agreement
+							doctype: "Service Level Agreement",
+							name: frm.doc.service_level_agreement,
 						},
-						callback: function(data) {
+						callback: function (data) {
 							let statuses = data.message.pause_sla_on;
 							const hold_statuses = [];
 							$.each(statuses, (_i, entry) => {
@@ -1016,32 +1091,46 @@
 							});
 							if (hold_statuses.includes(frm.doc.status)) {
 								frm.dashboard.clear_headline();
-								let message = {'indicator': 'orange', 'msg': __('SLA is on hold since {0}', [moment(frm.doc.on_hold_since).fromNow(true)])};
+								let message = {
+									indicator: "orange",
+									msg: __("SLA is on hold since {0}", [
+										moment(frm.doc.on_hold_since).fromNow(true),
+									]),
+								};
 								frm.dashboard.set_headline_alert(
 									'<div class="row">' +
 										'<div class="col-xs-12">' +
-											'<span class="indicator whitespace-nowrap '+ message.indicator +'"><span>'+ message.msg +'</span></span> ' +
-										'</div>' +
-									'</div>'
+										'<span class="indicator whitespace-nowrap ' +
+										message.indicator +
+										'"><span>' +
+										message.msg +
+										"</span></span> " +
+										"</div>" +
+										"</div>"
 								);
 							} else {
 								set_time_to_resolve_and_response(frm, data.message.apply_sla_for_resolution);
 							}
-						}
+						},
 					});
 				} else if (frm.doc.service_level_agreement) {
 					frm.dashboard.clear_headline();
 
-					let agreement_status = (frm.doc.agreement_status == 'Fulfilled') ?
-						{'indicator': 'green', 'msg': 'Service Level Agreement has been fulfilled'} :
-						{'indicator': 'red', 'msg': 'Service Level Agreement Failed'};
+					let agreement_status =
+						frm.doc.agreement_status == "Fulfilled"
+							? { indicator: "green", msg: "Service Level Agreement has been fulfilled" }
+							: { indicator: "red", msg: "Service Level Agreement Failed" };
 
 					frm.dashboard.set_headline_alert(
 						'<div class="row">' +
 							'<div class="col-xs-12">' +
-								'<span class="indicator whitespace-nowrap '+ agreement_status.indicator +'"><span class="hidden-xs">'+ agreement_status.msg +'</span></span> ' +
-							'</div>' +
-						'</div>'
+							'<span class="indicator whitespace-nowrap ' +
+							agreement_status.indicator +
+							'"><span class="hidden-xs">' +
+							agreement_status.msg +
+							"</span></span> " +
+							"</div>" +
+							"</div>"
 					);
 				}
 			},
@@ -1067,7 +1156,6 @@
 				</span>
 			</div>`;
 
-
 	if (apply_sla_for_resolution) {
 		let time_to_resolve;
 		if (!frm.doc.resolution_date) {
@@ -1084,34 +1172,32 @@
 			</div>`;
 	}
 
-	alert += '</div>';
+	alert += "</div>";
 
 	frm.dashboard.set_headline_alert(alert);
 }
 
 function get_time_left(timestamp, agreement_status) {
 	const diff = moment(timestamp).diff(frappe.datetime.system_datetime(true));
-	const diff_display = diff >= 44500 ? moment.duration(diff).humanize() : 'Failed';
-	let indicator = (diff_display == 'Failed' && agreement_status != 'Fulfilled') ? 'red' : 'green';
-	return {'diff_display': diff_display, 'indicator': indicator};
+	const diff_display = diff >= 44500 ? moment.duration(diff).humanize() : "Failed";
+	let indicator = diff_display == "Failed" && agreement_status != "Fulfilled" ? "red" : "green";
+	return { diff_display: diff_display, indicator: indicator };
 }
 
 function get_status(expected, actual) {
 	const time_left = moment(expected).diff(moment(actual));
 	if (time_left >= 0) {
-		return {'diff_display': 'Fulfilled', 'indicator': 'green'};
+		return { diff_display: "Fulfilled", indicator: "green" };
 	} else {
-		return {'diff_display': 'Failed', 'indicator': 'red'};
+		return { diff_display: "Failed", indicator: "red" };
 	}
 }
 
 function attach_selector_button(inner_text, append_loction, context, grid_row) {
-	let $btn_div = $("<div>").css({"margin-bottom": "10px", "margin-top": "10px"})
-		.appendTo(append_loction);
-	let $btn = $(`<button class="btn btn-sm btn-default">${inner_text}</button>`)
-		.appendTo($btn_div);
+	let $btn_div = $("<div>").css({ "margin-bottom": "10px", "margin-top": "10px" }).appendTo(append_loction);
+	let $btn = $(`<button class="btn btn-sm btn-default">${inner_text}</button>`).appendTo($btn_div);
 
-	$btn.on("click", function() {
+	$btn.on("click", function () {
 		context.show_serial_batch_selector(grid_row.frm, grid_row.doc, "", "", true);
 	});
 }
diff --git a/erpnext/public/js/utils/barcode_scanner.js b/erpnext/public/js/utils/barcode_scanner.js
index 4d1c0c1..d6ef794 100644
--- a/erpnext/public/js/utils/barcode_scanner.js
+++ b/erpnext/public/js/utils/barcode_scanner.js
@@ -58,13 +58,15 @@
 					return;
 				}
 
-				me.update_table(data).then(row => {
-					this.play_success_sound();
-					resolve(row);
-				}).catch(() => {
-					this.play_fail_sound();
-					reject();
-				});
+				me.update_table(data)
+					.then((row) => {
+						this.play_success_sound();
+						resolve(row);
+					})
+					.catch(() => {
+						this.play_fail_sound();
+						reject();
+					});
 			});
 		});
 	}
@@ -87,7 +89,7 @@
 			let cur_grid = this.frm.fields_dict[this.items_table_name].grid;
 			frappe.flags.trigger_from_barcode_scanner = true;
 
-			const {item_code, barcode, batch_no, serial_no, uom} = data;
+			const { item_code, barcode, batch_no, serial_no, uom } = data;
 
 			let row = this.get_row_to_modify_on_scan(item_code, batch_no, uom, barcode);
 
@@ -116,16 +118,17 @@
 
 			frappe.run_serially([
 				() => this.set_selector_trigger_flag(data),
-				() => this.set_item(row, item_code, barcode, batch_no, serial_no).then(qty => {
-					this.show_scan_message(row.idx, row.item_code, qty);
-				}),
+				() =>
+					this.set_item(row, item_code, barcode, batch_no, serial_no).then((qty) => {
+						this.show_scan_message(row.idx, row.item_code, qty);
+					}),
 				() => this.set_barcode_uom(row, uom),
 				() => this.set_serial_no(row, serial_no),
 				() => this.set_batch_no(row, batch_no),
 				() => this.set_barcode(row, barcode),
 				() => this.clean_up(),
 				() => this.revert_selector_flag(),
-				() => resolve(row)
+				() => resolve(row),
 			]);
 		});
 	}
@@ -133,7 +136,7 @@
 	// batch and serial selector is reduandant when all info can be added by scan
 	// this flag on item row is used by transaction.js to avoid triggering selector
 	set_selector_trigger_flag(data) {
-		const {batch_no, serial_no, has_batch_no, has_serial_no} = data;
+		const { batch_no, serial_no, has_batch_no, has_serial_no } = data;
 
 		const require_selecting_batch = has_batch_no && !batch_no;
 		const require_selecting_serial = has_serial_no && !serial_no;
@@ -149,17 +152,17 @@
 	}
 
 	set_item(row, item_code, barcode, batch_no, serial_no) {
-		return new Promise(resolve => {
+		return new Promise((resolve) => {
 			const increment = async (value = 1) => {
-				const item_data = {item_code: item_code, use_serial_batch_fields: 1.0};
+				const item_data = { item_code: item_code, use_serial_batch_fields: 1.0 };
 				frappe.flags.trigger_from_barcode_scanner = true;
-				item_data[this.qty_field] = Number((row[this.qty_field] || 0)) + Number(value);
+				item_data[this.qty_field] = Number(row[this.qty_field] || 0) + Number(value);
 				await frappe.model.set_value(row.doctype, row.name, item_data);
 				return value;
 			};
 
 			if (this.prompt_qty) {
-				frappe.prompt(__("Please enter quantity for item {0}", [item_code]), ({value}) => {
+				frappe.prompt(__("Please enter quantity for item {0}", [item_code]), ({ value }) => {
 					increment(value).then((value) => resolve(value));
 				});
 			} else if (this.frm.has_items) {
@@ -175,14 +178,15 @@
 		this.dialog = new frappe.ui.Dialog({
 			title: __("Scan barcode for item {0}", [item_code]),
 			fields: me.get_fields_for_dialog(row, item_code, barcode, batch_no, serial_no),
-		})
+		});
 
 		this.dialog.set_primary_action(__("Update"), () => {
-			const item_data = {item_code: item_code};
+			const item_data = { item_code: item_code };
 			item_data[this.qty_field] = this.dialog.get_value("scanned_qty");
 			item_data["has_item_scanned"] = 1;
 
-			this.remaining_qty = flt(this.dialog.get_value("qty")) - flt(this.dialog.get_value("scanned_qty"));
+			this.remaining_qty =
+				flt(this.dialog.get_value("qty")) - flt(this.dialog.get_value("scanned_qty"));
 			frappe.model.set_value(row.doctype, row.name, item_data);
 
 			frappe.run_serially([
@@ -190,7 +194,7 @@
 				() => this.set_barcode(row, this.dialog.get_value("barcode")),
 				() => this.set_serial_no(row, this.dialog.get_value("serial_no")),
 				() => this.add_child_for_remaining_qty(row),
-				() => this.clean_up()
+				() => this.clean_up(),
 			]);
 
 			this.dialog.hide();
@@ -219,9 +223,9 @@
 							if (r.message) {
 								this.update_dialog_values(item_code, r);
 							}
-						})
+						});
 					}
-				}
+				},
 			},
 			{
 				fieldtype: "Section Break",
@@ -245,8 +249,8 @@
 			},
 			{
 				fieldtype: "Section Break",
-			}
-		]
+			},
+		];
 
 		if (batch_no) {
 			fields.push({
@@ -256,7 +260,7 @@
 				label: __("Batch No"),
 				default: batch_no,
 				read_only: 1,
-				hidden: 1
+				hidden: 1,
 			});
 		}
 
@@ -278,7 +282,7 @@
 				label: __("Barcode"),
 				default: barcode,
 				read_only: 1,
-				hidden: 1
+				hidden: 1,
 			});
 		}
 
@@ -286,18 +290,18 @@
 	}
 
 	update_dialog_values(scanned_item, r) {
-		const {item_code, barcode, batch_no, serial_no} = r.message;
+		const { item_code, barcode, batch_no, serial_no } = r.message;
 
 		this.dialog.set_value("barcode_scanner", "");
-		if (item_code === scanned_item &&
-			(this.dialog.get_value("barcode") === barcode || batch_no || serial_no)) {
-
+		if (
+			item_code === scanned_item &&
+			(this.dialog.get_value("barcode") === barcode || batch_no || serial_no)
+		) {
 			if (batch_no) {
 				this.dialog.set_value("batch_no", batch_no);
 			}
 
 			if (serial_no) {
-
 				this.validate_duplicate_serial_no(serial_no);
 				let serial_nos = this.dialog.get_value("serial_no") + "\n" + serial_no;
 				this.dialog.set_value("serial_no", serial_nos);
@@ -309,8 +313,9 @@
 	}
 
 	validate_duplicate_serial_no(serial_no) {
-		let serial_nos = this.dialog.get_value("serial_no") ?
-			this.dialog.get_value("serial_no").split("\n") : [];
+		let serial_nos = this.dialog.get_value("serial_no")
+			? this.dialog.get_value("serial_no").split("\n")
+			: [];
 
 		if (in_list(serial_nos, serial_no)) {
 			frappe.throw(__("Serial No {0} already scanned", [serial_no]));
@@ -318,12 +323,19 @@
 	}
 
 	add_child_for_remaining_qty(prev_row) {
-		if (this.remaining_qty && this.remaining_qty >0) {
+		if (this.remaining_qty && this.remaining_qty > 0) {
 			let cur_grid = this.frm.fields_dict[this.items_table_name].grid;
 			let row = frappe.model.add_child(this.frm.doc, cur_grid.doctype, this.items_table_name);
 
-			let ignore_fields = ["name", "idx", "batch_no", "barcode",
-				"received_qty", "serial_no", "has_item_scanned"];
+			let ignore_fields = [
+				"name",
+				"idx",
+				"batch_no",
+				"barcode",
+				"received_qty",
+				"serial_no",
+				"has_item_scanned",
+			];
 
 			for (let key in prev_row) {
 				if (in_list(ignore_fields, key)) {
@@ -379,7 +391,7 @@
 		if (exist) {
 			this.show_alert(__("Row #{0}: Qty increased by {1}", [idx, qty]), "green");
 		} else {
-			this.show_alert(__("Row #{0}: Item added", [idx]), "green")
+			this.show_alert(__("Row #{0}: Item added", [idx]), "green");
 		}
 	}
 
@@ -401,17 +413,19 @@
 
 		const matching_row = (row) => {
 			const item_match = row.item_code == item_code;
-			const batch_match = (!row[this.batch_no_field] || row[this.batch_no_field] == batch_no);
+			const batch_match = !row[this.batch_no_field] || row[this.batch_no_field] == batch_no;
 			const uom_match = !uom || row[this.uom_field] == uom;
 			const qty_in_limit = flt(row[this.qty_field]) < flt(row[this.max_qty_field]);
 			const item_scanned = row.has_item_scanned;
 
-			return item_match
-				&& uom_match
-				&& !item_scanned
-				&& (!is_batch_no_scan || batch_match)
-				&& (!check_max_qty || qty_in_limit)
-		}
+			return (
+				item_match &&
+				uom_match &&
+				!item_scanned &&
+				(!is_batch_no_scan || batch_match) &&
+				(!check_max_qty || qty_in_limit)
+			);
+		};
 
 		return this.items_table.find(matching_row) || this.get_existing_blank_row();
 	}
@@ -432,7 +446,7 @@
 		this.scan_barcode_field.set_value("");
 		refresh_field(this.items_table_name);
 	}
-	show_alert(msg, indicator, duration=3) {
-		frappe.show_alert({message: msg, indicator: indicator}, duration);
+	show_alert(msg, indicator, duration = 3) {
+		frappe.show_alert({ message: msg, indicator: indicator }, duration);
 	}
-};
\ No newline at end of file
+};
diff --git a/erpnext/public/js/utils/contact_address_quick_entry.js b/erpnext/public/js/utils/contact_address_quick_entry.js
index adabf08..2f61dee 100644
--- a/erpnext/public/js/utils/contact_address_quick_entry.js
+++ b/erpnext/public/js/utils/contact_address_quick_entry.js
@@ -1,6 +1,8 @@
-frappe.provide('frappe.ui.form');
+frappe.provide("frappe.ui.form");
 
-frappe.ui.form.ContactAddressQuickEntryForm = class ContactAddressQuickEntryForm extends frappe.ui.form.QuickEntryForm {
+frappe.ui.form.ContactAddressQuickEntryForm = class ContactAddressQuickEntryForm extends (
+	frappe.ui.form.QuickEntryForm
+) {
 	constructor(doctype, after_insert, init_callback, doc, force) {
 		super(doctype, after_insert, init_callback, doc, force);
 		this.skip_redirect_on_error = true;
@@ -17,8 +19,8 @@
 		 * Therefor, resulting in the fields being "hidden".
 		 */
 		const map_field_names = {
-			"email_address": "email_id",
-			"mobile_number": "mobile_no",
+			email_address: "email_id",
+			mobile_number: "mobile_no",
 		};
 
 		Object.entries(map_field_names).forEach(([fieldname, new_fieldname]) => {
@@ -30,71 +32,73 @@
 	}
 
 	get_variant_fields() {
-		var variant_fields = [{
-			fieldtype: "Section Break",
-			label: __("Primary Contact Details"),
-			collapsible: 1
-		},
-		{
-			label: __("Email Id"),
-			fieldname: "email_address",
-			fieldtype: "Data",
-			options: "Email",
-		},
-		{
-			fieldtype: "Column Break"
-		},
-		{
-			label: __("Mobile Number"),
-			fieldname: "mobile_number",
-			fieldtype: "Data"
-		},
-		{
-			fieldtype: "Section Break",
-			label: __("Primary Address Details"),
-			collapsible: 1
-		},
-		{
-			label: __("Address Line 1"),
-			fieldname: "address_line1",
-			fieldtype: "Data"
-		},
-		{
-			label: __("Address Line 2"),
-			fieldname: "address_line2",
-			fieldtype: "Data"
-		},
-		{
-			label: __("ZIP Code"),
-			fieldname: "pincode",
-			fieldtype: "Data"
-		},
-		{
-			fieldtype: "Column Break"
-		},
-		{
-			label: __("City"),
-			fieldname: "city",
-			fieldtype: "Data"
-		},
-		{
-			label: __("State"),
-			fieldname: "state",
-			fieldtype: "Data"
-		},
-		{
-			label: __("Country"),
-			fieldname: "country",
-			fieldtype: "Link",
-			options: "Country"
-		},
-		{
-			label: __("Customer POS Id"),
-			fieldname: "customer_pos_id",
-			fieldtype: "Data",
-			hidden: 1
-		}];
+		var variant_fields = [
+			{
+				fieldtype: "Section Break",
+				label: __("Primary Contact Details"),
+				collapsible: 1,
+			},
+			{
+				label: __("Email Id"),
+				fieldname: "email_address",
+				fieldtype: "Data",
+				options: "Email",
+			},
+			{
+				fieldtype: "Column Break",
+			},
+			{
+				label: __("Mobile Number"),
+				fieldname: "mobile_number",
+				fieldtype: "Data",
+			},
+			{
+				fieldtype: "Section Break",
+				label: __("Primary Address Details"),
+				collapsible: 1,
+			},
+			{
+				label: __("Address Line 1"),
+				fieldname: "address_line1",
+				fieldtype: "Data",
+			},
+			{
+				label: __("Address Line 2"),
+				fieldname: "address_line2",
+				fieldtype: "Data",
+			},
+			{
+				label: __("ZIP Code"),
+				fieldname: "pincode",
+				fieldtype: "Data",
+			},
+			{
+				fieldtype: "Column Break",
+			},
+			{
+				label: __("City"),
+				fieldname: "city",
+				fieldtype: "Data",
+			},
+			{
+				label: __("State"),
+				fieldname: "state",
+				fieldtype: "Data",
+			},
+			{
+				label: __("Country"),
+				fieldname: "country",
+				fieldtype: "Link",
+				options: "Country",
+			},
+			{
+				label: __("Customer POS Id"),
+				fieldname: "customer_pos_id",
+				fieldtype: "Data",
+				hidden: 1,
+			},
+		];
 
 		return variant_fields;
 	}
-}
+};
diff --git a/erpnext/public/js/utils/crm_activities.js b/erpnext/public/js/utils/crm_activities.js
index ec79a10..a5a2254 100644
--- a/erpnext/public/js/utils/crm_activities.js
+++ b/erpnext/public/js/utils/crm_activities.js
@@ -6,21 +6,21 @@
 	refresh() {
 		var me = this;
 		$(this.open_activities_wrapper).empty();
-		let cur_form_footer = this.form_wrapper.find('.form-footer');
+		let cur_form_footer = this.form_wrapper.find(".form-footer");
 
 		// all activities
-		if (!$(this.all_activities_wrapper).find('.form-footer').length) {
+		if (!$(this.all_activities_wrapper).find(".form-footer").length) {
 			this.all_activities_wrapper.empty();
 			$(cur_form_footer).appendTo(this.all_activities_wrapper);
 
 			// remove frappe-control class to avoid absolute position for action-btn
-			$(this.all_activities_wrapper).removeClass('frappe-control');
+			$(this.all_activities_wrapper).removeClass("frappe-control");
 			// hide new event button
-			$('.timeline-actions').find('.btn-default').hide();
+			$(".timeline-actions").find(".btn-default").hide();
 			// hide new comment box
 			$(".comment-box").hide();
 			// show only communications by default
-			$($('.timeline-content').find('.nav-link')[0]).tab('show');
+			$($(".timeline-content").find(".nav-link")[0]).tab("show");
 		}
 
 		// open activities
@@ -28,66 +28,70 @@
 			method: "erpnext.crm.utils.get_open_activities",
 			args: {
 				ref_doctype: this.frm.doc.doctype,
-				ref_docname: this.frm.doc.name
+				ref_docname: this.frm.doc.name,
 			},
 			callback: (r) => {
 				if (!r.exc) {
-					var activities_html = frappe.render_template('crm_activities', {
+					var activities_html = frappe.render_template("crm_activities", {
 						tasks: r.message.tasks,
-						events: r.message.events
+						events: r.message.events,
 					});
 
 					$(activities_html).appendTo(me.open_activities_wrapper);
 
-					$(".open-tasks").find(".completion-checkbox").on("click", function() {
-						me.update_status(this, "ToDo");
-					});
+					$(".open-tasks")
+						.find(".completion-checkbox")
+						.on("click", function () {
+							me.update_status(this, "ToDo");
+						});
 
-					$(".open-events").find(".completion-checkbox").on("click", function() {
-						me.update_status(this, "Event");
-					});
+					$(".open-events")
+						.find(".completion-checkbox")
+						.on("click", function () {
+							me.update_status(this, "Event");
+						});
 
 					me.create_task();
 					me.create_event();
 				}
-			}
+			},
 		});
 	}
 
-	create_task () {
+	create_task() {
 		let me = this;
 		let _create_task = () => {
 			const args = {
 				doc: me.frm.doc,
 				frm: me.frm,
-				title: __("New Task")
+				title: __("New Task"),
 			};
 			let composer = new frappe.views.InteractionComposer(args);
-			composer.dialog.get_field('interaction_type').set_value("ToDo");
+			composer.dialog.get_field("interaction_type").set_value("ToDo");
 			// hide column having interaction type field
-			$(composer.dialog.get_field('interaction_type').wrapper).closest('.form-column').hide();
+			$(composer.dialog.get_field("interaction_type").wrapper).closest(".form-column").hide();
 			// hide summary field
-			$(composer.dialog.get_field('summary').wrapper).closest('.form-section').hide();
+			$(composer.dialog.get_field("summary").wrapper).closest(".form-section").hide();
 		};
 		$(".new-task-btn").click(_create_task);
 	}
 
-	create_event () {
+	create_event() {
 		let me = this;
 		let _create_event = () => {
 			const args = {
 				doc: me.frm.doc,
 				frm: me.frm,
-				title: __("New Event")
+				title: __("New Event"),
 			};
 			let composer = new frappe.views.InteractionComposer(args);
-			composer.dialog.get_field('interaction_type').set_value("Event");
-			$(composer.dialog.get_field('interaction_type').wrapper).hide();
+			composer.dialog.get_field("interaction_type").set_value("Event");
+			$(composer.dialog.get_field("interaction_type").wrapper).hide();
 		};
 		$(".new-event-btn").click(_create_event);
 	}
 
-	async update_status (input_field, doctype) {
+	async update_status(input_field, doctype) {
 		let completed = $(input_field).prop("checked") ? 1 : 0;
 		let docname = $(input_field).attr("name");
 		if (completed) {
@@ -104,132 +108,129 @@
 
 	refresh() {
 		var me = this;
-		this.notes_wrapper.find('.notes-section').remove();
+		this.notes_wrapper.find(".notes-section").remove();
 
 		let notes = this.frm.doc.notes || [];
-		notes.sort(
-			function(a, b) {
-				return new Date(b.added_on) - new Date(a.added_on);
-			}
-		);
+		notes.sort(function (a, b) {
+			return new Date(b.added_on) - new Date(a.added_on);
+		});
 
-		let notes_html = frappe.render_template(
-			'crm_notes',
-			{
-				notes: notes
-			}
-		);
+		let notes_html = frappe.render_template("crm_notes", {
+			notes: notes,
+		});
 		$(notes_html).appendTo(this.notes_wrapper);
 
 		this.add_note();
 
-		$(".notes-section").find(".edit-note-btn").on("click", function() {
-			me.edit_note(this);
-		});
+		$(".notes-section")
+			.find(".edit-note-btn")
+			.on("click", function () {
+				me.edit_note(this);
+			});
 
-		$(".notes-section").find(".delete-note-btn").on("click", function() {
-			me.delete_note(this);
-		});
+		$(".notes-section")
+			.find(".delete-note-btn")
+			.on("click", function () {
+				me.delete_note(this);
+			});
 	}
 
-
-	add_note () {
+	add_note() {
 		let me = this;
 		let _add_note = () => {
 			var d = new frappe.ui.Dialog({
-				title: __('Add a Note'),
+				title: __("Add a Note"),
 				fields: [
 					{
-						"label": "Note",
-						"fieldname": "note",
-						"fieldtype": "Text Editor",
-						"reqd": 1,
-						"enable_mentions": true,
-					}
+						label: "Note",
+						fieldname: "note",
+						fieldtype: "Text Editor",
+						reqd: 1,
+						enable_mentions: true,
+					},
 				],
-				primary_action: function() {
+				primary_action: function () {
 					var data = d.get_values();
 					frappe.call({
 						method: "add_note",
 						doc: me.frm.doc,
 						args: {
-							note: data.note
+							note: data.note,
 						},
 						freeze: true,
-						callback: function(r) {
+						callback: function (r) {
 							if (!r.exc) {
 								me.frm.refresh_field("notes");
 								me.refresh();
 							}
 							d.hide();
-						}
+						},
 					});
 				},
-				primary_action_label: __('Add')
+				primary_action_label: __("Add"),
 			});
 			d.show();
 		};
 		$(".new-note-btn").click(_add_note);
 	}
 
-	edit_note (edit_btn) {
+	edit_note(edit_btn) {
 		var me = this;
-		let row = $(edit_btn).closest('.comment-content');
+		let row = $(edit_btn).closest(".comment-content");
 		let row_id = row.attr("name");
 		let row_content = $(row).find(".content").html();
 		if (row_content) {
 			var d = new frappe.ui.Dialog({
-				title: __('Edit Note'),
+				title: __("Edit Note"),
 				fields: [
 					{
-						"label": "Note",
-						"fieldname": "note",
-						"fieldtype": "Text Editor",
-						"default": row_content
-					}
+						label: "Note",
+						fieldname: "note",
+						fieldtype: "Text Editor",
+						default: row_content,
+					},
 				],
-				primary_action: function() {
+				primary_action: function () {
 					var data = d.get_values();
 					frappe.call({
 						method: "edit_note",
 						doc: me.frm.doc,
 						args: {
 							note: data.note,
-							row_id: row_id
+							row_id: row_id,
 						},
 						freeze: true,
-						callback: function(r) {
+						callback: function (r) {
 							if (!r.exc) {
 								me.frm.refresh_field("notes");
 								me.refresh();
 								d.hide();
 							}
-
-						}
+						},
 					});
 				},
-				primary_action_label: __('Done')
+				primary_action_label: __("Done"),
 			});
 			d.show();
 		}
 	}
 
-	delete_note (delete_btn) {
+	delete_note(delete_btn) {
 		var me = this;
-		let row_id = $(delete_btn).closest('.comment-content').attr("name");
+		let row_id = $(delete_btn).closest(".comment-content").attr("name");
 		frappe.call({
 			method: "delete_note",
 			doc: me.frm.doc,
 			args: {
-				row_id: row_id
+				row_id: row_id,
 			},
 			freeze: true,
-			callback: function(r) {
+			callback: function (r) {
 				if (!r.exc) {
 					me.frm.refresh_field("notes");
 					me.refresh();
 				}
-			}
+			},
 		});
 	}
 };
diff --git a/erpnext/public/js/utils/customer_quick_entry.js b/erpnext/public/js/utils/customer_quick_entry.js
index b253208..e9b77a3 100644
--- a/erpnext/public/js/utils/customer_quick_entry.js
+++ b/erpnext/public/js/utils/customer_quick_entry.js
@@ -1,3 +1,3 @@
-frappe.provide('frappe.ui.form');
+frappe.provide("frappe.ui.form");
 
 frappe.ui.form.CustomerQuickEntryForm = frappe.ui.form.ContactAddressQuickEntryForm;
diff --git a/erpnext/public/js/utils/dimension_tree_filter.js b/erpnext/public/js/utils/dimension_tree_filter.js
index 27d00ba..36c0f1b 100644
--- a/erpnext/public/js/utils/dimension_tree_filter.js
+++ b/erpnext/public/js/utils/dimension_tree_filter.js
@@ -1,4 +1,4 @@
-frappe.provide('erpnext.accounts');
+frappe.provide("erpnext.accounts");
 
 erpnext.accounts.dimensions = {
 	setup_dimension_filters(frm, doctype) {
@@ -12,36 +12,38 @@
 		frappe.call({
 			method: "erpnext.accounts.doctype.accounting_dimension.accounting_dimension.get_dimensions",
 			args: {
-				'with_cost_center_and_project': true
+				with_cost_center_and_project: true,
 			},
-			callback: function(r) {
+			callback: function (r) {
 				me.accounting_dimensions = r.message[0];
 				// Ignoring "Project" as it is already handled specifically in Sales Order and Delivery Note
-				me.accounting_dimensions = me.accounting_dimensions.filter(x=>{return x.document_type != "Project"});
+				me.accounting_dimensions = me.accounting_dimensions.filter((x) => {
+					return x.document_type != "Project";
+				});
 				me.default_dimensions = r.message[1];
 				me.setup_filters(frm, doctype);
-			}
+			},
 		});
 	},
 
 	setup_filters(frm, doctype) {
-		if (doctype == 'Payment Entry' && this.accounting_dimensions) {
-			frm.dimension_filters = this.accounting_dimensions
+		if (doctype == "Payment Entry" && this.accounting_dimensions) {
+			frm.dimension_filters = this.accounting_dimensions;
 		}
 
 		if (this.accounting_dimensions) {
 			this.accounting_dimensions.forEach((dimension) => {
-				frappe.model.with_doctype(dimension['document_type'], () => {
+				frappe.model.with_doctype(dimension["document_type"], () => {
 					let parent_fields = [];
 					frappe.meta.get_docfields(doctype).forEach((df) => {
-						if (df.fieldtype === 'Link' && df.options === 'Account') {
+						if (df.fieldtype === "Link" && df.options === "Account") {
 							parent_fields.push(df.fieldname);
-						} else if (df.fieldtype === 'Table') {
-							this.setup_child_filters(frm, df.options, df.fieldname, dimension['fieldname']);
+						} else if (df.fieldtype === "Table") {
+							this.setup_child_filters(frm, df.options, df.fieldname, dimension["fieldname"]);
 						}
 
-						if (frappe.meta.has_field(doctype, dimension['fieldname'])) {
-							this.setup_account_filters(frm, dimension['fieldname'], parent_fields);
+						if (frappe.meta.has_field(doctype, dimension["fieldname"])) {
+							this.setup_account_filters(frm, dimension["fieldname"], parent_fields);
 						}
 					});
 				});
@@ -55,12 +57,12 @@
 		if (frappe.meta.has_field(doctype, dimension)) {
 			frappe.model.with_doctype(doctype, () => {
 				frappe.meta.get_docfields(doctype).forEach((df) => {
-					if (df.fieldtype === 'Link' && df.options === 'Account') {
+					if (df.fieldtype === "Link" && df.options === "Account") {
 						fields.push(df.fieldname);
 					}
 				});
 
-				frm.set_query(dimension, parentfield, function(doc, cdt, cdn) {
+				frm.set_query(dimension, parentfield, function (doc, cdt, cdn) {
 					let row = locals[cdt][cdn];
 					return erpnext.queries.get_filtered_dimensions(row, fields, dimension, doc.company);
 				});
@@ -69,7 +71,7 @@
 	},
 
 	setup_account_filters(frm, dimension, fields) {
-		frm.set_query(dimension, function(doc) {
+		frm.set_query(dimension, function (doc) {
 			return erpnext.queries.get_filtered_dimensions(doc, fields, dimension, doc.company);
 		});
 	},
@@ -78,18 +80,26 @@
 		if (this.accounting_dimensions) {
 			this.accounting_dimensions.forEach((dimension) => {
 				if (frm.is_new()) {
-					if (frm.doc.company && Object.keys(this.default_dimensions || {}).length > 0
-						&& this.default_dimensions[frm.doc.company]) {
-
-						let default_dimension = this.default_dimensions[frm.doc.company][dimension['fieldname']];
+					if (
+						frm.doc.company &&
+						Object.keys(this.default_dimensions || {}).length > 0 &&
+						this.default_dimensions[frm.doc.company]
+					) {
+						let default_dimension =
+							this.default_dimensions[frm.doc.company][dimension["fieldname"]];
 
 						if (default_dimension) {
-							if (frappe.meta.has_field(doctype, dimension['fieldname'])) {
-								frm.set_value(dimension['fieldname'], default_dimension);
+							if (frappe.meta.has_field(doctype, dimension["fieldname"])) {
+								frm.set_value(dimension["fieldname"], default_dimension);
 							}
 
-							$.each(frm.doc.items || frm.doc.accounts || [], function(i, row) {
-								frappe.model.set_value(row.doctype, row.name, dimension['fieldname'], default_dimension);
+							$.each(frm.doc.items || frm.doc.accounts || [], function (i, row) {
+								frappe.model.set_value(
+									row.doctype,
+									row.name,
+									dimension["fieldname"],
+									default_dimension
+								);
 							});
 						}
 					}
@@ -102,8 +112,8 @@
 		if (frappe.meta.has_field(frm.doctype, fieldname) && this.accounting_dimensions) {
 			this.accounting_dimensions.forEach((dimension) => {
 				let row = frappe.get_doc(cdt, cdn);
-				frm.script_manager.copy_from_first_row(fieldname, row, [dimension['fieldname']]);
+				frm.script_manager.copy_from_first_row(fieldname, row, [dimension["fieldname"]]);
 			});
 		}
-	}
+	},
 };
diff --git a/erpnext/public/js/utils/item_selector.js b/erpnext/public/js/utils/item_selector.js
index e74d291..d8a4ef4 100644
--- a/erpnext/public/js/utils/item_selector.js
+++ b/erpnext/public/js/utils/item_selector.js
@@ -3,7 +3,7 @@
 		$.extend(this, opts);
 
 		if (!this.item_field) {
-			this.item_field = 'item_code';
+			this.item_field = "item_code";
 		}
 
 		if (!this.item_query) {
@@ -16,39 +16,43 @@
 
 	setup() {
 		var me = this;
-		if(!this.grid.add_items_button) {
-			this.grid.add_items_button = this.grid.add_custom_button(__('Add Items'), function() {
-				if(!me.dialog) {
+		if (!this.grid.add_items_button) {
+			this.grid.add_items_button = this.grid.add_custom_button(__("Add Items"), function () {
+				if (!me.dialog) {
 					me.make_dialog();
 				}
 				me.dialog.show();
 				me.render_items();
-				setTimeout(function() { me.dialog.input.focus(); }, 1000);
+				setTimeout(function () {
+					me.dialog.input.focus();
+				}, 1000);
 			});
 		}
 	}
 
 	make_dialog() {
 		this.dialog = new frappe.ui.Dialog({
-			title: __('Add Items')
+			title: __("Add Items"),
 		});
 		var body = $(this.dialog.body);
-		body.html('<div><p><input type="text" class="form-control"></p>\
-			<br><div class="results"></div></div>');
+		body.html(
+			'<div><p><input type="text" class="form-control"></p>\
+			<br><div class="results"></div></div>'
+		);
 
-		this.dialog.input = body.find('.form-control');
-		this.dialog.results = body.find('.results');
+		this.dialog.input = body.find(".form-control");
+		this.dialog.results = body.find(".results");
 
 		var me = this;
-		this.dialog.results.on('click', '.image-view-item', function() {
-			me.add_item($(this).attr('data-name'));
+		this.dialog.results.on("click", ".image-view-item", function () {
+			me.add_item($(this).attr("data-name"));
 		});
 
-		this.dialog.input.on('keyup', function() {
-			if(me.timeout_id) {
+		this.dialog.input.on("keyup", function () {
+			if (me.timeout_id) {
 				clearTimeout(me.timeout_id);
 			}
-			me.timeout_id = setTimeout(function() {
+			me.timeout_id = setTimeout(function () {
 				me.render_items();
 				me.timeout_id = undefined;
 			}, 500);
@@ -61,33 +65,34 @@
 
 		// find row with item if exists
 		$.each(this.frm.doc.items || [], (i, d) => {
-			if(d[this.item_field]===item_code) {
-				frappe.model.set_value(d.doctype, d.name, 'qty', d.qty + 1);
-				frappe.show_alert({message: __("Added {0} ({1})", [item_code, d.qty]), indicator: 'green'});
+			if (d[this.item_field] === item_code) {
+				frappe.model.set_value(d.doctype, d.name, "qty", d.qty + 1);
+				frappe.show_alert({ message: __("Added {0} ({1})", [item_code, d.qty]), indicator: "green" });
 				added = true;
 				return false;
 			}
 		});
 
-		if(!added) {
+		if (!added) {
 			var d = null;
 			frappe.run_serially([
-				() => { d = this.grid.add_new_row(); },
+				() => {
+					d = this.grid.add_new_row();
+				},
 				() => frappe.model.set_value(d.doctype, d.name, this.item_field, item_code),
 				() => frappe.timeout(0.1),
 				() => {
-					frappe.model.set_value(d.doctype, d.name, 'qty', 1);
-					frappe.show_alert({message: __("Added {0} ({1})", [item_code, 1]), indicator: 'green'});
-				}
+					frappe.model.set_value(d.doctype, d.name, "qty", 1);
+					frappe.show_alert({ message: __("Added {0} ({1})", [item_code, 1]), indicator: "green" });
+				},
 			]);
 		}
-
 	}
 
 	render_items() {
 		let args = {
 			query: this.item_query,
-			filters: {}
+			filters: {},
 		};
 		args.txt = this.dialog.input.val();
 		args.as_dict = 1;
@@ -97,14 +102,14 @@
 		}
 
 		var me = this;
-		frappe.link_search("Item", args, function(results) {
-			$.each(results, function(i, d) {
-				if(!d.image) {
+		frappe.link_search("Item", args, function (results) {
+			$.each(results, function (i, d) {
+				if (!d.image) {
 					d.abbr = frappe.get_abbr(d.item_name);
 					d.color = frappe.get_palette(d.item_name);
 				}
 			});
-			me.dialog.results.html(frappe.render_template('item_selector', {'data': results}));
+			me.dialog.results.html(frappe.render_template("item_selector", { data: results }));
 		});
 	}
 };
diff --git a/erpnext/public/js/utils/landed_taxes_and_charges_common.js b/erpnext/public/js/utils/landed_taxes_and_charges_common.js
index c71f77d..2cb3016 100644
--- a/erpnext/public/js/utils/landed_taxes_and_charges_common.js
+++ b/erpnext/public/js/utils/landed_taxes_and_charges_common.js
@@ -1,62 +1,74 @@
-
 erpnext.landed_cost_taxes_and_charges = {
-	setup_triggers: function(doctype) {
+	setup_triggers: function (doctype) {
 		frappe.ui.form.on(doctype, {
-			refresh: function(frm) {
-				let tax_field = frm.doc.doctype == 'Landed Cost Voucher' ? 'taxes' : 'additional_costs';
-				frm.set_query("expense_account", tax_field, function() {
+			refresh: function (frm) {
+				let tax_field = frm.doc.doctype == "Landed Cost Voucher" ? "taxes" : "additional_costs";
+				frm.set_query("expense_account", tax_field, function () {
 					return {
 						filters: {
-							"account_type": ['in', ["Tax", "Chargeable", "Income Account", "Expenses Included In Valuation", "Expenses Included In Asset Valuation"]],
-							"company": frm.doc.company
-						}
+							account_type: [
+								"in",
+								[
+									"Tax",
+									"Chargeable",
+									"Income Account",
+									"Expenses Included In Valuation",
+									"Expenses Included In Asset Valuation",
+								],
+							],
+							company: frm.doc.company,
+						},
 					};
 				});
 			},
 
-			set_account_currency: function(frm, cdt, cdn) {
+			set_account_currency: function (frm, cdt, cdn) {
 				let row = locals[cdt][cdn];
 				if (row.expense_account) {
-					frappe.db.get_value('Account', row.expense_account, 'account_currency', function(value) {
+					frappe.db.get_value("Account", row.expense_account, "account_currency", function (value) {
 						frappe.model.set_value(cdt, cdn, "account_currency", value.account_currency);
 						frm.events.set_exchange_rate(frm, cdt, cdn);
 					});
 				}
 			},
 
-			set_exchange_rate: function(frm, cdt, cdn) {
+			set_exchange_rate: function (frm, cdt, cdn) {
 				let row = locals[cdt][cdn];
 				let company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
 
 				if (row.account_currency == company_currency) {
 					row.exchange_rate = 1;
-					frm.set_df_property('taxes', 'hidden', 1, row.name, 'exchange_rate');
+					frm.set_df_property("taxes", "hidden", 1, row.name, "exchange_rate");
 				} else if (!row.exchange_rate || row.exchange_rate == 1) {
-					frm.set_df_property('taxes', 'hidden', 0, row.name, 'exchange_rate');
+					frm.set_df_property("taxes", "hidden", 0, row.name, "exchange_rate");
 					frappe.call({
 						method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_exchange_rate",
 						args: {
 							posting_date: frm.doc.posting_date,
 							account: row.expense_account,
 							account_currency: row.account_currency,
-							company: frm.doc.company
+							company: frm.doc.company,
 						},
-						callback: function(r) {
+						callback: function (r) {
 							if (r.message) {
 								frappe.model.set_value(cdt, cdn, "exchange_rate", r.message);
 							}
-						}
+						},
 					});
 				}
 
-				frm.refresh_field('taxes');
+				frm.refresh_field("taxes");
 			},
 
-			set_base_amount: function(frm, cdt, cdn) {
+			set_base_amount: function (frm, cdt, cdn) {
 				let row = locals[cdt][cdn];
-				frappe.model.set_value(cdt, cdn, "base_amount",
-					flt(flt(row.amount)*row.exchange_rate, precision("base_amount", row)));
-			}
+				frappe.model.set_value(
+					cdt,
+					cdn,
+					"base_amount",
+					flt(flt(row.amount) * row.exchange_rate, precision("base_amount", row))
+				);
+			},
 		});
-	}
-}
+	},
+};
diff --git a/erpnext/public/js/utils/ledger_preview.js b/erpnext/public/js/utils/ledger_preview.js
index 85d4a7d..6a610dd 100644
--- a/erpnext/public/js/utils/ledger_preview.js
+++ b/erpnext/public/js/utils/ledger_preview.js
@@ -1,60 +1,78 @@
-frappe.provide('erpnext.accounts');
+frappe.provide("erpnext.accounts");
 
 erpnext.accounts.ledger_preview = {
 	show_accounting_ledger_preview(frm) {
 		let me = this;
-		if(!frm.is_new() && frm.doc.docstatus == 0) {
-			frm.add_custom_button(__('Accounting Ledger'), function() {
-				frappe.call({
-					"type": "GET",
-					"method": "erpnext.controllers.stock_controller.show_accounting_ledger_preview",
-					"args": {
-						"company": frm.doc.company,
-						"doctype": frm.doc.doctype,
-						"docname": frm.doc.name
-					},
-					"callback": function(response) {
-						me.make_dialog("Accounting Ledger Preview", "accounting_ledger_preview_html", response.message.gl_columns, response.message.gl_data);
-					}
-				})
-			}, __("Preview"));
+		if (!frm.is_new() && frm.doc.docstatus == 0) {
+			frm.add_custom_button(
+				__("Accounting Ledger"),
+				function () {
+					frappe.call({
+						type: "GET",
+						method: "erpnext.controllers.stock_controller.show_accounting_ledger_preview",
+						args: {
+							company: frm.doc.company,
+							doctype: frm.doc.doctype,
+							docname: frm.doc.name,
+						},
+						callback: function (response) {
+							me.make_dialog(
+								"Accounting Ledger Preview",
+								"accounting_ledger_preview_html",
+								response.message.gl_columns,
+								response.message.gl_data
+							);
+						},
+					});
+				},
+				__("Preview")
+			);
 		}
 	},
 
 	show_stock_ledger_preview(frm) {
-		let me = this
-		if(!frm.is_new() && frm.doc.docstatus == 0) {
-			frm.add_custom_button(__('Stock Ledger'), function() {
-				frappe.call({
-					"type": "GET",
-					"method": "erpnext.controllers.stock_controller.show_stock_ledger_preview",
-					"args": {
-						"company": frm.doc.company,
-						"doctype": frm.doc.doctype,
-						"docname": frm.doc.name
-					},
-					"callback": function(response) {
-						me.make_dialog("Stock Ledger Preview", "stock_ledger_preview_html", response.message.sl_columns, response.message.sl_data);
-					}
-				})
-			}, __("Preview"));
+		let me = this;
+		if (!frm.is_new() && frm.doc.docstatus == 0) {
+			frm.add_custom_button(
+				__("Stock Ledger"),
+				function () {
+					frappe.call({
+						type: "GET",
+						method: "erpnext.controllers.stock_controller.show_stock_ledger_preview",
+						args: {
+							company: frm.doc.company,
+							doctype: frm.doc.doctype,
+							docname: frm.doc.name,
+						},
+						callback: function (response) {
+							me.make_dialog(
+								"Stock Ledger Preview",
+								"stock_ledger_preview_html",
+								response.message.sl_columns,
+								response.message.sl_data
+							);
+						},
+					});
+				},
+				__("Preview")
+			);
 		}
 	},
 
 	make_dialog(label, fieldname, columns, data) {
 		let me = this;
 		let dialog = new frappe.ui.Dialog({
-			"size": "extra-large",
-			"title": __(label),
-			"fields": [
+			size: "extra-large",
+			title: __(label),
+			fields: [
 				{
-					"fieldtype": "HTML",
-					"fieldname": fieldname,
+					fieldtype: "HTML",
+					fieldname: fieldname,
 				},
-			]
+			],
 		});
 
-		setTimeout(function() {
+		setTimeout(function () {
 			me.get_datatable(columns, data, dialog.get_field(fieldname).wrapper);
 		}, 200);
 
@@ -70,9 +88,6 @@
 			inlineFilters: true,
 		};
 
-		new frappe.DataTable(
-			wrapper,
-			datatable_options
-		);
-	}
-}
\ No newline at end of file
+		new frappe.DataTable(wrapper, datatable_options);
+	},
+};
diff --git a/erpnext/public/js/utils/party.js b/erpnext/public/js/utils/party.js
index cba615c..801376b 100644
--- a/erpnext/public/js/utils/party.js
+++ b/erpnext/public/js/utils/party.js
@@ -3,18 +3,19 @@
 
 frappe.provide("erpnext.utils");
 
-const SALES_DOCTYPES = ['Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice'];
-const PURCHASE_DOCTYPES = ['Supplier Quotation','Purchase Order', 'Purchase Receipt', 'Purchase Invoice'];
+const SALES_DOCTYPES = ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice"];
+const PURCHASE_DOCTYPES = ["Supplier Quotation", "Purchase Order", "Purchase Receipt", "Purchase Invoice"];
 
-erpnext.utils.get_party_details = function(frm, method, args, callback) {
+erpnext.utils.get_party_details = function (frm, method, args, callback) {
 	if (!method) {
 		method = "erpnext.accounts.party.get_party_details";
 	}
 
 	if (!args) {
-		if ((frm.doctype != "Purchase Order" && frm.doc.customer)
-			|| (frm.doc.party_name && in_list(['Quotation', 'Opportunity'], frm.doc.doctype))) {
-
+		if (
+			(frm.doctype != "Purchase Order" && frm.doc.customer) ||
+			(frm.doc.party_name && in_list(["Quotation", "Opportunity"], frm.doc.doctype))
+		) {
 			let party_type = "Customer";
 			if (frm.doc.quotation_to && in_list(["Lead", "Prospect"], frm.doc.quotation_to)) {
 				party_type = frm.doc.quotation_to;
@@ -23,14 +24,14 @@
 			args = {
 				party: frm.doc.customer || frm.doc.party_name,
 				party_type: party_type,
-				price_list: frm.doc.selling_price_list
+				price_list: frm.doc.selling_price_list,
 			};
 		} else if (frm.doc.supplier) {
 			args = {
 				party: frm.doc.supplier,
 				party_type: "Supplier",
 				bill_date: frm.doc.bill_date,
-				price_list: frm.doc.buying_price_list
+				price_list: frm.doc.buying_price_list,
 			};
 		}
 
@@ -38,14 +39,14 @@
 			if (in_list(SALES_DOCTYPES, frm.doc.doctype)) {
 				args = {
 					party: frm.doc.customer || frm.doc.party_name,
-					party_type: 'Customer'
+					party_type: "Customer",
 				};
 			}
 
 			if (in_list(PURCHASE_DOCTYPES, frm.doc.doctype)) {
 				args = {
 					party: frm.doc.supplier,
-					party_type: 'Supplier'
+					party_type: "Supplier",
 				};
 			}
 		}
@@ -72,13 +73,26 @@
 		}
 	}
 
-
 	if (frappe.meta.get_docfield(frm.doc.doctype, "taxes")) {
-		if (!erpnext.utils.validate_mandatory(frm, "Posting / Transaction Date",
-			args.posting_date, args.party_type=="Customer" ? "customer": "supplier")) return;
+		if (
+			!erpnext.utils.validate_mandatory(
+				frm,
+				"Posting / Transaction Date",
+				args.posting_date,
+				args.party_type == "Customer" ? "customer" : "supplier"
+			)
+		)
+			return;
 	}
 
-	if (!erpnext.utils.validate_mandatory(frm, "Company", frm.doc.company, args.party_type=="Customer" ? "customer": "supplier")) {
+	if (
+		!erpnext.utils.validate_mandatory(
+			frm,
+			"Company",
+			frm.doc.company,
+			args.party_type == "Customer" ? "customer" : "supplier"
+		)
+	) {
 		return;
 	}
 
@@ -88,7 +102,7 @@
 	frappe.call({
 		method: method,
 		args: args,
-		callback: function(r) {
+		callback: function (r) {
 			if (r.message) {
 				frm.supplier_tds = r.message.supplier_tds;
 				frm.updating_party_details = true;
@@ -99,28 +113,28 @@
 						if (callback) callback();
 						frm.refresh();
 						erpnext.utils.add_item(frm);
-					}
+					},
 				]);
 			}
-		}
+		},
 	});
-}
+};
 
-erpnext.utils.add_item = function(frm) {
+erpnext.utils.add_item = function (frm) {
 	if (frm.is_new()) {
 		var prev_route = frappe.get_prev_route();
-		if (prev_route[1]==='Item' && !(frm.doc.items && frm.doc.items.length)) {
+		if (prev_route[1] === "Item" && !(frm.doc.items && frm.doc.items.length)) {
 			// add row
-			var item = frm.add_child('items');
-			frm.refresh_field('items');
+			var item = frm.add_child("items");
+			frm.refresh_field("items");
 
 			// set item
-			frappe.model.set_value(item.doctype, item.name, 'item_code', prev_route[2]);
+			frappe.model.set_value(item.doctype, item.name, "item_code", prev_route[2]);
 		}
 	}
-}
+};
 
-erpnext.utils.get_address_display = function(frm, address_field, display_field, is_your_company_address) {
+erpnext.utils.get_address_display = function (frm, address_field, display_field, is_your_company_address) {
 	if (frm.updating_party_details) return;
 
 	if (!address_field) {
@@ -135,29 +149,46 @@
 	if (frm.doc[address_field]) {
 		frappe.call({
 			method: "frappe.contacts.doctype.address.address.get_address_display",
-			args: {"address_dict": frm.doc[address_field] },
-			callback: function(r) {
+			args: { address_dict: frm.doc[address_field] },
+			callback: function (r) {
 				if (r.message) {
-					frm.set_value(display_field, r.message)
+					frm.set_value(display_field, r.message);
 				}
-			}
-		})
+			},
+		});
 	} else {
-		frm.set_value(display_field, '');
+		frm.set_value(display_field, "");
 	}
 };
 
-erpnext.utils.set_taxes_from_address = function(frm, triggered_from_field, billing_address_field, shipping_address_field) {
+erpnext.utils.set_taxes_from_address = function (
+	frm,
+	triggered_from_field,
+	billing_address_field,
+	shipping_address_field
+) {
 	if (frm.updating_party_details) return;
 
 	if (frappe.meta.get_docfield(frm.doc.doctype, "taxes")) {
-		if (!erpnext.utils.validate_mandatory(frm, "Lead / Customer / Supplier",
-			frm.doc.customer || frm.doc.supplier || frm.doc.lead || frm.doc.party_name, triggered_from_field)) {
+		if (
+			!erpnext.utils.validate_mandatory(
+				frm,
+				"Lead / Customer / Supplier",
+				frm.doc.customer || frm.doc.supplier || frm.doc.lead || frm.doc.party_name,
+				triggered_from_field
+			)
+		) {
 			return;
 		}
 
-		if (!erpnext.utils.validate_mandatory(frm, "Posting / Transaction Date",
-			frm.doc.posting_date || frm.doc.transaction_date, triggered_from_field)) {
+		if (
+			!erpnext.utils.validate_mandatory(
+				frm,
+				"Posting / Transaction Date",
+				frm.doc.posting_date || frm.doc.transaction_date,
+				triggered_from_field
+			)
+		) {
 			return;
 		}
 	} else {
@@ -167,35 +198,47 @@
 	frappe.call({
 		method: "erpnext.accounts.party.get_address_tax_category",
 		args: {
-			"tax_category": frm.doc.tax_category,
-			"billing_address": frm.doc[billing_address_field],
-			"shipping_address": frm.doc[shipping_address_field]
+			tax_category: frm.doc.tax_category,
+			billing_address: frm.doc[billing_address_field],
+			shipping_address: frm.doc[shipping_address_field],
 		},
-		callback: function(r) {
-			if (!r.exc){
+		callback: function (r) {
+			if (!r.exc) {
 				if (frm.doc.tax_category != r.message) {
 					frm.set_value("tax_category", r.message);
 				} else {
 					erpnext.utils.set_taxes(frm, triggered_from_field);
 				}
 			}
-		}
+		},
 	});
 };
 
-erpnext.utils.set_taxes = function(frm, triggered_from_field) {
+erpnext.utils.set_taxes = function (frm, triggered_from_field) {
 	if (frappe.meta.get_docfield(frm.doc.doctype, "taxes")) {
 		if (!erpnext.utils.validate_mandatory(frm, "Company", frm.doc.company, triggered_from_field)) {
 			return;
 		}
 
-		if (!erpnext.utils.validate_mandatory(frm, "Lead / Customer / Supplier",
-			frm.doc.customer || frm.doc.supplier || frm.doc.lead || frm.doc.party_name, triggered_from_field)) {
+		if (
+			!erpnext.utils.validate_mandatory(
+				frm,
+				"Lead / Customer / Supplier",
+				frm.doc.customer || frm.doc.supplier || frm.doc.lead || frm.doc.party_name,
+				triggered_from_field
+			)
+		) {
 			return;
 		}
 
-		if (!erpnext.utils.validate_mandatory(frm, "Posting / Transaction Date",
-			frm.doc.posting_date || frm.doc.transaction_date, triggered_from_field)) {
+		if (
+			!erpnext.utils.validate_mandatory(
+				frm,
+				"Posting / Transaction Date",
+				frm.doc.posting_date || frm.doc.transaction_date,
+				triggered_from_field
+			)
+		) {
 			return;
 		}
 	} else {
@@ -204,15 +247,15 @@
 
 	var party_type, party;
 	if (frm.doc.lead) {
-		party_type = 'Lead';
+		party_type = "Lead";
 		party = frm.doc.lead;
 	} else if (frm.doc.customer) {
-		party_type = 'Customer';
+		party_type = "Customer";
 		party = frm.doc.customer;
 	} else if (frm.doc.supplier) {
-		party_type = 'Supplier';
+		party_type = "Supplier";
 		party = frm.doc.supplier;
-	} else if (frm.doc.quotation_to){
+	} else if (frm.doc.quotation_to) {
 		party_type = frm.doc.quotation_to;
 		party = frm.doc.party_name;
 	}
@@ -224,21 +267,22 @@
 	frappe.call({
 		method: "erpnext.accounts.party.set_taxes",
 		args: {
-			"party": party,
-			"party_type": party_type,
-			"posting_date": frm.doc.posting_date || frm.doc.transaction_date,
-			"company": frm.doc.company,
-			"customer_group": frm.doc.customer_group,
-			"supplier_group": frm.doc.supplier_group,
-			"tax_category": frm.doc.tax_category,
-			"billing_address": ((frm.doc.customer || frm.doc.lead) ? (frm.doc.customer_address) : (frm.doc.supplier_address)),
-			"shipping_address": frm.doc.shipping_address_name
+			party: party,
+			party_type: party_type,
+			posting_date: frm.doc.posting_date || frm.doc.transaction_date,
+			company: frm.doc.company,
+			customer_group: frm.doc.customer_group,
+			supplier_group: frm.doc.supplier_group,
+			tax_category: frm.doc.tax_category,
+			billing_address:
+				frm.doc.customer || frm.doc.lead ? frm.doc.customer_address : frm.doc.supplier_address,
+			shipping_address: frm.doc.shipping_address_name,
 		},
-		callback: function(r) {
-			if (r.message){
-				frm.set_value("taxes_and_charges", r.message)
+		callback: function (r) {
+			if (r.message) {
+				frm.set_value("taxes_and_charges", r.message);
 			}
-		}
+		},
 	});
 };
 
@@ -266,20 +310,23 @@
 	}
 };
 
-erpnext.utils.validate_mandatory = function(frm, label, value, trigger_on) {
+erpnext.utils.validate_mandatory = function (frm, label, value, trigger_on) {
 	if (!value) {
 		frm.doc[trigger_on] = "";
 		refresh_field(trigger_on);
-		frappe.throw({message:__("Please enter {0} first", [label]), title:__("Mandatory")});
+		frappe.throw({ message: __("Please enter {0} first", [label]), title: __("Mandatory") });
 		return false;
 	}
 	return true;
-}
+};
 
-erpnext.utils.get_shipping_address = function(frm, callback) {
+erpnext.utils.get_shipping_address = function (frm, callback) {
 	if (frm.doc.company) {
-		if ((frm.doc.inter_company_order_reference || frm.doc.internal_invoice_reference ||
-			frm.doc.internal_order_reference)) {
+		if (
+			frm.doc.inter_company_order_reference ||
+			frm.doc.internal_invoice_reference ||
+			frm.doc.internal_order_reference
+		) {
 			if (callback) {
 				return callback();
 			}
@@ -288,20 +335,20 @@
 			method: "erpnext.accounts.custom.address.get_shipping_address",
 			args: {
 				company: frm.doc.company,
-				address: frm.doc.shipping_address
+				address: frm.doc.shipping_address,
 			},
-			callback: function(r) {
+			callback: function (r) {
 				if (r.message) {
-					frm.set_value("shipping_address", r.message[0]) //Address title or name
-					frm.set_value("shipping_address_display", r.message[1]) //Address to be displayed on the page
+					frm.set_value("shipping_address", r.message[0]); //Address title or name
+					frm.set_value("shipping_address_display", r.message[1]); //Address to be displayed on the page
 				}
 
-				if (callback){
+				if (callback) {
 					return callback();
 				}
-			}
+			},
 		});
 	} else {
 		frappe.msgprint(__("Select company first"));
 	}
-}
+};
diff --git a/erpnext/public/js/utils/sales_common.js b/erpnext/public/js/utils/sales_common.js
index a957530..f2b7331 100644
--- a/erpnext/public/js/utils/sales_common.js
+++ b/erpnext/public/js/utils/sales_common.js
@@ -4,7 +4,7 @@
 frappe.provide("erpnext.selling");
 
 erpnext.sales_common = {
-	setup_selling_controller:function() {
+	setup_selling_controller: function () {
 		erpnext.selling.SellingController = class SellingController extends erpnext.TransactionController {
 			setup() {
 				super.setup();
@@ -15,107 +15,123 @@
 			onload() {
 				super.onload();
 				this.setup_queries();
-				this.frm.set_query('shipping_rule', function() {
+				this.frm.set_query("shipping_rule", function () {
 					return {
 						filters: {
-							"shipping_rule_type": "Selling"
-						}
+							shipping_rule_type: "Selling",
+						},
 					};
 				});
 
-				this.frm.set_query('project', function(doc) {
+				this.frm.set_query("project", function (doc) {
 					return {
 						query: "erpnext.controllers.queries.get_project_name",
 						filters: {
-							'customer': doc.customer
-						}
-					}
+							customer: doc.customer,
+						},
+					};
 				});
 			}
 
 			setup_queries() {
 				var me = this;
 
-				$.each([["customer", "customer"],
-					["lead", "lead"]],
-					function(i, opts) {
-						if(me.frm.fields_dict[opts[0]])
-							me.frm.set_query(opts[0], erpnext.queries[opts[1]]);
-					});
+				$.each(
+					[
+						["customer", "customer"],
+						["lead", "lead"],
+					],
+					function (i, opts) {
+						if (me.frm.fields_dict[opts[0]]) me.frm.set_query(opts[0], erpnext.queries[opts[1]]);
+					}
+				);
 
-				me.frm.set_query('contact_person', erpnext.queries.contact_query);
-				me.frm.set_query('customer_address', erpnext.queries.address_query);
-				me.frm.set_query('shipping_address_name', erpnext.queries.address_query);
-				me.frm.set_query('dispatch_address_name', erpnext.queries.dispatch_address_query);
+				me.frm.set_query("contact_person", erpnext.queries.contact_query);
+				me.frm.set_query("customer_address", erpnext.queries.address_query);
+				me.frm.set_query("shipping_address_name", erpnext.queries.address_query);
+				me.frm.set_query("dispatch_address_name", erpnext.queries.dispatch_address_query);
 
 				erpnext.accounts.dimensions.setup_dimension_filters(me.frm, me.frm.doctype);
 
-				if(this.frm.fields_dict.selling_price_list) {
-					this.frm.set_query("selling_price_list", function() {
+				if (this.frm.fields_dict.selling_price_list) {
+					this.frm.set_query("selling_price_list", function () {
 						return { filters: { selling: 1 } };
 					});
 				}
 
-				if(this.frm.fields_dict.tc_name) {
-					this.frm.set_query("tc_name", function() {
+				if (this.frm.fields_dict.tc_name) {
+					this.frm.set_query("tc_name", function () {
 						return { filters: { selling: 1 } };
 					});
 				}
 
-				if(!this.frm.fields_dict["items"]) {
+				if (!this.frm.fields_dict["items"]) {
 					return;
 				}
 
-				if(this.frm.fields_dict["items"].grid.get_field('item_code')) {
-					this.frm.set_query("item_code", "items", function() {
+				if (this.frm.fields_dict["items"].grid.get_field("item_code")) {
+					this.frm.set_query("item_code", "items", function () {
 						return {
 							query: "erpnext.controllers.queries.item_query",
-							filters: {'is_sales_item': 1, 'customer': me.frm.doc.customer, 'has_variants': 0}
-						}
+							filters: { is_sales_item: 1, customer: me.frm.doc.customer, has_variants: 0 },
+						};
 					});
 				}
 
-				if(this.frm.fields_dict["packed_items"] &&
-					this.frm.fields_dict["packed_items"].grid.get_field('batch_no')) {
-					this.frm.set_query("batch_no", "packed_items", function(doc, cdt, cdn) {
-						return me.set_query_for_batch(doc, cdt, cdn)
+				if (
+					this.frm.fields_dict["packed_items"] &&
+					this.frm.fields_dict["packed_items"].grid.get_field("batch_no")
+				) {
+					this.frm.set_query("batch_no", "packed_items", function (doc, cdt, cdn) {
+						return me.set_query_for_batch(doc, cdt, cdn);
 					});
 				}
 
-				if(this.frm.fields_dict["items"].grid.get_field('item_code')) {
-					this.frm.set_query("item_tax_template", "items", function(doc, cdt, cdn) {
-						return me.set_query_for_item_tax_template(doc, cdt, cdn)
+				if (this.frm.fields_dict["items"].grid.get_field("item_code")) {
+					this.frm.set_query("item_tax_template", "items", function (doc, cdt, cdn) {
+						return me.set_query_for_item_tax_template(doc, cdt, cdn);
 					});
 				}
-
 			}
 
 			refresh() {
 				super.refresh();
 
-				frappe.dynamic_link = {doc: this.frm.doc, fieldname: 'customer', doctype: 'Customer'}
+				frappe.dynamic_link = { doc: this.frm.doc, fieldname: "customer", doctype: "Customer" };
 
-				this.frm.toggle_display("customer_name",
-					(this.frm.doc.customer_name && this.frm.doc.customer_name!==this.frm.doc.customer));
+				this.frm.toggle_display(
+					"customer_name",
+					this.frm.doc.customer_name && this.frm.doc.customer_name !== this.frm.doc.customer
+				);
 
 				this.toggle_editable_price_list_rate();
 			}
 
 			customer() {
 				var me = this;
-				erpnext.utils.get_party_details(this.frm, null, null, function() {
+				erpnext.utils.get_party_details(this.frm, null, null, function () {
 					me.apply_price_list();
 				});
 			}
 
 			customer_address() {
 				erpnext.utils.get_address_display(this.frm, "customer_address");
-				erpnext.utils.set_taxes_from_address(this.frm, "customer_address", "customer_address", "shipping_address_name");
+				erpnext.utils.set_taxes_from_address(
+					this.frm,
+					"customer_address",
+					"customer_address",
+					"shipping_address_name"
+				);
 			}
 
 			shipping_address_name() {
 				erpnext.utils.get_address_display(this.frm, "shipping_address_name", "shipping_address");
-				erpnext.utils.set_taxes_from_address(this.frm, "shipping_address_name", "customer_address", "shipping_address_name");
+				erpnext.utils.set_taxes_from_address(
+					this.frm,
+					"shipping_address_name",
+					"customer_address",
+					"shipping_address_name"
+				);
 			}
 
 			dispatch_address_name() {
@@ -138,18 +154,17 @@
 			discount_percentage(doc, cdt, cdn) {
 				var item = frappe.get_doc(cdt, cdn);
 				item.discount_amount = 0.0;
-				this.apply_discount_on_item(doc, cdt, cdn, 'discount_percentage');
+				this.apply_discount_on_item(doc, cdt, cdn, "discount_percentage");
 			}
 
 			discount_amount(doc, cdt, cdn) {
-
-				if(doc.name === cdn) {
+				if (doc.name === cdn) {
 					return;
 				}
 
 				var item = frappe.get_doc(cdt, cdn);
 				item.discount_percentage = 0.0;
-				this.apply_discount_on_item(doc, cdt, cdn, 'discount_amount');
+				this.apply_discount_on_item(doc, cdt, cdn, "discount_amount");
 			}
 
 			commission_rate() {
@@ -157,40 +172,48 @@
 			}
 
 			total_commission() {
-				frappe.model.round_floats_in(this.frm.doc, ["amount_eligible_for_commission", "total_commission"]);
+				frappe.model.round_floats_in(this.frm.doc, [
+					"amount_eligible_for_commission",
+					"total_commission",
+				]);
 
 				const { amount_eligible_for_commission } = this.frm.doc;
-				if(!amount_eligible_for_commission) return;
+				if (!amount_eligible_for_commission) return;
 
 				this.frm.set_value(
-					"commission_rate", flt(
-						this.frm.doc.total_commission * 100.0 / amount_eligible_for_commission
-					)
+					"commission_rate",
+					flt((this.frm.doc.total_commission * 100.0) / amount_eligible_for_commission)
 				);
 			}
 
 			allocated_percentage(doc, cdt, cdn) {
 				var sales_person = frappe.get_doc(cdt, cdn);
-				if(sales_person.allocated_percentage) {
+				if (sales_person.allocated_percentage) {
+					sales_person.allocated_percentage = flt(
+						sales_person.allocated_percentage,
+						precision("allocated_percentage", sales_person)
+					);
 
-					sales_person.allocated_percentage = flt(sales_person.allocated_percentage,
-						precision("allocated_percentage", sales_person));
-
-					sales_person.allocated_amount = flt(this.frm.doc.amount_eligible_for_commission *
-						sales_person.allocated_percentage / 100.0,
-						precision("allocated_amount", sales_person));
-						refresh_field(["allocated_amount"], sales_person);
+					sales_person.allocated_amount = flt(
+						(this.frm.doc.amount_eligible_for_commission * sales_person.allocated_percentage) /
+							100.0,
+						precision("allocated_amount", sales_person)
+					);
+					refresh_field(["allocated_amount"], sales_person);
 
 					this.calculate_incentive(sales_person);
-					refresh_field(["allocated_percentage", "allocated_amount", "commission_rate","incentives"], sales_person.name,
-						sales_person.parentfield);
+					refresh_field(
+						["allocated_percentage", "allocated_amount", "commission_rate", "incentives"],
+						sales_person.name,
+						sales_person.parentfield
+					);
 				}
 			}
 
 			sales_person(doc, cdt, cdn) {
 				var row = frappe.get_doc(cdt, cdn);
 				this.calculate_incentive(row);
-				refresh_field("incentives",row.name,row.parentfield);
+				refresh_field("incentives", row.name, row.parentfield);
 			}
 
 			warehouse(doc, cdt, cdn) {
@@ -200,35 +223,47 @@
 			}
 
 			toggle_editable_price_list_rate() {
-				var df = frappe.meta.get_docfield(this.frm.doc.doctype + " Item", "price_list_rate", this.frm.doc.name);
+				var df = frappe.meta.get_docfield(
+					this.frm.doc.doctype + " Item",
+					"price_list_rate",
+					this.frm.doc.name
+				);
 				var editable_price_list_rate = cint(frappe.defaults.get_default("editable_price_list_rate"));
 
-				if(df && editable_price_list_rate) {
-					const parent_field = frappe.meta.get_parentfield(this.frm.doc.doctype, this.frm.doc.doctype + " Item");
+				if (df && editable_price_list_rate) {
+					const parent_field = frappe.meta.get_parentfield(
+						this.frm.doc.doctype,
+						this.frm.doc.doctype + " Item"
+					);
 					if (!this.frm.fields_dict[parent_field]) return;
 
 					this.frm.fields_dict[parent_field].grid.update_docfield_property(
-						'price_list_rate', 'read_only', 0
+						"price_list_rate",
+						"read_only",
+						0
 					);
 				}
 			}
 
 			calculate_commission() {
-				if(!this.frm.fields_dict.commission_rate || this.frm.doc.docstatus === 1) return;
+				if (!this.frm.fields_dict.commission_rate || this.frm.doc.docstatus === 1) return;
 
-				if(this.frm.doc.commission_rate > 100) {
+				if (this.frm.doc.commission_rate > 100) {
 					this.frm.set_value("commission_rate", 100);
-					frappe.throw(`${__(frappe.meta.get_label(
-						this.frm.doc.doctype, "commission_rate", this.frm.doc.name
-					))} ${__("cannot be greater than 100")}`);
+					frappe.throw(
+						`${__(
+							frappe.meta.get_label(this.frm.doc.doctype, "commission_rate", this.frm.doc.name)
+						)} ${__("cannot be greater than 100")}`
+					);
 				}
 
 				this.frm.doc.amount_eligible_for_commission = this.frm.doc.items.reduce(
-					(sum, item) => item.grant_commission ? sum + item.base_net_amount : sum, 0
-				)
+					(sum, item) => (item.grant_commission ? sum + item.base_net_amount : sum),
+					0
+				);
 
 				this.frm.doc.total_commission = flt(
-					this.frm.doc.amount_eligible_for_commission * this.frm.doc.commission_rate / 100.0,
+					(this.frm.doc.amount_eligible_for_commission * this.frm.doc.commission_rate) / 100.0,
 					precision("total_commission")
 				);
 
@@ -237,25 +272,24 @@
 
 			calculate_contribution() {
 				var me = this;
-				$.each(this.frm.doc.doctype.sales_team || [], function(i, sales_person) {
+				$.each(this.frm.doc.doctype.sales_team || [], function (i, sales_person) {
 					frappe.model.round_floats_in(sales_person);
 					if (!sales_person.allocated_percentage) return;
 
 					sales_person.allocated_amount = flt(
-						me.frm.doc.amount_eligible_for_commission
-						* sales_person.allocated_percentage
-						/ 100.0,
+						(me.frm.doc.amount_eligible_for_commission * sales_person.allocated_percentage) /
+							100.0,
 						precision("allocated_amount", sales_person)
 					);
 				});
 			}
 
 			calculate_incentive(row) {
-				if(row.allocated_amount)
-				{
+				if (row.allocated_amount) {
 					row.incentives = flt(
-							row.allocated_amount * row.commission_rate / 100.0,
-							precision("incentives", row));
+						(row.allocated_amount * row.commission_rate) / 100.0,
+						precision("incentives", row)
+					);
 				}
 			}
 
@@ -265,37 +299,41 @@
 			}
 
 			set_product_bundle_help(doc) {
-				if(!this.frm.fields_dict.packing_list) return;
+				if (!this.frm.fields_dict.packing_list) return;
 				if ((doc.packed_items || []).length) {
 					$(this.frm.fields_dict.packing_list.row.wrapper).toggle(true);
 
-					if (in_list(['Delivery Note', 'Sales Invoice'], doc.doctype)) {
-						var help_msg = "<div class='alert alert-warning'>" +
-							__("For 'Product Bundle' items, Warehouse, Serial No and Batch No will be considered from the 'Packing List' table. If Warehouse and Batch No are same for all packing items for any 'Product Bundle' item, those values can be entered in the main Item table, values will be copied to 'Packing List' table.")+
-						"</div>";
-						frappe.meta.get_docfield(doc.doctype, 'product_bundle_help', doc.name).options = help_msg;
+					if (in_list(["Delivery Note", "Sales Invoice"], doc.doctype)) {
+						var help_msg =
+							"<div class='alert alert-warning'>" +
+							__(
+								"For 'Product Bundle' items, Warehouse, Serial No and Batch No will be considered from the 'Packing List' table. If Warehouse and Batch No are same for all packing items for any 'Product Bundle' item, those values can be entered in the main Item table, values will be copied to 'Packing List' table."
+							) +
+							"</div>";
+						frappe.meta.get_docfield(doc.doctype, "product_bundle_help", doc.name).options =
+							help_msg;
 					}
 				} else {
 					$(this.frm.fields_dict.packing_list.row.wrapper).toggle(false);
-					if (in_list(['Delivery Note', 'Sales Invoice'], doc.doctype)) {
-						frappe.meta.get_docfield(doc.doctype, 'product_bundle_help', doc.name).options = '';
+					if (in_list(["Delivery Note", "Sales Invoice"], doc.doctype)) {
+						frappe.meta.get_docfield(doc.doctype, "product_bundle_help", doc.name).options = "";
 					}
 				}
-				refresh_field('product_bundle_help');
+				refresh_field("product_bundle_help");
 			}
 
 			company_address() {
 				var me = this;
-				if(this.frm.doc.company_address) {
+				if (this.frm.doc.company_address) {
 					frappe.call({
 						method: "frappe.contacts.doctype.address.address.get_address_display",
-						args: {"address_dict": this.frm.doc.company_address },
-						callback: function(r) {
-							if(r.message) {
-								me.frm.set_value("company_address_display", r.message)
+						args: { address_dict: this.frm.doc.company_address },
+						callback: function (r) {
+							if (r.message) {
+								me.frm.set_value("company_address_display", r.message);
 							}
-						}
-					})
+						},
+					});
 				} else {
 					this.frm.set_value("company_address_display", "");
 				}
@@ -314,79 +352,96 @@
 				let me = this;
 				let path = "assets/erpnext/js/utils/serial_no_batch_selector.js";
 
-				frappe.db.get_value("Item", item.item_code, ["has_batch_no", "has_serial_no"])
-					.then((r) => {
-						if (r.message && (r.message.has_batch_no || r.message.has_serial_no)) {
-							item.has_serial_no = r.message.has_serial_no;
-							item.has_batch_no = r.message.has_batch_no;
-							item.type_of_transaction = item.qty > 0 ? "Outward":"Inward";
+				frappe.db.get_value("Item", item.item_code, ["has_batch_no", "has_serial_no"]).then((r) => {
+					if (r.message && (r.message.has_batch_no || r.message.has_serial_no)) {
+						item.has_serial_no = r.message.has_serial_no;
+						item.has_batch_no = r.message.has_batch_no;
+						item.type_of_transaction = item.qty > 0 ? "Outward" : "Inward";
 
-							item.title = item.has_serial_no ?
-								__("Select Serial No") : __("Select Batch No");
+						item.title = item.has_serial_no ? __("Select Serial No") : __("Select Batch No");
 
-							if (item.has_serial_no && item.has_batch_no) {
-								item.title = __("Select Serial and Batch");
-							}
-
-							frappe.require(path, function() {
-								new erpnext.SerialBatchPackageSelector(
-									me.frm, item, (r) => {
-										if (r) {
-											let qty = Math.abs(r.total_qty);
-											if (doc.is_return) {
-												qty = qty * -1;
-											}
-
-											frappe.model.set_value(item.doctype, item.name, {
-												"serial_and_batch_bundle": r.name,
-												"use_serial_batch_fields": 0,
-												"qty": qty / flt(item.conversion_factor || 1, precision("conversion_factor", item))
-											});
-										}
-									}
-								);
-							});
+						if (item.has_serial_no && item.has_batch_no) {
+							item.title = __("Select Serial and Batch");
 						}
-					});
+
+						frappe.require(path, function () {
+							new erpnext.SerialBatchPackageSelector(me.frm, item, (r) => {
+								if (r) {
+									let qty = Math.abs(r.total_qty);
+									if (doc.is_return) {
+										qty = qty * -1;
+									}
+
+									frappe.model.set_value(item.doctype, item.name, {
+										serial_and_batch_bundle: r.name,
+										use_serial_batch_fields: 0,
+										qty:
+											qty /
+											flt(
+												item.conversion_factor || 1,
+												precision("conversion_factor", item)
+											),
+									});
+								}
+							});
+						});
+					}
+				});
 			}
 
 			update_auto_repeat_reference(doc) {
 				if (doc.auto_repeat) {
 					frappe.call({
-						method:"frappe.automation.doctype.auto_repeat.auto_repeat.update_reference",
-						args:{
+						method: "frappe.automation.doctype.auto_repeat.auto_repeat.update_reference",
+						args: {
 							docname: doc.auto_repeat,
-							reference:doc.name
+							reference: doc.name,
 						},
-						callback: function(r){
-							if (r.message=="success") {
-								frappe.show_alert({message:__("Auto repeat document updated"), indicator:'green'});
+						callback: function (r) {
+							if (r.message == "success") {
+								frappe.show_alert({
+									message: __("Auto repeat document updated"),
+									indicator: "green",
+								});
 							} else {
-								frappe.show_alert({message:__("An error occurred during the update process"), indicator:'red'});
+								frappe.show_alert({
+									message: __("An error occurred during the update process"),
+									indicator: "red",
+								});
 							}
-						}
-					})
+						},
+					});
 				}
 			}
 
 			project() {
 				let me = this;
-				if(in_list(["Delivery Note", "Sales Invoice", "Sales Order"], this.frm.doc.doctype)) {
-					if(this.frm.doc.project) {
+				if (in_list(["Delivery Note", "Sales Invoice", "Sales Order"], this.frm.doc.doctype)) {
+					if (this.frm.doc.project) {
 						frappe.call({
-							method:'erpnext.projects.doctype.project.project.get_cost_center_name' ,
-							args: {project: this.frm.doc.project},
-							callback: function(r, rt) {
-								if(!r.exc) {
-									$.each(me.frm.doc["items"] || [], function(i, row) {
-										if(r.message) {
-											frappe.model.set_value(row.doctype, row.name, "cost_center", r.message);
-											frappe.msgprint(__("Cost Center For Item with Item Code {0} has been Changed to {1}", [row.item_name, r.message]));
+							method: "erpnext.projects.doctype.project.project.get_cost_center_name",
+							args: { project: this.frm.doc.project },
+							callback: function (r, rt) {
+								if (!r.exc) {
+									$.each(me.frm.doc["items"] || [], function (i, row) {
+										if (r.message) {
+											frappe.model.set_value(
+												row.doctype,
+												row.name,
+												"cost_center",
+												r.message
+											);
+											frappe.msgprint(
+												__(
+													"Cost Center For Item with Item Code {0} has been Changed to {1}",
+													[row.item_name, r.message]
+												)
+											);
 										}
-									})
+									});
 								}
-							}
-						})
+							},
+						});
 					}
 				}
 			}
@@ -396,57 +451,60 @@
 				this.frm.set_value("additional_discount_percentage", 0);
 			}
 		};
-	}
-}
+	},
+};
 
 erpnext.pre_sales = {
-	set_as_lost: function(doctype) {
+	set_as_lost: function (doctype) {
 		frappe.ui.form.on(doctype, {
-			set_as_lost_dialog: function(frm) {
+			set_as_lost_dialog: function (frm) {
 				var dialog = new frappe.ui.Dialog({
 					title: __("Set as Lost"),
 					fields: [
 						{
-							"fieldtype": "Table MultiSelect",
-							"label": __("Lost Reasons"),
-							"fieldname": "lost_reason",
-							"options": frm.doctype === 'Opportunity' ? 'Opportunity Lost Reason Detail': 'Quotation Lost Reason Detail',
-							"reqd": 1
+							fieldtype: "Table MultiSelect",
+							label: __("Lost Reasons"),
+							fieldname: "lost_reason",
+							options:
+								frm.doctype === "Opportunity"
+									? "Opportunity Lost Reason Detail"
+									: "Quotation Lost Reason Detail",
+							reqd: 1,
 						},
 						{
-							"fieldtype": "Table MultiSelect",
-							"label": __("Competitors"),
-							"fieldname": "competitors",
-							"options": "Competitor Detail"
+							fieldtype: "Table MultiSelect",
+							label: __("Competitors"),
+							fieldname: "competitors",
+							options: "Competitor Detail",
 						},
 						{
-							"fieldtype": "Small Text",
-							"label": __("Detailed Reason"),
-							"fieldname": "detailed_reason"
+							fieldtype: "Small Text",
+							label: __("Detailed Reason"),
+							fieldname: "detailed_reason",
 						},
 					],
-					primary_action: function() {
+					primary_action: function () {
 						let values = dialog.get_values();
 
 						frm.call({
 							doc: frm.doc,
-							method: 'declare_enquiry_lost',
+							method: "declare_enquiry_lost",
 							args: {
-								'lost_reasons_list': values.lost_reason,
-								'competitors': values.competitors ? values.competitors : [],
-								'detailed_reason': values.detailed_reason
+								lost_reasons_list: values.lost_reason,
+								competitors: values.competitors ? values.competitors : [],
+								detailed_reason: values.detailed_reason,
 							},
-							callback: function(r) {
+							callback: function (r) {
 								dialog.hide();
 								frm.reload_doc();
 							},
 						});
 					},
-					primary_action_label: __('Declare Lost')
+					primary_action_label: __("Declare Lost"),
 				});
 
 				dialog.show();
-			}
+			},
 		});
-	}
-}
+	},
+};
diff --git a/erpnext/public/js/utils/serial_no_batch_selector.js b/erpnext/public/js/utils/serial_no_batch_selector.js
index d0064b3..24133b8 100644
--- a/erpnext/public/js/utils/serial_no_batch_selector.js
+++ b/erpnext/public/js/utils/serial_no_batch_selector.js
@@ -4,30 +4,30 @@
 		this.item = item;
 		this.qty = item.qty;
 		this.callback = callback;
-		this.bundle = this.item?.is_rejected ?
-			this.item.rejected_serial_and_batch_bundle : this.item.serial_and_batch_bundle;
+		this.bundle = this.item?.is_rejected
+			? this.item.rejected_serial_and_batch_bundle
+			: this.item.serial_and_batch_bundle;
 
 		this.make();
 		this.render_data();
 	}
 
 	make() {
-		let label = this.item?.has_serial_no ? __('Serial Nos') : __('Batch Nos');
-		let primary_label = this.bundle
-			? __('Update') : __('Add');
+		let label = this.item?.has_serial_no ? __("Serial Nos") : __("Batch Nos");
+		let primary_label = this.bundle ? __("Update") : __("Add");
 
 		if (this.item?.has_serial_no && this.item?.batch_no) {
-			label = __('Serial Nos / Batch Nos');
+			label = __("Serial Nos / Batch Nos");
 		}
 
-		primary_label += ' ' + label;
+		primary_label += " " + label;
 
 		this.dialog = new frappe.ui.Dialog({
 			title: this.item?.title || primary_label,
 			fields: this.get_dialog_fields(),
 			primary_action_label: primary_label,
 			primary_action: () => this.update_bundle_entries(),
-			secondary_action_label: __('Edit Full Form'),
+			secondary_action_label: __("Edit Full Form"),
 			secondary_action: () => this.edit_full_form(),
 		});
 
@@ -45,21 +45,21 @@
 		if (qty > 0) {
 			this.dialog.set_value("qty", qty).then(() => {
 				if (this.item.serial_no && !this.item.serial_and_batch_bundle) {
-					let serial_nos = this.item.serial_no.split('\n');
+					let serial_nos = this.item.serial_no.split("\n");
 					if (serial_nos.length > 1) {
-						serial_nos.forEach(serial_no => {
+						serial_nos.forEach((serial_no) => {
 							this.dialog.fields_dict.entries.df.data.push({
 								serial_no: serial_no,
-								batch_no: this.item.batch_no
+								batch_no: this.item.batch_no,
 							});
 						});
 					} else {
 						this.dialog.set_value("scan_serial_no", this.item.serial_no);
 					}
-					frappe.model.set_value(this.item.doctype, this.item.name, 'serial_no', '');
+					frappe.model.set_value(this.item.doctype, this.item.name, "serial_no", "");
 				} else if (this.item.batch_no && !this.item.serial_and_batch_bundle) {
 					this.dialog.set_value("scan_batch_no", this.item.batch_no);
-					frappe.model.set_value(this.item.doctype, this.item.name, 'batch_no', '');
+					frappe.model.set_value(this.item.doctype, this.item.name, "batch_no", "");
 				}
 
 				this.dialog.fields_dict.entries.grid.refresh();
@@ -68,20 +68,20 @@
 	}
 
 	get_serial_no_filters() {
-		let warehouse = this.item?.type_of_transaction === "Outward" ?
-			(this.item.warehouse || this.item.s_warehouse) : "";
+		let warehouse =
+			this.item?.type_of_transaction === "Outward" ? this.item.warehouse || this.item.s_warehouse : "";
 
-		if (this.frm.doc.doctype === 'Stock Entry') {
+		if (this.frm.doc.doctype === "Stock Entry") {
 			warehouse = this.item.s_warehouse || this.item.t_warehouse;
 		}
 
-		if (!warehouse && this.frm.doc.doctype === 'Stock Reconciliation') {
+		if (!warehouse && this.frm.doc.doctype === "Stock Reconciliation") {
 			warehouse = this.get_warehouse();
 		}
 
 		return {
-			'item_code': this.item.item_code,
-			'warehouse': ["=", warehouse]
+			item_code: this.item.item_code,
+			warehouse: ["=", warehouse],
 		};
 	}
 
@@ -89,71 +89,70 @@
 		let fields = [];
 
 		fields.push({
-			fieldtype: 'Link',
-			fieldname: 'warehouse',
-			label: __('Warehouse'),
-			options: 'Warehouse',
+			fieldtype: "Link",
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			options: "Warehouse",
 			default: this.get_warehouse(),
 			onchange: () => {
-				this.item.warehouse = this.dialog.get_value('warehouse');
-				this.get_auto_data()
+				this.item.warehouse = this.dialog.get_value("warehouse");
+				this.get_auto_data();
 			},
 			get_query: () => {
 				return {
 					filters: {
-						'is_group': 0,
-						'company': this.frm.doc.company,
-					}
+						is_group: 0,
+						company: this.frm.doc.company,
+					},
 				};
-			}
+			},
 		});
 
-		if (this.frm.doc.doctype === 'Stock Entry'
-			&& this.frm.doc.purpose === 'Manufacture') {
+		if (this.frm.doc.doctype === "Stock Entry" && this.frm.doc.purpose === "Manufacture") {
 			fields.push({
-				fieldtype: 'Column Break',
+				fieldtype: "Column Break",
 			});
 
 			fields.push({
-				fieldtype: 'Link',
-				fieldname: 'work_order',
-				label: __('For Work Order'),
-				options: 'Work Order',
+				fieldtype: "Link",
+				fieldname: "work_order",
+				label: __("For Work Order"),
+				options: "Work Order",
 				read_only: 1,
 				default: this.frm.doc.work_order,
 			});
 
 			fields.push({
-				fieldtype: 'Section Break',
+				fieldtype: "Section Break",
 			});
 		}
 
 		fields.push({
-			fieldtype: 'Column Break',
+			fieldtype: "Column Break",
 		});
 
 		if (this.item.has_serial_no) {
 			fields.push({
-				fieldtype: 'Data',
-				options: 'Barcode',
-				fieldname: 'scan_serial_no',
-				label: __('Scan Serial No'),
+				fieldtype: "Data",
+				options: "Barcode",
+				fieldname: "scan_serial_no",
+				label: __("Scan Serial No"),
 				get_query: () => {
 					return {
-						filters: this.get_serial_no_filters()
+						filters: this.get_serial_no_filters(),
 					};
 				},
-				onchange: () => this.scan_barcode_data()
+				onchange: () => this.scan_barcode_data(),
 			});
 		}
 
 		if (this.item.has_batch_no && !this.item.has_serial_no) {
 			fields.push({
-				fieldtype: 'Data',
-				options: 'Barcode',
-				fieldname: 'scan_batch_no',
-				label: __('Scan Batch No'),
-				onchange: () => this.scan_barcode_data()
+				fieldtype: "Data",
+				options: "Barcode",
+				fieldname: "scan_batch_no",
+				label: __("Scan Batch No"),
+				onchange: () => this.scan_barcode_data(),
 			});
 		}
 
@@ -164,12 +163,12 @@
 		}
 
 		fields.push({
-			fieldtype: 'Section Break',
+			fieldtype: "Section Break",
 		});
 
 		fields.push({
-			fieldname: 'entries',
-			fieldtype: 'Table',
+			fieldname: "entries",
+			fieldtype: "Table",
 			allow_bulk_edit: true,
 			data: [],
 			fields: this.get_dialog_table_fields(),
@@ -179,94 +178,95 @@
 	}
 
 	get_attach_field() {
-		let label = this.item?.has_serial_no ? __('Serial Nos') : __('Batch Nos');
-		let primary_label = this.bundle
-			? __('Update') : __('Add');
+		let label = this.item?.has_serial_no ? __("Serial Nos") : __("Batch Nos");
+		let primary_label = this.bundle ? __("Update") : __("Add");
 
 		if (this.item?.has_serial_no && this.item?.has_batch_no) {
-			label = __('Serial Nos / Batch Nos');
+			label = __("Serial Nos / Batch Nos");
 		}
 
 		let fields = [
 			{
-				fieldtype: 'Section Break',
-				label: __('{0} {1} via CSV File', [primary_label, label])
-			}
-		]
+				fieldtype: "Section Break",
+				label: __("{0} {1} via CSV File", [primary_label, label]),
+			},
+		];
 
 		if (this.item?.has_serial_no) {
-			fields = [...fields,
+			fields = [
+				...fields,
 				{
-					fieldtype: 'Check',
-					label: __('Import Using CSV file'),
-					fieldname: 'import_using_csv_file',
+					fieldtype: "Check",
+					label: __("Import Using CSV file"),
+					fieldname: "import_using_csv_file",
 					default: 0,
 				},
 				{
-					fieldtype: 'Section Break',
-					label: __('{0} {1} Manually', [primary_label, label]),
-					depends_on: 'eval:doc.import_using_csv_file === 0',
+					fieldtype: "Section Break",
+					label: __("{0} {1} Manually", [primary_label, label]),
+					depends_on: "eval:doc.import_using_csv_file === 0",
 				},
 				{
-					fieldtype: 'Small Text',
-					label: __('Enter Serial Nos'),
-					fieldname: 'upload_serial_nos',
-					depends_on: 'eval:doc.import_using_csv_file === 0',
-					description: __('Enter each serial no in a new line'),
+					fieldtype: "Small Text",
+					label: __("Enter Serial Nos"),
+					fieldname: "upload_serial_nos",
+					depends_on: "eval:doc.import_using_csv_file === 0",
+					description: __("Enter each serial no in a new line"),
 				},
 				{
-					fieldtype: 'Column Break',
-					depends_on: 'eval:doc.import_using_csv_file === 0',
+					fieldtype: "Column Break",
+					depends_on: "eval:doc.import_using_csv_file === 0",
 				},
 				{
-					fieldtype: 'Button',
-					fieldname: 'make_serial_nos',
-					label: __('Create Serial Nos'),
-					depends_on: 'eval:doc.import_using_csv_file === 0',
+					fieldtype: "Button",
+					fieldname: "make_serial_nos",
+					label: __("Create Serial Nos"),
+					depends_on: "eval:doc.import_using_csv_file === 0",
 					click: () => {
 						this.create_serial_nos();
-					}
+					},
 				},
 				{
-					fieldtype: 'Section Break',
-					depends_on: 'eval:doc.import_using_csv_file === 1',
-				}
+					fieldtype: "Section Break",
+					depends_on: "eval:doc.import_using_csv_file === 1",
+				},
 			];
 		}
 
-		fields = [...fields,
+		fields = [
+			...fields,
 			{
-				fieldtype: 'Button',
-				fieldname: 'download_csv',
-				label: __('Download CSV Template'),
-				click: () => this.download_csv_file()
+				fieldtype: "Button",
+				fieldname: "download_csv",
+				label: __("Download CSV Template"),
+				click: () => this.download_csv_file(),
 			},
 			{
-				fieldtype: 'Column Break',
+				fieldtype: "Column Break",
 			},
 			{
-				fieldtype: 'Attach',
-				fieldname: 'attach_serial_batch_csv',
-				label: __('Attach CSV File'),
-				onchange: () => this.upload_csv_file()
-			}
+				fieldtype: "Attach",
+				fieldname: "attach_serial_batch_csv",
+				label: __("Attach CSV File"),
+				onchange: () => this.upload_csv_file(),
+			},
 		];
 
 		return fields;
 	}
 
 	create_serial_nos() {
-		let {upload_serial_nos} = this.dialog.get_values();
+		let { upload_serial_nos } = this.dialog.get_values();
 
 		if (!upload_serial_nos) {
-			frappe.throw(__('Please enter Serial Nos'));
+			frappe.throw(__("Please enter Serial Nos"));
 		}
 
 		frappe.call({
-			method: 'erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle.create_serial_nos',
+			method: "erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle.create_serial_nos",
 			args: {
 				item_code: this.item.item_code,
-				serial_nos: upload_serial_nos
+				serial_nos: upload_serial_nos,
 			},
 			callback: (r) => {
 				if (r.message) {
@@ -274,20 +274,22 @@
 					this.set_data(r.message);
 					this.update_bundle_entries();
 				}
-			}
+			},
 		});
 	}
 
 	download_csv_file() {
-		let csvFileData = ['Serial No'];
+		let csvFileData = ["Serial No"];
 
 		if (this.item.has_serial_no && this.item.has_batch_no) {
-			csvFileData = ['Serial No', 'Batch No', 'Quantity'];
+			csvFileData = ["Serial No", "Batch No", "Quantity"];
 		} else if (this.item.has_batch_no) {
-			csvFileData = ['Batch No', 'Quantity'];
+			csvFileData = ["Batch No", "Quantity"];
 		}
 
-		const method = `/api/method/erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle.download_blank_csv_template?content=${encodeURIComponent(JSON.stringify(csvFileData))}`;
+		const method = `/api/method/erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle.download_blank_csv_template?content=${encodeURIComponent(
+			JSON.stringify(csvFileData)
+		)}`;
 		const w = window.open(frappe.urllib.get_full_url(method));
 		if (!w) {
 			frappe.msgprint(__("Please enable pop-ups"));
@@ -295,13 +297,13 @@
 	}
 
 	upload_csv_file() {
-		const file_path = this.dialog.get_value("attach_serial_batch_csv")
+		const file_path = this.dialog.get_value("attach_serial_batch_csv");
 
 		frappe.call({
-			method: 'erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle.upload_csv_file',
+			method: "erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle.upload_csv_file",
 			args: {
 				item_code: this.item.item_code,
-				file_path: file_path
+				file_path: file_path,
 			},
 			callback: (r) => {
 				if (r.message.serial_nos && r.message.serial_nos.length) {
@@ -309,102 +311,106 @@
 				} else if (r.message.batch_nos && r.message.batch_nos.length) {
 					this.set_data(r.message.batch_nos);
 				}
-			}
+			},
 		});
 	}
 
 	get_filter_fields() {
 		return [
 			{
-				fieldtype: 'Section Break',
-				label: __('Auto Fetch')
+				fieldtype: "Section Break",
+				label: __("Auto Fetch"),
 			},
 			{
-				fieldtype: 'Float',
-				fieldname: 'qty',
-				label: __('Qty to Fetch'),
-				onchange: () => this.get_auto_data()
+				fieldtype: "Float",
+				fieldname: "qty",
+				label: __("Qty to Fetch"),
+				onchange: () => this.get_auto_data(),
 			},
 			{
-				fieldtype: 'Column Break',
+				fieldtype: "Column Break",
 			},
 			{
-				fieldtype: 'Select',
-				options: ['FIFO', 'LIFO', 'Expiry'],
-				default: 'FIFO',
-				fieldname: 'based_on',
-				label: __('Fetch Based On'),
-				onchange: () => this.get_auto_data()
+				fieldtype: "Select",
+				options: ["FIFO", "LIFO", "Expiry"],
+				default: "FIFO",
+				fieldname: "based_on",
+				label: __("Fetch Based On"),
+				onchange: () => this.get_auto_data(),
 			},
 			{
-				fieldtype: 'Section Break',
+				fieldtype: "Section Break",
 			},
-		]
-
+		];
 	}
 
 	get_dialog_table_fields() {
-		let fields = []
+		let fields = [];
 
 		if (this.item.has_serial_no) {
 			fields.push({
-				fieldtype: 'Link',
-				options: 'Serial No',
-				fieldname: 'serial_no',
-				label: __('Serial No'),
+				fieldtype: "Link",
+				options: "Serial No",
+				fieldname: "serial_no",
+				label: __("Serial No"),
 				in_list_view: 1,
 				get_query: () => {
 					return {
-						filters: this.get_serial_no_filters()
-					}
-				}
-			})
+						filters: this.get_serial_no_filters(),
+					};
+				},
+			});
 		}
 
-		let batch_fields = []
+		let batch_fields = [];
 		if (this.item.has_batch_no) {
 			batch_fields = [
 				{
-					fieldtype: 'Link',
-					options: 'Batch',
-					fieldname: 'batch_no',
-					label: __('Batch No'),
+					fieldtype: "Link",
+					options: "Batch",
+					fieldname: "batch_no",
+					label: __("Batch No"),
 					in_list_view: 1,
 					get_query: () => {
 						let is_inward = false;
-						if ((["Purchase Receipt", "Purchase Invoice"].includes(this.frm.doc.doctype) && !this.frm.doc.is_return)
-							|| (this.frm.doc.doctype === 'Stock Entry' && this.frm.doc.purpose === 'Material Receipt')) {
+						if (
+							(["Purchase Receipt", "Purchase Invoice"].includes(this.frm.doc.doctype) &&
+								!this.frm.doc.is_return) ||
+							(this.frm.doc.doctype === "Stock Entry" &&
+								this.frm.doc.purpose === "Material Receipt")
+						) {
 							is_inward = true;
 						}
 
 						return {
-							query : "erpnext.controllers.queries.get_batch_no",
+							query: "erpnext.controllers.queries.get_batch_no",
 							filters: {
-								'item_code': this.item.item_code,
-								'warehouse': this.item.s_warehouse || this.item.t_warehouse || this.item.warehouse,
-								'is_inward': is_inward
-							}
-						}
+								item_code: this.item.item_code,
+								warehouse:
+									this.item.s_warehouse || this.item.t_warehouse || this.item.warehouse,
+								is_inward: is_inward,
+							},
+						};
 					},
-				}
-			]
+				},
+			];
 
 			if (!this.item.has_serial_no) {
 				batch_fields.push({
-					fieldtype: 'Float',
-					fieldname: 'qty',
-					label: __('Quantity'),
+					fieldtype: "Float",
+					fieldname: "qty",
+					label: __("Quantity"),
 					in_list_view: 1,
-				})
+				});
 			}
 		}
 
 		fields = [...fields, ...batch_fields];
 
 		fields.push({
-			fieldtype: 'Data',
-			fieldname: 'name',
-			label: __('Name'),
+			fieldtype: "Data",
+			fieldname: "name",
+			label: __("Name"),
 			hidden: 1,
 		});
 
@@ -425,26 +431,26 @@
 		}
 
 		if (!based_on) {
-			based_on = 'FIFO';
+			based_on = "FIFO";
 		}
 
 		if (qty) {
 			frappe.call({
-				method: 'erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle.get_auto_data',
+				method: "erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle.get_auto_data",
 				args: {
 					item_code: this.item.item_code,
 					warehouse: this.item.warehouse || this.item.s_warehouse,
 					has_serial_no: this.item.has_serial_no,
 					has_batch_no: this.item.has_batch_no,
 					qty: qty,
-					based_on: based_on
+					based_on: based_on,
 				},
 				callback: (r) => {
 					if (r.message) {
 						this.dialog.fields_dict.entries.df.data = r.message;
 						this.dialog.fields_dict.entries.grid.refresh();
 					}
-				}
+				},
 			});
 		}
 	}
@@ -454,7 +460,7 @@
 
 		if (scan_serial_no || scan_batch_no) {
 			frappe.call({
-				method: 'erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle.is_serial_batch_no_exists',
+				method: "erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle.is_serial_batch_no_exists",
 				args: {
 					item_code: this.item.item_code,
 					type_of_transaction: this.item.type_of_transaction,
@@ -463,9 +469,8 @@
 				},
 				callback: (r) => {
 					this.update_serial_batch_no();
-				}
-
-			})
+				},
+			});
 		}
 	}
 
@@ -473,25 +478,25 @@
 		const { scan_serial_no, scan_batch_no } = this.dialog.get_values();
 
 		if (scan_serial_no) {
-			let existing_row = this.dialog.fields_dict.entries.df.data.filter(d => {
+			let existing_row = this.dialog.fields_dict.entries.df.data.filter((d) => {
 				if (d.serial_no === scan_serial_no) {
-					return d
+					return d;
 				}
 			});
 
 			if (existing_row?.length) {
-				frappe.throw(__('Serial No {0} already exists', [scan_serial_no]));
+				frappe.throw(__("Serial No {0} already exists", [scan_serial_no]));
 			}
 
 			if (!this.item.has_batch_no) {
 				this.dialog.fields_dict.entries.df.data.push({
-					serial_no: scan_serial_no
+					serial_no: scan_serial_no,
 				});
 
-				this.dialog.fields_dict.scan_serial_no.set_value('');
+				this.dialog.fields_dict.scan_serial_no.set_value("");
 			} else {
 				frappe.call({
-					method: 'erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle.get_batch_no_from_serial_no',
+					method: "erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle.get_batch_no_from_serial_no",
 					args: {
 						serial_no: scan_serial_no,
 					},
@@ -499,19 +504,18 @@
 						if (r.message) {
 							this.dialog.fields_dict.entries.df.data.push({
 								serial_no: scan_serial_no,
-								batch_no: r.message
+								batch_no: r.message,
 							});
 
-							this.dialog.fields_dict.scan_serial_no.set_value('');
+							this.dialog.fields_dict.scan_serial_no.set_value("");
 						}
-					}
-
-				})
+					},
+				});
 			}
 		} else if (scan_batch_no) {
-			let existing_row = this.dialog.fields_dict.entries.df.data.filter(d => {
+			let existing_row = this.dialog.fields_dict.entries.df.data.filter((d) => {
 				if (d.batch_no === scan_batch_no) {
-					return d
+					return d;
 				}
 			});
 
@@ -520,11 +524,11 @@
 			} else {
 				this.dialog.fields_dict.entries.df.data.push({
 					batch_no: scan_batch_no,
-					qty: 1
+					qty: 1,
 				});
 			}
 
-			this.dialog.fields_dict.scan_batch_no.set_value('');
+			this.dialog.fields_dict.scan_batch_no.set_value("");
 		}
 
 		this.dialog.fields_dict.entries.grid.refresh();
@@ -532,33 +536,33 @@
 
 	update_bundle_entries() {
 		let entries = this.dialog.get_values().entries;
-		let warehouse = this.dialog.get_value('warehouse');
+		let warehouse = this.dialog.get_value("warehouse");
 
-		if (entries && !entries.length || !entries) {
-			frappe.throw(__('Please add atleast one Serial No / Batch No'));
+		if ((entries && !entries.length) || !entries) {
+			frappe.throw(__("Please add atleast one Serial No / Batch No"));
 		}
 
-		frappe.call({
-			method: 'erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle.add_serial_batch_ledgers',
-			args: {
-				entries: entries,
-				child_row: this.item,
-				doc: this.frm.doc,
-				warehouse: warehouse,
-			}
-		}).then(r => {
-			this.callback && this.callback(r.message);
-			this.frm.save();
-			this.dialog.hide();
-		})
+		frappe
+			.call({
+				method: "erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle.add_serial_batch_ledgers",
+				args: {
+					entries: entries,
+					child_row: this.item,
+					doc: this.frm.doc,
+					warehouse: warehouse,
+				},
+			})
+			.then((r) => {
+				this.callback && this.callback(r.message);
+				this.frm.save();
+				this.dialog.hide();
+			});
 	}
 
 	edit_full_form() {
-		let bundle_id = this.item.serial_and_batch_bundle
+		let bundle_id = this.item.serial_and_batch_bundle;
 		if (!bundle_id) {
-			let _new = frappe.model.get_new_doc(
-				"Serial and Batch Bundle", null, null, true
-			);
+			let _new = frappe.model.get_new_doc("Serial and Batch Bundle", null, null, true);
 
 			_new.item_code = this.item.item_code;
 			_new.warehouse = this.get_warehouse();
@@ -575,34 +579,36 @@
 	}
 
 	get_warehouse() {
-		return (this.item?.type_of_transaction === "Outward" ?
-			(this.item.warehouse || this.item.s_warehouse)
-			: (this.item.warehouse || this.item.t_warehouse));
+		return this.item?.type_of_transaction === "Outward"
+			? this.item.warehouse || this.item.s_warehouse
+			: this.item.warehouse || this.item.t_warehouse;
 	}
 
 	render_data() {
 		if (this.bundle) {
-			frappe.call({
-				method: 'erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle.get_serial_batch_ledgers',
-				args: {
-					item_code: this.item.item_code,
-					name: this.bundle,
-					voucher_no: !this.frm.is_new() ? this.item.parent : "",
-				}
-			}).then(r => {
-				if (r.message) {
-					this.set_data(r.message);
-				}
-			})
+			frappe
+				.call({
+					method: "erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle.get_serial_batch_ledgers",
+					args: {
+						item_code: this.item.item_code,
+						name: this.bundle,
+						voucher_no: !this.frm.is_new() ? this.item.parent : "",
+					},
+				})
+				.then((r) => {
+					if (r.message) {
+						this.set_data(r.message);
+					}
+				});
 		}
 	}
 
 	set_data(data) {
-		data.forEach(d => {
+		data.forEach((d) => {
 			d.qty = Math.abs(d.qty);
 			this.dialog.fields_dict.entries.df.data.push(d);
 		});
 
 		this.dialog.fields_dict.entries.grid.refresh();
 	}
-}
\ No newline at end of file
+};
diff --git a/erpnext/public/js/utils/supplier_quick_entry.js b/erpnext/public/js/utils/supplier_quick_entry.js
index 687b014..968ef74 100644
--- a/erpnext/public/js/utils/supplier_quick_entry.js
+++ b/erpnext/public/js/utils/supplier_quick_entry.js
@@ -1,3 +1,3 @@
-frappe.provide('frappe.ui.form');
+frappe.provide("frappe.ui.form");
 
 frappe.ui.form.SupplierQuickEntryForm = frappe.ui.form.ContactAddressQuickEntryForm;
diff --git a/erpnext/public/js/utils/unreconcile.js b/erpnext/public/js/utils/unreconcile.js
index 79490a1..6864e28 100644
--- a/erpnext/public/js/utils/unreconcile.js
+++ b/erpnext/public/js/utils/unreconcile.js
@@ -1,27 +1,34 @@
-frappe.provide('erpnext.accounts');
+frappe.provide("erpnext.accounts");
 
 erpnext.accounts.unreconcile_payment = {
 	add_unreconcile_btn(frm) {
 		if (frm.doc.docstatus == 1) {
-			if(((frm.doc.doctype == "Journal Entry") && (frm.doc.voucher_type != "Journal Entry"))
-			   || !["Purchase Invoice", "Sales Invoice", "Journal Entry", "Payment Entry"].includes(frm.doc.doctype)
-			  ) {
+			if (
+				(frm.doc.doctype == "Journal Entry" && frm.doc.voucher_type != "Journal Entry") ||
+				!["Purchase Invoice", "Sales Invoice", "Journal Entry", "Payment Entry"].includes(
+					frm.doc.doctype
+				)
+			) {
 				return;
 			}
 
 			frappe.call({
-				"method": "erpnext.accounts.doctype.unreconcile_payment.unreconcile_payment.doc_has_references",
-				"args": {
-					"doctype": frm.doc.doctype,
-					"docname": frm.doc.name
+				method: "erpnext.accounts.doctype.unreconcile_payment.unreconcile_payment.doc_has_references",
+				args: {
+					doctype: frm.doc.doctype,
+					docname: frm.doc.name,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (r.message) {
-						frm.add_custom_button(__("UnReconcile"), function() {
-							erpnext.accounts.unreconcile_payment.build_unreconcile_dialog(frm);
-						}, __('Actions'));
+						frm.add_custom_button(
+							__("UnReconcile"),
+							function () {
+								erpnext.accounts.unreconcile_payment.build_unreconcile_dialog(frm);
+							},
+							__("Actions")
+						);
 					}
-				}
+				},
 			});
 		}
 	},
@@ -30,18 +37,18 @@
 		// assuming each row is an individual voucher
 		// pass this to server side method that creates unreconcile doc for each row
 		let selection_map = [];
-		if (['Sales Invoice', 'Purchase Invoice'].includes(frm.doc.doctype)) {
-			selection_map = selections.map(function(elem) {
+		if (["Sales Invoice", "Purchase Invoice"].includes(frm.doc.doctype)) {
+			selection_map = selections.map(function (elem) {
 				return {
 					company: elem.company,
 					voucher_type: elem.voucher_type,
 					voucher_no: elem.voucher_no,
 					against_voucher_type: frm.doc.doctype,
-					against_voucher_no: frm.doc.name
+					against_voucher_no: frm.doc.name,
 				};
 			});
-		} else if (['Payment Entry', 'Journal Entry'].includes(frm.doc.doctype)) {
-			selection_map = selections.map(function(elem) {
+		} else if (["Payment Entry", "Journal Entry"].includes(frm.doc.doctype)) {
+			selection_map = selections.map(function (elem) {
 				return {
 					company: elem.company,
 					voucher_type: frm.doc.doctype,
@@ -55,18 +62,41 @@
 	},
 
 	build_unreconcile_dialog(frm) {
-		if (['Sales Invoice', 'Purchase Invoice', 'Payment Entry', 'Journal Entry'].includes(frm.doc.doctype)) {
+		if (
+			["Sales Invoice", "Purchase Invoice", "Payment Entry", "Journal Entry"].includes(frm.doc.doctype)
+		) {
 			let child_table_fields = [
-				{ label: __("Voucher Type"), fieldname: "voucher_type", fieldtype: "Dynamic Link", options: "DocType", in_list_view: 1, read_only: 1},
-				{ label: __("Voucher No"), fieldname: "voucher_no", fieldtype: "Link", options: "voucher_type", in_list_view: 1, read_only: 1 },
-				{ label: __("Allocated Amount"), fieldname: "allocated_amount", fieldtype: "Currency", in_list_view: 1, read_only: 1 , options: "account_currency"},
-				{ label: __("Currency"), fieldname: "account_currency", fieldtype: "Currency", read_only: 1},
-			]
+				{
+					label: __("Voucher Type"),
+					fieldname: "voucher_type",
+					fieldtype: "Dynamic Link",
+					options: "DocType",
+					in_list_view: 1,
+					read_only: 1,
+				},
+				{
+					label: __("Voucher No"),
+					fieldname: "voucher_no",
+					fieldtype: "Link",
+					options: "voucher_type",
+					in_list_view: 1,
+					read_only: 1,
+				},
+				{
+					label: __("Allocated Amount"),
+					fieldname: "allocated_amount",
+					fieldtype: "Currency",
+					in_list_view: 1,
+					read_only: 1,
+					options: "account_currency",
+				},
+				{ label: __("Currency"), fieldname: "account_currency", fieldtype: "Currency", read_only: 1 },
+			];
 			let unreconcile_dialog_fields = [
 				{
-					label: __('Allocations'),
-					fieldname: 'allocations',
-					fieldtype: 'Table',
+					label: __("Allocations"),
+					fieldname: "allocations",
+					fieldtype: "Table",
 					read_only: 1,
 					fields: child_table_fields,
 				},
@@ -74,54 +104,57 @@
 
 			// get linked payments
 			frappe.call({
-				"method": "erpnext.accounts.doctype.unreconcile_payment.unreconcile_payment.get_linked_payments_for_doc",
-				"args": {
-					"company": frm.doc.company,
-					"doctype": frm.doc.doctype,
-					"docname": frm.doc.name
+				method: "erpnext.accounts.doctype.unreconcile_payment.unreconcile_payment.get_linked_payments_for_doc",
+				args: {
+					company: frm.doc.company,
+					doctype: frm.doc.doctype,
+					docname: frm.doc.name,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (r.message) {
 						// populate child table with allocations
 						unreconcile_dialog_fields[0].data = r.message;
-						unreconcile_dialog_fields[0].get_data = function(){ return r.message};
+						unreconcile_dialog_fields[0].get_data = function () {
+							return r.message;
+						};
 
 						let d = new frappe.ui.Dialog({
-							title: 'UnReconcile Allocations',
+							title: "UnReconcile Allocations",
 							fields: unreconcile_dialog_fields,
-							size: 'large',
+							size: "large",
 							cannot_add_rows: true,
-							primary_action_label: 'UnReconcile',
+							primary_action_label: "UnReconcile",
 							primary_action(values) {
-
-								let selected_allocations = values.allocations.filter(x=>x.__checked);
+								let selected_allocations = values.allocations.filter((x) => x.__checked);
 								if (selected_allocations.length > 0) {
-									let selection_map = erpnext.accounts.unreconcile_payment.build_selection_map(frm, selected_allocations);
-									erpnext.accounts.unreconcile_payment.create_unreconcile_docs(selection_map);
+									let selection_map =
+										erpnext.accounts.unreconcile_payment.build_selection_map(
+											frm,
+											selected_allocations
+										);
+									erpnext.accounts.unreconcile_payment.create_unreconcile_docs(
+										selection_map
+									);
 									d.hide();
-
 								} else {
 									frappe.msgprint("No Selection");
 								}
-							}
+							},
 						});
 
 						d.show();
 					}
-				}
+				},
 			});
 		}
 	},
 
 	create_unreconcile_docs(selection_map) {
 		frappe.call({
-			"method": "erpnext.accounts.doctype.unreconcile_payment.unreconcile_payment.create_unreconcile_doc_for_selection",
-			"args": {
-				"selections": selection_map
+			method: "erpnext.accounts.doctype.unreconcile_payment.unreconcile_payment.create_unreconcile_doc_for_selection",
+			args: {
+				selections: selection_map,
 			},
 		});
-	}
-
-
-
-}
+	},
+};
diff --git a/erpnext/public/js/website_theme.js b/erpnext/public/js/website_theme.js
index 0009cac..9c2b8cd 100644
--- a/erpnext/public/js/website_theme.js
+++ b/erpnext/public/js/website_theme.js
@@ -1,14 +1,15 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
 // MIT License. See license.txt
 
-frappe.ui.form.on('Website Theme', {
+frappe.ui.form.on("Website Theme", {
 	validate(frm) {
 		let theme_scss = frm.doc.theme_scss;
-		if (theme_scss && theme_scss.includes('frappe/public/scss/website')
-			&& !theme_scss.includes('erpnext/public/scss/website')
+		if (
+			theme_scss &&
+			theme_scss.includes("frappe/public/scss/website") &&
+			!theme_scss.includes("erpnext/public/scss/website")
 		) {
-			frm.set_value('theme_scss',
-				`${frm.doc.theme_scss}\n@import "erpnext/public/scss/website";`);
+			frm.set_value("theme_scss", `${frm.doc.theme_scss}\n@import "erpnext/public/scss/website";`);
 		}
-	}
+	},
 });
diff --git a/erpnext/public/js/website_utils.js b/erpnext/public/js/website_utils.js
index 2bb5255..981899f 100644
--- a/erpnext/public/js/website_utils.js
+++ b/erpnext/public/js/website_utils.js
@@ -1,14 +1,14 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-if(!window.erpnext) window.erpnext = {};
+if (!window.erpnext) window.erpnext = {};
 
-erpnext.subscribe_to_newsletter = function(opts, btn) {
+erpnext.subscribe_to_newsletter = function (opts, btn) {
 	return frappe.call({
 		type: "POST",
 		method: "frappe.email.doctype.newsletter.newsletter.subscribe",
 		btn: btn,
-		args: {"email": opts.email},
-		callback: opts.callback
+		args: { email: opts.email },
+		callback: opts.callback,
 	});
-}
+};
diff --git a/erpnext/public/scss/erpnext.scss b/erpnext/public/scss/erpnext.scss
index 1626b7c..e45ae50 100644
--- a/erpnext/public/scss/erpnext.scss
+++ b/erpnext/public/scss/erpnext.scss
@@ -51,7 +51,7 @@
 }
 
 // assessment tool
-.frappe-control[data-fieldname='result_html'] {
+.frappe-control[data-fieldname="result_html"] {
 	overflow: scroll;
 }
 .assessment-result-tool {
@@ -70,7 +70,9 @@
 		text-overflow: ellipsis;
 	}
 
-	.total-score, .grade, .score {
+	.total-score,
+	.grade,
+	.score {
 		text-align: right;
 	}
 }
@@ -78,13 +80,13 @@
 /* pos */
 
 body[data-route="pos"] {
-
 	.pos-bill-toolbar {
 		padding: 10px 0px;
 		height: 51px;
 	}
 
-	.pos-bill-item:hover, .list-customers-table > .pos-list-row:hover {
+	.pos-bill-item:hover,
+	.list-customers-table > .pos-list-row:hover {
 		background-color: #f5f7fa;
 		cursor: pointer;
 	}
@@ -135,50 +137,52 @@
 	}
 
 	.pos-payment-row .col-xs-6 {
-		padding :15px;
+		padding: 15px;
 	}
 
 	.pos-payment-row {
-		border-bottom:1px solid var(--border-color);
+		border-bottom: 1px solid var(--border-color);
 		margin: 2px 0px 5px 0px;
 		height: 60px;
 		margin-top: 0px;
 		margin-bottom: 0px;
 	}
 
-	.pos-payment-row:hover, .pos-keyboard-key:hover{
+	.pos-payment-row:hover,
+	.pos-keyboard-key:hover {
 		background-color: var(--bg-color);
 		cursor: pointer;
 	}
 
-	.pos-keyboard-key, .delete-btn {
+	.pos-keyboard-key,
+	.delete-btn {
 		border: 1px solid var(--border-color);
-		height:85px;
-		width:85px;
-		margin:10px 10px;
-		font-size:24px;
-		font-weight:200;
-		background-color: #FDFDFD;
+		height: 85px;
+		width: 85px;
+		margin: 10px 10px;
+		font-size: 24px;
+		font-weight: 200;
+		background-color: #fdfdfd;
 		border-color: #e8e8e8;
 	}
 
 	.numeric-keypad {
 		border: 1px solid var(--border-color);
-		height:69px;
-		width:69px;
-		font-size:20px;
-		font-weight:200;
-		background-color: #FDFDFD;
+		height: 69px;
+		width: 69px;
+		font-size: 20px;
+		font-weight: 200;
+		background-color: #fdfdfd;
 		border-color: #e8e8e8;
-		margin-left:-4px;
+		margin-left: -4px;
 	}
 
 	.pos-pay {
-		height:69px;
-		width:69px;
-		font-size:17px;
-		font-weight:200;
-		margin-left:-4px;
+		height: 69px;
+		width: 69px;
+		font-size: 17px;
+		font-weight: 200;
+		margin-left: -4px;
 	}
 
 	.numeric-keypad {
@@ -188,7 +192,7 @@
 		font-weight: 200;
 		border-radius: 0;
 		background-color: #fff;
-		margin-left:-4px;
+		margin-left: -4px;
 
 		@media (max-width: var(--xl-width)) {
 			height: 45px;
@@ -253,7 +257,8 @@
 		.amount-row h3 {
 			font-size: 15px;
 		}
-		.pos-keyboard-key, .delete-btn {
+		.pos-keyboard-key,
+		.delete-btn {
 			height: 50px;
 		}
 		.multimode-payments {
@@ -277,7 +282,8 @@
 		padding: 15px 10px;
 	}
 
-	.write_off_amount, .change_amount {
+	.write_off_amount,
+	.change_amount {
 		margin: 15px;
 		width: 130px;
 	}
@@ -301,10 +307,11 @@
 		}
 
 		.subject {
-			width: 40%
+			width: 40%;
 		}
 
-		.list-row-checkbox, .list-select-all {
+		.list-row-checkbox,
+		.list-select-all {
 			margin-right: 7px;
 		}
 	}
@@ -397,7 +404,7 @@
 			padding-top: 0;
 		}
 
-		&> .pos-list-row {
+		& > .pos-list-row {
 			border: none;
 
 			@media (max-width: var(--xl-width)) {
@@ -442,13 +449,12 @@
 	padding: 5px 9px;
 	border-radius: 3px;
 	color: #fff;
-
 }
 
 // Healthcare
 
 .exercise-card {
-	box-shadow: 0 1px 3px rgba(0,0,0,0.30);
+	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
 	border-radius: 2px;
 	padding: 6px 6px 6px 8px;
 	margin-top: 10px;
@@ -491,7 +497,9 @@
 	padding: 10px;
 }
 
-.plant-floor, .workstation-wrapper, .workstation-card p {
+.plant-floor,
+.workstation-wrapper,
+.workstation-card p {
 	border-radius: var(--border-radius-md);
 	border: 1px solid var(--border-color);
 	box-shadow: none;
@@ -511,13 +519,13 @@
 
 .plant-floor-container {
 	display: grid;
-	grid-template-columns: repeat(6,minmax(0,1fr));
+	grid-template-columns: repeat(6, minmax(0, 1fr));
 	gap: var(--margin-xl);
 }
 
 @media screen and (max-width: 620px) {
 	.plant-floor-container {
-		grid-template-columns: repeat(2,minmax(0,1fr));
+		grid-template-columns: repeat(2, minmax(0, 1fr));
 	}
 }
 
@@ -535,8 +543,8 @@
 .workstation-abbr {
 	display: flex;
 	background-color: var(--control-bg);
-	height:100%;
-	width:100%;
+	height: 100%;
+	width: 100%;
 	align-items: center;
 	justify-content: center;
-}
\ No newline at end of file
+}
diff --git a/erpnext/public/scss/order-page.scss b/erpnext/public/scss/order-page.scss
index 6f5fe5d..2b1dae2 100644
--- a/erpnext/public/scss/order-page.scss
+++ b/erpnext/public/scss/order-page.scss
@@ -1,115 +1,113 @@
 #page-order {
-    .main-column {
-        .page-content-wrapper {
+	.main-column {
+		.page-content-wrapper {
+			.breadcrumb-container {
+				@media screen and (min-width: 567px) {
+					padding-left: var(--padding-sm);
+				}
+			}
 
-            .breadcrumb-container {
-                @media screen and (min-width: 567px) {
-                    padding-left: var(--padding-sm);
-                }
-            }
+			.container.my-4 {
+				background-color: var(--fg-color);
 
-            .container.my-4 {
-                background-color: var(--fg-color);
-
-                @media screen and (min-width: 567px) {
-                    padding: 1.25rem 1.5rem;
-                    border-radius: var(--border-radius-md);
-                    box-shadow: var(--card-shadow);
-                }
-            }
-        }
-    }
+				@media screen and (min-width: 567px) {
+					padding: 1.25rem 1.5rem;
+					border-radius: var(--border-radius-md);
+					box-shadow: var(--card-shadow);
+				}
+			}
+		}
+	}
 }
 
 .indicator-container {
-    @media screen and (max-width: 567px) {
-        padding-bottom: 0.8rem;
-    }
+	@media screen and (max-width: 567px) {
+		padding-bottom: 0.8rem;
+	}
 }
 
 .order-items {
-    padding: 1.5rem 0;
-    border-bottom: 1px solid var(--border-color);
-    color: var(--gray-700);
+	padding: 1.5rem 0;
+	border-bottom: 1px solid var(--border-color);
+	color: var(--gray-700);
 
-    @media screen and (max-width: 567px) {
-        align-items: flex-start !important;
-    }
-    .col-2 {
-        @media screen and (max-width: 567px) {
-            flex: auto;
-            max-width: 28%;
-        }
-    }
+	@media screen and (max-width: 567px) {
+		align-items: flex-start !important;
+	}
+	.col-2 {
+		@media screen and (max-width: 567px) {
+			flex: auto;
+			max-width: 28%;
+		}
+	}
 
-    .order-item-name {
-        font-size: var(--text-base);
-        font-weight: 500;
-    }
+	.order-item-name {
+		font-size: var(--text-base);
+		font-weight: 500;
+	}
 
-    .btn:focus,
-    .btn:hover {
-        background-color: var(--control-bg);
-    }
+	.btn:focus,
+	.btn:hover {
+		background-color: var(--control-bg);
+	}
 
+	.col-6 {
+		@media screen and (max-width: 567px) {
+			max-width: 100%;
+		}
 
-    .col-6 {
-        @media screen and (max-width: 567px) {
-            max-width: 100%;
-        }
-
-        &.order-item-name {
-            font-size: var(--text-base);
-        }
-    }
+		&.order-item-name {
+			font-size: var(--text-base);
+		}
+	}
 }
 
 .item-grand-total {
-    font-size: var(--text-base);
+	font-size: var(--text-base);
 }
 
 .list-item-name,
 .item-total,
 .order-container,
 .order-qty {
-    font-size: var(--text-md);
+	font-size: var(--text-md);
 }
 
 .d-s-n {
-    @media screen and (max-width: 567px) {
-        display: none;
-    }
+	@media screen and (max-width: 567px) {
+		display: none;
+	}
 }
 
 .d-l-n {
-    @media screen and (min-width: 567px) {
-        display: none;
-    }
+	@media screen and (min-width: 567px) {
+		display: none;
+	}
 }
 
 .border-btm {
-    border-bottom: 1px solid var(--border-color);
+	border-bottom: 1px solid var(--border-color);
 }
 
 .order-taxes {
-    display: flex;
+	display: flex;
 
-    @media screen and (min-width: 567px) {
-        justify-content: flex-end;
-    }
+	@media screen and (min-width: 567px) {
+		justify-content: flex-end;
+	}
 
-    .col-4 {
-        padding-right: 0;
+	.col-4 {
+		padding-right: 0;
 
-        .col-8 {
-            padding-left: 0;
-            padding-right: 0;
-        }
+		.col-8 {
+			padding-left: 0;
+			padding-right: 0;
+		}
 
-        @media screen and (max-width: 567px) {
-            padding-left: 0;
-            flex: auto;
-            max-width: 100%;
-        }
-    }
-}
\ No newline at end of file
+		@media screen and (max-width: 567px) {
+			padding-left: 0;
+			flex: auto;
+			max-width: 100%;
+		}
+	}
+}
diff --git a/erpnext/public/scss/point-of-sale.scss b/erpnext/public/scss/point-of-sale.scss
index ba64b59..75bbabd 100644
--- a/erpnext/public/scss/point-of-sale.scss
+++ b/erpnext/public/scss/point-of-sale.scss
@@ -184,7 +184,6 @@
 						font-weight: 700;
 					}
 				}
-
 			}
 		}
 	}
@@ -261,12 +260,12 @@
 						flex-direction: column;
 						margin-right: auto;
 
-						>.customer-name {
+						> .customer-name {
 							font-weight: 700;
 							font-size: var(--text-lg);
 						}
 
-						>.customer-desc {
+						> .customer-desc {
 							font-weight: 500;
 							font-size: var(--text-sm);
 						}
@@ -277,7 +276,6 @@
 						align-items: center;
 						cursor: pointer;
 					}
-
 				}
 
 				> .customer-fields-container {
@@ -407,7 +405,6 @@
 							font-size: var(--text-lg);
 						}
 
-
 						> .item-name-desc {
 							@extend .nowrap;
 							display: flex;
@@ -455,7 +452,6 @@
 								}
 							}
 						}
-
 					}
 				}
 
@@ -854,7 +850,7 @@
 			display: flex;
 			flex: 1;
 			height: 100%;
-    		position: relative;
+			position: relative;
 			justify-content: flex-end;
 
 			> .fields-section {
@@ -1130,7 +1126,6 @@
 					}
 				}
 
-
 				> .summary-btns {
 					display: flex;
 					justify-content: space-between;
@@ -1142,7 +1137,7 @@
 
 					> .new-btn {
 						background-color: var(--blue-500);
-						color:white;
+						color: white;
 						font-weight: 500;
 					}
 				}
@@ -1156,13 +1151,14 @@
 		grid-template-columns: repeat(1, minmax(0, 1fr));
 
 		> .items-selector {
-			grid-column: span 6 / span 1  !important;
+			grid-column: span 6 / span 1 !important;
 			> .items-container {
-			grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
+				grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
 			}
 		}
 
-		> .item-details-container, .customer-cart-container {
+		> .item-details-container,
+		.customer-cart-container {
 			grid-column: span 6 / span 1;
 		}
 
@@ -1179,7 +1175,7 @@
 			}
 		}
 
-		> .past-order-summary{
+		> .past-order-summary {
 			> .invoice-summary-wrapper {
 				width: 100%;
 			}
diff --git a/erpnext/public/scss/website.scss b/erpnext/public/scss/website.scss
index b5e97f1..dd2ae21 100644
--- a/erpnext/public/scss/website.scss
+++ b/erpnext/public/scss/website.scss
@@ -1,4 +1,4 @@
-@import './order-page';
+@import "./order-page";
 
 .filter-options {
 	max-height: 300px;
@@ -52,7 +52,8 @@
 	border-bottom: 1px solid var(--border-color);
 	position: relative;
 
-	&:only-child, &:last-child {
+	&:only-child,
+	&:last-child {
 		border: 0;
 	}
 
@@ -80,7 +81,8 @@
 	}
 }
 
-.list-item-name, .item-total {
+.list-item-name,
+.item-total {
 	font-size: var(--font-size-sm);
 }
 
@@ -88,4 +90,4 @@
 	@media screen and (max-width: 567px) {
 		margin-top: 1rem;
 	}
-}
\ No newline at end of file
+}
diff --git a/erpnext/quality_management/doctype/non_conformance/non_conformance.js b/erpnext/quality_management/doctype/non_conformance/non_conformance.js
index e7f5eee..5524d74 100644
--- a/erpnext/quality_management/doctype/non_conformance/non_conformance.js
+++ b/erpnext/quality_management/doctype/non_conformance/non_conformance.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Non Conformance', {
+frappe.ui.form.on("Non Conformance", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/quality_management/doctype/quality_action/quality_action.js b/erpnext/quality_management/doctype/quality_action/quality_action.js
index b44f2a2..8261fab 100644
--- a/erpnext/quality_management/doctype/quality_action/quality_action.js
+++ b/erpnext/quality_management/doctype/quality_action/quality_action.js
@@ -1,6 +1,4 @@
 // Copyright (c) 2018, Frappe and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Quality Action', {
-
-});
+frappe.ui.form.on("Quality Action", {});
diff --git a/erpnext/quality_management/doctype/quality_feedback/quality_feedback.js b/erpnext/quality_management/doctype/quality_feedback/quality_feedback.js
index 6fb3267..8166c25 100644
--- a/erpnext/quality_management/doctype/quality_feedback/quality_feedback.js
+++ b/erpnext/quality_management/doctype/quality_feedback/quality_feedback.js
@@ -1,10 +1,10 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Quality Feedback', {
-	template: function(frm) {
+frappe.ui.form.on("Quality Feedback", {
+	template: function (frm) {
 		if (frm.doc.template) {
-			frm.call('set_parameters');
+			frm.call("set_parameters");
 		}
-	}
+	},
 });
diff --git a/erpnext/quality_management/doctype/quality_feedback_template/quality_feedback_template.js b/erpnext/quality_management/doctype/quality_feedback_template/quality_feedback_template.js
index 490eed9..054572a 100644
--- a/erpnext/quality_management/doctype/quality_feedback_template/quality_feedback_template.js
+++ b/erpnext/quality_management/doctype/quality_feedback_template/quality_feedback_template.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Quality Feedback Template', {
+frappe.ui.form.on("Quality Feedback Template", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/quality_management/doctype/quality_goal/quality_goal.js b/erpnext/quality_management/doctype/quality_goal/quality_goal.js
index 40cb4d9..5b7cae5 100644
--- a/erpnext/quality_management/doctype/quality_goal/quality_goal.js
+++ b/erpnext/quality_management/doctype/quality_goal/quality_goal.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2018, Frappe and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Quality Goal', {
+frappe.ui.form.on("Quality Goal", {
 	// refresh: function(frm) {
 	// }
 });
diff --git a/erpnext/quality_management/doctype/quality_meeting/quality_meeting.js b/erpnext/quality_management/doctype/quality_meeting/quality_meeting.js
index eb7a8c3..00ab1e4 100644
--- a/erpnext/quality_management/doctype/quality_meeting/quality_meeting.js
+++ b/erpnext/quality_management/doctype/quality_meeting/quality_meeting.js
@@ -1,6 +1,4 @@
 // Copyright (c) 2018, Frappe and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Quality Meeting', {
-
-});
+frappe.ui.form.on("Quality Meeting", {});
diff --git a/erpnext/quality_management/doctype/quality_meeting/quality_meeting_list.js b/erpnext/quality_management/doctype/quality_meeting/quality_meeting_list.js
index 5fd1b30..ae3112f 100644
--- a/erpnext/quality_management/doctype/quality_meeting/quality_meeting_list.js
+++ b/erpnext/quality_management/doctype/quality_meeting/quality_meeting_list.js
@@ -1,11 +1,10 @@
-frappe.listview_settings['Quality Meeting'] = {
+frappe.listview_settings["Quality Meeting"] = {
 	add_fields: ["status"],
-	get_indicator: function(doc) {
-		if(doc.status == "Open") {
+	get_indicator: function (doc) {
+		if (doc.status == "Open") {
 			return [__("Open"), "red", "status=,Open"];
-		}
-		else if(doc.status == "Close") {
+		} else if (doc.status == "Close") {
 			return [__("Close"), "green", ",status=,Close"];
 		}
-	}
+	},
 };
diff --git a/erpnext/quality_management/doctype/quality_meeting_agenda/quality_meeting_agenda.js b/erpnext/quality_management/doctype/quality_meeting_agenda/quality_meeting_agenda.js
index 09989dc..ad037c2 100644
--- a/erpnext/quality_management/doctype/quality_meeting_agenda/quality_meeting_agenda.js
+++ b/erpnext/quality_management/doctype/quality_meeting_agenda/quality_meeting_agenda.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Quality Meeting Agenda', {
+frappe.ui.form.on("Quality Meeting Agenda", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/quality_management/doctype/quality_procedure/quality_procedure.js b/erpnext/quality_management/doctype/quality_procedure/quality_procedure.js
index 79fd2eb..a2c16dd 100644
--- a/erpnext/quality_management/doctype/quality_procedure/quality_procedure.js
+++ b/erpnext/quality_management/doctype/quality_procedure/quality_procedure.js
@@ -1,23 +1,23 @@
 // Copyright (c) 2018, Frappe and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Quality Procedure', {
-	refresh: function(frm) {
-		frm.set_query('procedure', 'processes', (frm) =>{
+frappe.ui.form.on("Quality Procedure", {
+	refresh: function (frm) {
+		frm.set_query("procedure", "processes", (frm) => {
 			return {
 				filters: {
-					name: ['not in', [frm.parent_quality_procedure, frm.name]]
-				}
+					name: ["not in", [frm.parent_quality_procedure, frm.name]],
+				},
 			};
 		});
 
-		frm.set_query('parent_quality_procedure', function(){
+		frm.set_query("parent_quality_procedure", function () {
 			return {
 				filters: {
 					is_group: 1,
-					name: ['!=', frm.doc.name]
-				}
+					name: ["!=", frm.doc.name],
+				},
 			};
 		});
-	}
+	},
 });
diff --git a/erpnext/quality_management/doctype/quality_procedure/quality_procedure_tree.js b/erpnext/quality_management/doctype/quality_procedure/quality_procedure_tree.js
index 2851fcc..25f9a59 100644
--- a/erpnext/quality_management/doctype/quality_procedure/quality_procedure_tree.js
+++ b/erpnext/quality_management/doctype/quality_procedure/quality_procedure_tree.js
@@ -1,18 +1,18 @@
 frappe.treeview_settings["Quality Procedure"] = {
-	ignore_fields:["parent_quality_procedure"],
-	get_tree_nodes: 'erpnext.quality_management.doctype.quality_procedure.quality_procedure.get_children',
-	add_tree_node: 'erpnext.quality_management.doctype.quality_procedure.quality_procedure.add_node',
+	ignore_fields: ["parent_quality_procedure"],
+	get_tree_nodes: "erpnext.quality_management.doctype.quality_procedure.quality_procedure.get_children",
+	add_tree_node: "erpnext.quality_management.doctype.quality_procedure.quality_procedure.add_node",
 	filters: [
 		{
 			fieldname: "parent_quality_procedure",
 			fieldtype: "Link",
 			options: "Quality Procedure",
 			label: __("Quality Procedure"),
-			get_query: function() {
+			get_query: function () {
 				return {
-					filters: [["Quality Procedure", 'is_group', '=', 1]]
+					filters: [["Quality Procedure", "is_group", "=", 1]],
 				};
-			}
+			},
 		},
 	],
 	breadcrumb: "Quality Management",
@@ -22,13 +22,13 @@
 	menu_items: [
 		{
 			label: __("New Quality Procedure"),
-			action: function() {
+			action: function () {
 				frappe.new_doc("Quality Procedure", true);
 			},
-			condition: 'frappe.boot.user.can_create.indexOf("Quality Procedure") !== -1'
-		}
+			condition: 'frappe.boot.user.can_create.indexOf("Quality Procedure") !== -1',
+		},
 	],
-	onload: function(treeview) {
+	onload: function (treeview) {
 		treeview.make_tree();
 	},
 };
diff --git a/erpnext/quality_management/doctype/quality_review/quality_review.js b/erpnext/quality_management/doctype/quality_review/quality_review.js
index 0e6b703..504f8fc 100644
--- a/erpnext/quality_management/doctype/quality_review/quality_review.js
+++ b/erpnext/quality_management/doctype/quality_review/quality_review.js
@@ -1,15 +1,15 @@
 // Copyright (c) 2018, Frappe and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Quality Review', {
-	goal: function(frm) {
+frappe.ui.form.on("Quality Review", {
+	goal: function (frm) {
 		frappe.call({
-			"method": "frappe.client.get",
+			method: "frappe.client.get",
 			args: {
 				doctype: "Quality Goal",
-				name: frm.doc.goal
+				name: frm.doc.goal,
 			},
-			callback: function(data){
+			callback: function (data) {
 				frm.fields_dict.reviews.grid.remove_all();
 				let objectives = data.message.objectives;
 				for (var i in objectives) {
@@ -19,7 +19,7 @@
 					frm.fields_dict.reviews.get_value()[i].uom = objectives[i].uom;
 				}
 				frm.refresh();
-			}
+			},
 		});
 	},
 });
diff --git a/erpnext/quality_management/doctype/quality_review/quality_review_list.js b/erpnext/quality_management/doctype/quality_review/quality_review_list.js
index b0be783..3be6c10 100644
--- a/erpnext/quality_management/doctype/quality_review/quality_review_list.js
+++ b/erpnext/quality_management/doctype/quality_review/quality_review_list.js
@@ -1,12 +1,10 @@
-frappe.listview_settings['Quality Review'] = {
+frappe.listview_settings["Quality Review"] = {
 	add_fields: ["action"],
-	get_indicator: function(doc)
-	{
-		if(doc.action == "No Action") {
+	get_indicator: function (doc) {
+		if (doc.action == "No Action") {
 			return [__("No Action"), "green", "action,=,No Action"];
-		}
-		else if(doc.action == "Action Initialised") {
+		} else if (doc.action == "Action Initialised") {
 			return [__("Action Initialised"), "red", "action,=,Action Initialised"];
 		}
-	}
+	},
 };
diff --git a/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.js b/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.js
index 5918ec8..5fbb5cb 100644
--- a/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.js
+++ b/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.js
@@ -1,39 +1,39 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.ui.form.on('Import Supplier Invoice', {
-	onload: function(frm) {
+frappe.ui.form.on("Import Supplier Invoice", {
+	onload: function (frm) {
 		frappe.realtime.on("import_invoice_update", function (data) {
 			frm.dashboard.show_progress(data.title, (data.count / data.total) * 100, data.message);
 			if (data.count == data.total) {
-				window.setTimeout(title => frm.dashboard.hide_progress(title), 1500, data.title);
+				window.setTimeout((title) => frm.dashboard.hide_progress(title), 1500, data.title);
 			}
 		});
 	},
-	setup: function(frm) {
-		frm.set_query("tax_account", function(doc) {
+	setup: function (frm) {
+		frm.set_query("tax_account", function (doc) {
 			return {
 				filters: {
-					account_type: 'Tax',
-					company: doc.company
-				}
+					account_type: "Tax",
+					company: doc.company,
+				},
 			};
 		});
 
-		frm.set_query("default_buying_price_list", function(doc) {
+		frm.set_query("default_buying_price_list", function (doc) {
 			return {
 				filters: {
-					currency: frappe.get_doc(":Company", doc.company).default_currency
-				}
+					currency: frappe.get_doc(":Company", doc.company).default_currency,
+				},
 			};
 		});
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		frm.trigger("toggle_read_only_fields");
 	},
 
-	toggle_read_only_fields: function(frm) {
+	toggle_read_only_fields: function (frm) {
 		if (in_list(["File Import Completed", "Processing File Data"], frm.doc.status)) {
 			cur_frm.set_read_only();
 			cur_frm.refresh_fields();
@@ -41,6 +41,5 @@
 		} else {
 			frm.set_df_property("import_invoices", "hidden", 0);
 		}
-	}
-
+	},
 });
diff --git a/erpnext/regional/doctype/lower_deduction_certificate/lower_deduction_certificate.js b/erpnext/regional/doctype/lower_deduction_certificate/lower_deduction_certificate.js
index 8257bf8..02eaff5 100644
--- a/erpnext/regional/doctype/lower_deduction_certificate/lower_deduction_certificate.js
+++ b/erpnext/regional/doctype/lower_deduction_certificate/lower_deduction_certificate.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Lower Deduction Certificate', {
+frappe.ui.form.on("Lower Deduction Certificate", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/regional/doctype/south_africa_vat_settings/south_africa_vat_settings.js b/erpnext/regional/doctype/south_africa_vat_settings/south_africa_vat_settings.js
index e37a61a..86384e4 100644
--- a/erpnext/regional/doctype/south_africa_vat_settings/south_africa_vat_settings.js
+++ b/erpnext/regional/doctype/south_africa_vat_settings/south_africa_vat_settings.js
@@ -1,23 +1,23 @@
 // Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('South Africa VAT Settings', {
-	refresh: function(frm) {
-		frm.set_query("company", function() {
+frappe.ui.form.on("South Africa VAT Settings", {
+	refresh: function (frm) {
+		frm.set_query("company", function () {
 			return {
 				filters: {
 					country: "South Africa",
-				}
+				},
 			};
 		});
-		frm.set_query("account", "vat_accounts", function() {
+		frm.set_query("account", "vat_accounts", function () {
 			return {
 				filters: {
 					company: frm.doc.company,
 					account_type: "Tax",
-					is_group: 0
-				}
+					is_group: 0,
+				},
 			};
 		});
-	}
+	},
 });
diff --git a/erpnext/regional/doctype/uae_vat_settings/uae_vat_settings.js b/erpnext/regional/doctype/uae_vat_settings/uae_vat_settings.js
index 6653141..c7d0f05 100644
--- a/erpnext/regional/doctype/uae_vat_settings/uae_vat_settings.js
+++ b/erpnext/regional/doctype/uae_vat_settings/uae_vat_settings.js
@@ -1,14 +1,14 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('UAE VAT Settings', {
-	onload: function(frm) {
-		frm.set_query('account', 'uae_vat_accounts', function() {
+frappe.ui.form.on("UAE VAT Settings", {
+	onload: function (frm) {
+		frm.set_query("account", "uae_vat_accounts", function () {
 			return {
 				filters: {
-					'company': frm.doc.company
-				}
+					company: frm.doc.company,
+				},
 			};
 		});
-	}
+	},
 });
diff --git a/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.js b/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.js
index 4fc1be1..c883489 100644
--- a/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.js
+++ b/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.js
@@ -1,53 +1,54 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Electronic Invoice Register"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-			"width": "80"
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			width: "80",
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today()
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname":"customer",
-			"label": __("Customer"),
-			"fieldtype": "Link",
-			"options": "Customer"
+			fieldname: "customer",
+			label: __("Customer"),
+			fieldtype: "Link",
+			options: "Customer",
 		},
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
 		},
 	],
-	"onload": function(reportview) {
-		reportview.page.add_inner_button(__("Export E-Invoices"), function() {
+	onload: function (reportview) {
+		reportview.page.add_inner_button(__("Export E-Invoices"), function () {
 			//TODO: refactor condition to disallow export if report has no data.
 			if (!reportview.data.length) {
 				frappe.msgprint(__("No data to export"));
-				return
+				return;
 			}
 
 			var w = window.open(
 				frappe.urllib.get_full_url(
-					"/api/method/erpnext.regional.italy.utils.export_invoices?"
-					+ "filters=" + JSON.stringify(reportview.get_filter_values())
+					"/api/method/erpnext.regional.italy.utils.export_invoices?" +
+						"filters=" +
+						JSON.stringify(reportview.get_filter_values())
 				)
 			);
 			if (!w) {
-				frappe.msgprint(__("Please enable pop-ups")); return;
+				frappe.msgprint(__("Please enable pop-ups"));
+				return;
 			}
-		})
-	}
-}
+		});
+	},
+};
diff --git a/erpnext/regional/report/irs_1099/irs_1099.js b/erpnext/regional/report/irs_1099/irs_1099.js
index b3508e4..385468b 100644
--- a/erpnext/regional/report/irs_1099/irs_1099.js
+++ b/erpnext/regional/report/irs_1099/irs_1099.js
@@ -2,33 +2,33 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["IRS 1099"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1,
-			"width": 80,
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
+			width: 80,
 		},
 		{
-			"fieldname": "fiscal_year",
-			"label": __("Fiscal Year"),
-			"fieldtype": "Link",
-			"options": "Fiscal Year",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
-			"reqd": 1,
-			"width": 80,
+			fieldname: "fiscal_year",
+			label: __("Fiscal Year"),
+			fieldtype: "Link",
+			options: "Fiscal Year",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
+			reqd: 1,
+			width: 80,
 		},
 		{
-			"fieldname": "supplier_group",
-			"label": __("Supplier Group"),
-			"fieldtype": "Link",
-			"options": "Supplier Group",
-			"default": "",
-			"reqd": 0,
-			"width": 80
+			fieldname: "supplier_group",
+			label: __("Supplier Group"),
+			fieldtype: "Link",
+			options: "Supplier Group",
+			default: "",
+			reqd: 0,
+			width: 80,
 		},
 	],
 
@@ -36,12 +36,15 @@
 		query_report.page.add_inner_button(__("Print IRS 1099 Forms"), () => {
 			build_1099_print(query_report);
 		});
-	}
+	},
 };
 
 function build_1099_print(query_report) {
 	let filters = JSON.stringify(query_report.get_values());
-	let w = window.open('/api/method/erpnext.regional.report.irs_1099.irs_1099.irs_1099_print?' +
-		'&filters=' + encodeURIComponent(filters));
+	let w = window.open(
+		"/api/method/erpnext.regional.report.irs_1099.irs_1099.irs_1099_print?" +
+			"&filters=" +
+			encodeURIComponent(filters)
+	);
 	// w.print();
 }
diff --git a/erpnext/regional/report/uae_vat_201/uae_vat_201.js b/erpnext/regional/report/uae_vat_201/uae_vat_201.js
index eaefc04..49060fd 100644
--- a/erpnext/regional/report/uae_vat_201/uae_vat_201.js
+++ b/erpnext/regional/report/uae_vat_201/uae_vat_201.js
@@ -1,36 +1,38 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["UAE VAT 201"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"reqd": 1,
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname": "from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"reqd": 1,
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -3),
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -3),
 		},
 		{
-			"fieldname": "to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"reqd": 1,
-			"default": frappe.datetime.get_today()
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			default: frappe.datetime.get_today(),
 		},
 	],
-	"formatter": function(value, row, column, data, default_formatter) {
-		if (data
-			&& (data.legend=='VAT on Sales and All Other Outputs' || data.legend=='VAT on Expenses and All Other Inputs')
-			&& data.legend==value) {
+	formatter: function (value, row, column, data, default_formatter) {
+		if (
+			data &&
+			(data.legend == "VAT on Sales and All Other Outputs" ||
+				data.legend == "VAT on Expenses and All Other Inputs") &&
+			data.legend == value
+		) {
 			value = $(`<span>${value}</span>`);
 			var $value = $(value).css("font-weight", "bold");
 			value = $value.wrap("<p></p>").parent().html();
diff --git a/erpnext/regional/report/vat_audit_report/vat_audit_report.js b/erpnext/regional/report/vat_audit_report/vat_audit_report.js
index 41318f3..de4fde5 100644
--- a/erpnext/regional/report/vat_audit_report/vat_audit_report.js
+++ b/erpnext/regional/report/vat_audit_report/vat_audit_report.js
@@ -1,31 +1,30 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["VAT Audit Report"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"reqd": 1,
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname": "from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"reqd": 1,
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -2),
-			"width": "80"
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -2),
+			width: "80",
 		},
 		{
-			"fieldname": "to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"reqd": 1,
-			"default": frappe.datetime.get_today()
-		}
-	]
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			default: frappe.datetime.get_today(),
+		},
+	],
 };
diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js
index ddc7e2a..50248a9 100644
--- a/erpnext/selling/doctype/customer/customer.js
+++ b/erpnext/selling/doctype/customer/customer.js
@@ -2,15 +2,15 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.ui.form.on("Customer", {
-	setup: function(frm) {
+	setup: function (frm) {
 		frm.custom_make_buttons = {
-			"Opportunity": "Opportunity",
-			"Quotation": "Quotation",
+			Opportunity: "Opportunity",
+			Quotation: "Quotation",
 			"Sales Order": "Sales Order",
 			"Pricing Rule": "Pricing Rule",
 		};
 		frm.make_methods = {
-			"Quotation": () =>
+			Quotation: () =>
 				frappe.model.open_mapped_doc({
 					method: "erpnext.selling.doctype.customer.customer.make_quotation",
 					frm: frm,
@@ -21,163 +21,181 @@
 					so.customer = frm.doc.name; // Set the current customer as the SO customer
 					frappe.set_route("Form", "Sales Order", so.name);
 				}),
-			"Opportunity": () =>
+			Opportunity: () =>
 				frappe.model.open_mapped_doc({
 					method: "erpnext.selling.doctype.customer.customer.make_opportunity",
 					frm: frm,
 				}),
-			"Pricing Rule": () =>
-				erpnext.utils.make_pricing_rule(frm.doc.doctype, frm.doc.name),
+			"Pricing Rule": () => erpnext.utils.make_pricing_rule(frm.doc.doctype, frm.doc.name),
 		};
 
-		frm.add_fetch('lead_name', 'company_name', 'customer_name');
-		frm.add_fetch('default_sales_partner','commission_rate','default_commission_rate');
-		frm.set_query('customer_group', {'is_group': 0});
-		frm.set_query('default_price_list', { 'selling': 1});
-		frm.set_query('account', 'accounts', function(doc, cdt, cdn) {
-			let d  = locals[cdt][cdn];
+		frm.add_fetch("lead_name", "company_name", "customer_name");
+		frm.add_fetch("default_sales_partner", "commission_rate", "default_commission_rate");
+		frm.set_query("customer_group", { is_group: 0 });
+		frm.set_query("default_price_list", { selling: 1 });
+		frm.set_query("account", "accounts", function (doc, cdt, cdn) {
+			let d = locals[cdt][cdn];
 			let filters = {
-				'account_type': 'Receivable',
-				'root_type': 'Asset',
-				'company': d.company,
-				"is_group": 0
+				account_type: "Receivable",
+				root_type: "Asset",
+				company: d.company,
+				is_group: 0,
 			};
 
-			if(doc.party_account_currency) {
-				$.extend(filters, {"account_currency": doc.party_account_currency});
+			if (doc.party_account_currency) {
+				$.extend(filters, { account_currency: doc.party_account_currency });
 			}
 			return {
-				filters: filters
-			}
+				filters: filters,
+			};
 		});
 
-		frm.set_query('advance_account', 'accounts', function (doc, cdt, cdn) {
+		frm.set_query("advance_account", "accounts", function (doc, cdt, cdn) {
 			let d = locals[cdt][cdn];
 			return {
 				filters: {
-					"account_type": 'Receivable',
-					"root_type": "Liability",
-					"company": d.company,
-					"is_group": 0
-				}
-			}
+					account_type: "Receivable",
+					root_type: "Liability",
+					company: d.company,
+					is_group: 0,
+				},
+			};
 		});
 
-
 		if (frm.doc.__islocal == 1) {
 			frm.set_value("represents_company", "");
 		}
 
-		frm.set_query('customer_primary_contact', function(doc) {
+		frm.set_query("customer_primary_contact", function (doc) {
 			return {
 				query: "erpnext.selling.doctype.customer.customer.get_customer_primary_contact",
 				filters: {
-					'customer': doc.name
-				}
-			}
-		})
-		frm.set_query('customer_primary_address', function(doc) {
+					customer: doc.name,
+				},
+			};
+		});
+		frm.set_query("customer_primary_address", function (doc) {
 			return {
 				filters: {
-					'link_doctype': 'Customer',
-					'link_name': doc.name
-				}
-			}
-		})
-
-		frm.set_query('default_bank_account', function() {
-			return {
-				filters: {
-					'is_company_account': 1
-				}
-			}
+					link_doctype: "Customer",
+					link_name: doc.name,
+				},
+			};
 		});
 
-		frm.set_query("user", "portal_users", function() {
+		frm.set_query("default_bank_account", function () {
 			return {
 				filters: {
-					"ignore_user_type": true,
-				}
+					is_company_account: 1,
+				},
+			};
+		});
+
+		frm.set_query("user", "portal_users", function () {
+			return {
+				filters: {
+					ignore_user_type: true,
+				},
 			};
 		});
 	},
-	customer_primary_address: function(frm){
-		if(frm.doc.customer_primary_address){
+	customer_primary_address: function (frm) {
+		if (frm.doc.customer_primary_address) {
 			frappe.call({
-				method: 'frappe.contacts.doctype.address.address.get_address_display',
+				method: "frappe.contacts.doctype.address.address.get_address_display",
 				args: {
-					"address_dict": frm.doc.customer_primary_address
+					address_dict: frm.doc.customer_primary_address,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					frm.set_value("primary_address", r.message);
-				}
+				},
 			});
 		}
-		if(!frm.doc.customer_primary_address){
+		if (!frm.doc.customer_primary_address) {
 			frm.set_value("primary_address", "");
 		}
 	},
 
-	is_internal_customer: function(frm) {
+	is_internal_customer: function (frm) {
 		if (frm.doc.is_internal_customer == 1) {
 			frm.toggle_reqd("represents_company", true);
-		}
-		else {
+		} else {
 			frm.toggle_reqd("represents_company", false);
 		}
 	},
 
-	customer_primary_contact: function(frm){
-		if(!frm.doc.customer_primary_contact){
+	customer_primary_contact: function (frm) {
+		if (!frm.doc.customer_primary_contact) {
 			frm.set_value("mobile_no", "");
 			frm.set_value("email_id", "");
 		}
 	},
 
-	loyalty_program: function(frm) {
-		if(frm.doc.loyalty_program) {
-			frm.set_value('loyalty_program_tier', null);
+	loyalty_program: function (frm) {
+		if (frm.doc.loyalty_program) {
+			frm.set_value("loyalty_program_tier", null);
 		}
 	},
 
-	refresh: function(frm) {
-		if(frappe.defaults.get_default("cust_master_name")!="Naming Series") {
+	refresh: function (frm) {
+		if (frappe.defaults.get_default("cust_master_name") != "Naming Series") {
 			frm.toggle_display("naming_series", false);
 		} else {
 			erpnext.toggle_naming_series();
 		}
 
-		if(!frm.doc.__islocal) {
+		if (!frm.doc.__islocal) {
 			frappe.contacts.render_address_and_contact(frm);
 
 			// custom buttons
 
-			frm.add_custom_button(__('Accounts Receivable'), function () {
-				frappe.set_route('query-report', 'Accounts Receivable', { party_type: "Customer", party: frm.doc.name });
-			}, __('View'));
+			frm.add_custom_button(
+				__("Accounts Receivable"),
+				function () {
+					frappe.set_route("query-report", "Accounts Receivable", {
+						party_type: "Customer",
+						party: frm.doc.name,
+					});
+				},
+				__("View")
+			);
 
-			frm.add_custom_button(__('Accounting Ledger'), function () {
-				frappe.set_route('query-report', 'General Ledger',
-					{party_type: 'Customer', party: frm.doc.name, party_name: frm.doc.customer_name});
-			}, __('View'));
+			frm.add_custom_button(
+				__("Accounting Ledger"),
+				function () {
+					frappe.set_route("query-report", "General Ledger", {
+						party_type: "Customer",
+						party: frm.doc.name,
+						party_name: frm.doc.customer_name,
+					});
+				},
+				__("View")
+			);
 
 			for (const doctype in frm.make_methods) {
 				frm.add_custom_button(__(doctype), frm.make_methods[doctype], __("Create"));
 			}
 
-			frm.add_custom_button(__('Get Customer Group Details'), function () {
-				frm.trigger("get_customer_group_details");
-			}, __('Actions'));
+			frm.add_custom_button(
+				__("Get Customer Group Details"),
+				function () {
+					frm.trigger("get_customer_group_details");
+				},
+				__("Actions")
+			);
 
 			if (cint(frappe.defaults.get_default("enable_common_party_accounting"))) {
-				frm.add_custom_button(__('Link with Supplier'), function () {
-					frm.trigger('show_party_link_dialog');
-				}, __('Actions'));
+				frm.add_custom_button(
+					__("Link with Supplier"),
+					function () {
+						frm.trigger("show_party_link_dialog");
+					},
+					__("Actions")
+				);
 			}
 
 			// indicator
 			erpnext.utils.set_party_dashboard_indicators(frm);
-
 		} else {
 			frappe.contacts.clear_address_and_contact(frm);
 		}
@@ -186,55 +204,58 @@
 		grid.set_column_disp("allocated_amount", false);
 		grid.set_column_disp("incentives", false);
 	},
-	validate: function(frm) {
-		if(frm.doc.lead_name) frappe.model.clear_doc("Lead", frm.doc.lead_name);
-
+	validate: function (frm) {
+		if (frm.doc.lead_name) frappe.model.clear_doc("Lead", frm.doc.lead_name);
 	},
-	get_customer_group_details: function(frm) {
+	get_customer_group_details: function (frm) {
 		frappe.call({
 			method: "get_customer_group_details",
 			doc: frm.doc,
-			callback: function() {
+			callback: function () {
 				frm.refresh();
-			}
+			},
 		});
-
 	},
-	show_party_link_dialog: function(frm) {
+	show_party_link_dialog: function (frm) {
 		const dialog = new frappe.ui.Dialog({
-			title: __('Select a Supplier'),
-			fields: [{
-				fieldtype: 'Link', label: __('Supplier'),
-				options: 'Supplier', fieldname: 'supplier', reqd: 1
-			}],
-			primary_action: function({ supplier }) {
+			title: __("Select a Supplier"),
+			fields: [
+				{
+					fieldtype: "Link",
+					label: __("Supplier"),
+					options: "Supplier",
+					fieldname: "supplier",
+					reqd: 1,
+				},
+			],
+			primary_action: function ({ supplier }) {
 				frappe.call({
-					method: 'erpnext.accounts.doctype.party_link.party_link.create_party_link',
+					method: "erpnext.accounts.doctype.party_link.party_link.create_party_link",
 					args: {
-						primary_role: 'Customer',
+						primary_role: "Customer",
 						primary_party: frm.doc.name,
-						secondary_party: supplier
+						secondary_party: supplier,
 					},
 					freeze: true,
-					callback: function() {
+					callback: function () {
 						dialog.hide();
 						frappe.msgprint({
-							message: __('Successfully linked to Supplier'),
-							alert: true
+							message: __("Successfully linked to Supplier"),
+							alert: true,
 						});
 					},
-					error: function() {
+					error: function () {
 						dialog.hide();
 						frappe.msgprint({
-							message: __('Linking to Supplier Failed. Please try again.'),
-							title: __('Linking Failed'),
-							indicator: 'red'
+							message: __("Linking to Supplier Failed. Please try again."),
+							title: __("Linking Failed"),
+							indicator: "red",
 						});
-					}
+					},
 				});
 			},
-			primary_action_label: __('Create Link')
+			primary_action_label: __("Create Link"),
 		});
 		dialog.show();
-	}
+	},
 });
diff --git a/erpnext/selling/doctype/customer/customer_list.js b/erpnext/selling/doctype/customer/customer_list.js
index 38fc9ad..6149c6f 100644
--- a/erpnext/selling/doctype/customer/customer_list.js
+++ b/erpnext/selling/doctype/customer/customer_list.js
@@ -1,3 +1,3 @@
-frappe.listview_settings['Customer'] = {
+frappe.listview_settings["Customer"] = {
 	add_fields: ["customer_name", "territory", "customer_group", "customer_type", "image"],
 };
diff --git a/erpnext/selling/doctype/industry_type/industry_type.js b/erpnext/selling/doctype/industry_type/industry_type.js
index 3680906..273e30f 100644
--- a/erpnext/selling/doctype/industry_type/industry_type.js
+++ b/erpnext/selling/doctype/industry_type/industry_type.js
@@ -1,13 +1,7 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-
-
 //--------- ONLOAD -------------
-cur_frm.cscript.onload = function(doc, cdt, cdn) {
+cur_frm.cscript.onload = function (doc, cdt, cdn) {};
 
-}
-
-cur_frm.cscript.refresh = function(doc, cdt, cdn) {
-
-}
+cur_frm.cscript.refresh = function (doc, cdt, cdn) {};
diff --git a/erpnext/selling/doctype/installation_note/installation_note.js b/erpnext/selling/doctype/installation_note/installation_note.js
index 8128c77..4e13fa7 100644
--- a/erpnext/selling/doctype/installation_note/installation_note.js
+++ b/erpnext/selling/doctype/installation_note/installation_note.js
@@ -1,51 +1,51 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.ui.form.on('Installation Note', {
-	setup: function(frm) {
-		frappe.dynamic_link = {doc: frm.doc, fieldname: 'customer', doctype: 'Customer'}
-		frm.set_query('customer_address', erpnext.queries.address_query);
-		frm.set_query('contact_person', erpnext.queries.contact_query);
-		frm.set_query('customer', erpnext.queries.customer);
+frappe.ui.form.on("Installation Note", {
+	setup: function (frm) {
+		frappe.dynamic_link = { doc: frm.doc, fieldname: "customer", doctype: "Customer" };
+		frm.set_query("customer_address", erpnext.queries.address_query);
+		frm.set_query("contact_person", erpnext.queries.contact_query);
+		frm.set_query("customer", erpnext.queries.customer);
 		frm.set_query("serial_and_batch_bundle", "items", (doc, cdt, cdn) => {
 			let row = locals[cdt][cdn];
 			return {
 				filters: {
-					'item_code': row.item_code,
-					'voucher_type': doc.doctype,
-					'voucher_no': ["in", [doc.name, ""]],
-					'is_cancelled': 0,
-				}
-			}
+					item_code: row.item_code,
+					voucher_type: doc.doctype,
+					voucher_no: ["in", [doc.name, ""]],
+					is_cancelled: 0,
+				},
+			};
 		});
 	},
-	onload: function(frm) {
-		if(!frm.doc.status) {
-			frm.set_value({ status:'Draft'});
+	onload: function (frm) {
+		if (!frm.doc.status) {
+			frm.set_value({ status: "Draft" });
 		}
-		if(frm.doc.__islocal) {
-			frm.set_value({inst_date: frappe.datetime.get_today()});
+		if (frm.doc.__islocal) {
+			frm.set_value({ inst_date: frappe.datetime.get_today() });
 		}
 
-		let sbb_field = frm.get_docfield('items', 'serial_and_batch_bundle');
+		let sbb_field = frm.get_docfield("items", "serial_and_batch_bundle");
 		if (sbb_field) {
 			sbb_field.get_route_options_for_new_doc = (row) => {
 				return {
-					'item_code': row.doc.item_code,
-					'voucher_type': frm.doc.doctype,
-				}
+					item_code: row.doc.item_code,
+					voucher_type: frm.doc.doctype,
+				};
 			};
 		}
 	},
-	customer: function(frm) {
+	customer: function (frm) {
 		erpnext.utils.get_party_details(frm);
 	},
-	customer_address: function(frm) {
+	customer_address: function (frm) {
 		erpnext.utils.get_address_display(frm);
 	},
-	contact_person: function(frm) {
+	contact_person: function (frm) {
 		erpnext.utils.get_contact_details(frm);
-	}
+	},
 });
 
 frappe.provide("erpnext.selling");
@@ -54,9 +54,10 @@
 erpnext.selling.InstallationNote = class InstallationNote extends frappe.ui.form.Controller {
 	refresh() {
 		var me = this;
-		if (this.frm.doc.docstatus===0) {
-			this.frm.add_custom_button(__('From Delivery Note'),
-				function() {
+		if (this.frm.doc.docstatus === 0) {
+			this.frm.add_custom_button(
+				__("From Delivery Note"),
+				function () {
 					erpnext.utils.map_current_doc({
 						method: "erpnext.stock.doctype.delivery_note.delivery_note.make_installation_note",
 						source_doctype: "Delivery Note",
@@ -69,13 +70,15 @@
 							docstatus: 1,
 							status: ["not in", ["Stopped", "Closed"]],
 							per_installed: ["<", 99.99],
-							company: me.frm.doc.company
-						}
-					})
-				}, "fa fa-download", "btn-default"
+							company: me.frm.doc.company,
+						},
+					});
+				},
+				"fa fa-download",
+				"btn-default"
 			);
 		}
 	}
 };
 
-extend_cscript(cur_frm.cscript, new erpnext.selling.InstallationNote({frm: cur_frm}));
+extend_cscript(cur_frm.cscript, new erpnext.selling.InstallationNote({ frm: cur_frm }));
diff --git a/erpnext/selling/doctype/party_specific_item/party_specific_item.js b/erpnext/selling/doctype/party_specific_item/party_specific_item.js
index 077b936..0decc70 100644
--- a/erpnext/selling/doctype/party_specific_item/party_specific_item.js
+++ b/erpnext/selling/doctype/party_specific_item/party_specific_item.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Party Specific Item', {
+frappe.ui.form.on("Party Specific Item", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js
index 1bc8d68..6e2b726 100644
--- a/erpnext/selling/doctype/quotation/quotation.js
+++ b/erpnext/selling/doctype/quotation/quotation.js
@@ -6,34 +6,33 @@
 erpnext.pre_sales.set_as_lost("Quotation");
 erpnext.sales_common.setup_selling_controller();
 
-frappe.ui.form.on('Quotation', {
-	setup: function(frm) {
-		frm.custom_make_buttons = {
-			'Sales Order': 'Sales Order'
-		},
+frappe.ui.form.on("Quotation", {
+	setup: function (frm) {
+		(frm.custom_make_buttons = {
+			"Sales Order": "Sales Order",
+		}),
+			frm.set_query("quotation_to", function () {
+				return {
+					filters: {
+						name: ["in", ["Customer", "Lead", "Prospect"]],
+					},
+				};
+			});
 
-		frm.set_query("quotation_to", function() {
-			return{
-				"filters": {
-					"name": ["in", ["Customer", "Lead", "Prospect"]],
-				}
-			}
-		});
+		frm.set_df_property("packed_items", "cannot_add_rows", true);
+		frm.set_df_property("packed_items", "cannot_delete_rows", true);
 
-		frm.set_df_property('packed_items', 'cannot_add_rows', true);
-		frm.set_df_property('packed_items', 'cannot_delete_rows', true);
-
-		frm.set_query('company_address', function(doc) {
-			if(!doc.company) {
-				frappe.throw(__('Please set Company'));
+		frm.set_query("company_address", function (doc) {
+			if (!doc.company) {
+				frappe.throw(__("Please set Company"));
 			}
 
 			return {
-				query: 'frappe.contacts.doctype.address.address.address_query',
+				query: "frappe.contacts.doctype.address.address.address_query",
 				filters: {
-					link_doctype: 'Company',
-					link_name: doc.company
-				}
+					link_doctype: "Company",
+					link_name: doc.company,
+				},
 			};
 		});
 
@@ -41,40 +40,40 @@
 			let row = locals[cdt][cdn];
 			return {
 				filters: {
-					'item_code': row.item_code,
-					'voucher_type': doc.doctype,
-					'voucher_no': ["in", [doc.name, ""]],
-					'is_cancelled': 0,
-				}
-			}
+					item_code: row.item_code,
+					voucher_type: doc.doctype,
+					voucher_no: ["in", [doc.name, ""]],
+					is_cancelled: 0,
+				},
+			};
 		});
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		frm.trigger("set_label");
 		frm.trigger("set_dynamic_field_label");
 
-		let sbb_field = frm.get_docfield('packed_items', 'serial_and_batch_bundle');
+		let sbb_field = frm.get_docfield("packed_items", "serial_and_batch_bundle");
 		if (sbb_field) {
 			sbb_field.get_route_options_for_new_doc = (row) => {
 				return {
-					'item_code': row.doc.item_code,
-					'warehouse': row.doc.warehouse,
-					'voucher_type': frm.doc.doctype,
-				}
+					item_code: row.doc.item_code,
+					warehouse: row.doc.warehouse,
+					voucher_type: frm.doc.doctype,
+				};
 			};
 		}
 	},
 
-	quotation_to: function(frm) {
+	quotation_to: function (frm) {
 		frm.trigger("set_label");
 		frm.trigger("toggle_reqd_lead_customer");
 		frm.trigger("set_dynamic_field_label");
 	},
 
-	set_label: function(frm) {
+	set_label: function (frm) {
 		frm.fields_dict.customer_address.set_label(__(frm.doc.quotation_to + " Address"));
-	}
+	},
 });
 
 erpnext.selling.QuotationController = class QuotationController extends erpnext.selling.SellingController {
@@ -83,11 +82,11 @@
 	}
 	party_name() {
 		var me = this;
-		erpnext.utils.get_party_details(this.frm, null, null, function() {
+		erpnext.utils.get_party_details(this.frm, null, null, function () {
 			me.apply_price_list();
 		});
 
-		if(me.frm.doc.quotation_to=="Lead" && me.frm.doc.party_name) {
+		if (me.frm.doc.quotation_to == "Lead" && me.frm.doc.party_name) {
 			me.frm.trigger("get_lead_details");
 		}
 	}
@@ -95,43 +94,48 @@
 		super.refresh(doc, dt, dn);
 		frappe.dynamic_link = {
 			doc: this.frm.doc,
-			fieldname: 'party_name',
-			doctype: doc.quotation_to == 'Customer' ? 'Customer' : 'Lead',
+			fieldname: "party_name",
+			doctype: doc.quotation_to == "Customer" ? "Customer" : "Lead",
 		};
 
 		var me = this;
 
 		if (doc.__islocal && !doc.valid_till) {
-			if(frappe.boot.sysdefaults.quotation_valid_till){
-				this.frm.set_value('valid_till', frappe.datetime.add_days(doc.transaction_date, frappe.boot.sysdefaults.quotation_valid_till));
+			if (frappe.boot.sysdefaults.quotation_valid_till) {
+				this.frm.set_value(
+					"valid_till",
+					frappe.datetime.add_days(
+						doc.transaction_date,
+						frappe.boot.sysdefaults.quotation_valid_till
+					)
+				);
 			} else {
-				this.frm.set_value('valid_till', frappe.datetime.add_months(doc.transaction_date, 1));
+				this.frm.set_value("valid_till", frappe.datetime.add_months(doc.transaction_date, 1));
 			}
 		}
 
 		if (doc.docstatus == 1 && !["Lost", "Ordered"].includes(doc.status)) {
-			if (frappe.boot.sysdefaults.allow_sales_order_creation_for_expired_quotation
-				|| (!doc.valid_till)
-				|| frappe.datetime.get_diff(doc.valid_till, frappe.datetime.get_today()) >= 0) {
-					this.frm.add_custom_button(
-						__("Sales Order"),
-						() => this.make_sales_order(),
-						__("Create")
-					);
-				}
+			if (
+				frappe.boot.sysdefaults.allow_sales_order_creation_for_expired_quotation ||
+				!doc.valid_till ||
+				frappe.datetime.get_diff(doc.valid_till, frappe.datetime.get_today()) >= 0
+			) {
+				this.frm.add_custom_button(__("Sales Order"), () => this.make_sales_order(), __("Create"));
+			}
 
-			if(doc.status!=="Ordered") {
-				this.frm.add_custom_button(__('Set as Lost'), () => {
-						this.frm.trigger('set_as_lost_dialog');
-					});
-				}
+			if (doc.status !== "Ordered") {
+				this.frm.add_custom_button(__("Set as Lost"), () => {
+					this.frm.trigger("set_as_lost_dialog");
+				});
+			}
 
-			cur_frm.page.set_inner_btn_group_as_primary(__('Create'));
+			cur_frm.page.set_inner_btn_group_as_primary(__("Create"));
 		}
 
-		if (this.frm.doc.docstatus===0) {
-			this.frm.add_custom_button(__('Opportunity'),
-				function() {
+		if (this.frm.doc.docstatus === 0) {
+			this.frm.add_custom_button(
+				__("Opportunity"),
+				function () {
 					erpnext.utils.map_current_doc({
 						method: "erpnext.crm.doctype.opportunity.opportunity.make_quotation",
 						source_doctype: "Opportunity",
@@ -142,26 +146,28 @@
 								fieldname: "party_name",
 								fieldtype: "Link",
 								options: me.frm.doc.quotation_to,
-								default: me.frm.doc.party_name || undefined
+								default: me.frm.doc.party_name || undefined,
 							},
 							{
 								label: "Opportunity Type",
 								fieldname: "opportunity_type",
 								fieldtype: "Link",
 								options: "Opportunity Type",
-								default: me.frm.doc.order_type || undefined
-							}
+								default: me.frm.doc.order_type || undefined,
+							},
 						],
 						get_query_filters: {
 							status: ["not in", ["Lost", "Closed"]],
-							company: me.frm.doc.company
-						}
-					})
-				}, __("Get Items From"), "btn-default");
+							company: me.frm.doc.company,
+						},
+					});
+				},
+				__("Get Items From"),
+				"btn-default"
+			);
 		}
 
 		this.toggle_reqd_lead_customer();
-
 	}
 
 	make_sales_order() {
@@ -173,20 +179,20 @@
 		} else {
 			frappe.model.open_mapped_doc({
 				method: "erpnext.selling.doctype.quotation.quotation.make_sales_order",
-				frm: me.frm
+				frm: me.frm,
 			});
 		}
 	}
 
-	set_dynamic_field_label(){
+	set_dynamic_field_label() {
 		if (this.frm.doc.quotation_to == "Customer") {
 			this.frm.set_df_property("party_name", "label", "Customer");
 			this.frm.fields_dict.party_name.get_query = null;
 		} else if (this.frm.doc.quotation_to == "Lead") {
 			this.frm.set_df_property("party_name", "label", "Lead");
-			this.frm.fields_dict.party_name.get_query = function() {
-				return{	query: "erpnext.controllers.queries.lead_query" }
-			}
+			this.frm.fields_dict.party_name.get_query = function () {
+				return { query: "erpnext.controllers.queries.lead_query" };
+			};
 		} else if (this.frm.doc.quotation_to == "Prospect") {
 			this.frm.set_df_property("party_name", "label", "Prospect");
 		}
@@ -197,8 +203,8 @@
 
 		// to overwrite the customer_filter trigger from queries.js
 		this.frm.toggle_reqd("party_name", this.frm.doc.quotation_to);
-		this.frm.set_query('customer_address', this.address_query);
-		this.frm.set_query('shipping_address_name', this.address_query);
+		this.frm.set_query("customer_address", this.address_query);
+		this.frm.set_query("shipping_address_name", this.address_query);
 	}
 
 	tc_name() {
@@ -207,17 +213,22 @@
 
 	address_query(doc) {
 		return {
-			query: 'frappe.contacts.doctype.address.address.address_query',
+			query: "frappe.contacts.doctype.address.address.address_query",
 			filters: {
 				link_doctype: frappe.dynamic_link.doctype,
-				link_name: doc.party_name
-			}
+				link_name: doc.party_name,
+			},
 		};
 	}
 
 	validate_company_and_party(party_field) {
-		if(!this.frm.doc.quotation_to) {
-			frappe.msgprint(__("Please select a value for {0} quotation_to {1}", [this.frm.doc.doctype, this.frm.doc.name]));
+		if (!this.frm.doc.quotation_to) {
+			frappe.msgprint(
+				__("Please select a value for {0} quotation_to {1}", [
+					this.frm.doc.doctype,
+					this.frm.doc.name,
+				])
+			);
 			return false;
 		} else if (this.frm.doc.quotation_to == "Lead") {
 			return true;
@@ -228,85 +239,84 @@
 
 	get_lead_details() {
 		var me = this;
-		if(!this.frm.doc.quotation_to === "Lead") {
+		if (!this.frm.doc.quotation_to === "Lead") {
 			return;
 		}
 
 		frappe.call({
 			method: "erpnext.crm.doctype.lead.lead.get_lead_details",
 			args: {
-				'lead': this.frm.doc.party_name,
-				'posting_date': this.frm.doc.transaction_date,
-				'company': this.frm.doc.company,
+				lead: this.frm.doc.party_name,
+				posting_date: this.frm.doc.transaction_date,
+				company: this.frm.doc.company,
 			},
-			callback: function(r) {
-				if(r.message) {
+			callback: function (r) {
+				if (r.message) {
 					me.frm.updating_party_details = true;
 					me.frm.set_value(r.message);
 					me.frm.refresh();
 					me.frm.updating_party_details = false;
-
 				}
-			}
-		})
+			},
+		});
 	}
 
 	show_alternative_items_dialog() {
 		let me = this;
 
 		const table_fields = [
-		{
-			fieldtype:"Data",
-			fieldname:"name",
-			label: __("Name"),
-			read_only: 1,
-		},
-		{
-			fieldtype:"Link",
-			fieldname:"item_code",
-			options: "Item",
-			label: __("Item Code"),
-			read_only: 1,
-			in_list_view: 1,
-			columns: 2,
-			formatter: (value, df, options, doc) => {
-				return doc.is_alternative ? `<span class="indicator yellow">${value}</span>` : value;
-			}
-		},
-		{
-			fieldtype:"Data",
-			fieldname:"description",
-			label: __("Description"),
-			in_list_view: 1,
-			read_only: 1,
-		},
-		{
-			fieldtype:"Currency",
-			fieldname:"amount",
-			label: __("Amount"),
-			options: "currency",
-			in_list_view: 1,
-			read_only: 1,
-		},
-		{
-			fieldtype:"Check",
-			fieldname:"is_alternative",
-			label: __("Is Alternative"),
-			read_only: 1,
-		}];
+			{
+				fieldtype: "Data",
+				fieldname: "name",
+				label: __("Name"),
+				read_only: 1,
+			},
+			{
+				fieldtype: "Link",
+				fieldname: "item_code",
+				options: "Item",
+				label: __("Item Code"),
+				read_only: 1,
+				in_list_view: 1,
+				columns: 2,
+				formatter: (value, df, options, doc) => {
+					return doc.is_alternative ? `<span class="indicator yellow">${value}</span>` : value;
+				},
+			},
+			{
+				fieldtype: "Data",
+				fieldname: "description",
+				label: __("Description"),
+				in_list_view: 1,
+				read_only: 1,
+			},
+			{
+				fieldtype: "Currency",
+				fieldname: "amount",
+				label: __("Amount"),
+				options: "currency",
+				in_list_view: 1,
+				read_only: 1,
+			},
+			{
+				fieldtype: "Check",
+				fieldname: "is_alternative",
+				label: __("Is Alternative"),
+				read_only: 1,
+			},
+		];
 
-
-		this.data = this.frm.doc.items.filter(
-			(item) => item.is_alternative || item.has_alternative_item
-		).map((item) => {
-			return {
-				"name": item.name,
-				"item_code": item.item_code,
-				"description": item.description,
-				"amount": item.amount,
-				"is_alternative": item.is_alternative,
-			}
-		});
+		this.data = this.frm.doc.items
+			.filter((item) => item.is_alternative || item.has_alternative_item)
+			.map((item) => {
+				return {
+					name: item.name,
+					item_code: item.item_code,
+					description: item.description,
+					amount: item.amount,
+					is_alternative: item.is_alternative,
+				};
+			});
 
 		const dialog = new frappe.ui.Dialog({
 			title: __("Select Alternative Items for Sales Order"),
@@ -314,7 +324,7 @@
 				{
 					fieldname: "info",
 					fieldtype: "HTML",
-					read_only: 1
+					read_only: 1,
 				},
 				{
 					fieldname: "alternative_items",
@@ -328,20 +338,20 @@
 					get_data: () => {
 						return this.data;
 					},
-					fields: table_fields
+					fields: table_fields,
 				},
 			],
-			primary_action: function() {
+			primary_action: function () {
 				frappe.model.open_mapped_doc({
 					method: "erpnext.selling.doctype.quotation.quotation.make_sales_order",
 					frm: me.frm,
 					args: {
-						selected_items: dialog.fields_dict.alternative_items.grid.get_selected_children()
-					}
+						selected_items: dialog.fields_dict.alternative_items.grid.get_selected_children(),
+					},
 				});
 				dialog.hide();
 			},
-			primary_action_label: __('Continue')
+			primary_action_label: __("Continue"),
 		});
 
 		dialog.fields_dict.info.$wrapper.html(
@@ -349,19 +359,24 @@
 				<span class="indicator yellow"></span>
 				${__("Alternative Items")}
 			</p>`
-		)
+		);
 		dialog.show();
 	}
 };
 
 cur_frm.script_manager.make(erpnext.selling.QuotationController);
 
-frappe.ui.form.on("Quotation Item", "items_on_form_rendered", "packed_items_on_form_rendered", function(frm, cdt, cdn) {
-	// enable tax_amount field if Actual
-})
+frappe.ui.form.on(
+	"Quotation Item",
+	"items_on_form_rendered",
+	"packed_items_on_form_rendered",
+	function (frm, cdt, cdn) {
+		// enable tax_amount field if Actual
+	}
+);
 
-frappe.ui.form.on("Quotation Item", "stock_balance", function(frm, cdt, cdn) {
+frappe.ui.form.on("Quotation Item", "stock_balance", function (frm, cdt, cdn) {
 	var d = frappe.model.get_doc(cdt, cdn);
-	frappe.route_options = {"item_code": d.item_code};
+	frappe.route_options = { item_code: d.item_code };
 	frappe.set_route("query-report", "Stock Balance");
-})
+});
diff --git a/erpnext/selling/doctype/quotation/quotation_list.js b/erpnext/selling/doctype/quotation/quotation_list.js
index 32fce1f..ae744b9 100644
--- a/erpnext/selling/doctype/quotation/quotation_list.js
+++ b/erpnext/selling/doctype/quotation/quotation_list.js
@@ -1,38 +1,37 @@
-frappe.listview_settings['Quotation'] = {
-	add_fields: ["customer_name", "base_grand_total", "status",
-		"company", "currency", 'valid_till'],
+frappe.listview_settings["Quotation"] = {
+	add_fields: ["customer_name", "base_grand_total", "status", "company", "currency", "valid_till"],
 
-	onload: function(listview) {
+	onload: function (listview) {
 		if (listview.page.fields_dict.quotation_to) {
-			listview.page.fields_dict.quotation_to.get_query = function() {
+			listview.page.fields_dict.quotation_to.get_query = function () {
 				return {
-					"filters": {
-						"name": ["in", ["Customer", "Lead"]],
-					}
+					filters: {
+						name: ["in", ["Customer", "Lead"]],
+					},
 				};
 			};
 		}
 
-		listview.page.add_action_item(__("Sales Order"), ()=>{
+		listview.page.add_action_item(__("Sales Order"), () => {
 			erpnext.bulk_transaction_processing.create(listview, "Quotation", "Sales Order");
 		});
 
-		listview.page.add_action_item(__("Sales Invoice"), ()=>{
+		listview.page.add_action_item(__("Sales Invoice"), () => {
 			erpnext.bulk_transaction_processing.create(listview, "Quotation", "Sales Invoice");
 		});
 	},
 
-	get_indicator: function(doc) {
-		if(doc.status==="Open") {
+	get_indicator: function (doc) {
+		if (doc.status === "Open") {
 			return [__("Open"), "orange", "status,=,Open"];
-		} else if (doc.status==="Partially Ordered") {
+		} else if (doc.status === "Partially Ordered") {
 			return [__("Partially Ordered"), "yellow", "status,=,Partially Ordered"];
-		} else if(doc.status==="Ordered") {
+		} else if (doc.status === "Ordered") {
 			return [__("Ordered"), "green", "status,=,Ordered"];
-		} else if(doc.status==="Lost") {
+		} else if (doc.status === "Lost") {
 			return [__("Lost"), "gray", "status,=,Lost"];
-		} else if(doc.status==="Expired") {
+		} else if (doc.status === "Expired") {
 			return [__("Expired"), "gray", "status,=,Expired"];
 		}
-	}
+	},
 };
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index 1713a7b..161a064 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -6,77 +6,98 @@
 erpnext.sales_common.setup_selling_controller();
 
 frappe.ui.form.on("Sales Order", {
-	setup: function(frm) {
+	setup: function (frm) {
 		frm.custom_make_buttons = {
-			'Delivery Note': 'Delivery Note',
-			'Pick List': 'Pick List',
-			'Sales Invoice': 'Sales Invoice',
-			'Material Request': 'Material Request',
-			'Purchase Order': 'Purchase Order',
-			'Project': 'Project',
-			'Payment Entry': "Payment",
-			'Work Order': "Work Order"
-		}
-		frm.add_fetch('customer', 'tax_id', 'tax_id');
+			"Delivery Note": "Delivery Note",
+			"Pick List": "Pick List",
+			"Sales Invoice": "Sales Invoice",
+			"Material Request": "Material Request",
+			"Purchase Order": "Purchase Order",
+			Project: "Project",
+			"Payment Entry": "Payment",
+			"Work Order": "Work Order",
+		};
+		frm.add_fetch("customer", "tax_id", "tax_id");
 
 		// formatter for material request item
-		frm.set_indicator_formatter('item_code',
-			function(doc) { return (doc.stock_qty<=doc.delivered_qty) ? "green" : "orange" })
+		frm.set_indicator_formatter("item_code", function (doc) {
+			return doc.stock_qty <= doc.delivered_qty ? "green" : "orange";
+		});
 
-		frm.set_query('company_address', function(doc) {
-			if(!doc.company) {
-				frappe.throw(__('Please set Company'));
+		frm.set_query("company_address", function (doc) {
+			if (!doc.company) {
+				frappe.throw(__("Please set Company"));
 			}
 
 			return {
-				query: 'frappe.contacts.doctype.address.address.address_query',
+				query: "frappe.contacts.doctype.address.address.address_query",
 				filters: {
-					link_doctype: 'Company',
-					link_name: doc.company
-				}
+					link_doctype: "Company",
+					link_name: doc.company,
+				},
 			};
-		})
+		});
 
-		frm.set_query("bom_no", "items", function(doc, cdt, cdn) {
+		frm.set_query("bom_no", "items", function (doc, cdt, cdn) {
 			var row = locals[cdt][cdn];
 			return {
 				filters: {
-					"item": row.item_code
-				}
-			}
+					item: row.item_code,
+				},
+			};
 		});
 
-		frm.set_df_property('packed_items', 'cannot_add_rows', true);
-		frm.set_df_property('packed_items', 'cannot_delete_rows', true);
+		frm.set_df_property("packed_items", "cannot_add_rows", true);
+		frm.set_df_property("packed_items", "cannot_delete_rows", true);
 	},
 
-	refresh: function(frm) {
-		if(frm.doc.docstatus === 1) {
-			if (frm.doc.status !== 'Closed' && flt(frm.doc.per_delivered, 2) < 100 && flt(frm.doc.per_billed, 2) < 100) {
-				frm.add_custom_button(__('Update Items'), () => {
+	refresh: function (frm) {
+		if (frm.doc.docstatus === 1) {
+			if (
+				frm.doc.status !== "Closed" &&
+				flt(frm.doc.per_delivered, 2) < 100 &&
+				flt(frm.doc.per_billed, 2) < 100
+			) {
+				frm.add_custom_button(__("Update Items"), () => {
 					erpnext.utils.update_child_items({
 						frm: frm,
 						child_docname: "items",
 						child_doctype: "Sales Order Detail",
 						cannot_add_row: false,
-						has_reserved_stock: frm.doc.__onload && frm.doc.__onload.has_reserved_stock
-					})
+						has_reserved_stock: frm.doc.__onload && frm.doc.__onload.has_reserved_stock,
+					});
 				});
 
 				// Stock Reservation > Reserve button should only be visible if the SO has unreserved stock and no Pick List is created against the SO.
-				if (frm.doc.__onload && frm.doc.__onload.has_unreserved_stock && flt(frm.doc.per_picked) === 0) {
-					frm.add_custom_button(__('Reserve'), () => frm.events.create_stock_reservation_entries(frm), __('Stock Reservation'));
+				if (
+					frm.doc.__onload &&
+					frm.doc.__onload.has_unreserved_stock &&
+					flt(frm.doc.per_picked) === 0
+				) {
+					frm.add_custom_button(
+						__("Reserve"),
+						() => frm.events.create_stock_reservation_entries(frm),
+						__("Stock Reservation")
+					);
 				}
 			}
 
 			// Stock Reservation > Unreserve button will be only visible if the SO has un-delivered reserved stock.
 			if (frm.doc.__onload && frm.doc.__onload.has_reserved_stock) {
-				frm.add_custom_button(__('Unreserve'), () => frm.events.cancel_stock_reservation_entries(frm), __('Stock Reservation'));
+				frm.add_custom_button(
+					__("Unreserve"),
+					() => frm.events.cancel_stock_reservation_entries(frm),
+					__("Stock Reservation")
+				);
 			}
 
-			frm.doc.items.forEach(item => {
+			frm.doc.items.forEach((item) => {
 				if (flt(item.stock_reserved_qty) > 0) {
-					frm.add_custom_button(__('Reserved Stock'), () => frm.events.show_reserved_stock(frm), __('Stock Reservation'));
+					frm.add_custom_button(
+						__("Reserved Stock"),
+						() => frm.events.show_reserved_stock(frm),
+						__("Stock Reservation")
+					);
 					return;
 				}
 			});
@@ -94,11 +115,11 @@
 						frm.set_value("reserve_stock", 0);
 						frm.set_df_property("reserve_stock", "read_only", 1);
 						frm.set_df_property("reserve_stock", "hidden", 1);
-						frm.fields_dict.items.grid.update_docfield_property('reserve_stock', 'hidden', 1);
-						frm.fields_dict.items.grid.update_docfield_property('reserve_stock', 'default', 0);
-						frm.fields_dict.items.grid.update_docfield_property('reserve_stock', 'read_only', 1);
+						frm.fields_dict.items.grid.update_docfield_property("reserve_stock", "hidden", 1);
+						frm.fields_dict.items.grid.update_docfield_property("reserve_stock", "default", 0);
+						frm.fields_dict.items.grid.update_docfield_property("reserve_stock", "read_only", 1);
 					}
-				})
+				});
 			}
 		}
 
@@ -109,47 +130,47 @@
 	},
 
 	get_items_from_internal_purchase_order(frm) {
-		frm.add_custom_button(__('Purchase Order'), () => {
-			erpnext.utils.map_current_doc({
-				method: 'erpnext.buying.doctype.purchase_order.purchase_order.make_inter_company_sales_order',
-				source_doctype: 'Purchase Order',
-				target: frm,
-				setters: [
-					{
-						label: 'Supplier',
-						fieldname: 'supplier',
-						fieldtype: 'Link',
-						options: 'Supplier'
-					}
-				],
-				get_query_filters: {
-					company: frm.doc.company,
-					is_internal_supplier: 1,
-					docstatus: 1,
-					status: ['!=', 'Completed']
-				}
-			});
-		}, __('Get Items From'));
+		frm.add_custom_button(
+			__("Purchase Order"),
+			() => {
+				erpnext.utils.map_current_doc({
+					method: "erpnext.buying.doctype.purchase_order.purchase_order.make_inter_company_sales_order",
+					source_doctype: "Purchase Order",
+					target: frm,
+					setters: [
+						{
+							label: "Supplier",
+							fieldname: "supplier",
+							fieldtype: "Link",
+							options: "Supplier",
+						},
+					],
+					get_query_filters: {
+						company: frm.doc.company,
+						is_internal_supplier: 1,
+						docstatus: 1,
+						status: ["!=", "Completed"],
+					},
+				});
+			},
+			__("Get Items From")
+		);
 	},
 
-	onload: function(frm) {
-		if (!frm.doc.transaction_date){
-			frm.set_value('transaction_date', frappe.datetime.get_today())
+	onload: function (frm) {
+		if (!frm.doc.transaction_date) {
+			frm.set_value("transaction_date", frappe.datetime.get_today());
 		}
-		erpnext.queries.setup_queries(frm, "Warehouse", function() {
+		erpnext.queries.setup_queries(frm, "Warehouse", function () {
 			return {
-				filters: [
-					["Warehouse", "company", "in", ["", cstr(frm.doc.company)]],
-				]
+				filters: [["Warehouse", "company", "in", ["", cstr(frm.doc.company)]]],
 			};
 		});
 
-		frm.set_query('warehouse', 'items', function(doc, cdt, cdn) {
-			let row  = locals[cdt][cdn];
+		frm.set_query("warehouse", "items", function (doc, cdt, cdn) {
+			let row = locals[cdt][cdn];
 			let query = {
-				filters: [
-					["Warehouse", "company", "in", ["", cstr(frm.doc.company)]],
-				]
+				filters: [["Warehouse", "company", "in", ["", cstr(frm.doc.company)]]],
 			};
 			if (row.item_code) {
 				query.query = "erpnext.controllers.queries.warehouse_query";
@@ -160,15 +181,15 @@
 
 		// On cancel and amending a sales order with advance payment, reset advance paid amount
 		if (frm.is_new()) {
-			frm.set_value("advance_paid", 0)
+			frm.set_value("advance_paid", 0);
 		}
 
-		frm.ignore_doctypes_on_cancel_all = ['Purchase Order'];
+		frm.ignore_doctypes_on_cancel_all = ["Purchase Order"];
 	},
 
-	delivery_date: function(frm) {
-		$.each(frm.doc.items || [], function(i, d) {
-			if(!d.delivery_date) d.delivery_date = frm.doc.delivery_date;
+	delivery_date: function (frm) {
+		$.each(frm.doc.items || [], function (i, d) {
+			if (!d.delivery_date) d.delivery_date = frm.doc.delivery_date;
 		});
 		refresh_field("items");
 	},
@@ -186,9 +207,7 @@
 					default: frm.doc.set_warehouse,
 					get_query: () => {
 						return {
-							filters: [
-								["Warehouse", "is_group", "!=", 1]
-							]
+							filters: [["Warehouse", "is_group", "!=", 1]],
 						};
 					},
 					onchange: () => {
@@ -200,7 +219,7 @@
 						}
 					},
 				},
-				{fieldtype: "Column Break"},
+				{ fieldtype: "Column Break" },
 				{
 					fieldname: "add_item",
 					fieldtype: "Link",
@@ -210,19 +229,24 @@
 						return {
 							query: "erpnext.controllers.queries.get_filtered_child_rows",
 							filters: {
-								"parenttype": frm.doc.doctype,
-								"parent": frm.doc.name,
-								"reserve_stock": 1,
-							}
-						}
+								parenttype: frm.doc.doctype,
+								parent: frm.doc.name,
+								reserve_stock: 1,
+							},
+						};
 					},
 					onchange: () => {
 						let sales_order_item = dialog.get_value("add_item");
 
 						if (sales_order_item) {
-							frm.doc.items.forEach(item => {
+							frm.doc.items.forEach((item) => {
 								if (item.name === sales_order_item) {
-									let unreserved_qty = (flt(item.stock_qty) - (item.stock_reserved_qty ? flt(item.stock_reserved_qty) : (flt(item.delivered_qty) * flt(item.conversion_factor)))) / flt(item.conversion_factor);
+									let unreserved_qty =
+										(flt(item.stock_qty) -
+											(item.stock_reserved_qty
+												? flt(item.stock_reserved_qty)
+												: flt(item.delivered_qty) * flt(item.conversion_factor))) /
+										flt(item.conversion_factor);
 
 									if (unreserved_qty > 0) {
 										dialog.fields_dict.items.df.data.forEach((row) => {
@@ -233,10 +257,10 @@
 									}
 
 									dialog.fields_dict.items.df.data.push({
-										'sales_order_item': item.name,
-										'item_code': item.item_code,
-										'warehouse': dialog.get_value("set_warehouse") || item.warehouse,
-										'qty_to_reserve': Math.max(unreserved_qty, 0)
+										sales_order_item: item.name,
+										item_code: item.item_code,
+										warehouse: dialog.get_value("set_warehouse") || item.warehouse,
+										qty_to_reserve: Math.max(unreserved_qty, 0),
 									});
 									dialog.fields_dict.items.grid.refresh();
 									dialog.set_value("add_item", undefined);
@@ -245,7 +269,7 @@
 						}
 					},
 				},
-				{fieldtype: "Section Break"},
+				{ fieldtype: "Section Break" },
 				{
 					fieldname: "items",
 					fieldtype: "Table",
@@ -265,25 +289,26 @@
 								return {
 									query: "erpnext.controllers.queries.get_filtered_child_rows",
 									filters: {
-										"parenttype": frm.doc.doctype,
-										"parent": frm.doc.name,
-										"reserve_stock": 1,
-									}
-								}
+										parenttype: frm.doc.doctype,
+										parent: frm.doc.name,
+										reserve_stock: 1,
+									},
+								};
 							},
 							onchange: (event) => {
 								if (event) {
 									let name = $(event.currentTarget).closest(".grid-row").attr("data-name");
-									let item_row = dialog.fields_dict.items.grid.grid_rows_by_docname[name].doc;
+									let item_row =
+										dialog.fields_dict.items.grid.grid_rows_by_docname[name].doc;
 
-									frm.doc.items.forEach(item => {
+									frm.doc.items.forEach((item) => {
 										if (item.name === item_row.sales_order_item) {
 											item_row.item_code = item.item_code;
 										}
 									});
 									dialog.fields_dict.items.grid.refresh();
 								}
-							}
+							},
 						},
 						{
 							fieldname: "item_code",
@@ -303,9 +328,7 @@
 							in_list_view: 1,
 							get_query: () => {
 								return {
-									filters: [
-										["Warehouse", "is_group", "!=", 1]
-									]
+									filters: [["Warehouse", "is_group", "!=", 1]],
 								};
 							},
 						},
@@ -314,14 +337,14 @@
 							fieldtype: "Float",
 							label: __("Qty"),
 							reqd: 1,
-							in_list_view: 1
-						}
+							in_list_view: 1,
+						},
 					],
 				},
 			],
 			primary_action_label: __("Reserve Stock"),
 			primary_action: () => {
-				var data = {items: dialog.fields_dict.items.grid.data};
+				var data = { items: dialog.fields_dict.items.grid.data };
 
 				if (data.items && data.items.length > 0) {
 					frappe.call({
@@ -329,14 +352,14 @@
 						method: "create_stock_reservation_entries",
 						args: {
 							items_details: data.items,
-							notify: true
+							notify: true,
 						},
 						freeze: true,
 						freeze_message: __("Reserving Stock..."),
 						callback: (r) => {
 							frm.doc.__onload.has_unreserved_stock = false;
 							frm.reload_doc();
-						}
+						},
 					});
 				}
 
@@ -344,16 +367,21 @@
 			},
 		});
 
-		frm.doc.items.forEach(item => {
+		frm.doc.items.forEach((item) => {
 			if (item.reserve_stock) {
-				let unreserved_qty = (flt(item.stock_qty) - (item.stock_reserved_qty ? flt(item.stock_reserved_qty) : (flt(item.delivered_qty) * flt(item.conversion_factor)))) / flt(item.conversion_factor);
+				let unreserved_qty =
+					(flt(item.stock_qty) -
+						(item.stock_reserved_qty
+							? flt(item.stock_reserved_qty)
+							: flt(item.delivered_qty) * flt(item.conversion_factor))) /
+					flt(item.conversion_factor);
 
 				if (unreserved_qty > 0) {
 					dialog.fields_dict.items.df.data.push({
-						'sales_order_item': item.name,
-						'item_code': item.item_code,
-						'warehouse': item.warehouse,
-						'qty_to_reserve': unreserved_qty
+						sales_order_item: item.name,
+						item_code: item.item_code,
+						warehouse: item.warehouse,
+						qty_to_reserve: unreserved_qty,
 					});
 				}
 			}
@@ -410,28 +438,28 @@
 							label: __("Qty"),
 							reqd: 1,
 							read_only: 1,
-							in_list_view: 1
-						}
-					]
-				}
+							in_list_view: 1,
+						},
+					],
+				},
 			],
 			primary_action_label: __("Unreserve Stock"),
 			primary_action: () => {
-				var data = {sr_entries: dialog.fields_dict.sr_entries.grid.data};
+				var data = { sr_entries: dialog.fields_dict.sr_entries.grid.data };
 
 				if (data.sr_entries && data.sr_entries.length > 0) {
 					frappe.call({
 						doc: frm.doc,
 						method: "cancel_stock_reservation_entries",
 						args: {
-							sre_list: data.sr_entries.map(item => item.sre),
+							sre_list: data.sr_entries.map((item) => item.sre),
 						},
 						freeze: true,
-						freeze_message: __('Unreserving Stock...'),
+						freeze_message: __("Unreserving Stock..."),
 						callback: (r) => {
 							frm.doc.__onload.has_reserved_stock = false;
 							frm.reload_doc();
-						}
+						},
 					});
 				}
 
@@ -439,35 +467,39 @@
 			},
 		});
 
-		frappe.call({
-			method: 'erpnext.stock.doctype.stock_reservation_entry.stock_reservation_entry.get_stock_reservation_entries_for_voucher',
-			args: {
-				voucher_type: frm.doctype,
-				voucher_no: frm.docname,
-			},
-			callback: (r) => {
-				if (!r.exc && r.message) {
-					r.message.forEach(sre => {
-						if (flt(sre.reserved_qty) > flt(sre.delivered_qty)) {
-							dialog.fields_dict.sr_entries.df.data.push({
-								'sre': sre.name,
-								'item_code': sre.item_code,
-								'warehouse': sre.warehouse,
-								'qty': (flt(sre.reserved_qty) - flt(sre.delivered_qty))
-							});
-						}
-					});
-				}
-			}
-		}).then(r => {
-			dialog.fields_dict.sr_entries.grid.refresh();
-			dialog.show();
-		});
+		frappe
+			.call({
+				method: "erpnext.stock.doctype.stock_reservation_entry.stock_reservation_entry.get_stock_reservation_entries_for_voucher",
+				args: {
+					voucher_type: frm.doctype,
+					voucher_no: frm.docname,
+				},
+				callback: (r) => {
+					if (!r.exc && r.message) {
+						r.message.forEach((sre) => {
+							if (flt(sre.reserved_qty) > flt(sre.delivered_qty)) {
+								dialog.fields_dict.sr_entries.df.data.push({
+									sre: sre.name,
+									item_code: sre.item_code,
+									warehouse: sre.warehouse,
+									qty: flt(sre.reserved_qty) - flt(sre.delivered_qty),
+								});
+							}
+						});
+					}
+				},
+			})
+			.then((r) => {
+				dialog.fields_dict.sr_entries.grid.refresh();
+				dialog.show();
+			});
 	},
 
 	show_reserved_stock(frm) {
 		// Get the latest modified date from the items table.
-		var to_date = moment(new Date(Math.max(...frm.doc.items.map(e => new Date(e.modified))))).format('YYYY-MM-DD');
+		var to_date = moment(new Date(Math.max(...frm.doc.items.map((e) => new Date(e.modified))))).format(
+			"YYYY-MM-DD"
+		);
 
 		frappe.route_options = {
 			company: frm.doc.company,
@@ -475,13 +507,13 @@
 			to_date: to_date,
 			voucher_type: frm.doc.doctype,
 			voucher_no: frm.doc.name,
-		}
+		};
 		frappe.set_route("query-report", "Reserved Stock");
-	}
+	},
 });
 
 frappe.ui.form.on("Sales Order Item", {
-	item_code: function(frm,cdt,cdn) {
+	item_code: function (frm, cdt, cdn) {
 		var row = locals[cdt][cdn];
 		if (frm.doc.delivery_date) {
 			row.delivery_date = frm.doc.delivery_date;
@@ -490,11 +522,11 @@
 			frm.script_manager.copy_from_first_row("items", row, ["delivery_date"]);
 		}
 	},
-	delivery_date: function(frm, cdt, cdn) {
-		if(!frm.doc.delivery_date) {
+	delivery_date: function (frm, cdt, cdn) {
+		if (!frm.doc.delivery_date) {
 			erpnext.utils.copy_value_in_all_rows(frm.doc, cdt, cdn, "items", "delivery_date");
 		}
-	}
+	},
 });
 
 erpnext.selling.SalesOrderController = class SalesOrderController extends erpnext.selling.SellingController {
@@ -507,111 +539,185 @@
 		super.refresh();
 		let allow_delivery = false;
 
-		if (doc.docstatus==1) {
+		if (doc.docstatus == 1) {
+			if (this.frm.has_perm("submit")) {
+				if (doc.status === "On Hold") {
+					// un-hold
+					this.frm.add_custom_button(
+						__("Resume"),
+						function () {
+							me.frm.cscript.update_status("Resume", "Draft");
+						},
+						__("Status")
+					);
 
-			if(this.frm.has_perm("submit")) {
-				if(doc.status === 'On Hold') {
-				   // un-hold
-				   this.frm.add_custom_button(__('Resume'), function() {
-					   me.frm.cscript.update_status('Resume', 'Draft')
-				   }, __("Status"));
-
-				   if(flt(doc.per_delivered, 2) < 100 || flt(doc.per_billed, 2) < 100) {
-					   // close
-					   this.frm.add_custom_button(__('Close'), () => this.close_sales_order(), __("Status"))
-				   }
+					if (flt(doc.per_delivered, 2) < 100 || flt(doc.per_billed, 2) < 100) {
+						// close
+						this.frm.add_custom_button(__("Close"), () => this.close_sales_order(), __("Status"));
+					}
+				} else if (doc.status === "Closed") {
+					// un-close
+					this.frm.add_custom_button(
+						__("Re-open"),
+						function () {
+							me.frm.cscript.update_status("Re-open", "Draft");
+						},
+						__("Status")
+					);
 				}
-			   	else if(doc.status === 'Closed') {
-				   // un-close
-				   this.frm.add_custom_button(__('Re-open'), function() {
-					   me.frm.cscript.update_status('Re-open', 'Draft')
-				   }, __("Status"));
-			   }
 			}
-			if(doc.status !== 'Closed') {
-				if(doc.status !== 'On Hold') {
-					allow_delivery = this.frm.doc.items.some(item => item.delivered_by_supplier === 0 && item.qty > flt(item.delivered_qty))
-						&& !this.frm.doc.skip_delivery_note
+			if (doc.status !== "Closed") {
+				if (doc.status !== "On Hold") {
+					allow_delivery =
+						this.frm.doc.items.some(
+							(item) => item.delivered_by_supplier === 0 && item.qty > flt(item.delivered_qty)
+						) && !this.frm.doc.skip_delivery_note;
 
 					if (this.frm.has_perm("submit")) {
-						if(flt(doc.per_delivered, 2) < 100 || flt(doc.per_billed, 2) < 100) {
+						if (flt(doc.per_delivered, 2) < 100 || flt(doc.per_billed, 2) < 100) {
 							// hold
-							this.frm.add_custom_button(__('Hold'), () => this.hold_sales_order(), __("Status"))
+							this.frm.add_custom_button(
+								__("Hold"),
+								() => this.hold_sales_order(),
+								__("Status")
+							);
 							// close
-							this.frm.add_custom_button(__('Close'), () => this.close_sales_order(), __("Status"))
+							this.frm.add_custom_button(
+								__("Close"),
+								() => this.close_sales_order(),
+								__("Status")
+							);
 						}
 					}
 
 					if (!doc.__onload || !doc.__onload.has_reserved_stock) {
 						// Don't show the `Reserve` button if the Sales Order has Picked Items.
 						if (flt(doc.per_picked, 2) < 100 && flt(doc.per_delivered, 2) < 100) {
-							this.frm.add_custom_button(__('Pick List'), () => this.create_pick_list(), __('Create'));
+							this.frm.add_custom_button(
+								__("Pick List"),
+								() => this.create_pick_list(),
+								__("Create")
+							);
 						}
 					}
 
 					const order_is_a_sale = ["Sales", "Shopping Cart"].indexOf(doc.order_type) !== -1;
 					const order_is_maintenance = ["Maintenance"].indexOf(doc.order_type) !== -1;
 					// order type has been customised then show all the action buttons
-					const order_is_a_custom_sale = ["Sales", "Shopping Cart", "Maintenance"].indexOf(doc.order_type) === -1;
+					const order_is_a_custom_sale =
+						["Sales", "Shopping Cart", "Maintenance"].indexOf(doc.order_type) === -1;
 
 					// delivery note
-					if(flt(doc.per_delivered, 2) < 100 && (order_is_a_sale || order_is_a_custom_sale) && allow_delivery) {
-						this.frm.add_custom_button(__('Delivery Note'), () => this.make_delivery_note_based_on_delivery_date(true), __('Create'));
-						this.frm.add_custom_button(__('Work Order'), () => this.make_work_order(), __('Create'));
+					if (
+						flt(doc.per_delivered, 2) < 100 &&
+						(order_is_a_sale || order_is_a_custom_sale) &&
+						allow_delivery
+					) {
+						this.frm.add_custom_button(
+							__("Delivery Note"),
+							() => this.make_delivery_note_based_on_delivery_date(true),
+							__("Create")
+						);
+						this.frm.add_custom_button(
+							__("Work Order"),
+							() => this.make_work_order(),
+							__("Create")
+						);
 					}
 
 					// sales invoice
-					if(flt(doc.per_billed, 2) < 100) {
-						this.frm.add_custom_button(__('Sales Invoice'), () => me.make_sales_invoice(), __('Create'));
+					if (flt(doc.per_billed, 2) < 100) {
+						this.frm.add_custom_button(
+							__("Sales Invoice"),
+							() => me.make_sales_invoice(),
+							__("Create")
+						);
 					}
 
 					// material request
-					if(!doc.order_type || (order_is_a_sale || order_is_a_custom_sale) && flt(doc.per_delivered, 2) < 100) {
-						this.frm.add_custom_button(__('Material Request'), () => this.make_material_request(), __('Create'));
-						this.frm.add_custom_button(__('Request for Raw Materials'), () => this.make_raw_material_request(), __('Create'));
+					if (
+						!doc.order_type ||
+						((order_is_a_sale || order_is_a_custom_sale) && flt(doc.per_delivered, 2) < 100)
+					) {
+						this.frm.add_custom_button(
+							__("Material Request"),
+							() => this.make_material_request(),
+							__("Create")
+						);
+						this.frm.add_custom_button(
+							__("Request for Raw Materials"),
+							() => this.make_raw_material_request(),
+							__("Create")
+						);
 					}
 
 					// Make Purchase Order
 					if (!this.frm.doc.is_internal_customer) {
-						this.frm.add_custom_button(__('Purchase Order'), () => this.make_purchase_order(), __('Create'));
+						this.frm.add_custom_button(
+							__("Purchase Order"),
+							() => this.make_purchase_order(),
+							__("Create")
+						);
 					}
 
 					// maintenance
-					if(flt(doc.per_delivered, 2) < 100 && (order_is_maintenance || order_is_a_custom_sale)) {
-						this.frm.add_custom_button(__('Maintenance Visit'), () => this.make_maintenance_visit(), __('Create'));
-						this.frm.add_custom_button(__('Maintenance Schedule'), () => this.make_maintenance_schedule(), __('Create'));
+					if (flt(doc.per_delivered, 2) < 100 && (order_is_maintenance || order_is_a_custom_sale)) {
+						this.frm.add_custom_button(
+							__("Maintenance Visit"),
+							() => this.make_maintenance_visit(),
+							__("Create")
+						);
+						this.frm.add_custom_button(
+							__("Maintenance Schedule"),
+							() => this.make_maintenance_schedule(),
+							__("Create")
+						);
 					}
 
 					// project
-					if(flt(doc.per_delivered, 2) < 100) {
-							this.frm.add_custom_button(__('Project'), () => this.make_project(), __('Create'));
+					if (flt(doc.per_delivered, 2) < 100) {
+						this.frm.add_custom_button(__("Project"), () => this.make_project(), __("Create"));
 					}
 
 					if (doc.docstatus === 1 && !doc.inter_company_order_reference) {
 						let me = this;
 						let internal = me.frm.doc.is_internal_customer;
 						if (internal) {
-							let button_label = (me.frm.doc.company === me.frm.doc.represents_company) ? "Internal Purchase Order" :
-								"Inter Company Purchase Order";
+							let button_label =
+								me.frm.doc.company === me.frm.doc.represents_company
+									? "Internal Purchase Order"
+									: "Inter Company Purchase Order";
 
-							me.frm.add_custom_button(button_label, function() {
-								me.make_inter_company_order();
-							}, __('Create'));
+							me.frm.add_custom_button(
+								button_label,
+								function () {
+									me.make_inter_company_order();
+								},
+								__("Create")
+							);
 						}
 					}
 				}
 				// payment request
-				if(flt(doc.per_billed, precision('per_billed', doc)) < 100 + frappe.boot.sysdefaults.over_billing_allowance) {
-					this.frm.add_custom_button(__('Payment Request'), () => this.make_payment_request(), __('Create'));
-					this.frm.add_custom_button(__('Payment'), () => this.make_payment_entry(), __('Create'));
+				if (
+					flt(doc.per_billed, precision("per_billed", doc)) <
+					100 + frappe.boot.sysdefaults.over_billing_allowance
+				) {
+					this.frm.add_custom_button(
+						__("Payment Request"),
+						() => this.make_payment_request(),
+						__("Create")
+					);
+					this.frm.add_custom_button(__("Payment"), () => this.make_payment_entry(), __("Create"));
 				}
-				this.frm.page.set_inner_btn_group_as_primary(__('Create'));
+				this.frm.page.set_inner_btn_group_as_primary(__("Create"));
 			}
 		}
 
-		if (this.frm.doc.docstatus===0) {
-			this.frm.add_custom_button(__('Quotation'),
-				function() {
+		if (this.frm.doc.docstatus === 0) {
+			this.frm.add_custom_button(
+				__("Quotation"),
+				function () {
 					let d = erpnext.utils.map_current_doc({
 						method: "erpnext.selling.doctype.quotation.quotation.make_sales_order",
 						source_doctype: "Quotation",
@@ -622,14 +728,14 @@
 								fieldname: "party_name",
 								fieldtype: "Link",
 								options: "Customer",
-								default: me.frm.doc.customer || undefined
-							}
+								default: me.frm.doc.customer || undefined,
+							},
 						],
 						get_query_filters: {
 							company: me.frm.doc.company,
 							docstatus: 1,
-							status: ["!=", "Lost"]
-						}
+							status: ["!=", "Lost"],
+						},
 					});
 
 					setTimeout(() => {
@@ -639,8 +745,9 @@
 							</span>
 					`);
 					}, 200);
-
-				}, __("Get Items From"));
+				},
+				__("Get Items From")
+			);
 		}
 
 		this.order_type(doc);
@@ -649,8 +756,8 @@
 	create_pick_list() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.selling.doctype.sales_order.sales_order.create_pick_list",
-			frm: this.frm
-		})
+			frm: this.frm,
+		});
 	}
 
 	make_work_order() {
@@ -661,86 +768,99 @@
 				sales_order: this.frm.docname,
 			},
 			freeze: true,
-			callback: function(r) {
-				if(!r.message) {
+			callback: function (r) {
+				if (!r.message) {
 					frappe.msgprint({
-						title: __('Work Order not created'),
-						message: __('No Items with Bill of Materials to Manufacture'),
-						indicator: 'orange'
+						title: __("Work Order not created"),
+						message: __("No Items with Bill of Materials to Manufacture"),
+						indicator: "orange",
 					});
 					return;
-				}
-				else {
-					const fields = [{
-						label: 'Items',
-						fieldtype: 'Table',
-						fieldname: 'items',
-						description: __('Select BOM and Qty for Production'),
-						fields: [{
-							fieldtype: 'Read Only',
-							fieldname: 'item_code',
-							label: __('Item Code'),
-							in_list_view: 1
-						}, {
-							fieldtype: 'Link',
-							fieldname: 'bom',
-							options: 'BOM',
-							reqd: 1,
-							label: __('Select BOM'),
-							in_list_view: 1,
-							get_query: function (doc) {
-								return { filters: { item: doc.item_code } };
-							}
-						}, {
-							fieldtype: 'Float',
-							fieldname: 'pending_qty',
-							reqd: 1,
-							label: __('Qty'),
-							in_list_view: 1
-						}, {
-							fieldtype: 'Data',
-							fieldname: 'sales_order_item',
-							reqd: 1,
-							label: __('Sales Order Item'),
-							hidden: 1
-						}],
-						data: r.message,
-						get_data: () => {
-							return r.message
-						}
-					}]
+				} else {
+					const fields = [
+						{
+							label: "Items",
+							fieldtype: "Table",
+							fieldname: "items",
+							description: __("Select BOM and Qty for Production"),
+							fields: [
+								{
+									fieldtype: "Read Only",
+									fieldname: "item_code",
+									label: __("Item Code"),
+									in_list_view: 1,
+								},
+								{
+									fieldtype: "Link",
+									fieldname: "bom",
+									options: "BOM",
+									reqd: 1,
+									label: __("Select BOM"),
+									in_list_view: 1,
+									get_query: function (doc) {
+										return { filters: { item: doc.item_code } };
+									},
+								},
+								{
+									fieldtype: "Float",
+									fieldname: "pending_qty",
+									reqd: 1,
+									label: __("Qty"),
+									in_list_view: 1,
+								},
+								{
+									fieldtype: "Data",
+									fieldname: "sales_order_item",
+									reqd: 1,
+									label: __("Sales Order Item"),
+									hidden: 1,
+								},
+							],
+							data: r.message,
+							get_data: () => {
+								return r.message;
+							},
+						},
+					];
 					var d = new frappe.ui.Dialog({
-						title: __('Select Items to Manufacture'),
+						title: __("Select Items to Manufacture"),
 						fields: fields,
-						primary_action: function() {
-							var data = {items: d.fields_dict.items.grid.get_selected_children()};
+						primary_action: function () {
+							var data = { items: d.fields_dict.items.grid.get_selected_children() };
 							me.frm.call({
-								method: 'make_work_orders',
+								method: "make_work_orders",
 								args: {
 									items: data,
 									company: me.frm.doc.company,
 									sales_order: me.frm.docname,
-									project: me.frm.project
+									project: me.frm.project,
 								},
 								freeze: true,
-								callback: function(r) {
-									if(r.message) {
+								callback: function (r) {
+									if (r.message) {
 										frappe.msgprint({
-											message: __('Work Orders Created: {0}', [r.message.map(function(d) {
-													return repl('<a href="/app/work-order/%(name)s">%(name)s</a>', {name:d})
-												}).join(', ')]),
-											indicator: 'green'
-										})
+											message: __("Work Orders Created: {0}", [
+												r.message
+													.map(function (d) {
+														return repl(
+															'<a href="/app/work-order/%(name)s">%(name)s</a>',
+															{ name: d }
+														);
+													})
+													.join(", "),
+											]),
+											indicator: "green",
+										});
 									}
 									d.hide();
-								}
+								},
 							});
 						},
-						primary_action_label: __('Create')
+						primary_action_label: __("Create"),
 					});
 					d.show();
 				}
-			}
+			},
 		});
 	}
 
@@ -755,8 +875,8 @@
 	make_material_request() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.selling.doctype.sales_order.sales_order.make_material_request",
-			frm: this.frm
-		})
+			frm: this.frm,
+		});
 	}
 
 	skip_delivery_note() {
@@ -764,8 +884,10 @@
 	}
 
 	toggle_delivery_date() {
-		this.frm.fields_dict.items.grid.toggle_reqd("delivery_date",
-			(this.frm.doc.order_type == "Sales" && !this.frm.doc.skip_delivery_note));
+		this.frm.fields_dict.items.grid.toggle_reqd(
+			"delivery_date",
+			this.frm.doc.order_type == "Sales" && !this.frm.doc.skip_delivery_note
+		);
 	}
 
 	make_raw_material_request() {
@@ -774,104 +896,135 @@
 			method: "erpnext.selling.doctype.sales_order.sales_order.get_work_order_items",
 			args: {
 				sales_order: this.frm.docname,
-				for_raw_material_request: 1
+				for_raw_material_request: 1,
 			},
-			callback: function(r) {
-				if(!r.message) {
+			callback: function (r) {
+				if (!r.message) {
 					frappe.msgprint({
-						message: __('No Items with Bill of Materials.'),
-						indicator: 'orange'
+						message: __("No Items with Bill of Materials."),
+						indicator: "orange",
 					});
 					return;
-				}
-				else {
+				} else {
 					me.make_raw_material_request_dialog(r);
 				}
-			}
+			},
 		});
 	}
 
 	make_raw_material_request_dialog(r) {
 		var me = this;
 		var fields = [
-			{fieldtype:'Check', fieldname:'include_exploded_items',
-				label: __('Include Exploded Items')},
-			{fieldtype:'Check', fieldname:'ignore_existing_ordered_qty',
-				label: __('Ignore Existing Ordered Qty')},
+			{ fieldtype: "Check", fieldname: "include_exploded_items", label: __("Include Exploded Items") },
 			{
-				fieldtype:'Table', fieldname: 'items',
-				description: __('Select BOM, Qty and For Warehouse'),
+				fieldtype: "Check",
+				fieldname: "ignore_existing_ordered_qty",
+				label: __("Ignore Existing Ordered Qty"),
+			},
+			{
+				fieldtype: "Table",
+				fieldname: "items",
+				description: __("Select BOM, Qty and For Warehouse"),
 				fields: [
-					{fieldtype:'Read Only', fieldname:'item_code',
-						label: __('Item Code'), in_list_view:1},
-					{fieldtype:'Link', fieldname:'warehouse', options: 'Warehouse',
-						label: __('For Warehouse'), in_list_view:1},
-					{fieldtype:'Link', fieldname:'bom', options: 'BOM', reqd: 1,
-						label: __('BOM'), in_list_view:1, get_query: function(doc) {
-							return {filters: {item: doc.item_code}};
-						}
+					{
+						fieldtype: "Read Only",
+						fieldname: "item_code",
+						label: __("Item Code"),
+						in_list_view: 1,
 					},
-					{fieldtype:'Float', fieldname:'required_qty', reqd: 1,
-						label: __('Qty'), in_list_view:1},
+					{
+						fieldtype: "Link",
+						fieldname: "warehouse",
+						options: "Warehouse",
+						label: __("For Warehouse"),
+						in_list_view: 1,
+					},
+					{
+						fieldtype: "Link",
+						fieldname: "bom",
+						options: "BOM",
+						reqd: 1,
+						label: __("BOM"),
+						in_list_view: 1,
+						get_query: function (doc) {
+							return { filters: { item: doc.item_code } };
+						},
+					},
+					{
+						fieldtype: "Float",
+						fieldname: "required_qty",
+						reqd: 1,
+						label: __("Qty"),
+						in_list_view: 1,
+					},
 				],
 				data: r.message,
-				get_data: function() {
-					return r.message
-				}
-			}
-		]
+				get_data: function () {
+					return r.message;
+				},
+			},
+		];
 		var d = new frappe.ui.Dialog({
 			title: __("Items for Raw Material Request"),
 			fields: fields,
-			primary_action: function() {
+			primary_action: function () {
 				var data = d.get_values();
 				me.frm.call({
-					method: 'erpnext.selling.doctype.sales_order.sales_order.make_raw_material_request',
+					method: "erpnext.selling.doctype.sales_order.sales_order.make_raw_material_request",
 					args: {
 						items: data,
 						company: me.frm.doc.company,
 						sales_order: me.frm.docname,
-						project: me.frm.project
+						project: me.frm.project,
 					},
 					freeze: true,
-					callback: function(r) {
-						if(r.message) {
-							frappe.msgprint(__('Material Request {0} submitted.',
-							['<a href="/app/material-request/'+r.message.name+'">' + r.message.name+ '</a>']));
+					callback: function (r) {
+						if (r.message) {
+							frappe.msgprint(
+								__("Material Request {0} submitted.", [
+									'<a href="/app/material-request/' +
+										r.message.name +
+										'">' +
+										r.message.name +
+										"</a>",
+								])
+							);
 						}
 						d.hide();
 						me.frm.reload_doc();
-					}
+					},
 				});
 			},
-			primary_action_label: __('Create')
+			primary_action_label: __("Create"),
 		});
 		d.show();
 	}
 
-	make_delivery_note_based_on_delivery_date(for_reserved_stock=false) {
+	make_delivery_note_based_on_delivery_date(for_reserved_stock = false) {
 		var me = this;
 
-		var delivery_dates = this.frm.doc.items.map(i => i.delivery_date);
-		delivery_dates = [ ...new Set(delivery_dates) ];
+		var delivery_dates = this.frm.doc.items.map((i) => i.delivery_date);
+		delivery_dates = [...new Set(delivery_dates)];
 
 		var today = new Date();
 
 		var item_grid = this.frm.fields_dict["items"].grid;
-		if(!item_grid.get_selected().length && delivery_dates.length > 1) {
+		if (!item_grid.get_selected().length && delivery_dates.length > 1) {
 			var dialog = new frappe.ui.Dialog({
 				title: __("Select Items based on Delivery Date"),
-				fields: [{fieldtype: "HTML", fieldname: "dates_html"}]
+				fields: [{ fieldtype: "HTML", fieldname: "dates_html" }],
 			});
 
 			var html = $(`
 				<div style="border: 1px solid #d1d8dd">
 					<div class="list-item list-item--head">
 						<div class="list-item__content list-item__content--flex-2">
-							${__('Delivery Date')}
+							${__("Delivery Date")}
 						</div>
 					</div>
-					${delivery_dates.map(date => `
+					${delivery_dates
+						.map(
+							(date) => `
 						<div class="list-item">
 							<div class="list-item__content list-item__content--flex-2">
 								<label>
@@ -884,18 +1037,22 @@
 								</label>
 							</div>
 						</div>
-					`).join("")}
+					`
+						)
+						.join("")}
 				</div>
 			`);
 
 			var wrapper = dialog.fields_dict.dates_html.$wrapper;
 			wrapper.html(html);
 
-			dialog.set_primary_action(__("Select"), function() {
-				var dates = wrapper.find('input[type=checkbox]:checked')
-					.map((i, el) => $(el).attr('data-date')).toArray();
+			dialog.set_primary_action(__("Select"), function () {
+				var dates = wrapper
+					.find("input[type=checkbox]:checked")
+					.map((i, el) => $(el).attr("data-date"))
+					.toArray();
 
-				if(!dates) return;
+				if (!dates) return;
 
 				me.make_delivery_note(dates, for_reserved_stock);
 				dialog.hide();
@@ -906,61 +1063,64 @@
 		}
 	}
 
-	make_delivery_note(delivery_dates, for_reserved_stock=false) {
+	make_delivery_note(delivery_dates, for_reserved_stock = false) {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.selling.doctype.sales_order.sales_order.make_delivery_note",
 			frm: this.frm,
 			args: {
 				delivery_dates,
-				for_reserved_stock: for_reserved_stock
+				for_reserved_stock: for_reserved_stock,
 			},
 			freeze: true,
-			freeze_message: __("Creating Delivery Note ...")
-		})
+			freeze_message: __("Creating Delivery Note ..."),
+		});
 	}
 
 	make_sales_invoice() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice",
-			frm: this.frm
-		})
+			frm: this.frm,
+		});
 	}
 
 	make_maintenance_schedule() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_schedule",
-			frm: this.frm
-		})
+			frm: this.frm,
+		});
 	}
 
 	make_project() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.selling.doctype.sales_order.sales_order.make_project",
-			frm: this.frm
-		})
+			frm: this.frm,
+		});
 	}
 
 	make_inter_company_order() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.selling.doctype.sales_order.sales_order.make_inter_company_purchase_order",
-			frm: this.frm
+			frm: this.frm,
 		});
 	}
 
 	make_maintenance_visit() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_visit",
-			frm: this.frm
-		})
+			frm: this.frm,
+		});
 	}
 
-	make_purchase_order(){
-		let pending_items = this.frm.doc.items.some((item) =>{
+	make_purchase_order() {
+		let pending_items = this.frm.doc.items.some((item) => {
 			let pending_qty = flt(item.stock_qty) - flt(item.ordered_qty);
 			return pending_qty > 0;
-		})
-		if(!pending_items){
-			frappe.throw({message: __("Purchase Order already created for all Sales Order items"), title: __("Note")});
+		});
+		if (!pending_items) {
+			frappe.throw({
+				message: __("Purchase Order already created for all Sales Order items"),
+				title: __("Note"),
+			});
 		}
 
 		var me = this;
@@ -969,115 +1129,122 @@
 			size: "large",
 			fields: [
 				{
-					"fieldtype": "Check",
-					"label": __("Against Default Supplier"),
-					"fieldname": "against_default_supplier",
-					"default": 0
+					fieldtype: "Check",
+					label: __("Against Default Supplier"),
+					fieldname: "against_default_supplier",
+					default: 0,
 				},
 				{
-					fieldname: 'items_for_po', fieldtype: 'Table', label: 'Select Items',
+					fieldname: "items_for_po",
+					fieldtype: "Table",
+					label: "Select Items",
 					fields: [
 						{
-							fieldtype:'Data',
-							fieldname:'item_code',
-							label: __('Item'),
-							read_only:1,
-							in_list_view:1
-						},
-						{
-							fieldtype:'Data',
-							fieldname:'item_name',
-							label: __('Item name'),
-							read_only:1,
-							in_list_view:1
-						},
-						{
-							fieldtype:'Float',
-							fieldname:'pending_qty',
-							label: __('Pending Qty'),
+							fieldtype: "Data",
+							fieldname: "item_code",
+							label: __("Item"),
 							read_only: 1,
-							in_list_view:1
+							in_list_view: 1,
 						},
 						{
-							fieldtype:'Link',
-							read_only:1,
-							fieldname:'uom',
-							label: __('UOM'),
-							in_list_view:1,
+							fieldtype: "Data",
+							fieldname: "item_name",
+							label: __("Item name"),
+							read_only: 1,
+							in_list_view: 1,
 						},
 						{
-							fieldtype:'Data',
-							fieldname:'supplier',
-							label: __('Supplier'),
-							read_only:1,
-							in_list_view:1
+							fieldtype: "Float",
+							fieldname: "pending_qty",
+							label: __("Pending Qty"),
+							read_only: 1,
+							in_list_view: 1,
 						},
-					]
-				}
+						{
+							fieldtype: "Link",
+							read_only: 1,
+							fieldname: "uom",
+							label: __("UOM"),
+							in_list_view: 1,
+						},
+						{
+							fieldtype: "Data",
+							fieldname: "supplier",
+							label: __("Supplier"),
+							read_only: 1,
+							in_list_view: 1,
+						},
+					],
+				},
 			],
-			primary_action_label: 'Create Purchase Order',
-			primary_action (args) {
+			primary_action_label: "Create Purchase Order",
+			primary_action(args) {
 				if (!args) return;
 
 				let selected_items = dialog.fields_dict.items_for_po.grid.get_selected_children();
-				if(selected_items.length == 0) {
-					frappe.throw({message: 'Please select Items from the Table', title: __('Items Required'), indicator:'blue'})
+				if (selected_items.length == 0) {
+					frappe.throw({
+						message: "Please select Items from the Table",
+						title: __("Items Required"),
+						indicator: "blue",
+					});
 				}
 
 				dialog.hide();
 
-				var method = args.against_default_supplier ? "make_purchase_order_for_default_supplier" : "make_purchase_order"
+				var method = args.against_default_supplier
+					? "make_purchase_order_for_default_supplier"
+					: "make_purchase_order";
 				return frappe.call({
 					method: "erpnext.selling.doctype.sales_order.sales_order." + method,
 					freeze_message: __("Creating Purchase Order ..."),
 					args: {
-						"source_name": me.frm.doc.name,
-						"selected_items": selected_items
+						source_name: me.frm.doc.name,
+						selected_items: selected_items,
 					},
 					freeze: true,
-					callback: function(r) {
-						if(!r.exc) {
+					callback: function (r) {
+						if (!r.exc) {
 							if (!args.against_default_supplier) {
 								frappe.model.sync(r.message);
 								frappe.set_route("Form", r.message.doctype, r.message.name);
-							}
-							else {
+							} else {
 								frappe.route_options = {
-									"sales_order": me.frm.doc.name
-								}
+									sales_order: me.frm.doc.name,
+								};
 								frappe.set_route("List", "Purchase Order");
 							}
 						}
-					}
-				})
-			}
+					},
+				});
+			},
 		});
 
 		dialog.fields_dict["against_default_supplier"].df.onchange = () => set_po_items_data(dialog);
 
-		function set_po_items_data (dialog) {
+		function set_po_items_data(dialog) {
 			var against_default_supplier = dialog.get_value("against_default_supplier");
 			var items_for_po = dialog.get_value("items_for_po");
 
 			if (against_default_supplier) {
-				let items_with_supplier = items_for_po.filter((item) => item.supplier)
+				let items_with_supplier = items_for_po.filter((item) => item.supplier);
 
 				dialog.fields_dict["items_for_po"].df.data = items_with_supplier;
 				dialog.get_field("items_for_po").refresh();
 			} else {
 				let po_items = [];
-				me.frm.doc.items.forEach(d => {
+				me.frm.doc.items.forEach((d) => {
 					let ordered_qty = me.get_ordered_qty(d, me.frm.doc);
 					let pending_qty = (flt(d.stock_qty) - ordered_qty) / flt(d.conversion_factor);
 					if (pending_qty > 0) {
 						po_items.push({
-							"doctype": "Sales Order Item",
-							"name": d.name,
-							"item_name": d.item_name,
-							"item_code": d.item_code,
-							"pending_qty": pending_qty,
-							"uom": d.uom,
-							"supplier": d.supplier
+							doctype: "Sales Order Item",
+							name: d.name,
+							item_name: d.item_name,
+							item_code: d.item_code,
+							pending_qty: pending_qty,
+							uom: d.uom,
+							supplier: d.supplier,
 						});
 					}
 				});
@@ -1090,7 +1257,7 @@
 		set_po_items_data(dialog);
 		dialog.get_field("items_for_po").grid.only_sortable();
 		dialog.get_field("items_for_po").refresh();
-		dialog.wrapper.find('.grid-heading-row .grid-row-check').click();
+		dialog.wrapper.find(".grid-heading-row .grid-row-check").click();
 		dialog.show();
 	}
 
@@ -1098,71 +1265,66 @@
 		let ordered_qty = item.ordered_qty;
 		if (so.packed_items && so.packed_items.length) {
 			// calculate ordered qty based on packed items in case of product bundle
-			let packed_items = so.packed_items.filter(
-				(pi) => pi.parent_detail_docname == item.name
-			);
+			let packed_items = so.packed_items.filter((pi) => pi.parent_detail_docname == item.name);
 			if (packed_items && packed_items.length) {
-				ordered_qty = packed_items.reduce(
-					(sum, pi) => sum + flt(pi.ordered_qty),
-					0
-				);
+				ordered_qty = packed_items.reduce((sum, pi) => sum + flt(pi.ordered_qty), 0);
 				ordered_qty = ordered_qty / packed_items.length;
 			}
 		}
 		return ordered_qty;
 	}
 
-	hold_sales_order(){
+	hold_sales_order() {
 		var me = this;
 		var d = new frappe.ui.Dialog({
-			title: __('Reason for Hold'),
+			title: __("Reason for Hold"),
 			fields: [
 				{
-					"fieldname": "reason_for_hold",
-					"fieldtype": "Text",
-					"reqd": 1,
-				}
+					fieldname: "reason_for_hold",
+					fieldtype: "Text",
+					reqd: 1,
+				},
 			],
-			primary_action: function() {
+			primary_action: function () {
 				var data = d.get_values();
 				frappe.call({
 					method: "frappe.desk.form.utils.add_comment",
 					args: {
 						reference_doctype: me.frm.doctype,
 						reference_name: me.frm.docname,
-						content: __('Reason for hold:') + ' ' + data.reason_for_hold,
+						content: __("Reason for hold:") + " " + data.reason_for_hold,
 						comment_email: frappe.session.user,
-						comment_by: frappe.session.user_fullname
+						comment_by: frappe.session.user_fullname,
 					},
-					callback: function(r) {
-						if(!r.exc) {
-							me.update_status('Hold', 'On Hold')
+					callback: function (r) {
+						if (!r.exc) {
+							me.update_status("Hold", "On Hold");
 							d.hide();
 						}
-					}
+					},
 				});
-			}
+			},
 		});
 		d.show();
 	}
-	close_sales_order(){
-		this.frm.cscript.update_status("Close", "Closed")
+	close_sales_order() {
+		this.frm.cscript.update_status("Close", "Closed");
 	}
-	update_status(label, status){
+	update_status(label, status) {
 		var doc = this.frm.doc;
 		var me = this;
 		frappe.ui.form.is_saving = true;
 		frappe.call({
 			method: "erpnext.selling.doctype.sales_order.sales_order.update_status",
-			args: {status: status, name: doc.name},
-			callback: function(r){
+			args: { status: status, name: doc.name },
+			callback: function (r) {
 				me.frm.reload_doc();
 			},
-			always: function() {
+			always: function () {
 				frappe.ui.form.is_saving = false;
-			}
+			},
 		});
 	}
 };
 
-extend_cscript(cur_frm.cscript, new erpnext.selling.SalesOrderController({frm: cur_frm}));
+extend_cscript(cur_frm.cscript, new erpnext.selling.SalesOrderController({ frm: cur_frm }));
diff --git a/erpnext/selling/doctype/sales_order/sales_order_calendar.js b/erpnext/selling/doctype/sales_order/sales_order_calendar.js
index cb412cf..f4c0e2b 100644
--- a/erpnext/selling/doctype/sales_order/sales_order_calendar.js
+++ b/erpnext/selling/doctype/sales_order/sales_order_calendar.js
@@ -3,43 +3,44 @@
 
 frappe.views.calendar["Sales Order"] = {
 	field_map: {
-		"start": "delivery_date",
-		"end": "delivery_date",
-		"id": "name",
-		"title": "customer_name",
-		"allDay": "allDay"
+		start: "delivery_date",
+		end: "delivery_date",
+		id: "name",
+		title: "customer_name",
+		allDay: "allDay",
 	},
 	gantt: true,
 	filters: [
 		{
-			"fieldtype": "Link",
-			"fieldname": "customer",
-			"options": "Customer",
-			"label": __("Customer")
+			fieldtype: "Link",
+			fieldname: "customer",
+			options: "Customer",
+			label: __("Customer"),
 		},
 		{
-			"fieldtype": "Select",
-			"fieldname": "delivery_status",
-			"options": "Not Delivered\nFully Delivered\nPartly Delivered\nClosed\nNot Applicable",
-			"label": __("Delivery Status")
+			fieldtype: "Select",
+			fieldname: "delivery_status",
+			options: "Not Delivered\nFully Delivered\nPartly Delivered\nClosed\nNot Applicable",
+			label: __("Delivery Status"),
 		},
 		{
-			"fieldtype": "Select",
-			"fieldname": "billing_status",
-			"options": "Not Billed\nFully Billed\nPartly Billed\nClosed",
-			"label": __("Billing Status")
+			fieldtype: "Select",
+			fieldname: "billing_status",
+			options: "Not Billed\nFully Billed\nPartly Billed\nClosed",
+			label: __("Billing Status"),
 		},
 	],
 	get_events_method: "erpnext.selling.doctype.sales_order.sales_order.get_events",
-	get_css_class: function(data) {
-		if(data.status=="Closed") {
-			return "success";
-		} if(data.delivery_status=="Not Delivered") {
-			return "danger";
-		} else if(data.delivery_status=="Partly Delivered") {
-			return "warning";
-		} else if(data.delivery_status=="Fully Delivered") {
+	get_css_class: function (data) {
+		if (data.status == "Closed") {
 			return "success";
 		}
-	}
-}
+		if (data.delivery_status == "Not Delivered") {
+			return "danger";
+		} else if (data.delivery_status == "Partly Delivered") {
+			return "warning";
+		} else if (data.delivery_status == "Fully Delivered") {
+			return "success";
+		}
+	},
+};
diff --git a/erpnext/selling/doctype/sales_order/sales_order_list.js b/erpnext/selling/doctype/sales_order/sales_order_list.js
index 53de329..14ba051 100644
--- a/erpnext/selling/doctype/sales_order/sales_order_list.js
+++ b/erpnext/selling/doctype/sales_order/sales_order_list.js
@@ -1,6 +1,17 @@
-frappe.listview_settings['Sales Order'] = {
-	add_fields: ["base_grand_total", "customer_name", "currency", "delivery_date",
-		"per_delivered", "per_billed", "status", "advance_payment_status", "order_type", "name", "skip_delivery_note"],
+frappe.listview_settings["Sales Order"] = {
+	add_fields: [
+		"base_grand_total",
+		"customer_name",
+		"currency",
+		"delivery_date",
+		"per_delivered",
+		"per_billed",
+		"status",
+		"advance_payment_status",
+		"order_type",
+		"name",
+		"skip_delivery_note",
+	],
 	get_indicator: function (doc) {
 		if (doc.status === "Closed") {
 			// Closed
@@ -14,70 +25,84 @@
 			return [__("To Pay"), "gray", "advance_payment_status,=,Requested"];
 		} else if (!doc.skip_delivery_note && flt(doc.per_delivered, 2) < 100) {
 			if (frappe.datetime.get_diff(doc.delivery_date) < 0) {
-			// not delivered & overdue
-				return [__("Overdue"), "red",
-					"per_delivered,<,100|delivery_date,<,Today|status,!=,Closed"];
+				// not delivered & overdue
+				return [__("Overdue"), "red", "per_delivered,<,100|delivery_date,<,Today|status,!=,Closed"];
 			} else if (flt(doc.grand_total) === 0) {
 				// not delivered (zeroount order)
-				return [__("To Deliver"), "orange",
-					"per_delivered,<,100|grand_total,=,0|status,!=,Closed"];
+				return [__("To Deliver"), "orange", "per_delivered,<,100|grand_total,=,0|status,!=,Closed"];
 			} else if (flt(doc.per_billed, 2) < 100) {
 				// not delivered & not billed
-				return [__("To Deliver and Bill"), "orange",
-					"per_delivered,<,100|per_billed,<,100|status,!=,Closed"];
+				return [
+					__("To Deliver and Bill"),
+					"orange",
+					"per_delivered,<,100|per_billed,<,100|status,!=,Closed",
+				];
 			} else {
 				// not billed
-				return [__("To Deliver"), "orange",
-					"per_delivered,<,100|per_billed,=,100|status,!=,Closed"];
+				return [__("To Deliver"), "orange", "per_delivered,<,100|per_billed,=,100|status,!=,Closed"];
 			}
-		} else if ((flt(doc.per_delivered, 2) === 100) && flt(doc.grand_total) !== 0
-			&& flt(doc.per_billed, 2) < 100) {
+		} else if (
+			flt(doc.per_delivered, 2) === 100 &&
+			flt(doc.grand_total) !== 0 &&
+			flt(doc.per_billed, 2) < 100
+		) {
 			// to bill
-			return [__("To Bill"), "orange",
-				"per_delivered,=,100|per_billed,<,100|status,!=,Closed"];
-		} else if (doc.skip_delivery_note && flt(doc.per_billed, 2) < 100){
+			return [__("To Bill"), "orange", "per_delivered,=,100|per_billed,<,100|status,!=,Closed"];
+		} else if (doc.skip_delivery_note && flt(doc.per_billed, 2) < 100) {
 			return [__("To Bill"), "orange", "per_billed,<,100|status,!=,Closed"];
 		}
 	},
-	onload: function(listview) {
+	onload: function (listview) {
 		var method = "erpnext.selling.doctype.sales_order.sales_order.close_or_unclose_sales_orders";
 
-		listview.page.add_menu_item(__("Close"), function() {
-			listview.call_for_selected_items(method, {"status": "Closed"});
+		listview.page.add_menu_item(__("Close"), function () {
+			listview.call_for_selected_items(method, { status: "Closed" });
 		});
 
-		listview.page.add_menu_item(__("Re-open"), function() {
-			listview.call_for_selected_items(method, {"status": "Submitted"});
+		listview.page.add_menu_item(__("Re-open"), function () {
+			listview.call_for_selected_items(method, { status: "Submitted" });
 		});
 
-		listview.page.add_action_item(__("Sales Invoice"), ()=>{
+		listview.page.add_action_item(__("Sales Invoice"), () => {
 			erpnext.bulk_transaction_processing.create(listview, "Sales Order", "Sales Invoice");
 		});
 
-		listview.page.add_action_item(__("Delivery Note"), ()=>{
-			frappe.db.get_single_value("Selling Settings", "enable_cutoff_date_on_bulk_delivery_note_creation").then((value) => {
-				if (value) {
-					var dialog = new frappe.ui.Dialog({
-						title: __("Select Items up to Delivery Date"),
-						fields: [{fieldtype: "Date", fieldname: "delivery_date", default: frappe.datetime.add_days(frappe.datetime.nowdate(), 1)}]
-					});
-					dialog.set_primary_action(__("Select"), function(values) {
-						var until_delivery_date = values.delivery_date;
-						erpnext.bulk_transaction_processing.create(listview, "Sales Order", "Delivery Note", {
-							until_delivery_date
+		listview.page.add_action_item(__("Delivery Note"), () => {
+			frappe.db
+				.get_single_value("Selling Settings", "enable_cutoff_date_on_bulk_delivery_note_creation")
+				.then((value) => {
+					if (value) {
+						var dialog = new frappe.ui.Dialog({
+							title: __("Select Items up to Delivery Date"),
+							fields: [
+								{
+									fieldtype: "Date",
+									fieldname: "delivery_date",
+									default: frappe.datetime.add_days(frappe.datetime.nowdate(), 1),
+								},
+							],
 						});
-						dialog.hide();
-					});
-					dialog.show();
-				} else {
-					erpnext.bulk_transaction_processing.create(listview, "Sales Order", "Delivery Note");
-				}
-			})
+						dialog.set_primary_action(__("Select"), function (values) {
+							var until_delivery_date = values.delivery_date;
+							erpnext.bulk_transaction_processing.create(
+								listview,
+								"Sales Order",
+								"Delivery Note",
+								{
+									until_delivery_date,
+								}
+							);
+							dialog.hide();
+						});
+						dialog.show();
+					} else {
+						erpnext.bulk_transaction_processing.create(listview, "Sales Order", "Delivery Note");
+					}
+				});
 		});
 
-		listview.page.add_action_item(__("Advance Payment"), ()=>{
+		listview.page.add_action_item(__("Advance Payment"), () => {
 			erpnext.bulk_transaction_processing.create(listview, "Sales Order", "Payment Entry");
 		});
-
-	}
+	},
 };
diff --git a/erpnext/selling/doctype/sales_partner_type/sales_partner_type.js b/erpnext/selling/doctype/sales_partner_type/sales_partner_type.js
index 3e183f6..ac5a813 100644
--- a/erpnext/selling/doctype/sales_partner_type/sales_partner_type.js
+++ b/erpnext/selling/doctype/sales_partner_type/sales_partner_type.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Sales Partner Type', {
-	refresh: function() {
-
-	}
+frappe.ui.form.on("Sales Partner Type", {
+	refresh: function () {},
 });
diff --git a/erpnext/selling/doctype/selling_settings/selling_settings.js b/erpnext/selling/doctype/selling_settings/selling_settings.js
index cf6fb28..4471458 100644
--- a/erpnext/selling/doctype/selling_settings/selling_settings.js
+++ b/erpnext/selling/doctype/selling_settings/selling_settings.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Selling Settings', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Selling Settings", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/selling/doctype/sms_center/sms_center.js b/erpnext/selling/doctype/sms_center/sms_center.js
index 974cfc7..f513213 100644
--- a/erpnext/selling/doctype/sms_center/sms_center.js
+++ b/erpnext/selling/doctype/sms_center/sms_center.js
@@ -8,10 +8,10 @@
 
 		if (total_characters > 160) {
 			total_msg = cint(total_characters / 160);
-			total_msg = (total_characters % 160 == 0 ? total_msg : total_msg + 1);
+			total_msg = total_characters % 160 == 0 ? total_msg : total_msg + 1;
 		}
 
 		this.frm.set_value("total_characters", total_characters);
 		this.frm.set_value("total_messages", this.frm.doc.message ? total_msg : 0);
-	}
+	},
 });
diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js
index 6db4150..6e4d1d0 100644
--- a/erpnext/selling/page/point_of_sale/point_of_sale.js
+++ b/erpnext/selling/page/point_of_sale/point_of_sale.js
@@ -1,19 +1,19 @@
-frappe.provide('erpnext.PointOfSale');
+frappe.provide("erpnext.PointOfSale");
 
-frappe.pages['point-of-sale'].on_page_load = function(wrapper) {
+frappe.pages["point-of-sale"].on_page_load = function (wrapper) {
 	frappe.ui.make_app_page({
 		parent: wrapper,
-		title: __('Point of Sale'),
-		single_column: true
+		title: __("Point of Sale"),
+		single_column: true,
 	});
 
-	frappe.require('point-of-sale.bundle.js', function() {
+	frappe.require("point-of-sale.bundle.js", function () {
 		wrapper.pos = new erpnext.PointOfSale.Controller(wrapper);
 		window.cur_pos = wrapper.pos;
 	});
 };
 
-frappe.pages['point-of-sale'].refresh = function(wrapper) {
+frappe.pages["point-of-sale"].refresh = function (wrapper) {
 	if (document.scannerDetectionData) {
 		onScan.detachFrom(document);
 		wrapper.pos.wrapper.html("");
diff --git a/erpnext/selling/page/point_of_sale/pos_controller.js b/erpnext/selling/page/point_of_sale/pos_controller.js
index 80e1c20..f361976 100644
--- a/erpnext/selling/page/point_of_sale/pos_controller.js
+++ b/erpnext/selling/page/point_of_sale/pos_controller.js
@@ -1,13 +1,15 @@
 erpnext.PointOfSale.Controller = class {
 	constructor(wrapper) {
-		this.wrapper = $(wrapper).find('.layout-main-section');
+		this.wrapper = $(wrapper).find(".layout-main-section");
 		this.page = wrapper.page;
 
 		this.check_opening_entry();
 	}
 
 	fetch_opening_entry() {
-		return frappe.call("erpnext.selling.page.point_of_sale.point_of_sale.check_opening_entry", { "user": frappe.session.user });
+		return frappe.call("erpnext.selling.page.point_of_sale.point_of_sale.check_opening_entry", {
+			user: frappe.session.user,
+		});
 	}
 
 	check_opening_entry() {
@@ -25,50 +27,62 @@
 		const me = this;
 		const table_fields = [
 			{
-				fieldname: "mode_of_payment", fieldtype: "Link",
-				in_list_view: 1, label: "Mode of Payment",
-				options: "Mode of Payment", reqd: 1
+				fieldname: "mode_of_payment",
+				fieldtype: "Link",
+				in_list_view: 1,
+				label: "Mode of Payment",
+				options: "Mode of Payment",
+				reqd: 1,
 			},
 			{
-				fieldname: "opening_amount", fieldtype: "Currency",
-				in_list_view: 1, label: "Opening Amount",
+				fieldname: "opening_amount",
+				fieldtype: "Currency",
+				in_list_view: 1,
+				label: "Opening Amount",
 				options: "company:company_currency",
 				change: function () {
-					dialog.fields_dict.balance_details.df.data.some(d => {
+					dialog.fields_dict.balance_details.df.data.some((d) => {
 						if (d.idx == this.doc.idx) {
 							d.opening_amount = this.value;
 							dialog.fields_dict.balance_details.grid.refresh();
 							return true;
 						}
 					});
-				}
-			}
+				},
+			},
 		];
 		const fetch_pos_payment_methods = () => {
 			const pos_profile = dialog.fields_dict.pos_profile.get_value();
 			if (!pos_profile) return;
 			frappe.db.get_doc("POS Profile", pos_profile).then(({ payments }) => {
 				dialog.fields_dict.balance_details.df.data = [];
-				payments.forEach(pay => {
+				payments.forEach((pay) => {
 					const { mode_of_payment } = pay;
-					dialog.fields_dict.balance_details.df.data.push({ mode_of_payment, opening_amount: '0' });
+					dialog.fields_dict.balance_details.df.data.push({ mode_of_payment, opening_amount: "0" });
 				});
 				dialog.fields_dict.balance_details.grid.refresh();
 			});
-		}
+		};
 		const dialog = new frappe.ui.Dialog({
-			title: __('Create POS Opening Entry'),
+			title: __("Create POS Opening Entry"),
 			static: true,
 			fields: [
 				{
-					fieldtype: 'Link', label: __('Company'), default: frappe.defaults.get_default('company'),
-					options: 'Company', fieldname: 'company', reqd: 1
+					fieldtype: "Link",
+					label: __("Company"),
+					default: frappe.defaults.get_default("company"),
+					options: "Company",
+					fieldname: "company",
+					reqd: 1,
 				},
 				{
-					fieldtype: 'Link', label: __('POS Profile'),
-					options: 'POS Profile', fieldname: 'pos_profile', reqd: 1,
+					fieldtype: "Link",
+					label: __("POS Profile"),
+					options: "POS Profile",
+					fieldname: "pos_profile",
+					reqd: 1,
 					get_query: () => pos_profile_query(),
-					onchange: () => fetch_pos_payment_methods()
+					onchange: () => fetch_pos_payment_methods(),
 				},
 				{
 					fieldname: "balance_details",
@@ -78,34 +92,38 @@
 					in_place_edit: true,
 					reqd: 1,
 					data: [],
-					fields: table_fields
-				}
+					fields: table_fields,
+				},
 			],
-			primary_action: async function({ company, pos_profile, balance_details }) {
+			primary_action: async function ({ company, pos_profile, balance_details }) {
 				if (!balance_details.length) {
 					frappe.show_alert({
 						message: __("Please add Mode of payments and opening balance details."),
-						indicator: 'red'
-					})
+						indicator: "red",
+					});
 					return frappe.utils.play_sound("error");
 				}
 
 				// filter balance details for empty rows
-				balance_details = balance_details.filter(d => d.mode_of_payment);
+				balance_details = balance_details.filter((d) => d.mode_of_payment);
 
 				const method = "erpnext.selling.page.point_of_sale.point_of_sale.create_opening_voucher";
-				const res = await frappe.call({ method, args: { pos_profile, company, balance_details }, freeze:true });
+				const res = await frappe.call({
+					method,
+					args: { pos_profile, company, balance_details },
+					freeze: true,
+				});
 				!res.exc && me.prepare_app_defaults(res.message);
 				dialog.hide();
 			},
-			primary_action_label: __('Submit')
+			primary_action_label: __("Submit"),
 		});
 		dialog.show();
 		const pos_profile_query = () => {
 			return {
-				query: 'erpnext.accounts.doctype.pos_profile.pos_profile.pos_profile_query',
-				filters: { company: dialog.fields_dict.company.get_value() }
-			}
+				query: "erpnext.accounts.doctype.pos_profile.pos_profile.pos_profile_query",
+				filters: { company: dialog.fields_dict.company.get_value() },
+			};
 		};
 	}
 
@@ -117,19 +135,19 @@
 		this.item_stock_map = {};
 		this.settings = {};
 
-		frappe.db.get_value('Stock Settings', undefined, 'allow_negative_stock').then(({ message }) => {
+		frappe.db.get_value("Stock Settings", undefined, "allow_negative_stock").then(({ message }) => {
 			this.allow_negative_stock = flt(message.allow_negative_stock) || false;
 		});
 
 		frappe.call({
 			method: "erpnext.selling.page.point_of_sale.point_of_sale.get_pos_profile_data",
-			args: { "pos_profile": this.pos_profile },
+			args: { pos_profile: this.pos_profile },
 			callback: (res) => {
 				const profile = res.message;
 				Object.assign(this.settings, profile);
-				this.settings.customer_groups = profile.customer_groups.map(group => group.name);
+				this.settings.customer_groups = profile.customer_groups.map((group) => group.name);
 				this.make_app();
-			}
+			},
 		});
 	}
 
@@ -139,7 +157,8 @@
 				<a class="text-muted" href="#Form/POS%20Opening%20Entry/${this.pos_opening}">
 					Opened at ${moment(this.pos_opening_time).format("Do MMMM, h:mma")}
 				</a>
-			</span>`);
+			</span>`
+		);
 	}
 
 	make_app() {
@@ -150,11 +169,9 @@
 	}
 
 	prepare_dom() {
-		this.wrapper.append(
-			`<div class="point-of-sale-app"></div>`
-		);
+		this.wrapper.append(`<div class="point-of-sale-app"></div>`);
 
-		this.$components_wrapper = this.wrapper.find('.point-of-sale-app');
+		this.$components_wrapper = this.wrapper.find(".point-of-sale-app");
 	}
 
 	prepare_components() {
@@ -169,13 +186,18 @@
 	prepare_menu() {
 		this.page.clear_menu();
 
-		this.page.add_menu_item(__("Open Form View"), this.open_form_view.bind(this), false, 'Ctrl+F');
+		this.page.add_menu_item(__("Open Form View"), this.open_form_view.bind(this), false, "Ctrl+F");
 
-		this.page.add_menu_item(__("Toggle Recent Orders"), this.toggle_recent_order.bind(this), false, 'Ctrl+O');
+		this.page.add_menu_item(
+			__("Toggle Recent Orders"),
+			this.toggle_recent_order.bind(this),
+			false,
+			"Ctrl+O"
+		);
 
-		this.page.add_menu_item(__("Save as Draft"), this.save_draft_invoice.bind(this), false, 'Ctrl+S');
+		this.page.add_menu_item(__("Save as Draft"), this.save_draft_invoice.bind(this), false, "Ctrl+S");
 
-		this.page.add_menu_item(__('Close the POS'), this.close_pos.bind(this), false, 'Shift+Ctrl+C');
+		this.page.add_menu_item(__("Close the POS"), this.close_pos.bind(this), false, "Shift+Ctrl+C");
 	}
 
 	open_form_view() {
@@ -184,7 +206,7 @@
 	}
 
 	toggle_recent_order() {
-		const show = this.recent_order_list.$component.is(':hidden');
+		const show = this.recent_order_list.$component.is(":hidden");
 		this.toggle_recent_order_list(show);
 	}
 
@@ -194,31 +216,33 @@
 		if (this.frm.doc.items.length == 0) {
 			frappe.show_alert({
 				message: __("You must add atleast one item to save it as draft."),
-				indicator:'red'
+				indicator: "red",
 			});
 			frappe.utils.play_sound("error");
 			return;
 		}
 
-		this.frm.save(undefined, undefined, undefined, () => {
-			frappe.show_alert({
-				message: __("There was an error saving the document."),
-				indicator: 'red'
+		this.frm
+			.save(undefined, undefined, undefined, () => {
+				frappe.show_alert({
+					message: __("There was an error saving the document."),
+					indicator: "red",
+				});
+				frappe.utils.play_sound("error");
+			})
+			.then(() => {
+				frappe.run_serially([
+					() => frappe.dom.freeze(),
+					() => this.make_new_invoice(),
+					() => frappe.dom.unfreeze(),
+				]);
 			});
-			frappe.utils.play_sound("error");
-		}).then(() => {
-			frappe.run_serially([
-				() => frappe.dom.freeze(),
-				() => this.make_new_invoice(),
-				() => frappe.dom.unfreeze(),
-			]);
-		});
 	}
 
 	close_pos() {
 		if (!this.$components_wrapper.is(":visible")) return;
 
-		let voucher = frappe.model.get_new_doc('POS Closing Entry');
+		let voucher = frappe.model.get_new_doc("POS Closing Entry");
 		voucher.pos_profile = this.frm.doc.pos_profile;
 		voucher.user = frappe.session.user;
 		voucher.company = this.frm.doc.company;
@@ -226,7 +250,7 @@
 		voucher.period_end_date = frappe.datetime.now_datetime();
 		voucher.posting_date = frappe.datetime.now_date();
 		voucher.posting_time = frappe.datetime.now_time();
-		frappe.set_route('Form', 'POS Closing Entry', voucher.name);
+		frappe.set_route("Form", "POS Closing Entry", voucher.name);
 	}
 
 	init_item_selector() {
@@ -235,11 +259,11 @@
 			pos_profile: this.pos_profile,
 			settings: this.settings,
 			events: {
-				item_selected: args => this.on_cart_update(args),
+				item_selected: (args) => this.on_cart_update(args),
 
-				get_frm: () => this.frm || {}
-			}
-		})
+				get_frm: () => this.frm || {},
+			},
+		});
 	}
 
 	init_item_cart() {
@@ -264,9 +288,9 @@
 					this.customer_details = details;
 					// will add/remove LP payment method
 					this.payment.render_loyalty_points_payment_mode();
-				}
-			}
-		})
+				},
+			},
+		});
 	}
 
 	init_item_details() {
@@ -287,7 +311,7 @@
 						const args = {
 							field,
 							value,
-							item: this.item_details.current_item
+							item: this.item_details.current_item,
 						};
 						return this.on_cart_update(args);
 					}
@@ -304,24 +328,28 @@
 					this.cart.toggle_numpad_field_edit(fieldname);
 				},
 				set_value_in_current_cart_item: (selector, value) => {
-					this.cart.update_selector_value_in_cart_item(selector, value, this.item_details.current_item);
+					this.cart.update_selector_value_in_cart_item(
+						selector,
+						value,
+						this.item_details.current_item
+					);
 				},
 				clone_new_batch_item_in_frm: (batch_serial_map, item) => {
 					// called if serial nos are 'auto_selected' and if those serial nos belongs to multiple batches
 					// for each unique batch new item row is added in the form & cart
-					Object.keys(batch_serial_map).forEach(batch => {
-						const item_to_clone = this.frm.doc.items.find(i => i.name == item.name);
+					Object.keys(batch_serial_map).forEach((batch) => {
+						const item_to_clone = this.frm.doc.items.find((i) => i.name == item.name);
 						const new_row = this.frm.add_child("items", { ...item_to_clone });
 						// update new serialno and batch
 						new_row.batch_no = batch;
 						new_row.serial_no = batch_serial_map[batch].join(`\n`);
 						new_row.qty = batch_serial_map[batch].length;
-						this.frm.doc.items.forEach(row => {
+						this.frm.doc.items.forEach((row) => {
 							if (item.item_code === row.item_code) {
 								this.update_cart_html(row);
 							}
 						});
-					})
+					});
 				},
 				remove_item_from_cart: () => this.remove_item_from_cart(),
 				get_item_stock_map: () => this.item_stock_map,
@@ -330,8 +358,8 @@
 					this.cart.prev_action = null;
 					this.cart.toggle_item_highlight();
 				},
-				get_available_stock: (item_code, warehouse) => this.get_available_stock(item_code, warehouse)
-			}
+				get_available_stock: (item_code, warehouse) => this.get_available_stock(item_code, warehouse),
+			},
 		});
 	}
 
@@ -345,7 +373,9 @@
 
 				toggle_other_sections: (show) => {
 					if (show) {
-						this.item_details.$component.is(':visible') ? this.item_details.$component.css('display', 'none') : '';
+						this.item_details.$component.is(":visible")
+							? this.item_details.$component.css("display", "none")
+							: "";
 						this.item_selector.toggle_component(false);
 					} else {
 						this.item_selector.toggle_component(true);
@@ -353,18 +383,17 @@
 				},
 
 				submit_invoice: () => {
-					this.frm.savesubmit()
-						.then((r) => {
-							this.toggle_components(false);
-							this.order_summary.toggle_component(true);
-							this.order_summary.load_summary_of(this.frm.doc, true);
-							frappe.show_alert({
-								indicator: 'green',
-								message: __('POS invoice {0} created successfully', [r.doc.name])
-							});
+					this.frm.savesubmit().then((r) => {
+						this.toggle_components(false);
+						this.order_summary.toggle_component(true);
+						this.order_summary.load_summary_of(this.frm.doc, true);
+						frappe.show_alert({
+							indicator: "green",
+							message: __("POS invoice {0} created successfully", [r.doc.name]),
 						});
-				}
-			}
+					});
+				},
+			},
 		});
 	}
 
@@ -373,13 +402,13 @@
 			wrapper: this.$components_wrapper,
 			events: {
 				open_invoice_data: (name) => {
-					frappe.db.get_doc('POS Invoice', name).then((doc) => {
+					frappe.db.get_doc("POS Invoice", name).then((doc) => {
 						this.order_summary.load_summary_of(doc);
 					});
 				},
-				reset_summary: () => this.order_summary.toggle_summary_placeholder(true)
-			}
-		})
+				reset_summary: () => this.order_summary.toggle_summary_placeholder(true),
+			},
+		});
 	}
 
 	init_order_summary() {
@@ -390,11 +419,11 @@
 
 				process_return: (name) => {
 					this.recent_order_list.toggle_component(false);
-					frappe.db.get_doc('POS Invoice', name).then((doc) => {
+					frappe.db.get_doc("POS Invoice", name).then((doc) => {
 						frappe.run_serially([
 							() => this.make_return_invoice(doc),
 							() => this.cart.load_invoice(),
-							() => this.item_selector.toggle_component(true)
+							() => this.item_selector.toggle_component(true),
 						]);
 					});
 				},
@@ -402,9 +431,9 @@
 					this.recent_order_list.toggle_component(false);
 					frappe.run_serially([
 						() => this.frm.refresh(name),
-						() => this.frm.call('reset_mode_of_payments'),
+						() => this.frm.call("reset_mode_of_payments"),
 						() => this.cart.load_invoice(),
-						() => this.item_selector.toggle_component(true)
+						() => this.item_selector.toggle_component(true),
 					]);
 				},
 				delete_order: (name) => {
@@ -419,9 +448,9 @@
 						() => this.item_selector.toggle_component(true),
 						() => frappe.dom.unfreeze(),
 					]);
-				}
-			}
-		})
+				},
+			},
+		});
 	}
 
 	toggle_recent_order_list(show) {
@@ -435,7 +464,7 @@
 		this.item_selector.toggle_component(show);
 
 		// do not show item details or payment if recent order is toggled off
-		!show ? (this.item_details.toggle_component(false) || this.payment.toggle_component(false)) : '';
+		!show ? this.item_details.toggle_component(false) || this.payment.toggle_component(false) : "";
 	}
 
 	make_new_invoice() {
@@ -445,23 +474,23 @@
 			() => this.set_pos_profile_data(),
 			() => this.set_pos_profile_status(),
 			() => this.cart.load_invoice(),
-			() => frappe.dom.unfreeze()
+			() => frappe.dom.unfreeze(),
 		]);
 	}
 
 	make_sales_invoice_frm() {
-		const doctype = 'POS Invoice';
-		return new Promise(resolve => {
+		const doctype = "POS Invoice";
+		return new Promise((resolve) => {
 			if (this.frm) {
 				this.frm = this.get_new_frm(this.frm);
 				this.frm.doc.items = [];
-				this.frm.doc.is_pos = 1
+				this.frm.doc.is_pos = 1;
 				resolve();
 			} else {
 				frappe.model.with_doctype(doctype, () => {
 					this.frm = this.get_new_frm();
 					this.frm.doc.items = [];
-					this.frm.doc.is_pos = 1
+					this.frm.doc.is_pos = 1;
 					resolve();
 				});
 			}
@@ -469,8 +498,8 @@
 	}
 
 	get_new_frm(_frm) {
-		const doctype = 'POS Invoice';
-		const page = $('<div>');
+		const doctype = "POS Invoice";
+		const page = $("<div>");
 		const frm = _frm || new frappe.ui.form.Form(doctype, page, false);
 		const name = frappe.model.make_new_doc_and_get_name(doctype, true);
 		frm.refresh(name);
@@ -485,8 +514,8 @@
 		return frappe.call({
 			method: "erpnext.accounts.doctype.pos_invoice.pos_invoice.make_sales_return",
 			args: {
-				'source_name': doc.name,
-				'target_doc': this.frm.doc
+				source_name: doc.name,
+				target_doc: this.frm.doc,
 			},
 			callback: (r) => {
 				frappe.model.sync(r.message);
@@ -494,13 +523,16 @@
 				this.set_pos_profile_data().then(() => {
 					frappe.dom.unfreeze();
 				});
-			}
+			},
 		});
 	}
 
 	set_pos_profile_data() {
 		if (this.company && !this.frm.doc.company) this.frm.doc.company = this.company;
-		if ((this.pos_profile && !this.frm.doc.pos_profile) | (this.frm.doc.is_return && this.pos_profile != this.frm.doc.pos_profile)) {
+		if (
+			(this.pos_profile && !this.frm.doc.pos_profile) |
+			(this.frm.doc.is_return && this.pos_profile != this.frm.doc.pos_profile)
+		) {
 			this.frm.doc.pos_profile = this.pos_profile;
 		}
 
@@ -521,16 +553,15 @@
 			item_row = this.get_item_from_frm(item);
 			const item_row_exists = !$.isEmptyObject(item_row);
 
-			const from_selector = field === 'qty' && value === "+1";
-			if (from_selector)
-				value = flt(item_row.stock_qty) + flt(value);
+			const from_selector = field === "qty" && value === "+1";
+			if (from_selector) value = flt(item_row.stock_qty) + flt(value);
 
 			if (item_row_exists) {
-				if (field === 'qty')
-					value = flt(value);
+				if (field === "qty") value = flt(value);
 
-				if (['qty', 'conversion_factor'].includes(field) && value > 0 && !this.allow_negative_stock) {
-					const qty_needed = field === 'qty' ? value * item_row.conversion_factor : item_row.qty * value;
+				if (["qty", "conversion_factor"].includes(field) && value > 0 && !this.allow_negative_stock) {
+					const qty_needed =
+						field === "qty" ? value * item_row.conversion_factor : item_row.qty * value;
 					await this.check_stock_availability(item_row, qty_needed, this.frm.doc.set_warehouse);
 				}
 
@@ -538,20 +569,17 @@
 					await frappe.model.set_value(item_row.doctype, item_row.name, field, value);
 					this.update_cart_html(item_row);
 				}
-
 			} else {
-				if (!this.frm.doc.customer)
-					return this.raise_customer_selection_alert();
+				if (!this.frm.doc.customer) return this.raise_customer_selection_alert();
 
 				const { item_code, batch_no, serial_no, rate, uom } = item;
 
-				if (!item_code)
-					return;
+				if (!item_code) return;
 
 				if (rate == undefined || rate == 0) {
 					frappe.show_alert({
-						message: __('Price is not set for the item.'),
-						indicator: 'orange'
+						message: __("Price is not set for the item."),
+						indicator: "orange",
 					});
 					frappe.utils.play_sound("error");
 					return;
@@ -560,15 +588,14 @@
 
 				if (serial_no) {
 					await this.check_serial_no_availablilty(item_code, this.frm.doc.set_warehouse, serial_no);
-					new_item['serial_no'] = serial_no;
+					new_item["serial_no"] = serial_no;
 				}
 
-				if (field === 'serial_no')
-					new_item['qty'] = value.split(`\n`).length || 0;
+				if (field === "serial_no") new_item["qty"] = value.split(`\n`).length || 0;
 
-				item_row = this.frm.add_child('items', new_item);
+				item_row = this.frm.add_child("items", new_item);
 
-				if (field === 'qty' && value !== 0 && !this.allow_negative_stock) {
+				if (field === "qty" && value !== 0 && !this.allow_negative_stock) {
 					const qty_needed = value * item_row.conversion_factor;
 					await this.check_stock_availability(item_row, qty_needed, this.frm.doc.set_warehouse);
 				}
@@ -577,13 +604,14 @@
 
 				this.update_cart_html(item_row);
 
-				if (this.item_details.$component.is(':visible'))
-					this.edit_item_details_of(item_row);
+				if (this.item_details.$component.is(":visible")) this.edit_item_details_of(item_row);
 
-				if (this.check_serial_batch_selection_needed(item_row) && !this.item_details.$component.is(':visible'))
+				if (
+					this.check_serial_batch_selection_needed(item_row) &&
+					!this.item_details.$component.is(":visible")
+				)
 					this.edit_item_details_of(item_row);
 			}
-
 		} catch (error) {
 			console.log(error);
 		} finally {
@@ -595,8 +623,8 @@
 	raise_customer_selection_alert() {
 		frappe.dom.unfreeze();
 		frappe.show_alert({
-			message: __('You must select a customer before adding an item.'),
-			indicator: 'orange'
+			message: __("You must select a customer before adding an item."),
+			indicator: "orange",
 		});
 		frappe.utils.play_sound("error");
 	}
@@ -604,17 +632,18 @@
 	get_item_from_frm({ name, item_code, batch_no, uom, rate }) {
 		let item_row = null;
 		if (name) {
-			item_row = this.frm.doc.items.find(i => i.name == name);
+			item_row = this.frm.doc.items.find((i) => i.name == name);
 		} else {
 			// if item is clicked twice from item selector
 			// then "item_code, batch_no, uom, rate" will help in getting the exact item
 			// to increase the qty by one
-			const has_batch_no = (batch_no !== 'null' && batch_no !== null);
+			const has_batch_no = batch_no !== "null" && batch_no !== null;
 			item_row = this.frm.doc.items.find(
-				i => i.item_code === item_code
-					&& (!has_batch_no || (has_batch_no && i.batch_no === batch_no))
-					&& (i.uom === uom)
-					&& (i.rate === flt(rate))
+				(i) =>
+					i.item_code === item_code &&
+					(!has_batch_no || (has_batch_no && i.batch_no === batch_no)) &&
+					i.uom === uom &&
+					i.rate === flt(rate)
 			);
 		}
 
@@ -642,16 +671,19 @@
 		const no_serial_selected = !item_row.serial_no;
 		const no_batch_selected = !item_row.batch_no;
 
-		if ((serialized && no_serial_selected) || (batched && no_batch_selected) ||
-			(serialized && batched && (no_batch_selected || no_serial_selected))) {
+		if (
+			(serialized && no_serial_selected) ||
+			(batched && no_batch_selected) ||
+			(serialized && batched && (no_batch_selected || no_serial_selected))
+		) {
 			return true;
 		}
 		return false;
 	}
 
 	async trigger_new_item_events(item_row) {
-		await this.frm.script_manager.trigger('item_code', item_row.doctype, item_row.name);
-		await this.frm.script_manager.trigger('qty', item_row.doctype, item_row.name);
+		await this.frm.script_manager.trigger("item_code", item_row.doctype, item_row.name);
+		await this.frm.script_manager.trigger("qty", item_row.doctype, item_row.name);
 	}
 
 	async check_stock_availability(item_row, qty_needed, warehouse) {
@@ -663,21 +695,27 @@
 		const bold_uom = item_row.stock_uom.bold();
 		const bold_item_code = item_row.item_code.bold();
 		const bold_warehouse = warehouse.bold();
-		const bold_available_qty = available_qty.toString().bold()
+		const bold_available_qty = available_qty.toString().bold();
 		if (!(available_qty > 0)) {
 			if (is_stock_item) {
 				frappe.model.clear_doc(item_row.doctype, item_row.name);
 				frappe.throw({
 					title: __("Not Available"),
-					message: __('Item Code: {0} is not available under warehouse {1}.', [bold_item_code, bold_warehouse])
+					message: __("Item Code: {0} is not available under warehouse {1}.", [
+						bold_item_code,
+						bold_warehouse,
+					]),
 				});
 			} else {
 				return;
 			}
 		} else if (is_stock_item && available_qty < qty_needed) {
 			frappe.throw({
-				message: __('Stock quantity not enough for Item Code: {0} under warehouse {1}. Available quantity {2} {3}.', [bold_item_code, bold_warehouse, bold_available_qty, bold_uom]),
-				indicator: 'orange'
+				message: __(
+					"Stock quantity not enough for Item Code: {0} under warehouse {1}. Available quantity {2} {3}.",
+					[bold_item_code, bold_warehouse, bold_available_qty, bold_uom]
+				),
+				indicator: "orange",
 			});
 			frappe.utils.play_sound("error");
 		}
@@ -686,13 +724,15 @@
 
 	async check_serial_no_availablilty(item_code, warehouse, serial_no) {
 		const method = "erpnext.stock.doctype.serial_no.serial_no.get_pos_reserved_serial_nos";
-		const args = {filters: { item_code, warehouse }}
+		const args = { filters: { item_code, warehouse } };
 		const res = await frappe.call({ method, args });
 
 		if (res.message.includes(serial_no)) {
 			frappe.throw({
 				title: __("Not Available"),
-				message: __('Serial No: {0} has already been transacted into another POS Invoice.', [serial_no.bold()])
+				message: __("Serial No: {0} has already been transacted into another POS Invoice.", [
+					serial_no.bold(),
+				]),
 			});
 		}
 	}
@@ -702,21 +742,20 @@
 		return frappe.call({
 			method: "erpnext.accounts.doctype.pos_invoice.pos_invoice.get_stock_availability",
 			args: {
-				'item_code': item_code,
-				'warehouse': warehouse,
+				item_code: item_code,
+				warehouse: warehouse,
 			},
 			callback(res) {
-				if (!me.item_stock_map[item_code])
-					me.item_stock_map[item_code] = {};
+				if (!me.item_stock_map[item_code]) me.item_stock_map[item_code] = {};
 				me.item_stock_map[item_code][warehouse] = res.message;
-			}
+			},
 		});
 	}
 
 	update_item_field(value, field_or_action) {
-		if (field_or_action === 'checkout') {
+		if (field_or_action === "checkout") {
 			this.item_details.toggle_item_details_section(null);
-		} else if (field_or_action === 'remove') {
+		} else if (field_or_action === "remove") {
 			this.remove_item_from_cart();
 		} else {
 			const field_control = this.item_details[`${field_or_action}_control`];
@@ -730,26 +769,28 @@
 		frappe.dom.freeze();
 		const { doctype, name, current_item } = this.item_details;
 
-		return frappe.model.set_value(doctype, name, 'qty', 0)
+		return frappe.model
+			.set_value(doctype, name, "qty", 0)
 			.then(() => {
 				frappe.model.clear_doc(doctype, name);
 				this.update_cart_html(current_item, true);
 				this.item_details.toggle_item_details_section(null);
 				frappe.dom.unfreeze();
 			})
-			.catch(e => console.log(e));
+			.catch((e) => console.log(e));
 	}
 
 	async save_and_checkout() {
 		if (this.frm.is_dirty()) {
 			let save_error = false;
-			await this.frm.save(null, null, null, () => save_error = true);
+			await this.frm.save(null, null, null, () => (save_error = true));
 			// only move to payment section if save is successful
 			!save_error && this.payment.checkout();
 			// show checkout button on error
-			save_error && setTimeout(() => {
-				this.cart.toggle_checkout_btn(true);
-			}, 300); // wait for save to finish
+			save_error &&
+				setTimeout(() => {
+					this.cart.toggle_checkout_btn(true);
+				}, 300); // wait for save to finish
 		} else {
 			this.payment.checkout();
 		}
diff --git a/erpnext/selling/page/point_of_sale/pos_item_cart.js b/erpnext/selling/page/point_of_sale/pos_item_cart.js
index bd85792..d95ef58 100644
--- a/erpnext/selling/page/point_of_sale/pos_item_cart.js
+++ b/erpnext/selling/page/point_of_sale/pos_item_cart.js
@@ -18,11 +18,9 @@
 	}
 
 	prepare_dom() {
-		this.wrapper.append(
-			`<section class="customer-cart-container"></section>`
-		)
+		this.wrapper.append(`<section class="customer-cart-container"></section>`);
 
-		this.$component = this.wrapper.find('.customer-cart-container');
+		this.$component = this.wrapper.find(".customer-cart-container");
 	}
 
 	init_child_components() {
@@ -31,16 +29,14 @@
 	}
 
 	init_customer_selector() {
-		this.$component.append(
-			`<div class="customer-section"></div>`
-		)
-		this.$customer_section = this.$component.find('.customer-section');
+		this.$component.append(`<div class="customer-section"></div>`);
+		this.$customer_section = this.$component.find(".customer-section");
 		this.make_customer_selector();
 	}
 
 	reset_customer_selector() {
 		const frm = this.events.get_frm();
-		frm.set_value('customer', '');
+		frm.set_value("customer", "");
 		this.make_customer_selector();
 		this.customer_field.set_focus();
 	}
@@ -49,11 +45,11 @@
 		this.$component.append(
 			`<div class="cart-container">
 				<div class="abs-cart-container">
-					<div class="cart-label">${__('Item Cart')}</div>
+					<div class="cart-label">${__("Item Cart")}</div>
 					<div class="cart-header">
-						<div class="name-header">${__('Item')}</div>
-						<div class="qty-header">${__('Quantity')}</div>
-						<div class="rate-amount-header">${__('Amount')}</div>
+						<div class="name-header">${__("Item")}</div>
+						<div class="qty-header">${__("Quantity")}</div>
+						<div class="rate-amount-header">${__("Amount")}</div>
 					</div>
 					<div class="cart-items-section"></div>
 					<div class="cart-totals-section"></div>
@@ -61,7 +57,7 @@
 				</div>
 			</div>`
 		);
-		this.$cart_container = this.$component.find('.cart-container');
+		this.$cart_container = this.$component.find(".cart-container");
 
 		this.make_cart_totals_section();
 		this.make_cart_items_section();
@@ -69,39 +65,35 @@
 	}
 
 	make_cart_items_section() {
-		this.$cart_header = this.$component.find('.cart-header');
-		this.$cart_items_wrapper = this.$component.find('.cart-items-section');
+		this.$cart_header = this.$component.find(".cart-header");
+		this.$cart_items_wrapper = this.$component.find(".cart-items-section");
 
 		this.make_no_items_placeholder();
 	}
 
 	make_no_items_placeholder() {
-		this.$cart_header.css('display', 'none');
-		this.$cart_items_wrapper.html(
-			`<div class="no-item-wrapper">${__('No items in cart')}</div>`
-		);
+		this.$cart_header.css("display", "none");
+		this.$cart_items_wrapper.html(`<div class="no-item-wrapper">${__("No items in cart")}</div>`);
 	}
 
 	get_discount_icon() {
-		return (
-			`<svg class="discount-icon" width="24" height="24" viewBox="0 0 24 24" stroke="currentColor" fill="none" xmlns="http://www.w3.org/2000/svg">
+		return `<svg class="discount-icon" width="24" height="24" viewBox="0 0 24 24" stroke="currentColor" fill="none" xmlns="http://www.w3.org/2000/svg">
 				<path d="M19 15.6213C19 15.2235 19.158 14.842 19.4393 14.5607L20.9393 13.0607C21.5251 12.4749 21.5251 11.5251 20.9393 10.9393L19.4393 9.43934C19.158 9.15804 19 8.7765 19 8.37868V6.5C19 5.67157 18.3284 5 17.5 5H15.6213C15.2235 5 14.842 4.84196 14.5607 4.56066L13.0607 3.06066C12.4749 2.47487 11.5251 2.47487 10.9393 3.06066L9.43934 4.56066C9.15804 4.84196 8.7765 5 8.37868 5H6.5C5.67157 5 5 5.67157 5 6.5V8.37868C5 8.7765 4.84196 9.15804 4.56066 9.43934L3.06066 10.9393C2.47487 11.5251 2.47487 12.4749 3.06066 13.0607L4.56066 14.5607C4.84196 14.842 5 15.2235 5 15.6213V17.5C5 18.3284 5.67157 19 6.5 19H8.37868C8.7765 19 9.15804 19.158 9.43934 19.4393L10.9393 20.9393C11.5251 21.5251 12.4749 21.5251 13.0607 20.9393L14.5607 19.4393C14.842 19.158 15.2235 19 15.6213 19H17.5C18.3284 19 19 18.3284 19 17.5V15.6213Z" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
 				<path d="M15 9L9 15" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
 				<path d="M10.5 9.5C10.5 10.0523 10.0523 10.5 9.5 10.5C8.94772 10.5 8.5 10.0523 8.5 9.5C8.5 8.94772 8.94772 8.5 9.5 8.5C10.0523 8.5 10.5 8.94772 10.5 9.5Z" fill="white" stroke-linecap="round" stroke-linejoin="round"/>
 				<path d="M15.5 14.5C15.5 15.0523 15.0523 15.5 14.5 15.5C13.9477 15.5 13.5 15.0523 13.5 14.5C13.5 13.9477 13.9477 13.5 14.5 13.5C15.0523 13.5 15.5 13.9477 15.5 14.5Z" fill="white" stroke-linecap="round" stroke-linejoin="round"/>
-			</svg>`
-		);
+			</svg>`;
 	}
 
 	make_cart_totals_section() {
-		this.$totals_section = this.$component.find('.cart-totals-section');
+		this.$totals_section = this.$component.find(".cart-totals-section");
 
 		this.$totals_section.append(
 			`<div class="add-discount-wrapper">
-				${this.get_discount_icon()} ${__('Add Discount')}
+				${this.get_discount_icon()} ${__("Add Discount")}
 			</div>
 			<div class="item-qty-total-container">
-				<div class="item-qty-total-label">${__('Total Items')}</div>
+				<div class="item-qty-total-label">${__("Total Items")}</div>
 				<div class="item-qty-total-value">0.00</div>
 			</div>
 			<div class="net-total-container">
@@ -110,39 +102,39 @@
 			</div>
 			<div class="taxes-container"></div>
 			<div class="grand-total-container">
-				<div>${__('Grand Total')}</div>
+				<div>${__("Grand Total")}</div>
 				<div>0.00</div>
 			</div>
-			<div class="checkout-btn">${__('Checkout')}</div>
-			<div class="edit-cart-btn">${__('Edit Cart')}</div>`
-		)
+			<div class="checkout-btn">${__("Checkout")}</div>
+			<div class="edit-cart-btn">${__("Edit Cart")}</div>`
+		);
 
 		this.$add_discount_elem = this.$component.find(".add-discount-wrapper");
 	}
 
 	make_cart_numpad() {
-		this.$numpad_section = this.$component.find('.numpad-section');
+		this.$numpad_section = this.$component.find(".numpad-section");
 
 		this.number_pad = new erpnext.PointOfSale.NumberPad({
 			wrapper: this.$numpad_section,
 			events: {
-				numpad_event: this.on_numpad_event.bind(this)
+				numpad_event: this.on_numpad_event.bind(this),
 			},
 			cols: 5,
 			keys: [
-				[ 1, 2, 3, 'Quantity' ],
-				[ 4, 5, 6, 'Discount' ],
-				[ 7, 8, 9, 'Rate' ],
-				[ '.', 0, 'Delete', 'Remove' ]
+				[1, 2, 3, "Quantity"],
+				[4, 5, 6, "Discount"],
+				[7, 8, 9, "Rate"],
+				[".", 0, "Delete", "Remove"],
 			],
 			css_classes: [
-				[ '', '', '', 'col-span-2' ],
-				[ '', '', '', 'col-span-2' ],
-				[ '', '', '', 'col-span-2' ],
-				[ '', '', '', 'col-span-2 remove-btn' ]
+				["", "", "", "col-span-2"],
+				["", "", "", "col-span-2"],
+				["", "", "", "col-span-2"],
+				["", "", "", "col-span-2 remove-btn"],
 			],
-			fieldnames_map: { 'Quantity': 'qty', 'Discount': 'discount_percentage' }
-		})
+			fieldnames_map: { Quantity: "qty", Discount: "discount_percentage" },
+		});
 
 		this.$numpad_section.prepend(
 			`<div class="numpad-totals">
@@ -150,49 +142,49 @@
 				<span class="numpad-net-total"></span>
 				<span class="numpad-grand-total"></span>
 			</div>`
-		)
+		);
 
 		this.$numpad_section.append(
-			`<div class="numpad-btn checkout-btn" data-button-value="checkout">${__('Checkout')}</div>`
-		)
+			`<div class="numpad-btn checkout-btn" data-button-value="checkout">${__("Checkout")}</div>`
+		);
 	}
 
 	bind_events() {
 		const me = this;
-		this.$customer_section.on('click', '.reset-customer-btn', function () {
+		this.$customer_section.on("click", ".reset-customer-btn", function () {
 			me.reset_customer_selector();
 		});
 
-		this.$customer_section.on('click', '.close-details-btn', function () {
+		this.$customer_section.on("click", ".close-details-btn", function () {
 			me.toggle_customer_info(false);
 		});
 
-		this.$customer_section.on('click', '.customer-display', function(e) {
-			if ($(e.target).closest('.reset-customer-btn').length) return;
+		this.$customer_section.on("click", ".customer-display", function (e) {
+			if ($(e.target).closest(".reset-customer-btn").length) return;
 
-			const show = me.$cart_container.is(':visible');
+			const show = me.$cart_container.is(":visible");
 			me.toggle_customer_info(show);
 		});
 
-		this.$cart_items_wrapper.on('click', '.cart-item-wrapper', function() {
+		this.$cart_items_wrapper.on("click", ".cart-item-wrapper", function () {
 			const $cart_item = $(this);
 
 			me.toggle_item_highlight(this);
 
-			const payment_section_hidden = !me.$totals_section.find('.edit-cart-btn').is(':visible');
+			const payment_section_hidden = !me.$totals_section.find(".edit-cart-btn").is(":visible");
 			if (!payment_section_hidden) {
 				// payment section is visible
 				// edit cart first and then open item details section
 				me.$totals_section.find(".edit-cart-btn").click();
 			}
 
-			const item_row_name = unescape($cart_item.attr('data-row-name'));
+			const item_row_name = unescape($cart_item.attr("data-row-name"));
 			me.events.cart_item_clicked({ name: item_row_name });
-			this.numpad_value = '';
+			this.numpad_value = "";
 		});
 
-		this.$component.on('click', '.checkout-btn', async function() {
-			if ($(this).attr('style').indexOf('--blue-500') == -1) return;
+		this.$component.on("click", ".checkout-btn", async function () {
+			if ($(this).attr("style").indexOf("--blue-500") == -1) return;
 
 			await me.events.checkout();
 			me.toggle_checkout_btn(false);
@@ -200,18 +192,18 @@
 			me.allow_discount_change && me.$add_discount_elem.removeClass("d-none");
 		});
 
-		this.$totals_section.on('click', '.edit-cart-btn', () => {
+		this.$totals_section.on("click", ".edit-cart-btn", () => {
 			this.events.edit_cart();
 			this.toggle_checkout_btn(true);
 		});
 
-		this.$component.on('click', '.add-discount-wrapper', () => {
-			const can_edit_discount = this.$add_discount_elem.find('.edit-discount-btn').length;
+		this.$component.on("click", ".add-discount-wrapper", () => {
+			const can_edit_discount = this.$add_discount_elem.find(".edit-discount-btn").length;
 
-			if(!this.discount_field || can_edit_discount) this.show_discount_control();
+			if (!this.discount_field || can_edit_discount) this.show_discount_control();
 		});
 
-		frappe.ui.form.on("POS Invoice", "paid_amount", frm => {
+		frappe.ui.form.on("POS Invoice", "paid_amount", (frm) => {
 			// called when discount is applied
 			this.update_totals_section(frm);
 		});
@@ -220,43 +212,49 @@
 	attach_shortcuts() {
 		for (let row of this.number_pad.keys) {
 			for (let btn of row) {
-				if (typeof btn !== 'string') continue; // do not make shortcuts for numbers
+				if (typeof btn !== "string") continue; // do not make shortcuts for numbers
 
 				let shortcut_key = `ctrl+${frappe.scrub(String(btn))[0]}`;
-				if (btn === 'Delete') shortcut_key = 'ctrl+backspace';
-				if (btn === 'Remove') shortcut_key = 'shift+ctrl+backspace'
-				if (btn === '.') shortcut_key = 'ctrl+>';
+				if (btn === "Delete") shortcut_key = "ctrl+backspace";
+				if (btn === "Remove") shortcut_key = "shift+ctrl+backspace";
+				if (btn === ".") shortcut_key = "ctrl+>";
 
 				// to account for fieldname map
-				const fieldname = this.number_pad.fieldnames[btn] ? this.number_pad.fieldnames[btn] :
-					typeof btn === 'string' ? frappe.scrub(btn) : btn;
+				const fieldname = this.number_pad.fieldnames[btn]
+					? this.number_pad.fieldnames[btn]
+					: typeof btn === "string"
+					? frappe.scrub(btn)
+					: btn;
 
-				let shortcut_label = shortcut_key.split('+').map(frappe.utils.to_title_case).join('+');
-				shortcut_label = frappe.utils.is_mac() ? shortcut_label.replace('Ctrl', '⌘') : shortcut_label;
-				this.$numpad_section.find(`.numpad-btn[data-button-value="${fieldname}"]`).attr("title", shortcut_label);
+				let shortcut_label = shortcut_key.split("+").map(frappe.utils.to_title_case).join("+");
+				shortcut_label = frappe.utils.is_mac() ? shortcut_label.replace("Ctrl", "⌘") : shortcut_label;
+				this.$numpad_section
+					.find(`.numpad-btn[data-button-value="${fieldname}"]`)
+					.attr("title", shortcut_label);
 
 				frappe.ui.keys.on(`${shortcut_key}`, () => {
 					const cart_is_visible = this.$component.is(":visible");
 					if (cart_is_visible && this.item_is_selected && this.$numpad_section.is(":visible")) {
 						this.$numpad_section.find(`.numpad-btn[data-button-value="${fieldname}"]`).click();
 					}
-				})
+				});
 			}
 		}
-		const ctrl_label = frappe.utils.is_mac() ? '⌘' : 'Ctrl';
+		const ctrl_label = frappe.utils.is_mac() ? "⌘" : "Ctrl";
 		this.$component.find(".checkout-btn").attr("title", `${ctrl_label}+Enter`);
 		frappe.ui.keys.add_shortcut({
 			shortcut: "ctrl+enter",
 			action: () => this.$component.find(".checkout-btn").click(),
-			condition: () => this.$component.is(":visible") && !this.$totals_section.find('.edit-cart-btn').is(':visible'),
+			condition: () =>
+				this.$component.is(":visible") && !this.$totals_section.find(".edit-cart-btn").is(":visible"),
 			description: __("Checkout Order / Submit Order / New Order"),
 			ignore_inputs: true,
-			page: cur_page.page.page
+			page: cur_page.page.page,
 		});
 		this.$component.find(".edit-cart-btn").attr("title", `${ctrl_label}+E`);
 		frappe.ui.keys.on("ctrl+e", () => {
 			const item_cart_visible = this.$component.is(":visible");
-			const checkout_btn_invisible = !this.$totals_section.find('.checkout-btn').is('visible');
+			const checkout_btn_invisible = !this.$totals_section.find(".checkout-btn").is("visible");
 			if (item_cart_visible && checkout_btn_invisible) {
 				this.$component.find(".edit-cart-btn").click();
 			}
@@ -268,7 +266,7 @@
 			condition: () => this.$add_discount_elem.is(":visible"),
 			description: __("Add Order Discount"),
 			ignore_inputs: true,
-			page: cur_page.page.page
+			page: cur_page.page.page,
 		});
 		frappe.ui.keys.on("escape", () => {
 			const item_cart_visible = this.$component.is(":visible");
@@ -284,11 +282,11 @@
 
 		if (!item || item_is_highlighted) {
 			this.item_is_selected = false;
-			this.$cart_container.find('.cart-item-wrapper').css("background-color", "");
+			this.$cart_container.find(".cart-item-wrapper").css("background-color", "");
 		} else {
 			$cart_item.css("background-color", "var(--control-bg)");
 			this.item_is_selected = true;
-			this.$cart_container.find('.cart-item-wrapper').not(item).css("background-color", "");
+			this.$cart_container.find(".cart-item-wrapper").not(item).css("background-color", "");
 		}
 	}
 
@@ -297,38 +295,38 @@
 			<div class="customer-field"></div>
 		`);
 		const me = this;
-		const query = { query: 'erpnext.controllers.queries.customer_query' };
+		const query = { query: "erpnext.controllers.queries.customer_query" };
 		const allowed_customer_group = this.allowed_customer_groups || [];
 		if (allowed_customer_group.length) {
 			query.filters = {
-				customer_group: ['in', allowed_customer_group]
-			}
+				customer_group: ["in", allowed_customer_group],
+			};
 		}
 		this.customer_field = frappe.ui.form.make_control({
 			df: {
-				label: __('Customer'),
-				fieldtype: 'Link',
-				options: 'Customer',
-				placeholder: __('Search by customer name, phone, email.'),
+				label: __("Customer"),
+				fieldtype: "Link",
+				options: "Customer",
+				placeholder: __("Search by customer name, phone, email."),
 				get_query: () => query,
-				onchange: function() {
+				onchange: function () {
 					if (this.value) {
 						const frm = me.events.get_frm();
 						frappe.dom.freeze();
-						frappe.model.set_value(frm.doc.doctype, frm.doc.name, 'customer', this.value);
-						frm.script_manager.trigger('customer', frm.doc.doctype, frm.doc.name).then(() => {
+						frappe.model.set_value(frm.doc.doctype, frm.doc.name, "customer", this.value);
+						frm.script_manager.trigger("customer", frm.doc.doctype, frm.doc.name).then(() => {
 							frappe.run_serially([
 								() => me.fetch_customer_details(this.value),
 								() => me.events.customer_details_updated(me.customer_info),
 								() => me.update_customer_section(),
 								() => me.update_totals_section(),
-								() => frappe.dom.unfreeze()
+								() => frappe.dom.unfreeze(),
 							]);
-						})
+						});
 					}
 				},
 			},
-			parent: this.$customer_section.find('.customer-field'),
+			parent: this.$customer_section.find(".customer-field"),
 			render_input: true,
 		});
 		this.customer_field.toggle_label(false);
@@ -337,66 +335,81 @@
 	fetch_customer_details(customer) {
 		if (customer) {
 			return new Promise((resolve) => {
-				frappe.db.get_value('Customer', customer, ["email_id", "mobile_no", "image", "loyalty_program"]).then(({ message }) => {
-					const { loyalty_program } = message;
-					// if loyalty program then fetch loyalty points too
-					if (loyalty_program) {
-						frappe.call({
-							method: "erpnext.accounts.doctype.loyalty_program.loyalty_program.get_loyalty_program_details_with_points",
-							args: { customer, loyalty_program, "silent": true },
-							callback: (r) => {
-								const { loyalty_points, conversion_factor } = r.message;
-								if (!r.exc) {
-									this.customer_info = { ...message, customer, loyalty_points, conversion_factor };
-									resolve();
-								}
-							}
-						});
-					} else {
-						this.customer_info = { ...message, customer };
-						resolve();
-					}
-				});
+				frappe.db
+					.get_value("Customer", customer, ["email_id", "mobile_no", "image", "loyalty_program"])
+					.then(({ message }) => {
+						const { loyalty_program } = message;
+						// if loyalty program then fetch loyalty points too
+						if (loyalty_program) {
+							frappe.call({
+								method: "erpnext.accounts.doctype.loyalty_program.loyalty_program.get_loyalty_program_details_with_points",
+								args: { customer, loyalty_program, silent: true },
+								callback: (r) => {
+									const { loyalty_points, conversion_factor } = r.message;
+									if (!r.exc) {
+										this.customer_info = {
+											...message,
+											customer,
+											loyalty_points,
+											conversion_factor,
+										};
+										resolve();
+									}
+								},
+							});
+						} else {
+							this.customer_info = { ...message, customer };
+							resolve();
+						}
+					});
 			});
 		} else {
 			return new Promise((resolve) => {
-				this.customer_info = {}
+				this.customer_info = {};
 				resolve();
 			});
 		}
 	}
 
 	show_discount_control() {
-		this.$add_discount_elem.css({ 'padding': '0px', 'border': 'none' });
-		this.$add_discount_elem.html(
-			`<div class="add-discount-field"></div>`
-		);
+		this.$add_discount_elem.css({ padding: "0px", border: "none" });
+		this.$add_discount_elem.html(`<div class="add-discount-field"></div>`);
 		const me = this;
 		const frm = me.events.get_frm();
 		let discount = frm.doc.additional_discount_percentage;
 
 		this.discount_field = frappe.ui.form.make_control({
 			df: {
-				label: __('Discount'),
-				fieldtype: 'Data',
-				placeholder: ( discount ? discount + '%' :  __('Enter discount percentage.') ),
-				input_class: 'input-xs',
-				onchange: function() {
+				label: __("Discount"),
+				fieldtype: "Data",
+				placeholder: discount ? discount + "%" : __("Enter discount percentage."),
+				input_class: "input-xs",
+				onchange: function () {
 					if (flt(this.value) != 0) {
-						frappe.model.set_value(frm.doc.doctype, frm.doc.name, 'additional_discount_percentage', flt(this.value));
+						frappe.model.set_value(
+							frm.doc.doctype,
+							frm.doc.name,
+							"additional_discount_percentage",
+							flt(this.value)
+						);
 						me.hide_discount_control(this.value);
 					} else {
-						frappe.model.set_value(frm.doc.doctype, frm.doc.name, 'additional_discount_percentage', 0);
+						frappe.model.set_value(
+							frm.doc.doctype,
+							frm.doc.name,
+							"additional_discount_percentage",
+							0
+						);
 						me.$add_discount_elem.css({
-							'border': '1px dashed var(--gray-500)',
-							'padding': 'var(--padding-sm) var(--padding-md)'
+							border: "1px dashed var(--gray-500)",
+							padding: "var(--padding-sm) var(--padding-md)",
 						});
-						me.$add_discount_elem.html(`${me.get_discount_icon()} ${__('Add Discount')}`);
+						me.$add_discount_elem.html(`${me.get_discount_icon()} ${__("Add Discount")}`);
 						me.discount_field = undefined;
 					}
 				},
 			},
-			parent: this.$add_discount_elem.find('.add-discount-field'),
+			parent: this.$add_discount_elem.find(".add-discount-field"),
 			render_input: true,
 		});
 		this.discount_field.toggle_label(false);
@@ -405,14 +418,12 @@
 
 	hide_discount_control(discount) {
 		if (!discount) {
-			this.$add_discount_elem.css({ 'padding': '0px', 'border': 'none' });
-			this.$add_discount_elem.html(
-				`<div class="add-discount-field"></div>`
-			);
+			this.$add_discount_elem.css({ padding: "0px", border: "none" });
+			this.$add_discount_elem.html(`<div class="add-discount-field"></div>`);
 		} else {
 			this.$add_discount_elem.css({
-				'border': '1px dashed var(--dark-green-500)',
-				'padding': 'var(--padding-sm) var(--padding-md)'
+				border: "1px dashed var(--dark-green-500)",
+				padding: "var(--padding-sm) var(--padding-md)",
 			});
 			this.$add_discount_elem.html(
 				`<div class="edit-discount-btn">
@@ -424,7 +435,7 @@
 
 	update_customer_section() {
 		const me = this;
-		const { customer, email_id='', mobile_no='', image } = this.customer_info || {};
+		const { customer, email_id = "", mobile_no = "", image } = this.customer_info || {};
 
 		if (customer) {
 			this.$customer_section.html(
@@ -450,7 +461,7 @@
 
 		function get_customer_description() {
 			if (!email_id && !mobile_no) {
-				return `<div class="customer-desc">${__('Click to add email / phone')}</div>`;
+				return `<div class="customer-desc">${__("Click to add email / phone")}</div>`;
 			} else if (email_id && !mobile_no) {
 				return `<div class="customer-desc">${email_id}</div>`;
 			} else if (mobile_no && !email_id) {
@@ -459,7 +470,6 @@
 				return `<div class="customer-desc">${email_id} - ${mobile_no}</div>`;
 			}
 		}
-
 	}
 
 	get_customer_image() {
@@ -476,7 +486,9 @@
 
 		this.render_net_total(frm.doc.net_total);
 		this.render_total_item_qty(frm.doc.items);
-		const grand_total = cint(frappe.sys_defaults.disable_rounded_total) ? frm.doc.grand_total : frm.doc.rounded_total;
+		const grand_total = cint(frappe.sys_defaults.disable_rounded_total)
+			? frm.doc.grand_total
+			: frm.doc.rounded_total;
 		this.render_grand_total(grand_total);
 
 		this.render_taxes(frm.doc.taxes);
@@ -484,13 +496,13 @@
 
 	render_net_total(value) {
 		const currency = this.events.get_frm().doc.currency;
-		this.$totals_section.find('.net-total-container').html(
-			`<div>${__('Net Total')}</div><div>${format_currency(value, currency)}</div>`
-		)
+		this.$totals_section
+			.find(".net-total-container")
+			.html(`<div>${__("Net Total")}</div><div>${format_currency(value, currency)}</div>`);
 
-		this.$numpad_section.find('.numpad-net-total').html(
-			`<div>${__('Net Total')}: <span>${format_currency(value, currency)}</span></div>`
-		);
+		this.$numpad_section
+			.find(".numpad-net-total")
+			.html(`<div>${__("Net Total")}: <span>${format_currency(value, currency)}</span></div>`);
 	}
 
 	render_total_item_qty(items) {
@@ -499,41 +511,47 @@
 			total_item_qty = total_item_qty + item.qty;
 		});
 
-		this.$totals_section.find('.item-qty-total-container').html(
-			`<div>${__('Total Quantity')}</div><div>${total_item_qty}</div>`
-		);
+		this.$totals_section
+			.find(".item-qty-total-container")
+			.html(`<div>${__("Total Quantity")}</div><div>${total_item_qty}</div>`);
 
-		this.$numpad_section.find('.numpad-item-qty-total').html(
-			`<div>${__('Total Quantity')}: <span>${total_item_qty}</span></div>`
-		);
+		this.$numpad_section
+			.find(".numpad-item-qty-total")
+			.html(`<div>${__("Total Quantity")}: <span>${total_item_qty}</span></div>`);
 	}
 
 	render_grand_total(value) {
 		const currency = this.events.get_frm().doc.currency;
-		this.$totals_section.find('.grand-total-container').html(
-			`<div>${__('Grand Total')}</div><div>${format_currency(value, currency)}</div>`
-		)
+		this.$totals_section
+			.find(".grand-total-container")
+			.html(`<div>${__("Grand Total")}</div><div>${format_currency(value, currency)}</div>`);
 
-		this.$numpad_section.find('.numpad-grand-total').html(
-			`<div>${__('Grand Total')}: <span>${format_currency(value, currency)}</span></div>`
-		);
+		this.$numpad_section
+			.find(".numpad-grand-total")
+			.html(`<div>${__("Grand Total")}: <span>${format_currency(value, currency)}</span></div>`);
 	}
 
 	render_taxes(taxes) {
 		if (taxes && taxes.length) {
 			const currency = this.events.get_frm().doc.currency;
-			const taxes_html = taxes.map(t => {
-				if (t.tax_amount_after_discount_amount == 0.0) return;
-				// if tax rate is 0, don't print it.
-				const description = /[0-9]+/.test(t.description) ? t.description : ((t.rate != 0) ? `${t.description} @ ${t.rate}%`: t.description);
-				return `<div class="tax-row">
+			const taxes_html = taxes
+				.map((t) => {
+					if (t.tax_amount_after_discount_amount == 0.0) return;
+					// if tax rate is 0, don't print it.
+					const description = /[0-9]+/.test(t.description)
+						? t.description
+						: t.rate != 0
+						? `${t.description} @ ${t.rate}%`
+						: t.description;
+					return `<div class="tax-row">
 					<div class="tax-label">${description}</div>
 					<div class="tax-value">${format_currency(t.tax_amount_after_discount_amount, currency)}</div>
 				</div>`;
-			}).join('');
-			this.$totals_section.find('.taxes-container').css('display', 'flex').html(taxes_html);
+				})
+				.join("");
+			this.$totals_section.find(".taxes-container").css("display", "flex").html(taxes_html);
 		} else {
-			this.$totals_section.find('.taxes-container').css('display', 'none').html('');
+			this.$totals_section.find(".taxes-container").css("display", "none").html("");
 		}
 	}
 
@@ -544,7 +562,7 @@
 
 	get_item_from_frm(item) {
 		const doc = this.events.get_frm().doc;
-		return doc.items.find(i => i.name == item.name);
+		return doc.items.find((i) => i.name == item.name);
 	}
 
 	update_item_html(item, remove_item) {
@@ -557,7 +575,7 @@
 			this.render_cart_item(item_row, $item);
 		}
 
-		const no_of_cart_items = this.$cart_items_wrapper.find('.cart-item-wrapper').length;
+		const no_of_cart_items = this.$cart_items_wrapper.find(".cart-item-wrapper").length;
 		this.highlight_checkout_btn(no_of_cart_items > 0);
 
 		this.update_empty_cart_section(no_of_cart_items);
@@ -571,7 +589,7 @@
 			this.$cart_items_wrapper.append(
 				`<div class="cart-item-wrapper" data-row-name="${escape(item_data.name)}"></div>
 				<div class="seperator"></div>`
-			)
+			);
 			$item_to_update = this.get_cart_item(item_data);
 		}
 
@@ -584,7 +602,7 @@
 				${get_description_html()}
 			</div>
 			${get_rate_discount_html()}`
-		)
+		);
 
 		set_dynamic_rate_header_width();
 
@@ -593,8 +611,7 @@
 			me.$cart_header.find(".rate-amount-header").css("width", "");
 			me.$cart_items_wrapper.find(".item-rate-amount").css("width", "");
 			let max_width = rate_cols.reduce((max_width, elm) => {
-				if ($(elm).width() > max_width)
-					max_width = $(elm).width();
+				if ($(elm).width() > max_width) max_width = $(elm).width();
 				return max_width;
 			}, 0);
 
@@ -614,7 +631,7 @@
 							<div class="item-rate">${format_currency(item_data.amount, currency)}</div>
 							<div class="item-amount">${format_currency(item_data.rate, currency)}</div>
 						</div>
-					</div>`
+					</div>`;
 			} else {
 				return `
 					<div class="item-qty-rate">
@@ -622,17 +639,20 @@
 						<div class="item-rate-amount">
 							<div class="item-rate">${format_currency(item_data.rate, currency)}</div>
 						</div>
-					</div>`
+					</div>`;
 			}
 		}
 
 		function get_description_html() {
 			if (item_data.description) {
-				if (item_data.description.indexOf('<div>') != -1) {
+				if (item_data.description.indexOf("<div>") != -1) {
 					try {
 						item_data.description = $(item_data.description).text();
 					} catch (error) {
-						item_data.description = item_data.description.replace(/<div>/g, ' ').replace(/<\/div>/g, ' ').replace(/ +/g, ' ');
+						item_data.description = item_data.description
+							.replace(/<div>/g, " ")
+							.replace(/<\/div>/g, " ")
+							.replace(/ +/g, " ");
 					}
 				}
 				item_data.description = frappe.ellipsis(item_data.description, 45);
@@ -657,7 +677,7 @@
 	}
 
 	handle_broken_image($img) {
-		const item_abbr = $($img).attr('alt');
+		const item_abbr = $($img).attr("alt");
 		$($img).parent().replaceWith(`<div class="item-image item-abbr">${item_abbr}</div>`);
 	}
 
@@ -668,44 +688,48 @@
 
 	toggle_checkout_btn(show_checkout) {
 		if (show_checkout) {
-			this.$totals_section.find('.checkout-btn').css('display', 'flex');
-			this.$totals_section.find('.edit-cart-btn').css('display', 'none');
+			this.$totals_section.find(".checkout-btn").css("display", "flex");
+			this.$totals_section.find(".edit-cart-btn").css("display", "none");
 		} else {
-			this.$totals_section.find('.checkout-btn').css('display', 'none');
-			this.$totals_section.find('.edit-cart-btn').css('display', 'flex');
+			this.$totals_section.find(".checkout-btn").css("display", "none");
+			this.$totals_section.find(".edit-cart-btn").css("display", "flex");
 		}
 	}
 
 	highlight_checkout_btn(toggle) {
 		if (toggle) {
-			this.$add_discount_elem.css('display', 'flex');
-			this.$cart_container.find('.checkout-btn').css({
-				'background-color': 'var(--blue-500)'
+			this.$add_discount_elem.css("display", "flex");
+			this.$cart_container.find(".checkout-btn").css({
+				"background-color": "var(--blue-500)",
 			});
 		} else {
-			this.$add_discount_elem.css('display', 'none');
-			this.$cart_container.find('.checkout-btn').css({
-				'background-color': 'var(--blue-200)'
+			this.$add_discount_elem.css("display", "none");
+			this.$cart_container.find(".checkout-btn").css({
+				"background-color": "var(--blue-200)",
 			});
 		}
 	}
 
 	update_empty_cart_section(no_of_cart_items) {
-		const $no_item_element = this.$cart_items_wrapper.find('.no-item-wrapper');
+		const $no_item_element = this.$cart_items_wrapper.find(".no-item-wrapper");
 
 		// if cart has items and no item is present
-		no_of_cart_items > 0 && $no_item_element && $no_item_element.remove() && this.$cart_header.css('display', 'flex');
+		no_of_cart_items > 0 &&
+			$no_item_element &&
+			$no_item_element.remove() &&
+			this.$cart_header.css("display", "flex");
 
 		no_of_cart_items === 0 && !$no_item_element.length && this.make_no_items_placeholder();
 	}
 
 	on_numpad_event($btn) {
-		const current_action = $btn.attr('data-button-value');
-		const action_is_field_edit = ['qty', 'discount_percentage', 'rate'].includes(current_action);
-		const action_is_allowed = action_is_field_edit ? (
-			(current_action == 'rate' && this.allow_rate_change) ||
-			(current_action == 'discount_percentage' && this.allow_discount_change) ||
-			(current_action == 'qty')) : true;
+		const current_action = $btn.attr("data-button-value");
+		const action_is_field_edit = ["qty", "discount_percentage", "rate"].includes(current_action);
+		const action_is_allowed = action_is_field_edit
+			? (current_action == "rate" && this.allow_rate_change) ||
+			  (current_action == "discount_percentage" && this.allow_discount_change) ||
+			  current_action == "qty"
+			: true;
 
 		const action_is_pressed_twice = this.prev_action === current_action;
 		const first_click_event = !this.prev_action;
@@ -713,11 +737,11 @@
 
 		if (action_is_field_edit) {
 			if (!action_is_allowed) {
-				const label = current_action == 'rate' ? 'Rate'.bold() : 'Discount'.bold();
-				const message = __('Editing {0} is not allowed as per POS Profile settings', [label]);
+				const label = current_action == "rate" ? "Rate".bold() : "Discount".bold();
+				const message = __("Editing {0} is not allowed as per POS Profile settings", [label]);
 				frappe.show_alert({
-					indicator: 'red',
-					message: message
+					indicator: "red",
+					message: message,
 				});
 				frappe.utils.play_sound("error");
 				return;
@@ -728,20 +752,22 @@
 			} else if (action_is_pressed_twice) {
 				this.prev_action = undefined;
 			}
-			this.numpad_value = '';
-
-		} else if (current_action === 'checkout') {
+			this.numpad_value = "";
+		} else if (current_action === "checkout") {
 			this.prev_action = undefined;
 			this.toggle_item_highlight();
 			this.events.numpad_event(undefined, current_action);
 			return;
-		} else if (current_action === 'remove') {
+		} else if (current_action === "remove") {
 			this.prev_action = undefined;
 			this.toggle_item_highlight();
 			this.events.numpad_event(undefined, current_action);
 			return;
 		} else {
-			this.numpad_value = current_action === 'delete' ? this.numpad_value.slice(0, -1) : this.numpad_value + current_action;
+			this.numpad_value =
+				current_action === "delete"
+					? this.numpad_value.slice(0, -1)
+					: this.numpad_value + current_action;
 			this.numpad_value = this.numpad_value || 0;
 		}
 
@@ -749,17 +775,17 @@
 
 		if (first_click_event_is_not_field_edit) {
 			frappe.show_alert({
-				indicator: 'red',
-				message: __('Please select a field to edit from numpad')
+				indicator: "red",
+				message: __("Please select a field to edit from numpad"),
 			});
 			frappe.utils.play_sound("error");
 			return;
 		}
 
-		if (flt(this.numpad_value) > 100 && this.prev_action === 'discount_percentage') {
+		if (flt(this.numpad_value) > 100 && this.prev_action === "discount_percentage") {
 			frappe.show_alert({
-				message: __('Discount cannot be greater than 100%'),
-				indicator: 'orange'
+				message: __("Discount cannot be greater than 100%"),
+				indicator: "orange",
 			});
 			frappe.utils.play_sound("error");
 			this.numpad_value = current_action;
@@ -770,48 +796,48 @@
 	}
 
 	highlight_numpad_btn($btn, curr_action) {
-		const curr_action_is_highlighted = $btn.hasClass('highlighted-numpad-btn');
-		const curr_action_is_action = ['qty', 'discount_percentage', 'rate', 'done'].includes(curr_action);
+		const curr_action_is_highlighted = $btn.hasClass("highlighted-numpad-btn");
+		const curr_action_is_action = ["qty", "discount_percentage", "rate", "done"].includes(curr_action);
 
 		if (!curr_action_is_highlighted) {
-			$btn.addClass('highlighted-numpad-btn');
+			$btn.addClass("highlighted-numpad-btn");
 		}
 		if (this.prev_action === curr_action && curr_action_is_highlighted) {
 			// if Qty is pressed twice
-			$btn.removeClass('highlighted-numpad-btn');
+			$btn.removeClass("highlighted-numpad-btn");
 		}
 		if (this.prev_action && this.prev_action !== curr_action && curr_action_is_action) {
 			// Order: Qty -> Rate then remove Qty highlight
 			const prev_btn = $(`[data-button-value='${this.prev_action}']`);
-			prev_btn.removeClass('highlighted-numpad-btn');
+			prev_btn.removeClass("highlighted-numpad-btn");
 		}
-		if (!curr_action_is_action || curr_action === 'done') {
+		if (!curr_action_is_action || curr_action === "done") {
 			// if numbers are clicked
 			setTimeout(() => {
-				$btn.removeClass('highlighted-numpad-btn');
+				$btn.removeClass("highlighted-numpad-btn");
 			}, 200);
 		}
 	}
 
 	toggle_numpad(show) {
 		if (show) {
-			this.$totals_section.css('display', 'none');
-			this.$numpad_section.css('display', 'flex');
+			this.$totals_section.css("display", "none");
+			this.$numpad_section.css("display", "flex");
 		} else {
-			this.$totals_section.css('display', 'flex');
-			this.$numpad_section.css('display', 'none');
+			this.$totals_section.css("display", "flex");
+			this.$numpad_section.css("display", "none");
 		}
 		this.reset_numpad();
 	}
 
 	reset_numpad() {
-		this.numpad_value = '';
+		this.numpad_value = "";
 		this.prev_action = undefined;
-		this.$numpad_section.find('.highlighted-numpad-btn').removeClass('highlighted-numpad-btn');
+		this.$numpad_section.find(".highlighted-numpad-btn").removeClass("highlighted-numpad-btn");
 	}
 
 	toggle_numpad_field_edit(fieldname) {
-		if (['qty', 'discount_percentage', 'rate'].includes(fieldname)) {
+		if (["qty", "discount_percentage", "rate"].includes(fieldname)) {
 			this.$numpad_section.find(`[data-button-value="${fieldname}"]`).click();
 		}
 	}
@@ -820,12 +846,12 @@
 		if (show) {
 			const { customer } = this.customer_info || {};
 
-			this.$cart_container.css('display', 'none');
+			this.$cart_container.css("display", "none");
 			this.$customer_section.css({
-				'height': '100%',
-				'padding-top': '0px'
+				height: "100%",
+				"padding-top": "0px",
 			});
-			this.$customer_section.find('.customer-details').html(
+			this.$customer_section.find(".customer-details").html(
 				`<div class="header">
 					<div class="label">Contact Details</div>
 					<div class="close-details-btn">
@@ -854,12 +880,11 @@
 
 			this.render_customer_fields();
 			this.fetch_customer_transactions();
-
 		} else {
-			this.$cart_container.css('display', 'flex');
+			this.$cart_container.css("display", "flex");
 			this.$customer_section.css({
-				'height': '',
-				'padding-top': ''
+				height: "",
+				"padding-top": "",
 			});
 
 			this.update_customer_section();
@@ -867,100 +892,107 @@
 	}
 
 	render_customer_fields() {
-		const $customer_form = this.$customer_section.find('.customer-fields-container');
+		const $customer_form = this.$customer_section.find(".customer-fields-container");
 
-		const dfs = [{
-			fieldname: 'email_id',
-			label: __('Email'),
-			fieldtype: 'Data',
-			options: 'email',
-			placeholder: __("Enter customer's email")
-		},{
-			fieldname: 'mobile_no',
-			label: __('Phone Number'),
-			fieldtype: 'Data',
-			placeholder: __("Enter customer's phone number")
-		},{
-			fieldname: 'loyalty_program',
-			label: __('Loyalty Program'),
-			fieldtype: 'Link',
-			options: 'Loyalty Program',
-			placeholder: __("Select Loyalty Program")
-		},{
-			fieldname: 'loyalty_points',
-			label: __('Loyalty Points'),
-			fieldtype: 'Data',
-			read_only: 1
-		}];
+		const dfs = [
+			{
+				fieldname: "email_id",
+				label: __("Email"),
+				fieldtype: "Data",
+				options: "email",
+				placeholder: __("Enter customer's email"),
+			},
+			{
+				fieldname: "mobile_no",
+				label: __("Phone Number"),
+				fieldtype: "Data",
+				placeholder: __("Enter customer's phone number"),
+			},
+			{
+				fieldname: "loyalty_program",
+				label: __("Loyalty Program"),
+				fieldtype: "Link",
+				options: "Loyalty Program",
+				placeholder: __("Select Loyalty Program"),
+			},
+			{
+				fieldname: "loyalty_points",
+				label: __("Loyalty Points"),
+				fieldtype: "Data",
+				read_only: 1,
+			},
+		];
 
 		const me = this;
-		dfs.forEach(df => {
+		dfs.forEach((df) => {
 			this[`customer_${df.fieldname}_field`] = frappe.ui.form.make_control({
-				df: { ...df,
-					onchange: handle_customer_field_change,
-				},
+				df: { ...df, onchange: handle_customer_field_change },
 				parent: $customer_form.find(`.${df.fieldname}-field`),
 				render_input: true,
 			});
 			this[`customer_${df.fieldname}_field`].set_value(this.customer_info[df.fieldname]);
-		})
+		});
 
 		function handle_customer_field_change() {
 			const current_value = me.customer_info[this.df.fieldname];
 			const current_customer = me.customer_info.customer;
 
-			if (this.value && current_value != this.value && this.df.fieldname != 'loyalty_points') {
+			if (this.value && current_value != this.value && this.df.fieldname != "loyalty_points") {
 				frappe.call({
-					method: 'erpnext.selling.page.point_of_sale.point_of_sale.set_customer_info',
+					method: "erpnext.selling.page.point_of_sale.point_of_sale.set_customer_info",
 					args: {
 						fieldname: this.df.fieldname,
 						customer: current_customer,
-						value: this.value
+						value: this.value,
 					},
 					callback: (r) => {
-						if(!r.exc) {
+						if (!r.exc) {
 							me.customer_info[this.df.fieldname] = this.value;
 							frappe.show_alert({
 								message: __("Customer contact updated successfully."),
-								indicator: 'green'
+								indicator: "green",
 							});
 							frappe.utils.play_sound("submit");
 						}
-					}
+					},
 				});
 			}
 		}
 	}
 
 	fetch_customer_transactions() {
-		frappe.db.get_list('POS Invoice', {
-			filters: { customer: this.customer_info.customer, docstatus: 1 },
-			fields: ['name', 'grand_total', 'status', 'posting_date', 'posting_time', 'currency'],
-			limit: 20
-		}).then((res) => {
-			const transaction_container = this.$customer_section.find('.customer-transactions');
+		frappe.db
+			.get_list("POS Invoice", {
+				filters: { customer: this.customer_info.customer, docstatus: 1 },
+				fields: ["name", "grand_total", "status", "posting_date", "posting_time", "currency"],
+				limit: 20,
+			})
+			.then((res) => {
+				const transaction_container = this.$customer_section.find(".customer-transactions");
 
-			if (!res.length) {
-				transaction_container.html(
-					`<div class="no-transactions-placeholder">No recent transactions found</div>`
-				)
-				return;
-			}
+				if (!res.length) {
+					transaction_container.html(
+						`<div class="no-transactions-placeholder">No recent transactions found</div>`
+					);
+					return;
+				}
 
-			const elapsed_time = moment(res[0].posting_date+" "+res[0].posting_time).fromNow();
-			this.$customer_section.find('.customer-desc').html(`Last transacted ${elapsed_time}`);
+				const elapsed_time = moment(res[0].posting_date + " " + res[0].posting_time).fromNow();
+				this.$customer_section.find(".customer-desc").html(`Last transacted ${elapsed_time}`);
 
-			res.forEach(invoice => {
-				const posting_datetime = moment(invoice.posting_date+" "+invoice.posting_time).format("Do MMMM, h:mma");
-				let indicator_color = {
-					'Paid': 'green',
-					'Draft': 'red',
-					'Return': 'gray',
-					'Consolidated': 'blue'
-				};
+				res.forEach((invoice) => {
+					const posting_datetime = moment(invoice.posting_date + " " + invoice.posting_time).format(
+						"Do MMMM, h:mma"
+					);
+					let indicator_color = {
+						Paid: "green",
+						Draft: "red",
+						Return: "gray",
+						Consolidated: "blue",
+					};
 
-				transaction_container.append(
-					`<div class="invoice-wrapper" data-invoice-name="${escape(invoice.name)}">
+					transaction_container.append(
+						`<div class="invoice-wrapper" data-invoice-name="${escape(invoice.name)}">
 						<div class="invoice-name-date">
 							<div class="invoice-name">${invoice.name}</div>
 							<div class="invoice-date">${posting_datetime}</div>
@@ -977,17 +1009,17 @@
 						</div>
 					</div>
 					<div class="seperator"></div>`
-				)
+					);
+				});
 			});
-		});
 	}
 
 	attach_refresh_field_event(frm) {
-		$(frm.wrapper).off('refresh-fields');
-		$(frm.wrapper).on('refresh-fields', () => {
+		$(frm.wrapper).off("refresh-fields");
+		$(frm.wrapper).on("refresh-fields", () => {
 			if (frm.doc.items.length) {
-				this.$cart_items_wrapper.html('');
-				frm.doc.items.forEach(item => {
+				this.$cart_items_wrapper.html("");
+				frm.doc.items.forEach((item) => {
 					this.update_item_html(item);
 				});
 			}
@@ -1005,9 +1037,9 @@
 			this.update_customer_section();
 		});
 
-		this.$cart_items_wrapper.html('');
+		this.$cart_items_wrapper.html("");
 		if (frm.doc.items.length) {
-			frm.doc.items.forEach(item => {
+			frm.doc.items.forEach((item) => {
 				this.update_item_html(item);
 			});
 		} else {
@@ -1017,19 +1049,18 @@
 
 		this.update_totals_section(frm);
 
-		if(frm.doc.docstatus === 1) {
-			this.$totals_section.find('.checkout-btn').css('display', 'none');
-			this.$totals_section.find('.edit-cart-btn').css('display', 'none');
+		if (frm.doc.docstatus === 1) {
+			this.$totals_section.find(".checkout-btn").css("display", "none");
+			this.$totals_section.find(".edit-cart-btn").css("display", "none");
 		} else {
-			this.$totals_section.find('.checkout-btn').css('display', 'flex');
-			this.$totals_section.find('.edit-cart-btn').css('display', 'none');
+			this.$totals_section.find(".checkout-btn").css("display", "flex");
+			this.$totals_section.find(".edit-cart-btn").css("display", "none");
 		}
 
 		this.toggle_component(true);
 	}
 
 	toggle_component(show) {
-		show ? this.$component.css('display', 'flex') : this.$component.css('display', 'none');
+		show ? this.$component.css("display", "flex") : this.$component.css("display", "none");
 	}
-
-}
+};
diff --git a/erpnext/selling/page/point_of_sale/pos_item_details.js b/erpnext/selling/page/point_of_sale/pos_item_details.js
index b6e567c..9646a04 100644
--- a/erpnext/selling/page/point_of_sale/pos_item_details.js
+++ b/erpnext/selling/page/point_of_sale/pos_item_details.js
@@ -18,17 +18,15 @@
 	}
 
 	prepare_dom() {
-		this.wrapper.append(
-			`<section class="item-details-container"></section>`
-		)
+		this.wrapper.append(`<section class="item-details-container"></section>`);
 
-		this.$component = this.wrapper.find('.item-details-container');
+		this.$component = this.wrapper.find(".item-details-container");
 	}
 
 	init_child_components() {
 		this.$component.html(
 			`<div class="item-details-header">
-				<div class="label">${__('Item Details')}</div>
+				<div class="label">${__("Item Details")}</div>
 				<div class="close-btn">
 					<svg width="32" height="32" viewBox="0 0 14 14" fill="none">
 						<path d="M4.93764 4.93759L7.00003 6.99998M9.06243 9.06238L7.00003 6.99998M7.00003 6.99998L4.93764 9.06238L9.06243 4.93759" stroke="#8D99A6"/>
@@ -46,15 +44,15 @@
 			<div class="discount-section"></div>
 			<div class="form-container"></div>
 			<div class="serial-batch-container"></div>`
-		)
+		);
 
-		this.$item_name = this.$component.find('.item-name');
-		this.$item_description = this.$component.find('.item-desc');
-		this.$item_price = this.$component.find('.item-price');
-		this.$item_image = this.$component.find('.item-image');
-		this.$form_container = this.$component.find('.form-container');
-		this.$dicount_section = this.$component.find('.discount-section');
-		this.$serial_batch_container = this.$component.find('.serial-batch-container');
+		this.$item_name = this.$component.find(".item-name");
+		this.$item_description = this.$component.find(".item-desc");
+		this.$item_price = this.$component.find(".item-price");
+		this.$item_image = this.$component.find(".item-image");
+		this.$form_container = this.$component.find(".form-container");
+		this.$dicount_section = this.$component.find(".discount-section");
+		this.$serial_batch_container = this.$component.find(".serial-batch-container");
 	}
 
 	compare_with_current_item(item) {
@@ -97,7 +95,7 @@
 
 	validate_serial_batch_item() {
 		const doc = this.events.get_frm().doc;
-		const item_row = doc.items.find(item => item.name === this.name);
+		const item_row = doc.items.find((item) => item.name === this.name);
 
 		if (!item_row) return;
 
@@ -108,7 +106,7 @@
 		if ((serialized && no_bundle_selected) || (batched && no_bundle_selected)) {
 			frappe.show_alert({
 				message: __("Item is removed since no serial / batch no selected."),
-				indicator: 'orange'
+				indicator: "orange",
 			});
 			frappe.utils.play_sound("cancel");
 			return this.events.remove_item_from_cart();
@@ -120,7 +118,10 @@
 
 		function get_description_html() {
 			if (description) {
-				description = description.indexOf('...') === -1 && description.length > 140 ? description.substr(0, 139) + '...' : description;
+				description =
+					description.indexOf("...") === -1 && description.length > 140
+						? description.substr(0, 139) + "..."
+						: description;
 				return description;
 			}
 			return ``;
@@ -140,11 +141,10 @@
 		} else {
 			this.$item_image.html(`<div class="item-abbr">${frappe.get_abbr(item_name)}</div>`);
 		}
-
 	}
 
 	handle_broken_image($img) {
-		const item_abbr = $($img).attr('alt');
+		const item_abbr = $($img).attr("alt");
 		$($img).replaceWith(`<div class="item-abbr">${item_abbr}</div>`);
 	}
 
@@ -153,36 +153,36 @@
 			this.$dicount_section.html(
 				`<div class="item-rate">${format_currency(item.price_list_rate, this.currency)}</div>
 				<div class="item-discount">${item.discount_percentage}% off</div>`
-			)
+			);
 			this.$item_price.html(format_currency(item.rate, this.currency));
 		} else {
-			this.$dicount_section.html(``)
+			this.$dicount_section.html(``);
 		}
 	}
 
 	render_form(item) {
 		const fields_to_display = this.get_form_fields(item);
-		this.$form_container.html('');
+		this.$form_container.html("");
 
 		fields_to_display.forEach((fieldname, idx) => {
 			this.$form_container.append(
 				`<div class="${fieldname}-control" data-fieldname="${fieldname}"></div>`
-			)
+			);
 
-			const field_meta = this.item_meta.fields.find(df => df.fieldname === fieldname);
-			fieldname === 'discount_percentage' ? (field_meta.label = __('Discount (%)')) : '';
+			const field_meta = this.item_meta.fields.find((df) => df.fieldname === fieldname);
+			fieldname === "discount_percentage" ? (field_meta.label = __("Discount (%)")) : "";
 			const me = this;
 
 			this[`${fieldname}_control`] = frappe.ui.form.make_control({
 				df: {
 					...field_meta,
-					onchange: function() {
+					onchange: function () {
 						me.events.form_updated(me.current_item, fieldname, this.value);
-					}
+					},
 				},
 				parent: this.$form_container.find(`.${fieldname}-control`),
 				render_input: true,
-			})
+			});
 			this[`${fieldname}_control`].set_value(item[fieldname]);
 		});
 
@@ -192,28 +192,37 @@
 	}
 
 	get_form_fields(item) {
-		const fields = ['qty', 'uom', 'rate', 'conversion_factor', 'discount_percentage', 'warehouse', 'actual_qty', 'price_list_rate'];
-		if (item.has_serial_no) fields.push('serial_no');
-		if (item.has_batch_no) fields.push('batch_no');
+		const fields = [
+			"qty",
+			"uom",
+			"rate",
+			"conversion_factor",
+			"discount_percentage",
+			"warehouse",
+			"actual_qty",
+			"price_list_rate",
+		];
+		if (item.has_serial_no) fields.push("serial_no");
+		if (item.has_batch_no) fields.push("batch_no");
 		return fields;
 	}
 
 	make_auto_serial_selection_btn(item) {
 		if (item.has_serial_no || item.has_batch_no) {
-			const label = item.has_serial_no ? __('Select Serial No') : __('Select Batch No');
+			const label = item.has_serial_no ? __("Select Serial No") : __("Select Batch No");
 			this.$form_container.append(
 				`<div class="btn btn-sm btn-secondary auto-fetch-btn">${label}</div>`
 			);
-			this.$form_container.find('.serial_no-control').find('textarea').css('height', '6rem');
+			this.$form_container.find(".serial_no-control").find("textarea").css("height", "6rem");
 		}
 	}
 
 	bind_custom_control_change_event() {
 		const me = this;
 		if (this.rate_control) {
-			this.rate_control.df.onchange = function() {
+			this.rate_control.df.onchange = function () {
 				if (this.value || flt(this.value) === 0) {
-					me.events.form_updated(me.current_item, 'rate', this.value).then(() => {
+					me.events.form_updated(me.current_item, "rate", this.value).then(() => {
 						const item_row = frappe.get_doc(me.doctype, me.name);
 						const doc = me.events.get_frm().doc;
 						me.$item_price.html(format_currency(item_row.rate, doc.currency));
@@ -232,43 +241,48 @@
 
 		if (this.warehouse_control) {
 			this.warehouse_control.df.reqd = 1;
-			this.warehouse_control.df.onchange = function() {
+			this.warehouse_control.df.onchange = function () {
 				if (this.value) {
-					me.events.form_updated(me.current_item, 'warehouse', this.value).then(() => {
+					me.events.form_updated(me.current_item, "warehouse", this.value).then(() => {
 						me.item_stock_map = me.events.get_item_stock_map();
 						const available_qty = me.item_stock_map[me.item_row.item_code][this.value][0];
-						const is_stock_item = Boolean(me.item_stock_map[me.item_row.item_code][this.value][1]);
+						const is_stock_item = Boolean(
+							me.item_stock_map[me.item_row.item_code][this.value][1]
+						);
 						if (available_qty === undefined) {
 							me.events.get_available_stock(me.item_row.item_code, this.value).then(() => {
 								// item stock map is updated now reset warehouse
 								me.warehouse_control.set_value(this.value);
-							})
+							});
 						} else if (available_qty === 0 && is_stock_item) {
-							me.warehouse_control.set_value('');
+							me.warehouse_control.set_value("");
 							const bold_item_code = me.item_row.item_code.bold();
 							const bold_warehouse = this.value.bold();
 							frappe.throw(
-								__('Item Code: {0} is not available under warehouse {1}.', [bold_item_code, bold_warehouse])
+								__("Item Code: {0} is not available under warehouse {1}.", [
+									bold_item_code,
+									bold_warehouse,
+								])
 							);
 						}
 						me.actual_qty_control.set_value(available_qty);
 					});
 				}
-			}
+			};
 			this.warehouse_control.df.get_query = () => {
 				return {
-					filters: { company: this.events.get_frm().doc.company }
-				}
+					filters: { company: this.events.get_frm().doc.company },
+				};
 			};
 			this.warehouse_control.refresh();
 		}
 
 		if (this.serial_no_control) {
 			this.serial_no_control.df.reqd = 1;
-			this.serial_no_control.df.onchange = async function() {
-				!me.current_item.batch_no && await me.auto_update_batch_no();
-				me.events.form_updated(me.current_item, 'serial_no', this.value);
-			}
+			this.serial_no_control.df.onchange = async function () {
+				!me.current_item.batch_no && (await me.auto_update_batch_no());
+				me.events.form_updated(me.current_item, "serial_no", this.value);
+			};
 			this.serial_no_control.refresh();
 		}
 
@@ -276,25 +290,25 @@
 			this.batch_no_control.df.reqd = 1;
 			this.batch_no_control.df.get_query = () => {
 				return {
-					query: 'erpnext.controllers.queries.get_batch_no',
+					query: "erpnext.controllers.queries.get_batch_no",
 					filters: {
 						item_code: me.item_row.item_code,
 						warehouse: me.item_row.warehouse,
-						posting_date: me.events.get_frm().doc.posting_date
-					}
-				}
+						posting_date: me.events.get_frm().doc.posting_date,
+					},
+				};
 			};
 			this.batch_no_control.refresh();
 		}
 
 		if (this.uom_control) {
-			this.uom_control.df.onchange = function() {
-				me.events.form_updated(me.current_item, 'uom', this.value);
+			this.uom_control.df.onchange = function () {
+				me.events.form_updated(me.current_item, "uom", this.value);
 
 				const item_row = frappe.get_doc(me.doctype, me.name);
-				me.conversion_factor_control.df.read_only = (item_row.stock_uom == this.value);
+				me.conversion_factor_control.df.read_only = item_row.stock_uom == this.value;
 				me.conversion_factor_control.refresh();
-			}
+			};
 		}
 
 		frappe.model.on("POS Invoice Item", "*", (fieldname, value, item_row) => {
@@ -310,13 +324,16 @@
 
 	async auto_update_batch_no() {
 		if (this.serial_no_control && this.batch_no_control) {
-			const selected_serial_nos = this.serial_no_control.get_value().split(`\n`).filter(s => s);
+			const selected_serial_nos = this.serial_no_control
+				.get_value()
+				.split(`\n`)
+				.filter((s) => s);
 			if (!selected_serial_nos.length) return;
 
 			// find batch nos of the selected serial no
 			const serials_with_batch_no = await frappe.db.get_list("Serial No", {
-				filters: { 'name': ["in", selected_serial_nos]},
-				fields: ["batch_no", "name"]
+				filters: { name: ["in", selected_serial_nos] },
+				fields: ["batch_no", "name"],
 			});
 			const batch_serial_map = serials_with_batch_no.reduce((acc, r) => {
 				if (!acc[r.batch_no]) {
@@ -329,10 +346,11 @@
 			const batch_no = Object.keys(batch_serial_map)[0];
 			const batch_serial_nos = batch_serial_map[batch_no].join(`\n`);
 			// eg. 10 selected serial no. -> 5 belongs to first batch other 5 belongs to second batch
-			const serial_nos_belongs_to_other_batch = selected_serial_nos.length !== batch_serial_map[batch_no].length;
+			const serial_nos_belongs_to_other_batch =
+				selected_serial_nos.length !== batch_serial_map[batch_no].length;
 
 			const current_batch_no = this.batch_no_control.get_value();
-			current_batch_no != batch_no && await this.batch_no_control.set_value(batch_no);
+			current_batch_no != batch_no && (await this.batch_no_control.set_value(batch_no));
 
 			if (serial_nos_belongs_to_other_batch) {
 				this.serial_no_control.set_value(batch_serial_nos);
@@ -348,13 +366,13 @@
 		this.bind_auto_serial_fetch_event();
 		this.bind_fields_to_numpad_fields();
 
-		this.$component.on('click', '.close-btn', () => {
+		this.$component.on("click", ".close-btn", () => {
 			this.events.close_item_details();
 		});
 	}
 
 	attach_shortcuts() {
-		this.wrapper.find('.close-btn').attr("title", "Esc");
+		this.wrapper.find(".close-btn").attr("title", "Esc");
 		frappe.ui.keys.on("escape", () => {
 			const item_details_visible = this.$component.is(":visible");
 			if (item_details_visible) {
@@ -365,8 +383,8 @@
 
 	bind_fields_to_numpad_fields() {
 		const me = this;
-		this.$form_container.on('click', '.input-with-feedback', function() {
-			const fieldname = $(this).attr('data-fieldname');
+		this.$form_container.on("click", ".input-with-feedback", function () {
+			const fieldname = $(this).attr("data-fieldname");
 			if (this.last_field_focused != fieldname) {
 				me.events.item_field_focused(fieldname);
 				this.last_field_focused = fieldname;
@@ -375,7 +393,7 @@
 	}
 
 	bind_auto_serial_fetch_event() {
-		this.$form_container.on('click', '.auto-fetch-btn', () => {
+		this.$form_container.on("click", ".auto-fetch-btn", () => {
 			frappe.require("assets/erpnext/js/utils/serial_no_batch_selector.js", () => {
 				let frm = this.events.get_frm();
 				let item_row = this.item_row;
@@ -384,16 +402,16 @@
 				new erpnext.SerialBatchPackageSelector(frm, item_row, (r) => {
 					if (r) {
 						frappe.model.set_value(item_row.doctype, item_row.name, {
-							"serial_and_batch_bundle": r.name,
-							"qty": Math.abs(r.total_qty)
+							serial_and_batch_bundle: r.name,
+							qty: Math.abs(r.total_qty),
 						});
 					}
 				});
 			});
-		})
+		});
 	}
 
 	toggle_component(show) {
-		show ? this.$component.css('display', 'flex') : this.$component.css('display', 'none');
+		show ? this.$component.css("display", "flex") : this.$component.css("display", "none");
 	}
-}
+};
diff --git a/erpnext/selling/page/point_of_sale/pos_item_selector.js b/erpnext/selling/page/point_of_sale/pos_item_selector.js
index ec67bdf..b5fa884 100644
--- a/erpnext/selling/page/point_of_sale/pos_item_selector.js
+++ b/erpnext/selling/page/point_of_sale/pos_item_selector.js
@@ -1,4 +1,4 @@
-import onScan from 'onscan.js';
+import onScan from "onscan.js";
 
 erpnext.PointOfSale.ItemSelector = class {
 	// eslint-disable-next-line no-unused-vars
@@ -24,7 +24,7 @@
 		this.wrapper.append(
 			`<section class="items-selector">
 				<div class="filter-section">
-					<div class="label">${__('All Items')}</div>
+					<div class="label">${__("All Items")}</div>
 					<div class="search-field"></div>
 					<div class="item-group-field"></div>
 				</div>
@@ -32,13 +32,13 @@
 			</section>`
 		);
 
-		this.$component = this.wrapper.find('.items-selector');
-		this.$items_container = this.$component.find('.items-container');
+		this.$component = this.wrapper.find(".items-selector");
+		this.$items_container = this.$component.find(".items-container");
 	}
 
 	async load_items_data() {
 		if (!this.item_group) {
-			const res = await frappe.db.get_value("Item Group", {lft: 1, is_group: 1}, "name");
+			const res = await frappe.db.get_value("Item Group", { lft: 1, is_group: 1 }, "name");
 			this.parent_item_group = res.message.name;
 		}
 		if (!this.price_list) {
@@ -46,12 +46,12 @@
 			this.price_list = res.message.selling_price_list;
 		}
 
-		this.get_items({}).then(({message}) => {
+		this.get_items({}).then(({ message }) => {
 			this.render_item_list(message.items);
 		});
 	}
 
-	get_items({start = 0, page_length = 40, search_term=''}) {
+	get_items({ start = 0, page_length = 40, search_term = "" }) {
 		const doc = this.events.get_frm().doc;
 		const price_list = (doc && doc.selling_price_list) || this.price_list;
 		let { item_group, pos_profile } = this;
@@ -65,11 +65,10 @@
 		});
 	}
 
-
 	render_item_list(items) {
-		this.$items_container.html('');
+		this.$items_container.html("");
 
-		items.forEach(item => {
+		items.forEach((item) => {
 			const item_html = this.get_item_html(item);
 			this.$items_container.append(item_html);
 		});
@@ -84,15 +83,15 @@
 		let qty_to_display = actual_qty;
 
 		if (item.is_stock_item) {
-			indicator_color = (actual_qty > 10 ? "green" : actual_qty <= 0 ? "red" : "orange");
+			indicator_color = actual_qty > 10 ? "green" : actual_qty <= 0 ? "red" : "orange";
 
 			if (Math.round(qty_to_display) > 999) {
-				qty_to_display = Math.round(qty_to_display)/1000;
-				qty_to_display = qty_to_display.toFixed(1) + 'K';
+				qty_to_display = Math.round(qty_to_display) / 1000;
+				qty_to_display = qty_to_display.toFixed(1) + "K";
 			}
 		} else {
-			indicator_color = '';
-			qty_to_display = '';
+			indicator_color = "";
+			qty_to_display = "";
 		}
 
 		function get_item_image_html() {
@@ -115,8 +114,7 @@
 			}
 		}
 
-		return (
-			`<div class="item-wrapper"
+		return `<div class="item-wrapper"
 				data-item-code="${escape(item.item_code)}" data-serial-no="${escape(serial_no)}"
 				data-batch-no="${escape(batch_no)}" data-uom="${escape(uom)}"
 				data-rate="${escape(price_list_rate || 0)}"
@@ -130,51 +128,50 @@
 					</div>
 					<div class="item-rate">${format_currency(price_list_rate, item.currency, precision) || 0} / ${uom}</div>
 				</div>
-			</div>`
-		);
+			</div>`;
 	}
 
 	handle_broken_image($img) {
-		const item_abbr = $($img).attr('alt');
+		const item_abbr = $($img).attr("alt");
 		$($img).parent().replaceWith(`<div class="item-display abbr">${item_abbr}</div>`);
 	}
 
 	make_search_bar() {
 		const me = this;
 		const doc = me.events.get_frm().doc;
-		this.$component.find('.search-field').html('');
-		this.$component.find('.item-group-field').html('');
+		this.$component.find(".search-field").html("");
+		this.$component.find(".item-group-field").html("");
 
 		this.search_field = frappe.ui.form.make_control({
 			df: {
-				label: __('Search'),
-				fieldtype: 'Data',
-				placeholder: __('Search by item code, serial number or barcode')
+				label: __("Search"),
+				fieldtype: "Data",
+				placeholder: __("Search by item code, serial number or barcode"),
 			},
-			parent: this.$component.find('.search-field'),
+			parent: this.$component.find(".search-field"),
 			render_input: true,
 		});
 		this.item_group_field = frappe.ui.form.make_control({
 			df: {
-				label: __('Item Group'),
-				fieldtype: 'Link',
-				options: 'Item Group',
-				placeholder: __('Select item group'),
-				onchange: function() {
+				label: __("Item Group"),
+				fieldtype: "Link",
+				options: "Item Group",
+				placeholder: __("Select item group"),
+				onchange: function () {
 					me.item_group = this.value;
 					!me.item_group && (me.item_group = me.parent_item_group);
 					me.filter_items();
 				},
 				get_query: function () {
 					return {
-						query: 'erpnext.selling.page.point_of_sale.point_of_sale.item_group_query',
+						query: "erpnext.selling.page.point_of_sale.point_of_sale.item_group_query",
 						filters: {
-							pos_profile: doc ? doc.pos_profile : ''
-						}
+							pos_profile: doc ? doc.pos_profile : "",
+						},
 					};
 				},
 			},
-			parent: this.$component.find('.item-group-field'),
+			parent: this.$component.find(".item-group-field"),
 			render_input: true,
 		});
 		this.search_field.toggle_label(false);
@@ -184,18 +181,18 @@
 	}
 
 	attach_clear_btn() {
-		this.search_field.$wrapper.find('.control-input').append(
+		this.search_field.$wrapper.find(".control-input").append(
 			`<span class="link-btn" style="top: 2px;">
 				<a class="btn-open no-decoration" title="${__("Clear")}">
-					${frappe.utils.icon('close', 'sm')}
+					${frappe.utils.icon("close", "sm")}
 				</a>
 			</span>`
 		);
 
-		this.$clear_search_btn = this.search_field.$wrapper.find('.link-btn');
+		this.$clear_search_btn = this.search_field.$wrapper.find(".link-btn");
 
-		this.$clear_search_btn.on('click', 'a', () => {
-			this.set_search_value('');
+		this.$clear_search_btn.on("click", "a", () => {
+			this.set_search_value("");
 			this.search_field.set_focus();
 		});
 	}
@@ -217,39 +214,43 @@
 				case iCode >= 186 && iCode <= 194: // (; = , - . / `)
 				case iCode >= 219 && iCode <= 222: // ([ \ ] ')
 				case iCode == 32: // spacebar
-					if (oEvent.key !== undefined && oEvent.key !== '') {
+					if (oEvent.key !== undefined && oEvent.key !== "") {
 						return oEvent.key;
 					}
 
 					var sDecoded = String.fromCharCode(iCode);
 					switch (oEvent.shiftKey) {
-						case false: sDecoded = sDecoded.toLowerCase(); break;
-						case true: sDecoded = sDecoded.toUpperCase(); break;
+						case false:
+							sDecoded = sDecoded.toLowerCase();
+							break;
+						case true:
+							sDecoded = sDecoded.toUpperCase();
+							break;
 					}
 					return sDecoded;
 				case iCode >= 96 && iCode <= 105: // numbers on numeric keypad
 					return 0 + (iCode - 96);
 			}
-			return '';
+			return "";
 		};
 
 		onScan.attachTo(document, {
 			onScan: (sScancode) => {
-				if (this.search_field && this.$component.is(':visible')) {
+				if (this.search_field && this.$component.is(":visible")) {
 					this.search_field.set_focus();
 					this.set_search_value(sScancode);
 					this.barcode_scanned = true;
 				}
-			}
+			},
 		});
 
-		this.$component.on('click', '.item-wrapper', function() {
+		this.$component.on("click", ".item-wrapper", function () {
 			const $item = $(this);
-			const item_code = unescape($item.attr('data-item-code'));
-			let batch_no = unescape($item.attr('data-batch-no'));
-			let serial_no = unescape($item.attr('data-serial-no'));
-			let uom = unescape($item.attr('data-uom'));
-			let rate = unescape($item.attr('data-rate'));
+			const item_code = unescape($item.attr("data-item-code"));
+			let batch_no = unescape($item.attr("data-batch-no"));
+			let serial_no = unescape($item.attr("data-serial-no"));
+			let uom = unescape($item.attr("data-uom"));
+			let rate = unescape($item.attr("data-rate"));
 
 			// escape(undefined) returns "undefined" then unescape returns "undefined"
 			batch_no = batch_no === "undefined" ? undefined : batch_no;
@@ -258,76 +259,72 @@
 			rate = rate === "undefined" ? undefined : rate;
 
 			me.events.item_selected({
-				field: 'qty',
+				field: "qty",
 				value: "+1",
-				item: { item_code, batch_no, serial_no, uom, rate }
+				item: { item_code, batch_no, serial_no, uom, rate },
 			});
 			me.search_field.set_focus();
 		});
 
-		this.search_field.$input.on('input', (e) => {
+		this.search_field.$input.on("input", (e) => {
 			clearTimeout(this.last_search);
 			this.last_search = setTimeout(() => {
 				const search_term = e.target.value;
 				this.filter_items({ search_term });
 			}, 300);
 
-			this.$clear_search_btn.toggle(
-				Boolean(this.search_field.$input.val())
-			);
+			this.$clear_search_btn.toggle(Boolean(this.search_field.$input.val()));
 		});
 
-		this.search_field.$input.on('focus', () => {
-			this.$clear_search_btn.toggle(
-				Boolean(this.search_field.$input.val())
-			);
+		this.search_field.$input.on("focus", () => {
+			this.$clear_search_btn.toggle(Boolean(this.search_field.$input.val()));
 		});
 	}
 
 	attach_shortcuts() {
-		const ctrl_label = frappe.utils.is_mac() ? '⌘' : 'Ctrl';
+		const ctrl_label = frappe.utils.is_mac() ? "⌘" : "Ctrl";
 		this.search_field.parent.attr("title", `${ctrl_label}+I`);
 		frappe.ui.keys.add_shortcut({
 			shortcut: "ctrl+i",
 			action: () => this.search_field.set_focus(),
-			condition: () => this.$component.is(':visible'),
+			condition: () => this.$component.is(":visible"),
 			description: __("Focus on search input"),
 			ignore_inputs: true,
-			page: cur_page.page.page
+			page: cur_page.page.page,
 		});
 		this.item_group_field.parent.attr("title", `${ctrl_label}+G`);
 		frappe.ui.keys.add_shortcut({
 			shortcut: "ctrl+g",
 			action: () => this.item_group_field.set_focus(),
-			condition: () => this.$component.is(':visible'),
+			condition: () => this.$component.is(":visible"),
 			description: __("Focus on Item Group filter"),
 			ignore_inputs: true,
-			page: cur_page.page.page
+			page: cur_page.page.page,
 		});
 
 		// for selecting the last filtered item on search
 		frappe.ui.keys.on("enter", () => {
-			const selector_is_visible = this.$component.is(':visible');
+			const selector_is_visible = this.$component.is(":visible");
 			if (!selector_is_visible || this.search_field.get_value() === "") return;
 
 			if (this.items.length == 1) {
 				this.$items_container.find(".item-wrapper").click();
 				frappe.utils.play_sound("submit");
-				this.set_search_value('');
+				this.set_search_value("");
 			} else if (this.items.length == 0 && this.barcode_scanned) {
 				// only show alert of barcode is scanned and enter is pressed
 				frappe.show_alert({
 					message: __("No items found. Scan barcode again."),
-					indicator: 'orange'
+					indicator: "orange",
 				});
 				frappe.utils.play_sound("error");
 				this.barcode_scanned = false;
-				this.set_search_value('');
+				this.set_search_value("");
 			}
 		});
 	}
 
-	filter_items({ search_term='' }={}) {
+	filter_items({ search_term = "" } = {}) {
 		if (search_term) {
 			search_term = search_term.toLowerCase();
 
@@ -342,44 +339,47 @@
 			}
 		}
 
-		this.get_items({ search_term })
-			.then(({ message }) => {
-				// eslint-disable-next-line no-unused-vars
-				const { items, serial_no, batch_no, barcode } = message;
-				if (search_term && !barcode) {
-					this.search_index[search_term] = items;
-				}
-				this.items = items;
-				this.render_item_list(items);
-				this.auto_add_item && this.items.length == 1 && this.add_filtered_item_to_cart();
-			});
+		this.get_items({ search_term }).then(({ message }) => {
+			// eslint-disable-next-line no-unused-vars
+			const { items, serial_no, batch_no, barcode } = message;
+			if (search_term && !barcode) {
+				this.search_index[search_term] = items;
+			}
+			this.items = items;
+			this.render_item_list(items);
+			this.auto_add_item && this.items.length == 1 && this.add_filtered_item_to_cart();
+		});
 	}
 
 	add_filtered_item_to_cart() {
 		this.$items_container.find(".item-wrapper").click();
-		this.set_search_value('');
+		this.set_search_value("");
 	}
 
 	resize_selector(minimize) {
-		minimize ?
-			this.$component.find('.filter-section').css('grid-template-columns', 'repeat(1, minmax(0, 1fr))') :
-			this.$component.find('.filter-section').css('grid-template-columns', 'repeat(12, minmax(0, 1fr))');
+		minimize
+			? this.$component
+					.find(".filter-section")
+					.css("grid-template-columns", "repeat(1, minmax(0, 1fr))")
+			: this.$component
+					.find(".filter-section")
+					.css("grid-template-columns", "repeat(12, minmax(0, 1fr))");
 
-		minimize ?
-			this.$component.find('.search-field').css('margin', 'var(--margin-sm) 0px') :
-			this.$component.find('.search-field').css('margin', '0px var(--margin-sm)');
+		minimize
+			? this.$component.find(".search-field").css("margin", "var(--margin-sm) 0px")
+			: this.$component.find(".search-field").css("margin", "0px var(--margin-sm)");
 
-		minimize ?
-			this.$component.css('grid-column', 'span 2 / span 2') :
-			this.$component.css('grid-column', 'span 6 / span 6');
+		minimize
+			? this.$component.css("grid-column", "span 2 / span 2")
+			: this.$component.css("grid-column", "span 6 / span 6");
 
-		minimize ?
-			this.$items_container.css('grid-template-columns', 'repeat(1, minmax(0, 1fr))') :
-			this.$items_container.css('grid-template-columns', 'repeat(4, minmax(0, 1fr))');
+		minimize
+			? this.$items_container.css("grid-template-columns", "repeat(1, minmax(0, 1fr))")
+			: this.$items_container.css("grid-template-columns", "repeat(4, minmax(0, 1fr))");
 	}
 
 	toggle_component(show) {
-		this.set_search_value('');
-		this.$component.css('display', show ? 'flex': 'none');
+		this.set_search_value("");
+		this.$component.css("display", show ? "flex" : "none");
 	}
 };
diff --git a/erpnext/selling/page/point_of_sale/pos_number_pad.js b/erpnext/selling/page/point_of_sale/pos_number_pad.js
index f27b0d5..c77f206 100644
--- a/erpnext/selling/page/point_of_sale/pos_number_pad.js
+++ b/erpnext/selling/page/point_of_sale/pos_number_pad.js
@@ -20,28 +20,40 @@
 
 		function get_keys() {
 			return keys.reduce((a, row, i) => {
-				return a + row.reduce((a2, number, j) => {
-					const class_to_append = css_classes && css_classes[i] ? css_classes[i][j] : '';
-					const fieldname = fieldnames && fieldnames[number] ?
-						fieldnames[number] : typeof number === 'string' ? frappe.scrub(number) : number;
+				return (
+					a +
+					row.reduce((a2, number, j) => {
+						const class_to_append = css_classes && css_classes[i] ? css_classes[i][j] : "";
+						const fieldname =
+							fieldnames && fieldnames[number]
+								? fieldnames[number]
+								: typeof number === "string"
+								? frappe.scrub(number)
+								: number;
 
-					return a2 + `<div class="numpad-btn ${class_to_append}" data-button-value="${fieldname}">${__(number)}</div>`;
-				}, '');
-			}, '');
+						return (
+							a2 +
+							`<div class="numpad-btn ${class_to_append}" data-button-value="${fieldname}">${__(
+								number
+							)}</div>`
+						);
+					}, "")
+				);
+			}, "");
 		}
 
 		this.wrapper.html(
 			`<div class="numpad-container">
 				${get_keys()}
 			</div>`
-		)
+		);
 	}
 
 	bind_events() {
 		const me = this;
-		this.wrapper.on('click', '.numpad-btn', function() {
+		this.wrapper.on("click", ".numpad-btn", function () {
 			const $btn = $(this);
 			me.events.numpad_event($btn);
 		});
 	}
-}
+};
diff --git a/erpnext/selling/page/point_of_sale/pos_past_order_list.js b/erpnext/selling/page/point_of_sale/pos_past_order_list.js
index a0475c7..c450d8a 100644
--- a/erpnext/selling/page/point_of_sale/pos_past_order_list.js
+++ b/erpnext/selling/page/point_of_sale/pos_past_order_list.js
@@ -16,7 +16,7 @@
 		this.wrapper.append(
 			`<section class="past-order-list">
 				<div class="filter-section">
-					<div class="label">${__('Recent Orders')}</div>
+					<div class="label">${__("Recent Orders")}</div>
 					<div class="search-field"></div>
 					<div class="status-field"></div>
 				</div>
@@ -24,12 +24,12 @@
 			</section>`
 		);
 
-		this.$component = this.wrapper.find('.past-order-list');
-		this.$invoices_container = this.$component.find('.invoices-container');
+		this.$component = this.wrapper.find(".past-order-list");
+		this.$invoices_container = this.$component.find(".invoices-container");
 	}
 
 	bind_events() {
-		this.search_field.$input.on('input', (e) => {
+		this.search_field.$input.on("input", (e) => {
 			clearTimeout(this.last_search);
 			this.last_search = setTimeout(() => {
 				const search_term = e.target.value;
@@ -37,8 +37,8 @@
 			}, 300);
 		});
 		const me = this;
-		this.$invoices_container.on('click', '.invoice-wrapper', function() {
-			const invoice_name = unescape($(this).attr('data-invoice-name'));
+		this.$invoices_container.on("click", ".invoice-wrapper", function () {
+			const invoice_name = unescape($(this).attr("data-invoice-name"));
 
 			me.events.open_invoice_data(invoice_name);
 		});
@@ -48,29 +48,29 @@
 		const me = this;
 		this.search_field = frappe.ui.form.make_control({
 			df: {
-				label: __('Search'),
-				fieldtype: 'Data',
-				placeholder: __('Search by invoice id or customer name')
+				label: __("Search"),
+				fieldtype: "Data",
+				placeholder: __("Search by invoice id or customer name"),
 			},
-			parent: this.$component.find('.search-field'),
+			parent: this.$component.find(".search-field"),
 			render_input: true,
 		});
 		this.status_field = frappe.ui.form.make_control({
 			df: {
-				label: __('Invoice Status'),
-				fieldtype: 'Select',
+				label: __("Invoice Status"),
+				fieldtype: "Select",
 				options: `Draft\nPaid\nConsolidated\nReturn`,
-				placeholder: __('Filter by invoice status'),
-				onchange: function() {
-					if (me.$component.is(':visible')) me.refresh_list();
-				}
+				placeholder: __("Filter by invoice status"),
+				onchange: function () {
+					if (me.$component.is(":visible")) me.refresh_list();
+				},
 			},
-			parent: this.$component.find('.status-field'),
+			parent: this.$component.find(".status-field"),
 			render_input: true,
 		});
 		this.search_field.toggle_label(false);
 		this.status_field.toggle_label(false);
-		this.status_field.set_value('Draft');
+		this.status_field.set_value("Draft");
 	}
 
 	refresh_list() {
@@ -79,7 +79,7 @@
 		const search_term = this.search_field.get_value();
 		const status = this.status_field.get_value();
 
-		this.$invoices_container.html('');
+		this.$invoices_container.html("");
 
 		return frappe.call({
 			method: "erpnext.selling.page.point_of_sale.point_of_sale.get_past_order_list",
@@ -87,18 +87,19 @@
 			args: { search_term, status },
 			callback: (response) => {
 				frappe.dom.unfreeze();
-				response.message.forEach(invoice => {
+				response.message.forEach((invoice) => {
 					const invoice_html = this.get_invoice_html(invoice);
 					this.$invoices_container.append(invoice_html);
 				});
-			}
+			},
 		});
 	}
 
 	get_invoice_html(invoice) {
-		const posting_datetime = moment(invoice.posting_date+" "+invoice.posting_time).format("Do MMMM, h:mma");
-		return (
-			`<div class="invoice-wrapper" data-invoice-name="${escape(invoice.name)}">
+		const posting_datetime = moment(invoice.posting_date + " " + invoice.posting_time).format(
+			"Do MMMM, h:mma"
+		);
+		return `<div class="invoice-wrapper" data-invoice-name="${escape(invoice.name)}">
 				<div class="invoice-name-date">
 					<div class="invoice-name">${invoice.name}</div>
 					<div class="invoice-date">
@@ -113,11 +114,12 @@
 					<div class="invoice-date">${posting_datetime}</div>
 				</div>
 			</div>
-			<div class="seperator"></div>`
-		);
+			<div class="seperator"></div>`;
 	}
 
 	toggle_component(show) {
-		show ? this.$component.css('display', 'flex') && this.refresh_list() : this.$component.css('display', 'none');
+		show
+			? this.$component.css("display", "flex") && this.refresh_list()
+			: this.$component.css("display", "none");
 	}
 };
diff --git a/erpnext/selling/page/point_of_sale/pos_past_order_summary.js b/erpnext/selling/page/point_of_sale/pos_past_order_summary.js
index d341d23..448dbca 100644
--- a/erpnext/selling/page/point_of_sale/pos_past_order_summary.js
+++ b/erpnext/selling/page/point_of_sale/pos_past_order_summary.js
@@ -17,16 +17,16 @@
 		this.wrapper.append(
 			`<section class="past-order-summary">
 				<div class="no-summary-placeholder">
-					${__('Select an invoice to load summary data')}
+					${__("Select an invoice to load summary data")}
 				</div>
 				<div class="invoice-summary-wrapper">
 					<div class="abs-container">
 						<div class="upper-section"></div>
-						<div class="label">${__('Items')}</div>
+						<div class="label">${__("Items")}</div>
 						<div class="items-container summary-container"></div>
-						<div class="label">${__('Totals')}</div>
+						<div class="label">${__("Totals")}</div>
 						<div class="totals-container summary-container"></div>
-						<div class="label">${__('Payments')}</div>
+						<div class="label">${__("Payments")}</div>
 						<div class="payments-container summary-container"></div>
 						<div class="summary-btns"></div>
 					</div>
@@ -34,55 +34,53 @@
 			</section>`
 		);
 
-		this.$component = this.wrapper.find('.past-order-summary');
-		this.$summary_wrapper = this.$component.find('.invoice-summary-wrapper');
-		this.$summary_container = this.$component.find('.abs-container');
-		this.$upper_section = this.$summary_container.find('.upper-section');
-		this.$items_container = this.$summary_container.find('.items-container');
-		this.$totals_container = this.$summary_container.find('.totals-container');
-		this.$payment_container = this.$summary_container.find('.payments-container');
-		this.$summary_btns = this.$summary_container.find('.summary-btns');
+		this.$component = this.wrapper.find(".past-order-summary");
+		this.$summary_wrapper = this.$component.find(".invoice-summary-wrapper");
+		this.$summary_container = this.$component.find(".abs-container");
+		this.$upper_section = this.$summary_container.find(".upper-section");
+		this.$items_container = this.$summary_container.find(".items-container");
+		this.$totals_container = this.$summary_container.find(".totals-container");
+		this.$payment_container = this.$summary_container.find(".payments-container");
+		this.$summary_btns = this.$summary_container.find(".summary-btns");
 	}
 
 	init_email_print_dialog() {
 		const email_dialog = new frappe.ui.Dialog({
-			title: 'Email Receipt',
+			title: "Email Receipt",
 			fields: [
-				{fieldname: 'email_id', fieldtype: 'Data', options: 'Email', label: 'Email ID', reqd: 1},
-				{fieldname:'content', fieldtype:'Small Text', label:'Message (if any)'}
+				{ fieldname: "email_id", fieldtype: "Data", options: "Email", label: "Email ID", reqd: 1 },
+				{ fieldname: "content", fieldtype: "Small Text", label: "Message (if any)" },
 			],
 			primary_action: () => {
 				this.send_email();
 			},
-			primary_action_label: __('Send'),
+			primary_action_label: __("Send"),
 		});
 		this.email_dialog = email_dialog;
 
 		const print_dialog = new frappe.ui.Dialog({
-			title: 'Print Receipt',
-			fields: [
-				{fieldname: 'print', fieldtype: 'Data', label: 'Print Preview'}
-			],
+			title: "Print Receipt",
+			fields: [{ fieldname: "print", fieldtype: "Data", label: "Print Preview" }],
 			primary_action: () => {
 				this.print_receipt();
 			},
-			primary_action_label: __('Print'),
+			primary_action_label: __("Print"),
 		});
 		this.print_dialog = print_dialog;
 	}
 
 	get_upper_section_html(doc) {
 		const { status } = doc;
-		let indicator_color = '';
+		let indicator_color = "";
 
-		in_list(['Paid', 'Consolidated'], status) && (indicator_color = 'green');
-		status === 'Draft' && (indicator_color = 'red');
-		status === 'Return' && (indicator_color = 'grey');
+		in_list(["Paid", "Consolidated"], status) && (indicator_color = "green");
+		status === "Draft" && (indicator_color = "red");
+		status === "Return" && (indicator_color = "grey");
 
 		return `<div class="left-section">
 					<div class="customer-name">${doc.customer}</div>
 					<div class="customer-email">${this.customer_email}</div>
-					<div class="cashier">${__('Sold by')}: ${doc.owner}</div>
+					<div class="cashier">${__("Sold by")}: ${doc.owner}</div>
 				</div>
 				<div class="right-section">
 					<div class="paid-amount">${format_currency(doc.paid_amount, doc.currency)}</div>
@@ -103,7 +101,10 @@
 				return `<span class="item-disc">(${item_data.discount_percentage}% off)</span>
 						<div class="item-rate">${format_currency(item_data.rate, doc.currency)}</div>`;
 			} else {
-				return `<div class="item-rate">${format_currency(item_data.price_list_rate || item_data.rate, doc.currency)}</div>`;
+				return `<div class="item-rate">${format_currency(
+					item_data.price_list_rate || item_data.rate,
+					doc.currency
+				)}</div>`;
 			}
 		}
 	}
@@ -121,31 +122,37 @@
 
 	get_net_total_html(doc) {
 		return `<div class="summary-row-wrapper">
-					<div>${__('Net Total')}</div>
+					<div>${__("Net Total")}</div>
 					<div>${format_currency(doc.net_total, doc.currency)}</div>
 				</div>`;
 	}
 
 	get_taxes_html(doc) {
-		if (!doc.taxes.length) return '';
+		if (!doc.taxes.length) return "";
 
-		let taxes_html = doc.taxes.map(t => {
-			// if tax rate is 0, don't print it.
-			const description = /[0-9]+/.test(t.description) ? t.description : ((t.rate != 0) ? `${t.description} @ ${t.rate}%`: t.description);
-			return `
+		let taxes_html = doc.taxes
+			.map((t) => {
+				// if tax rate is 0, don't print it.
+				const description = /[0-9]+/.test(t.description)
+					? t.description
+					: t.rate != 0
+					? `${t.description} @ ${t.rate}%`
+					: t.description;
+				return `
 				<div class="tax-row">
 					<div class="tax-label">${description}</div>
 					<div class="tax-value">${format_currency(t.tax_amount_after_discount_amount, doc.currency)}</div>
 				</div>
 			`;
-		}).join('');
+			})
+			.join("");
 
 		return `<div class="taxes-wrapper">${taxes_html}</div>`;
 	}
 
 	get_grand_total_html(doc) {
 		return `<div class="summary-row-wrapper grand-total">
-					<div>${__('Grand Total')}</div>
+					<div>${__("Grand Total")}</div>
 					<div>${format_currency(doc.grand_total, doc.currency)}</div>
 				</div>`;
 	}
@@ -158,26 +165,26 @@
 	}
 
 	bind_events() {
-		this.$summary_container.on('click', '.return-btn', () => {
+		this.$summary_container.on("click", ".return-btn", () => {
 			this.events.process_return(this.doc.name);
 			this.toggle_component(false);
-			this.$component.find('.no-summary-placeholder').css('display', 'flex');
-			this.$summary_wrapper.css('display', 'none');
+			this.$component.find(".no-summary-placeholder").css("display", "flex");
+			this.$summary_wrapper.css("display", "none");
 		});
 
-		this.$summary_container.on('click', '.edit-btn', () => {
+		this.$summary_container.on("click", ".edit-btn", () => {
 			this.events.edit_order(this.doc.name);
 			this.toggle_component(false);
-			this.$component.find('.no-summary-placeholder').css('display', 'flex');
-			this.$summary_wrapper.css('display', 'none');
+			this.$component.find(".no-summary-placeholder").css("display", "flex");
+			this.$summary_wrapper.css("display", "none");
 		});
 
-		this.$summary_container.on('click', '.delete-btn', () => {
+		this.$summary_container.on("click", ".delete-btn", () => {
 			this.events.delete_order(this.doc.name);
 			this.show_summary_placeholder();
 		});
 
-		this.$summary_container.on('click', '.delete-btn', () => {
+		this.$summary_container.on("click", ".delete-btn", () => {
 			this.events.delete_order(this.doc.name);
 			this.show_summary_placeholder();
 			// this.toggle_component(false);
@@ -185,19 +192,19 @@
 			// this.$summary_wrapper.addClass('d-none');
 		});
 
-		this.$summary_container.on('click', '.new-btn', () => {
+		this.$summary_container.on("click", ".new-btn", () => {
 			this.events.new_order();
 			this.toggle_component(false);
-			this.$component.find('.no-summary-placeholder').css('display', 'flex');
-			this.$summary_wrapper.css('display', 'none');
+			this.$component.find(".no-summary-placeholder").css("display", "flex");
+			this.$summary_wrapper.css("display", "none");
 		});
 
-		this.$summary_container.on('click', '.email-btn', () => {
+		this.$summary_container.on("click", ".email-btn", () => {
 			this.email_dialog.fields_dict.email_id.set_value(this.customer_email);
 			this.email_dialog.show();
 		});
 
-		this.$summary_container.on('click', '.print-btn', () => {
+		this.$summary_container.on("click", ".print-btn", () => {
 			this.print_receipt();
 		});
 	}
@@ -214,29 +221,31 @@
 	}
 
 	attach_shortcuts() {
-		const ctrl_label = frappe.utils.is_mac() ? '⌘' : 'Ctrl';
-		this.$summary_container.find('.print-btn').attr("title", `${ctrl_label}+P`);
+		const ctrl_label = frappe.utils.is_mac() ? "⌘" : "Ctrl";
+		this.$summary_container.find(".print-btn").attr("title", `${ctrl_label}+P`);
 		frappe.ui.keys.add_shortcut({
 			shortcut: "ctrl+p",
-			action: () => this.$summary_container.find('.print-btn').click(),
-			condition: () => this.$component.is(':visible') && this.$summary_container.find('.print-btn').is(":visible"),
+			action: () => this.$summary_container.find(".print-btn").click(),
+			condition: () =>
+				this.$component.is(":visible") && this.$summary_container.find(".print-btn").is(":visible"),
 			description: __("Print Receipt"),
-			page: cur_page.page.page
+			page: cur_page.page.page,
 		});
-		this.$summary_container.find('.new-btn').attr("title", `${ctrl_label}+Enter`);
+		this.$summary_container.find(".new-btn").attr("title", `${ctrl_label}+Enter`);
 		frappe.ui.keys.on("ctrl+enter", () => {
 			const summary_is_visible = this.$component.is(":visible");
-			if (summary_is_visible && this.$summary_container.find('.new-btn').is(":visible")) {
-				this.$summary_container.find('.new-btn').click();
+			if (summary_is_visible && this.$summary_container.find(".new-btn").is(":visible")) {
+				this.$summary_container.find(".new-btn").click();
 			}
 		});
-		this.$summary_container.find('.edit-btn').attr("title", `${ctrl_label}+E`);
+		this.$summary_container.find(".edit-btn").attr("title", `${ctrl_label}+E`);
 		frappe.ui.keys.add_shortcut({
 			shortcut: "ctrl+e",
-			action: () => this.$summary_container.find('.edit-btn').click(),
-			condition: () => this.$component.is(':visible') && this.$summary_container.find('.edit-btn').is(":visible"),
+			action: () => this.$summary_container.find(".edit-btn").click(),
+			condition: () =>
+				this.$component.is(":visible") && this.$summary_container.find(".edit-btn").is(":visible"),
 			description: __("Edit Receipt"),
-			page: cur_page.page.page
+			page: cur_page.page.page,
 		});
 	}
 
@@ -251,43 +260,44 @@
 			method: "frappe.core.doctype.communication.email.make",
 			args: {
 				recipients: recipients,
-				subject: __(frm.meta.name) + ': ' + doc.name,
-				content: content ? content : __(frm.meta.name) + ': ' + doc.name,
+				subject: __(frm.meta.name) + ": " + doc.name,
+				content: content ? content : __(frm.meta.name) + ": " + doc.name,
 				doctype: doc.doctype,
 				name: doc.name,
 				send_email: 1,
 				print_format,
 				sender_full_name: frappe.user.full_name(),
-				_lang: doc.language
+				_lang: doc.language,
 			},
-			callback: r => {
+			callback: (r) => {
 				if (!r.exc) {
 					frappe.utils.play_sound("email");
 					if (r.message["emails_not_sent_to"]) {
-						frappe.msgprint(__(
-							"Email not sent to {0} (unsubscribed / disabled)",
-							[ frappe.utils.escape_html(r.message["emails_not_sent_to"]) ]
-						));
+						frappe.msgprint(
+							__("Email not sent to {0} (unsubscribed / disabled)", [
+								frappe.utils.escape_html(r.message["emails_not_sent_to"]),
+							])
+						);
 					} else {
 						frappe.show_alert({
-							message: __('Email sent successfully.'),
-							indicator: 'green'
+							message: __("Email sent successfully."),
+							indicator: "green",
 						});
 					}
 					this.email_dialog.hide();
 				} else {
 					frappe.msgprint(__("There were errors while sending email. Please try again."));
 				}
-			}
+			},
 		});
 	}
 
 	add_summary_btns(map) {
-		this.$summary_btns.html('');
-		map.forEach(m => {
+		this.$summary_btns.html("");
+		map.forEach((m) => {
 			if (m.condition) {
-				m.visible_btns.forEach(b => {
-					const class_name = b.split(' ')[0].toLowerCase();
+				m.visible_btns.forEach((b) => {
+					const class_name = b.split(" ")[0].toLowerCase();
 					const btn = __(b);
 					this.$summary_btns.append(
 						`<div class="summary-btn btn btn-default ${class_name}-btn">${btn}</div>`
@@ -295,34 +305,40 @@
 				});
 			}
 		});
-		this.$summary_btns.children().last().removeClass('mr-4');
+		this.$summary_btns.children().last().removeClass("mr-4");
 	}
 
 	toggle_summary_placeholder(show) {
 		if (show) {
-			this.$summary_wrapper.css('display', 'none');
-			this.$component.find('.no-summary-placeholder').css('display', 'flex');
+			this.$summary_wrapper.css("display", "none");
+			this.$component.find(".no-summary-placeholder").css("display", "flex");
 		} else {
-			this.$summary_wrapper.css('display', 'flex');
-			this.$component.find('.no-summary-placeholder').css('display', 'none');
+			this.$summary_wrapper.css("display", "flex");
+			this.$component.find(".no-summary-placeholder").css("display", "none");
 		}
 	}
 
 	get_condition_btn_map(after_submission) {
 		if (after_submission)
-			return [{ condition: true, visible_btns: ['Print Receipt', 'Email Receipt', 'New Order'] }];
+			return [{ condition: true, visible_btns: ["Print Receipt", "Email Receipt", "New Order"] }];
 
 		return [
-			{ condition: this.doc.docstatus === 0, visible_btns: ['Edit Order', 'Delete Order'] },
-			{ condition: !this.doc.is_return && this.doc.docstatus === 1, visible_btns: ['Print Receipt', 'Email Receipt', 'Return']},
-			{ condition: this.doc.is_return && this.doc.docstatus === 1, visible_btns: ['Print Receipt', 'Email Receipt']}
+			{ condition: this.doc.docstatus === 0, visible_btns: ["Edit Order", "Delete Order"] },
+			{
+				condition: !this.doc.is_return && this.doc.docstatus === 1,
+				visible_btns: ["Print Receipt", "Email Receipt", "Return"],
+			},
+			{
+				condition: this.doc.is_return && this.doc.docstatus === 1,
+				visible_btns: ["Print Receipt", "Email Receipt"],
+			},
 		];
 	}
 
-	load_summary_of(doc, after_submission=false) {
-		after_submission ?
-			this.$component.css('grid-column', 'span 10 / span 10') :
-			this.$component.css('grid-column', 'span 6 / span 6');
+	load_summary_of(doc, after_submission = false) {
+		after_submission
+			? this.$component.css("grid-column", "span 10 / span 10")
+			: this.$component.css("grid-column", "span 6 / span 6");
 
 		this.toggle_summary_placeholder(false);
 
@@ -342,16 +358,16 @@
 	}
 
 	attach_document_info(doc) {
-		frappe.db.get_value('Customer', this.doc.customer, 'email_id').then(({ message }) => {
-			this.customer_email = message.email_id || '';
+		frappe.db.get_value("Customer", this.doc.customer, "email_id").then(({ message }) => {
+			this.customer_email = message.email_id || "";
 			const upper_section_dom = this.get_upper_section_html(doc);
 			this.$upper_section.html(upper_section_dom);
 		});
 	}
 
 	attach_items_info(doc) {
-		this.$items_container.html('');
-		doc.items.forEach(item => {
+		this.$items_container.html("");
+		doc.items.forEach((item) => {
 			const item_dom = this.get_item_html(doc, item);
 			this.$items_container.append(item_dom);
 			this.set_dynamic_rate_header_width();
@@ -362,8 +378,7 @@
 		const rate_cols = Array.from(this.$items_container.find(".item-rate-disc"));
 		this.$items_container.find(".item-rate-disc").css("width", "");
 		let max_width = rate_cols.reduce((max_width, elm) => {
-			if ($(elm).width() > max_width)
-				max_width = $(elm).width();
+			if ($(elm).width() > max_width) max_width = $(elm).width();
 			return max_width;
 		}, 0);
 
@@ -374,8 +389,8 @@
 	}
 
 	attach_payments_info(doc) {
-		this.$payment_container.html('');
-		doc.payments.forEach(p => {
+		this.$payment_container.html("");
+		doc.payments.forEach((p) => {
 			if (p.amount) {
 				const payment_dom = this.get_payment_html(doc, p);
 				this.$payment_container.append(payment_dom);
@@ -383,7 +398,7 @@
 		});
 		if (doc.redeem_loyalty_points && doc.loyalty_amount) {
 			const payment_dom = this.get_payment_html(doc, {
-				mode_of_payment: 'Loyalty Points',
+				mode_of_payment: "Loyalty Points",
 				amount: doc.loyalty_amount,
 			});
 			this.$payment_container.append(payment_dom);
@@ -391,7 +406,7 @@
 	}
 
 	attach_totals_info(doc) {
-		this.$totals_container.html('');
+		this.$totals_container.html("");
 
 		const net_total_dom = this.get_net_total_html(doc);
 		const taxes_dom = this.get_taxes_html(doc);
@@ -404,6 +419,6 @@
 	}
 
 	toggle_component(show) {
-		show ? this.$component.css('display', 'flex') : this.$component.css('display', 'none');
+		show ? this.$component.css("display", "flex") : this.$component.css("display", "none");
 	}
 };
diff --git a/erpnext/selling/page/point_of_sale/pos_payment.js b/erpnext/selling/page/point_of_sale/pos_payment.js
index 588b698..cadbfa7 100644
--- a/erpnext/selling/page/point_of_sale/pos_payment.js
+++ b/erpnext/selling/page/point_of_sale/pos_payment.js
@@ -12,17 +12,16 @@
 		this.initialize_numpad();
 		this.bind_events();
 		this.attach_shortcuts();
-
 	}
 
 	prepare_dom() {
 		this.wrapper.append(
 			`<section class="payment-container">
-				<div class="section-label payment-section">${__('Payment Method')}</div>
+				<div class="section-label payment-section">${__("Payment Method")}</div>
 				<div class="payment-modes"></div>
 				<div class="fields-numpad-container">
 					<div class="fields-section">
-						<div class="section-label">${__('Additional Information')}</div>
+						<div class="section-label">${__("Additional Information")}</div>
 						<div class="invoice-fields"></div>
 					</div>
 					<div class="number-pad"></div>
@@ -33,12 +32,12 @@
 				<div class="submit-order-btn">${__("Complete Order")}</div>
 			</section>`
 		);
-		this.$component = this.wrapper.find('.payment-container');
-		this.$payment_modes = this.$component.find('.payment-modes');
-		this.$totals_section = this.$component.find('.totals-section');
-		this.$totals = this.$component.find('.totals');
-		this.$numpad = this.$component.find('.number-pad');
-		this.$invoice_fields_section = this.$component.find('.fields-section');
+		this.$component = this.wrapper.find(".payment-container");
+		this.$payment_modes = this.$component.find(".payment-modes");
+		this.$totals_section = this.$component.find(".totals-section");
+		this.$totals = this.$component.find(".totals");
+		this.$numpad = this.$component.find(".number-pad");
+		this.$invoice_fields_section = this.$component.find(".fields-section");
 	}
 
 	make_invoice_fields_control() {
@@ -46,33 +45,33 @@
 			const fields = doc.invoice_fields;
 			if (!fields.length) return;
 
-			this.$invoice_fields = this.$invoice_fields_section.find('.invoice-fields');
-			this.$invoice_fields.html('');
+			this.$invoice_fields = this.$invoice_fields_section.find(".invoice-fields");
+			this.$invoice_fields.html("");
 			const frm = this.events.get_frm();
 
-			fields.forEach(df => {
+			fields.forEach((df) => {
 				this.$invoice_fields.append(
 					`<div class="invoice_detail_field ${df.fieldname}-field" data-fieldname="${df.fieldname}"></div>`
 				);
 				let df_events = {
-					onchange: function() {
+					onchange: function () {
 						frm.set_value(this.df.fieldname, this.get_value());
-					}
+					},
 				};
 				if (df.fieldtype == "Button") {
 					df_events = {
-						click: function() {
+						click: function () {
 							if (frm.script_manager.has_handlers(df.fieldname, frm.doc.doctype)) {
 								frm.script_manager.trigger(df.fieldname, frm.doc.doctype, frm.doc.docname);
 							}
-						}
+						},
 					};
 				}
 
 				this[`${df.fieldname}_field`] = frappe.ui.form.make_control({
 					df: {
 						...df,
-						...df_events
+						...df_events,
 					},
 					parent: this.$invoice_fields.find(`.${df.fieldname}-field`),
 					render_input: true,
@@ -87,34 +86,35 @@
 		this.number_pad = new erpnext.PointOfSale.NumberPad({
 			wrapper: this.$numpad,
 			events: {
-				numpad_event: function($btn) {
+				numpad_event: function ($btn) {
 					me.on_numpad_clicked($btn);
-				}
+				},
 			},
 			cols: 3,
 			keys: [
-				[ 1, 2, 3 ],
-				[ 4, 5, 6 ],
-				[ 7, 8, 9 ],
-				[ '.', 0, 'Delete' ]
+				[1, 2, 3],
+				[4, 5, 6],
+				[7, 8, 9],
+				[".", 0, "Delete"],
 			],
 		});
 
-		this.numpad_value = '';
+		this.numpad_value = "";
 	}
 
 	on_numpad_clicked($btn) {
-		const button_value = $btn.attr('data-button-value');
+		const button_value = $btn.attr("data-button-value");
 
 		highlight_numpad_btn($btn);
-		this.numpad_value = button_value === 'delete' ? this.numpad_value.slice(0, -1) : this.numpad_value + button_value;
+		this.numpad_value =
+			button_value === "delete" ? this.numpad_value.slice(0, -1) : this.numpad_value + button_value;
 		this.selected_mode.$input.get(0).focus();
 		this.selected_mode.set_value(this.numpad_value);
 
 		function highlight_numpad_btn($btn) {
-			$btn.addClass('shadow-base-inner bg-selected');
+			$btn.addClass("shadow-base-inner bg-selected");
 			setTimeout(() => {
-				$btn.removeClass('shadow-base-inner bg-selected');
+				$btn.removeClass("shadow-base-inner bg-selected");
 			}, 100);
 		}
 	}
@@ -122,36 +122,37 @@
 	bind_events() {
 		const me = this;
 
-		this.$payment_modes.on('click', '.mode-of-payment', function(e) {
+		this.$payment_modes.on("click", ".mode-of-payment", function (e) {
 			const mode_clicked = $(this);
 			// if clicked element doesn't have .mode-of-payment class then return
 			if (!$(e.target).is(mode_clicked)) return;
 
-			const scrollLeft = mode_clicked.offset().left - me.$payment_modes.offset().left + me.$payment_modes.scrollLeft();
+			const scrollLeft =
+				mode_clicked.offset().left - me.$payment_modes.offset().left + me.$payment_modes.scrollLeft();
 			me.$payment_modes.animate({ scrollLeft });
 
-			const mode = mode_clicked.attr('data-mode');
+			const mode = mode_clicked.attr("data-mode");
 
 			// hide all control fields and shortcuts
-			$(`.mode-of-payment-control`).css('display', 'none');
-			$(`.cash-shortcuts`).css('display', 'none');
-			me.$payment_modes.find(`.pay-amount`).css('display', 'inline');
-			me.$payment_modes.find(`.loyalty-amount-name`).css('display', 'none');
+			$(`.mode-of-payment-control`).css("display", "none");
+			$(`.cash-shortcuts`).css("display", "none");
+			me.$payment_modes.find(`.pay-amount`).css("display", "inline");
+			me.$payment_modes.find(`.loyalty-amount-name`).css("display", "none");
 
 			// remove highlight from all mode-of-payments
-			$('.mode-of-payment').removeClass('border-primary');
+			$(".mode-of-payment").removeClass("border-primary");
 
-			if (mode_clicked.hasClass('border-primary')) {
+			if (mode_clicked.hasClass("border-primary")) {
 				// clicked one is selected then unselect it
-				mode_clicked.removeClass('border-primary');
-				me.selected_mode = '';
+				mode_clicked.removeClass("border-primary");
+				me.selected_mode = "";
 			} else {
 				// clicked one is not selected then select it
-				mode_clicked.addClass('border-primary');
-				mode_clicked.find('.mode-of-payment-control').css('display', 'flex');
-				mode_clicked.find('.cash-shortcuts').css('display', 'grid');
-				me.$payment_modes.find(`.${mode}-amount`).css('display', 'none');
-				me.$payment_modes.find(`.${mode}-name`).css('display', 'inline');
+				mode_clicked.addClass("border-primary");
+				mode_clicked.find(".mode-of-payment-control").css("display", "flex");
+				mode_clicked.find(".cash-shortcuts").css("display", "grid");
+				me.$payment_modes.find(`.${mode}-amount`).css("display", "none");
+				me.$payment_modes.find(`.${mode}-name`).css("display", "inline");
 
 				me.selected_mode = me[`${mode}_control`];
 				me.selected_mode && me.selected_mode.$input.get(0).focus();
@@ -159,33 +160,33 @@
 			}
 		});
 
-		frappe.ui.form.on('POS Invoice', 'contact_mobile', (frm) => {
+		frappe.ui.form.on("POS Invoice", "contact_mobile", (frm) => {
 			const contact = frm.doc.contact_mobile;
 			const request_button = $(this.request_for_payment_field?.$input[0]);
 			if (contact) {
-				request_button.removeClass('btn-default').addClass('btn-primary');
+				request_button.removeClass("btn-default").addClass("btn-primary");
 			} else {
-				request_button.removeClass('btn-primary').addClass('btn-default');
+				request_button.removeClass("btn-primary").addClass("btn-default");
 			}
 		});
 
-		frappe.ui.form.on('POS Invoice', 'coupon_code', (frm) => {
+		frappe.ui.form.on("POS Invoice", "coupon_code", (frm) => {
 			if (frm.doc.coupon_code && !frm.applying_pos_coupon_code) {
 				if (!frm.doc.ignore_pricing_rule) {
 					frm.applying_pos_coupon_code = true;
 					frappe.run_serially([
-						() => frm.doc.ignore_pricing_rule=1,
-						() => frm.trigger('ignore_pricing_rule'),
-						() => frm.doc.ignore_pricing_rule=0,
-						() => frm.trigger('apply_pricing_rule'),
+						() => (frm.doc.ignore_pricing_rule = 1),
+						() => frm.trigger("ignore_pricing_rule"),
+						() => (frm.doc.ignore_pricing_rule = 0),
+						() => frm.trigger("apply_pricing_rule"),
 						() => frm.save(),
 						() => this.update_totals_section(frm.doc),
-						() => (frm.applying_pos_coupon_code = false)
+						() => (frm.applying_pos_coupon_code = false),
 					]);
 				} else if (frm.doc.ignore_pricing_rule) {
 					frappe.show_alert({
 						message: __("Ignore Pricing Rule is enabled. Cannot apply coupon code."),
-						indicator: "orange"
+						indicator: "orange",
 					});
 				}
 			}
@@ -193,18 +194,20 @@
 
 		this.setup_listener_for_payments();
 
-		this.$payment_modes.on('click', '.shortcut', function() {
-			const value = $(this).attr('data-value');
+		this.$payment_modes.on("click", ".shortcut", function () {
+			const value = $(this).attr("data-value");
 			me.selected_mode.set_value(value);
 		});
 
-		this.$component.on('click', '.submit-order-btn', () => {
+		this.$component.on("click", ".submit-order-btn", () => {
 			const doc = this.events.get_frm().doc;
 			const paid_amount = doc.paid_amount;
 			const items = doc.items;
 
 			if (!items.length || (paid_amount == 0 && doc.additional_discount_percentage != 100)) {
-				const message = items.length ? __("You cannot submit the order without payment.") : __("You cannot submit empty order.");
+				const message = items.length
+					? __("You cannot submit the order without payment.")
+					: __("You cannot submit empty order.");
 				frappe.show_alert({ message, indicator: "orange" });
 				frappe.utils.play_sound("error");
 				return;
@@ -213,17 +216,18 @@
 			this.events.submit_invoice();
 		});
 
-		frappe.ui.form.on('POS Invoice', 'paid_amount', (frm) => {
+		frappe.ui.form.on("POS Invoice", "paid_amount", (frm) => {
 			this.update_totals_section(frm.doc);
 
 			// need to re calculate cash shortcuts after discount is applied
-			const is_cash_shortcuts_invisible = !this.$payment_modes.find('.cash-shortcuts').is(':visible');
+			const is_cash_shortcuts_invisible = !this.$payment_modes.find(".cash-shortcuts").is(":visible");
 			this.attach_cash_shortcuts(frm.doc);
-			!is_cash_shortcuts_invisible && this.$payment_modes.find('.cash-shortcuts').css('display', 'grid');
+			!is_cash_shortcuts_invisible &&
+				this.$payment_modes.find(".cash-shortcuts").css("display", "grid");
 			this.render_payment_mode_dom();
 		});
 
-		frappe.ui.form.on('POS Invoice', 'loyalty_amount', (frm) => {
+		frappe.ui.form.on("POS Invoice", "loyalty_amount", (frm) => {
 			const formatted_currency = format_currency(frm.doc.loyalty_amount, frm.doc.currency);
 			this.$payment_modes.find(`.loyalty-amount-amount`).html(formatted_currency);
 		});
@@ -246,28 +250,36 @@
 
 			if (success) {
 				title = __("Payment Received");
-				const grand_total = cint(frappe.sys_defaults.disable_rounded_total) ? doc.grand_total : doc.rounded_total;
+				const grand_total = cint(frappe.sys_defaults.disable_rounded_total)
+					? doc.grand_total
+					: doc.rounded_total;
 				if (amount >= grand_total) {
 					frappe.dom.unfreeze();
-					message = __("Payment of {0} received successfully.", [format_currency(amount, doc.currency, 0)]);
+					message = __("Payment of {0} received successfully.", [
+						format_currency(amount, doc.currency, 0),
+					]);
 					this.events.submit_invoice();
 					cur_frm.reload_doc();
-
 				} else {
-					message = __("Payment of {0} received successfully. Waiting for other requests to complete...", [format_currency(amount, doc.currency, 0)]);
+					message = __(
+						"Payment of {0} received successfully. Waiting for other requests to complete...",
+						[format_currency(amount, doc.currency, 0)]
+					);
 				}
 			} else if (failure_message) {
 				message = failure_message;
 				title = __("Payment Failed");
 			}
 
-			frappe.msgprint({ "message": message, "title": title });
+			frappe.msgprint({ message: message, title: title });
 		});
 	}
 
 	auto_set_remaining_amount() {
 		const doc = this.events.get_frm().doc;
-		const grand_total = cint(frappe.sys_defaults.disable_rounded_total) ? doc.grand_total : doc.rounded_total;
+		const grand_total = cint(frappe.sys_defaults.disable_rounded_total)
+			? doc.grand_total
+			: doc.rounded_total;
 		const remaining_amount = grand_total - doc.paid_amount;
 		const current_value = this.selected_mode ? this.selected_mode.get_value() : undefined;
 		if (!current_value && remaining_amount > 0 && this.selected_mode) {
@@ -276,13 +288,13 @@
 	}
 
 	attach_shortcuts() {
-		const ctrl_label = frappe.utils.is_mac() ? '⌘' : 'Ctrl';
-		this.$component.find('.submit-order-btn').attr("title", `${ctrl_label}+Enter`);
+		const ctrl_label = frappe.utils.is_mac() ? "⌘" : "Ctrl";
+		this.$component.find(".submit-order-btn").attr("title", `${ctrl_label}+Enter`);
 		frappe.ui.keys.on("ctrl+enter", () => {
 			const payment_is_visible = this.$component.is(":visible");
 			const active_mode = this.$payment_modes.find(".border-primary");
 			if (payment_is_visible && active_mode.length) {
-				this.$component.find('.submit-order-btn').click();
+				this.$component.find(".submit-order-btn").click();
 			}
 		});
 
@@ -295,19 +307,24 @@
 
 				if (!active_mode) return;
 
-				const mode_of_payments = Array.from(this.$payment_modes.find(".mode-of-payment")).map(m => $(m).attr("data-mode"));
+				const mode_of_payments = Array.from(this.$payment_modes.find(".mode-of-payment")).map((m) =>
+					$(m).attr("data-mode")
+				);
 				const mode_index = mode_of_payments.indexOf(active_mode);
 				const next_mode_index = (mode_index + 1) % mode_of_payments.length;
-				const next_mode_to_be_clicked = this.$payment_modes.find(`.mode-of-payment[data-mode="${mode_of_payments[next_mode_index]}"]`);
+				const next_mode_to_be_clicked = this.$payment_modes.find(
+					`.mode-of-payment[data-mode="${mode_of_payments[next_mode_index]}"]`
+				);
 
 				if (payment_is_visible && mode_index != next_mode_index) {
 					next_mode_to_be_clicked.click();
 				}
 			},
-			condition: () => this.$component.is(':visible') && this.$payment_modes.find(".border-primary").length,
+			condition: () =>
+				this.$component.is(":visible") && this.$payment_modes.find(".border-primary").length,
 			description: __("Switch Between Payment Modes"),
 			ignore_inputs: true,
-			page: cur_page.page.page
+			page: cur_page.page.page,
 		});
 	}
 
@@ -341,20 +358,20 @@
 	}
 
 	toggle_remarks_control() {
-		if (this.$remarks.find('.frappe-control').length) {
-			this.$remarks.html('+ Add Remark');
+		if (this.$remarks.find(".frappe-control").length) {
+			this.$remarks.html("+ Add Remark");
 		} else {
-			this.$remarks.html('');
+			this.$remarks.html("");
 			this[`remark_control`] = frappe.ui.form.make_control({
 				df: {
-					label: __('Remark'),
-					fieldtype: 'Data',
-					onchange: function() {}
+					label: __("Remark"),
+					fieldtype: "Data",
+					onchange: function () {},
 				},
 				parent: this.$totals_section.find(`.remarks`),
 				render_input: true,
 			});
-			this[`remark_control`].set_value('');
+			this[`remark_control`].set_value("");
 		}
 	}
 
@@ -363,14 +380,15 @@
 		const payments = doc.payments;
 		const currency = doc.currency;
 
-		this.$payment_modes.html(`${
-			payments.map((p, i) => {
-				const mode = p.mode_of_payment.replace(/ +/g, "_").toLowerCase();
-				const payment_type = p.type;
-				const margin = i % 2 === 0 ? 'pr-2' : 'pl-2';
-				const amount = p.amount > 0 ? format_currency(p.amount, currency) : '';
+		this.$payment_modes.html(
+			`${payments
+				.map((p, i) => {
+					const mode = p.mode_of_payment.replace(/ +/g, "_").toLowerCase();
+					const payment_type = p.type;
+					const margin = i % 2 === 0 ? "pr-2" : "pl-2";
+					const amount = p.amount > 0 ? format_currency(p.amount, currency) : "";
 
-				return (`
+					return `
 					<div class="payment-mode-wrapper">
 						<div class="mode-of-payment" data-mode="${mode}" data-payment-type="${payment_type}">
 							${p.mode_of_payment}
@@ -378,29 +396,30 @@
 							<div class="${mode} mode-of-payment-control"></div>
 						</div>
 					</div>
-				`);
-			}).join('')
-		}`);
+				`;
+				})
+				.join("")}`
+		);
 
-		payments.forEach(p => {
+		payments.forEach((p) => {
 			const mode = p.mode_of_payment.replace(/ +/g, "_").toLowerCase();
 			const me = this;
 			this[`${mode}_control`] = frappe.ui.form.make_control({
 				df: {
 					label: p.mode_of_payment,
-					fieldtype: 'Currency',
-					placeholder: __('Enter {0} amount.', [__(p.mode_of_payment)]),
-					onchange: function() {
-						const current_value = frappe.model.get_value(p.doctype, p.name, 'amount');
+					fieldtype: "Currency",
+					placeholder: __("Enter {0} amount.", [__(p.mode_of_payment)]),
+					onchange: function () {
+						const current_value = frappe.model.get_value(p.doctype, p.name, "amount");
 						if (current_value != this.value) {
 							frappe.model
-								.set_value(p.doctype, p.name, 'amount', flt(this.value))
-								.then(() => me.update_totals_section())
+								.set_value(p.doctype, p.name, "amount", flt(this.value))
+								.then(() => me.update_totals_section());
 
 							const formatted_currency = format_currency(this.value, currency);
 							me.$payment_modes.find(`.${mode}-amount`).html(formatted_currency);
 						}
-					}
+					},
 				},
 				parent: this.$payment_modes.find(`.${mode}.mode-of-payment-control`),
 				render_input: true,
@@ -417,7 +436,7 @@
 	focus_on_default_mop() {
 		const doc = this.events.get_frm().doc;
 		const payments = doc.payments;
-		payments.forEach(p => {
+		payments.forEach((p) => {
 			const mode = p.mode_of_payment.replace(/ +/g, "_").toLowerCase();
 			if (p.default) {
 				setTimeout(() => {
@@ -428,17 +447,23 @@
 	}
 
 	attach_cash_shortcuts(doc) {
-		const grand_total = cint(frappe.sys_defaults.disable_rounded_total) ? doc.grand_total : doc.rounded_total;
+		const grand_total = cint(frappe.sys_defaults.disable_rounded_total)
+			? doc.grand_total
+			: doc.rounded_total;
 		const currency = doc.currency;
 
 		const shortcuts = this.get_cash_shortcuts(flt(grand_total));
 
-		this.$payment_modes.find('.cash-shortcuts').remove();
-		let shortcuts_html = shortcuts.map(s => {
-			return `<div class="shortcut" data-value="${s}">${format_currency(s, currency, 0)}</div>`;
-		}).join('');
+		this.$payment_modes.find(".cash-shortcuts").remove();
+		let shortcuts_html = shortcuts
+			.map((s) => {
+				return `<div class="shortcut" data-value="${s}">${format_currency(s, currency, 0)}</div>`;
+			})
+			.join("");
 
-		this.$payment_modes.find('[data-payment-type="Cash"]').find('.mode-of-payment-control')
+		this.$payment_modes
+			.find('[data-payment-type="Cash"]')
+			.find(".mode-of-payment-control")
 			.after(`<div class="cash-shortcuts">${shortcuts_html}</div>`);
 	}
 
@@ -446,10 +471,10 @@
 		let steps = [1, 5, 10];
 		const digits = String(Math.round(grand_total)).length;
 
-		steps = steps.map(x => x * (10 ** (digits - 2)));
+		steps = steps.map((x) => x * 10 ** (digits - 2));
 
 		const get_nearest = (amount, x) => {
-			let nearest_x = Math.ceil((amount / x)) * x;
+			let nearest_x = Math.ceil(amount / x) * x;
 			return nearest_x === amount ? nearest_x + x : nearest_x;
 		};
 
@@ -474,13 +499,16 @@
 			description = __("You don't have enough points to redeem.");
 			read_only = true;
 		} else {
-			max_redeemable_amount = flt(flt(loyalty_points) * flt(conversion_factor), precision("loyalty_amount", doc));
+			max_redeemable_amount = flt(
+				flt(loyalty_points) * flt(conversion_factor),
+				precision("loyalty_amount", doc)
+			);
 			description = __("You can redeem upto {0}.", [format_currency(max_redeemable_amount)]);
 			read_only = false;
 		}
 
-		const margin = this.$payment_modes.children().length % 2 === 0 ? 'pr-2' : 'pl-2';
-		const amount = doc.loyalty_amount > 0 ? format_currency(doc.loyalty_amount, doc.currency) : '';
+		const margin = this.$payment_modes.children().length % 2 === 0 ? "pr-2" : "pl-2";
+		const amount = doc.loyalty_amount > 0 ? format_currency(doc.loyalty_amount, doc.currency) : "";
 		this.$payment_modes.append(
 			`<div class="payment-mode-wrapper">
 				<div class="mode-of-payment loyalty-card" data-mode="loyalty-amount" data-payment-type="loyalty-amount">
@@ -492,35 +520,47 @@
 			</div>`
 		);
 
-		this['loyalty-amount_control'] = frappe.ui.form.make_control({
+		this["loyalty-amount_control"] = frappe.ui.form.make_control({
 			df: {
 				label: __("Redeem Loyalty Points"),
-				fieldtype: 'Currency',
+				fieldtype: "Currency",
 				placeholder: __("Enter amount to be redeemed."),
-				options: 'company:currency',
+				options: "company:currency",
 				read_only,
-				onchange: async function() {
+				onchange: async function () {
 					if (!loyalty_points) return;
 
 					if (this.value > max_redeemable_amount) {
 						frappe.show_alert({
-							message: __("You cannot redeem more than {0}.", [format_currency(max_redeemable_amount)]),
-							indicator: "red"
+							message: __("You cannot redeem more than {0}.", [
+								format_currency(max_redeemable_amount),
+							]),
+							indicator: "red",
 						});
 						frappe.utils.play_sound("submit");
-						me['loyalty-amount_control'].set_value(0);
+						me["loyalty-amount_control"].set_value(0);
 						return;
 					}
 					const redeem_loyalty_points = this.value > 0 ? 1 : 0;
-					await frappe.model.set_value(doc.doctype, doc.name, 'redeem_loyalty_points', redeem_loyalty_points);
-					frappe.model.set_value(doc.doctype, doc.name, 'loyalty_points', parseInt(this.value / conversion_factor));
+					await frappe.model.set_value(
+						doc.doctype,
+						doc.name,
+						"redeem_loyalty_points",
+						redeem_loyalty_points
+					);
+					frappe.model.set_value(
+						doc.doctype,
+						doc.name,
+						"loyalty_points",
+						parseInt(this.value / conversion_factor)
+					);
 				},
-				description
+				description,
 			},
 			parent: this.$payment_modes.find(`.loyalty-amount.mode-of-payment-control`),
 			render_input: true,
 		});
-		this['loyalty-amount_control'].toggle_label(false);
+		this["loyalty-amount_control"].toggle_label(false);
 
 		// this.render_add_payment_method_dom();
 	}
@@ -538,20 +578,22 @@
 	update_totals_section(doc) {
 		if (!doc) doc = this.events.get_frm().doc;
 		const paid_amount = doc.paid_amount;
-		const grand_total = cint(frappe.sys_defaults.disable_rounded_total) ? doc.grand_total : doc.rounded_total;
+		const grand_total = cint(frappe.sys_defaults.disable_rounded_total)
+			? doc.grand_total
+			: doc.rounded_total;
 		const remaining = grand_total - doc.paid_amount;
 		const change = doc.change_amount || remaining <= 0 ? -1 * remaining : undefined;
 		const currency = doc.currency;
-		const label = change ? __('Change') : __('To Be Paid');
+		const label = change ? __("Change") : __("To Be Paid");
 
 		this.$totals.html(
 			`<div class="col">
-				<div class="total-label">${__('Grand Total')}</div>
+				<div class="total-label">${__("Grand Total")}</div>
 				<div class="value">${format_currency(grand_total, currency)}</div>
 			</div>
 			<div class="seperator-y"></div>
 			<div class="col">
-				<div class="total-label">${__('Paid Amount')}</div>
+				<div class="total-label">${__("Paid Amount")}</div>
 				<div class="value">${format_currency(paid_amount, currency)}</div>
 			</div>
 			<div class="seperator-y"></div>
@@ -563,6 +605,6 @@
 	}
 
 	toggle_component(show) {
-		show ? this.$component.css('display', 'flex') : this.$component.css('display', 'none');
+		show ? this.$component.css("display", "flex") : this.$component.css("display", "none");
 	}
 };
diff --git a/erpnext/selling/page/sales_funnel/sales_funnel.js b/erpnext/selling/page/sales_funnel/sales_funnel.js
index a0a1222..1d52597 100644
--- a/erpnext/selling/page/sales_funnel/sales_funnel.js
+++ b/erpnext/selling/page/sales_funnel/sales_funnel.js
@@ -1,23 +1,23 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.pages['sales-funnel'].on_page_load = function(wrapper) {
+frappe.pages["sales-funnel"].on_page_load = function (wrapper) {
 	frappe.ui.make_app_page({
 		parent: wrapper,
-		title: __('Sales Funnel'),
-		single_column: true
+		title: __("Sales Funnel"),
+		single_column: true,
 	});
 
 	wrapper.sales_funnel = new erpnext.SalesFunnel(wrapper);
 
 	frappe.breadcrumbs.add("Selling");
-}
+};
 
 erpnext.SalesFunnel = class SalesFunnel {
 	constructor(wrapper) {
 		var me = this;
 		// 0 setTimeout hack - this gives time for canvas to get width and height
-		setTimeout(function() {
+		setTimeout(function () {
 			me.setup(wrapper);
 			me.get_data();
 		}, 0);
@@ -26,50 +26,65 @@
 	setup(wrapper) {
 		var me = this;
 
-		this.company_field = wrapper.page.add_field({"fieldtype": "Link", "fieldname": "company", "options": "Company",
-			"label": __("Company"), "reqd": 1, "default": frappe.defaults.get_user_default('company'),
-			change: function() {
-				me.company = this.value || frappe.defaults.get_user_default('company');
+		(this.company_field = wrapper.page.add_field({
+			fieldtype: "Link",
+			fieldname: "company",
+			options: "Company",
+			label: __("Company"),
+			reqd: 1,
+			default: frappe.defaults.get_user_default("company"),
+			change: function () {
+				me.company = this.value || frappe.defaults.get_user_default("company");
 				me.get_data();
-			}
-		}),
+			},
+		})),
+			(this.elements = {
+				layout: $(wrapper).find(".layout-main"),
+				from_date: wrapper.page.add_date(__("From Date")),
+				to_date: wrapper.page.add_date(__("To Date")),
+				chart: wrapper.page.add_select(__("Chart"), [
+					{ value: "sales_funnel", label: __("Sales Funnel") },
+					{ value: "sales_pipeline", label: __("Sales Pipeline") },
+					{ value: "opp_by_lead_source", label: __("Opportunities by lead source") },
+				]),
+				refresh_btn: wrapper.page.set_primary_action(
+					__("Refresh"),
+					function () {
+						me.get_data();
+					},
+					"fa fa-refresh"
+				),
+			});
 
-		this.elements = {
-			layout: $(wrapper).find(".layout-main"),
-			from_date: wrapper.page.add_date(__("From Date")),
-			to_date: wrapper.page.add_date(__("To Date")),
-			chart: wrapper.page.add_select(__("Chart"), [{value: 'sales_funnel', label:__("Sales Funnel")},
-				{value: 'sales_pipeline', label:__("Sales Pipeline")},
-				{value: 'opp_by_lead_source', label:__("Opportunities by lead source")}]),
-			refresh_btn: wrapper.page.set_primary_action(__("Refresh"),
-				function() { me.get_data(); }, "fa fa-refresh"),
-		};
-
-		this.elements.no_data = $('<div class="alert alert-warning">' + __("No Data") + '</div>')
+		this.elements.no_data = $('<div class="alert alert-warning">' + __("No Data") + "</div>")
 			.toggle(false)
 			.appendTo(this.elements.layout);
 
-		this.elements.funnel_wrapper = $('<div class="funnel-wrapper text-center"></div>')
-			.appendTo(this.elements.layout);
+		this.elements.funnel_wrapper = $('<div class="funnel-wrapper text-center"></div>').appendTo(
+			this.elements.layout
+		);
 
-		this.company = frappe.defaults.get_user_default('company');
+		this.company = frappe.defaults.get_user_default("company");
 		this.options = {
 			from_date: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
 			to_date: frappe.datetime.get_today(),
-			chart: 'sales_funnel'
+			chart: "sales_funnel",
 		};
 
 		// set defaults and bind on change
-		$.each(this.options, function(k, v) {
-			if (['from_date', 'to_date'].includes(k)) {
+		$.each(this.options, function (k, v) {
+			if (["from_date", "to_date"].includes(k)) {
 				me.elements[k].val(frappe.datetime.str_to_user(v));
 			} else {
 				me.elements[k].val(v);
 			}
 
-			me.elements[k].on("change", function() {
-				if (['from_date', 'to_date'].includes(k)) {
-					me.options[k] = frappe.datetime.user_to_str($(this).val()) != 'Invalid date' ? frappe.datetime.user_to_str($(this).val()) : frappe.datetime.get_today();
+			me.elements[k].on("change", function () {
+				if (["from_date", "to_date"].includes(k)) {
+					me.options[k] =
+						frappe.datetime.user_to_str($(this).val()) != "Invalid date"
+							? frappe.datetime.user_to_str($(this).val())
+							: frappe.datetime.get_today();
 				} else {
 					me.options.chart = $(this).val();
 				}
@@ -78,12 +93,12 @@
 		});
 
 		// bind refresh
-		this.elements.refresh_btn.on("click", function() {
+		this.elements.refresh_btn.on("click", function () {
 			me.get_data(this);
 		});
 
 		// bind resize
-		$(window).resize(function() {
+		$(window).resize(function () {
 			me.render();
 		});
 	}
@@ -95,39 +110,39 @@
 		}
 
 		const method_map = {
-			"sales_funnel": "erpnext.selling.page.sales_funnel.sales_funnel.get_funnel_data",
-			"opp_by_lead_source": "erpnext.selling.page.sales_funnel.sales_funnel.get_opp_by_lead_source",
-			"sales_pipeline": "erpnext.selling.page.sales_funnel.sales_funnel.get_pipeline_data"
+			sales_funnel: "erpnext.selling.page.sales_funnel.sales_funnel.get_funnel_data",
+			opp_by_lead_source: "erpnext.selling.page.sales_funnel.sales_funnel.get_opp_by_lead_source",
+			sales_pipeline: "erpnext.selling.page.sales_funnel.sales_funnel.get_pipeline_data",
 		};
 		frappe.call({
 			method: method_map[this.options.chart],
 			args: {
 				from_date: this.options.from_date,
 				to_date: this.options.to_date,
-				company: this.company
+				company: this.company,
 			},
 			btn: btn,
-			callback: function(r) {
-				if(!r.exc) {
+			callback: function (r) {
+				if (!r.exc) {
 					me.options.data = r.message;
-					if (me.options.data=='empty') {
+					if (me.options.data == "empty") {
 						const $parent = me.elements.funnel_wrapper;
-						$parent.html(__('No data for this period'));
+						$parent.html(__("No data for this period"));
 					} else {
 						me.render();
 					}
 				}
-			}
+			},
 		});
 	}
 
 	render() {
 		let me = this;
-		if (me.options.chart == 'sales_funnel'){
+		if (me.options.chart == "sales_funnel") {
 			me.render_funnel();
-		} else if (me.options.chart == 'opp_by_lead_source'){
+		} else if (me.options.chart == "opp_by_lead_source") {
 			me.render_chart(__("Sales Opportunities by Source"));
-		} else if (me.options.chart == 'sales_pipeline'){
+		} else if (me.options.chart == "sales_pipeline") {
 			me.render_chart(__("Sales Pipeline by Stage"));
 		}
 	}
@@ -143,12 +158,12 @@
 			y = 0,
 			y_old = 0.0;
 
-		if(this.options.total_value === 0) {
+		if (this.options.total_value === 0) {
 			this.elements.no_data.toggle(true);
 			return;
 		}
 
-		this.options.data.forEach(function(d) {
+		this.options.data.forEach(function (d) {
 			context.fillStyle = d.color;
 			context.strokeStyle = d.color;
 			me.draw_triangle(x_start, x_mid, x_end, y, me.options.height);
@@ -175,21 +190,22 @@
 		this.elements.no_data.toggle(false);
 
 		// calculate width and height options
-		this.options.width = $(this.elements.funnel_wrapper).width() * 2.0 / 3.0;
+		this.options.width = ($(this.elements.funnel_wrapper).width() * 2.0) / 3.0;
 		this.options.height = (Math.sqrt(3) * this.options.width) / 2.0;
 
 		// calculate total weightage
 		// as height decreases, area decreases by the square of the reduction
 		// hence, compensating by squaring the index value
-		this.options.total_weightage = this.options.data.reduce(
-			function(prev, curr, i) { return prev + Math.pow(i+1, 2) * curr.value; }, 0.0);
+		this.options.total_weightage = this.options.data.reduce(function (prev, curr, i) {
+			return prev + Math.pow(i + 1, 2) * curr.value;
+		}, 0.0);
 
 		// calculate height for each data
-		$.each(this.options.data, function(i, d) {
-			d.height = me.options.height * d.value * Math.pow(i+1, 2) / me.options.total_weightage;
+		$.each(this.options.data, function (i, d) {
+			d.height = (me.options.height * d.value * Math.pow(i + 1, 2)) / me.options.total_weightage;
 		});
 
-		this.elements.canvas = $('<canvas></canvas>')
+		this.elements.canvas = $("<canvas></canvas>")
 			.appendTo(this.elements.funnel_wrapper.empty())
 			.attr("width", $(this.elements.funnel_wrapper).width())
 			.attr("height", this.options.height);
@@ -211,7 +227,7 @@
 	draw_legend(x_mid, y_mid, width, height, title) {
 		var context = this.elements.context;
 
-		if(y_mid == 0) {
+		if (y_mid == 0) {
 			y_mid = 7;
 		}
 
@@ -246,13 +262,13 @@
 			title: title,
 			height: 400,
 			data: chart_data,
-			type: 'bar',
+			type: "bar",
 			barOptions: {
-				stacked: 1
+				stacked: 1,
 			},
 			tooltipOptions: {
-				formatTooltipY: d => format_currency(d, currency),
-			}
+				formatTooltipY: (d) => format_currency(d, currency),
+			},
 		});
 	}
 };
diff --git a/erpnext/selling/report/address_and_contacts/address_and_contacts.js b/erpnext/selling/report/address_and_contacts/address_and_contacts.js
index f81d1c1..c19ed7d 100644
--- a/erpnext/selling/report/address_and_contacts/address_and_contacts.js
+++ b/erpnext/selling/report/address_and_contacts/address_and_contacts.js
@@ -1,34 +1,33 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Address And Contacts"] = {
-	"filters": [
+	filters: [
 		{
-			"reqd": 1,
-			"fieldname":"party_type",
-			"label": __("Party Type"),
-			"fieldtype": "Link",
-			"options": "DocType",
-			"get_query": function() {
+			reqd: 1,
+			fieldname: "party_type",
+			label: __("Party Type"),
+			fieldtype: "Link",
+			options: "DocType",
+			get_query: function () {
 				return {
-					"filters": {
-						"name": ["in","Customer,Supplier,Sales Partner,Lead"],
-					}
-				}
-			}
+					filters: {
+						name: ["in", "Customer,Supplier,Sales Partner,Lead"],
+					},
+				};
+			},
 		},
 		{
-			"fieldname":"party_name",
-			"label": __("Party Name"),
-			"fieldtype": "Dynamic Link",
-			"get_options": function() {
-				let party_type = frappe.query_report.get_filter_value('party_type');
-				if(!party_type) {
+			fieldname: "party_name",
+			label: __("Party Name"),
+			fieldtype: "Dynamic Link",
+			get_options: function () {
+				let party_type = frappe.query_report.get_filter_value("party_type");
+				if (!party_type) {
 					frappe.throw(__("Please select Party Type first"));
 				}
 				return party_type;
-			}
-		}
-	]
-}
+			},
+		},
+	],
+};
diff --git a/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.js b/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.js
index 1e83acd..a9ee0cb 100644
--- a/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.js
+++ b/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.js
@@ -2,7 +2,5 @@
 // For license information, please see license.txt
 
 frappe.query_reports["Available Stock for Packing Items"] = {
-	"filters": [
-
-	]
-}
+	filters: [],
+};
diff --git a/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.js b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.js
index 744b5d9..745550b 100644
--- a/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.js
+++ b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.js
@@ -2,43 +2,43 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Customer Acquisition and Loyalty"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "view_type",
-			"label": __("View Type"),
-			"fieldtype": "Select",
-			"options": ["Monthly", "Territory Wise"],
-			"default": "Monthly",
-			"reqd": 1
+			fieldname: "view_type",
+			label: __("View Type"),
+			fieldtype: "Select",
+			options: ["Monthly", "Territory Wise"],
+			default: "Monthly",
+			reqd: 1,
 		},
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
-			"reqd": 1
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
+			reqd: 1,
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
-			"reqd": 1
-		}
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
+			reqd: 1,
+		},
 	],
-	'formatter': function(value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 		if (data && data.bold) {
 			value = value.bold();
 		}
 		return value;
-	}
-}
+	},
+};
diff --git a/erpnext/selling/report/customer_credit_balance/customer_credit_balance.js b/erpnext/selling/report/customer_credit_balance/customer_credit_balance.js
index 3a99eb0..9902abe 100644
--- a/erpnext/selling/report/customer_credit_balance/customer_credit_balance.js
+++ b/erpnext/selling/report/customer_credit_balance/customer_credit_balance.js
@@ -2,20 +2,20 @@
 // For license information, please see license.txt
 
 frappe.query_reports["Customer Credit Balance"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"reqd": 1,
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname":"customer",
-			"label": __("Customer"),
-			"fieldtype": "Link",
-			"options": "Customer"
-		}
-	]
-}
+			fieldname: "customer",
+			label: __("Customer"),
+			fieldtype: "Link",
+			options: "Customer",
+		},
+	],
+};
diff --git a/erpnext/selling/report/customer_wise_item_price/customer_wise_item_price.js b/erpnext/selling/report/customer_wise_item_price/customer_wise_item_price.js
index 2aac343..02c7125 100644
--- a/erpnext/selling/report/customer_wise_item_price/customer_wise_item_price.js
+++ b/erpnext/selling/report/customer_wise_item_price/customer_wise_item_price.js
@@ -1,27 +1,26 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Customer-wise Item Price"] = {
-	"filters": [
+	filters: [
 		{
-			"label": __("Customer"),
-			"fieldname": "customer",
-			"fieldtype": "Link",
-			"options": "Customer",
-			"reqd": 1
+			label: __("Customer"),
+			fieldname: "customer",
+			fieldtype: "Link",
+			options: "Customer",
+			reqd: 1,
 		},
 		{
-			"label": __("Item"),
-			"fieldname": "item",
-			"fieldtype": "Link",
-			"options": "Item",
-			"get_query": () => {
+			label: __("Item"),
+			fieldname: "item",
+			fieldtype: "Link",
+			options: "Item",
+			get_query: () => {
 				return {
 					query: "erpnext.controllers.queries.item_query",
-					filters: { 'is_sales_item': 1 }
-				}
-			}
-		}
-	]
-}
+					filters: { is_sales_item: 1 },
+				};
+			},
+		},
+	],
+};
diff --git a/erpnext/selling/report/inactive_customers/inactive_customers.js b/erpnext/selling/report/inactive_customers/inactive_customers.js
index 804d17e..a191d56 100644
--- a/erpnext/selling/report/inactive_customers/inactive_customers.js
+++ b/erpnext/selling/report/inactive_customers/inactive_customers.js
@@ -2,19 +2,19 @@
 // For license information, please see license.txt
 
 frappe.query_reports["Inactive Customers"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"days_since_last_order",
-			"label": __("Days Since Last Order"),
-			"fieldtype": "Int",
-			"default": 60
+			fieldname: "days_since_last_order",
+			label: __("Days Since Last Order"),
+			fieldtype: "Int",
+			default: 60,
 		},
 		{
-			"fieldname":"doctype",
-			"label": __("Doctype"),
-			"fieldtype": "Select",
-			"default": "Sales Order",
-			"options": "Sales Order\nSales Invoice"
-		}
-	]
-}
+			fieldname: "doctype",
+			label: __("Doctype"),
+			fieldtype: "Select",
+			default: "Sales Order",
+			options: "Sales Order\nSales Invoice",
+		},
+	],
+};
diff --git a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.js b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.js
index f63d02e..2b4b8e7 100644
--- a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.js
+++ b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.js
@@ -1,57 +1,56 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Item-wise Sales History"] = {
-	"filters": [
+	filters: [
 		{
-			fieldname:"company",
+			fieldname: "company",
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
 			default: frappe.defaults.get_user_default("Company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"from_date",
+			fieldname: "from_date",
 			reqd: 1,
 			label: __("From Date"),
 			fieldtype: "Date",
 			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			reqd: 1,
 			default: frappe.datetime.get_today(),
 			label: __("To Date"),
 			fieldtype: "Date",
 		},
 		{
-			fieldname:"item_group",
+			fieldname: "item_group",
 			label: __("Item Group"),
 			fieldtype: "Link",
-			options: "Item Group"
+			options: "Item Group",
 		},
 		{
-			fieldname:"item_code",
+			fieldname: "item_code",
 			label: __("Item"),
 			fieldtype: "Link",
 			options: "Item",
 			get_query: () => {
 				return {
-					query: "erpnext.controllers.queries.item_query"
-				}
-			}
+					query: "erpnext.controllers.queries.item_query",
+				};
+			},
 		},
 		{
-			fieldname:"customer",
+			fieldname: "customer",
 			label: __("Customer"),
 			fieldtype: "Link",
-			options: "Customer"
-		}
+			options: "Customer",
+		},
 	],
 
-	"formatter": function (value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 		let format_fields = ["delivered_quantity", "billed_amount"];
 
@@ -59,5 +58,5 @@
 			value = "<span style='color:green;'>" + value + "</span>";
 		}
 		return value;
-	}
+	},
 };
diff --git a/erpnext/selling/report/payment_terms_status_for_sales_order/payment_terms_status_for_sales_order.js b/erpnext/selling/report/payment_terms_status_for_sales_order/payment_terms_status_for_sales_order.js
index 0203a05..99ef5e4 100644
--- a/erpnext/selling/report/payment_terms_status_for_sales_order/payment_terms_status_for_sales_order.js
+++ b/erpnext/selling/report/payment_terms_status_for_sales_order/payment_terms_status_for_sales_order.js
@@ -1,144 +1,138 @@
 // Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 function get_filters() {
 	let filters = [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname":"period_start_date",
-			"label": __("Start Date"),
-			"fieldtype": "Date",
-			"reqd": 1,
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1)
+			fieldname: "period_start_date",
+			label: __("Start Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
 		},
 		{
-			"fieldname":"period_end_date",
-			"label": __("End Date"),
-			"fieldtype": "Date",
-			"reqd": 1,
-			"default": frappe.datetime.get_today()
+			fieldname: "period_end_date",
+			label: __("End Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname":"customer_group",
-			"label": __("Customer Group"),
-			"fieldtype": "Link",
-			"width": 100,
-			"options": "Customer Group",
+			fieldname: "customer_group",
+			label: __("Customer Group"),
+			fieldtype: "Link",
+			width: 100,
+			options: "Customer Group",
 		},
 		{
-			"fieldname":"customer",
-			"label": __("Customer"),
-			"fieldtype": "Link",
-			"width": 100,
-			"options": "Customer",
-			"get_query": () => {
-				var customer_group = frappe.query_report.get_filter_value('customer_group');
-				return{
-					"query": "erpnext.selling.report.payment_terms_status_for_sales_order.payment_terms_status_for_sales_order.get_customers_or_items",
-					"filters": [
-						['Customer', 'disabled', '=', '0'],
-						['Customer Group','name', '=', customer_group]
-					]
-				}
-			}
+			fieldname: "customer",
+			label: __("Customer"),
+			fieldtype: "Link",
+			width: 100,
+			options: "Customer",
+			get_query: () => {
+				var customer_group = frappe.query_report.get_filter_value("customer_group");
+				return {
+					query: "erpnext.selling.report.payment_terms_status_for_sales_order.payment_terms_status_for_sales_order.get_customers_or_items",
+					filters: [
+						["Customer", "disabled", "=", "0"],
+						["Customer Group", "name", "=", customer_group],
+					],
+				};
+			},
 		},
 		{
-			"fieldname":"item_group",
-			"label": __("Item Group"),
-			"fieldtype": "Link",
-			"width": 100,
-			"options": "Item Group",
-
+			fieldname: "item_group",
+			label: __("Item Group"),
+			fieldtype: "Link",
+			width: 100,
+			options: "Item Group",
 		},
 		{
-			"fieldname":"item",
-			"label": __("Item"),
-			"fieldtype": "Link",
-			"width": 100,
-			"options": "Item",
-			"get_query": () => {
-				var item_group = frappe.query_report.get_filter_value('item_group');
-				return{
-					"query": "erpnext.selling.report.payment_terms_status_for_sales_order.payment_terms_status_for_sales_order.get_customers_or_items",
-					"filters": [
-						['Item', 'disabled', '=', '0'],
-						['Item Group','name', '=', item_group]
-					]
-				}
-			}
+			fieldname: "item",
+			label: __("Item"),
+			fieldtype: "Link",
+			width: 100,
+			options: "Item",
+			get_query: () => {
+				var item_group = frappe.query_report.get_filter_value("item_group");
+				return {
+					query: "erpnext.selling.report.payment_terms_status_for_sales_order.payment_terms_status_for_sales_order.get_customers_or_items",
+					filters: [
+						["Item", "disabled", "=", "0"],
+						["Item Group", "name", "=", item_group],
+					],
+				};
+			},
 		},
 		{
-			"fieldname":"from_due_date",
-			"label": __("From Due Date"),
-			"fieldtype": "Date",
+			fieldname: "from_due_date",
+			label: __("From Due Date"),
+			fieldtype: "Date",
 		},
 		{
-			"fieldname":"to_due_date",
-			"label": __("To Due Date"),
-			"fieldtype": "Date",
+			fieldname: "to_due_date",
+			label: __("To Due Date"),
+			fieldtype: "Date",
 		},
 		{
-			"fieldname":"status",
-			"label": __("Status"),
-			"fieldtype": "MultiSelectList",
-			"width": 100,
-			get_data: function(txt) {
-				let status = ["Overdue", "Unpaid", "Completed", "Partly Paid"]
-				let options = []
-				for (let option of status){
+			fieldname: "status",
+			label: __("Status"),
+			fieldtype: "MultiSelectList",
+			width: 100,
+			get_data: function (txt) {
+				let status = ["Overdue", "Unpaid", "Completed", "Partly Paid"];
+				let options = [];
+				for (let option of status) {
 					options.push({
-						"value": option,
-						"label": __(option),
-						"description": ""
-					})
+						value: option,
+						label: __(option),
+						description: "",
+					});
 				}
-				return options
-			}
+				return options;
+			},
 		},
 		{
-			"fieldname":"only_immediate_upcoming_term",
-			"label": __("Show only the Immediate Upcoming Term"),
-			"fieldtype": "Check",
+			fieldname: "only_immediate_upcoming_term",
+			label: __("Show only the Immediate Upcoming Term"),
+			fieldtype: "Check",
 		},
-	]
+	];
 	return filters;
 }
 
 frappe.query_reports["Payment Terms Status for Sales Order"] = {
-	"filters": get_filters(),
-	"formatter": function(value, row, column, data, default_formatter){
-		if(column.fieldname == 'invoices' && value) {
-			let invoices = value.split(',');
+	filters: get_filters(),
+	formatter: function (value, row, column, data, default_formatter) {
+		if (column.fieldname == "invoices" && value) {
+			let invoices = value.split(",");
 			const invoice_formatter = (prev_value, curr_value) => {
-				if(prev_value != "") {
+				if (prev_value != "") {
 					return prev_value + ", " + default_formatter(curr_value, row, column, data);
-				}
-				else {
+				} else {
 					return default_formatter(curr_value, row, column, data);
 				}
-			}
-			return invoices.reduce(invoice_formatter, "")
-		}
-		else if (column.fieldname == 'paid_amount' && value){
+			};
+			return invoices.reduce(invoice_formatter, "");
+		} else if (column.fieldname == "paid_amount" && value) {
 			let formatted_value = default_formatter(value, row, column, data);
-			if(value > 0) {
-				formatted_value = "<span style='color:green;'>" + formatted_value + "</span>"
+			if (value > 0) {
+				formatted_value = "<span style='color:green;'>" + formatted_value + "</span>";
 			}
 			return formatted_value;
-		}
-		else if (column.fieldname == 'status' && value == 'Completed'){
+		} else if (column.fieldname == "status" && value == "Completed") {
 			return "<span style='color:green;'>" + default_formatter(value, row, column, data) + "</span>";
 		}
 
 		return default_formatter(value, row, column, data);
 	},
-
 };
diff --git a/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.js b/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.js
index 2042059..76d04b0 100644
--- a/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.js
+++ b/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.js
@@ -1,6 +1,4 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
-frappe.query_reports["Pending SO Items For Purchase Request"] = {
-}
+frappe.query_reports["Pending SO Items For Purchase Request"] = {};
diff --git a/erpnext/selling/report/quotation_trends/quotation_trends.js b/erpnext/selling/report/quotation_trends/quotation_trends.js
index 97a1931..8ffeda4 100644
--- a/erpnext/selling/report/quotation_trends/quotation_trends.js
+++ b/erpnext/selling/report/quotation_trends/quotation_trends.js
@@ -1,8 +1,8 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.require("assets/erpnext/js/sales_trends_filters.js", function() {
+frappe.require("assets/erpnext/js/sales_trends_filters.js", function () {
 	frappe.query_reports["Quotation Trends"] = {
-		filters: erpnext.get_sales_trends_filters()
-	}
+		filters: erpnext.get_sales_trends_filters(),
+	};
 });
diff --git a/erpnext/selling/report/sales_analytics/sales_analytics.js b/erpnext/selling/report/sales_analytics/sales_analytics.js
index abe4f01..a01103a 100644
--- a/erpnext/selling/report/sales_analytics/sales_analytics.js
+++ b/erpnext/selling/report/sales_analytics/sales_analytics.js
@@ -1,49 +1,56 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Sales Analytics"] = {
-	"filters": [
+	filters: [
 		{
 			fieldname: "tree_type",
 			label: __("Tree Type"),
 			fieldtype: "Select",
-			options: ["Customer Group", "Customer", "Item Group", "Item", "Territory", "Order Type", "Project"],
+			options: [
+				"Customer Group",
+				"Customer",
+				"Item Group",
+				"Item",
+				"Territory",
+				"Order Type",
+				"Project",
+			],
 			default: "Customer",
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "doc_type",
 			label: __("based_on"),
 			fieldtype: "Select",
-			options: ["Sales Order","Delivery Note","Sales Invoice"],
+			options: ["Sales Order", "Delivery Note", "Sales Invoice"],
 			default: "Sales Invoice",
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "value_quantity",
 			label: __("Value Or Qty"),
 			fieldtype: "Select",
 			options: [
-				{ "value": "Value", "label": __("Value") },
-				{ "value": "Quantity", "label": __("Quantity") },
+				{ value: "Value", label: __("Value") },
+				{ value: "Quantity", label: __("Quantity") },
 			],
 			default: "Value",
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "from_date",
 			label: __("From Date"),
 			fieldtype: "Date",
 			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
 			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "company",
@@ -51,21 +58,21 @@
 			fieldtype: "Link",
 			options: "Company",
 			default: frappe.defaults.get_user_default("Company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "range",
 			label: __("Range"),
 			fieldtype: "Select",
 			options: [
-				{ "value": "Weekly", "label": __("Weekly") },
-				{ "value": "Monthly", "label": __("Monthly") },
-				{ "value": "Quarterly", "label": __("Quarterly") },
-				{ "value": "Yearly", "label": __("Yearly") }
+				{ value: "Weekly", label: __("Weekly") },
+				{ value: "Monthly", label: __("Monthly") },
+				{ value: "Quarterly", label: __("Quarterly") },
+				{ value: "Yearly", label: __("Yearly") },
 			],
 			default: "Monthly",
-			reqd: 1
-		}
+			reqd: 1,
+		},
 	],
 	get_datatable_options(options) {
 		return Object.assign(options, {
@@ -73,32 +80,26 @@
 			events: {
 				onCheckRow: function (data) {
 					if (!data) return;
-					const data_doctype = $(
-						data[2].html
-					)[0].attributes.getNamedItem("data-doctype").value;
+					const data_doctype = $(data[2].html)[0].attributes.getNamedItem("data-doctype").value;
 					const tree_type = frappe.query_report.filters[0].value;
 					if (data_doctype != tree_type) return;
 
 					const row_name = data[2].content;
 					const raw_data = frappe.query_report.chart.data;
 					const new_datasets = raw_data.datasets;
-					const element_found = new_datasets.some(
-						(element, index, array) => {
-							if (element.name == row_name) {
-								array.splice(index, 1);
-								return true;
-							}
-							return false;
+					const element_found = new_datasets.some((element, index, array) => {
+						if (element.name == row_name) {
+							array.splice(index, 1);
+							return true;
 						}
-					);
+						return false;
+					});
 					const slice_at = { Customer: 4, Item: 5 }[tree_type] || 3;
 
 					if (!element_found) {
 						new_datasets.push({
 							name: row_name,
-							values: data
-								.slice(slice_at, data.length - 1)
-								.map(column => column.content),
+							values: data.slice(slice_at, data.length - 1).map((column) => column.content),
 						});
 					}
 
@@ -106,7 +107,9 @@
 						labels: raw_data.labels,
 						datasets: new_datasets,
 					};
-					const new_options = Object.assign({}, frappe.query_report.chart_options, {data: new_data});
+					const new_options = Object.assign({}, frappe.query_report.chart_options, {
+						data: new_data,
+					});
 					frappe.query_report.render_chart(new_options);
 
 					frappe.query_report.raw_chart_data = new_data;
diff --git a/erpnext/selling/report/sales_order_analysis/sales_order_analysis.js b/erpnext/selling/report/sales_order_analysis/sales_order_analysis.js
index fc685e0..2b6e143 100644
--- a/erpnext/selling/report/sales_order_analysis/sales_order_analysis.js
+++ b/erpnext/selling/report/sales_order_analysis/sales_order_analysis.js
@@ -1,82 +1,81 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Sales Order Analysis"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"width": "80",
-			"options": "Company",
-			"reqd": 1,
-			"default": frappe.defaults.get_default("company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_default("company"),
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"width": "80",
-			"reqd": 1,
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			width: "80",
+			reqd: 1,
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"width": "80",
-			"reqd": 1,
-			"default": frappe.datetime.get_today()
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			width: "80",
+			reqd: 1,
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname": "sales_order",
-			"label": __("Sales Order"),
-			"fieldtype": "MultiSelectList",
-			"width": "80",
-			"options": "Sales Order",
-			"get_data": function(txt) {
+			fieldname: "sales_order",
+			label: __("Sales Order"),
+			fieldtype: "MultiSelectList",
+			width: "80",
+			options: "Sales Order",
+			get_data: function (txt) {
 				return frappe.db.get_link_options("Sales Order", txt);
 			},
-			"get_query": () =>{
+			get_query: () => {
 				return {
-					filters: { "docstatus": 1 }
-				}
-			}
+					filters: { docstatus: 1 },
+				};
+			},
 		},
 		{
-			"fieldname": "warehouse",
-			"label": __("Warehouse"),
-			"fieldtype": "Link",
-			"options": "Warehouse"
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			options: "Warehouse",
 		},
 		{
-			"fieldname": "status",
-			"label": __("Status"),
-			"fieldtype": "MultiSelectList",
-			"width": "80",
-			get_data: function(txt) {
-				let status = ["To Pay", "To Bill", "To Deliver", "To Deliver and Bill", "Completed"]
-				let options = []
-				for (let option of status){
+			fieldname: "status",
+			label: __("Status"),
+			fieldtype: "MultiSelectList",
+			width: "80",
+			get_data: function (txt) {
+				let status = ["To Pay", "To Bill", "To Deliver", "To Deliver and Bill", "Completed"];
+				let options = [];
+				for (let option of status) {
 					options.push({
-						"value": option,
-						"label": __(option),
-						"description": ""
-					})
+						value: option,
+						label: __(option),
+						description: "",
+					});
 				}
-				return options
-			}
+				return options;
+			},
 		},
 		{
-			"fieldname": "group_by_so",
-			"label": __("Group by Sales Order"),
-			"fieldtype": "Check",
-			"default": 0
-		}
+			fieldname: "group_by_so",
+			label: __("Group by Sales Order"),
+			fieldtype: "Check",
+			default: 0,
+		},
 	],
 
-	"formatter": function (value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 		let format_fields = ["delivered_qty", "billed_amount"];
 
@@ -88,5 +87,5 @@
 			value = "<span style='color:red;'>" + value + "</span>";
 		}
 		return value;
-	}
+	},
 };
diff --git a/erpnext/selling/report/sales_order_trends/sales_order_trends.js b/erpnext/selling/report/sales_order_trends/sales_order_trends.js
index b22ea8f..fe38804 100644
--- a/erpnext/selling/report/sales_order_trends/sales_order_trends.js
+++ b/erpnext/selling/report/sales_order_trends/sales_order_trends.js
@@ -1,8 +1,8 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.require("assets/erpnext/js/sales_trends_filters.js", function() {
+frappe.require("assets/erpnext/js/sales_trends_filters.js", function () {
 	frappe.query_reports["Sales Order Trends"] = {
-		filters: erpnext.get_sales_trends_filters()
-	}
+		filters: erpnext.get_sales_trends_filters(),
+	};
 });
diff --git a/erpnext/selling/report/sales_partner_commission_summary/sales_partner_commission_summary.js b/erpnext/selling/report/sales_partner_commission_summary/sales_partner_commission_summary.js
index f08780a..4a1ebab 100644
--- a/erpnext/selling/report/sales_partner_commission_summary/sales_partner_commission_summary.js
+++ b/erpnext/selling/report/sales_partner_commission_summary/sales_partner_commission_summary.js
@@ -1,22 +1,20 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Sales Partner Commission Summary"] = {
-	"filters": [
-
+	filters: [
 		{
 			fieldname: "sales_partner",
 			label: __("Sales Partner"),
 			fieldtype: "Link",
-			options: "Sales Partner"
+			options: "Sales Partner",
 		},
 		{
 			fieldname: "doctype",
 			label: __("Document Type"),
 			fieldtype: "Select",
 			options: "Sales Order\nDelivery Note\nSales Invoice",
-			default: "Sales Order"
+			default: "Sales Order",
 		},
 		{
 			fieldname: "from_date",
@@ -25,30 +23,29 @@
 			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
-			default: frappe.datetime.get_today()
+			default: frappe.datetime.get_today(),
 		},
 		{
-			fieldname:"company",
+			fieldname: "company",
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
-			default: frappe.defaults.get_user_default("Company")
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			fieldname:"customer",
+			fieldname: "customer",
 			label: __("Customer"),
 			fieldtype: "Link",
 			options: "Customer",
 		},
 		{
-			fieldname:"territory",
+			fieldname: "territory",
 			label: __("Territory"),
 			fieldtype: "Link",
 			options: "Territory",
 		},
-
-	]
-}
+	],
+};
diff --git a/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.js b/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.js
index 93aad54..6809b38 100644
--- a/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.js
+++ b/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.js
@@ -1,63 +1,60 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Sales Partner Target Variance based on Item Group"] = {
-	"filters": [
+	filters: [
 		{
-			fieldname:"company",
+			fieldname: "company",
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
-			default: frappe.defaults.get_user_default("Company")
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
 			fieldname: "fiscal_year",
 			label: __("Fiscal Year"),
 			fieldtype: "Link",
 			options: "Fiscal Year",
-			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today())
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
 		},
 		{
 			fieldname: "doctype",
 			label: __("Document Type"),
 			fieldtype: "Select",
 			options: "Sales Order\nDelivery Note\nSales Invoice",
-			default: "Sales Order"
+			default: "Sales Order",
 		},
 		{
 			fieldname: "period",
 			label: __("Period"),
 			fieldtype: "Select",
 			options: [
-				{ "value": "Monthly", "label": __("Monthly") },
-				{ "value": "Quarterly", "label": __("Quarterly") },
-				{ "value": "Half-Yearly", "label": __("Half-Yearly") },
-				{ "value": "Yearly", "label": __("Yearly") }
+				{ value: "Monthly", label: __("Monthly") },
+				{ value: "Quarterly", label: __("Quarterly") },
+				{ value: "Half-Yearly", label: __("Half-Yearly") },
+				{ value: "Yearly", label: __("Yearly") },
 			],
-			default: "Monthly"
+			default: "Monthly",
 		},
 		{
 			fieldname: "target_on",
 			label: __("Target On"),
 			fieldtype: "Select",
 			options: "Quantity\nAmount",
-			default: "Quantity"
+			default: "Quantity",
 		},
 	],
-	"formatter": function (value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 
-		if (column.fieldname.includes('variance')) {
-
+		if (column.fieldname.includes("variance")) {
 			if (data[column.fieldname] < 0) {
 				value = "<span style='color:red'>" + value + "</span>";
-			}
-			else if (data[column.fieldname] > 0) {
+			} else if (data[column.fieldname] > 0) {
 				value = "<span style='color:green'>" + value + "</span>";
 			}
 		}
 
 		return value;
-	}
-}
+	},
+};
diff --git a/erpnext/selling/report/sales_partner_transaction_summary/sales_partner_transaction_summary.js b/erpnext/selling/report/sales_partner_transaction_summary/sales_partner_transaction_summary.js
index e443ab3..b7bca8a 100644
--- a/erpnext/selling/report/sales_partner_transaction_summary/sales_partner_transaction_summary.js
+++ b/erpnext/selling/report/sales_partner_transaction_summary/sales_partner_transaction_summary.js
@@ -1,21 +1,20 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Sales Partner Transaction Summary"] = {
-	"filters": [
+	filters: [
 		{
 			fieldname: "sales_partner",
 			label: __("Sales Partner"),
 			fieldtype: "Link",
-			options: "Sales Partner"
+			options: "Sales Partner",
 		},
 		{
 			fieldname: "doctype",
 			label: __("Document Type"),
 			fieldtype: "Select",
 			options: "Sales Order\nDelivery Note\nSales Invoice",
-			default: "Sales Order"
+			default: "Sales Order",
 		},
 		{
 			fieldname: "from_date",
@@ -24,48 +23,48 @@
 			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
-			default: frappe.datetime.get_today()
+			default: frappe.datetime.get_today(),
 		},
 		{
-			fieldname:"company",
+			fieldname: "company",
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
 			default: frappe.defaults.get_user_default("Company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"item_group",
+			fieldname: "item_group",
 			label: __("Item Group"),
 			fieldtype: "Link",
 			options: "Item Group",
 		},
 		{
-			fieldname:"brand",
+			fieldname: "brand",
 			label: __("Brand"),
 			fieldtype: "Link",
 			options: "Brand",
 		},
 		{
-			fieldname:"customer",
+			fieldname: "customer",
 			label: __("Customer"),
 			fieldtype: "Link",
 			options: "Customer",
 		},
 		{
-			fieldname:"territory",
+			fieldname: "territory",
 			label: __("Territory"),
 			fieldtype: "Link",
 			options: "Territory",
 		},
 		{
-			fieldname:"show_return_entries",
+			fieldname: "show_return_entries",
 			label: __("Show Return Entries"),
 			fieldtype: "Check",
 			default: 0,
 		},
-	]
-}
+	],
+};
diff --git a/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.js b/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.js
index 9ed0b00..b197a9a 100644
--- a/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.js
+++ b/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.js
@@ -1,22 +1,20 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Sales Person Commission Summary"] = {
-	"filters": [
-
+	filters: [
 		{
 			fieldname: "sales_person",
 			label: __("Sales Person"),
 			fieldtype: "Link",
-			options: "Sales Person"
+			options: "Sales Person",
 		},
 		{
 			fieldname: "doc_type",
 			label: __("Document Type"),
 			fieldtype: "Select",
 			options: "Sales Order\nDelivery Note\nSales Invoice",
-			default: "Sales Order"
+			default: "Sales Order",
 		},
 		{
 			fieldname: "from_date",
@@ -25,30 +23,29 @@
 			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
-			default: frappe.datetime.get_today()
+			default: frappe.datetime.get_today(),
 		},
 		{
-			fieldname:"company",
+			fieldname: "company",
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
-			default: frappe.defaults.get_user_default("Company")
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			fieldname:"customer",
+			fieldname: "customer",
 			label: __("Customer"),
 			fieldtype: "Link",
 			options: "Customer",
 		},
 		{
-			fieldname:"territory",
+			fieldname: "territory",
 			label: __("Territory"),
 			fieldtype: "Link",
 			options: "Territory",
 		},
-
-	]
-}
+	],
+};
diff --git a/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.js b/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.js
index 8ee86dc..f9e8cc6 100644
--- a/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.js
+++ b/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.js
@@ -1,15 +1,14 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Sales Person Target Variance Based On Item Group"] = {
-	"filters": [
+	filters: [
 		{
-			fieldname:"company",
+			fieldname: "company",
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
-			default: frappe.defaults.get_user_default("Company")
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
 			fieldname: "fiscal_year",
@@ -23,41 +22,39 @@
 			label: __("Document Type"),
 			fieldtype: "Select",
 			options: "Sales Order\nDelivery Note\nSales Invoice",
-			default: "Sales Order"
+			default: "Sales Order",
 		},
 		{
 			fieldname: "period",
 			label: __("Period"),
 			fieldtype: "Select",
 			options: [
-				{ "value": "Monthly", "label": __("Monthly") },
-				{ "value": "Quarterly", "label": __("Quarterly") },
-				{ "value": "Half-Yearly", "label": __("Half-Yearly") },
-				{ "value": "Yearly", "label": __("Yearly") }
+				{ value: "Monthly", label: __("Monthly") },
+				{ value: "Quarterly", label: __("Quarterly") },
+				{ value: "Half-Yearly", label: __("Half-Yearly") },
+				{ value: "Yearly", label: __("Yearly") },
 			],
-			default: "Monthly"
+			default: "Monthly",
 		},
 		{
 			fieldname: "target_on",
 			label: __("Target On"),
 			fieldtype: "Select",
 			options: "Quantity\nAmount",
-			default: "Quantity"
+			default: "Quantity",
 		},
 	],
-	"formatter": function (value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 
-		if (column.fieldname.includes('variance')) {
-
+		if (column.fieldname.includes("variance")) {
 			if (data[column.fieldname] < 0) {
 				value = "<span style='color:red'>" + value + "</span>";
-			}
-			else if (data[column.fieldname] > 0) {
+			} else if (data[column.fieldname] > 0) {
 				value = "<span style='color:green'>" + value + "</span>";
 			}
 		}
 
 		return value;
-	}
-}
+	},
+};
diff --git a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js
index 80c7b5f..828e9e7 100644
--- a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js
+++ b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js
@@ -2,19 +2,19 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Sales Person-wise Transaction Summary"] = {
-	"filters": [
+	filters: [
 		{
 			fieldname: "sales_person",
 			label: __("Sales Person"),
 			fieldtype: "Link",
-			options: "Sales Person"
+			options: "Sales Person",
 		},
 		{
 			fieldname: "doc_type",
 			label: __("Document Type"),
 			fieldtype: "Select",
 			options: "Sales Order\nDelivery Note\nSales Invoice",
-			default: "Sales Order"
+			default: "Sales Order",
 		},
 		{
 			fieldname: "from_date",
@@ -23,48 +23,48 @@
 			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
-			default: frappe.datetime.get_today()
+			default: frappe.datetime.get_today(),
 		},
 		{
-			fieldname:"company",
+			fieldname: "company",
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
 			default: frappe.defaults.get_user_default("Company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"item_group",
+			fieldname: "item_group",
 			label: __("Item Group"),
 			fieldtype: "Link",
 			options: "Item Group",
 		},
 		{
-			fieldname:"brand",
+			fieldname: "brand",
 			label: __("Brand"),
 			fieldtype: "Link",
 			options: "Brand",
 		},
 		{
-			fieldname:"customer",
+			fieldname: "customer",
 			label: __("Customer"),
 			fieldtype: "Link",
 			options: "Customer",
 		},
 		{
-			fieldname:"territory",
+			fieldname: "territory",
 			label: __("Territory"),
 			fieldtype: "Link",
 			options: "Territory",
 		},
 		{
-			fieldname:"show_return_entries",
+			fieldname: "show_return_entries",
 			label: __("Show Return Entries"),
 			fieldtype: "Check",
 			default: 0,
 		},
-	]
-}
+	],
+};
diff --git a/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.js b/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.js
index 50ac4da..a9e3432 100644
--- a/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.js
+++ b/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.js
@@ -1,63 +1,60 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Territory Target Variance Based On Item Group"] = {
-	"filters": [
+	filters: [
 		{
-			fieldname:"company",
+			fieldname: "company",
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
-			default: frappe.defaults.get_user_default("Company")
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
 			fieldname: "fiscal_year",
 			label: __("Fiscal Year"),
 			fieldtype: "Link",
 			options: "Fiscal Year",
-			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today())
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
 		},
 		{
 			fieldname: "doctype",
 			label: __("Document Type"),
 			fieldtype: "Select",
 			options: "Sales Order\nDelivery Note\nSales Invoice",
-			default: "Sales Order"
+			default: "Sales Order",
 		},
 		{
 			fieldname: "period",
 			label: __("Period"),
 			fieldtype: "Select",
 			options: [
-				{ "value": "Monthly", "label": __("Monthly") },
-				{ "value": "Quarterly", "label": __("Quarterly") },
-				{ "value": "Half-Yearly", "label": __("Half-Yearly") },
-				{ "value": "Yearly", "label": __("Yearly") }
+				{ value: "Monthly", label: __("Monthly") },
+				{ value: "Quarterly", label: __("Quarterly") },
+				{ value: "Half-Yearly", label: __("Half-Yearly") },
+				{ value: "Yearly", label: __("Yearly") },
 			],
-			default: "Monthly"
+			default: "Monthly",
 		},
 		{
 			fieldname: "target_on",
 			label: __("Target On"),
 			fieldtype: "Select",
 			options: "Quantity\nAmount",
-			default: "Quantity"
+			default: "Quantity",
 		},
 	],
-	"formatter": function (value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 
-		if (column.fieldname.includes('variance')) {
-
+		if (column.fieldname.includes("variance")) {
 			if (data[column.fieldname] < 0) {
 				value = "<span style='color:red'>" + value + "</span>";
-			}
-			else if (data[column.fieldname] > 0) {
+			} else if (data[column.fieldname] > 0) {
 				value = "<span style='color:green'>" + value + "</span>";
 			}
 		}
 
 		return value;
-	}
-}
+	},
+};
diff --git a/erpnext/selling/report/territory_wise_sales/territory_wise_sales.js b/erpnext/selling/report/territory_wise_sales/territory_wise_sales.js
index c755a75..409b7c7 100644
--- a/erpnext/selling/report/territory_wise_sales/territory_wise_sales.js
+++ b/erpnext/selling/report/territory_wise_sales/territory_wise_sales.js
@@ -1,22 +1,23 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
-
 frappe.query_reports["Territory-wise Sales"] = {
-	"breadcrumb":"Selling",
-	"filters": [
+	breadcrumb: "Selling",
+	filters: [
 		{
-			fieldname:"transaction_date",
+			fieldname: "transaction_date",
 			label: __("Transaction Date"),
 			fieldtype: "DateRange",
-			default: [frappe.datetime.add_months(frappe.datetime.get_today(),-1), frappe.datetime.get_today()],
+			default: [
+				frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+				frappe.datetime.get_today(),
+			],
 		},
 		{
 			fieldname: "company",
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
-		}
-	]
+		},
+	],
 };
diff --git a/erpnext/setup/doctype/authorization_rule/authorization_rule.js b/erpnext/setup/doctype/authorization_rule/authorization_rule.js
index f00ed3e..0004119 100644
--- a/erpnext/setup/doctype/authorization_rule/authorization_rule.js
+++ b/erpnext/setup/doctype/authorization_rule/authorization_rule.js
@@ -2,17 +2,17 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.ui.form.on("Authorization Rule", {
-	refresh: function(frm) {
+	refresh: function (frm) {
 		frm.events.set_master_type(frm);
 	},
-	set_master_type: function(frm) {
-		if(frm.doc.based_on==="Customerwise Discount") {
+	set_master_type: function (frm) {
+		if (frm.doc.based_on === "Customerwise Discount") {
 			unhide_field("master_name");
 			frm.set_value("customer_or_item", "Customer");
-		} else if(frm.doc.based_on==="Itemwise Discount") {
+		} else if (frm.doc.based_on === "Itemwise Discount") {
 			unhide_field("master_name");
 			frm.set_value("customer_or_item", "Item");
-		} else if(frm.doc.based_on==="Item Group wise Discount") {
+		} else if (frm.doc.based_on === "Item Group wise Discount") {
 			unhide_field("master_name");
 			frm.set_value("customer_or_item", "Item Group");
 		} else {
@@ -21,84 +21,74 @@
 			hide_field("master_name");
 		}
 	},
-	based_on: function(frm) {
+	based_on: function (frm) {
 		frm.events.set_master_type(frm);
-		if (frm.doc.based_on === 'Not Applicable') {
+		if (frm.doc.based_on === "Not Applicable") {
 			frm.set_value("value", 0);
-			hide_field('value');
+			hide_field("value");
 		} else {
-			unhide_field('value');
+			unhide_field("value");
 		}
 	},
-	transaction: function(frm) {
-		unhide_field(['system_role', 'system_user', 'value', 'based_on']);
-		hide_field(['to_emp', 'to_designation']);
-	}
-})
-
+	transaction: function (frm) {
+		unhide_field(["system_role", "system_user", "value", "based_on"]);
+		hide_field(["to_emp", "to_designation"]);
+	},
+});
 
 // Settings Module
-cur_frm.cscript.refresh = function(doc, cdt, cdn) {
-	if (doc.based_on == 'Not Applicable')
-		hide_field('value');
-	else
-		unhide_field('value');
+cur_frm.cscript.refresh = function (doc, cdt, cdn) {
+	if (doc.based_on == "Not Applicable") hide_field("value");
+	else unhide_field("value");
 
-	unhide_field(['system_role', 'system_user', 'value']);
-	hide_field(['to_emp', 'to_designation']);
-}
+	unhide_field(["system_role", "system_user", "value"]);
+	hide_field(["to_emp", "to_designation"]);
+};
 
-cur_frm.fields_dict.system_user.get_query = function(doc, cdt, cdn) {
-	return { query:"frappe.core.doctype.user.user.user_query" }
-}
+cur_frm.fields_dict.system_user.get_query = function (doc, cdt, cdn) {
+	return { query: "frappe.core.doctype.user.user.user_query" };
+};
 
-cur_frm.fields_dict.approving_user.get_query = function(doc, cdt, cdn) {
-	return { query:"frappe.core.doctype.user.user.user_query" }
-}
+cur_frm.fields_dict.approving_user.get_query = function (doc, cdt, cdn) {
+	return { query: "frappe.core.doctype.user.user.user_query" };
+};
 
-cur_frm.fields_dict['approving_role'].get_query = cur_frm.fields_dict['system_role'].get_query;
+cur_frm.fields_dict["approving_role"].get_query = cur_frm.fields_dict["system_role"].get_query;
 
 // System Role Trigger
 // -----------------------
-cur_frm.fields_dict['system_role'].get_query = function(doc) {
+cur_frm.fields_dict["system_role"].get_query = function (doc) {
 	return {
-		filters:[
-			['Role', 'name', 'not in', 'Administrator, Guest, All']
-		]
-	}
-}
-
+		filters: [["Role", "name", "not in", "Administrator, Guest, All"]],
+	};
+};
 
 // Master Name Trigger
 // --------------------
-cur_frm.fields_dict['master_name'].get_query = function(doc) {
-	if (doc.based_on == 'Customerwise Discount')
+cur_frm.fields_dict["master_name"].get_query = function (doc) {
+	if (doc.based_on == "Customerwise Discount")
 		return {
 			doctype: "Customer",
-			filters:[
-				['Customer', 'docstatus', '!=', 2]
-			]
-		}
-	else if (doc.based_on == 'Itemwise Discount')
+			filters: [["Customer", "docstatus", "!=", 2]],
+		};
+	else if (doc.based_on == "Itemwise Discount")
 		return {
 			doctype: "Item",
-			query: "erpnext.controllers.queries.item_query"
-		}
-	else if (doc.based_on==="Item Group wise Discount")
+			query: "erpnext.controllers.queries.item_query",
+		};
+	else if (doc.based_on === "Item Group wise Discount")
 		return {
 			doctype: "Item Group",
 			filters: {
-				"is_group": 0
-			}
-		}
+				is_group: 0,
+			},
+		};
 	else
 		return {
-			filters: [
-				['Item', 'name', '=', 'cheating done to avoid null']
-			]
-		}
-}
+			filters: [["Item", "name", "=", "cheating done to avoid null"]],
+		};
+};
 
-cur_frm.fields_dict.to_emp.get_query = function(doc, cdt, cdn) {
-	return { query: "erpnext.controllers.queries.employee_query" }
-}
+cur_frm.fields_dict.to_emp.get_query = function (doc, cdt, cdn) {
+	return { query: "erpnext.controllers.queries.employee_query" };
+};
diff --git a/erpnext/setup/doctype/branch/branch.js b/erpnext/setup/doctype/branch/branch.js
index c8a0afc..6e17c78 100644
--- a/erpnext/setup/doctype/branch/branch.js
+++ b/erpnext/setup/doctype/branch/branch.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Branch', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Branch", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/setup/doctype/brand/brand.js b/erpnext/setup/doctype/brand/brand.js
index 0abb71a..5d16d73 100644
--- a/erpnext/setup/doctype/brand/brand.js
+++ b/erpnext/setup/doctype/brand/brand.js
@@ -1,71 +1,99 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.ui.form.on('Brand', {
+frappe.ui.form.on("Brand", {
 	setup: (frm) => {
-        frm.fields_dict["brand_defaults"].grid.get_field("default_warehouse").get_query = function(doc, cdt, cdn) {
+		frm.fields_dict["brand_defaults"].grid.get_field("default_warehouse").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
 			const row = locals[cdt][cdn];
 			return {
-				filters: { company: row.company }
-			}
-		}
-
-        frm.fields_dict["brand_defaults"].grid.get_field("default_discount_account").get_query = function(doc, cdt, cdn) {
-			const row = locals[cdt][cdn];
-			return {
-				filters: {
-					'report_type': 'Profit and Loss',
-					'company': row.company,
-					"is_group": 0
-				}
+				filters: { company: row.company },
 			};
-		}
+		};
 
-        frm.fields_dict["brand_defaults"].grid.get_field("buying_cost_center").get_query = function(doc, cdt, cdn) {
+		frm.fields_dict["brand_defaults"].grid.get_field("default_discount_account").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
 			const row = locals[cdt][cdn];
 			return {
 				filters: {
-					"is_group": 0,
-					"company": row.company
-				}
-			}
-		}
+					report_type: "Profit and Loss",
+					company: row.company,
+					is_group: 0,
+				},
+			};
+		};
 
-        frm.fields_dict["brand_defaults"].grid.get_field("expense_account").get_query = function(doc, cdt, cdn) {
+		frm.fields_dict["brand_defaults"].grid.get_field("buying_cost_center").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
+			const row = locals[cdt][cdn];
+			return {
+				filters: {
+					is_group: 0,
+					company: row.company,
+				},
+			};
+		};
+
+		frm.fields_dict["brand_defaults"].grid.get_field("expense_account").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
 			const row = locals[cdt][cdn];
 			return {
 				query: "erpnext.controllers.queries.get_expense_account",
-				filters: { company: row.company }
-			}
-		}
-
-        frm.fields_dict["brand_defaults"].grid.get_field("default_provisional_account").get_query = function(doc, cdt, cdn) {
-			const row = locals[cdt][cdn];
-			return {
-				filters: {
-					"company": row.company,
-					"root_type": ["in", ["Liability", "Asset"]],
-					"is_group": 0
-				}
+				filters: { company: row.company },
 			};
-		}
+		};
 
-        frm.fields_dict["brand_defaults"].grid.get_field("selling_cost_center").get_query = function(doc, cdt, cdn) {
+		frm.fields_dict["brand_defaults"].grid.get_field("default_provisional_account").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
 			const row = locals[cdt][cdn];
 			return {
 				filters: {
-					"is_group": 0,
-					"company": row.company
-				}
-			}
-		}
+					company: row.company,
+					root_type: ["in", ["Liability", "Asset"]],
+					is_group: 0,
+				},
+			};
+		};
 
-        frm.fields_dict["brand_defaults"].grid.get_field("income_account").get_query = function(doc, cdt, cdn) {
+		frm.fields_dict["brand_defaults"].grid.get_field("selling_cost_center").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
+			const row = locals[cdt][cdn];
+			return {
+				filters: {
+					is_group: 0,
+					company: row.company,
+				},
+			};
+		};
+
+		frm.fields_dict["brand_defaults"].grid.get_field("income_account").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
 			const row = locals[cdt][cdn];
 			return {
 				query: "erpnext.controllers.queries.get_income_account",
-				filters: { company: row.company }
-			}
-		}
-	}
-});
\ No newline at end of file
+				filters: { company: row.company },
+			};
+		};
+	},
+});
diff --git a/erpnext/setup/doctype/company/company.js b/erpnext/setup/doctype/company/company.js
index 340a917..3917005 100644
--- a/erpnext/setup/doctype/company/company.js
+++ b/erpnext/setup/doctype/company/company.js
@@ -4,119 +4,146 @@
 frappe.provide("erpnext.company");
 
 frappe.ui.form.on("Company", {
-	onload: function(frm) {
+	onload: function (frm) {
 		if (frm.doc.__islocal && frm.doc.parent_company) {
-			frappe.db.get_value('Company', frm.doc.parent_company, 'is_group', (r) => {
+			frappe.db.get_value("Company", frm.doc.parent_company, "is_group", (r) => {
 				if (!r.is_group) {
-					frm.set_value('parent_company', '');
+					frm.set_value("parent_company", "");
 				}
 			});
 		}
 
-		frm.call('check_if_transactions_exist').then(r => {
-			frm.toggle_enable("default_currency", (!r.message));
+		frm.call("check_if_transactions_exist").then((r) => {
+			frm.toggle_enable("default_currency", !r.message);
 		});
 	},
-	setup: function(frm) {
+	setup: function (frm) {
 		frm.__rename_queue = "long";
 		erpnext.company.setup_queries(frm);
 
-		frm.set_query("parent_company", function() {
+		frm.set_query("parent_company", function () {
 			return {
-				filters: {"is_group": 1}
-			}
+				filters: { is_group: 1 },
+			};
 		});
 
-		frm.set_query("default_selling_terms", function() {
+		frm.set_query("default_selling_terms", function () {
 			return { filters: { selling: 1 } };
 		});
 
-		frm.set_query("default_buying_terms", function() {
+		frm.set_query("default_buying_terms", function () {
 			return { filters: { buying: 1 } };
 		});
 
-		frm.set_query("default_in_transit_warehouse", function() {
+		frm.set_query("default_in_transit_warehouse", function () {
 			return {
-				filters:{
-					'warehouse_type' : 'Transit',
-					'is_group': 0,
-					'company': frm.doc.company_name
-				}
+				filters: {
+					warehouse_type: "Transit",
+					is_group: 0,
+					company: frm.doc.company_name,
+				},
 			};
 		});
 	},
 
-	company_name: function(frm) {
-		if(frm.doc.__islocal) {
+	company_name: function (frm) {
+		if (frm.doc.__islocal) {
 			// add missing " " arg in split method
 			let parts = frm.doc.company_name.split(" ");
 			let abbr = $.map(parts, function (p) {
-				return p? p.substr(0, 1) : null;
+				return p ? p.substr(0, 1) : null;
 			}).join("");
 			frm.set_value("abbr", abbr);
 		}
 	},
 
-	parent_company: function(frm) {
+	parent_company: function (frm) {
 		var bool = frm.doc.parent_company ? true : false;
-		frm.set_value('create_chart_of_accounts_based_on', bool ? "Existing Company" : "");
-		frm.set_value('existing_company', bool ? frm.doc.parent_company : "");
+		frm.set_value("create_chart_of_accounts_based_on", bool ? "Existing Company" : "");
+		frm.set_value("existing_company", bool ? frm.doc.parent_company : "");
 		disbale_coa_fields(frm, bool);
 	},
 
-	date_of_commencement: function(frm) {
-		if(frm.doc.date_of_commencement<frm.doc.date_of_incorporation)
-		{
+	date_of_commencement: function (frm) {
+		if (frm.doc.date_of_commencement < frm.doc.date_of_incorporation) {
 			frappe.throw(__("Date of Commencement should be greater than Date of Incorporation"));
 		}
-		if(!frm.doc.date_of_commencement){
-			frm.doc.date_of_incorporation = ""
+		if (!frm.doc.date_of_commencement) {
+			frm.doc.date_of_incorporation = "";
 		}
 	},
 
-	refresh: function(frm) {
-		frm.toggle_display('address_html', !frm.is_new());
+	refresh: function (frm) {
+		frm.toggle_display("address_html", !frm.is_new());
 
 		if (!frm.is_new()) {
 			frm.doc.abbr && frm.set_df_property("abbr", "read_only", 1);
 			disbale_coa_fields(frm);
 			frappe.contacts.render_address_and_contact(frm);
 
-			if (frappe.perm.has_perm("Cost Center", 0, 'read')) {
-				frm.add_custom_button(__('Cost Centers'), function() {
-					frappe.set_route('Tree', 'Cost Center', {'company': frm.doc.name});
-				}, __("View"));
+			if (frappe.perm.has_perm("Cost Center", 0, "read")) {
+				frm.add_custom_button(
+					__("Cost Centers"),
+					function () {
+						frappe.set_route("Tree", "Cost Center", { company: frm.doc.name });
+					},
+					__("View")
+				);
 			}
 
-			if (frappe.perm.has_perm("Account", 0, 'read')) {
-				frm.add_custom_button(__('Chart of Accounts'), function() {
-					frappe.set_route('Tree', 'Account', {'company': frm.doc.name});
-				}, __("View"));
+			if (frappe.perm.has_perm("Account", 0, "read")) {
+				frm.add_custom_button(
+					__("Chart of Accounts"),
+					function () {
+						frappe.set_route("Tree", "Account", { company: frm.doc.name });
+					},
+					__("View")
+				);
 			}
 
-			if (frappe.perm.has_perm("Sales Taxes and Charges Template", 0, 'read')) {
-				frm.add_custom_button(__('Sales Tax Template'), function() {
-					frappe.set_route('List', 'Sales Taxes and Charges Template', {'company': frm.doc.name});
-				}, __("View"));
+			if (frappe.perm.has_perm("Sales Taxes and Charges Template", 0, "read")) {
+				frm.add_custom_button(
+					__("Sales Tax Template"),
+					function () {
+						frappe.set_route("List", "Sales Taxes and Charges Template", {
+							company: frm.doc.name,
+						});
+					},
+					__("View")
+				);
 			}
 
-			if (frappe.perm.has_perm("Purchase Taxes and Charges Template", 0, 'read')) {
-				frm.add_custom_button(__('Purchase Tax Template'), function() {
-					frappe.set_route('List', 'Purchase Taxes and Charges Template', {'company': frm.doc.name});
-				}, __("View"));
+			if (frappe.perm.has_perm("Purchase Taxes and Charges Template", 0, "read")) {
+				frm.add_custom_button(
+					__("Purchase Tax Template"),
+					function () {
+						frappe.set_route("List", "Purchase Taxes and Charges Template", {
+							company: frm.doc.name,
+						});
+					},
+					__("View")
+				);
 			}
 
-			if (frm.has_perm('write')) {
-				frm.add_custom_button(__('Create Tax Template'), function() {
-					frm.trigger("make_default_tax_template");
-				}, __('Manage'));
+			if (frm.has_perm("write")) {
+				frm.add_custom_button(
+					__("Create Tax Template"),
+					function () {
+						frm.trigger("make_default_tax_template");
+					},
+					__("Manage")
+				);
 			}
 
-			if (frappe.user.has_role('System Manager')) {
-				if (frm.has_perm('write')) {
-					frm.add_custom_button(__('Delete Transactions'), function() {
-						frm.trigger("delete_company_transactions");
-					}, __('Manage'));
+			if (frappe.user.has_role("System Manager")) {
+				if (frm.has_perm("write")) {
+					frm.add_custom_button(
+						__("Delete Transactions"),
+						function () {
+							frm.trigger("delete_company_transactions");
+						},
+						__("Manage")
+					);
 				}
 			}
 		}
@@ -124,157 +151,168 @@
 		erpnext.company.set_chart_of_accounts_options(frm.doc);
 	},
 
-	make_default_tax_template: function(frm) {
+	make_default_tax_template: function (frm) {
 		frm.call({
 			method: "create_default_tax_template",
 			doc: frm.doc,
 			freeze: true,
-			callback: function() {
+			callback: function () {
 				frappe.msgprint(__("Default tax templates for sales, purchase and items are created."));
-			}
-		})
+			},
+		});
 	},
 
-	country: function(frm) {
+	country: function (frm) {
 		erpnext.company.set_chart_of_accounts_options(frm.doc);
 	},
 
-	delete_company_transactions: function(frm) {
+	delete_company_transactions: function (frm) {
 		frappe.call({
 			method: "erpnext.setup.doctype.company.company.is_deletion_job_running",
 			args: {
-				company: frm.doc.name
+				company: frm.doc.name,
 			},
 			freeze: true,
-			callback: function(r) {
-				if(!r.exc) {
-					frappe.verify_password(function() {
-						var d = frappe.prompt({
-							fieldtype:"Data",
-							fieldname: "company_name",
-							label: __("Please enter the company name to confirm"),
-							reqd: 1,
-							description: __("Please make sure you really want to delete all the transactions for this company. Your master data will remain as it is. This action cannot be undone.")
-						},
-								      function(data) {
-									      if(data.company_name !== frm.doc.name) {
-										      frappe.msgprint(__("Company name not same"));
-										      return;
-									      }
-									      frappe.call({
-										      method: "erpnext.setup.doctype.company.company.create_transaction_deletion_request",
-										      args: {
-											      company: data.company_name
-										      },
-										      freeze: true,
-										      callback: function(r, rt) { },
-										      onerror: function() {
-											      frappe.msgprint(__("Wrong Password"));
-										      }
-									      });
-								      },
-								      __("Delete all the Transactions for this Company"), __("Delete")
-								     );
+			callback: function (r) {
+				if (!r.exc) {
+					frappe.verify_password(function () {
+						var d = frappe.prompt(
+							{
+								fieldtype: "Data",
+								fieldname: "company_name",
+								label: __("Please enter the company name to confirm"),
+								reqd: 1,
+								description: __(
+									"Please make sure you really want to delete all the transactions for this company. Your master data will remain as it is. This action cannot be undone."
+								),
+							},
+							function (data) {
+								if (data.company_name !== frm.doc.name) {
+									frappe.msgprint(__("Company name not same"));
+									return;
+								}
+								frappe.call({
+									method: "erpnext.setup.doctype.company.company.create_transaction_deletion_request",
+									args: {
+										company: data.company_name,
+									},
+									freeze: true,
+									callback: function (r, rt) {},
+									onerror: function () {
+										frappe.msgprint(__("Wrong Password"));
+									},
+								});
+							},
+							__("Delete all the Transactions for this Company"),
+							__("Delete")
+						);
 						d.get_primary_btn().addClass("btn-danger");
 					});
 				}
-
 			},
 		});
-
-	}
+	},
 });
 
-
-erpnext.company.set_chart_of_accounts_options = function(doc) {
+erpnext.company.set_chart_of_accounts_options = function (doc) {
 	var selected_value = doc.chart_of_accounts;
-	if(doc.country) {
+	if (doc.country) {
 		return frappe.call({
 			method: "erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts.get_charts_for_country",
 			args: {
-				"country": doc.country,
-				"with_standard": true
+				country: doc.country,
+				with_standard: true,
 			},
-			callback: function(r) {
-				if(!r.exc) {
+			callback: function (r) {
+				if (!r.exc) {
 					set_field_options("chart_of_accounts", [""].concat(r.message).join("\n"));
-					if(in_list(r.message, selected_value))
+					if (in_list(r.message, selected_value))
 						cur_frm.set_value("chart_of_accounts", selected_value);
 				}
-			}
-		})
-	}
-}
-
-erpnext.company.setup_queries = function(frm) {
-	$.each([
-		["default_bank_account", {"account_type": "Bank"}],
-		["default_cash_account", {"account_type": "Cash"}],
-		["default_receivable_account", { "root_type": "Asset", "account_type": "Receivable" }],
-		["default_payable_account", { "root_type": "Liability", "account_type": "Payable" }],
-		["default_expense_account", {"root_type": "Expense"}],
-		["default_income_account", {"root_type": "Income"}],
-		["round_off_account", {"root_type": "Expense"}],
-		["write_off_account", {"root_type": "Expense"}],
-		["default_deferred_expense_account", {}],
-		["default_deferred_revenue_account", {}],
-		["default_discount_account", {}],
-		["discount_allowed_account", {"root_type": "Expense"}],
-		["discount_received_account", {"root_type": "Income"}],
-		["exchange_gain_loss_account", {"root_type": ["in", ["Expense", "Income"]]}],
-		["unrealized_exchange_gain_loss_account", {"root_type": ["in", ["Expense", "Income"]]}],
-		["accumulated_depreciation_account",
-			{"root_type": "Asset", "account_type": "Accumulated Depreciation"}],
-		["depreciation_expense_account", {"root_type": "Expense", "account_type": "Depreciation"}],
-		["disposal_account", {"report_type": "Profit and Loss"}],
-		["default_inventory_account", {"account_type": "Stock"}],
-		["cost_center", {}],
-		["round_off_cost_center", {}],
-		["depreciation_cost_center", {}],
-		["capital_work_in_progress_account", {"account_type": "Capital Work in Progress"}],
-		["asset_received_but_not_billed", {"account_type": "Asset Received But Not Billed"}],
-		["unrealized_profit_loss_account", {"root_type": ["in", ["Liability", "Asset"]]}],
-		["default_provisional_account", {"root_type": ["in", ["Liability", "Asset"]]}],
-		["default_advance_received_account", {"root_type": "Liability", "account_type": "Receivable"}],
-		["default_advance_paid_account", {"root_type": "Asset", "account_type": "Payable"}],
-	], function(i, v) {
-		erpnext.company.set_custom_query(frm, v);
-	});
-
-	if (frm.doc.enable_perpetual_inventory) {
-		$.each([
-			["stock_adjustment_account",
-				{"root_type": "Expense", "account_type": "Stock Adjustment"}],
-			["stock_received_but_not_billed",
-				{"root_type": "Liability", "account_type": "Stock Received But Not Billed"}],
-			["service_received_but_not_billed",
-				{"root_type": "Liability", "account_type": "Service Received But Not Billed"}],
-
-		], function(i, v) {
-			erpnext.company.set_custom_query(frm, v);
+			},
 		});
 	}
-}
+};
 
-erpnext.company.set_custom_query = function(frm, v) {
+erpnext.company.setup_queries = function (frm) {
+	$.each(
+		[
+			["default_bank_account", { account_type: "Bank" }],
+			["default_cash_account", { account_type: "Cash" }],
+			["default_receivable_account", { root_type: "Asset", account_type: "Receivable" }],
+			["default_payable_account", { root_type: "Liability", account_type: "Payable" }],
+			["default_expense_account", { root_type: "Expense" }],
+			["default_income_account", { root_type: "Income" }],
+			["round_off_account", { root_type: "Expense" }],
+			["write_off_account", { root_type: "Expense" }],
+			["default_deferred_expense_account", {}],
+			["default_deferred_revenue_account", {}],
+			["default_discount_account", {}],
+			["discount_allowed_account", { root_type: "Expense" }],
+			["discount_received_account", { root_type: "Income" }],
+			["exchange_gain_loss_account", { root_type: ["in", ["Expense", "Income"]] }],
+			["unrealized_exchange_gain_loss_account", { root_type: ["in", ["Expense", "Income"]] }],
+			[
+				"accumulated_depreciation_account",
+				{ root_type: "Asset", account_type: "Accumulated Depreciation" },
+			],
+			["depreciation_expense_account", { root_type: "Expense", account_type: "Depreciation" }],
+			["disposal_account", { report_type: "Profit and Loss" }],
+			["default_inventory_account", { account_type: "Stock" }],
+			["cost_center", {}],
+			["round_off_cost_center", {}],
+			["depreciation_cost_center", {}],
+			["capital_work_in_progress_account", { account_type: "Capital Work in Progress" }],
+			["asset_received_but_not_billed", { account_type: "Asset Received But Not Billed" }],
+			["unrealized_profit_loss_account", { root_type: ["in", ["Liability", "Asset"]] }],
+			["default_provisional_account", { root_type: ["in", ["Liability", "Asset"]] }],
+			["default_advance_received_account", { root_type: "Liability", account_type: "Receivable" }],
+			["default_advance_paid_account", { root_type: "Asset", account_type: "Payable" }],
+		],
+		function (i, v) {
+			erpnext.company.set_custom_query(frm, v);
+		}
+	);
+
+	if (frm.doc.enable_perpetual_inventory) {
+		$.each(
+			[
+				["stock_adjustment_account", { root_type: "Expense", account_type: "Stock Adjustment" }],
+				[
+					"stock_received_but_not_billed",
+					{ root_type: "Liability", account_type: "Stock Received But Not Billed" },
+				],
+				[
+					"service_received_but_not_billed",
+					{ root_type: "Liability", account_type: "Service Received But Not Billed" },
+				],
+			],
+			function (i, v) {
+				erpnext.company.set_custom_query(frm, v);
+			}
+		);
+	}
+};
+
+erpnext.company.set_custom_query = function (frm, v) {
 	var filters = {
-		"company": frm.doc.name,
-		"is_group": 0
+		company: frm.doc.name,
+		is_group: 0,
 	};
 
 	for (var key in v[1]) {
 		filters[key] = v[1][key];
 	}
 
-	frm.set_query(v[0], function() {
+	frm.set_query(v[0], function () {
 		return {
-			filters: filters
-		}
+			filters: filters,
+		};
 	});
-}
+};
 
-var disbale_coa_fields = function(frm, bool=true) {
+var disbale_coa_fields = function (frm, bool = true) {
 	frm.set_df_property("create_chart_of_accounts_based_on", "read_only", bool);
 	frm.set_df_property("chart_of_accounts", "read_only", bool);
 	frm.set_df_property("existing_company", "read_only", bool);
-}
+};
diff --git a/erpnext/setup/doctype/company/company_list.js b/erpnext/setup/doctype/company/company_list.js
index 1d1184f..558e750 100644
--- a/erpnext/setup/doctype/company/company_list.js
+++ b/erpnext/setup/doctype/company/company_list.js
@@ -1,5 +1,5 @@
-frappe.listview_settings['Company'] = {
+frappe.listview_settings["Company"] = {
 	onload() {
-		frappe.breadcrumbs.add('Accounts');
+		frappe.breadcrumbs.add("Accounts");
 	},
 };
diff --git a/erpnext/setup/doctype/company/company_tree.js b/erpnext/setup/doctype/company/company_tree.js
index 160481c..0ee55df 100644
--- a/erpnext/setup/doctype/company/company_tree.js
+++ b/erpnext/setup/doctype/company/company_tree.js
@@ -1,18 +1,18 @@
 frappe.treeview_settings["Company"] = {
-	ignore_fields:["parent_company"],
-	get_tree_nodes: 'erpnext.setup.doctype.company.company.get_children',
-	add_tree_node: 'erpnext.setup.doctype.company.company.add_node',
+	ignore_fields: ["parent_company"],
+	get_tree_nodes: "erpnext.setup.doctype.company.company.get_children",
+	add_tree_node: "erpnext.setup.doctype.company.company.add_node",
 	filters: [
 		{
 			fieldname: "company",
-			fieldtype:"Link",
+			fieldtype: "Link",
 			options: "Company",
 			label: __("Company"),
-			get_query: function() {
+			get_query: function () {
 				return {
-					filters: [["Company", 'is_group', '=', 1]]
+					filters: [["Company", "is_group", "=", 1]],
 				};
-			}
+			},
 		},
 	],
 	breadcrumb: "Setup",
@@ -21,13 +21,13 @@
 	menu_items: [
 		{
 			label: __("New Company"),
-			action: function() {
+			action: function () {
 				frappe.new_doc("Company", true);
 			},
-			condition: 'frappe.boot.user.can_create.indexOf("Company") !== -1'
-		}
+			condition: 'frappe.boot.user.can_create.indexOf("Company") !== -1',
+		},
 	],
-	onload: function(treeview) {
+	onload: function (treeview) {
 		treeview.make_tree();
-	}
+	},
 };
diff --git a/erpnext/setup/doctype/currency_exchange/currency_exchange.js b/erpnext/setup/doctype/currency_exchange/currency_exchange.js
index 85036a1..82f0e22 100644
--- a/erpnext/setup/doctype/currency_exchange/currency_exchange.js
+++ b/erpnext/setup/doctype/currency_exchange/currency_exchange.js
@@ -2,29 +2,30 @@
 // License: GNU General Public License v3. See license.txt
 
 extend_cscript(cur_frm.cscript, {
-	onload: function() {
-		if(cur_frm.doc.__islocal) {
+	onload: function () {
+		if (cur_frm.doc.__islocal) {
 			cur_frm.set_value("to_currency", frappe.defaults.get_global_default("currency"));
 		}
 	},
 
-	refresh: function() {
+	refresh: function () {
 		cur_frm.cscript.set_exchange_rate_label();
 	},
 
-	from_currency: function() {
+	from_currency: function () {
 		cur_frm.cscript.set_exchange_rate_label();
 	},
 
-	to_currency: function() {
+	to_currency: function () {
 		cur_frm.cscript.set_exchange_rate_label();
 	},
 
-	set_exchange_rate_label: function() {
-		if(cur_frm.doc.from_currency && cur_frm.doc.to_currency) {
+	set_exchange_rate_label: function () {
+		if (cur_frm.doc.from_currency && cur_frm.doc.to_currency) {
 			var default_label = __(frappe.meta.docfield_map[cur_frm.doctype]["exchange_rate"].label);
-			cur_frm.fields_dict.exchange_rate.set_label(default_label +
-				repl(" (1 %(from_currency)s = [?] %(to_currency)s)", cur_frm.doc));
+			cur_frm.fields_dict.exchange_rate.set_label(
+				default_label + repl(" (1 %(from_currency)s = [?] %(to_currency)s)", cur_frm.doc)
+			);
 		}
-	}
+	},
 });
diff --git a/erpnext/setup/doctype/customer_group/customer_group.js b/erpnext/setup/doctype/customer_group/customer_group.js
index e352818..9d60a70 100644
--- a/erpnext/setup/doctype/customer_group/customer_group.js
+++ b/erpnext/setup/doctype/customer_group/customer_group.js
@@ -2,44 +2,44 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.ui.form.on("Customer Group", {
-	setup: function(frm){
-		frm.set_query('parent_customer_group', function (doc) {
+	setup: function (frm) {
+		frm.set_query("parent_customer_group", function (doc) {
 			return {
 				filters: {
-					'is_group': 1,
-					'name': ['!=', cur_frm.doc.customer_group_name]
-				}
-			}
+					is_group: 1,
+					name: ["!=", cur_frm.doc.customer_group_name],
+				},
+			};
 		});
 
-		frm.set_query('account', 'accounts', function (doc, cdt, cdn) {
+		frm.set_query("account", "accounts", function (doc, cdt, cdn) {
 			return {
 				filters: {
-					'root_type': 'Asset',
-					"account_type": 'Receivable',
-					"company": locals[cdt][cdn].company,
-					"is_group": 0
-				}
-			}
+					root_type: "Asset",
+					account_type: "Receivable",
+					company: locals[cdt][cdn].company,
+					is_group: 0,
+				},
+			};
 		});
 
-		frm.set_query('advance_account', 'accounts', function (doc, cdt, cdn) {
+		frm.set_query("advance_account", "accounts", function (doc, cdt, cdn) {
 			return {
 				filters: {
-					"root_type": 'Liability',
-					"account_type": "Receivable",
-					"company": locals[cdt][cdn].company,
-					"is_group": 0
-				}
-			}
+					root_type: "Liability",
+					account_type: "Receivable",
+					company: locals[cdt][cdn].company,
+					is_group: 0,
+				},
+			};
 		});
 	},
-	refresh: function(frm) {
+	refresh: function (frm) {
 		frm.trigger("set_root_readonly");
 	},
-	set_root_readonly: function(frm) {
+	set_root_readonly: function (frm) {
 		// read-only for root customer group
-		if(!frm.doc.parent_customer_group && !frm.doc.__islocal) {
+		if (!frm.doc.parent_customer_group && !frm.doc.__islocal) {
 			frm.set_read_only();
 			frm.set_intro(__("This is a root customer group and cannot be edited."));
 		} else {
diff --git a/erpnext/setup/doctype/customer_group/customer_group_tree.js b/erpnext/setup/doctype/customer_group/customer_group_tree.js
index d50e9c8..151fb2c 100644
--- a/erpnext/setup/doctype/customer_group/customer_group_tree.js
+++ b/erpnext/setup/doctype/customer_group/customer_group_tree.js
@@ -1,3 +1,3 @@
 frappe.treeview_settings["Customer Group"] = {
-	ignore_fields:["parent_customer_group"]
-}
+	ignore_fields: ["parent_customer_group"],
+};
diff --git a/erpnext/setup/doctype/department/department.js b/erpnext/setup/doctype/department/department.js
index 322eea5..d703a52 100644
--- a/erpnext/setup/doctype/department/department.js
+++ b/erpnext/setup/doctype/department/department.js
@@ -2,21 +2,21 @@
 // For license information, please see license.txt
 
 frappe.ui.form.on("Department", {
-	onload: function(frm) {
-		frm.set_query("parent_department", function() {
-			return {"filters": [["Department", "is_group", "=", 1]]};
+	onload: function (frm) {
+		frm.set_query("parent_department", function () {
+			return { filters: [["Department", "is_group", "=", 1]] };
 		});
 	},
-	refresh: function(frm) {
+	refresh: function (frm) {
 		// read-only for root department
-		if(!frm.doc.parent_department && !frm.is_new()) {
+		if (!frm.doc.parent_department && !frm.is_new()) {
 			frm.set_read_only();
 			frm.set_intro(__("This is a root department and cannot be edited."));
 		}
 	},
-	validate: function(frm) {
-		if(frm.doc.name=="All Departments") {
+	validate: function (frm) {
+		if (frm.doc.name == "All Departments") {
 			frappe.throw(__("You cannot edit root node."));
 		}
-	}
+	},
 });
diff --git a/erpnext/setup/doctype/department/department_tree.js b/erpnext/setup/doctype/department/department_tree.js
index 9c1341b..7ca70af 100644
--- a/erpnext/setup/doctype/department/department_tree.js
+++ b/erpnext/setup/doctype/department/department_tree.js
@@ -1,11 +1,11 @@
 frappe.treeview_settings["Department"] = {
-	ignore_fields:["parent_department"],
-	get_tree_nodes: 'erpnext.setup.doctype.department.department.get_children',
-	add_tree_node: 'erpnext.setup.doctype.department.department.add_node',
+	ignore_fields: ["parent_department"],
+	get_tree_nodes: "erpnext.setup.doctype.department.department.get_children",
+	add_tree_node: "erpnext.setup.doctype.department.department.add_node",
 	filters: [
 		{
 			fieldname: "company",
-			fieldtype:"Link",
+			fieldtype: "Link",
 			options: "Company",
 			label: __("Company"),
 		},
@@ -16,13 +16,13 @@
 	menu_items: [
 		{
 			label: __("New Department"),
-			action: function() {
+			action: function () {
 				frappe.new_doc("Department", true);
 			},
-			condition: 'frappe.boot.user.can_create.indexOf("Department") !== -1'
-		}
+			condition: 'frappe.boot.user.can_create.indexOf("Department") !== -1',
+		},
 	],
-	onload: function(treeview) {
+	onload: function (treeview) {
 		treeview.make_tree();
-	}
+	},
 };
diff --git a/erpnext/setup/doctype/designation/designation.js b/erpnext/setup/doctype/designation/designation.js
index 952c73f..f68a032 100644
--- a/erpnext/setup/doctype/designation/designation.js
+++ b/erpnext/setup/doctype/designation/designation.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Designation', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Designation", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/setup/doctype/driver/driver.js b/erpnext/setup/doctype/driver/driver.js
index b3c24c1..0bd80ed 100644
--- a/erpnext/setup/doctype/driver/driver.js
+++ b/erpnext/setup/doctype/driver/driver.js
@@ -2,35 +2,35 @@
 // For license information, please see license.txt
 
 frappe.ui.form.on("Driver", {
-	setup: function(frm) {
-		frm.set_query("transporter", function() {
+	setup: function (frm) {
+		frm.set_query("transporter", function () {
 			return {
 				filters: {
-					is_transporter: 1
-				}
+					is_transporter: 1,
+				},
 			};
 		});
 	},
 
-	refresh: function(frm) {
-		frm.set_query("address", function() {
+	refresh: function (frm) {
+		frm.set_query("address", function () {
 			return {
 				filters: {
-					is_your_company_address: !frm.doc.transporter ? 1 : 0
-				}
+					is_your_company_address: !frm.doc.transporter ? 1 : 0,
+				},
 			};
 		});
 	},
 
-	transporter: function(frm, cdt, cdn) {
+	transporter: function (frm, cdt, cdn) {
 		// this assumes that supplier's address has same title as supplier's name
 		frappe.db
 			.get_doc("Address", null, { address_title: frm.doc.transporter })
-			.then(r => {
+			.then((r) => {
 				frappe.model.set_value(cdt, cdn, "address", r.name);
 			})
-			.catch(err => {
+			.catch((err) => {
 				console.log(err);
 			});
-	}
+	},
 });
diff --git a/erpnext/setup/doctype/email_digest/email_digest.js b/erpnext/setup/doctype/email_digest/email_digest.js
index c2c2710..c0a887e 100644
--- a/erpnext/setup/doctype/email_digest/email_digest.js
+++ b/erpnext/setup/doctype/email_digest/email_digest.js
@@ -2,30 +2,30 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.ui.form.on("Email Digest", {
-	refresh: function(frm) {
+	refresh: function (frm) {
 		if (!frm.is_new()) {
-			frm.add_custom_button(__('View Now'), function() {
+			frm.add_custom_button(__("View Now"), function () {
 				frappe.call({
-					method: 'erpnext.setup.doctype.email_digest.email_digest.get_digest_msg',
+					method: "erpnext.setup.doctype.email_digest.email_digest.get_digest_msg",
 					args: {
-						name: frm.doc.name
+						name: frm.doc.name,
 					},
-					callback: function(r) {
+					callback: function (r) {
 						let d = new frappe.ui.Dialog({
-							title: __('Email Digest: {0}', [frm.doc.name]),
-							width: 800
+							title: __("Email Digest: {0}", [frm.doc.name]),
+							width: 800,
 						});
 						$(d.body).html(r.message);
 						d.show();
-					}
+					},
 				});
 			});
 
-			frm.add_custom_button(__('Send Now'), function() {
-				return frm.call('send', null, () => {
-					frappe.show_alert({ message: __("Message Sent"), indicator: 'green'});
+			frm.add_custom_button(__("Send Now"), function () {
+				return frm.call("send", null, () => {
+					frappe.show_alert({ message: __("Message Sent"), indicator: "green" });
 				});
 			});
 		}
-	}
+	},
 });
diff --git a/erpnext/setup/doctype/employee/employee.js b/erpnext/setup/doctype/employee/employee.js
index efc3fd1..d165d42 100755
--- a/erpnext/setup/doctype/employee/employee.js
+++ b/erpnext/setup/doctype/employee/employee.js
@@ -4,14 +4,15 @@
 frappe.provide("erpnext.setup");
 erpnext.setup.EmployeeController = class EmployeeController extends frappe.ui.form.Controller {
 	setup() {
-		this.frm.fields_dict.user_id.get_query = function(doc, cdt, cdn) {
+		this.frm.fields_dict.user_id.get_query = function (doc, cdt, cdn) {
 			return {
 				query: "frappe.core.doctype.user.user.user_query",
-				filters: {ignore_user_type: 1}
-			}
-		}
-		this.frm.fields_dict.reports_to.get_query = function(doc, cdt, cdn) {
-			return { query: "erpnext.controllers.queries.employee_query"} }
+				filters: { ignore_user_type: 1 },
+			};
+		};
+		this.frm.fields_dict.reports_to.get_query = function (doc, cdt, cdn) {
+			return { query: "erpnext.controllers.queries.employee_query" };
+		};
 	}
 
 	refresh() {
@@ -20,58 +21,59 @@
 
 	salutation() {
 		if (this.frm.doc.salutation) {
-			this.frm.set_value("gender", {
-				"Mr": "Male",
-				"Ms": "Female"
-			}[this.frm.doc.salutation]);
+			this.frm.set_value(
+				"gender",
+				{
+					Mr: "Male",
+					Ms: "Female",
+				}[this.frm.doc.salutation]
+			);
 		}
 	}
-
 };
 
 frappe.ui.form.on("Employee", {
 	onload: function (frm) {
-		frm.set_query("department", function() {
+		frm.set_query("department", function () {
 			return {
-				"filters": {
-					"company": frm.doc.company,
-				}
+				filters: {
+					company: frm.doc.company,
+				},
 			};
 		});
 	},
-	prefered_contact_email: function(frm) {
+	prefered_contact_email: function (frm) {
 		frm.events.update_contact(frm);
 	},
 
-	personal_email: function(frm) {
+	personal_email: function (frm) {
 		frm.events.update_contact(frm);
 	},
 
-	company_email: function(frm) {
+	company_email: function (frm) {
 		frm.events.update_contact(frm);
 	},
 
-	user_id: function(frm) {
+	user_id: function (frm) {
 		frm.events.update_contact(frm);
 	},
 
-	update_contact: function(frm) {
-		var prefered_email_fieldname = frappe.model.scrub(frm.doc.prefered_contact_email) || 'user_id';
-		frm.set_value("prefered_email",
-			frm.fields_dict[prefered_email_fieldname].value);
+	update_contact: function (frm) {
+		var prefered_email_fieldname = frappe.model.scrub(frm.doc.prefered_contact_email) || "user_id";
+		frm.set_value("prefered_email", frm.fields_dict[prefered_email_fieldname].value);
 	},
 
-	status: function(frm) {
+	status: function (frm) {
 		return frm.call({
 			method: "deactivate_sales_person",
 			args: {
 				employee: frm.doc.employee,
-				status: frm.doc.status
-			}
+				status: frm.doc.status,
+			},
 		});
 	},
 
-	create_user: function(frm) {
+	create_user: function (frm) {
 		if (!frm.doc.prefered_email) {
 			frappe.throw(__("Please enter Preferred Contact Email"));
 		}
@@ -79,46 +81,53 @@
 			method: "erpnext.setup.doctype.employee.employee.create_user",
 			args: {
 				employee: frm.doc.name,
-				email: frm.doc.prefered_email
+				email: frm.doc.prefered_email,
 			},
 			freeze: true,
 			freeze_message: __("Creating User..."),
 			callback: function (r) {
 				frm.reload_doc();
-			}
+			},
 		});
-	}
+	},
 });
 
 cur_frm.cscript = new erpnext.setup.EmployeeController({
-	frm: cur_frm
+	frm: cur_frm,
 });
 
-
-frappe.tour['Employee'] = [
+frappe.tour["Employee"] = [
 	{
 		fieldname: "first_name",
 		title: "First Name",
-		description: __("Enter First and Last name of Employee, based on Which Full Name will be updated. IN transactions, it will be Full Name which will be fetched.")
+		description: __(
+			"Enter First and Last name of Employee, based on Which Full Name will be updated. IN transactions, it will be Full Name which will be fetched."
+		),
 	},
 	{
 		fieldname: "company",
 		title: "Company",
-		description: __("Select a Company this Employee belongs to.")
+		description: __("Select a Company this Employee belongs to."),
 	},
 	{
 		fieldname: "date_of_birth",
 		title: "Date of Birth",
-		description: __("Select Date of Birth. This will validate Employees age and prevent hiring of under-age staff.")
+		description: __(
+			"Select Date of Birth. This will validate Employees age and prevent hiring of under-age staff."
+		),
 	},
 	{
 		fieldname: "date_of_joining",
 		title: "Date of Joining",
-		description: __("Select Date of joining. It will have impact on the first salary calculation, Leave allocation on pro-rata bases.")
+		description: __(
+			"Select Date of joining. It will have impact on the first salary calculation, Leave allocation on pro-rata bases."
+		),
 	},
 	{
 		fieldname: "reports_to",
 		title: "Reports To",
-		description: __("Here, you can select a senior of this Employee. Based on this, Organization Chart will be populated.")
+		description: __(
+			"Here, you can select a senior of this Employee. Based on this, Organization Chart will be populated."
+		),
 	},
 ];
diff --git a/erpnext/setup/doctype/employee/employee_list.js b/erpnext/setup/doctype/employee/employee_list.js
index d37e149..0c97b62 100644
--- a/erpnext/setup/doctype/employee/employee_list.js
+++ b/erpnext/setup/doctype/employee/employee_list.js
@@ -1,9 +1,9 @@
-frappe.listview_settings['Employee'] = {
-	add_fields: ["status", "branch", "department", "designation","image"],
-	filters: [["status","=", "Active"]],
-	get_indicator: function(doc) {
+frappe.listview_settings["Employee"] = {
+	add_fields: ["status", "branch", "department", "designation", "image"],
+	filters: [["status", "=", "Active"]],
+	get_indicator: function (doc) {
 		var indicator = [__(doc.status), frappe.utils.guess_colour(doc.status), "status,=," + doc.status];
-		indicator[1] = {"Active": "green", "Inactive": "red", "Left": "gray", "Suspended": "orange"}[doc.status];
+		indicator[1] = { Active: "green", Inactive: "red", Left: "gray", Suspended: "orange" }[doc.status];
 		return indicator;
-	}
+	},
 };
diff --git a/erpnext/setup/doctype/employee/employee_tree.js b/erpnext/setup/doctype/employee/employee_tree.js
index 8f52cff..26a8971 100644
--- a/erpnext/setup/doctype/employee/employee_tree.js
+++ b/erpnext/setup/doctype/employee/employee_tree.js
@@ -1,13 +1,13 @@
-frappe.treeview_settings['Employee'] = {
+frappe.treeview_settings["Employee"] = {
 	get_tree_nodes: "erpnext.setup.doctype.employee.employee.get_children",
 	filters: [
 		{
 			fieldname: "company",
-			fieldtype:"Select",
-			options: ['All Companies'].concat(erpnext.utils.get_tree_options("company")),
+			fieldtype: "Select",
+			options: ["All Companies"].concat(erpnext.utils.get_tree_options("company")),
 			label: __("Company"),
-			default: erpnext.utils.get_tree_default("company")
-		}
+			default: erpnext.utils.get_tree_default("company"),
+		},
 	],
 	breadcrumb: "Hr",
 	disable_add_node: true,
@@ -15,22 +15,22 @@
 	toolbar: [
 		{ toggle_btn: true },
 		{
-			label:__("Edit"),
-			condition: function(node) {
+			label: __("Edit"),
+			condition: function (node) {
 				return !node.is_root;
 			},
-			click: function(node) {
+			click: function (node) {
 				frappe.set_route("Form", "Employee", node.data.value);
-			}
-		}
+			},
+		},
 	],
 	menu_items: [
 		{
 			label: __("New Employee"),
-			action: function() {
+			action: function () {
 				frappe.new_doc("Employee", true);
 			},
-			condition: 'frappe.boot.user.can_create.indexOf("Employee") !== -1'
-		}
+			condition: 'frappe.boot.user.can_create.indexOf("Employee") !== -1',
+		},
 	],
 };
diff --git a/erpnext/setup/doctype/employee_group/employee_group.js b/erpnext/setup/doctype/employee_group/employee_group.js
index 3db5718..0ffa877 100644
--- a/erpnext/setup/doctype/employee_group/employee_group.js
+++ b/erpnext/setup/doctype/employee_group/employee_group.js
@@ -1,6 +1,4 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Employee Group', {
-
-});
+frappe.ui.form.on("Employee Group", {});
diff --git a/erpnext/setup/doctype/global_defaults/global_defaults.js b/erpnext/setup/doctype/global_defaults/global_defaults.js
index 942dd59..20ac6da 100644
--- a/erpnext/setup/doctype/global_defaults/global_defaults.js
+++ b/erpnext/setup/doctype/global_defaults/global_defaults.js
@@ -1,14 +1,14 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.ui.form.on('Global Defaults', {
-	onload: function(frm) {
-		frm.trigger('get_distance_uoms');
+frappe.ui.form.on("Global Defaults", {
+	onload: function (frm) {
+		frm.trigger("get_distance_uoms");
 	},
-	validate: function(frm) {
-		frm.call('get_defaults', null, r => {
+	validate: function (frm) {
+		frm.call("get_defaults", null, (r) => {
 			frappe.sys_defaults = r.message;
-		})
+		});
 	},
 	get_distance_uoms: function (frm) {
 		let units = [];
@@ -17,16 +17,16 @@
 			method: "frappe.client.get_list",
 			args: {
 				doctype: "UOM Conversion Factor",
-				filters: { "category": __("Length") },
+				filters: { category: __("Length") },
 				fields: ["to_uom"],
-				limit_page_length: 500
+				limit_page_length: 500,
 			},
 			callback: function (r) {
-				r.message.forEach(row => units.push(row.to_uom));
-			}
+				r.message.forEach((row) => units.push(row.to_uom));
+			},
 		});
 		frm.set_query("default_distance_unit", function () {
-			return { filters: { "name": ["IN", units] } };
+			return { filters: { name: ["IN", units] } };
 		});
-	}
+	},
 });
diff --git a/erpnext/setup/doctype/holiday_list/holiday_list.js b/erpnext/setup/doctype/holiday_list/holiday_list.js
index 90d9f1b..1f95a73 100644
--- a/erpnext/setup/doctype/holiday_list/holiday_list.js
+++ b/erpnext/setup/doctype/holiday_list/holiday_list.js
@@ -2,12 +2,12 @@
 // For license information, please see license.txt
 
 frappe.ui.form.on("Holiday List", {
-	refresh: function(frm) {
+	refresh: function (frm) {
 		if (frm.doc.holidays) {
 			frm.set_value("total_holidays", frm.doc.holidays.length);
 		}
 
-		frm.call("get_supported_countries").then(r => {
+		frm.call("get_supported_countries").then((r) => {
 			frm.subdivisions_by_country = r.message.subdivisions_by_country;
 			frm.fields_dict.country.set_data(
 				r.message.countries.sort((a, b) => a.label.localeCompare(b.label))
@@ -18,20 +18,20 @@
 			}
 		});
 	},
-	from_date: function(frm) {
+	from_date: function (frm) {
 		if (frm.doc.from_date && !frm.doc.to_date) {
 			var a_year_from_start = frappe.datetime.add_months(frm.doc.from_date, 12);
 			frm.set_value("to_date", frappe.datetime.add_days(a_year_from_start, -1));
 		}
 	},
-	country: function(frm) {
+	country: function (frm) {
 		frm.set_value("subdivision", "");
 
 		if (frm.doc.country) {
 			frm.trigger("set_subdivisions");
 		}
 	},
-	set_subdivisions: function(frm) {
+	set_subdivisions: function (frm) {
 		const subdivisions = [...frm.subdivisions_by_country[frm.doc.country]];
 		if (subdivisions && subdivisions.length > 0) {
 			frm.fields_dict.subdivision.set_data(subdivisions);
@@ -67,11 +67,15 @@
 	{
 		fieldname: "get_weekly_off_dates",
 		title: "Add Holidays",
-		description: __("Click on Add to Holidays. This will populate the holidays table with all the dates that fall on the selected weekly off. Repeat the process for populating the dates for all your weekly holidays"),
+		description: __(
+			"Click on Add to Holidays. This will populate the holidays table with all the dates that fall on the selected weekly off. Repeat the process for populating the dates for all your weekly holidays"
+		),
 	},
 	{
 		fieldname: "holidays",
 		title: "Holidays",
-		description: __("Here, your weekly offs are pre-populated based on the previous selections. You can add more rows to also add public and national holidays individually.")
+		description: __(
+			"Here, your weekly offs are pre-populated based on the previous selections. You can add more rows to also add public and national holidays individually."
+		),
 	},
 ];
diff --git a/erpnext/setup/doctype/holiday_list/holiday_list_calendar.js b/erpnext/setup/doctype/holiday_list/holiday_list_calendar.js
index bb6d831..ff83088 100644
--- a/erpnext/setup/doctype/holiday_list/holiday_list_calendar.js
+++ b/erpnext/setup/doctype/holiday_list/holiday_list_calendar.js
@@ -3,20 +3,20 @@
 
 frappe.views.calendar["Holiday List"] = {
 	field_map: {
-		"start": "holiday_date",
-		"end": "holiday_date",
-		"id": "name",
-		"title": "description",
-		"allDay": "allDay"
+		start: "holiday_date",
+		end: "holiday_date",
+		id: "name",
+		title: "description",
+		allDay: "allDay",
 	},
 	order_by: `from_date`,
 	get_events_method: "erpnext.setup.doctype.holiday_list.holiday_list.get_events",
 	filters: [
 		{
-			'fieldtype': 'Link',
-			'fieldname': 'holiday_list',
-			'options': 'Holiday List',
-			'label': __('Holiday List')
-		}
-	]
-}
+			fieldtype: "Link",
+			fieldname: "holiday_list",
+			options: "Holiday List",
+			label: __("Holiday List"),
+		},
+	],
+};
diff --git a/erpnext/setup/doctype/item_group/item_group.js b/erpnext/setup/doctype/item_group/item_group.js
index d6eb11f..6835be1 100644
--- a/erpnext/setup/doctype/item_group/item_group.js
+++ b/erpnext/setup/doctype/item_group/item_group.js
@@ -2,85 +2,102 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.ui.form.on("Item Group", {
-	onload: function(frm) {
+	onload: function (frm) {
 		frm.list_route = "Tree/Item Group";
 
 		//get query select item group
-		frm.fields_dict['parent_item_group'].get_query = function(doc,cdt,cdn) {
-			return{
-				filters:[
-					['Item Group', 'is_group', '=', 1],
-					['Item Group', 'name', '!=', doc.item_group_name]
-				]
-			}
-		}
-		frm.fields_dict['item_group_defaults'].grid.get_field("default_discount_account").get_query = function(doc, cdt, cdn) {
-			const row = locals[cdt][cdn];
+		frm.fields_dict["parent_item_group"].get_query = function (doc, cdt, cdn) {
 			return {
-				filters: {
-					'report_type': 'Profit and Loss',
-					'company': row.company,
-					"is_group": 0
-				}
+				filters: [
+					["Item Group", "is_group", "=", 1],
+					["Item Group", "name", "!=", doc.item_group_name],
+				],
 			};
-		}
-		frm.fields_dict["item_group_defaults"].grid.get_field("expense_account").get_query = function(doc, cdt, cdn) {
+		};
+		frm.fields_dict["item_group_defaults"].grid.get_field("default_discount_account").get_query =
+			function (doc, cdt, cdn) {
+				const row = locals[cdt][cdn];
+				return {
+					filters: {
+						report_type: "Profit and Loss",
+						company: row.company,
+						is_group: 0,
+					},
+				};
+			};
+		frm.fields_dict["item_group_defaults"].grid.get_field("expense_account").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
 			const row = locals[cdt][cdn];
 			return {
 				query: "erpnext.controllers.queries.get_expense_account",
-				filters: { company: row.company }
-			}
-		}
-		frm.fields_dict["item_group_defaults"].grid.get_field("income_account").get_query = function(doc, cdt, cdn) {
+				filters: { company: row.company },
+			};
+		};
+		frm.fields_dict["item_group_defaults"].grid.get_field("income_account").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
 			const row = locals[cdt][cdn];
 			return {
 				query: "erpnext.controllers.queries.get_income_account",
-				filters: { company: row.company }
-			}
-		}
+				filters: { company: row.company },
+			};
+		};
 
-		frm.fields_dict["item_group_defaults"].grid.get_field("buying_cost_center").get_query = function(doc, cdt, cdn) {
+		frm.fields_dict["item_group_defaults"].grid.get_field("buying_cost_center").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
 			const row = locals[cdt][cdn];
 			return {
 				filters: {
-					"is_group": 0,
-					"company": row.company
-				}
-			}
-		}
+					is_group: 0,
+					company: row.company,
+				},
+			};
+		};
 
-		frm.fields_dict["item_group_defaults"].grid.get_field("selling_cost_center").get_query = function(doc, cdt, cdn) {
+		frm.fields_dict["item_group_defaults"].grid.get_field("selling_cost_center").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
 			const row = locals[cdt][cdn];
 			return {
 				filters: {
-					"is_group": 0,
-					"company": row.company
-				}
-			}
-		}
+					is_group: 0,
+					company: row.company,
+				},
+			};
+		};
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		frm.trigger("set_root_readonly");
-		frm.add_custom_button(__("Item Group Tree"), function() {
+		frm.add_custom_button(__("Item Group Tree"), function () {
 			frappe.set_route("Tree", "Item Group");
 		});
 
-		if(!frm.is_new()) {
-			frm.add_custom_button(__("Items"), function() {
-				frappe.set_route("List", "Item", {"item_group": frm.doc.name});
+		if (!frm.is_new()) {
+			frm.add_custom_button(__("Items"), function () {
+				frappe.set_route("List", "Item", { item_group: frm.doc.name });
 			});
 		}
 	},
 
-	set_root_readonly: function(frm) {
+	set_root_readonly: function (frm) {
 		// read-only for root item group
 		frm.set_intro("");
-		if(!frm.doc.parent_item_group && !frm.doc.__islocal) {
+		if (!frm.doc.parent_item_group && !frm.doc.__islocal) {
 			frm.set_read_only();
 			frm.set_intro(__("This is a root item group and cannot be edited."), true);
 		}
 	},
 
-	page_name: frappe.utils.warn_page_name_change
+	page_name: frappe.utils.warn_page_name_change,
 });
diff --git a/erpnext/setup/doctype/item_group/item_group_tree.js b/erpnext/setup/doctype/item_group/item_group_tree.js
index b2628f4..a7c2b63 100644
--- a/erpnext/setup/doctype/item_group/item_group_tree.js
+++ b/erpnext/setup/doctype/item_group/item_group_tree.js
@@ -1,3 +1,3 @@
 frappe.treeview_settings["Item Group"] = {
-	ignore_fields:["parent_item_group"]
-}
+	ignore_fields: ["parent_item_group"],
+};
diff --git a/erpnext/setup/doctype/party_type/party_type.js b/erpnext/setup/doctype/party_type/party_type.js
index 7a96dc5..9bbfd7d 100644
--- a/erpnext/setup/doctype/party_type/party_type.js
+++ b/erpnext/setup/doctype/party_type/party_type.js
@@ -1,15 +1,15 @@
 // Copyright (c) 2016, Frappe Technologies and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Party Type', {
-	setup: function(frm) {
-		frm.fields_dict["party_type"].get_query = function(frm) {
+frappe.ui.form.on("Party Type", {
+	setup: function (frm) {
+		frm.fields_dict["party_type"].get_query = function (frm) {
 			return {
 				filters: {
-					"istable": 0,
-					"is_submittable": 0
-				}
-			}
-		}
-	}
+					istable: 0,
+					is_submittable: 0,
+				},
+			};
+		};
+	},
 });
diff --git a/erpnext/setup/doctype/print_heading/print_heading.js b/erpnext/setup/doctype/print_heading/print_heading.js
index 3680906..273e30f 100644
--- a/erpnext/setup/doctype/print_heading/print_heading.js
+++ b/erpnext/setup/doctype/print_heading/print_heading.js
@@ -1,13 +1,7 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-
-
 //--------- ONLOAD -------------
-cur_frm.cscript.onload = function(doc, cdt, cdn) {
+cur_frm.cscript.onload = function (doc, cdt, cdn) {};
 
-}
-
-cur_frm.cscript.refresh = function(doc, cdt, cdn) {
-
-}
+cur_frm.cscript.refresh = function (doc, cdt, cdn) {};
diff --git a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.js b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.js
index 3680906..273e30f 100644
--- a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.js
+++ b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.js
@@ -1,13 +1,7 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-
-
 //--------- ONLOAD -------------
-cur_frm.cscript.onload = function(doc, cdt, cdn) {
+cur_frm.cscript.onload = function (doc, cdt, cdn) {};
 
-}
-
-cur_frm.cscript.refresh = function(doc, cdt, cdn) {
-
-}
+cur_frm.cscript.refresh = function (doc, cdt, cdn) {};
diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.js b/erpnext/setup/doctype/sales_partner/sales_partner.js
index f9e3770..f6b3dd2 100644
--- a/erpnext/setup/doctype/sales_partner/sales_partner.js
+++ b/erpnext/setup/doctype/sales_partner/sales_partner.js
@@ -1,32 +1,31 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.ui.form.on('Sales Partner', {
-	refresh: function(frm) {
-		if(frm.doc.__islocal){
-			hide_field(['address_html', 'contact_html', 'address_contacts']);
+frappe.ui.form.on("Sales Partner", {
+	refresh: function (frm) {
+		if (frm.doc.__islocal) {
+			hide_field(["address_html", "contact_html", "address_contacts"]);
 			frappe.contacts.clear_address_and_contact(frm);
-		}
-		else{
-			unhide_field(['address_html', 'contact_html', 'address_contacts']);
+		} else {
+			unhide_field(["address_html", "contact_html", "address_contacts"]);
 			frappe.contacts.render_address_and_contact(frm);
 		}
 	},
 
-	setup: function(frm) {
-		frm.fields_dict["targets"].grid.get_field("distribution_id").get_query = function(doc, cdt, cdn){
+	setup: function (frm) {
+		frm.fields_dict["targets"].grid.get_field("distribution_id").get_query = function (doc, cdt, cdn) {
 			var row = locals[cdt][cdn];
 			return {
 				filters: {
-					'fiscal_year': row.fiscal_year
-				}
-			}
+					fiscal_year: row.fiscal_year,
+				},
+			};
 		};
 	},
-	referral_code:function(frm){
+	referral_code: function (frm) {
 		if (frm.doc.referral_code) {
-			frm.doc.referral_code=frm.doc.referral_code.toUpperCase();
-			frm.refresh_field('referral_code');
+			frm.doc.referral_code = frm.doc.referral_code.toUpperCase();
+			frm.refresh_field("referral_code");
 		}
-	}
+	},
 });
diff --git a/erpnext/setup/doctype/sales_person/sales_person.js b/erpnext/setup/doctype/sales_person/sales_person.js
index f0d9aa8..127bdac 100644
--- a/erpnext/setup/doctype/sales_person/sales_person.js
+++ b/erpnext/setup/doctype/sales_person/sales_person.js
@@ -1,56 +1,65 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.ui.form.on('Sales Person', {
-	refresh: function(frm) {
-		if(frm.doc.__onload && frm.doc.__onload.dashboard_info) {
+frappe.ui.form.on("Sales Person", {
+	refresh: function (frm) {
+		if (frm.doc.__onload && frm.doc.__onload.dashboard_info) {
 			let info = frm.doc.__onload.dashboard_info;
-			frm.dashboard.add_indicator(__('Total Contribution Amount Against Orders: {0}',
-				[format_currency(info.allocated_amount_against_order, info.currency)]), 'blue');
+			frm.dashboard.add_indicator(
+				__("Total Contribution Amount Against Orders: {0}", [
+					format_currency(info.allocated_amount_against_order, info.currency),
+				]),
+				"blue"
+			);
 
-			frm.dashboard.add_indicator(__('Total Contribution Amount Against Invoices: {0}',
-				[format_currency(info.allocated_amount_against_invoice, info.currency)]), 'blue');
+			frm.dashboard.add_indicator(
+				__("Total Contribution Amount Against Invoices: {0}", [
+					format_currency(info.allocated_amount_against_invoice, info.currency),
+				]),
+				"blue"
+			);
 		}
 		frm.trigger("set_root_readonly");
 	},
 
-	setup: function(frm) {
-		frm.fields_dict["targets"].grid.get_field("distribution_id").get_query = function(doc, cdt, cdn){
+	setup: function (frm) {
+		frm.fields_dict["targets"].grid.get_field("distribution_id").get_query = function (doc, cdt, cdn) {
 			var row = locals[cdt][cdn];
 			return {
 				filters: {
-					'fiscal_year': row.fiscal_year
-				}
-			}
+					fiscal_year: row.fiscal_year,
+				},
+			};
 		};
 
 		frm.make_methods = {
-			'Sales Order': () => frappe.new_doc("Sales Order")
-				.then(() => frm.add_child("sales_team", {"sales_person": frm.doc.name}))
-		}
+			"Sales Order": () =>
+				frappe
+					.new_doc("Sales Order")
+					.then(() => frm.add_child("sales_team", { sales_person: frm.doc.name })),
+		};
 	},
-	set_root_readonly: function(frm) {
+	set_root_readonly: function (frm) {
 		// read-only for root
-		if(!frm.doc.parent_sales_person && !frm.doc.__islocal) {
+		if (!frm.doc.parent_sales_person && !frm.doc.__islocal) {
 			frm.set_read_only();
 			frm.set_intro(__("This is a root sales person and cannot be edited."));
 		} else {
 			frm.set_intro(null);
 		}
-	}
+	},
 });
 
-
 //get query select sales person
-cur_frm.fields_dict['parent_sales_person'].get_query = function(doc, cdt, cdn) {
-	return{
+cur_frm.fields_dict["parent_sales_person"].get_query = function (doc, cdt, cdn) {
+	return {
 		filters: [
-			['Sales Person', 'is_group', '=', 1],
-			['Sales Person', 'name', '!=', doc.sales_person_name]
-		]
-	}
-}
+			["Sales Person", "is_group", "=", 1],
+			["Sales Person", "name", "!=", doc.sales_person_name],
+		],
+	};
+};
 
-cur_frm.fields_dict.employee.get_query = function(doc, cdt, cdn) {
-	return { query: "erpnext.controllers.queries.employee_query" }
-}
+cur_frm.fields_dict.employee.get_query = function (doc, cdt, cdn) {
+	return { query: "erpnext.controllers.queries.employee_query" };
+};
diff --git a/erpnext/setup/doctype/sales_person/sales_person_tree.js b/erpnext/setup/doctype/sales_person/sales_person_tree.js
index 00056fd..0fcd592 100644
--- a/erpnext/setup/doctype/sales_person/sales_person_tree.js
+++ b/erpnext/setup/doctype/sales_person/sales_person_tree.js
@@ -1,12 +1,18 @@
-
 frappe.treeview_settings["Sales Person"] = {
 	fields: [
-		{fieldtype:'Data', fieldname: 'sales_person_name',
-			label:__('New Sales Person Name'), reqd:true},
-		{fieldtype:'Link', fieldname:'employee',
-			label:__('Employee'), options:'Employee',
-			description: __("Please enter Employee Id of this sales person")},
-		{fieldtype:'Check', fieldname:'is_group', label:__('Group Node'),
-			description: __("Further nodes can be only created under 'Group' type nodes")}
+		{ fieldtype: "Data", fieldname: "sales_person_name", label: __("New Sales Person Name"), reqd: true },
+		{
+			fieldtype: "Link",
+			fieldname: "employee",
+			label: __("Employee"),
+			options: "Employee",
+			description: __("Please enter Employee Id of this sales person"),
+		},
+		{
+			fieldtype: "Check",
+			fieldname: "is_group",
+			label: __("Group Node"),
+			description: __("Further nodes can be only created under 'Group' type nodes"),
+		},
 	],
-}
+};
diff --git a/erpnext/setup/doctype/supplier_group/supplier_group.js b/erpnext/setup/doctype/supplier_group/supplier_group.js
index c697a99..d720b3b 100644
--- a/erpnext/setup/doctype/supplier_group/supplier_group.js
+++ b/erpnext/setup/doctype/supplier_group/supplier_group.js
@@ -2,48 +2,48 @@
 // For license information, please see license.txt
 
 frappe.ui.form.on("Supplier Group", {
-	setup: function(frm){
-		frm.set_query('parent_supplier_group', function (doc) {
+	setup: function (frm) {
+		frm.set_query("parent_supplier_group", function (doc) {
 			return {
 				filters: {
-					'is_group': 1,
-					'name': ['!=', cur_frm.doc.supplier_group_name]
-				}
-			}
+					is_group: 1,
+					name: ["!=", cur_frm.doc.supplier_group_name],
+				},
+			};
 		});
 
-		frm.set_query('account', 'accounts', function (doc, cdt, cdn) {
+		frm.set_query("account", "accounts", function (doc, cdt, cdn) {
 			return {
 				filters: {
-					'root_type': 'Liability',
-					'account_type': 'Payable',
-					'company': locals[cdt][cdn].company,
-					"is_group": 0
-				}
-			}
+					root_type: "Liability",
+					account_type: "Payable",
+					company: locals[cdt][cdn].company,
+					is_group: 0,
+				},
+			};
 		});
 
-		frm.set_query('advance_account', 'accounts', function (doc, cdt, cdn) {
+		frm.set_query("advance_account", "accounts", function (doc, cdt, cdn) {
 			return {
 				filters: {
-					"root_type": 'Asset',
-					"account_type": "Payable",
-					"company": locals[cdt][cdn].company,
-					"is_group": 0
-				}
-			}
+					root_type: "Asset",
+					account_type: "Payable",
+					company: locals[cdt][cdn].company,
+					is_group: 0,
+				},
+			};
 		});
 	},
-	refresh: function(frm) {
+	refresh: function (frm) {
 		frm.set_intro(frm.doc.__islocal ? "" : __("There is nothing to edit."));
 		frm.trigger("set_root_readonly");
 	},
-	set_root_readonly: function(frm) {
-		if(!frm.doc.parent_supplier_group && !frm.doc.__islocal) {
+	set_root_readonly: function (frm) {
+		if (!frm.doc.parent_supplier_group && !frm.doc.__islocal) {
 			frm.trigger("set_read_only");
 			frm.set_intro(__("This is a root supplier group and cannot be edited."));
 		} else {
 			frm.set_intro(null);
 		}
-	}
+	},
 });
diff --git a/erpnext/setup/doctype/supplier_group/supplier_group_tree.js b/erpnext/setup/doctype/supplier_group/supplier_group_tree.js
index 728793e..9210dc1 100644
--- a/erpnext/setup/doctype/supplier_group/supplier_group_tree.js
+++ b/erpnext/setup/doctype/supplier_group/supplier_group_tree.js
@@ -1,4 +1,4 @@
 frappe.treeview_settings["Supplier Group"] = {
 	breadcrumbs: "Buying",
-	ignore_fields:["parent_supplier_group"]
+	ignore_fields: ["parent_supplier_group"],
 };
diff --git a/erpnext/setup/doctype/territory/territory.js b/erpnext/setup/doctype/territory/territory.js
index e11d20b..62fab45 100644
--- a/erpnext/setup/doctype/territory/territory.js
+++ b/erpnext/setup/doctype/territory/territory.js
@@ -2,37 +2,36 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.ui.form.on("Territory", {
-	setup: function(frm) {
-		frm.fields_dict["targets"].grid.get_field("distribution_id").get_query = function(doc, cdt, cdn){
+	setup: function (frm) {
+		frm.fields_dict["targets"].grid.get_field("distribution_id").get_query = function (doc, cdt, cdn) {
 			var row = locals[cdt][cdn];
 			return {
 				filters: {
-					'fiscal_year': row.fiscal_year
-				}
-			}
+					fiscal_year: row.fiscal_year,
+				},
+			};
 		};
 	},
-	refresh: function(frm) {
+	refresh: function (frm) {
 		frm.trigger("set_root_readonly");
 	},
-	set_root_readonly: function(frm) {
+	set_root_readonly: function (frm) {
 		// read-only for root territory
-		if(!frm.doc.parent_territory && !frm.doc.__islocal) {
+		if (!frm.doc.parent_territory && !frm.doc.__islocal) {
 			frm.set_read_only();
 			frm.set_intro(__("This is a root territory and cannot be edited."));
 		} else {
 			frm.set_intro(null);
 		}
-	}
-
+	},
 });
 
 //get query select territory
-cur_frm.fields_dict['parent_territory'].get_query = function(doc,cdt,cdn) {
-	return{
-		filters:[
-			['Territory', 'is_group', '=', 1],
-			['Territory', 'name', '!=', doc.territory_name]
-		]
-	}
-}
+cur_frm.fields_dict["parent_territory"].get_query = function (doc, cdt, cdn) {
+	return {
+		filters: [
+			["Territory", "is_group", "=", 1],
+			["Territory", "name", "!=", doc.territory_name],
+		],
+	};
+};
diff --git a/erpnext/setup/doctype/territory/territory_tree.js b/erpnext/setup/doctype/territory/territory_tree.js
index dadeeef..4892b8c 100644
--- a/erpnext/setup/doctype/territory/territory_tree.js
+++ b/erpnext/setup/doctype/territory/territory_tree.js
@@ -1,3 +1,3 @@
 frappe.treeview_settings["Territory"] = {
-	ignore_fields:["parent_territory"]
-}
+	ignore_fields: ["parent_territory"],
+};
diff --git a/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.js b/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.js
index a7b0709..527c753 100644
--- a/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.js
+++ b/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.js
@@ -1,39 +1,38 @@
 // Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Transaction Deletion Record', {
-	onload: function(frm) {
+frappe.ui.form.on("Transaction Deletion Record", {
+	onload: function (frm) {
 		if (frm.doc.docstatus == 0) {
 			let doctypes_to_be_ignored_array;
 			frappe.call({
-				method: 'erpnext.setup.doctype.transaction_deletion_record.transaction_deletion_record.get_doctypes_to_be_ignored',
-				callback: function(r) {
+				method: "erpnext.setup.doctype.transaction_deletion_record.transaction_deletion_record.get_doctypes_to_be_ignored",
+				callback: function (r) {
 					doctypes_to_be_ignored_array = r.message;
 					populate_doctypes_to_be_ignored(doctypes_to_be_ignored_array, frm);
-					frm.fields_dict['doctypes_to_be_ignored'].grid.set_column_disp('no_of_docs', false);
-					frm.refresh_field('doctypes_to_be_ignored');
-				}
+					frm.fields_dict["doctypes_to_be_ignored"].grid.set_column_disp("no_of_docs", false);
+					frm.refresh_field("doctypes_to_be_ignored");
+				},
 			});
 		}
 
-		frm.get_field('doctypes_to_be_ignored').grid.cannot_add_rows = true;
-		frm.fields_dict['doctypes_to_be_ignored'].grid.set_column_disp('no_of_docs', false);
-		frm.refresh_field('doctypes_to_be_ignored');
+		frm.get_field("doctypes_to_be_ignored").grid.cannot_add_rows = true;
+		frm.fields_dict["doctypes_to_be_ignored"].grid.set_column_disp("no_of_docs", false);
+		frm.refresh_field("doctypes_to_be_ignored");
 	},
 
-	refresh: function(frm) {
-		frm.fields_dict['doctypes_to_be_ignored'].grid.set_column_disp('no_of_docs', false);
-		frm.refresh_field('doctypes_to_be_ignored');
-	}
-
+	refresh: function (frm) {
+		frm.fields_dict["doctypes_to_be_ignored"].grid.set_column_disp("no_of_docs", false);
+		frm.refresh_field("doctypes_to_be_ignored");
+	},
 });
 
 function populate_doctypes_to_be_ignored(doctypes_to_be_ignored_array, frm) {
 	if (frm.doc.doctypes_to_be_ignored.length === 0) {
 		var i;
 		for (i = 0; i < doctypes_to_be_ignored_array.length; i++) {
-			frm.add_child('doctypes_to_be_ignored', {
-				doctype_name: doctypes_to_be_ignored_array[i]
+			frm.add_child("doctypes_to_be_ignored", {
+				doctype_name: doctypes_to_be_ignored_array[i],
 			});
 		}
 	}
diff --git a/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record_list.js b/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record_list.js
index c238f18..08a35df 100644
--- a/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record_list.js
+++ b/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record_list.js
@@ -1,12 +1,12 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.listview_settings['Transaction Deletion Record'] = {
-	get_indicator: function(doc) {
+frappe.listview_settings["Transaction Deletion Record"] = {
+	get_indicator: function (doc) {
 		if (doc.docstatus == 0) {
 			return [__("Draft"), "red"];
 		} else {
 			return [__("Completed"), "green"];
 		}
-	}
+	},
 };
diff --git a/erpnext/setup/doctype/uom/uom.js b/erpnext/setup/doctype/uom/uom.js
index 3680906..273e30f 100644
--- a/erpnext/setup/doctype/uom/uom.js
+++ b/erpnext/setup/doctype/uom/uom.js
@@ -1,13 +1,7 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-
-
 //--------- ONLOAD -------------
-cur_frm.cscript.onload = function(doc, cdt, cdn) {
+cur_frm.cscript.onload = function (doc, cdt, cdn) {};
 
-}
-
-cur_frm.cscript.refresh = function(doc, cdt, cdn) {
-
-}
+cur_frm.cscript.refresh = function (doc, cdt, cdn) {};
diff --git a/erpnext/setup/doctype/uom_conversion_factor/uom_conversion_factor.js b/erpnext/setup/doctype/uom_conversion_factor/uom_conversion_factor.js
index e734d83..e975729 100644
--- a/erpnext/setup/doctype/uom_conversion_factor/uom_conversion_factor.js
+++ b/erpnext/setup/doctype/uom_conversion_factor/uom_conversion_factor.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('UOM Conversion Factor', {
-	refresh: function() {
-
-	}
+frappe.ui.form.on("UOM Conversion Factor", {
+	refresh: function () {},
 });
diff --git a/erpnext/setup/doctype/vehicle/vehicle.js b/erpnext/setup/doctype/vehicle/vehicle.js
index f12c434..9d598a9 100644
--- a/erpnext/setup/doctype/vehicle/vehicle.js
+++ b/erpnext/setup/doctype/vehicle/vehicle.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Vehicle', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Vehicle", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/stock/dashboard/item_dashboard.js b/erpnext/stock/dashboard/item_dashboard.js
index e02abb4..36a5105 100644
--- a/erpnext/stock/dashboard/item_dashboard.js
+++ b/erpnext/stock/dashboard/item_dashboard.js
@@ -1,4 +1,4 @@
-frappe.provide('erpnext.stock');
+frappe.provide("erpnext.stock");
 
 erpnext.stock.ItemDashboard = class ItemDashboard {
 	constructor(opts) {
@@ -9,46 +9,51 @@
 		var me = this;
 		this.start = 0;
 		if (!this.sort_by) {
-			this.sort_by = 'projected_qty';
-			this.sort_order = 'asc';
+			this.sort_by = "projected_qty";
+			this.sort_order = "asc";
 		}
 
-		this.content = $(frappe.render_template('item_dashboard')).appendTo(this.parent);
-		this.result = this.content.find('.result');
+		this.content = $(frappe.render_template("item_dashboard")).appendTo(this.parent);
+		this.result = this.content.find(".result");
 
-		this.content.on('click', '.btn-move', function () {
+		this.content.on("click", ".btn-move", function () {
 			handle_move_add($(this), "Move");
 		});
 
-		this.content.on('click', '.btn-add', function () {
+		this.content.on("click", ".btn-add", function () {
 			handle_move_add($(this), "Add");
 		});
 
-		this.content.on('click', '.btn-edit', function () {
-			let item = unescape($(this).attr('data-item'));
-			let warehouse = unescape($(this).attr('data-warehouse'));
-			let company = unescape($(this).attr('data-company'));
-			frappe.db.get_value('Putaway Rule', {
-				'item_code': item,
-				'warehouse': warehouse,
-				'company': company
-			}, 'name', (r) => {
-				frappe.set_route("Form", "Putaway Rule", r.name);
-			});
+		this.content.on("click", ".btn-edit", function () {
+			let item = unescape($(this).attr("data-item"));
+			let warehouse = unescape($(this).attr("data-warehouse"));
+			let company = unescape($(this).attr("data-company"));
+			frappe.db.get_value(
+				"Putaway Rule",
+				{
+					item_code: item,
+					warehouse: warehouse,
+					company: company,
+				},
+				"name",
+				(r) => {
+					frappe.set_route("Form", "Putaway Rule", r.name);
+				}
+			);
 		});
 
 		function handle_move_add(element, action) {
-			let item = unescape(element.attr('data-item'));
-			let warehouse = unescape(element.attr('data-warehouse'));
-			let actual_qty = unescape(element.attr('data-actual_qty'));
-			let disable_quick_entry = Number(unescape(element.attr('data-disable_quick_entry')));
+			let item = unescape(element.attr("data-item"));
+			let warehouse = unescape(element.attr("data-warehouse"));
+			let actual_qty = unescape(element.attr("data-actual_qty"));
+			let disable_quick_entry = Number(unescape(element.attr("data-disable_quick_entry")));
 			let entry_type = action === "Move" ? "Material Transfer" : "Material Receipt";
 
 			if (disable_quick_entry) {
 				open_stock_entry(item, warehouse, entry_type);
 			} else {
 				if (action === "Add") {
-					let rate = unescape($(this).attr('data-rate'));
+					let rate = unescape($(this).attr("data-rate"));
 					erpnext.stock.move_item(item, null, warehouse, actual_qty, rate, function () {
 						me.refresh();
 					});
@@ -61,35 +66,33 @@
 		}
 
 		function open_stock_entry(item, warehouse, entry_type) {
-			frappe.model.with_doctype('Stock Entry', function () {
-				var doc = frappe.model.get_new_doc('Stock Entry');
+			frappe.model.with_doctype("Stock Entry", function () {
+				var doc = frappe.model.get_new_doc("Stock Entry");
 				if (entry_type) {
 					doc.stock_entry_type = entry_type;
 				}
 
-				var row = frappe.model.add_child(doc, 'items');
+				var row = frappe.model.add_child(doc, "items");
 				row.item_code = item;
 
 				if (entry_type === "Material Transfer") {
 					row.s_warehouse = warehouse;
-				}
-				else {
+				} else {
 					row.t_warehouse = warehouse;
 				}
 
-				frappe.set_route('Form', doc.doctype, doc.name);
+				frappe.set_route("Form", doc.doctype, doc.name);
 			});
 		}
 
 		// more
-		this.content.find('.btn-more').on('click', function () {
+		this.content.find(".btn-more").on("click", function () {
 			me.start += me.page_length;
 			me.refresh();
 		});
-
 	}
 	refresh() {
-		if(this.before_refresh) {
+		if (this.before_refresh) {
 			this.before_refresh();
 		}
 
@@ -101,7 +104,7 @@
 			company: this.company,
 			start: this.start,
 			sort_by: this.sort_by,
-			sort_order: this.sort_order
+			sort_order: this.sort_order,
 		};
 
 		var me = this;
@@ -110,14 +113,14 @@
 			args: args,
 			callback: function (r) {
 				me.render(r.message);
-				if(me.after_refresh) {
+				if (me.after_refresh) {
 					me.after_refresh();
 				}
-			}
+			},
 		});
 	}
 	render(data) {
-		if (this.start===0) {
+		if (this.start === 0) {
 			this.max_count = 0;
 			this.result.empty();
 		}
@@ -130,22 +133,22 @@
 		}
 
 		// show more button
-		if (data && data.length === (this.page_length + 1)) {
-			this.content.find('.more').removeClass('hidden');
+		if (data && data.length === this.page_length + 1) {
+			this.content.find(".more").removeClass("hidden");
 
 			// remove the last element
 			data.splice(-1);
 		} else {
-			this.content.find('.more').addClass('hidden');
+			this.content.find(".more").addClass("hidden");
 		}
 
 		// If not any stock in any warehouses provide a message to end user
 		if (context.data.length > 0) {
-			this.content.find('.result').css('text-align', 'unset');
+			this.content.find(".result").css("text-align", "unset");
 			$(frappe.render_template(this.template, context)).appendTo(this.result);
 		} else {
 			var message = __("No Stock Available Currently");
-			this.content.find('.result').css('text-align', 'center');
+			this.content.find(".result").css("text-align", "center");
 
 			$(`<div class='text-muted' style='margin: 20px 5px;'>
 				${message} </div>`).appendTo(this.result);
@@ -153,19 +156,23 @@
 	}
 
 	get_item_dashboard_data(data, max_count, show_item) {
-		if(!max_count) max_count = 0;
-		if(!data) data = [];
+		if (!max_count) max_count = 0;
+		if (!data) data = [];
 
 		data.forEach(function (d) {
-			d.actual_or_pending = d.projected_qty + d.reserved_qty + d.reserved_qty_for_production + d.reserved_qty_for_sub_contract;
+			d.actual_or_pending =
+				d.projected_qty +
+				d.reserved_qty +
+				d.reserved_qty_for_production +
+				d.reserved_qty_for_sub_contract;
 			d.pending_qty = 0;
-			d.total_reserved = d.reserved_qty + d.reserved_qty_for_production + d.reserved_qty_for_sub_contract;
+			d.total_reserved =
+				d.reserved_qty + d.reserved_qty_for_production + d.reserved_qty_for_sub_contract;
 			if (d.actual_or_pending > d.actual_qty) {
 				d.pending_qty = d.actual_or_pending - d.actual_qty;
 			}
 
-			max_count = Math.max(d.actual_or_pending, d.actual_qty,
-				d.total_reserved, max_count);
+			max_count = Math.max(d.actual_or_pending, d.actual_qty, d.total_reserved, max_count);
 		});
 
 		let can_write = 0;
@@ -177,7 +184,7 @@
 			data: data,
 			max_count: max_count,
 			can_write: can_write,
-			show_item: show_item || false
+			show_item: show_item || false,
 		};
 	}
 
@@ -202,73 +209,74 @@
 
 erpnext.stock.move_item = function (item, source, target, actual_qty, rate, callback) {
 	var dialog = new frappe.ui.Dialog({
-		title: target ? __('Add Item') : __('Move Item'),
-		fields: [{
-			fieldname: 'item_code',
-			label: __('Item'),
-			fieldtype: 'Link',
-			options: 'Item',
-			read_only: 1
-		},
-		{
-			fieldname: 'source',
-			label: __('Source Warehouse'),
-			fieldtype: 'Link',
-			options: 'Warehouse',
-			read_only: 1
-		},
-		{
-			fieldname: 'target',
-			label: __('Target Warehouse'),
-			fieldtype: 'Link',
-			options: 'Warehouse',
-			reqd: 1,
-			get_query() {
-				return {
-					filters: {
-						is_group: 0
-					}
-				}
-			}
-		},
-		{
-			fieldname: 'qty',
-			label: __('Quantity'),
-			reqd: 1,
-			fieldtype: 'Float',
-			description: __('Available {0}', [actual_qty])
-		},
-		{
-			fieldname: 'rate',
-			label: __('Rate'),
-			fieldtype: 'Currency',
-			hidden: 1
-		},
+		title: target ? __("Add Item") : __("Move Item"),
+		fields: [
+			{
+				fieldname: "item_code",
+				label: __("Item"),
+				fieldtype: "Link",
+				options: "Item",
+				read_only: 1,
+			},
+			{
+				fieldname: "source",
+				label: __("Source Warehouse"),
+				fieldtype: "Link",
+				options: "Warehouse",
+				read_only: 1,
+			},
+			{
+				fieldname: "target",
+				label: __("Target Warehouse"),
+				fieldtype: "Link",
+				options: "Warehouse",
+				reqd: 1,
+				get_query() {
+					return {
+						filters: {
+							is_group: 0,
+						},
+					};
+				},
+			},
+			{
+				fieldname: "qty",
+				label: __("Quantity"),
+				reqd: 1,
+				fieldtype: "Float",
+				description: __("Available {0}", [actual_qty]),
+			},
+			{
+				fieldname: "rate",
+				label: __("Rate"),
+				fieldtype: "Currency",
+				hidden: 1,
+			},
 		],
 	});
 	dialog.show();
-	dialog.get_field('item_code').set_input(item);
+	dialog.get_field("item_code").set_input(item);
 
 	if (source) {
-		dialog.get_field('source').set_input(source);
+		dialog.get_field("source").set_input(source);
 	} else {
-		dialog.get_field('source').df.hidden = 1;
-		dialog.get_field('source').refresh();
+		dialog.get_field("source").df.hidden = 1;
+		dialog.get_field("source").refresh();
 	}
 
 	if (rate) {
-		dialog.get_field('rate').set_value(rate);
-		dialog.get_field('rate').df.hidden = 0;
-		dialog.get_field('rate').refresh();
+		dialog.get_field("rate").set_value(rate);
+		dialog.get_field("rate").df.hidden = 0;
+		dialog.get_field("rate").refresh();
 	}
 
 	if (target) {
-		dialog.get_field('target').df.read_only = 1;
-		dialog.get_field('target').value = target;
-		dialog.get_field('target').refresh();
+		dialog.get_field("target").df.read_only = 1;
+		dialog.get_field("target").value = target;
+		dialog.get_field("target").refresh();
 	}
 
-	dialog.set_primary_action(__('Create Stock Entry'), function () {
+	dialog.set_primary_action(__("Create Stock Entry"), function () {
 		if (source && (dialog.get_value("qty") == 0 || dialog.get_value("qty") > actual_qty)) {
 			frappe.msgprint(__("Quantity must be greater than zero, and less or equal to {0}", [actual_qty]));
 			return;
@@ -279,20 +287,20 @@
 			return;
 		}
 
-		frappe.model.with_doctype('Stock Entry', function () {
-			let doc = frappe.model.get_new_doc('Stock Entry');
-			doc.from_warehouse = dialog.get_value('source');
-			doc.to_warehouse = dialog.get_value('target');
+		frappe.model.with_doctype("Stock Entry", function () {
+			let doc = frappe.model.get_new_doc("Stock Entry");
+			doc.from_warehouse = dialog.get_value("source");
+			doc.to_warehouse = dialog.get_value("target");
 			doc.stock_entry_type = doc.from_warehouse ? "Material Transfer" : "Material Receipt";
-			let row = frappe.model.add_child(doc, 'items');
-			row.item_code = dialog.get_value('item_code');
-			row.s_warehouse = dialog.get_value('source');
-			row.t_warehouse = dialog.get_value('target');
-			row.qty = dialog.get_value('qty');
+			let row = frappe.model.add_child(doc, "items");
+			row.item_code = dialog.get_value("item_code");
+			row.s_warehouse = dialog.get_value("source");
+			row.t_warehouse = dialog.get_value("target");
+			row.qty = dialog.get_value("qty");
 			row.conversion_factor = 1;
-			row.transfer_qty = dialog.get_value('qty');
-			row.basic_rate = dialog.get_value('rate');
-			frappe.set_route('Form', doc.doctype, doc.name);
+			row.transfer_qty = dialog.get_value("qty");
+			row.basic_rate = dialog.get_value("rate");
+			frappe.set_route("Form", doc.doctype, doc.name);
 		});
 	});
 };
diff --git a/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.js b/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.js
index 2b9d46e..a550174 100644
--- a/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.js
+++ b/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.js
@@ -1,4 +1,4 @@
-frappe.provide('frappe.dashboards.chart_sources');
+frappe.provide("frappe.dashboards.chart_sources");
 
 frappe.dashboards.chart_sources["Warehouse wise Stock Value"] = {
 	method: "erpnext.stock.dashboard_chart_source.warehouse_wise_stock_value.warehouse_wise_stock_value.get",
@@ -8,7 +8,7 @@
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
-			default: frappe.defaults.get_user_default("Company")
-		}
-	]
+			default: frappe.defaults.get_user_default("Company"),
+		},
+	],
 };
diff --git a/erpnext/stock/doctype/batch/batch.js b/erpnext/stock/doctype/batch/batch.js
index f4a935a..3719c96 100644
--- a/erpnext/stock/doctype/batch/batch.js
+++ b/erpnext/stock/doctype/batch/batch.js
@@ -1,62 +1,72 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.ui.form.on('Batch', {
+frappe.ui.form.on("Batch", {
 	setup: (frm) => {
-		frm.fields_dict['item'].get_query = function(doc, cdt, cdn) {
+		frm.fields_dict["item"].get_query = function (doc, cdt, cdn) {
 			return {
 				query: "erpnext.controllers.queries.item_query",
-				filters:{
-					'is_stock_item': 1,
-					'has_batch_no': 1
-				}
-			}
-		}
+				filters: {
+					is_stock_item: 1,
+					has_batch_no: 1,
+				},
+			};
+		};
 	},
 	refresh: (frm) => {
-		if(!frm.is_new()) {
+		if (!frm.is_new()) {
 			frm.add_custom_button(__("View Ledger"), () => {
 				frappe.route_options = {
-					batch_no: frm.doc.name
+					batch_no: frm.doc.name,
 				};
 				frappe.set_route("query-report", "Stock Ledger");
 			});
-			frm.trigger('make_dashboard');
+			frm.trigger("make_dashboard");
 		}
 	},
 	item: (frm) => {
 		// frappe.db.get_value('Item', {name: frm.doc.item}, 'has_expiry_date', (r) => {
 		// 	frm.toggle_reqd('expiry_date', r.has_expiry_date);
 		// });
-		frappe.db.get_value('Item', {name: frm.doc.item}, ['shelf_life_in_days', 'has_expiry_date'], (r) => {
-			if (r.has_expiry_date && r.shelf_life_in_days) {
-				// Calculate expiry date based on shelf_life_in_days
-				frm.set_value('expiry_date', frappe.datetime.add_days(frm.doc.manufacturing_date, r.shelf_life_in_days));
-			}else if(r.has_expiry_date){
-				frm.toggle_reqd('expiry_date', r.has_expiry_date);
+		frappe.db.get_value(
+			"Item",
+			{ name: frm.doc.item },
+			["shelf_life_in_days", "has_expiry_date"],
+			(r) => {
+				if (r.has_expiry_date && r.shelf_life_in_days) {
+					// Calculate expiry date based on shelf_life_in_days
+					frm.set_value(
+						"expiry_date",
+						frappe.datetime.add_days(frm.doc.manufacturing_date, r.shelf_life_in_days)
+					);
+				} else if (r.has_expiry_date) {
+					frm.toggle_reqd("expiry_date", r.has_expiry_date);
+				}
 			}
-		})
+		);
 	},
 	make_dashboard: (frm) => {
-		if(!frm.is_new()) {
+		if (!frm.is_new()) {
 			frappe.call({
-				method: 'erpnext.stock.doctype.batch.batch.get_batch_qty',
-				args: {batch_no: frm.doc.name, item_code: frm.doc.item},
+				method: "erpnext.stock.doctype.batch.batch.get_batch_qty",
+				args: { batch_no: frm.doc.name, item_code: frm.doc.item },
 				callback: (r) => {
-					if(!r.message) {
+					if (!r.message) {
 						return;
 					}
 
-					const section = frm.dashboard.add_section('', __("Stock Levels"));
+					const section = frm.dashboard.add_section("", __("Stock Levels"));
 
 					// sort by qty
-					r.message.sort(function(a, b) { a.qty > b.qty ? 1 : -1 });
+					r.message.sort(function (a, b) {
+						a.qty > b.qty ? 1 : -1;
+					});
 
-					const rows = $('<div></div>').appendTo(section);
+					const rows = $("<div></div>").appendTo(section);
 
 					// show
-					(r.message || []).forEach(function(d) {
-						if(d.qty > 0) {
+					(r.message || []).forEach(function (d) {
+						if (d.qty > 0) {
 							$(`<div class='row' style='margin-bottom: 10px;'>
 								<div class='col-sm-3 small' style='padding-top: 3px;'>${d.warehouse}</div>
 								<div class='col-sm-3 small text-right' style='padding-top: 3px;'>${d.qty}</div>
@@ -64,98 +74,110 @@
 									<button class='btn btn-default btn-xs btn-move' style='margin-right: 7px;'
 										data-qty = "${d.qty}"
 										data-warehouse = "${d.warehouse}">
-										${__('Move')}</button>
+										${__("Move")}</button>
 									<button class='btn btn-default btn-xs btn-split'
 										data-qty = "${d.qty}"
 										data-warehouse = "${d.warehouse}">
-										${__('Split')}</button>
+										${__("Split")}</button>
 								</div>
 							</div>`).appendTo(rows);
 						}
 					});
 
 					// move - ask for target warehouse and make stock entry
-					rows.find('.btn-move').on('click', function() {
+					rows.find(".btn-move").on("click", function () {
 						const $btn = $(this);
 						const fields = [
 							{
-								fieldname: 'to_warehouse',
-								label: __('To Warehouse'),
-								fieldtype: 'Link',
-								options: 'Warehouse'
-							}
+								fieldname: "to_warehouse",
+								label: __("To Warehouse"),
+								fieldtype: "Link",
+								options: "Warehouse",
+							},
 						];
 
 						frappe.prompt(
 							fields,
 							(data) => {
 								frappe.call({
-									method: 'erpnext.stock.doctype.stock_entry.stock_entry_utils.make_stock_entry',
+									method: "erpnext.stock.doctype.stock_entry.stock_entry_utils.make_stock_entry",
 									args: {
 										item_code: frm.doc.item,
 										batch_no: frm.doc.name,
-										qty: $btn.attr('data-qty'),
-										from_warehouse: $btn.attr('data-warehouse'),
+										qty: $btn.attr("data-qty"),
+										from_warehouse: $btn.attr("data-warehouse"),
 										to_warehouse: data.to_warehouse,
 										source_document: frm.doc.reference_name,
-										reference_doctype: frm.doc.reference_doctype
+										reference_doctype: frm.doc.reference_doctype,
 									},
 									callback: (r) => {
-										frappe.show_alert(__('Stock Entry {0} created',
-											['<a href="/app/stock-entry/'+r.message.name+'">' + r.message.name+ '</a>']));
+										frappe.show_alert(
+											__("Stock Entry {0} created", [
+												'<a href="/app/stock-entry/' +
+													r.message.name +
+													'">' +
+													r.message.name +
+													"</a>",
+											])
+										);
 										frm.refresh();
 									},
 								});
 							},
-							__('Select Target Warehouse'),
-							__('Move')
+							__("Select Target Warehouse"),
+							__("Move")
 						);
 					});
 
 					// split - ask for new qty and batch ID (optional)
 					// and make stock entry via batch.batch_split
-					rows.find('.btn-split').on('click', function() {
+					rows.find(".btn-split").on("click", function () {
 						const $btn = $(this);
-						frappe.prompt([{
-							fieldname: 'qty',
-							label: __('New Batch Qty'),
-							fieldtype: 'Float',
-							'default': $btn.attr('data-qty')
-						},
-						{
-							fieldname: 'new_batch_id',
-							label: __('New Batch ID (Optional)'),
-							fieldtype: 'Data',
-						}],
-						(data) => {
-							frappe.xcall(
-								'erpnext.stock.doctype.batch.batch.split_batch',
+						frappe.prompt(
+							[
 								{
-									item_code: frm.doc.item,
-									batch_no: frm.doc.name,
-									qty: data.qty,
-									warehouse: $btn.attr('data-warehouse'),
-									new_batch_id: data.new_batch_id
-								}
-							).then(() => frm.reload_doc());
-						},
-						__('Split Batch'),
-						__('Split')
+									fieldname: "qty",
+									label: __("New Batch Qty"),
+									fieldtype: "Float",
+									default: $btn.attr("data-qty"),
+								},
+								{
+									fieldname: "new_batch_id",
+									label: __("New Batch ID (Optional)"),
+									fieldtype: "Data",
+								},
+							],
+							(data) => {
+								frappe
+									.xcall("erpnext.stock.doctype.batch.batch.split_batch", {
+										item_code: frm.doc.item,
+										batch_no: frm.doc.name,
+										qty: data.qty,
+										warehouse: $btn.attr("data-warehouse"),
+										new_batch_id: data.new_batch_id,
+									})
+									.then(() => frm.reload_doc());
+							},
+							__("Split Batch"),
+							__("Split")
 						);
-					})
+					});
 
 					frm.dashboard.show();
-				}
+				},
 			});
 		}
-	}
-})
+	},
+});
 
-frappe.ui.form.on('Batch', 'manufacturing_date', function (frm){
-	frappe.db.get_value('Item', {name: frm.doc.item}, ['shelf_life_in_days', 'has_expiry_date'], (r) => {
+frappe.ui.form.on("Batch", "manufacturing_date", function (frm) {
+	frappe.db.get_value("Item", { name: frm.doc.item }, ["shelf_life_in_days", "has_expiry_date"], (r) => {
 		if (r.has_expiry_date && r.shelf_life_in_days) {
 			// Calculate expiry date based on shelf_life_in_days
-			frm.set_value('expiry_date', frappe.datetime.add_days(frm.doc.manufacturing_date, r.shelf_life_in_days));
+			frm.set_value(
+				"expiry_date",
+				frappe.datetime.add_days(frm.doc.manufacturing_date, r.shelf_life_in_days)
+			);
 		}
-	})
-})
+	});
+});
diff --git a/erpnext/stock/doctype/batch/batch_list.js b/erpnext/stock/doctype/batch/batch_list.js
index f1a0643..2060d6e 100644
--- a/erpnext/stock/doctype/batch/batch_list.js
+++ b/erpnext/stock/doctype/batch/batch_list.js
@@ -1,14 +1,21 @@
-frappe.listview_settings['Batch'] = {
+frappe.listview_settings["Batch"] = {
 	add_fields: ["item", "expiry_date", "batch_qty", "disabled"],
 	get_indicator: (doc) => {
 		if (doc.disabled) {
 			return [__("Disabled"), "gray", "disabled,=,1"];
 		} else if (!doc.batch_qty) {
 			return [__("Empty"), "gray", "batch_qty,=,0|disabled,=,0"];
-		} else if (doc.expiry_date && frappe.datetime.get_diff(doc.expiry_date, frappe.datetime.nowdate()) <= 0) {
-			return [__("Expired"), "red", "expiry_date,not in,|expiry_date,<=,Today|batch_qty,>,0|disabled,=,0"]
+		} else if (
+			doc.expiry_date &&
+			frappe.datetime.get_diff(doc.expiry_date, frappe.datetime.nowdate()) <= 0
+		) {
+			return [
+				__("Expired"),
+				"red",
+				"expiry_date,not in,|expiry_date,<=,Today|batch_qty,>,0|disabled,=,0",
+			];
 		} else {
 			return [__("Active"), "green", "batch_qty,>,0|disabled,=,0"];
 		}
-	}
+	},
 };
diff --git a/erpnext/stock/doctype/bin/bin.js b/erpnext/stock/doctype/bin/bin.js
index 40411b6..02ff8b6 100644
--- a/erpnext/stock/doctype/bin/bin.js
+++ b/erpnext/stock/doctype/bin/bin.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Bin', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Bin", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/stock/doctype/closing_stock_balance/closing_stock_balance.js b/erpnext/stock/doctype/closing_stock_balance/closing_stock_balance.js
index 5c807a8..0f0221f 100644
--- a/erpnext/stock/doctype/closing_stock_balance/closing_stock_balance.js
+++ b/erpnext/stock/doctype/closing_stock_balance/closing_stock_balance.js
@@ -16,9 +16,9 @@
 					freeze: true,
 					callback: () => {
 						frm.reload_doc();
-					}
-				})
-			})
+					},
+				});
+			});
 		}
 	},
 
@@ -31,9 +31,9 @@
 					freeze: true,
 					callback: () => {
 						frm.reload_doc();
-					}
-				})
-			})
+					},
+				});
+			});
 		}
-	}
+	},
 });
diff --git a/erpnext/stock/doctype/customs_tariff_number/customs_tariff_number.js b/erpnext/stock/doctype/customs_tariff_number/customs_tariff_number.js
index a39414c..bb60ee7 100644
--- a/erpnext/stock/doctype/customs_tariff_number/customs_tariff_number.js
+++ b/erpnext/stock/doctype/customs_tariff_number/customs_tariff_number.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Customs Tariff Number', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Customs Tariff Number", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js
index 14aedca..c04d5c1 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.js
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-cur_frm.add_fetch('customer', 'tax_id', 'tax_id');
+cur_frm.add_fetch("customer", "tax_id", "tax_id");
 
 frappe.provide("erpnext.stock");
 frappe.provide("erpnext.stock.delivery_note");
@@ -11,138 +11,148 @@
 erpnext.accounts.taxes.setup_tax_validations("Delivery Note");
 erpnext.sales_common.setup_selling_controller();
 
-
 frappe.ui.form.on("Delivery Note", {
-	setup: function(frm) {
-		frm.custom_make_buttons = {
-			'Packing Slip': 'Packing Slip',
-			'Installation Note': 'Installation Note',
-			'Sales Invoice': 'Sales Invoice',
-			'Stock Entry': 'Return',
-			'Shipment': 'Shipment'
-		},
-		frm.set_indicator_formatter('item_code',
-			function(doc) {
-				return (doc.docstatus==1 || doc.qty<=doc.actual_qty) ? "green" : "orange"
-			})
+	setup: function (frm) {
+		(frm.custom_make_buttons = {
+			"Packing Slip": "Packing Slip",
+			"Installation Note": "Installation Note",
+			"Sales Invoice": "Sales Invoice",
+			"Stock Entry": "Return",
+			Shipment: "Shipment",
+		}),
+			frm.set_indicator_formatter("item_code", function (doc) {
+				return doc.docstatus == 1 || doc.qty <= doc.actual_qty ? "green" : "orange";
+			});
 
-		erpnext.queries.setup_queries(frm, "Warehouse", function() {
+		erpnext.queries.setup_queries(frm, "Warehouse", function () {
 			return erpnext.queries.warehouse(frm.doc);
 		});
 		erpnext.queries.setup_warehouse_query(frm);
 
-		frm.set_query('transporter', function() {
+		frm.set_query("transporter", function () {
 			return {
 				filters: {
-					'is_transporter': 1
-				}
-			}
+					is_transporter: 1,
+				},
+			};
 		});
 
-		frm.set_query('driver', function(doc) {
+		frm.set_query("driver", function (doc) {
 			return {
 				filters: {
-					'transporter': doc.transporter
-				}
-			}
+					transporter: doc.transporter,
+				},
+			};
 		});
 
-
-		frm.set_query('expense_account', 'items', function(doc, cdt, cdn) {
+		frm.set_query("expense_account", "items", function (doc, cdt, cdn) {
 			if (erpnext.is_perpetual_inventory_enabled(doc.company)) {
 				return {
 					filters: {
-						"report_type": "Profit and Loss",
-						"company": doc.company,
-						"is_group": 0
-					}
-				}
+						report_type: "Profit and Loss",
+						company: doc.company,
+						is_group: 0,
+					},
+				};
 			}
 		});
 
-		frm.set_query('cost_center', 'items', function(doc, cdt, cdn) {
+		frm.set_query("cost_center", "items", function (doc, cdt, cdn) {
 			if (erpnext.is_perpetual_inventory_enabled(doc.company)) {
 				return {
 					filters: {
-						'company': doc.company,
-						"is_group": 0
-					}
-				}
+						company: doc.company,
+						is_group: 0,
+					},
+				};
 			}
 		});
 
-		frm.set_df_property('packed_items', 'cannot_add_rows', true);
-		frm.set_df_property('packed_items', 'cannot_delete_rows', true);
+		frm.set_df_property("packed_items", "cannot_add_rows", true);
+		frm.set_df_property("packed_items", "cannot_delete_rows", true);
 	},
 
-	print_without_amount: function(frm) {
+	print_without_amount: function (frm) {
 		erpnext.stock.delivery_note.set_print_hide(frm.doc);
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		if (frm.doc.docstatus === 1 && frm.doc.is_return === 1 && frm.doc.per_billed !== 100) {
-			frm.add_custom_button(__('Credit Note'), function() {
-				frappe.model.open_mapped_doc({
-					method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice",
-					frm: cur_frm,
-				})
-			}, __('Create'));
-			frm.page.set_inner_btn_group_as_primary(__('Create'));
+			frm.add_custom_button(
+				__("Credit Note"),
+				function () {
+					frappe.model.open_mapped_doc({
+						method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice",
+						frm: cur_frm,
+					});
+				},
+				__("Create")
+			);
+			frm.page.set_inner_btn_group_as_primary(__("Create"));
 		}
 
 		if (frm.doc.docstatus == 1 && !frm.doc.inter_company_reference) {
 			let internal = frm.doc.is_internal_customer;
 			if (internal) {
-				let button_label = (frm.doc.company === frm.doc.represents_company) ? "Internal Purchase Receipt" :
-					"Inter Company Purchase Receipt";
+				let button_label =
+					frm.doc.company === frm.doc.represents_company
+						? "Internal Purchase Receipt"
+						: "Inter Company Purchase Receipt";
 
-				frm.add_custom_button(__(button_label), function() {
-					frappe.model.open_mapped_doc({
-						method: 'erpnext.stock.doctype.delivery_note.delivery_note.make_inter_company_purchase_receipt',
-						frm: frm,
-					});
-				}, __('Create'));
+				frm.add_custom_button(
+					__(button_label),
+					function () {
+						frappe.model.open_mapped_doc({
+							method: "erpnext.stock.doctype.delivery_note.delivery_note.make_inter_company_purchase_receipt",
+							frm: frm,
+						});
+					},
+					__("Create")
+				);
 			}
 		}
-	}
+	},
 });
 
 frappe.ui.form.on("Delivery Note Item", {
-	expense_account: function(frm, dt, dn) {
+	expense_account: function (frm, dt, dn) {
 		var d = locals[dt][dn];
-		frm.update_in_all_rows('items', 'expense_account', d.expense_account);
+		frm.update_in_all_rows("items", "expense_account", d.expense_account);
 	},
-	cost_center: function(frm, dt, dn) {
+	cost_center: function (frm, dt, dn) {
 		var d = locals[dt][dn];
-		frm.update_in_all_rows('items', 'cost_center', d.cost_center);
-	}
+		frm.update_in_all_rows("items", "cost_center", d.cost_center);
+	},
 });
 
-erpnext.stock.DeliveryNoteController = class DeliveryNoteController extends erpnext.selling.SellingController {
+erpnext.stock.DeliveryNoteController = class DeliveryNoteController extends (
+	erpnext.selling.SellingController
+) {
 	setup(doc) {
 		this.setup_posting_date_time_check();
 		super.setup(doc);
 		this.frm.make_methods = {
-			'Delivery Trip': this.make_delivery_trip,
+			"Delivery Trip": this.make_delivery_trip,
 		};
 	}
 	refresh(doc, dt, dn) {
 		var me = this;
 		super.refresh();
-		if ((!doc.is_return) && (doc.status!="Closed" || this.frm.is_new())) {
-			if (this.frm.doc.docstatus===0) {
-				this.frm.add_custom_button(__('Sales Order'),
-					function() {
+		if (!doc.is_return && (doc.status != "Closed" || this.frm.is_new())) {
+			if (this.frm.doc.docstatus === 0) {
+				this.frm.add_custom_button(
+					__("Sales Order"),
+					function () {
 						if (!me.frm.doc.customer) {
 							frappe.throw({
 								title: __("Mandatory"),
-								message: __("Please Select a Customer")
+								message: __("Please Select a Customer"),
 							});
 						}
 						erpnext.utils.map_current_doc({
 							method: "erpnext.selling.doctype.sales_order.sales_order.make_delivery_note",
 							args: {
-								for_reserved_stock: 1
+								for_reserved_stock: 1,
 							},
 							source_doctype: "Sales Order",
 							target: me.frm,
@@ -155,45 +165,71 @@
 								per_delivered: ["<", 99.99],
 								company: me.frm.doc.company,
 								project: me.frm.doc.project || undefined,
-							}
-						})
-					}, __("Get Items From"));
+							},
+						});
+					},
+					__("Get Items From")
+				);
 			}
 		}
 
-		if (!doc.is_return && doc.status!="Closed") {
-			if(doc.docstatus == 1) {
-				this.frm.add_custom_button(__('Shipment'), function() {
-					me.make_shipment() }, __('Create'));
+		if (!doc.is_return && doc.status != "Closed") {
+			if (doc.docstatus == 1) {
+				this.frm.add_custom_button(
+					__("Shipment"),
+					function () {
+						me.make_shipment();
+					},
+					__("Create")
+				);
 			}
 
-			if(flt(doc.per_installed, 2) < 100 && doc.docstatus==1)
-				this.frm.add_custom_button(__('Installation Note'), function() {
-					me.make_installation_note() }, __('Create'));
+			if (flt(doc.per_installed, 2) < 100 && doc.docstatus == 1)
+				this.frm.add_custom_button(
+					__("Installation Note"),
+					function () {
+						me.make_installation_note();
+					},
+					__("Create")
+				);
 
-			if (doc.docstatus==1) {
-				this.frm.add_custom_button(__('Sales Return'), function() {
-					me.make_sales_return() }, __('Create'));
+			if (doc.docstatus == 1) {
+				this.frm.add_custom_button(
+					__("Sales Return"),
+					function () {
+						me.make_sales_return();
+					},
+					__("Create")
+				);
 			}
 
-			if (doc.docstatus==1) {
-				this.frm.add_custom_button(__('Delivery Trip'), function() {
-					me.make_delivery_trip() }, __('Create'));
+			if (doc.docstatus == 1) {
+				this.frm.add_custom_button(
+					__("Delivery Trip"),
+					function () {
+						me.make_delivery_trip();
+					},
+					__("Create")
+				);
 			}
 
-			if(doc.docstatus==0 && !doc.__islocal) {
+			if (doc.docstatus == 0 && !doc.__islocal) {
 				if (doc.__onload && doc.__onload.has_unpacked_items) {
-					this.frm.add_custom_button(__('Packing Slip'), function() {
-						frappe.model.open_mapped_doc({
-							method: "erpnext.stock.doctype.delivery_note.delivery_note.make_packing_slip",
-							frm: me.frm
-						}) }, __('Create')
+					this.frm.add_custom_button(
+						__("Packing Slip"),
+						function () {
+							frappe.model.open_mapped_doc({
+								method: "erpnext.stock.doctype.delivery_note.delivery_note.make_packing_slip",
+								frm: me.frm,
+							});
+						},
+						__("Create")
 					);
 				}
 			}
 
-			if (!doc.__islocal && doc.docstatus==1) {
-				this.frm.page.set_inner_btn_group_as_primary(__('Create'));
+			if (!doc.__islocal && doc.docstatus == 1) {
+				this.frm.page.set_inner_btn_group_as_primary(__("Create"));
 			}
 		}
 
@@ -206,27 +242,42 @@
 				this.show_general_ledger();
 			}
 			if (this.frm.has_perm("submit") && doc.status !== "Closed") {
-				me.frm.add_custom_button(__("Close"), function() { me.close_delivery_note() },
-					__("Status"))
+				me.frm.add_custom_button(
+					__("Close"),
+					function () {
+						me.close_delivery_note();
+					},
+					__("Status")
+				);
 			}
 		}
 
-		if(doc.docstatus==1 && !doc.is_return && doc.status!="Closed" && flt(doc.per_billed) < 100) {
+		if (doc.docstatus == 1 && !doc.is_return && doc.status != "Closed" && flt(doc.per_billed) < 100) {
 			// show Make Invoice button only if Delivery Note is not created from Sales Invoice
 			var from_sales_invoice = false;
-			from_sales_invoice = me.frm.doc.items.some(function(item) {
+			from_sales_invoice = me.frm.doc.items.some(function (item) {
 				return item.against_sales_invoice ? true : false;
 			});
 
-			if(!from_sales_invoice) {
-				this.frm.add_custom_button(__('Sales Invoice'), function() { me.make_sales_invoice() },
-					__('Create'));
+			if (!from_sales_invoice) {
+				this.frm.add_custom_button(
+					__("Sales Invoice"),
+					function () {
+						me.make_sales_invoice();
+					},
+					__("Create")
+				);
 			}
 		}
 
-		if(doc.docstatus==1 && doc.status === "Closed" && this.frm.has_perm("submit")) {
-			this.frm.add_custom_button(__('Reopen'), function() { me.reopen_delivery_note() },
-				__("Status"))
+		if (doc.docstatus == 1 && doc.status === "Closed" && this.frm.has_perm("submit")) {
+			this.frm.add_custom_button(
+				__("Reopen"),
+				function () {
+					me.reopen_delivery_note();
+				},
+				__("Status")
+			);
 		}
 		erpnext.stock.delivery_note.set_print_hide(doc, dt, dn);
 	}
@@ -234,36 +285,36 @@
 	make_shipment() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.stock.doctype.delivery_note.delivery_note.make_shipment",
-			frm: this.frm
-		})
+			frm: this.frm,
+		});
 	}
 
 	make_sales_invoice() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice",
-			frm: this.frm
-		})
+			frm: this.frm,
+		});
 	}
 
 	make_installation_note() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.stock.doctype.delivery_note.delivery_note.make_installation_note",
-			frm: this.frm
+			frm: this.frm,
 		});
 	}
 
 	make_sales_return() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_return",
-			frm: this.frm
-		})
+			frm: this.frm,
+		});
 	}
 
 	make_delivery_trip() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.stock.doctype.delivery_note.delivery_note.make_delivery_trip",
-			frm: cur_frm
-		})
+			frm: cur_frm,
+		});
 	}
 
 	tc_name() {
@@ -278,96 +329,91 @@
 		erpnext.setup_serial_or_batch_no();
 	}
 
-	close_delivery_note(doc){
-		this.update_status("Closed")
+	close_delivery_note(doc) {
+		this.update_status("Closed");
 	}
 
 	reopen_delivery_note() {
-		this.update_status("Submitted")
+		this.update_status("Submitted");
 	}
 
 	update_status(status) {
 		var me = this;
 		frappe.ui.form.is_saving = true;
 		frappe.call({
-			method:"erpnext.stock.doctype.delivery_note.delivery_note.update_delivery_note_status",
-			args: {docname: me.frm.doc.name, status: status},
-			callback: function(r){
-				if(!r.exc)
-					me.frm.reload_doc();
+			method: "erpnext.stock.doctype.delivery_note.delivery_note.update_delivery_note_status",
+			args: { docname: me.frm.doc.name, status: status },
+			callback: function (r) {
+				if (!r.exc) me.frm.reload_doc();
 			},
-			always: function(){
+			always: function () {
 				frappe.ui.form.is_saving = false;
-			}
-		})
+			},
+		});
 	}
 };
 
-extend_cscript(cur_frm.cscript, new erpnext.stock.DeliveryNoteController({frm: cur_frm}));
+extend_cscript(cur_frm.cscript, new erpnext.stock.DeliveryNoteController({ frm: cur_frm }));
 
-frappe.ui.form.on('Delivery Note', {
-	setup: function(frm) {
-		if(frm.doc.company) {
+frappe.ui.form.on("Delivery Note", {
+	setup: function (frm) {
+		if (frm.doc.company) {
 			frm.trigger("unhide_account_head");
 		}
 	},
 
-	company: function(frm) {
+	company: function (frm) {
 		frm.trigger("unhide_account_head");
 		erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
 	},
 
-	unhide_account_head: function(frm) {
+	unhide_account_head: function (frm) {
 		// unhide expense_account and cost_center if perpetual inventory is enabled in the company
-		var aii_enabled = erpnext.is_perpetual_inventory_enabled(frm.doc.company)
+		var aii_enabled = erpnext.is_perpetual_inventory_enabled(frm.doc.company);
 		frm.fields_dict["items"].grid.set_column_disp(["expense_account", "cost_center"], aii_enabled);
-	}
-})
+	},
+});
 
-
-erpnext.stock.delivery_note.set_print_hide = function(doc, cdt, cdn){
-	var dn_fields = frappe.meta.docfield_map['Delivery Note'];
-	var dn_item_fields = frappe.meta.docfield_map['Delivery Note Item'];
+erpnext.stock.delivery_note.set_print_hide = function (doc, cdt, cdn) {
+	var dn_fields = frappe.meta.docfield_map["Delivery Note"];
+	var dn_item_fields = frappe.meta.docfield_map["Delivery Note Item"];
 	var dn_fields_copy = dn_fields;
 	var dn_item_fields_copy = dn_item_fields;
 	if (doc.print_without_amount) {
-		dn_fields['currency'].print_hide = 1;
-		dn_item_fields['rate'].print_hide = 1;
-		dn_item_fields['discount_percentage'].print_hide = 1;
-		dn_item_fields['price_list_rate'].print_hide = 1;
-		dn_item_fields['amount'].print_hide = 1;
-		dn_item_fields['discount_amount'].print_hide = 1;
-		dn_fields['taxes'].print_hide = 1;
+		dn_fields["currency"].print_hide = 1;
+		dn_item_fields["rate"].print_hide = 1;
+		dn_item_fields["discount_percentage"].print_hide = 1;
+		dn_item_fields["price_list_rate"].print_hide = 1;
+		dn_item_fields["amount"].print_hide = 1;
+		dn_item_fields["discount_amount"].print_hide = 1;
+		dn_fields["taxes"].print_hide = 1;
 	} else {
-		if (dn_fields_copy['currency'].print_hide != 1)
-			dn_fields['currency'].print_hide = 0;
-		if (dn_item_fields_copy['rate'].print_hide != 1)
-			dn_item_fields['rate'].print_hide = 0;
-		if (dn_item_fields_copy['amount'].print_hide != 1)
-			dn_item_fields['amount'].print_hide = 0;
-		if (dn_item_fields_copy['discount_amount'].print_hide != 1)
-			dn_item_fields['discount_amount'].print_hide = 0;
-		if (dn_fields_copy['taxes'].print_hide != 1)
-			dn_fields['taxes'].print_hide = 0;
+		if (dn_fields_copy["currency"].print_hide != 1) dn_fields["currency"].print_hide = 0;
+		if (dn_item_fields_copy["rate"].print_hide != 1) dn_item_fields["rate"].print_hide = 0;
+		if (dn_item_fields_copy["amount"].print_hide != 1) dn_item_fields["amount"].print_hide = 0;
+		if (dn_item_fields_copy["discount_amount"].print_hide != 1)
+			dn_item_fields["discount_amount"].print_hide = 0;
+		if (dn_fields_copy["taxes"].print_hide != 1) dn_fields["taxes"].print_hide = 0;
 	}
-}
+};
 
-
-frappe.tour['Delivery Note'] = [
+frappe.tour["Delivery Note"] = [
 	{
 		fieldname: "customer",
 		title: __("Customer"),
-		description: __("This field is used to set the 'Customer'.")
+		description: __("This field is used to set the 'Customer'."),
 	},
 	{
 		fieldname: "items",
 		title: __("Items"),
-		description: __("This table is used to set details about the 'Item', 'Qty', 'Basic Rate', etc.") + " " +
-		__("Different 'Source Warehouse' and 'Target Warehouse' can be set for each row.")
+		description:
+			__("This table is used to set details about the 'Item', 'Qty', 'Basic Rate', etc.") +
+			" " +
+			__("Different 'Source Warehouse' and 'Target Warehouse' can be set for each row."),
 	},
 	{
 		fieldname: "set_posting_time",
 		title: __("Edit Posting Date and Time"),
-		description: __("This option can be checked to edit the 'Posting Date' and 'Posting Time' fields.")
-	}
-]
+		description: __("This option can be checked to edit the 'Posting Date' and 'Posting Time' fields."),
+	},
+];
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note_list.js b/erpnext/stock/doctype/delivery_note/delivery_note_list.js
index 51a899b..c6b98c4 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note_list.js
+++ b/erpnext/stock/doctype/delivery_note/delivery_note_list.js
@@ -1,8 +1,18 @@
-frappe.listview_settings['Delivery Note'] = {
-	add_fields: ["customer", "customer_name", "base_grand_total", "per_installed", "per_billed",
-		"transporter_name", "grand_total", "is_return", "status", "currency"],
-	get_indicator: function(doc) {
-		if(cint(doc.is_return)==1) {
+frappe.listview_settings["Delivery Note"] = {
+	add_fields: [
+		"customer",
+		"customer_name",
+		"base_grand_total",
+		"per_installed",
+		"per_billed",
+		"transporter_name",
+		"grand_total",
+		"is_return",
+		"status",
+		"currency",
+	],
+	get_indicator: function (doc) {
+		if (cint(doc.is_return) == 1) {
 			return [__("Return"), "gray", "is_return,=,Yes"];
 		} else if (doc.status === "Closed") {
 			return [__("Closed"), "green", "status,=,Closed"];
@@ -26,44 +36,43 @@
 					}
 				}
 
-				frappe.new_doc("Delivery Trip")
-					.then(() => {
-						// Empty out the child table before inserting new ones
-						cur_frm.set_value("delivery_stops", []);
+				frappe.new_doc("Delivery Trip").then(() => {
+					// Empty out the child table before inserting new ones
+					cur_frm.set_value("delivery_stops", []);
 
-						// We don't want to use `map_current_doc` since it brings up
-						// the dialog to select more items. We just want the mapper
-						// function to be called.
-						frappe.call({
-							type: "POST",
-							method: "frappe.model.mapper.map_docs",
-							args: {
-								"method": "erpnext.stock.doctype.delivery_note.delivery_note.make_delivery_trip",
-								"source_names": docnames,
-								"target_doc": cur_frm.doc
-							},
-							callback: function (r) {
-								if (!r.exc) {
-									frappe.model.sync(r.message);
-									cur_frm.dirty();
-									cur_frm.refresh();
-								}
+					// We don't want to use `map_current_doc` since it brings up
+					// the dialog to select more items. We just want the mapper
+					// function to be called.
+					frappe.call({
+						type: "POST",
+						method: "frappe.model.mapper.map_docs",
+						args: {
+							method: "erpnext.stock.doctype.delivery_note.delivery_note.make_delivery_trip",
+							source_names: docnames,
+							target_doc: cur_frm.doc,
+						},
+						callback: function (r) {
+							if (!r.exc) {
+								frappe.model.sync(r.message);
+								cur_frm.dirty();
+								cur_frm.refresh();
 							}
-						});
-					})
+						},
+					});
+				});
 			}
 		};
 
 		// doclist.page.add_actions_menu_item(__('Create Delivery Trip'), action, false);
 
-		doclist.page.add_action_item(__('Create Delivery Trip'), action);
+		doclist.page.add_action_item(__("Create Delivery Trip"), action);
 
-		doclist.page.add_action_item(__("Sales Invoice"), ()=>{
+		doclist.page.add_action_item(__("Sales Invoice"), () => {
 			erpnext.bulk_transaction_processing.create(doclist, "Delivery Note", "Sales Invoice");
 		});
 
-		doclist.page.add_action_item(__("Packaging Slip From Delivery Note"), ()=>{
+		doclist.page.add_action_item(__("Packaging Slip From Delivery Note"), () => {
 			erpnext.bulk_transaction_processing.create(doclist, "Delivery Note", "Packing Slip");
 		});
-	}
-}
+	},
+};
diff --git a/erpnext/stock/doctype/delivery_settings/delivery_settings.js b/erpnext/stock/doctype/delivery_settings/delivery_settings.js
index 03aa192..4328158 100644
--- a/erpnext/stock/doctype/delivery_settings/delivery_settings.js
+++ b/erpnext/stock/doctype/delivery_settings/delivery_settings.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Delivery Settings', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Delivery Settings", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/stock/doctype/delivery_trip/delivery_trip.js b/erpnext/stock/doctype/delivery_trip/delivery_trip.js
index 158bd0c..4f8649c 100755
--- a/erpnext/stock/doctype/delivery_trip/delivery_trip.js
+++ b/erpnext/stock/doctype/delivery_trip/delivery_trip.js
@@ -1,15 +1,15 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Delivery Trip', {
+frappe.ui.form.on("Delivery Trip", {
 	setup: function (frm) {
-		frm.set_indicator_formatter('customer', (stop) => (stop.visited) ? "green" : "orange");
+		frm.set_indicator_formatter("customer", (stop) => (stop.visited ? "green" : "orange"));
 
 		frm.set_query("driver", function () {
 			return {
 				filters: {
-					"status": "Active"
-				}
+					status: "Active",
+				},
 			};
 		});
 
@@ -17,58 +17,71 @@
 			var row = locals[cdt][cdn];
 			if (row.customer) {
 				return {
-					query: 'frappe.contacts.doctype.address.address.address_query',
+					query: "frappe.contacts.doctype.address.address.address_query",
 					filters: {
 						link_doctype: "Customer",
-						link_name: row.customer
-					}
+						link_name: row.customer,
+					},
 				};
 			}
-		})
+		});
 
 		frm.set_query("contact", "delivery_stops", function (doc, cdt, cdn) {
 			var row = locals[cdt][cdn];
 			if (row.customer) {
 				return {
-					query: 'frappe.contacts.doctype.contact.contact.contact_query',
+					query: "frappe.contacts.doctype.contact.contact.contact_query",
 					filters: {
 						link_doctype: "Customer",
-						link_name: row.customer
-					}
+						link_name: row.customer,
+					},
 				};
 			}
-		})
+		});
 	},
 
 	refresh: function (frm) {
 		if (frm.doc.docstatus == 1 && frm.doc.delivery_stops.length > 0) {
 			frm.add_custom_button(__("Notify Customers via Email"), function () {
-				frm.trigger('notify_customers');
+				frm.trigger("notify_customers");
 			});
 		}
 
 		if (frm.doc.docstatus === 0) {
-			frm.add_custom_button(__('Delivery Note'), () => {
-				erpnext.utils.map_current_doc({
-					method: "erpnext.stock.doctype.delivery_note.delivery_note.make_delivery_trip",
-					source_doctype: "Delivery Note",
-					target: frm,
-					date_field: "posting_date",
-					setters: {
-						company: frm.doc.company,
-					},
-					get_query_filters: {
-						docstatus: 1,
-						company: frm.doc.company,
-					}
-				})
-			}, __("Get stops from"));
-		}
-		frm.add_custom_button(__("Delivery Notes"), function () {
-			frappe.set_route("List", "Delivery Note",
-					{'name': ["in", frm.doc.delivery_stops.map((stop) => {return stop.delivery_note;})]}
+			frm.add_custom_button(
+				__("Delivery Note"),
+				() => {
+					erpnext.utils.map_current_doc({
+						method: "erpnext.stock.doctype.delivery_note.delivery_note.make_delivery_trip",
+						source_doctype: "Delivery Note",
+						target: frm,
+						date_field: "posting_date",
+						setters: {
+							company: frm.doc.company,
+						},
+						get_query_filters: {
+							docstatus: 1,
+							company: frm.doc.company,
+						},
+					});
+				},
+				__("Get stops from")
 			);
-		}, __("View"));
+		}
+		frm.add_custom_button(
+			__("Delivery Notes"),
+			function () {
+				frappe.set_route("List", "Delivery Note", {
+					name: [
+						"in",
+						frm.doc.delivery_stops.map((stop) => {
+							return stop.delivery_note;
+						}),
+					],
+				});
+			},
+			__("View")
+		);
 	},
 
 	calculate_arrival_time: function (frm) {
@@ -77,13 +90,17 @@
 		}
 		frappe.show_alert({
 			message: "Calculating Arrival Times",
-			indicator: 'orange'
+			indicator: "orange",
 		});
-		frm.call("process_route", {
-			optimize: false,
-		}, () => {
-			frm.reload_doc();
-		});
+		frm.call(
+			"process_route",
+			{
+				optimize: false,
+			},
+			() => {
+				frm.reload_doc();
+			}
+		);
 	},
 
 	driver: function (frm) {
@@ -91,11 +108,11 @@
 			frappe.call({
 				method: "erpnext.stock.doctype.delivery_trip.delivery_trip.get_driver_email",
 				args: {
-					driver: frm.doc.driver
+					driver: frm.doc.driver,
 				},
 				callback: (data) => {
 					frm.set_value("driver_email", data.message.email);
-				}
+				},
 			});
 		}
 	},
@@ -106,23 +123,27 @@
 		}
 		frappe.show_alert({
 			message: "Optimizing Route",
-			indicator: 'orange'
+			indicator: "orange",
 		});
-		frm.call("process_route", {
-			optimize: true,
-		}, () => {
-			frm.reload_doc();
-		});
+		frm.call(
+			"process_route",
+			{
+				optimize: true,
+			},
+			() => {
+				frm.reload_doc();
+			}
+		);
 	},
 
 	notify_customers: function (frm) {
 		$.each(frm.doc.delivery_stops || [], function (i, delivery_stop) {
 			if (!delivery_stop.delivery_note) {
 				frappe.msgprint({
-					"message": __("No Delivery Note selected for Customer {}", [delivery_stop.customer]),
-					"title": __("Warning"),
-					"indicator": "orange",
-					"alert": 1
+					message: __("No Delivery Note selected for Customer {}", [delivery_stop.customer]),
+					title: __("Warning"),
+					indicator: "orange",
+					alert: 1,
 				});
 			}
 		});
@@ -135,48 +156,45 @@
 					frappe.call({
 						method: "erpnext.stock.doctype.delivery_trip.delivery_trip.notify_customers",
 						args: {
-							"delivery_trip": frm.doc.name
+							delivery_trip: frm.doc.name,
 						},
 						callback: function (r) {
 							if (!r.exc) {
 								frm.doc.email_notification_sent = true;
-								frm.refresh_field('email_notification_sent');
+								frm.refresh_field("email_notification_sent");
 							}
-						}
+						},
 					});
 				});
 			}
 		});
-	}
+	},
 });
 
-frappe.ui.form.on('Delivery Stop', {
+frappe.ui.form.on("Delivery Stop", {
 	customer: function (frm, cdt, cdn) {
 		var row = locals[cdt][cdn];
 		if (row.customer) {
 			frappe.call({
 				method: "erpnext.stock.doctype.delivery_trip.delivery_trip.get_contact_and_address",
-				args: { "name": row.customer },
+				args: { name: row.customer },
 				callback: function (r) {
 					if (r.message) {
 						if (r.message["shipping_address"]) {
 							frappe.model.set_value(cdt, cdn, "address", r.message["shipping_address"].parent);
-						}
-						else {
-							frappe.model.set_value(cdt, cdn, "address", '');
+						} else {
+							frappe.model.set_value(cdt, cdn, "address", "");
 						}
 						if (r.message["contact_person"]) {
 							frappe.model.set_value(cdt, cdn, "contact", r.message["contact_person"].parent);
+						} else {
+							frappe.model.set_value(cdt, cdn, "contact", "");
 						}
-						else {
-							frappe.model.set_value(cdt, cdn, "contact", '');
-						}
+					} else {
+						frappe.model.set_value(cdt, cdn, "address", "");
+						frappe.model.set_value(cdt, cdn, "contact", "");
 					}
-					else {
-						frappe.model.set_value(cdt, cdn, "address", '');
-						frappe.model.set_value(cdt, cdn, "contact", '');
-					}
-				}
+				},
 			});
 		}
 	},
@@ -186,12 +204,12 @@
 		if (row.address) {
 			frappe.call({
 				method: "frappe.contacts.doctype.address.address.get_address_display",
-				args: { "address_dict": row.address },
+				args: { address_dict: row.address },
 				callback: function (r) {
 					if (r.message) {
 						frappe.model.set_value(cdt, cdn, "customer_address", r.message);
 					}
-				}
+				},
 			});
 		} else {
 			frappe.model.set_value(cdt, cdn, "customer_address", "");
@@ -203,15 +221,15 @@
 		if (row.contact) {
 			frappe.call({
 				method: "erpnext.stock.doctype.delivery_trip.delivery_trip.get_contact_display",
-				args: { "contact": row.contact },
+				args: { contact: row.contact },
 				callback: function (r) {
 					if (r.message) {
 						frappe.model.set_value(cdt, cdn, "customer_contact", r.message);
 					}
-				}
+				},
 			});
 		} else {
 			frappe.model.set_value(cdt, cdn, "customer_contact", "");
 		}
-	}
+	},
 });
diff --git a/erpnext/stock/doctype/delivery_trip/delivery_trip_list.js b/erpnext/stock/doctype/delivery_trip/delivery_trip_list.js
index 1d198b7..230107c 100644
--- a/erpnext/stock/doctype/delivery_trip/delivery_trip_list.js
+++ b/erpnext/stock/doctype/delivery_trip/delivery_trip_list.js
@@ -1,4 +1,4 @@
-frappe.listview_settings['Delivery Trip'] = {
+frappe.listview_settings["Delivery Trip"] = {
 	add_fields: ["status"],
 	get_indicator: function (doc) {
 		if (in_list(["Cancelled", "Draft"], doc.status)) {
@@ -8,5 +8,5 @@
 		} else if (doc.status === "Completed") {
 			return [__(doc.status), "green", "status,=," + doc.status];
 		}
-	}
+	},
 };
diff --git a/erpnext/stock/doctype/inventory_dimension/inventory_dimension.js b/erpnext/stock/doctype/inventory_dimension/inventory_dimension.js
index 35d1c02..c819d17 100644
--- a/erpnext/stock/doctype/inventory_dimension/inventory_dimension.js
+++ b/erpnext/stock/doctype/inventory_dimension/inventory_dimension.js
@@ -1,43 +1,59 @@
 // Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Inventory Dimension', {
+frappe.ui.form.on("Inventory Dimension", {
 	setup(frm) {
-		frm.trigger('set_query_on_fields');
+		frm.trigger("set_query_on_fields");
 	},
 
 	set_query_on_fields(frm) {
-		frm.set_query('reference_document', () => {
+		frm.set_query("reference_document", () => {
 			let invalid_doctypes = frappe.model.core_doctypes_list;
-			invalid_doctypes.push('Batch', 'Serial No', 'Warehouse', 'Item', 'Inventory Dimension',
-				'Accounting Dimension', 'Accounting Dimension Filter');
+			invalid_doctypes.push(
+				"Batch",
+				"Serial No",
+				"Warehouse",
+				"Item",
+				"Inventory Dimension",
+				"Accounting Dimension",
+				"Accounting Dimension Filter"
+			);
 
 			return {
 				filters: {
-					'istable': 0,
-					'issingle': 0,
-					'name': ['not in', invalid_doctypes]
-				}
+					istable: 0,
+					issingle: 0,
+					name: ["not in", invalid_doctypes],
+				},
 			};
 		});
 
-		frm.set_query('document_type', () => {
+		frm.set_query("document_type", () => {
 			return {
-				query: 'erpnext.stock.doctype.inventory_dimension.inventory_dimension.get_inventory_documents',
+				query: "erpnext.stock.doctype.inventory_dimension.inventory_dimension.get_inventory_documents",
 			};
 		});
 	},
 
 	onload(frm) {
-		frm.trigger('render_traget_field');
+		frm.trigger("render_traget_field");
 		frm.trigger("set_parent_fields");
 	},
 
 	refresh(frm) {
-		if (frm.doc.__onload && frm.doc.__onload.has_stock_ledger
-			&& frm.doc.__onload.has_stock_ledger.length) {
-			let allow_to_edit_fields = ['disabled', 'fetch_from_parent',
-				'type_of_transaction', 'condition', 'mandatory_depends_on', 'validate_negative_stock'];
+		if (
+			frm.doc.__onload &&
+			frm.doc.__onload.has_stock_ledger &&
+			frm.doc.__onload.has_stock_ledger.length
+		) {
+			let allow_to_edit_fields = [
+				"disabled",
+				"fetch_from_parent",
+				"type_of_transaction",
+				"condition",
+				"mandatory_depends_on",
+				"validate_negative_stock",
+			];
 
 			frm.fields.forEach((field) => {
 				if (!in_list(allow_to_edit_fields, field.df.fieldname)) {
@@ -47,8 +63,8 @@
 		}
 
 		if (!frm.is_new()) {
-			frm.add_custom_button(__('Delete Dimension'), () => {
-				frm.trigger('delete_dimension');
+			frm.add_custom_button(__("Delete Dimension"), () => {
+				frm.trigger("delete_dimension");
 			});
 		}
 	},
@@ -62,39 +78,38 @@
 			frm.set_df_property("fetch_from_parent", "options", frm.doc.reference_document);
 		} else if (frm.doc.document_type && frm.doc.istable) {
 			frappe.call({
-				method: 'erpnext.stock.doctype.inventory_dimension.inventory_dimension.get_parent_fields',
+				method: "erpnext.stock.doctype.inventory_dimension.inventory_dimension.get_parent_fields",
 				args: {
 					child_doctype: frm.doc.document_type,
-					dimension_name: frm.doc.reference_document
+					dimension_name: frm.doc.reference_document,
 				},
 				callback: (r) => {
 					if (r.message && r.message.length) {
-						frm.set_df_property("fetch_from_parent", "options",
-							[""].concat(r.message));
+						frm.set_df_property("fetch_from_parent", "options", [""].concat(r.message));
 					} else {
 						frm.set_df_property("fetch_from_parent", "hidden", 1);
 					}
-				}
+				},
 			});
 		}
 	},
 
 	delete_dimension(frm) {
-		let msg = (`
+		let msg = `
 			Custom fields related to this dimension will be deleted on deletion of dimension.
 			<br> Do you want to delete {0} dimension?
-		`);
+		`;
 
 		frappe.confirm(__(msg, [frm.doc.name.bold()]), () => {
 			frappe.call({
-				method: 'erpnext.stock.doctype.inventory_dimension.inventory_dimension.delete_dimension',
+				method: "erpnext.stock.doctype.inventory_dimension.inventory_dimension.delete_dimension",
 				args: {
-					dimension: frm.doc.name
+					dimension: frm.doc.name,
 				},
-				callback: function() {
-					frappe.set_route('List', 'Inventory Dimension');
-				}
+				callback: function () {
+					frappe.set_route("List", "Inventory Dimension");
+				},
 			});
 		});
-	}
+	},
 });
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index b964c84..7a38024 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -3,48 +3,47 @@
 
 frappe.provide("erpnext.item");
 
-const SALES_DOCTYPES = ['Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice'];
-const PURCHASE_DOCTYPES = ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice'];
+const SALES_DOCTYPES = ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice"];
+const PURCHASE_DOCTYPES = ["Purchase Order", "Purchase Receipt", "Purchase Invoice"];
 
 frappe.ui.form.on("Item", {
-	setup: function(frm) {
-		frm.add_fetch('attribute', 'numeric_values', 'numeric_values');
-		frm.add_fetch('attribute', 'from_range', 'from_range');
-		frm.add_fetch('attribute', 'to_range', 'to_range');
-		frm.add_fetch('attribute', 'increment', 'increment');
-		frm.add_fetch('tax_type', 'tax_rate', 'tax_rate');
+	setup: function (frm) {
+		frm.add_fetch("attribute", "numeric_values", "numeric_values");
+		frm.add_fetch("attribute", "from_range", "from_range");
+		frm.add_fetch("attribute", "to_range", "to_range");
+		frm.add_fetch("attribute", "increment", "increment");
+		frm.add_fetch("tax_type", "tax_rate", "tax_rate");
 
 		frm.make_methods = {
-			'Sales Order': () => {
+			"Sales Order": () => {
 				open_form(frm, "Sales Order", "Sales Order Item", "items");
 			},
-			'Delivery Note': () => {
+			"Delivery Note": () => {
 				open_form(frm, "Delivery Note", "Delivery Note Item", "items");
 			},
-			'Sales Invoice': () => {
+			"Sales Invoice": () => {
 				open_form(frm, "Sales Invoice", "Sales Invoice Item", "items");
 			},
-			'Purchase Order': () => {
+			"Purchase Order": () => {
 				open_form(frm, "Purchase Order", "Purchase Order Item", "items");
 			},
-			'Purchase Receipt': () => {
+			"Purchase Receipt": () => {
 				open_form(frm, "Purchase Receipt", "Purchase Receipt Item", "items");
 			},
-			'Purchase Invoice': () => {
+			"Purchase Invoice": () => {
 				open_form(frm, "Purchase Invoice", "Purchase Invoice Item", "items");
 			},
-			'Material Request': () => {
+			"Material Request": () => {
 				open_form(frm, "Material Request", "Material Request Item", "items");
 			},
-			'Stock Entry': () => {
+			"Stock Entry": () => {
 				open_form(frm, "Stock Entry", "Stock Entry Detail", "items");
 			},
 		};
-
 	},
-	onload: function(frm) {
+	onload: function (frm) {
 		erpnext.item.setup_queries(frm);
-		if (frm.doc.variant_of){
+		if (frm.doc.variant_of) {
 			frm.fields_dict["attributes"].grid.set_column_disp("attribute_value", true);
 		}
 
@@ -53,73 +52,117 @@
 		}
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		if (frm.doc.is_stock_item) {
-			frm.add_custom_button(__("Stock Balance"), function() {
-				frappe.route_options = {
-					"item_code": frm.doc.name
-				}
-				frappe.set_route("query-report", "Stock Balance");
-			}, __("View"));
-			frm.add_custom_button(__("Stock Ledger"), function() {
-				frappe.route_options = {
-					"item_code": frm.doc.name
-				}
-				frappe.set_route("query-report", "Stock Ledger");
-			}, __("View"));
-			frm.add_custom_button(__("Stock Projected Qty"), function() {
-				frappe.route_options = {
-					"item_code": frm.doc.name
-				}
-				frappe.set_route("query-report", "Stock Projected Qty");
-			}, __("View"));
+			frm.add_custom_button(
+				__("Stock Balance"),
+				function () {
+					frappe.route_options = {
+						item_code: frm.doc.name,
+					};
+					frappe.set_route("query-report", "Stock Balance");
+				},
+				__("View")
+			);
+			frm.add_custom_button(
+				__("Stock Ledger"),
+				function () {
+					frappe.route_options = {
+						item_code: frm.doc.name,
+					};
+					frappe.set_route("query-report", "Stock Ledger");
+				},
+				__("View")
+			);
+			frm.add_custom_button(
+				__("Stock Projected Qty"),
+				function () {
+					frappe.route_options = {
+						item_code: frm.doc.name,
+					};
+					frappe.set_route("query-report", "Stock Projected Qty");
+				},
+				__("View")
+			);
 		}
 
-
 		if (frm.doc.is_fixed_asset) {
-			frm.trigger('is_fixed_asset');
-			frm.trigger('auto_create_assets');
+			frm.trigger("is_fixed_asset");
+			frm.trigger("auto_create_assets");
 		}
 
 		// clear intro
 		frm.set_intro();
 
 		if (frm.doc.has_variants) {
-			frm.set_intro(__("This Item is a Template and cannot be used in transactions. Item attributes will be copied over into the variants unless 'No Copy' is set"), true);
+			frm.set_intro(
+				__(
+					"This Item is a Template and cannot be used in transactions. Item attributes will be copied over into the variants unless 'No Copy' is set"
+				),
+				true
+			);
 
-			frm.add_custom_button(__("Show Variants"), function() {
-				frappe.set_route("List", "Item", {"variant_of": frm.doc.name});
-			}, __("View"));
+			frm.add_custom_button(
+				__("Show Variants"),
+				function () {
+					frappe.set_route("List", "Item", { variant_of: frm.doc.name });
+				},
+				__("View")
+			);
 
-			frm.add_custom_button(__("Item Variant Settings"), function() {
-				frappe.set_route("Form", "Item Variant Settings");
-			}, __("View"));
+			frm.add_custom_button(
+				__("Item Variant Settings"),
+				function () {
+					frappe.set_route("Form", "Item Variant Settings");
+				},
+				__("View")
+			);
 
-			frm.add_custom_button(__("Variant Details Report"), function() {
-				frappe.set_route("query-report", "Item Variant Details", {"item": frm.doc.name});
-			}, __("View"));
+			frm.add_custom_button(
+				__("Variant Details Report"),
+				function () {
+					frappe.set_route("query-report", "Item Variant Details", { item: frm.doc.name });
+				},
+				__("View")
+			);
 
-			if(frm.doc.variant_based_on==="Item Attribute") {
-				frm.add_custom_button(__("Single Variant"), function() {
-					erpnext.item.show_single_variant_dialog(frm);
-				}, __('Create'));
-				frm.add_custom_button(__("Multiple Variants"), function() {
-					erpnext.item.show_multiple_variants_dialog(frm);
-				}, __('Create'));
+			if (frm.doc.variant_based_on === "Item Attribute") {
+				frm.add_custom_button(
+					__("Single Variant"),
+					function () {
+						erpnext.item.show_single_variant_dialog(frm);
+					},
+					__("Create")
+				);
+				frm.add_custom_button(
+					__("Multiple Variants"),
+					function () {
+						erpnext.item.show_multiple_variants_dialog(frm);
+					},
+					__("Create")
+				);
 			} else {
-				frm.add_custom_button(__("Variant"), function() {
-					erpnext.item.show_modal_for_manufacturers(frm);
-				}, __('Create'));
+				frm.add_custom_button(
+					__("Variant"),
+					function () {
+						erpnext.item.show_modal_for_manufacturers(frm);
+					},
+					__("Create")
+				);
 			}
 
 			// frm.page.set_inner_btn_group_as_primary(__('Create'));
 		}
 		if (frm.doc.variant_of) {
-			frm.set_intro(__('This Item is a Variant of {0} (Template).',
-				[`<a href="/app/item/${frm.doc.variant_of}" onclick="location.reload()">${frm.doc.variant_of}</a>`]), true);
+			frm.set_intro(
+				__("This Item is a Variant of {0} (Template).", [
+					`<a href="/app/item/${frm.doc.variant_of}" onclick="location.reload()">${frm.doc.variant_of}</a>`,
+				]),
+				true
+			);
 		}
 
-		if (frappe.defaults.get_default("item_naming_by")!="Naming Series" || frm.doc.variant_of) {
+		if (frappe.defaults.get_default("item_naming_by") != "Naming Series" || frm.doc.variant_of) {
 			frm.toggle_display("naming_series", false);
 		} else {
 			erpnext.toggle_naming_series();
@@ -132,341 +175,374 @@
 			erpnext.item.make_dashboard(frm);
 		}
 
-		frm.add_custom_button(__('Duplicate'), function() {
+		frm.add_custom_button(__("Duplicate"), function () {
 			var new_item = frappe.model.copy_doc(frm.doc);
 			// Duplicate item could have different name, causing "copy paste" error.
-			if (new_item.item_name===new_item.item_code) {
+			if (new_item.item_name === new_item.item_code) {
 				new_item.item_name = null;
 			}
-			if (new_item.item_code===new_item.description || new_item.item_code===new_item.description) {
+			if (new_item.item_code === new_item.description || new_item.item_code === new_item.description) {
 				new_item.description = null;
 			}
-			frappe.set_route('Form', 'Item', new_item.name);
+			frappe.set_route("Form", "Item", new_item.name);
 		});
 
-		const stock_exists = (frm.doc.__onload
-			&& frm.doc.__onload.stock_exists) ? 1 : 0;
+		const stock_exists = frm.doc.__onload && frm.doc.__onload.stock_exists ? 1 : 0;
 
-		['is_stock_item', 'has_serial_no', 'has_batch_no', 'has_variants'].forEach((fieldname) => {
-			frm.set_df_property(fieldname, 'read_only', stock_exists);
+		["is_stock_item", "has_serial_no", "has_batch_no", "has_variants"].forEach((fieldname) => {
+			frm.set_df_property(fieldname, "read_only", stock_exists);
 		});
 
-		frm.toggle_reqd('customer', frm.doc.is_customer_provided_item ? 1:0);
+		frm.toggle_reqd("customer", frm.doc.is_customer_provided_item ? 1 : 0);
 	},
 
-	validate: function(frm){
+	validate: function (frm) {
 		erpnext.item.weight_to_validate(frm);
 	},
 
-	image: function() {
+	image: function () {
 		refresh_field("image_view");
 	},
 
-	is_customer_provided_item: function(frm) {
-		frm.toggle_reqd('customer', frm.doc.is_customer_provided_item ? 1:0);
+	is_customer_provided_item: function (frm) {
+		frm.toggle_reqd("customer", frm.doc.is_customer_provided_item ? 1 : 0);
 	},
 
-	is_fixed_asset: function(frm) {
+	is_fixed_asset: function (frm) {
 		// set serial no to false & toggles its visibility
-		frm.set_value('has_serial_no', 0);
-		frm.set_value('has_batch_no', 0);
-		frm.toggle_enable(['has_serial_no', 'serial_no_series'], !frm.doc.is_fixed_asset);
+		frm.set_value("has_serial_no", 0);
+		frm.set_value("has_batch_no", 0);
+		frm.toggle_enable(["has_serial_no", "serial_no_series"], !frm.doc.is_fixed_asset);
 
 		frappe.call({
 			method: "erpnext.stock.doctype.item.item.get_asset_naming_series",
-			callback: function(r) {
+			callback: function (r) {
 				frm.set_value("is_stock_item", frm.doc.is_fixed_asset ? 0 : 1);
 				frm.events.set_asset_naming_series(frm, r.message);
-			}
+			},
 		});
 
-		frm.trigger('auto_create_assets');
+		frm.trigger("auto_create_assets");
 	},
 
-	set_asset_naming_series: function(frm, asset_naming_series) {
+	set_asset_naming_series: function (frm, asset_naming_series) {
 		if ((frm.doc.__onload && frm.doc.__onload.asset_naming_series) || asset_naming_series) {
-			let naming_series = (frm.doc.__onload && frm.doc.__onload.asset_naming_series) || asset_naming_series;
+			let naming_series =
+				(frm.doc.__onload && frm.doc.__onload.asset_naming_series) || asset_naming_series;
 			frm.set_df_property("asset_naming_series", "options", naming_series);
 		}
 	},
 
-	auto_create_assets: function(frm) {
-		frm.toggle_reqd(['asset_naming_series'], frm.doc.auto_create_assets);
-		frm.toggle_display(['asset_naming_series'], frm.doc.auto_create_assets);
+	auto_create_assets: function (frm) {
+		frm.toggle_reqd(["asset_naming_series"], frm.doc.auto_create_assets);
+		frm.toggle_display(["asset_naming_series"], frm.doc.auto_create_assets);
 	},
 
 	page_name: frappe.utils.warn_page_name_change,
 
-	item_code: function(frm) {
-		if(!frm.doc.item_name)
-			frm.set_value("item_name", frm.doc.item_code);
+	item_code: function (frm) {
+		if (!frm.doc.item_name) frm.set_value("item_name", frm.doc.item_code);
 	},
 
-	is_stock_item: function(frm) {
-		if(!frm.doc.is_stock_item) {
+	is_stock_item: function (frm) {
+		if (!frm.doc.is_stock_item) {
 			frm.set_value("has_batch_no", 0);
 			frm.set_value("create_new_batch", 0);
 			frm.set_value("has_serial_no", 0);
 		}
 	},
 
-	has_variants: function(frm) {
+	has_variants: function (frm) {
 		erpnext.item.toggle_attributes(frm);
-	}
+	},
 });
 
-frappe.ui.form.on('Item Reorder', {
-	reorder_levels_add: function(frm, cdt, cdn) {
+frappe.ui.form.on("Item Reorder", {
+	reorder_levels_add: function (frm, cdt, cdn) {
 		var row = frappe.get_doc(cdt, cdn);
-		var type = frm.doc.default_material_request_type
-		row.material_request_type = (type == 'Material Transfer')? 'Transfer' : type;
-	}
-})
-
-frappe.ui.form.on('Item Customer Detail', {
-	customer_items_add: function(frm, cdt, cdn) {
-		frappe.model.set_value(cdt, cdn, 'customer_group', "");
+		var type = frm.doc.default_material_request_type;
+		row.material_request_type = type == "Material Transfer" ? "Transfer" : type;
 	},
-	customer_name: function(frm, cdt, cdn) {
+});
+
+frappe.ui.form.on("Item Customer Detail", {
+	customer_items_add: function (frm, cdt, cdn) {
+		frappe.model.set_value(cdt, cdn, "customer_group", "");
+	},
+	customer_name: function (frm, cdt, cdn) {
 		set_customer_group(frm, cdt, cdn);
 	},
-	customer_group: function(frm, cdt, cdn) {
-		if(set_customer_group(frm, cdt, cdn)){
+	customer_group: function (frm, cdt, cdn) {
+		if (set_customer_group(frm, cdt, cdn)) {
 			frappe.msgprint(__("Changing Customer Group for the selected Customer is not allowed."));
 		}
-	}
+	},
 });
 
-var set_customer_group = function(frm, cdt, cdn) {
+var set_customer_group = function (frm, cdt, cdn) {
 	var row = frappe.get_doc(cdt, cdn);
 
 	if (!row.customer_name) {
 		return false;
 	}
 
-	frappe.model.with_doc("Customer", row.customer_name, function() {
+	frappe.model.with_doc("Customer", row.customer_name, function () {
 		var customer = frappe.model.get_doc("Customer", row.customer_name);
 		row.customer_group = customer.customer_group;
 		refresh_field("customer_group", cdn, "customer_items");
 	});
 	return true;
-}
+};
 
 $.extend(erpnext.item, {
-	setup_queries: function(frm) {
-		frm.fields_dict["item_defaults"].grid.get_field("expense_account").get_query = function(doc, cdt, cdn) {
+	setup_queries: function (frm) {
+		frm.fields_dict["item_defaults"].grid.get_field("expense_account").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
 			const row = locals[cdt][cdn];
 			return {
 				query: "erpnext.controllers.queries.get_expense_account",
-				filters: { company: row.company }
-			}
-		}
-
-		frm.fields_dict["item_defaults"].grid.get_field("income_account").get_query = function(doc, cdt, cdn) {
-			const row = locals[cdt][cdn];
-			return {
-				query: "erpnext.controllers.queries.get_income_account",
-				filters: { company: row.company }
-			}
-		}
-
-		frm.fields_dict["item_defaults"].grid.get_field("default_discount_account").get_query = function(doc, cdt, cdn) {
-			const row = locals[cdt][cdn];
-			return {
-				filters: {
-					'report_type': 'Profit and Loss',
-					'company': row.company,
-					"is_group": 0
-				}
+				filters: { company: row.company },
 			};
 		};
 
-		frm.fields_dict["item_defaults"].grid.get_field("buying_cost_center").get_query = function(doc, cdt, cdn) {
+		frm.fields_dict["item_defaults"].grid.get_field("income_account").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
+			const row = locals[cdt][cdn];
+			return {
+				query: "erpnext.controllers.queries.get_income_account",
+				filters: { company: row.company },
+			};
+		};
+
+		frm.fields_dict["item_defaults"].grid.get_field("default_discount_account").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
 			const row = locals[cdt][cdn];
 			return {
 				filters: {
-					"is_group": 0,
-					"company": row.company
-				}
-			}
-		}
+					report_type: "Profit and Loss",
+					company: row.company,
+					is_group: 0,
+				},
+			};
+		};
 
-		frm.fields_dict["item_defaults"].grid.get_field("selling_cost_center").get_query = function(doc, cdt, cdn) {
+		frm.fields_dict["item_defaults"].grid.get_field("buying_cost_center").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
 			const row = locals[cdt][cdn];
 			return {
 				filters: {
-					"is_group": 0,
-					"company": row.company
-				}
-			}
-		}
+					is_group: 0,
+					company: row.company,
+				},
+			};
+		};
 
+		frm.fields_dict["item_defaults"].grid.get_field("selling_cost_center").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
+			const row = locals[cdt][cdn];
+			return {
+				filters: {
+					is_group: 0,
+					company: row.company,
+				},
+			};
+		};
 
-		frm.fields_dict['taxes'].grid.get_field("tax_type").get_query = function(doc, cdt, cdn) {
+		frm.fields_dict["taxes"].grid.get_field("tax_type").get_query = function (doc, cdt, cdn) {
 			return {
 				filters: [
-					['Account', 'account_type', 'in',
-						'Tax, Chargeable, Income Account, Expense Account'],
-					['Account', 'docstatus', '!=', 2]
-				]
-			}
-		}
+					["Account", "account_type", "in", "Tax, Chargeable, Income Account, Expense Account"],
+					["Account", "docstatus", "!=", 2],
+				],
+			};
+		};
 
-		frm.fields_dict['item_group'].get_query = function(doc, cdt, cdn) {
+		frm.fields_dict["item_group"].get_query = function (doc, cdt, cdn) {
 			return {
-				filters: [
-					['Item Group', 'docstatus', '!=', 2]
-				]
-			}
-		}
+				filters: [["Item Group", "docstatus", "!=", 2]],
+			};
+		};
 
-		frm.fields_dict["item_defaults"].grid.get_field("deferred_revenue_account").get_query = function(doc, cdt, cdn) {
+		frm.fields_dict["item_defaults"].grid.get_field("deferred_revenue_account").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
 			return {
 				filters: {
-					"company": locals[cdt][cdn].company,
-					'root_type': 'Liability',
-					"is_group": 0
-				}
-			}
-		}
+					company: locals[cdt][cdn].company,
+					root_type: "Liability",
+					is_group: 0,
+				},
+			};
+		};
 
-		frm.fields_dict["item_defaults"].grid.get_field("deferred_expense_account").get_query = function(doc, cdt, cdn) {
+		frm.fields_dict["item_defaults"].grid.get_field("deferred_expense_account").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
 			return {
 				filters: {
-					"company": locals[cdt][cdn].company,
-					'root_type': 'Asset',
-					"is_group": 0
-				}
-			}
-		}
+					company: locals[cdt][cdn].company,
+					root_type: "Asset",
+					is_group: 0,
+				},
+			};
+		};
 
-		frm.fields_dict.customer_items.grid.get_field("customer_name").get_query = function(doc, cdt, cdn) {
-			return { query: "erpnext.controllers.queries.customer_query" }
-		}
+		frm.fields_dict.customer_items.grid.get_field("customer_name").get_query = function (doc, cdt, cdn) {
+			return { query: "erpnext.controllers.queries.customer_query" };
+		};
 
-		frm.fields_dict.supplier_items.grid.get_field("supplier").get_query = function(doc, cdt, cdn) {
-			return { query: "erpnext.controllers.queries.supplier_query" }
-		}
+		frm.fields_dict.supplier_items.grid.get_field("supplier").get_query = function (doc, cdt, cdn) {
+			return { query: "erpnext.controllers.queries.supplier_query" };
+		};
 
-		frm.fields_dict["item_defaults"].grid.get_field("default_warehouse").get_query = function(doc, cdt, cdn) {
+		frm.fields_dict["item_defaults"].grid.get_field("default_warehouse").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
 			const row = locals[cdt][cdn];
 			return {
 				filters: {
-					"is_group": 0,
-					"company": row.company
-				}
-			}
-		}
+					is_group: 0,
+					company: row.company,
+				},
+			};
+		};
 
-		frm.fields_dict.reorder_levels.grid.get_field("warehouse_group").get_query = function(doc, cdt, cdn) {
+		frm.fields_dict.reorder_levels.grid.get_field("warehouse_group").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
 			return {
-				filters: { "is_group": 1 }
-			}
-		}
+				filters: { is_group: 1 },
+			};
+		};
 
-		frm.fields_dict.reorder_levels.grid.get_field("warehouse").get_query = function(doc, cdt, cdn) {
+		frm.fields_dict.reorder_levels.grid.get_field("warehouse").get_query = function (doc, cdt, cdn) {
 			var d = locals[cdt][cdn];
 
 			var filters = {
-				"is_group": 0
-			}
+				is_group: 0,
+			};
 
 			if (d.parent_warehouse) {
-				filters.extend({"parent_warehouse": d.warehouse_group})
+				filters.extend({ parent_warehouse: d.warehouse_group });
 			}
 
 			return {
-				filters: filters
-			}
-		}
+				filters: filters,
+			};
+		};
 
-		frm.set_query('default_provisional_account', 'item_defaults', (doc, cdt, cdn) => {
+		frm.set_query("default_provisional_account", "item_defaults", (doc, cdt, cdn) => {
 			let row = locals[cdt][cdn];
 			return {
 				filters: {
-					"company": row.company,
-					"root_type": ["in", ["Liability", "Asset"]],
-					"is_group": 0
-				}
+					company: row.company,
+					root_type: ["in", ["Liability", "Asset"]],
+					is_group: 0,
+				},
 			};
 		});
-
 	},
 
-	make_dashboard: function(frm) {
-		if(frm.doc.__islocal)
-			return;
+	make_dashboard: function (frm) {
+		if (frm.doc.__islocal) return;
 
 		// Show Stock Levels only if is_stock_item
 		if (frm.doc.is_stock_item) {
-			frappe.require('item-dashboard.bundle.js', function() {
-				const section = frm.dashboard.add_section('', __("Stock Levels"));
+			frappe.require("item-dashboard.bundle.js", function () {
+				const section = frm.dashboard.add_section("", __("Stock Levels"));
 				erpnext.item.item_dashboard = new erpnext.stock.ItemDashboard({
 					parent: section,
 					item_code: frm.doc.name,
 					page_length: 20,
-					method: 'erpnext.stock.dashboard.item_dashboard.get_data',
-					template: 'item_dashboard_list'
+					method: "erpnext.stock.dashboard.item_dashboard.get_data",
+					template: "item_dashboard_list",
 				});
 				erpnext.item.item_dashboard.refresh();
 			});
 		}
 	},
 
-	edit_prices_button: function(frm) {
-		frm.add_custom_button(__("Add / Edit Prices"), function() {
-			frappe.set_route("List", "Item Price", {"item_code": frm.doc.name});
-		}, __("Actions"));
+	edit_prices_button: function (frm) {
+		frm.add_custom_button(
+			__("Add / Edit Prices"),
+			function () {
+				frappe.set_route("List", "Item Price", { item_code: frm.doc.name });
+			},
+			__("Actions")
+		);
 	},
 
-	weight_to_validate: function(frm) {
+	weight_to_validate: function (frm) {
 		if (frm.doc.weight_per_unit && !frm.doc.weight_uom) {
 			frappe.msgprint({
 				message: __("Please mention 'Weight UOM' along with Weight."),
-				title: __("Note")
+				title: __("Note"),
 			});
 		}
 	},
 
-	show_modal_for_manufacturers: function(frm) {
+	show_modal_for_manufacturers: function (frm) {
 		var dialog = new frappe.ui.Dialog({
 			fields: [
 				{
-					fieldtype: 'Link',
-					fieldname: 'manufacturer',
-					options: 'Manufacturer',
-					label: 'Manufacturer',
+					fieldtype: "Link",
+					fieldname: "manufacturer",
+					options: "Manufacturer",
+					label: "Manufacturer",
 					reqd: 1,
 				},
 				{
-					fieldtype: 'Data',
-					label: 'Manufacturer Part Number',
-					fieldname: 'manufacturer_part_no'
+					fieldtype: "Data",
+					label: "Manufacturer Part Number",
+					fieldname: "manufacturer_part_no",
 				},
-			]
+			],
 		});
 
-		dialog.set_primary_action(__('Create'), function() {
+		dialog.set_primary_action(__("Create"), function () {
 			var data = dialog.get_values();
-			if(!data) return;
+			if (!data) return;
 
 			// call the server to make the variant
 			data.template = frm.doc.name;
 			frappe.call({
 				method: "erpnext.controllers.item_variant.get_variant",
 				args: data,
-				callback: function(r) {
+				callback: function (r) {
 					var doclist = frappe.model.sync(r.message);
 					dialog.hide();
 					frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
-				}
+				},
 			});
-		})
+		});
 
 		dialog.show();
 	},
 
-	show_multiple_variants_dialog: function(frm) {
+	show_multiple_variants_dialog: function (frm) {
 		var me = this;
 
 		let promises = [];
@@ -475,27 +551,26 @@
 		function make_fields_from_attribute_values(attr_dict) {
 			let fields = [];
 			Object.keys(attr_dict).forEach((name, i) => {
-				if(i % 3 === 0){
-					fields.push({fieldtype: 'Section Break'});
+				if (i % 3 === 0) {
+					fields.push({ fieldtype: "Section Break" });
 				}
-				fields.push({fieldtype: 'Column Break', label: name});
-				attr_dict[name].forEach(value => {
+				fields.push({ fieldtype: "Column Break", label: name });
+				attr_dict[name].forEach((value) => {
 					fields.push({
-						fieldtype: 'Check',
+						fieldtype: "Check",
 						label: value,
 						fieldname: value,
 						default: 0,
-						onchange: function() {
+						onchange: function () {
 							let selected_attributes = get_selected_attributes();
 							let lengths = [];
-							Object.keys(selected_attributes).map(key => {
+							Object.keys(selected_attributes).map((key) => {
 								lengths.push(selected_attributes[key].length);
 							});
-							if(lengths.includes(0)) {
-								me.multiple_variant_dialog.get_primary_btn().html(__('Create Variants'));
+							if (lengths.includes(0)) {
+								me.multiple_variant_dialog.get_primary_btn().html(__("Create Variants"));
 								me.multiple_variant_dialog.disable_primary_action();
 							} else {
-
 								let no_of_combinations = lengths.reduce((a, b) => a * b, 1);
 								let msg;
 								if (no_of_combinations === 1) {
@@ -506,7 +581,7 @@
 								me.multiple_variant_dialog.get_primary_btn().html(msg);
 								me.multiple_variant_dialog.enable_primary_action();
 							}
-						}
+						},
 					});
 				});
 			});
@@ -523,38 +598,40 @@
 						options: `<label class="control-label">
 							${__("Select at least one value from each of the attributes.")}
 						</label>`,
-					}
-				].concat(fields)
+					},
+				].concat(fields),
 			});
 
-			me.multiple_variant_dialog.set_primary_action(__('Create Variants'), () => {
+			me.multiple_variant_dialog.set_primary_action(__("Create Variants"), () => {
 				let selected_attributes = get_selected_attributes();
 
 				me.multiple_variant_dialog.hide();
 				frappe.call({
 					method: "erpnext.controllers.item_variant.enqueue_multiple_variant_creation",
 					args: {
-						"item": frm.doc.name,
-						"args": selected_attributes
+						item: frm.doc.name,
+						args: selected_attributes,
 					},
-					callback: function(r) {
-						if (r.message==='queued') {
+					callback: function (r) {
+						if (r.message === "queued") {
 							frappe.show_alert({
 								message: __("Variant creation has been queued."),
-								indicator: 'orange'
+								indicator: "orange",
 							});
 						} else {
 							frappe.show_alert({
 								message: __("{0} variants created.", [r.message]),
-								indicator: 'green'
+								indicator: "green",
 							});
 						}
-					}
+					},
 				});
 			});
 
-			$($(me.multiple_variant_dialog.$wrapper.find('.form-column'))
-				.find('.frappe-control')).css('margin-bottom', '0px');
+			$($(me.multiple_variant_dialog.$wrapper.find(".form-column")).find(".frappe-control")).css(
+				"margin-bottom",
+				"0px"
+			);
 
 			me.multiple_variant_dialog.disable_primary_action();
 			me.multiple_variant_dialog.clear();
@@ -563,14 +640,14 @@
 
 		function get_selected_attributes() {
 			let selected_attributes = {};
-			me.multiple_variant_dialog.$wrapper.find('.form-column').each((i, col) => {
-				if(i===0) return;
-				let attribute_name = $(col).find('.column-label').html().trim();
+			me.multiple_variant_dialog.$wrapper.find(".form-column").each((i, col) => {
+				if (i === 0) return;
+				let attribute_name = $(col).find(".column-label").html().trim();
 				selected_attributes[attribute_name] = [];
-				let checked_opts = $(col).find('.checkbox input');
+				let checked_opts = $(col).find(".checkbox input");
 				checked_opts.each((i, opt) => {
-					if($(opt).is(':checked')) {
-						selected_attributes[attribute_name].push($(opt).attr('data-fieldname'));
+					if ($(opt).is(":checked")) {
+						selected_attributes[attribute_name].push($(opt).attr("data-fieldname"));
 					}
 				});
 			});
@@ -578,30 +655,32 @@
 			return selected_attributes;
 		}
 
-		frm.doc.attributes.forEach(function(d) {
-			let p = new Promise(resolve => {
-				if(!d.numeric_values) {
-					frappe.call({
-						method: "frappe.client.get_list",
-						args: {
-							doctype: "Item Attribute Value",
-							filters: [
-								["parent","=", d.attribute]
-							],
-							fields: ["attribute_value"],
-							limit_page_length: 0,
-							parent: "Item Attribute",
-							order_by: "idx"
-						}
-					}).then((r) => {
-						if(r.message) {
-							attr_val_fields[d.attribute] = r.message.map(function(d) { return d.attribute_value; });
-							resolve();
-						}
-					});
+		frm.doc.attributes.forEach(function (d) {
+			let p = new Promise((resolve) => {
+				if (!d.numeric_values) {
+					frappe
+						.call({
+							method: "frappe.client.get_list",
+							args: {
+								doctype: "Item Attribute Value",
+								filters: [["parent", "=", d.attribute]],
+								fields: ["attribute_value"],
+								limit_page_length: 0,
+								parent: "Item Attribute",
+								order_by: "idx",
+							},
+						})
+						.then((r) => {
+							if (r.message) {
+								attr_val_fields[d.attribute] = r.message.map(function (d) {
+									return d.attribute_value;
+								});
+								resolve();
+							}
+						});
 				} else {
 					let values = [];
-					for(var i = d.from_range; i <= d.to_range; i = flt(i + d.increment, 6)) {
+					for (var i = d.from_range; i <= d.to_range; i = flt(i + d.increment, 6)) {
 						values.push(i);
 					}
 					attr_val_fields[d.attribute] = values;
@@ -610,66 +689,74 @@
 			});
 
 			promises.push(p);
-
 		}, this);
 
 		Promise.all(promises).then(() => {
 			let fields = make_fields_from_attribute_values(attr_val_fields);
 			make_and_show_dialog(fields);
-		})
-
+		});
 	},
 
-	show_single_variant_dialog: function(frm) {
-		var fields = []
+	show_single_variant_dialog: function (frm) {
+		var fields = [];
 
-		for(var i=0;i< frm.doc.attributes.length;i++){
+		for (var i = 0; i < frm.doc.attributes.length; i++) {
 			var fieldtype, desc;
 			var row = frm.doc.attributes[i];
-			if (row.numeric_values){
+			if (row.numeric_values) {
 				fieldtype = "Float";
-				desc = "Min Value: "+ row.from_range +" , Max Value: "+ row.to_range +", in Increments of: "+ row.increment
-			}
-			else {
+				desc =
+					"Min Value: " +
+					row.from_range +
+					" , Max Value: " +
+					row.to_range +
+					", in Increments of: " +
+					row.increment;
+			} else {
 				fieldtype = "Data";
-				desc = ""
+				desc = "";
 			}
 			fields = fields.concat({
-				"label": row.attribute,
-				"fieldname": row.attribute,
-				"fieldtype": fieldtype,
-				"reqd": 0,
-				"description": desc
-			})
+				label: row.attribute,
+				fieldname: row.attribute,
+				fieldtype: fieldtype,
+				reqd: 0,
+				description: desc,
+			});
 		}
 
 		var d = new frappe.ui.Dialog({
-			title: __('Create Variant'),
-			fields: fields
+			title: __("Create Variant"),
+			fields: fields,
 		});
 
-		d.set_primary_action(__('Create'), function() {
+		d.set_primary_action(__("Create"), function () {
 			var args = d.get_values();
-			if(!args) return;
+			if (!args) return;
 			frappe.call({
 				method: "erpnext.controllers.item_variant.get_variant",
 				btn: d.get_primary_btn(),
 				args: {
-					"template": frm.doc.name,
-					"args": d.get_values()
+					template: frm.doc.name,
+					args: d.get_values(),
 				},
-				callback: function(r) {
+				callback: function (r) {
 					// returns variant item
 					if (r.message) {
 						var variant = r.message;
-						frappe.msgprint_dialog = frappe.msgprint(__("Item Variant {0} already exists with same attributes",
-							[repl('<a href="/app/item/%(item_encoded)s" class="strong variant-click">%(item)s</a>', {
-								item_encoded: encodeURIComponent(variant),
-								item: variant
-							})]
-						));
+						frappe.msgprint_dialog = frappe.msgprint(
+							__("Item Variant {0} already exists with same attributes", [
+								repl(
+									'<a href="/app/item/%(item_encoded)s" class="strong variant-click">%(item)s</a>',
+									{
+										item_encoded: encodeURIComponent(variant),
+										item: variant,
+									}
+								),
+							])
+						);
 						frappe.msgprint_dialog.hide_on_page_refresh = true;
-						frappe.msgprint_dialog.$wrapper.find(".variant-click").on("click", function() {
+						frappe.msgprint_dialog.$wrapper.find(".variant-click").on("click", function () {
 							d.hide();
 						});
 					} else {
@@ -677,24 +764,23 @@
 						frappe.call({
 							method: "erpnext.controllers.item_variant.create_variant",
 							args: {
-								"item": frm.doc.name,
-								"args": d.get_values()
+								item: frm.doc.name,
+								args: d.get_values(),
 							},
-							callback: function(r) {
+							callback: function (r) {
 								var doclist = frappe.model.sync(r.message);
 								frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
-							}
+							},
 						});
 					}
-				}
+				},
 			});
 		});
 
 		d.show();
 
-		$.each(d.fields_dict, function(i, field) {
-
-			if(field.df.fieldtype !== "Data") {
+		$.each(d.fields_dict, function (i, field) {
+			if (field.df.fieldtype !== "Data") {
 				return;
 			}
 
@@ -710,26 +796,28 @@
 			input.field = field;
 
 			field.$input
-				.on('input', function(e) {
+				.on("input", function (e) {
 					var term = e.target.value;
 					frappe.call({
 						method: "erpnext.stock.doctype.item.item.get_item_attribute",
 						args: {
 							parent: i,
-							attribute_value: term
+							attribute_value: term,
 						},
-						callback: function(r) {
+						callback: function (r) {
 							if (r.message) {
-								e.target.awesomplete.list = r.message.map(function(d) { return d.attribute_value; });
+								e.target.awesomplete.list = r.message.map(function (d) {
+									return d.attribute_value;
+								});
 							}
-						}
+						},
 					});
 				})
-				.on('focus', function(e) {
-					$(e.target).val('').trigger('input');
+				.on("focus", function (e) {
+					$(e.target).val("").trigger("input");
 				})
 				.on("awesomplete-open", () => {
-					let modal = field.$input.parents('.modal-dialog')[0];
+					let modal = field.$input.parents(".modal-dialog")[0];
 					if (modal) {
 						$(modal).removeClass("modal-dialog-scrollable");
 					}
@@ -737,14 +825,13 @@
 		});
 	},
 
-	toggle_attributes: function(frm) {
-		if((frm.doc.has_variants || frm.doc.variant_of)
-			&& frm.doc.variant_based_on==='Item Attribute') {
+	toggle_attributes: function (frm) {
+		if ((frm.doc.has_variants || frm.doc.variant_of) && frm.doc.variant_based_on === "Item Attribute") {
 			frm.toggle_display("attributes", true);
 
 			var grid = frm.fields_dict.attributes.grid;
 
-			if(frm.doc.variant_of) {
+			if (frm.doc.variant_of) {
 				// variant
 
 				// value column is displayed but not editable
@@ -768,78 +855,87 @@
 				// enable the grid so you can add more attributes
 				grid.toggle_enable("attribute", true);
 			}
-
 		} else {
 			// nothing to do with attributes, hide it
 			frm.toggle_display("attributes", false);
 		}
 		frm.layout.refresh_sections();
-	}
+	},
 });
 
 frappe.ui.form.on("UOM Conversion Detail", {
-	uom: function(frm, cdt, cdn) {
+	uom: function (frm, cdt, cdn) {
 		var row = locals[cdt][cdn];
 		if (row.uom) {
 			frappe.call({
 				method: "erpnext.stock.doctype.item.item.get_uom_conv_factor",
 				args: {
-					"uom": row.uom,
-					"stock_uom": frm.doc.stock_uom
+					uom: row.uom,
+					stock_uom: frm.doc.stock_uom,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (!r.exc && r.message) {
 						frappe.model.set_value(cdt, cdn, "conversion_factor", r.message);
 					}
-				}
+				},
 			});
 		}
-	}
+	},
 });
 
-frappe.tour['Item'] = [
+frappe.tour["Item"] = [
 	{
 		fieldname: "item_code",
 		title: "Item Code",
-		description: __("Enter an Item Code, the name will be auto-filled the same as Item Code on clicking inside the Item Name field.")
+		description: __(
+			"Enter an Item Code, the name will be auto-filled the same as Item Code on clicking inside the Item Name field."
+		),
 	},
 	{
 		fieldname: "item_group",
 		title: "Item Group",
-		description: __("Select an Item Group.")
+		description: __("Select an Item Group."),
 	},
 	{
 		fieldname: "is_stock_item",
 		title: "Maintain Stock",
-		description: __("If you are maintaining stock of this Item in your Inventory, ERPNext will make a stock ledger entry for each transaction of this item.")
+		description: __(
+			"If you are maintaining stock of this Item in your Inventory, ERPNext will make a stock ledger entry for each transaction of this item."
+		),
 	},
 	{
 		fieldname: "include_item_in_manufacturing",
 		title: "Include Item in Manufacturing",
-		description: __("This is for raw material Items that'll be used to create finished goods. If the Item is an additional service like 'washing' that'll be used in the BOM, keep this unchecked.")
+		description: __(
+			"This is for raw material Items that'll be used to create finished goods. If the Item is an additional service like 'washing' that'll be used in the BOM, keep this unchecked."
+		),
 	},
 	{
 		fieldname: "opening_stock",
 		title: "Opening Stock",
-		description: __("Enter the opening stock units.")
+		description: __("Enter the opening stock units."),
 	},
 	{
 		fieldname: "valuation_rate",
 		title: "Valuation Rate",
-		description: __("There are two options to maintain valuation of stock. FIFO (first in - first out) and Moving Average. To understand this topic in detail please visit <a href='https://docs.erpnext.com/docs/v13/user/manual/en/stock/articles/item-valuation-fifo-and-moving-average' target='_blank'>Item Valuation, FIFO and Moving Average.</a>")
+		description: __(
+			"There are two options to maintain valuation of stock. FIFO (first in - first out) and Moving Average. To understand this topic in detail please visit <a href='https://docs.erpnext.com/docs/v13/user/manual/en/stock/articles/item-valuation-fifo-and-moving-average' target='_blank'>Item Valuation, FIFO and Moving Average.</a>"
+		),
 	},
 	{
 		fieldname: "standard_rate",
 		title: "Standard Selling Rate",
-		description: __("When creating an Item, entering a value for this field will automatically create an Item Price at the backend.")
+		description: __(
+			"When creating an Item, entering a value for this field will automatically create an Item Price at the backend."
+		),
 	},
 	{
 		fieldname: "item_defaults",
 		title: "Item Defaults",
-		description: __("In this section, you can define Company-wide transaction-related defaults for this Item. Eg. Default Warehouse, Default Price List, Supplier, etc.")
-	}
-
-
+		description: __(
+			"In this section, you can define Company-wide transaction-related defaults for this Item. Eg. Default Warehouse, Default Price List, Supplier, etc."
+		),
+	},
 ];
 
 function open_form(frm, doctype, child_doctype, parentfield) {
@@ -866,7 +962,7 @@
 			() => {
 				frappe.flags.ignore_company_party_validation = true;
 				frappe.model.trigger("item_code", frm.doc.name, new_child_doc);
-			}
-		])
+			},
+		]);
 	});
 }
diff --git a/erpnext/stock/doctype/item/item_list.js b/erpnext/stock/doctype/item/item_list.js
index 67dc86c..e8d886a 100644
--- a/erpnext/stock/doctype/item/item_list.js
+++ b/erpnext/stock/doctype/item/item_list.js
@@ -1,9 +1,17 @@
-frappe.listview_settings['Item'] = {
-	add_fields: ["item_name", "stock_uom", "item_group", "image",
-		"has_variants", "end_of_life", "disabled", "variant_of"],
+frappe.listview_settings["Item"] = {
+	add_fields: [
+		"item_name",
+		"stock_uom",
+		"item_group",
+		"image",
+		"has_variants",
+		"end_of_life",
+		"disabled",
+		"variant_of",
+	],
 	filters: [["disabled", "=", "0"]],
 
-	get_indicator: function(doc) {
+	get_indicator: function (doc) {
 		if (doc.disabled) {
 			return [__("Disabled"), "grey", "disabled,=,Yes"];
 		} else if (doc.end_of_life && doc.end_of_life < frappe.datetime.get_today()) {
@@ -17,23 +25,22 @@
 
 	reports: [
 		{
-			name: 'Stock Summary',
-			route: '/app/stock-balance'
+			name: "Stock Summary",
+			route: "/app/stock-balance",
 		},
 		{
-			name: 'Stock Ledger',
-			report_type: 'Script Report'
+			name: "Stock Ledger",
+			report_type: "Script Report",
 		},
 		{
-			name: 'Stock Balance',
-			report_type: 'Script Report'
+			name: "Stock Balance",
+			report_type: "Script Report",
 		},
 		{
-			name: 'Stock Projected Qty',
-			report_type: 'Script Report'
-		}
-
-	]
+			name: "Stock Projected Qty",
+			report_type: "Script Report",
+		},
+	],
 };
 
 frappe.help.youtube_id["Item"] = "qXaEwld4_Ps";
diff --git a/erpnext/stock/doctype/item_alternative/item_alternative.js b/erpnext/stock/doctype/item_alternative/item_alternative.js
index ef0a88b..e384e57 100644
--- a/erpnext/stock/doctype/item_alternative/item_alternative.js
+++ b/erpnext/stock/doctype/item_alternative/item_alternative.js
@@ -1,14 +1,14 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Item Alternative', {
-	setup: function(frm) {
+frappe.ui.form.on("Item Alternative", {
+	setup: function (frm) {
 		frm.fields_dict.item_code.get_query = () => {
 			return {
 				filters: {
-					'allow_alternative_item': 1
-				}
+					allow_alternative_item: 1,
+				},
 			};
 		};
-	}
+	},
 });
diff --git a/erpnext/stock/doctype/item_attribute/item_attribute.js b/erpnext/stock/doctype/item_attribute/item_attribute.js
index f253e22..22c7978 100644
--- a/erpnext/stock/doctype/item_attribute/item_attribute.js
+++ b/erpnext/stock/doctype/item_attribute/item_attribute.js
@@ -1,6 +1,4 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Item Attribute', {
-
-});
+frappe.ui.form.on("Item Attribute", {});
diff --git a/erpnext/stock/doctype/item_manufacturer/item_manufacturer.js b/erpnext/stock/doctype/item_manufacturer/item_manufacturer.js
index a4df923..2180372 100644
--- a/erpnext/stock/doctype/item_manufacturer/item_manufacturer.js
+++ b/erpnext/stock/doctype/item_manufacturer/item_manufacturer.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Item Manufacturer', {
+frappe.ui.form.on("Item Manufacturer", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/stock/doctype/item_price/item_price.js b/erpnext/stock/doctype/item_price/item_price.js
index 8a4b4ee..a5599e3 100644
--- a/erpnext/stock/doctype/item_price/item_price.js
+++ b/erpnext/stock/doctype/item_price/item_price.js
@@ -3,11 +3,11 @@
 
 frappe.ui.form.on("Item Price", {
 	setup(frm) {
-		frm.set_query("item_code", function() {
+		frm.set_query("item_code", function () {
 			return {
 				filters: {
-					"has_variants": 0
-				}
+					has_variants: 0,
+				},
 			};
 		});
 	},
@@ -23,15 +23,18 @@
 		frm.add_fetch("item_code", "description", "item_description");
 		frm.add_fetch("item_code", "stock_uom", "uom");
 
-		frm.set_df_property("bulk_import_help", "options",
-			'<a href="/app/data-import-tool/Item Price">' + __("Import in Bulk") + '</a>');
+		frm.set_df_property(
+			"bulk_import_help",
+			"options",
+			'<a href="/app/data-import-tool/Item Price">' + __("Import in Bulk") + "</a>"
+		);
 
-		frm.set_query('batch_no', function() {
+		frm.set_query("batch_no", function () {
 			return {
 				filters: {
-					'item': frm.doc.item_code
-				}
+					item: frm.doc.item_code,
+				},
 			};
 		});
-	}
+	},
 });
diff --git a/erpnext/stock/doctype/item_price/item_price_list.js b/erpnext/stock/doctype/item_price/item_price_list.js
index 4815839..94c232e 100644
--- a/erpnext/stock/doctype/item_price/item_price_list.js
+++ b/erpnext/stock/doctype/item_price/item_price_list.js
@@ -1,3 +1,3 @@
-frappe.listview_settings['Item Price'] = {
+frappe.listview_settings["Item Price"] = {
 	hide_name_column: true,
 };
diff --git a/erpnext/stock/doctype/item_variant_settings/item_variant_settings.js b/erpnext/stock/doctype/item_variant_settings/item_variant_settings.js
index 457e48f..d906b85 100644
--- a/erpnext/stock/doctype/item_variant_settings/item_variant_settings.js
+++ b/erpnext/stock/doctype/item_variant_settings/item_variant_settings.js
@@ -1,24 +1,39 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Item Variant Settings', {
-	refresh: function(frm) {
+frappe.ui.form.on("Item Variant Settings", {
+	refresh: function (frm) {
 		const allow_fields = [];
 
-		const existing_fields = frm.doc.fields.map(row => row.field_name);
-		const exclude_fields = [...existing_fields, "naming_series", "item_code", "item_name",
-			"published_in_website", "standard_rate", "opening_stock", "image",
-			"variant_of", "valuation_rate", "barcodes", "has_variants", "attributes"];
+		const existing_fields = frm.doc.fields.map((row) => row.field_name);
+		const exclude_fields = [
+			...existing_fields,
+			"naming_series",
+			"item_code",
+			"item_name",
+			"published_in_website",
+			"standard_rate",
+			"opening_stock",
+			"image",
+			"variant_of",
+			"valuation_rate",
+			"barcodes",
+			"has_variants",
+			"attributes",
+		];
 
-		const exclude_field_types = ['HTML', 'Section Break', 'Column Break', 'Button', 'Read Only'];
+		const exclude_field_types = ["HTML", "Section Break", "Column Break", "Button", "Read Only"];
 
-		frappe.model.with_doctype('Item', () => {
+		frappe.model.with_doctype("Item", () => {
 			const field_label_map = {};
-			frappe.get_meta('Item').fields.forEach(d => {
+			frappe.get_meta("Item").fields.forEach((d) => {
 				field_label_map[d.fieldname] = __(d.label, null, d.parent) + ` (${d.fieldname})`;
 
-				if (!in_list(exclude_field_types, d.fieldtype)
-					&& !d.no_copy && !in_list(exclude_fields, d.fieldname)) {
+				if (
+					!in_list(exclude_field_types, d.fieldtype) &&
+					!d.no_copy &&
+					!in_list(exclude_fields, d.fieldname)
+				) {
 					allow_fields.push({
 						label: field_label_map[d.fieldname],
 						value: d.fieldname,
@@ -33,9 +48,7 @@
 				});
 			}
 
-			frm.fields_dict.fields.grid.update_docfield_property(
-				'field_name', 'options', allow_fields
-			);
+			frm.fields_dict.fields.grid.update_docfield_property("field_name", "options", allow_fields);
 		});
-	}
+	},
 });
diff --git a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js
index 8215efc..0ecb9f2 100644
--- a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js
+++ b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js
@@ -7,24 +7,27 @@
 erpnext.stock.LandedCostVoucher = class LandedCostVoucher extends erpnext.stock.StockController {
 	setup() {
 		var me = this;
-		this.frm.fields_dict.purchase_receipts.grid.get_field('receipt_document').get_query =
-			function (doc, cdt, cdn) {
-				var d = locals[cdt][cdn]
+		this.frm.fields_dict.purchase_receipts.grid.get_field("receipt_document").get_query = function (
+			doc,
+			cdt,
+			cdn
+		) {
+			var d = locals[cdt][cdn];
 
-				var filters = [
-					[d.receipt_document_type, 'docstatus', '=', '1'],
-					[d.receipt_document_type, 'company', '=', me.frm.doc.company],
-				]
+			var filters = [
+				[d.receipt_document_type, "docstatus", "=", "1"],
+				[d.receipt_document_type, "company", "=", me.frm.doc.company],
+			];
 
-				if (d.receipt_document_type == "Purchase Invoice") {
-					filters.push(["Purchase Invoice", "update_stock", "=", "1"])
-				}
+			if (d.receipt_document_type == "Purchase Invoice") {
+				filters.push(["Purchase Invoice", "update_stock", "=", "1"]);
+			}
 
-				if (!me.frm.doc.company) frappe.msgprint(__("Please enter company first"));
-				return {
-					filters: filters
-				}
+			if (!me.frm.doc.company) frappe.msgprint(__("Please enter company first"));
+			return {
+				filters: filters,
 			};
+		};
 
 		this.frm.add_fetch("receipt_document", "supplier", "supplier");
 		this.frm.add_fetch("receipt_document", "posting_date", "posting_date");
@@ -32,8 +35,7 @@
 	}
 
 	refresh() {
-		var help_content =
-			`<br><br>
+		var help_content = `<br><br>
 			<table class="table table-bordered" style="background-color: var(--scrollbar-track-color);">
 				<tr><td>
 					<h4>
@@ -70,15 +72,15 @@
 
 	get_items_from_purchase_receipts() {
 		var me = this;
-		if(!this.frm.doc.purchase_receipts.length) {
+		if (!this.frm.doc.purchase_receipts.length) {
 			frappe.msgprint(__("Please enter Purchase Receipt first"));
 		} else {
 			return this.frm.call({
 				doc: me.frm.doc,
 				method: "get_items_from_purchase_receipts",
-				callback: function(r, rt) {
+				callback: function (r, rt) {
 					me.set_applicable_charges_for_item();
-				}
+				},
 			});
 		}
 	}
@@ -90,7 +92,7 @@
 
 	set_total_taxes_and_charges() {
 		var total_taxes_and_charges = 0.0;
-		$.each(this.frm.doc.taxes || [], function(i, d) {
+		$.each(this.frm.doc.taxes || [], function (i, d) {
 			total_taxes_and_charges += flt(d.base_amount);
 		});
 		this.frm.set_value("total_taxes_and_charges", total_taxes_and_charges);
@@ -99,47 +101,52 @@
 	set_applicable_charges_for_item() {
 		var me = this;
 
-		if(this.frm.doc.taxes.length) {
+		if (this.frm.doc.taxes.length) {
 			var total_item_cost = 0.0;
 			var based_on = this.frm.doc.distribute_charges_based_on.toLowerCase();
 
-			if (based_on != 'distribute manually') {
-				$.each(this.frm.doc.items || [], function(i, d) {
-					total_item_cost += flt(d[based_on])
+			if (based_on != "distribute manually") {
+				$.each(this.frm.doc.items || [], function (i, d) {
+					total_item_cost += flt(d[based_on]);
 				});
 
 				var total_charges = 0.0;
-				$.each(this.frm.doc.items || [], function(i, item) {
-					item.applicable_charges = flt(item[based_on]) * flt(me.frm.doc.total_taxes_and_charges) / flt(total_item_cost)
-					item.applicable_charges = flt(item.applicable_charges, precision("applicable_charges", item))
-					total_charges += item.applicable_charges
+				$.each(this.frm.doc.items || [], function (i, item) {
+					item.applicable_charges =
+						(flt(item[based_on]) * flt(me.frm.doc.total_taxes_and_charges)) /
+						flt(total_item_cost);
+					item.applicable_charges = flt(
+						item.applicable_charges,
+						precision("applicable_charges", item)
+					);
+					total_charges += item.applicable_charges;
 				});
 
-				if (total_charges != this.frm.doc.total_taxes_and_charges){
-					var diff = this.frm.doc.total_taxes_and_charges - flt(total_charges)
-					this.frm.doc.items.slice(-1)[0].applicable_charges += diff
+				if (total_charges != this.frm.doc.total_taxes_and_charges) {
+					var diff = this.frm.doc.total_taxes_and_charges - flt(total_charges);
+					this.frm.doc.items.slice(-1)[0].applicable_charges += diff;
 				}
 				refresh_field("items");
 			}
 		}
 	}
-	distribute_charges_based_on (frm) {
+	distribute_charges_based_on(frm) {
 		this.set_applicable_charges_for_item();
 	}
 
 	items_remove() {
-		this.trigger('set_applicable_charges_for_item');
+		this.trigger("set_applicable_charges_for_item");
 	}
 };
 
 cur_frm.script_manager.make(erpnext.stock.LandedCostVoucher);
 
-frappe.ui.form.on('Landed Cost Taxes and Charges', {
-	expense_account: function(frm, cdt, cdn) {
+frappe.ui.form.on("Landed Cost Taxes and Charges", {
+	expense_account: function (frm, cdt, cdn) {
 		frm.events.set_account_currency(frm, cdt, cdn);
 	},
 
-	amount: function(frm, cdt, cdn) {
+	amount: function (frm, cdt, cdn) {
 		frm.events.set_base_amount(frm, cdt, cdn);
-	}
+	},
 });
diff --git a/erpnext/stock/doctype/manufacturer/manufacturer.js b/erpnext/stock/doctype/manufacturer/manufacturer.js
index 5b4990f..e316543 100644
--- a/erpnext/stock/doctype/manufacturer/manufacturer.js
+++ b/erpnext/stock/doctype/manufacturer/manufacturer.js
@@ -1,15 +1,14 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Manufacturer', {
-	refresh: function(frm) {
+frappe.ui.form.on("Manufacturer", {
+	refresh: function (frm) {
 		if (frm.doc.__islocal) {
-			hide_field(['address_html','contact_html']);
+			hide_field(["address_html", "contact_html"]);
 			frappe.contacts.clear_address_and_contact(frm);
-		}
-		else {
-			unhide_field(['address_html','contact_html']);
+		} else {
+			unhide_field(["address_html", "contact_html"]);
 			frappe.contacts.render_address_and_contact(frm);
 		}
-	}
+	},
 });
diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js
index a913e28..f04acc8 100644
--- a/erpnext/stock/doctype/material_request/material_request.js
+++ b/erpnext/stock/doctype/material_request/material_request.js
@@ -5,181 +5,212 @@
 frappe.provide("erpnext.accounts.dimensions");
 erpnext.buying.setup_buying_controller();
 
-frappe.ui.form.on('Material Request', {
-	setup: function(frm) {
+frappe.ui.form.on("Material Request", {
+	setup: function (frm) {
 		frm.custom_make_buttons = {
-			'Stock Entry': 'Issue Material',
-			'Pick List': 'Pick List',
-			'Purchase Order': 'Purchase Order',
-			'Request for Quotation': 'Request for Quotation',
-			'Supplier Quotation': 'Supplier Quotation',
-			'Work Order': 'Work Order',
-			'Purchase Receipt': 'Purchase Receipt'
+			"Stock Entry": "Issue Material",
+			"Pick List": "Pick List",
+			"Purchase Order": "Purchase Order",
+			"Request for Quotation": "Request for Quotation",
+			"Supplier Quotation": "Supplier Quotation",
+			"Work Order": "Work Order",
+			"Purchase Receipt": "Purchase Receipt",
 		};
 
 		// formatter for material request item
-		frm.set_indicator_formatter('item_code',
-			function(doc) { return (doc.stock_qty<=doc.ordered_qty) ? "green" : "orange"; });
+		frm.set_indicator_formatter("item_code", function (doc) {
+			return doc.stock_qty <= doc.ordered_qty ? "green" : "orange";
+		});
 
-		frm.set_query("item_code", "items", function() {
+		frm.set_query("item_code", "items", function () {
 			return {
-				query: "erpnext.controllers.queries.item_query"
+				query: "erpnext.controllers.queries.item_query",
 			};
 		});
 
-		frm.set_query("from_warehouse", "items", function(doc) {
+		frm.set_query("from_warehouse", "items", function (doc) {
 			return {
-				filters: {'company': doc.company}
+				filters: { company: doc.company },
 			};
 		});
 
-		frm.set_query("bom_no", "items", function(doc, cdt, cdn) {
+		frm.set_query("bom_no", "items", function (doc, cdt, cdn) {
 			var row = locals[cdt][cdn];
 			return {
 				filters: {
-					"item": row.item_code
-				}
-			}
+					item: row.item_code,
+				},
+			};
 		});
 	},
 
-	onload: function(frm) {
+	onload: function (frm) {
 		// add item, if previous view was item
 		erpnext.utils.add_item(frm);
 
 		// set schedule_date
 		set_schedule_date(frm);
 
-		frm.set_query("warehouse", "items", function(doc) {
+		frm.set_query("warehouse", "items", function (doc) {
 			return {
-				filters: {'company': doc.company}
+				filters: { company: doc.company },
 			};
 		});
 
-		frm.set_query("set_warehouse", function(doc){
+		frm.set_query("set_warehouse", function (doc) {
 			return {
-				filters: {'company': doc.company}
+				filters: { company: doc.company },
 			};
 		});
 
-		frm.set_query("set_from_warehouse", function(doc){
+		frm.set_query("set_from_warehouse", function (doc) {
 			return {
-				filters: {'company': doc.company}
+				filters: { company: doc.company },
 			};
 		});
 
 		erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
 	},
 
-	company: function(frm) {
+	company: function (frm) {
 		erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
 	},
 
-	onload_post_render: function(frm) {
+	onload_post_render: function (frm) {
 		frm.get_field("items").grid.set_multiple_add("item_code", "qty");
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		frm.events.make_custom_buttons(frm);
-		frm.toggle_reqd('customer', frm.doc.material_request_type=="Customer Provided");
+		frm.toggle_reqd("customer", frm.doc.material_request_type == "Customer Provided");
 	},
 
-	set_from_warehouse: function(frm) {
-		if (frm.doc.material_request_type == "Material Transfer"
-			&& frm.doc.set_from_warehouse) {
-			frm.doc.items.forEach(d => {
-				frappe.model.set_value(d.doctype, d.name,
-					"from_warehouse", frm.doc.set_from_warehouse);
-			})
+	set_from_warehouse: function (frm) {
+		if (frm.doc.material_request_type == "Material Transfer" && frm.doc.set_from_warehouse) {
+			frm.doc.items.forEach((d) => {
+				frappe.model.set_value(d.doctype, d.name, "from_warehouse", frm.doc.set_from_warehouse);
+			});
 		}
 	},
 
-	make_custom_buttons: function(frm) {
-		if (frm.doc.docstatus==0) {
-			frm.add_custom_button(__("Bill of Materials"),
-				() => frm.events.get_items_from_bom(frm), __("Get Items From"));
+	make_custom_buttons: function (frm) {
+		if (frm.doc.docstatus == 0) {
+			frm.add_custom_button(
+				__("Bill of Materials"),
+				() => frm.events.get_items_from_bom(frm),
+				__("Get Items From")
+			);
 		}
 
-		if (frm.doc.docstatus == 1 && frm.doc.status != 'Stopped') {
+		if (frm.doc.docstatus == 1 && frm.doc.status != "Stopped") {
 			let precision = frappe.defaults.get_default("float_precision");
 
 			if (flt(frm.doc.per_received, precision) < 100) {
-				frm.add_custom_button(__('Stop'),
-					() => frm.events.update_status(frm, 'Stopped'));
+				frm.add_custom_button(__("Stop"), () => frm.events.update_status(frm, "Stopped"));
 			}
 
 			if (flt(frm.doc.per_ordered, precision) < 100) {
 				let add_create_pick_list_button = () => {
-					frm.add_custom_button(__('Pick List'),
-						() => frm.events.create_pick_list(frm), __('Create'));
-				}
+					frm.add_custom_button(
+						__("Pick List"),
+						() => frm.events.create_pick_list(frm),
+						__("Create")
+					);
+				};
 
 				if (frm.doc.material_request_type === "Material Transfer") {
 					add_create_pick_list_button();
-					frm.add_custom_button(__("Material Transfer"),
-						() => frm.events.make_stock_entry(frm), __('Create'));
+					frm.add_custom_button(
+						__("Material Transfer"),
+						() => frm.events.make_stock_entry(frm),
+						__("Create")
+					);
 
-					frm.add_custom_button(__("Material Transfer (In Transit)"),
-						() => frm.events.make_in_transit_stock_entry(frm), __('Create'));
+					frm.add_custom_button(
+						__("Material Transfer (In Transit)"),
+						() => frm.events.make_in_transit_stock_entry(frm),
+						__("Create")
+					);
 				}
 
 				if (frm.doc.material_request_type === "Material Issue") {
-					frm.add_custom_button(__("Issue Material"),
-						() => frm.events.make_stock_entry(frm), __('Create'));
+					frm.add_custom_button(
+						__("Issue Material"),
+						() => frm.events.make_stock_entry(frm),
+						__("Create")
+					);
 				}
 
 				if (frm.doc.material_request_type === "Customer Provided") {
-					frm.add_custom_button(__("Material Receipt"),
-						() => frm.events.make_stock_entry(frm), __('Create'));
+					frm.add_custom_button(
+						__("Material Receipt"),
+						() => frm.events.make_stock_entry(frm),
+						__("Create")
+					);
 				}
 
 				if (frm.doc.material_request_type === "Purchase") {
-					frm.add_custom_button(__('Purchase Order'),
-						() => frm.events.make_purchase_order(frm), __('Create'));
+					frm.add_custom_button(
+						__("Purchase Order"),
+						() => frm.events.make_purchase_order(frm),
+						__("Create")
+					);
 				}
 
 				if (frm.doc.material_request_type === "Purchase") {
-					frm.add_custom_button(__("Request for Quotation"),
-						() => frm.events.make_request_for_quotation(frm), __('Create'));
+					frm.add_custom_button(
+						__("Request for Quotation"),
+						() => frm.events.make_request_for_quotation(frm),
+						__("Create")
+					);
 				}
 
 				if (frm.doc.material_request_type === "Purchase") {
-					frm.add_custom_button(__("Supplier Quotation"),
-						() => frm.events.make_supplier_quotation(frm), __('Create'));
+					frm.add_custom_button(
+						__("Supplier Quotation"),
+						() => frm.events.make_supplier_quotation(frm),
+						__("Create")
+					);
 				}
 
 				if (frm.doc.material_request_type === "Manufacture") {
-					frm.add_custom_button(__("Work Order"),
-						() => frm.events.raise_work_orders(frm), __('Create'));
+					frm.add_custom_button(
+						__("Work Order"),
+						() => frm.events.raise_work_orders(frm),
+						__("Create")
+					);
 				}
 
-				frm.page.set_inner_btn_group_as_primary(__('Create'));
+				frm.page.set_inner_btn_group_as_primary(__("Create"));
 			}
 		}
 
-		if (frm.doc.docstatus===0) {
-			frm.add_custom_button(__('Sales Order'), () => frm.events.get_items_from_sales_order(frm),
-				__("Get Items From"));
+		if (frm.doc.docstatus === 0) {
+			frm.add_custom_button(
+				__("Sales Order"),
+				() => frm.events.get_items_from_sales_order(frm),
+				__("Get Items From")
+			);
 		}
 
-		if (frm.doc.docstatus == 1 && frm.doc.status == 'Stopped') {
-			frm.add_custom_button(__('Re-open'), () => frm.events.update_status(frm, 'Submitted'));
+		if (frm.doc.docstatus == 1 && frm.doc.status == "Stopped") {
+			frm.add_custom_button(__("Re-open"), () => frm.events.update_status(frm, "Submitted"));
 		}
 	},
 
-	update_status: function(frm, stop_status) {
+	update_status: function (frm, stop_status) {
 		frappe.call({
-			method: 'erpnext.stock.doctype.material_request.material_request.update_status',
+			method: "erpnext.stock.doctype.material_request.material_request.update_status",
 			args: { name: frm.doc.name, status: stop_status },
 			callback(r) {
 				if (!r.exc) {
 					frm.reload_doc();
 				}
-			}
+			},
 		});
 	},
 
-	get_items_from_sales_order: function(frm) {
+	get_items_from_sales_order: function (frm) {
 		erpnext.utils.map_current_doc({
 			method: "erpnext.selling.doctype.sales_order.sales_order.make_material_request",
 			source_doctype: "Sales Order",
@@ -192,13 +223,15 @@
 				docstatus: 1,
 				status: ["not in", ["Closed", "On Hold"]],
 				per_delivered: ["<", 99.99],
-				company: frm.doc.company
-			}
+				company: frm.doc.company,
+			},
 		});
 	},
 
-	get_item_data: function(frm, item, overwrite_warehouse=false) {
-		if (item && !item.item_code) { return; }
+	get_item_data: function (frm, item, overwrite_warehouse = false) {
+		if (item && !item.item_code) {
+			return;
+		}
 
 		frappe.call({
 			method: "erpnext.stock.get_item_details.get_item_details",
@@ -208,8 +241,8 @@
 					from_warehouse: item.from_warehouse,
 					warehouse: item.warehouse,
 					doctype: frm.doc.doctype,
-					buying_price_list: frappe.defaults.get_default('buying_price_list'),
-					currency: frappe.defaults.get_default('Currency'),
+					buying_price_list: frappe.defaults.get_default("buying_price_list"),
+					currency: frappe.defaults.get_default("Currency"),
 					name: frm.doc.name,
 					qty: item.qty || 1,
 					stock_qty: item.stock_qty,
@@ -222,15 +255,25 @@
 					conversion_factor: item.conversion_factor,
 					project: item.project,
 				},
-				overwrite_warehouse: overwrite_warehouse
+				overwrite_warehouse: overwrite_warehouse,
 			},
-			callback: function(r) {
+			callback: function (r) {
 				const d = item;
-				const allow_to_change_fields = ['actual_qty', 'projected_qty', 'min_order_qty', 'item_name', 'description', 'stock_uom', 'uom', 'conversion_factor', 'stock_qty'];
+				const allow_to_change_fields = [
+					"actual_qty",
+					"projected_qty",
+					"min_order_qty",
+					"item_name",
+					"description",
+					"stock_uom",
+					"uom",
+					"conversion_factor",
+					"stock_qty",
+				];
 
-				if(!r.exc) {
-					$.each(r.message, function(key, value) {
-						if(!d[key] || allow_to_change_fields.includes(key)) {
+				if (!r.exc) {
+					$.each(r.message, function (key, value) {
+						if (!d[key] || allow_to_change_fields.includes(key)) {
 							d[key] = value;
 						}
 					});
@@ -243,39 +286,53 @@
 
 					refresh_field("items");
 				}
-			}
+			},
 		});
 	},
 
-	get_items_from_bom: function(frm) {
+	get_items_from_bom: function (frm) {
 		var d = new frappe.ui.Dialog({
 			title: __("Get Items from BOM"),
 			fields: [
-				{"fieldname":"bom", "fieldtype":"Link", "label":__("BOM"),
-					options:"BOM", reqd: 1, get_query: function() {
-						return {filters: { docstatus:1, "is_active": 1 }};
-					}},
-				{"fieldname":"warehouse", "fieldtype":"Link", "label":__("For Warehouse"),
-					options:"Warehouse", reqd: 1},
-				{"fieldname":"qty", "fieldtype":"Float", "label":__("Quantity"),
-					reqd: 1, "default": 1},
-				{"fieldname":"fetch_exploded", "fieldtype":"Check",
-					"label":__("Fetch exploded BOM (including sub-assemblies)"), "default":1}
+				{
+					fieldname: "bom",
+					fieldtype: "Link",
+					label: __("BOM"),
+					options: "BOM",
+					reqd: 1,
+					get_query: function () {
+						return { filters: { docstatus: 1, is_active: 1 } };
+					},
+				},
+				{
+					fieldname: "warehouse",
+					fieldtype: "Link",
+					label: __("For Warehouse"),
+					options: "Warehouse",
+					reqd: 1,
+				},
+				{ fieldname: "qty", fieldtype: "Float", label: __("Quantity"), reqd: 1, default: 1 },
+				{
+					fieldname: "fetch_exploded",
+					fieldtype: "Check",
+					label: __("Fetch exploded BOM (including sub-assemblies)"),
+					default: 1,
+				},
 			],
-			primary_action_label: 'Get Items',
+			primary_action_label: "Get Items",
 			primary_action(values) {
-				if(!values) return;
+				if (!values) return;
 				values["company"] = frm.doc.company;
-				if(!frm.doc.company) frappe.throw(__("Company field is required"));
+				if (!frm.doc.company) frappe.throw(__("Company field is required"));
 				frappe.call({
 					method: "erpnext.manufacturing.doctype.bom.bom.get_bom_items",
 					args: values,
-					callback: function(r) {
+					callback: function (r) {
 						if (!r.message) {
 							frappe.throw(__("BOM does not contain any stock item"));
 						} else {
 							erpnext.utils.remove_empty_first_row(frm, "items");
-							$.each(r.message, function(i, item) {
+							$.each(r.message, function (i, item) {
 								var d = frappe.model.add_child(cur_frm.doc, "Material Request Item", "items");
 								d.item_code = item.item_code;
 								d.item_name = item.item_name;
@@ -290,61 +347,63 @@
 						}
 						d.hide();
 						refresh_field("items");
-					}
+					},
 				});
-			}
+			},
 		});
 
 		d.show();
 	},
 
-	make_purchase_order: function(frm) {
+	make_purchase_order: function (frm) {
 		frappe.prompt(
 			{
-				label: __('For Default Supplier (Optional)'),
-				fieldname:'default_supplier',
-				fieldtype: 'Link',
-				options: 'Supplier',
-				description: __('Select a Supplier from the Default Suppliers of the items below. On selection, a Purchase Order will be made against items belonging to the selected Supplier only.'),
+				label: __("For Default Supplier (Optional)"),
+				fieldname: "default_supplier",
+				fieldtype: "Link",
+				options: "Supplier",
+				description: __(
+					"Select a Supplier from the Default Suppliers of the items below. On selection, a Purchase Order will be made against items belonging to the selected Supplier only."
+				),
 				get_query: () => {
-					return{
+					return {
 						query: "erpnext.stock.doctype.material_request.material_request.get_default_supplier_query",
-						filters: {'doc': frm.doc.name}
-					}
-				}
+						filters: { doc: frm.doc.name },
+					};
+				},
 			},
 			(values) => {
 				frappe.model.open_mapped_doc({
 					method: "erpnext.stock.doctype.material_request.material_request.make_purchase_order",
 					frm: frm,
 					args: { default_supplier: values.default_supplier },
-					run_link_triggers: true
+					run_link_triggers: true,
 				});
 			},
-			__('Enter Supplier'),
-			__('Create')
-		)
+			__("Enter Supplier"),
+			__("Create")
+		);
 	},
 
-	make_request_for_quotation: function(frm) {
+	make_request_for_quotation: function (frm) {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.stock.doctype.material_request.material_request.make_request_for_quotation",
 			frm: frm,
-			run_link_triggers: true
+			run_link_triggers: true,
 		});
 	},
 
-	make_supplier_quotation: function(frm) {
+	make_supplier_quotation: function (frm) {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.stock.doctype.material_request.material_request.make_supplier_quotation",
-			frm: frm
+			frm: frm,
 		});
 	},
 
-	make_stock_entry: function(frm) {
+	make_stock_entry: function (frm) {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.stock.doctype.material_request.material_request.make_stock_entry",
-			frm: frm
+			frm: frm,
 		});
 	},
 
@@ -352,71 +411,70 @@
 		frappe.prompt(
 			[
 				{
-					label: __('In Transit Warehouse'),
-					fieldname: 'in_transit_warehouse',
-					fieldtype: 'Link',
-					options: 'Warehouse',
+					label: __("In Transit Warehouse"),
+					fieldname: "in_transit_warehouse",
+					fieldtype: "Link",
+					options: "Warehouse",
 					reqd: 1,
 					get_query: () => {
-						return{
+						return {
 							filters: {
-								'company': frm.doc.company,
-								'is_group': 0,
-								'warehouse_type': 'Transit'
-							}
-						}
-					}
-				}
+								company: frm.doc.company,
+								is_group: 0,
+								warehouse_type: "Transit",
+							},
+						};
+					},
+				},
 			],
 			(values) => {
 				frappe.call({
 					method: "erpnext.stock.doctype.material_request.material_request.make_in_transit_stock_entry",
 					args: {
 						source_name: frm.doc.name,
-						in_transit_warehouse: values.in_transit_warehouse
+						in_transit_warehouse: values.in_transit_warehouse,
 					},
-					callback: function(r) {
+					callback: function (r) {
 						if (r.message) {
 							let doc = frappe.model.sync(r.message);
-							frappe.set_route('Form', doc[0].doctype, doc[0].name);
+							frappe.set_route("Form", doc[0].doctype, doc[0].name);
 						}
-					}
-				})
+					},
+				});
 			},
-			__('In Transit Transfer'),
+			__("In Transit Transfer"),
 			__("Create Stock Entry")
-		)
+		);
 	},
 
 	create_pick_list: (frm) => {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.stock.doctype.material_request.material_request.create_pick_list",
-			frm: frm
+			frm: frm,
 		});
 	},
 
-	raise_work_orders: function(frm) {
+	raise_work_orders: function (frm) {
 		frappe.call({
-			method:"erpnext.stock.doctype.material_request.material_request.raise_work_orders",
+			method: "erpnext.stock.doctype.material_request.material_request.raise_work_orders",
 			args: {
-				"material_request": frm.doc.name
+				material_request: frm.doc.name,
 			},
 			freeze: true,
-			callback: function(r) {
-				if(r.message.length) {
+			callback: function (r) {
+				if (r.message.length) {
 					frm.reload_doc();
 				}
-			}
+			},
 		});
 	},
-	material_request_type: function(frm) {
-		frm.toggle_reqd('customer', frm.doc.material_request_type=="Customer Provided");
+	material_request_type: function (frm) {
+		frm.toggle_reqd("customer", frm.doc.material_request_type == "Customer Provided");
 
-		if (frm.doc.material_request_type !== 'Material Transfer' && frm.doc.set_from_warehouse) {
-			frm.set_value('set_from_warehouse', '');
+		if (frm.doc.material_request_type !== "Material Transfer" && frm.doc.set_from_warehouse) {
+			frm.set_value("set_from_warehouse", "");
 		}
 	},
-
 });
 
 frappe.ui.form.on("Material Request Item", {
@@ -428,12 +486,12 @@
 		frm.events.get_item_data(frm, item, false);
 	},
 
-	from_warehouse: function(frm, doctype, name) {
+	from_warehouse: function (frm, doctype, name) {
 		const item = locals[doctype][name];
 		frm.events.get_item_data(frm, item, false);
 	},
 
-	warehouse: function(frm, doctype, name) {
+	warehouse: function (frm, doctype, name) {
 		const item = locals[doctype][name];
 		frm.events.get_item_data(frm, item, false);
 	},
@@ -445,18 +503,18 @@
 		refresh_field("amount", item.name, item.parentfield);
 	},
 
-	item_code: function(frm, doctype, name) {
+	item_code: function (frm, doctype, name) {
 		const item = locals[doctype][name];
 		item.rate = 0;
-		item.uom = '';
+		item.uom = "";
 		set_schedule_date(frm);
 		frm.events.get_item_data(frm, item, true);
 	},
 
-	schedule_date: function(frm, cdt, cdn) {
+	schedule_date: function (frm, cdt, cdn) {
 		var row = locals[cdt][cdn];
 		if (row.schedule_date) {
-			if(!frm.doc.schedule_date) {
+			if (!frm.doc.schedule_date) {
 				erpnext.utils.copy_value_in_all_rows(frm.doc, cdt, cdn, "items", "schedule_date");
 			} else {
 				set_schedule_date(frm);
@@ -464,13 +522,15 @@
 		}
 	},
 
-	conversion_factor: function(frm, doctype, name) {
+	conversion_factor: function (frm, doctype, name) {
 		const item = locals[doctype][name];
 		frm.events.get_item_data(frm, item, false);
 	},
 });
 
-erpnext.buying.MaterialRequestController = class MaterialRequestController extends erpnext.buying.BuyingController {
+erpnext.buying.MaterialRequestController = class MaterialRequestController extends (
+	erpnext.buying.BuyingController
+) {
 	tc_name() {
 		this.get_terms();
 	}
@@ -492,32 +552,32 @@
 	}
 
 	onload() {
-		this.frm.set_query("item_code", "items", function(doc, cdt, cdn) {
+		this.frm.set_query("item_code", "items", function (doc, cdt, cdn) {
 			if (doc.material_request_type == "Customer Provided") {
-				return{
+				return {
 					query: "erpnext.controllers.queries.item_query",
-					filters:{
-						'customer': doc.customer,
-						'is_stock_item':1
-					}
-				}
+					filters: {
+						customer: doc.customer,
+						is_stock_item: 1,
+					},
+				};
 			} else if (doc.material_request_type == "Purchase") {
-				return{
+				return {
 					query: "erpnext.controllers.queries.item_query",
-					filters: {'is_purchase_item': 1}
-				}
+					filters: { is_purchase_item: 1 },
+				};
 			} else {
-				return{
+				return {
 					query: "erpnext.controllers.queries.item_query",
-					filters: {'is_stock_item': 1}
-				}
+					filters: { is_stock_item: 1 },
+				};
 			}
 		});
 	}
 
 	items_add(doc, cdt, cdn) {
 		var row = frappe.get_doc(cdt, cdn);
-		if(doc.schedule_date) {
+		if (doc.schedule_date) {
 			row.schedule_date = doc.schedule_date;
 			refresh_field("schedule_date", cdn, "items");
 		} else {
@@ -542,10 +602,16 @@
 };
 
 // for backward compatibility: combine new and previous states
-extend_cscript(cur_frm.cscript, new erpnext.buying.MaterialRequestController({frm: cur_frm}));
+extend_cscript(cur_frm.cscript, new erpnext.buying.MaterialRequestController({ frm: cur_frm }));
 
 function set_schedule_date(frm) {
-	if(frm.doc.schedule_date){
-		erpnext.utils.copy_value_in_all_rows(frm.doc, frm.doc.doctype, frm.doc.name, "items", "schedule_date");
+	if (frm.doc.schedule_date) {
+		erpnext.utils.copy_value_in_all_rows(
+			frm.doc,
+			frm.doc.doctype,
+			frm.doc.name,
+			"items",
+			"schedule_date"
+		);
 	}
 }
diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py
index 02fbd3d..ace84f8 100644
--- a/erpnext/stock/doctype/material_request/material_request.py
+++ b/erpnext/stock/doctype/material_request/material_request.py
@@ -595,17 +595,28 @@
 	for d in doc.items:
 		item_list.append(d.item_code)
 
-	return frappe.db.sql(
-		"""select default_supplier
-		from `tabItem Default`
-		where parent in ({0}) and
-		default_supplier IS NOT NULL
-		""".format(
-			", ".join(["%s"] * len(item_list))
-		),
-		tuple(item_list),
+	supplier = frappe.qb.DocType("Supplier")
+	item_default = frappe.qb.DocType("Item Default")
+	query = (
+		frappe.qb.from_(supplier)
+		.left_join(item_default)
+		.on(supplier.name == item_default.default_supplier)
+		.select(item_default.default_supplier)
+		.where(
+			(item_default.parent.isin(item_list))
+			& (item_default.default_supplier.notnull())
+			& (supplier[searchfield].like(f"%{txt}%"))
+		)
+		.offset(start)
+		.limit(page_len)
 	)
 
+	meta = frappe.get_meta("Supplier")
+	if meta.show_title_field_in_link and meta.title_field:
+		query = query.select(supplier[meta.title_field])
+
+	return query.run(as_dict=False)
+
 
 @frappe.whitelist()
 def make_supplier_quotation(source_name, target_doc=None):
diff --git a/erpnext/stock/doctype/material_request/material_request_list.js b/erpnext/stock/doctype/material_request/material_request_list.js
index c85bd71..8a8cfd4 100644
--- a/erpnext/stock/doctype/material_request/material_request_list.js
+++ b/erpnext/stock/doctype/material_request/material_request_list.js
@@ -1,8 +1,8 @@
-frappe.listview_settings['Material Request'] = {
+frappe.listview_settings["Material Request"] = {
 	add_fields: ["material_request_type", "status", "per_ordered", "per_received", "transfer_status"],
-	get_indicator: function(doc) {
+	get_indicator: function (doc) {
 		var precision = frappe.defaults.get_default("float_precision");
-		if (doc.status=="Stopped") {
+		if (doc.status == "Stopped") {
 			return [__("Stopped"), "red", "status,=,Stopped"];
 		} else if (doc.transfer_status && doc.docstatus != 2) {
 			if (doc.transfer_status == "Not Started") {
@@ -12,12 +12,16 @@
 			} else if (doc.transfer_status == "Completed") {
 				return [__("Completed"), "green"];
 			}
-		} else if (doc.docstatus==1 && flt(doc.per_ordered, precision) == 0) {
+		} else if (doc.docstatus == 1 && flt(doc.per_ordered, precision) == 0) {
 			return [__("Pending"), "orange", "per_ordered,=,0"];
-		}  else if (doc.docstatus==1 && flt(doc.per_ordered, precision) < 100) {
+		} else if (doc.docstatus == 1 && flt(doc.per_ordered, precision) < 100) {
 			return [__("Partially ordered"), "yellow", "per_ordered,<,100"];
-		} else if (doc.docstatus==1 && flt(doc.per_ordered, precision) == 100) {
-			if (doc.material_request_type == "Purchase" && flt(doc.per_received, precision) < 100 && flt(doc.per_received, precision) > 0) {
+		} else if (doc.docstatus == 1 && flt(doc.per_ordered, precision) == 100) {
+			if (
+				doc.material_request_type == "Purchase" &&
+				flt(doc.per_received, precision) < 100 &&
+				flt(doc.per_received, precision) > 0
+			) {
 				return [__("Partially Received"), "yellow", "per_received,<,100"];
 			} else if (doc.material_request_type == "Purchase" && flt(doc.per_received, precision) == 100) {
 				return [__("Received"), "green", "per_received,=,100"];
@@ -33,5 +37,5 @@
 				return [__("Manufactured"), "green", "per_ordered,=,100"];
 			}
 		}
-	}
+	},
 };
diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py
index c5fed0d..d81ceaf 100644
--- a/erpnext/stock/doctype/packed_item/packed_item.py
+++ b/erpnext/stock/doctype/packed_item/packed_item.py
@@ -51,7 +51,16 @@
 		warehouse: DF.Link | None
 	# end: auto-generated types
 
-	pass
+	def set_actual_and_projected_qty(self):
+		"Set actual and projected qty based on warehouse and item_code"
+		_bin = frappe.db.get_value(
+			"Bin",
+			{"item_code": self.item_code, "warehouse": self.warehouse},
+			["actual_qty", "projected_qty"],
+			as_dict=True,
+		)
+		self.actual_qty = _bin.actual_qty if _bin else 0
+		self.projected_qty = _bin.projected_qty if _bin else 0
 
 
 def make_packing_list(doc):
diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.js b/erpnext/stock/doctype/packing_slip/packing_slip.js
index 95e5ea3..682631f 100644
--- a/erpnext/stock/doctype/packing_slip/packing_slip.js
+++ b/erpnext/stock/doctype/packing_slip/packing_slip.js
@@ -1,45 +1,45 @@
 // Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Packing Slip', {
-    setup: (frm) => {
-        frm.set_query('delivery_note', () => {
-            return {
-                filters: {
-                    docstatus: 0,
-                }
-            }
-        });
+frappe.ui.form.on("Packing Slip", {
+	setup: (frm) => {
+		frm.set_query("delivery_note", () => {
+			return {
+				filters: {
+					docstatus: 0,
+				},
+			};
+		});
 
-        frm.set_query('item_code', 'items', (doc, cdt, cdn) => {
-            if (!doc.delivery_note) {
-                frappe.throw(__('Please select a Delivery Note'));
-            } else {
-                let d = locals[cdt][cdn];
-                return {
-                    query: 'erpnext.stock.doctype.packing_slip.packing_slip.item_details',
-                    filters: {
-                        delivery_note: doc.delivery_note,
-                    }
-                }
-            }
-        });
+		frm.set_query("item_code", "items", (doc, cdt, cdn) => {
+			if (!doc.delivery_note) {
+				frappe.throw(__("Please select a Delivery Note"));
+			} else {
+				let d = locals[cdt][cdn];
+				return {
+					query: "erpnext.stock.doctype.packing_slip.packing_slip.item_details",
+					filters: {
+						delivery_note: doc.delivery_note,
+					},
+				};
+			}
+		});
 	},
 
 	refresh: (frm) => {
-		frm.toggle_display('misc_details', frm.doc.amended_from);
+		frm.toggle_display("misc_details", frm.doc.amended_from);
 	},
 
 	delivery_note: (frm) => {
-		frm.set_value('items', null);
+		frm.set_value("items", null);
 
 		if (frm.doc.delivery_note) {
 			erpnext.utils.map_current_doc({
-				method: 'erpnext.stock.doctype.delivery_note.delivery_note.make_packing_slip',
+				method: "erpnext.stock.doctype.delivery_note.delivery_note.make_packing_slip",
 				source_name: frm.doc.delivery_note,
 				target_doc: frm,
 				freeze: true,
-				freeze_message: __('Creating Packing Slip ...'),
+				freeze_message: __("Creating Packing Slip ..."),
 			});
 		}
 	},
diff --git a/erpnext/stock/doctype/pick_list/pick_list.js b/erpnext/stock/doctype/pick_list/pick_list.js
index 3a5daa1..43519e7 100644
--- a/erpnext/stock/doctype/pick_list/pick_list.js
+++ b/erpnext/stock/doctype/pick_list/pick_list.js
@@ -1,54 +1,55 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Pick List', {
+frappe.ui.form.on("Pick List", {
 	setup: (frm) => {
 		frm.ignore_doctypes_on_cancel_all = ["Serial and Batch Bundle"];
 
-		frm.set_indicator_formatter('item_code',
-			function(doc) { return (doc.stock_qty === 0) ? "red" : "green"; });
+		frm.set_indicator_formatter("item_code", function (doc) {
+			return doc.stock_qty === 0 ? "red" : "green";
+		});
 
 		frm.custom_make_buttons = {
-			'Delivery Note': 'Delivery Note',
-			'Stock Entry': 'Stock Entry',
+			"Delivery Note": "Delivery Note",
+			"Stock Entry": "Stock Entry",
 		};
 
-		frm.set_query('parent_warehouse', () => {
+		frm.set_query("parent_warehouse", () => {
 			return {
 				filters: {
-					'company': frm.doc.company
-				}
+					company: frm.doc.company,
+				},
 			};
 		});
 
-		frm.set_query('work_order', () => {
+		frm.set_query("work_order", () => {
 			return {
-				query: 'erpnext.stock.doctype.pick_list.pick_list.get_pending_work_orders',
+				query: "erpnext.stock.doctype.pick_list.pick_list.get_pending_work_orders",
 				filters: {
-					'company': frm.doc.company
-				}
+					company: frm.doc.company,
+				},
 			};
 		});
 
-		frm.set_query('material_request', () => {
+		frm.set_query("material_request", () => {
 			return {
 				filters: {
-					'material_request_type': ['=', frm.doc.purpose]
-				}
+					material_request_type: ["=", frm.doc.purpose],
+				},
 			};
 		});
 
-		frm.set_query('item_code', 'locations', () => {
-			return erpnext.queries.item({ "is_stock_item": 1 });
+		frm.set_query("item_code", "locations", () => {
+			return erpnext.queries.item({ is_stock_item: 1 });
 		});
 
-		frm.set_query('batch_no', 'locations', (frm, cdt, cdn) => {
+		frm.set_query("batch_no", "locations", (frm, cdt, cdn) => {
 			const row = locals[cdt][cdn];
 			return {
-				query: 'erpnext.controllers.queries.get_batch_no',
+				query: "erpnext.controllers.queries.get_batch_no",
 				filters: {
 					item_code: row.item_code,
-					warehouse: row.warehouse
+					warehouse: row.warehouse,
 				},
 			};
 		});
@@ -57,29 +58,29 @@
 			let row = locals[cdt][cdn];
 			return {
 				filters: {
-					'item_code': row.item_code,
-					'voucher_type': doc.doctype,
-					'voucher_no': ["in", [doc.name, ""]],
-					'is_cancelled': 0,
-				}
-			}
+					item_code: row.item_code,
+					voucher_type: doc.doctype,
+					voucher_no: ["in", [doc.name, ""]],
+					is_cancelled: 0,
+				},
+			};
 		});
 	},
-	set_item_locations:(frm, save) => {
+	set_item_locations: (frm, save) => {
 		if (!(frm.doc.locations && frm.doc.locations.length)) {
-			frappe.msgprint(__('Add items in the Item Locations table'));
+			frappe.msgprint(__("Add items in the Item Locations table"));
 		} else {
 			frappe.call({
 				method: "set_item_locations",
 				doc: frm.doc,
 				args: {
-					"save": save,
+					save: save,
 				},
 				freeze: 1,
 				freeze_message: __("Setting Item Locations..."),
 				callback(r) {
 					refresh_field("locations");
-				}
+				},
 			});
 		}
 	},
@@ -88,142 +89,173 @@
 		frm.events.set_item_locations(frm, false);
 	},
 	refresh: (frm) => {
-		frm.trigger('add_get_items_button');
+		frm.trigger("add_get_items_button");
 		if (frm.doc.docstatus === 1) {
-			frappe.xcall('erpnext.stock.doctype.pick_list.pick_list.target_document_exists', {
-				'pick_list_name': frm.doc.name,
-				'purpose': frm.doc.purpose
-			}).then(target_document_exists => {
-				frm.set_df_property("locations", "allow_on_submit", target_document_exists ? 0 : 1);
+			frappe
+				.xcall("erpnext.stock.doctype.pick_list.pick_list.target_document_exists", {
+					pick_list_name: frm.doc.name,
+					purpose: frm.doc.purpose,
+				})
+				.then((target_document_exists) => {
+					frm.set_df_property("locations", "allow_on_submit", target_document_exists ? 0 : 1);
 
-				if (target_document_exists) return;
+					if (target_document_exists) return;
 
-				frm.add_custom_button(__('Update Current Stock'), () => frm.trigger('update_pick_list_stock'));
+					frm.add_custom_button(__("Update Current Stock"), () =>
+						frm.trigger("update_pick_list_stock")
+					);
 
-				if (frm.doc.purpose === 'Delivery') {
-					frm.add_custom_button(__('Delivery Note'), () => frm.trigger('create_delivery_note'), __('Create'));
-				} else {
-					frm.add_custom_button(__('Stock Entry'), () => frm.trigger('create_stock_entry'), __('Create'));
-				}
-			});
+					if (frm.doc.purpose === "Delivery") {
+						frm.add_custom_button(
+							__("Delivery Note"),
+							() => frm.trigger("create_delivery_note"),
+							__("Create")
+						);
+					} else {
+						frm.add_custom_button(
+							__("Stock Entry"),
+							() => frm.trigger("create_stock_entry"),
+							__("Create")
+						);
+					}
+				});
 
-			if (frm.doc.purpose === 'Delivery' && frm.doc.status === 'Open') {
+			if (frm.doc.purpose === "Delivery" && frm.doc.status === "Open") {
 				if (frm.doc.__onload && frm.doc.__onload.has_unreserved_stock) {
-					frm.add_custom_button(__('Reserve'), () => frm.events.create_stock_reservation_entries(frm), __('Stock Reservation'));
+					frm.add_custom_button(
+						__("Reserve"),
+						() => frm.events.create_stock_reservation_entries(frm),
+						__("Stock Reservation")
+					);
 				}
 
 				if (frm.doc.__onload && frm.doc.__onload.has_reserved_stock) {
-					frm.add_custom_button(__('Unreserve'), () => {
-						frappe.confirm(
-							__('The reserved stock will be released. Are you certain you wish to proceed?'),
-							() => frm.events.cancel_stock_reservation_entries(frm)
-						)
-					}, __('Stock Reservation'));
-					frm.add_custom_button(__('Reserved Stock'), () => frm.events.show_reserved_stock(frm), __('Stock Reservation'));
+					frm.add_custom_button(
+						__("Unreserve"),
+						() => {
+							frappe.confirm(
+								__(
+									"The reserved stock will be released. Are you certain you wish to proceed?"
+								),
+								() => frm.events.cancel_stock_reservation_entries(frm)
+							);
+						},
+						__("Stock Reservation")
+					);
+					frm.add_custom_button(
+						__("Reserved Stock"),
+						() => frm.events.show_reserved_stock(frm),
+						__("Stock Reservation")
+					);
 				}
 			}
 		}
 
-		let sbb_field = frm.get_docfield('locations', 'serial_and_batch_bundle');
+		let sbb_field = frm.get_docfield("locations", "serial_and_batch_bundle");
 		if (sbb_field) {
 			sbb_field.get_route_options_for_new_doc = (row) => {
 				return {
-					'item_code': row.doc.item_code,
-					'warehouse': row.doc.warehouse,
-					'voucher_type': frm.doc.doctype,
-				}
+					item_code: row.doc.item_code,
+					warehouse: row.doc.warehouse,
+					voucher_type: frm.doc.doctype,
+				};
 			};
 		}
 	},
 	work_order: (frm) => {
-		frappe.db.get_value('Work Order',
-			frm.doc.work_order,
-			['qty', 'material_transferred_for_manufacturing']
-		).then(data => {
-			let qty_data = data.message;
-			let max = qty_data.qty - qty_data.material_transferred_for_manufacturing;
-			frappe.prompt({
-				fieldtype: 'Float',
-				label: __('Qty of Finished Goods Item'),
-				fieldname: 'qty',
-				description: __('Max: {0}', [max]),
-				default: max
-			}, (data) => {
-				frm.set_value('for_qty', data.qty);
-				if (data.qty > max) {
-					frappe.msgprint(__('Quantity must not be more than {0}', [max]));
-					return;
-				}
-				frm.clear_table('locations');
-				erpnext.utils.map_current_doc({
-					method: 'erpnext.manufacturing.doctype.work_order.work_order.create_pick_list',
-					target: frm,
-					source_name: frm.doc.work_order
-				});
-			}, __('Select Quantity'), __('Get Items'));
-		});
+		frappe.db
+			.get_value("Work Order", frm.doc.work_order, ["qty", "material_transferred_for_manufacturing"])
+			.then((data) => {
+				let qty_data = data.message;
+				let max = qty_data.qty - qty_data.material_transferred_for_manufacturing;
+				frappe.prompt(
+					{
+						fieldtype: "Float",
+						label: __("Qty of Finished Goods Item"),
+						fieldname: "qty",
+						description: __("Max: {0}", [max]),
+						default: max,
+					},
+					(data) => {
+						frm.set_value("for_qty", data.qty);
+						if (data.qty > max) {
+							frappe.msgprint(__("Quantity must not be more than {0}", [max]));
+							return;
+						}
+						frm.clear_table("locations");
+						erpnext.utils.map_current_doc({
+							method: "erpnext.manufacturing.doctype.work_order.work_order.create_pick_list",
+							target: frm,
+							source_name: frm.doc.work_order,
+						});
+					},
+					__("Select Quantity"),
+					__("Get Items")
+				);
+			});
 	},
 	material_request: (frm) => {
 		erpnext.utils.map_current_doc({
-			method: 'erpnext.stock.doctype.material_request.material_request.create_pick_list',
+			method: "erpnext.stock.doctype.material_request.material_request.create_pick_list",
 			target: frm,
-			source_name: frm.doc.material_request
+			source_name: frm.doc.material_request,
 		});
 	},
 	purpose: (frm) => {
-		frm.clear_table('locations');
-		frm.trigger('add_get_items_button');
+		frm.clear_table("locations");
+		frm.trigger("add_get_items_button");
 	},
 	create_delivery_note: (frm) => {
 		frappe.model.open_mapped_doc({
-			method: 'erpnext.stock.doctype.pick_list.pick_list.create_delivery_note',
-			frm: frm
+			method: "erpnext.stock.doctype.pick_list.pick_list.create_delivery_note",
+			frm: frm,
 		});
-
 	},
 	create_stock_entry: (frm) => {
-		frappe.xcall('erpnext.stock.doctype.pick_list.pick_list.create_stock_entry', {
-			'pick_list': frm.doc,
-		}).then(stock_entry => {
-			frappe.model.sync(stock_entry);
-			frappe.set_route("Form", 'Stock Entry', stock_entry.name);
-		});
+		frappe
+			.xcall("erpnext.stock.doctype.pick_list.pick_list.create_stock_entry", {
+				pick_list: frm.doc,
+			})
+			.then((stock_entry) => {
+				frappe.model.sync(stock_entry);
+				frappe.set_route("Form", "Stock Entry", stock_entry.name);
+			});
 	},
 	update_pick_list_stock: (frm) => {
 		frm.events.set_item_locations(frm, true);
 	},
 	add_get_items_button: (frm) => {
 		let purpose = frm.doc.purpose;
-		if (purpose != 'Delivery' || frm.doc.docstatus !== 0) return;
+		if (purpose != "Delivery" || frm.doc.docstatus !== 0) return;
 		let get_query_filters = {
 			docstatus: 1,
-			per_delivered: ['<', 100],
-			status: ['!=', ''],
-			customer: frm.doc.customer
+			per_delivered: ["<", 100],
+			status: ["!=", ""],
+			customer: frm.doc.customer,
 		};
-		frm.get_items_btn = frm.add_custom_button(__('Get Items'), () => {
+		frm.get_items_btn = frm.add_custom_button(__("Get Items"), () => {
 			erpnext.utils.map_current_doc({
-				method: 'erpnext.selling.doctype.sales_order.sales_order.create_pick_list',
-				source_doctype: 'Sales Order',
+				method: "erpnext.selling.doctype.sales_order.sales_order.create_pick_list",
+				source_doctype: "Sales Order",
 				target: frm,
 				setters: {
 					company: frm.doc.company,
-					customer: frm.doc.customer
+					customer: frm.doc.customer,
 				},
-				date_field: 'transaction_date',
-				get_query_filters: get_query_filters
+				date_field: "transaction_date",
+				get_query_filters: get_query_filters,
 			});
 		});
 	},
 	scan_barcode: (frm) => {
 		const opts = {
 			frm,
-			items_table_name: 'locations',
-			qty_field: 'picked_qty',
-			max_qty_field: 'qty',
+			items_table_name: "locations",
+			qty_field: "picked_qty",
+			max_qty_field: "qty",
 			dont_allow_new_row: true,
 			prompt_qty: frm.doc.prompt_qty,
-			serial_no_field: "not_supported",  // doesn't make sense for picklist without a separate field.
+			serial_no_field: "not_supported", // doesn't make sense for picklist without a separate field.
 		};
 		const barcode_scanner = new erpnext.utils.BarcodeScanner(opts);
 		barcode_scanner.process_scan();
@@ -233,14 +265,14 @@
 			doc: frm.doc,
 			method: "create_stock_reservation_entries",
 			args: {
-				notify: true
+				notify: true,
 			},
 			freeze: true,
 			freeze_message: __("Reserving Stock..."),
 			callback: (r) => {
 				frm.doc.__onload.has_unreserved_stock = false;
 				frm.reload_doc();
-			}
+			},
 		});
 	},
 	cancel_stock_reservation_entries: (frm) => {
@@ -248,40 +280,42 @@
 			doc: frm.doc,
 			method: "cancel_stock_reservation_entries",
 			args: {
-				notify: true
+				notify: true,
 			},
 			freeze: true,
-			freeze_message: __('Unreserving Stock...'),
+			freeze_message: __("Unreserving Stock..."),
 			callback: (r) => {
 				frm.doc.__onload.has_reserved_stock = false;
 				frm.reload_doc();
-			}
+			},
 		});
 	},
 	show_reserved_stock(frm) {
 		// Get the latest modified date from the locations table.
-		var to_date = moment(new Date(Math.max(...frm.doc.locations.map(e => new Date(e.modified))))).format('YYYY-MM-DD');
+		var to_date = moment(
+			new Date(Math.max(...frm.doc.locations.map((e) => new Date(e.modified))))
+		).format("YYYY-MM-DD");
 
 		frappe.route_options = {
 			company: frm.doc.company,
-			from_date: moment(frm.doc.creation).format('YYYY-MM-DD'),
+			from_date: moment(frm.doc.creation).format("YYYY-MM-DD"),
 			to_date: to_date,
 			voucher_type: "Sales Order",
 			from_voucher_type: "Pick List",
 			from_voucher_no: frm.doc.name,
-		}
+		};
 		frappe.set_route("query-report", "Reserved Stock");
-	}
+	},
 });
 
-frappe.ui.form.on('Pick List Item', {
+frappe.ui.form.on("Pick List Item", {
 	item_code: (frm, cdt, cdn) => {
 		let row = frappe.get_doc(cdt, cdn);
 		if (row.item_code) {
-			get_item_details(row.item_code).then(data => {
-				frappe.model.set_value(cdt, cdn, 'uom', data.stock_uom);
-				frappe.model.set_value(cdt, cdn, 'stock_uom', data.stock_uom);
-				frappe.model.set_value(cdt, cdn, 'conversion_factor', 1);
+			get_item_details(row.item_code).then((data) => {
+				frappe.model.set_value(cdt, cdn, "uom", data.stock_uom);
+				frappe.model.set_value(cdt, cdn, "stock_uom", data.stock_uom);
+				frappe.model.set_value(cdt, cdn, "conversion_factor", 1);
 			});
 		}
 	},
@@ -289,64 +323,62 @@
 	uom: (frm, cdt, cdn) => {
 		let row = frappe.get_doc(cdt, cdn);
 		if (row.uom) {
-			get_item_details(row.item_code, row.uom).then(data => {
-				frappe.model.set_value(cdt, cdn, 'conversion_factor', data.conversion_factor);
+			get_item_details(row.item_code, row.uom).then((data) => {
+				frappe.model.set_value(cdt, cdn, "conversion_factor", data.conversion_factor);
 			});
 		}
 	},
 
 	qty: (frm, cdt, cdn) => {
 		let row = frappe.get_doc(cdt, cdn);
-		frappe.model.set_value(cdt, cdn, 'stock_qty', row.qty * row.conversion_factor);
+		frappe.model.set_value(cdt, cdn, "stock_qty", row.qty * row.conversion_factor);
 	},
 
 	conversion_factor: (frm, cdt, cdn) => {
 		let row = frappe.get_doc(cdt, cdn);
-		frappe.model.set_value(cdt, cdn, 'stock_qty', row.qty * row.conversion_factor);
+		frappe.model.set_value(cdt, cdn, "stock_qty", row.qty * row.conversion_factor);
 	},
 
 	pick_serial_and_batch(frm, cdt, cdn) {
 		let item = locals[cdt][cdn];
 		let path = "assets/erpnext/js/utils/serial_no_batch_selector.js";
 
-		frappe.db.get_value("Item", item.item_code, ["has_batch_no", "has_serial_no"])
-			.then((r) => {
-				if (r.message && (r.message.has_batch_no || r.message.has_serial_no)) {
-					item.has_serial_no = r.message.has_serial_no;
-					item.has_batch_no = r.message.has_batch_no;
-					item.type_of_transaction = item.qty > 0 ? "Outward":"Inward";
+		frappe.db.get_value("Item", item.item_code, ["has_batch_no", "has_serial_no"]).then((r) => {
+			if (r.message && (r.message.has_batch_no || r.message.has_serial_no)) {
+				item.has_serial_no = r.message.has_serial_no;
+				item.has_batch_no = r.message.has_batch_no;
+				item.type_of_transaction = item.qty > 0 ? "Outward" : "Inward";
 
-					item.title = item.has_serial_no ?
-						__("Select Serial No") : __("Select Batch No");
+				item.title = item.has_serial_no ? __("Select Serial No") : __("Select Batch No");
 
-					if (item.has_serial_no && item.has_batch_no) {
-						item.title = __("Select Serial and Batch");
-					}
-
-					frappe.require(path, function() {
-						new erpnext.SerialBatchPackageSelector(
-							frm, item, (r) => {
-								if (r) {
-									let qty = Math.abs(r.total_qty);
-									frappe.model.set_value(item.doctype, item.name, {
-										"serial_and_batch_bundle": r.name,
-										"use_serial_batch_fields": 0,
-										"qty": qty / flt(item.conversion_factor || 1, precision("conversion_factor", item))
-									});
-								}
-							}
-						);
-					});
+				if (item.has_serial_no && item.has_batch_no) {
+					item.title = __("Select Serial and Batch");
 				}
-			});
-	}
+
+				frappe.require(path, function () {
+					new erpnext.SerialBatchPackageSelector(frm, item, (r) => {
+						if (r) {
+							let qty = Math.abs(r.total_qty);
+							frappe.model.set_value(item.doctype, item.name, {
+								serial_and_batch_bundle: r.name,
+								use_serial_batch_fields: 0,
+								qty:
+									qty /
+									flt(item.conversion_factor || 1, precision("conversion_factor", item)),
+							});
+						}
+					});
+				});
+			}
+		});
+	},
 });
 
-function get_item_details(item_code, uom=null) {
+function get_item_details(item_code, uom = null) {
 	if (item_code) {
-		return frappe.xcall('erpnext.stock.doctype.pick_list.pick_list.get_item_details', {
+		return frappe.xcall("erpnext.stock.doctype.pick_list.pick_list.get_item_details", {
 			item_code,
-			uom
+			uom,
 		});
 	}
 }
diff --git a/erpnext/stock/doctype/pick_list/pick_list_list.js b/erpnext/stock/doctype/pick_list/pick_list_list.js
index ad88b0a..9cdbfe1 100644
--- a/erpnext/stock/doctype/pick_list/pick_list_list.js
+++ b/erpnext/stock/doctype/pick_list/pick_list_list.js
@@ -1,14 +1,14 @@
 // Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.listview_settings['Pick List'] = {
+frappe.listview_settings["Pick List"] = {
 	get_indicator: function (doc) {
 		const status_colors = {
-			"Draft": "grey",
-			"Open": "orange",
-			"Completed": "green",
-			"Cancelled": "red",
+			Draft: "grey",
+			Open: "orange",
+			Completed: "green",
+			Cancelled: "red",
 		};
 		return [__(doc.status), status_colors[doc.status], "status,=," + doc.status];
 	},
-};
\ No newline at end of file
+};
diff --git a/erpnext/stock/doctype/price_list/price_list.js b/erpnext/stock/doctype/price_list/price_list.js
index 9291498..85a3a39 100644
--- a/erpnext/stock/doctype/price_list/price_list.js
+++ b/erpnext/stock/doctype/price_list/price_list.js
@@ -2,13 +2,17 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.ui.form.on("Price List", {
-	refresh: function(frm) {
+	refresh: function (frm) {
 		let me = this;
-		frm.add_custom_button(__("Add / Edit Prices"), function() {
-			frappe.route_options = {
-				"price_list": frm.doc.name
-			};
-			frappe.set_route("Report", "Item Price");
-		}, "fa fa-money");
-	}
+		frm.add_custom_button(
+			__("Add / Edit Prices"),
+			function () {
+				frappe.route_options = {
+					price_list: frm.doc.name,
+				};
+				frappe.set_route("Report", "Item Price");
+			},
+			"fa fa-money"
+		);
+	},
 });
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
index 2cbccb0..997cdd0 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
@@ -10,12 +10,12 @@
 frappe.ui.form.on("Purchase Receipt", {
 	setup: (frm) => {
 		frm.make_methods = {
-			'Landed Cost Voucher': () => {
-				let lcv = frappe.model.get_new_doc('Landed Cost Voucher');
+			"Landed Cost Voucher": () => {
+				let lcv = frappe.model.get_new_doc("Landed Cost Voucher");
 				lcv.company = frm.doc.company;
 
-				let lcv_receipt = frappe.model.get_new_doc('Landed Cost Purchase Receipt');
-				lcv_receipt.receipt_document_type = 'Purchase Receipt';
+				let lcv_receipt = frappe.model.get_new_doc("Landed Cost Purchase Receipt");
+				lcv_receipt.receipt_document_type = "Purchase Receipt";
 				lcv_receipt.receipt_document = frm.doc.name;
 				lcv_receipt.supplier = frm.doc.supplier;
 				lcv_receipt.grand_total = frm.doc.grand_total;
@@ -23,69 +23,77 @@
 
 				frappe.set_route("Form", lcv.doctype, lcv.name);
 			},
-		}
-
-		frm.custom_make_buttons = {
-			'Stock Entry': 'Return',
-			'Purchase Invoice': 'Purchase Invoice'
 		};
 
-		frm.set_query("expense_account", "items", function() {
+		frm.custom_make_buttons = {
+			"Stock Entry": "Return",
+			"Purchase Invoice": "Purchase Invoice",
+		};
+
+		frm.set_query("expense_account", "items", function () {
 			return {
 				query: "erpnext.controllers.queries.get_expense_account",
-				filters: {'company': frm.doc.company }
-			}
+				filters: { company: frm.doc.company },
+			};
 		});
 
-		frm.set_query("wip_composite_asset", "items", function() {
+		frm.set_query("wip_composite_asset", "items", function () {
 			return {
-				filters: {'is_composite_asset': 1, 'docstatus': 0 }
-			}
+				filters: { is_composite_asset: 1, docstatus: 0 },
+			};
 		});
 
-		frm.set_query("taxes_and_charges", function() {
+		frm.set_query("taxes_and_charges", function () {
 			return {
-				filters: {'company': frm.doc.company }
-			}
+				filters: { company: frm.doc.company },
+			};
 		});
 
-		frm.set_query("subcontracting_receipt", function() {
+		frm.set_query("subcontracting_receipt", function () {
 			return {
 				filters: {
-					'docstatus': 1,
-					'supplier': frm.doc.supplier,
-				}
-			}
+					docstatus: 1,
+					supplier: frm.doc.supplier,
+				},
+			};
 		});
 	},
-	onload: function(frm) {
-		erpnext.queries.setup_queries(frm, "Warehouse", function() {
+	onload: function (frm) {
+		erpnext.queries.setup_queries(frm, "Warehouse", function () {
 			return erpnext.queries.warehouse(frm.doc);
 		});
 	},
 
-	refresh: function(frm) {
-		if(frm.doc.company) {
+	refresh: function (frm) {
+		if (frm.doc.company) {
 			frm.trigger("toggle_display_account_head");
 		}
 
 		if (frm.doc.docstatus === 1 && frm.doc.is_return === 1 && frm.doc.per_billed !== 100) {
-			frm.add_custom_button(__('Debit Note'), function() {
-				frappe.model.open_mapped_doc({
-					method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_purchase_invoice",
-					frm: cur_frm,
-				})
-			}, __('Create'));
-			frm.page.set_inner_btn_group_as_primary(__('Create'));
+			frm.add_custom_button(
+				__("Debit Note"),
+				function () {
+					frappe.model.open_mapped_doc({
+						method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_purchase_invoice",
+						frm: cur_frm,
+					});
+				},
+				__("Create")
+			);
+			frm.page.set_inner_btn_group_as_primary(__("Create"));
 		}
 
 		if (frm.doc.docstatus === 1 && frm.doc.is_internal_supplier && !frm.doc.inter_company_reference) {
-			frm.add_custom_button(__('Delivery Note'), function() {
-				frappe.model.open_mapped_doc({
-					method: 'erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_inter_company_delivery_note',
-					frm: cur_frm,
-				})
-			}, __('Create'));
+			frm.add_custom_button(
+				__("Delivery Note"),
+				function () {
+					frappe.model.open_mapped_doc({
+						method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_inter_company_delivery_note",
+						frm: cur_frm,
+					});
+				},
+				__("Create")
+			);
 		}
 
 		if (frm.doc.docstatus === 0) {
@@ -94,7 +102,9 @@
 					if (value) {
 						frm.doc.items.forEach((item) => {
 							frm.fields_dict.items.grid.update_docfield_property(
-								"rate", "read_only", (item.purchase_order && item.purchase_order_item)
+								"rate",
+								"read_only",
+								item.purchase_order && item.purchase_order_item
 							);
 						});
 					}
@@ -105,58 +115,68 @@
 		frm.events.add_custom_buttons(frm);
 	},
 
-	add_custom_buttons: function(frm) {
+	add_custom_buttons: function (frm) {
 		if (frm.doc.docstatus == 0) {
-			frm.add_custom_button(__('Purchase Invoice'), function () {
-				if (!frm.doc.supplier) {
-					frappe.throw({
-						title: __("Mandatory"),
-						message: __("Please Select a Supplier")
-					});
-				}
-				erpnext.utils.map_current_doc({
-					method: "erpnext.accounts.doctype.purchase_invoice.purchase_invoice.make_purchase_receipt",
-					source_doctype: "Purchase Invoice",
-					target: frm,
-					setters: {
-						supplier: frm.doc.supplier,
-					},
-					get_query_filters: {
-						docstatus: 1,
-						per_received: ["<", 100],
-						company: frm.doc.company
+			frm.add_custom_button(
+				__("Purchase Invoice"),
+				function () {
+					if (!frm.doc.supplier) {
+						frappe.throw({
+							title: __("Mandatory"),
+							message: __("Please Select a Supplier"),
+						});
 					}
-				})
-			}, __("Get Items From"));
+					erpnext.utils.map_current_doc({
+						method: "erpnext.accounts.doctype.purchase_invoice.purchase_invoice.make_purchase_receipt",
+						source_doctype: "Purchase Invoice",
+						target: frm,
+						setters: {
+							supplier: frm.doc.supplier,
+						},
+						get_query_filters: {
+							docstatus: 1,
+							per_received: ["<", 100],
+							company: frm.doc.company,
+						},
+					});
+				},
+				__("Get Items From")
+			);
 		}
 	},
 
-	company: function(frm) {
+	company: function (frm) {
 		frm.trigger("toggle_display_account_head");
 		erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
 	},
 
 	subcontracting_receipt: (frm) => {
-		if (frm.doc.is_subcontracted === 1 && frm.doc.is_old_subcontracting_flow === 0 && frm.doc.subcontracting_receipt) {
-			frm.set_value('items', null);
+		if (
+			frm.doc.is_subcontracted === 1 &&
+			frm.doc.is_old_subcontracting_flow === 0 &&
+			frm.doc.subcontracting_receipt
+		) {
+			frm.set_value("items", null);
 
 			erpnext.utils.map_current_doc({
-				method: 'erpnext.subcontracting.doctype.subcontracting_receipt.subcontracting_receipt.make_purchase_receipt',
+				method: "erpnext.subcontracting.doctype.subcontracting_receipt.subcontracting_receipt.make_purchase_receipt",
 				source_name: frm.doc.subcontracting_receipt,
 				target_doc: frm,
 				freeze: true,
-				freeze_message: __('Mapping Purchase Receipt ...'),
+				freeze_message: __("Mapping Purchase Receipt ..."),
 			});
 		}
 	},
 
-	toggle_display_account_head: function(frm) {
-		var enabled = erpnext.is_perpetual_inventory_enabled(frm.doc.company)
+	toggle_display_account_head: function (frm) {
+		var enabled = erpnext.is_perpetual_inventory_enabled(frm.doc.company);
 		frm.fields_dict["items"].grid.set_column_disp(["cost_center"], enabled);
-	}
+	},
 });
 
-erpnext.stock.PurchaseReceiptController = class PurchaseReceiptController extends erpnext.buying.BuyingController {
+erpnext.stock.PurchaseReceiptController = class PurchaseReceiptController extends (
+	erpnext.buying.BuyingController
+) {
 	setup(doc) {
 		this.setup_posting_date_time_check();
 		super.setup(doc);
@@ -169,34 +189,43 @@
 		erpnext.accounts.ledger_preview.show_accounting_ledger_preview(this.frm);
 		erpnext.accounts.ledger_preview.show_stock_ledger_preview(this.frm);
 
-		if(this.frm.doc.docstatus > 0) {
+		if (this.frm.doc.docstatus > 0) {
 			this.show_stock_ledger();
 			//removed for temporary
 			this.show_general_ledger();
 
-			this.frm.add_custom_button(__('Asset'), function() {
-				frappe.route_options = {
-					purchase_receipt: me.frm.doc.name,
-				};
-				frappe.set_route("List", "Asset");
-			}, __("View"));
+			this.frm.add_custom_button(
+				__("Asset"),
+				function () {
+					frappe.route_options = {
+						purchase_receipt: me.frm.doc.name,
+					};
+					frappe.set_route("List", "Asset");
+				},
+				__("View")
+			);
 
-			this.frm.add_custom_button(__('Asset Movement'), function() {
-				frappe.route_options = {
-					reference_name: me.frm.doc.name,
-				};
-				frappe.set_route("List", "Asset Movement");
-			}, __("View"));
+			this.frm.add_custom_button(
+				__("Asset Movement"),
+				function () {
+					frappe.route_options = {
+						reference_name: me.frm.doc.name,
+					};
+					frappe.set_route("List", "Asset Movement");
+				},
+				__("View")
+			);
 		}
 
-		if(!this.frm.doc.is_return && this.frm.doc.status!="Closed") {
+		if (!this.frm.doc.is_return && this.frm.doc.status != "Closed") {
 			if (this.frm.doc.docstatus == 0) {
-				this.frm.add_custom_button(__('Purchase Order'),
+				this.frm.add_custom_button(
+					__("Purchase Order"),
 					function () {
 						if (!me.frm.doc.supplier) {
 							frappe.throw({
 								title: __("Mandatory"),
-								message: __("Please Select a Supplier")
+								message: __("Please Select a Supplier"),
 							});
 						}
 						erpnext.utils.map_current_doc({
@@ -205,39 +234,52 @@
 							target: me.frm,
 							setters: {
 								supplier: me.frm.doc.supplier,
-								schedule_date: undefined
+								schedule_date: undefined,
 							},
 							get_query_filters: {
 								docstatus: 1,
 								status: ["not in", ["Closed", "On Hold"]],
 								per_received: ["<", 99.99],
-								company: me.frm.doc.company
-							}
-						})
-					}, __("Get Items From"));
+								company: me.frm.doc.company,
+							},
+						});
+					},
+					__("Get Items From")
+				);
 			}
 
-			if(this.frm.doc.docstatus == 1 && this.frm.doc.status!="Closed") {
+			if (this.frm.doc.docstatus == 1 && this.frm.doc.status != "Closed") {
 				if (this.frm.has_perm("submit")) {
-					cur_frm.add_custom_button(__("Close"), this.close_purchase_receipt, __("Status"))
+					cur_frm.add_custom_button(__("Close"), this.close_purchase_receipt, __("Status"));
 				}
 
-				cur_frm.add_custom_button(__('Purchase Return'), this.make_purchase_return, __('Create'));
+				cur_frm.add_custom_button(__("Purchase Return"), this.make_purchase_return, __("Create"));
 
-				cur_frm.add_custom_button(__('Make Stock Entry'), cur_frm.cscript['Make Stock Entry'], __('Create'));
+				cur_frm.add_custom_button(
+					__("Make Stock Entry"),
+					cur_frm.cscript["Make Stock Entry"],
+					__("Create")
+				);
 
-				if(flt(this.frm.doc.per_billed) < 100) {
-					cur_frm.add_custom_button(__('Purchase Invoice'), this.make_purchase_invoice, __('Create'));
+				if (flt(this.frm.doc.per_billed) < 100) {
+					cur_frm.add_custom_button(
+						__("Purchase Invoice"),
+						this.make_purchase_invoice,
+						__("Create")
+					);
 				}
-				cur_frm.add_custom_button(__('Retention Stock Entry'), this.make_retention_stock_entry, __('Create'));
+				cur_frm.add_custom_button(
+					__("Retention Stock Entry"),
+					this.make_retention_stock_entry,
+					__("Create")
+				);
 
-				cur_frm.page.set_inner_btn_group_as_primary(__('Create'));
+				cur_frm.page.set_inner_btn_group_as_primary(__("Create"));
 			}
 		}
 
-
-		if(this.frm.doc.docstatus==1 && this.frm.doc.status === "Closed" && this.frm.has_perm("submit")) {
-			cur_frm.add_custom_button(__('Reopen'), this.reopen_purchase_receipt, __("Status"))
+		if (this.frm.doc.docstatus == 1 && this.frm.doc.status === "Closed" && this.frm.has_perm("submit")) {
+			cur_frm.add_custom_button(__("Reopen"), this.reopen_purchase_receipt, __("Status"));
 		}
 
 		this.frm.toggle_reqd("supplier_warehouse", this.frm.doc.is_old_subcontracting_flow);
@@ -246,8 +288,8 @@
 	make_purchase_invoice() {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_purchase_invoice",
-			frm: cur_frm
-		})
+			frm: cur_frm,
+		});
 	}
 
 	make_purchase_return() {
@@ -257,34 +299,39 @@
 			if (item.rejected_qty > 0) {
 				return true;
 			}
-		})
+		});
 
 		if (has_rejected_items && has_rejected_items.length > 0) {
-			frappe.prompt([
-				{
-					label: __("Return Qty from Rejected Warehouse"),
-					fieldtype: "Check",
-					fieldname: "return_for_rejected_warehouse",
-					default: 1
+			frappe.prompt(
+				[
+					{
+						label: __("Return Qty from Rejected Warehouse"),
+						fieldtype: "Check",
+						fieldname: "return_for_rejected_warehouse",
+						default: 1,
+					},
+				],
+				function (values) {
+					if (values.return_for_rejected_warehouse) {
+						frappe.call({
+							method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_purchase_return_against_rejected_warehouse",
+							args: {
+								source_name: cur_frm.doc.name,
+							},
+							callback: function (r) {
+								if (r.message) {
+									frappe.model.sync(r.message);
+									frappe.set_route("Form", r.message.doctype, r.message.name);
+								}
+							},
+						});
+					} else {
+						cur_frm.cscript._make_purchase_return();
+					}
 				},
-			], function(values){
-				if (values.return_for_rejected_warehouse) {
-					frappe.call({
-						method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_purchase_return_against_rejected_warehouse",
-						args: {
-							source_name: cur_frm.doc.name
-						},
-						callback: function(r) {
-							if(r.message) {
-								frappe.model.sync(r.message);
-								frappe.set_route("Form", r.message.doctype, r.message.name);
-							}
-						}
-					})
-				} else {
-					cur_frm.cscript._make_purchase_return();
-				}
-			}, __("Return Qty"), __("Make Return Entry"));
+				__("Return Qty"),
+				__("Make Return Entry")
+			);
 		} else {
 			cur_frm.cscript._make_purchase_return();
 		}
@@ -301,76 +348,71 @@
 	make_retention_stock_entry() {
 		frappe.call({
 			method: "erpnext.stock.doctype.stock_entry.stock_entry.move_sample_to_retention_warehouse",
-			args:{
-				"company": cur_frm.doc.company,
-				"items": cur_frm.doc.items
+			args: {
+				company: cur_frm.doc.company,
+				items: cur_frm.doc.items,
 			},
 			callback: function (r) {
 				if (r.message) {
 					var doc = frappe.model.sync(r.message)[0];
 					frappe.set_route("Form", doc.doctype, doc.name);
+				} else {
+					frappe.msgprint(
+						__("Purchase Receipt doesn't have any Item for which Retain Sample is enabled.")
+					);
 				}
-				else {
-					frappe.msgprint(__("Purchase Receipt doesn't have any Item for which Retain Sample is enabled."));
-				}
-			}
+			},
 		});
 	}
 
 	apply_putaway_rule() {
 		if (this.frm.doc.apply_putaway_rule) erpnext.apply_putaway_rule(this.frm);
 	}
-
 };
 
 // for backward compatibility: combine new and previous states
-extend_cscript(cur_frm.cscript, new erpnext.stock.PurchaseReceiptController({frm: cur_frm}));
+extend_cscript(cur_frm.cscript, new erpnext.stock.PurchaseReceiptController({ frm: cur_frm }));
 
-cur_frm.cscript.update_status = function(status) {
+cur_frm.cscript.update_status = function (status) {
 	frappe.ui.form.is_saving = true;
 	frappe.call({
-		method:"erpnext.stock.doctype.purchase_receipt.purchase_receipt.update_purchase_receipt_status",
-		args: {docname: cur_frm.doc.name, status: status},
-		callback: function(r){
-			if(!r.exc)
-				cur_frm.reload_doc();
+		method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.update_purchase_receipt_status",
+		args: { docname: cur_frm.doc.name, status: status },
+		callback: function (r) {
+			if (!r.exc) cur_frm.reload_doc();
 		},
-		always: function(){
+		always: function () {
 			frappe.ui.form.is_saving = false;
-		}
-	})
-}
+		},
+	});
+};
 
-cur_frm.fields_dict['items'].grid.get_field('project').get_query = function(doc, cdt, cdn) {
+cur_frm.fields_dict["items"].grid.get_field("project").get_query = function (doc, cdt, cdn) {
+	return {
+		filters: [["Project", "status", "not in", "Completed, Cancelled"]],
+	};
+};
+
+cur_frm.fields_dict["select_print_heading"].get_query = function (doc, cdt, cdn) {
+	return {
+		filters: [["Print Heading", "docstatus", "!=", "2"]],
+	};
+};
+
+cur_frm.fields_dict["items"].grid.get_field("bom").get_query = function (doc, cdt, cdn) {
+	var d = locals[cdt][cdn];
 	return {
 		filters: [
-			['Project', 'status', 'not in', 'Completed, Cancelled']
-		]
-	}
-}
-
-cur_frm.fields_dict['select_print_heading'].get_query = function(doc, cdt, cdn) {
-	return {
-		filters: [
-			['Print Heading', 'docstatus', '!=', '2']
-		]
-	}
-}
-
-cur_frm.fields_dict['items'].grid.get_field('bom').get_query = function(doc, cdt, cdn) {
-	var d = locals[cdt][cdn]
-	return {
-		filters: [
-			['BOM', 'item', '=', d.item_code],
-			['BOM', 'is_active', '=', '1'],
-			['BOM', 'docstatus', '=', '1']
-		]
-	}
-}
+			["BOM", "item", "=", d.item_code],
+			["BOM", "is_active", "=", "1"],
+			["BOM", "docstatus", "=", "1"],
+		],
+	};
+};
 
 frappe.provide("erpnext.buying");
 
-frappe.ui.form.on("Purchase Receipt", "is_subcontracted", function(frm) {
+frappe.ui.form.on("Purchase Receipt", "is_subcontracted", function (frm) {
 	if (frm.doc.is_old_subcontracting_flow) {
 		erpnext.buying.get_default_bom(frm);
 	}
@@ -378,53 +420,53 @@
 	frm.toggle_reqd("supplier_warehouse", frm.doc.is_old_subcontracting_flow);
 });
 
-frappe.ui.form.on('Purchase Receipt Item', {
-	item_code: function(frm, cdt, cdn) {
+frappe.ui.form.on("Purchase Receipt Item", {
+	item_code: function (frm, cdt, cdn) {
 		var d = locals[cdt][cdn];
-		frappe.db.get_value('Item', {name: d.item_code}, 'sample_quantity', (r) => {
+		frappe.db.get_value("Item", { name: d.item_code }, "sample_quantity", (r) => {
 			frappe.model.set_value(cdt, cdn, "sample_quantity", r.sample_quantity);
 			validate_sample_quantity(frm, cdt, cdn);
 		});
 	},
-	qty: function(frm, cdt, cdn) {
+	qty: function (frm, cdt, cdn) {
 		validate_sample_quantity(frm, cdt, cdn);
 	},
-	sample_quantity: function(frm, cdt, cdn) {
+	sample_quantity: function (frm, cdt, cdn) {
 		validate_sample_quantity(frm, cdt, cdn);
 	},
-	batch_no: function(frm, cdt, cdn) {
+	batch_no: function (frm, cdt, cdn) {
 		validate_sample_quantity(frm, cdt, cdn);
 	},
 });
 
-cur_frm.cscript._make_purchase_return = function() {
+cur_frm.cscript._make_purchase_return = function () {
 	frappe.model.open_mapped_doc({
 		method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_purchase_return",
-		frm: cur_frm
+		frm: cur_frm,
 	});
-}
+};
 
-cur_frm.cscript['Make Stock Entry'] = function() {
+cur_frm.cscript["Make Stock Entry"] = function () {
 	frappe.model.open_mapped_doc({
 		method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_stock_entry",
 		frm: cur_frm,
-	})
-}
+	});
+};
 
-var validate_sample_quantity = function(frm, cdt, cdn) {
+var validate_sample_quantity = function (frm, cdt, cdn) {
 	var d = locals[cdt][cdn];
 	if (d.sample_quantity && d.qty) {
 		frappe.call({
-			method: 'erpnext.stock.doctype.stock_entry.stock_entry.validate_sample_quantity',
+			method: "erpnext.stock.doctype.stock_entry.stock_entry.validate_sample_quantity",
 			args: {
 				batch_no: d.batch_no,
 				item_code: d.item_code,
 				sample_quantity: d.sample_quantity,
-				qty: d.qty
+				qty: d.qty,
 			},
 			callback: (r) => {
 				frappe.model.set_value(cdt, cdn, "sample_quantity", r.message);
-			}
+			},
 		});
 	}
 };
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.js
index f19f1ff..fc4aabd 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.js
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.js
@@ -1,8 +1,17 @@
-frappe.listview_settings['Purchase Receipt'] = {
-	add_fields: ["supplier", "supplier_name", "base_grand_total", "is_subcontracted",
-		"transporter_name", "is_return", "status", "per_billed", "currency"],
-	get_indicator: function(doc) {
-		if(cint(doc.is_return)==1) {
+frappe.listview_settings["Purchase Receipt"] = {
+	add_fields: [
+		"supplier",
+		"supplier_name",
+		"base_grand_total",
+		"is_subcontracted",
+		"transporter_name",
+		"is_return",
+		"status",
+		"per_billed",
+		"currency",
+	],
+	get_indicator: function (doc) {
+		if (cint(doc.is_return) == 1) {
 			return [__("Return"), "gray", "is_return,=,Yes"];
 		} else if (doc.status === "Closed") {
 			return [__("Closed"), "green", "status,=,Closed"];
@@ -17,11 +26,9 @@
 		}
 	},
 
-	onload: function(listview) {
-
-		listview.page.add_action_item(__("Purchase Invoice"), ()=>{
+	onload: function (listview) {
+		listview.page.add_action_item(__("Purchase Invoice"), () => {
 			erpnext.bulk_transaction_processing.create(listview, "Purchase Receipt", "Purchase Invoice");
 		});
-	}
-
+	},
 };
diff --git a/erpnext/stock/doctype/putaway_rule/putaway_rule.js b/erpnext/stock/doctype/putaway_rule/putaway_rule.js
index e056920..351be16 100644
--- a/erpnext/stock/doctype/putaway_rule/putaway_rule.js
+++ b/erpnext/stock/doctype/putaway_rule/putaway_rule.js
@@ -1,41 +1,41 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Putaway Rule', {
-	setup: function(frm) {
-		frm.set_query("warehouse", function() {
+frappe.ui.form.on("Putaway Rule", {
+	setup: function (frm) {
+		frm.set_query("warehouse", function () {
 			return {
-				"filters": {
-					"company": frm.doc.company,
-					"is_group": 0
-				}
+				filters: {
+					company: frm.doc.company,
+					is_group: 0,
+				},
 			};
 		});
 	},
 
-	uom: function(frm) {
+	uom: function (frm) {
 		if (frm.doc.item_code && frm.doc.uom) {
 			return frm.call({
 				method: "erpnext.stock.get_item_details.get_conversion_factor",
 				args: {
 					item_code: frm.doc.item_code,
-					uom: frm.doc.uom
+					uom: frm.doc.uom,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (!r.exc) {
 						let stock_capacity = flt(frm.doc.capacity) * flt(r.message.conversion_factor);
-						frm.set_value('conversion_factor', r.message.conversion_factor);
-						frm.set_value('stock_capacity', stock_capacity);
+						frm.set_value("conversion_factor", r.message.conversion_factor);
+						frm.set_value("stock_capacity", stock_capacity);
 					}
-				}
+				},
 			});
 		}
 	},
 
-	capacity: function(frm) {
+	capacity: function (frm) {
 		let stock_capacity = flt(frm.doc.capacity) * flt(frm.doc.conversion_factor);
-		frm.set_value('stock_capacity', stock_capacity);
-	}
+		frm.set_value("stock_capacity", stock_capacity);
+	},
 
 	// refresh: function(frm) {
 
diff --git a/erpnext/stock/doctype/putaway_rule/putaway_rule_list.js b/erpnext/stock/doctype/putaway_rule/putaway_rule_list.js
index 753569c..0b8c9ec 100644
--- a/erpnext/stock/doctype/putaway_rule/putaway_rule_list.js
+++ b/erpnext/stock/doctype/putaway_rule/putaway_rule_list.js
@@ -1,4 +1,4 @@
-frappe.listview_settings['Putaway Rule'] = {
+frappe.listview_settings["Putaway Rule"] = {
 	add_fields: ["disable"],
 	get_indicator: (doc) => {
 		if (doc.disable) {
@@ -10,8 +10,8 @@
 
 	reports: [
 		{
-			name: 'Warehouse Capacity Summary',
-			route: '/app/warehouse-capacity-summary'
-		}
-	]
+			name: "Warehouse Capacity Summary",
+			route: "/app/warehouse-capacity-summary",
+		},
+	],
 };
diff --git a/erpnext/stock/doctype/quality_inspection/quality_inspection.js b/erpnext/stock/doctype/quality_inspection/quality_inspection.js
index 05fa232..fc48751 100644
--- a/erpnext/stock/doctype/quality_inspection/quality_inspection.js
+++ b/erpnext/stock/doctype/quality_inspection/quality_inspection.js
@@ -4,88 +4,85 @@
 cur_frm.cscript.refresh = cur_frm.cscript.inspection_type;
 
 frappe.ui.form.on("Quality Inspection", {
-
-	setup: function(frm) {
-		frm.set_query("reference_name", function() {
+	setup: function (frm) {
+		frm.set_query("reference_name", function () {
 			return {
 				filters: {
-					"docstatus": ["!=", 2],
-				}
-			}
+					docstatus: ["!=", 2],
+				},
+			};
 		});
 
-		frm.set_query("batch_no", function() {
+		frm.set_query("batch_no", function () {
 			return {
 				filters: {
-					"item": frm.doc.item_code
-				}
+					item: frm.doc.item_code,
+				},
 			};
 		});
 
 		// Serial No based on item_code
-		frm.set_query("item_serial_no", function() {
+		frm.set_query("item_serial_no", function () {
 			let filters = {};
 			if (frm.doc.item_code) {
 				filters = {
-					'item_code': frm.doc.item_code
+					item_code: frm.doc.item_code,
 				};
 			}
 			return { filters: filters };
 		});
 
 		// item code based on GRN/DN
-		frm.set_query("item_code", function(doc) {
+		frm.set_query("item_code", function (doc) {
 			let doctype = doc.reference_type;
 
 			if (doc.reference_type !== "Job Card") {
-				doctype = (doc.reference_type == "Stock Entry") ?
-					"Stock Entry Detail" : doc.reference_type + " Item";
+				doctype =
+					doc.reference_type == "Stock Entry" ? "Stock Entry Detail" : doc.reference_type + " Item";
 			}
 
 			if (doc.reference_type && doc.reference_name) {
 				let filters = {
-					"from": doctype,
-					"inspection_type": doc.inspection_type
+					from: doctype,
+					inspection_type: doc.inspection_type,
 				};
 
-				if (doc.reference_type == doctype)
-					filters["reference_name"] = doc.reference_name;
-				else
-					filters["parent"] = doc.reference_name;
+				if (doc.reference_type == doctype) filters["reference_name"] = doc.reference_name;
+				else filters["parent"] = doc.reference_name;
 
 				return {
 					query: "erpnext.stock.doctype.quality_inspection.quality_inspection.item_query",
-					filters: filters
+					filters: filters,
 				};
 			}
 		});
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		// Ignore cancellation of reference doctype on cancel all.
 		frm.ignore_doctypes_on_cancel_all = [frm.doc.reference_type];
 	},
 
-	item_code: function(frm) {
+	item_code: function (frm) {
 		if (frm.doc.item_code && !frm.doc.quality_inspection_template) {
 			return frm.call({
 				method: "get_quality_inspection_template",
 				doc: frm.doc,
-				callback: function() {
-					refresh_field(['quality_inspection_template', 'readings']);
-				}
+				callback: function () {
+					refresh_field(["quality_inspection_template", "readings"]);
+				},
 			});
 		}
 	},
 
-	quality_inspection_template: function(frm) {
+	quality_inspection_template: function (frm) {
 		if (frm.doc.quality_inspection_template) {
 			return frm.call({
 				method: "get_item_specification_details",
 				doc: frm.doc,
-				callback: function() {
-					refresh_field('readings');
-				}
+				callback: function () {
+					refresh_field("readings");
+				},
 			});
 		}
 	},
diff --git a/erpnext/stock/doctype/quality_inspection_parameter/quality_inspection_parameter.js b/erpnext/stock/doctype/quality_inspection_parameter/quality_inspection_parameter.js
index 47c7e11..ecf84c9 100644
--- a/erpnext/stock/doctype/quality_inspection_parameter/quality_inspection_parameter.js
+++ b/erpnext/stock/doctype/quality_inspection_parameter/quality_inspection_parameter.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Quality Inspection Parameter', {
+frappe.ui.form.on("Quality Inspection Parameter", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/stock/doctype/quality_inspection_parameter_group/quality_inspection_parameter_group.js b/erpnext/stock/doctype/quality_inspection_parameter_group/quality_inspection_parameter_group.js
index 8716a29..796ab89 100644
--- a/erpnext/stock/doctype/quality_inspection_parameter_group/quality_inspection_parameter_group.js
+++ b/erpnext/stock/doctype/quality_inspection_parameter_group/quality_inspection_parameter_group.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Quality Inspection Parameter Group', {
+frappe.ui.form.on("Quality Inspection Parameter Group", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/stock/doctype/quality_inspection_template/quality_inspection_template.js b/erpnext/stock/doctype/quality_inspection_template/quality_inspection_template.js
index fa57a3d..053809d 100644
--- a/erpnext/stock/doctype/quality_inspection_template/quality_inspection_template.js
+++ b/erpnext/stock/doctype/quality_inspection_template/quality_inspection_template.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Quality Inspection Template', {
-	refresh: function() {
-
-	}
+frappe.ui.form.on("Quality Inspection Template", {
+	refresh: function () {},
 });
diff --git a/erpnext/stock/doctype/quick_stock_balance/quick_stock_balance.js b/erpnext/stock/doctype/quick_stock_balance/quick_stock_balance.js
index f261fd9..5cfd1f5 100644
--- a/erpnext/stock/doctype/quick_stock_balance/quick_stock_balance.js
+++ b/erpnext/stock/doctype/quick_stock_balance/quick_stock_balance.js
@@ -1,91 +1,90 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Quick Stock Balance', {
-
+frappe.ui.form.on("Quick Stock Balance", {
 	setup: (frm) => {
-		frm.set_query('item', () => {
+		frm.set_query("item", () => {
 			if (!(frm.doc.warehouse && frm.doc.date)) {
-				frm.trigger('check_warehouse_and_date');
+				frm.trigger("check_warehouse_and_date");
 			}
 		});
 	},
 
 	make_custom_stock_report_button: (frm) => {
 		if (frm.doc.item) {
-			frm.add_custom_button(__('Stock Balance Report'), () => {
-				frappe.set_route('query-report', 'Stock Balance',
-					{ 'item_code': frm.doc.item, 'warehouse': frm.doc.warehouse });
+			frm.add_custom_button(__("Stock Balance Report"), () => {
+				frappe.set_route("query-report", "Stock Balance", {
+					item_code: frm.doc.item,
+					warehouse: frm.doc.warehouse,
+				});
 			});
 		}
 	},
 
 	refresh: (frm) => {
 		frm.disable_save();
-		frm.trigger('make_custom_stock_report_button');
+		frm.trigger("make_custom_stock_report_button");
 	},
 
 	check_warehouse_and_date: (frm) => {
-		frappe.msgprint(__('Please enter Warehouse and Date'));
-		frm.doc.item = '';
+		frappe.msgprint(__("Please enter Warehouse and Date"));
+		frm.doc.item = "";
 		frm.refresh();
 	},
 
 	warehouse: (frm) => {
 		if (frm.doc.item || frm.doc.item_barcode) {
-			frm.trigger('get_stock_and_item_details');
+			frm.trigger("get_stock_and_item_details");
 		}
 	},
 
 	date: (frm) => {
 		if (frm.doc.item || frm.doc.item_barcode) {
-			frm.trigger('get_stock_and_item_details');
+			frm.trigger("get_stock_and_item_details");
 		}
 	},
 
 	item: (frm) => {
-		frappe.flags.last_updated_element = 'item';
-		frm.trigger('get_stock_and_item_details');
-		frm.trigger('make_custom_stock_report_button');
+		frappe.flags.last_updated_element = "item";
+		frm.trigger("get_stock_and_item_details");
+		frm.trigger("make_custom_stock_report_button");
 	},
 
 	item_barcode: (frm) => {
-		frappe.flags.last_updated_element = 'item_barcode';
-		frm.trigger('get_stock_and_item_details');
-		frm.trigger('make_custom_stock_report_button');
+		frappe.flags.last_updated_element = "item_barcode";
+		frm.trigger("get_stock_and_item_details");
+		frm.trigger("make_custom_stock_report_button");
 	},
 
 	get_stock_and_item_details: (frm) => {
 		if (!(frm.doc.warehouse && frm.doc.date)) {
-			frm.trigger('check_warehouse_and_date');
-		}
-		else if (frm.doc.item || frm.doc.item_barcode) {
+			frm.trigger("check_warehouse_and_date");
+		} else if (frm.doc.item || frm.doc.item_barcode) {
 			let filters = {
 				warehouse: frm.doc.warehouse,
 				date: frm.doc.date,
 			};
-			if (frappe.flags.last_updated_element === 'item') {
-				filters = { ...filters, ...{ item: frm.doc.item }};
-			}
-			else {
-				filters = { ...filters, ...{ barcode: frm.doc.item_barcode }};
+			if (frappe.flags.last_updated_element === "item") {
+				filters = { ...filters, ...{ item: frm.doc.item } };
+			} else {
+				filters = { ...filters, ...{ barcode: frm.doc.item_barcode } };
 			}
 			frappe.call({
-				method: 'erpnext.stock.doctype.quick_stock_balance.quick_stock_balance.get_stock_item_details',
+				method: "erpnext.stock.doctype.quick_stock_balance.quick_stock_balance.get_stock_item_details",
 				args: filters,
 				callback: (r) => {
 					if (r.message) {
-						let fields = ['item', 'qty', 'value', 'image'];
-						if (!r.message['barcodes'].includes(frm.doc.item_barcode)) {
-							frm.doc.item_barcode = '';
+						let fields = ["item", "qty", "value", "image"];
+						if (!r.message["barcodes"].includes(frm.doc.item_barcode)) {
+							frm.doc.item_barcode = "";
 							frm.refresh();
 						}
 						fields.forEach(function (field) {
 							frm.set_value(field, r.message[field]);
 						});
 					}
-				}
+				},
 			});
 		}
-	}
+	},
 });
diff --git a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.js b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.js
index 40748ce..f0506ab 100644
--- a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.js
+++ b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.js
@@ -1,22 +1,32 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Repost Item Valuation', {
-	setup: function(frm) {
+frappe.ui.form.on("Repost Item Valuation", {
+	setup: function (frm) {
 		frm.set_query("warehouse", () => {
 			let filters = {
-				'is_group': 0
+				is_group: 0,
 			};
-			if (frm.doc.company) filters['company'] = frm.doc.company;
-			return {filters: filters};
+			if (frm.doc.company) filters["company"] = frm.doc.company;
+			return { filters: filters };
 		});
 
 		frm.set_query("voucher_type", () => {
 			return {
 				filters: {
-					name: ['in', ['Purchase Receipt', 'Purchase Invoice', 'Delivery Note',
-						'Sales Invoice', 'Stock Entry', 'Stock Reconciliation', 'Subcontracting Receipt']]
-				}
+					name: [
+						"in",
+						[
+							"Purchase Receipt",
+							"Purchase Invoice",
+							"Delivery Note",
+							"Sales Invoice",
+							"Stock Entry",
+							"Stock Reconciliation",
+							"Subcontracting Receipt",
+						],
+					],
+				},
 			};
 		});
 
@@ -25,74 +35,74 @@
 				return {
 					filters: {
 						company: frm.doc.company,
-						docstatus: 1
-					}
+						docstatus: 1,
+					},
 				};
 			});
 		}
 
-		frm.trigger('setup_realtime_progress');
+		frm.trigger("setup_realtime_progress");
 	},
 
-	based_on: function(frm) {
+	based_on: function (frm) {
 		var fields_to_reset = [];
 
-		if (frm.doc.based_on == 'Transaction') {
-			fields_to_reset = ['item_code', 'warehouse'];
-		} else if (frm.doc.based_on == 'Item and Warehouse') {
-			fields_to_reset = ['voucher_type', 'voucher_no'];
+		if (frm.doc.based_on == "Transaction") {
+			fields_to_reset = ["item_code", "warehouse"];
+		} else if (frm.doc.based_on == "Item and Warehouse") {
+			fields_to_reset = ["voucher_type", "voucher_no"];
 		}
 
 		if (fields_to_reset) {
-			fields_to_reset.forEach(field => {
+			fields_to_reset.forEach((field) => {
 				frm.set_value(field, undefined);
 			});
 		}
 	},
 
-	setup_realtime_progress: function(frm) {
-		frappe.realtime.on('item_reposting_progress', data => {
+	setup_realtime_progress: function (frm) {
+		frappe.realtime.on("item_reposting_progress", (data) => {
 			if (frm.doc.name !== data.name) {
 				return;
 			}
 
-			if (frm.doc.status == 'In Progress') {
+			if (frm.doc.status == "In Progress") {
 				frm.doc.current_index = data.current_index;
 				frm.doc.items_to_be_repost = data.items_to_be_repost;
 				frm.doc.total_reposting_count = data.total_reposting_count;
 
 				frm.dashboard.reset();
-				frm.trigger('show_reposting_progress');
+				frm.trigger("show_reposting_progress");
 			}
 		});
 	},
 
-	refresh: function(frm) {
-		if (frm.doc.status == "Failed" && frm.doc.docstatus==1) {
-			frm.add_custom_button(__('Restart'), function () {
+	refresh: function (frm) {
+		if (frm.doc.status == "Failed" && frm.doc.docstatus == 1) {
+			frm.add_custom_button(__("Restart"), function () {
 				frm.trigger("restart_reposting");
 			}).addClass("btn-primary");
 		}
 
-		frm.trigger('show_reposting_progress');
+		frm.trigger("show_reposting_progress");
 
-		if (frm.doc.status === 'Queued' && frm.doc.docstatus === 1) {
-			frm.trigger('execute_reposting');
+		if (frm.doc.status === "Queued" && frm.doc.docstatus === 1) {
+			frm.trigger("execute_reposting");
 		}
 	},
 
 	execute_reposting(frm) {
 		frm.add_custom_button(__("Start Reposting"), () => {
 			frappe.call({
-				method: 'erpnext.stock.doctype.repost_item_valuation.repost_item_valuation.execute_repost_item_valuation',
-				callback: function() {
-					frappe.msgprint(__('Reposting has been started in the background.'));
-				}
+				method: "erpnext.stock.doctype.repost_item_valuation.repost_item_valuation.execute_repost_item_valuation",
+				callback: function () {
+					frappe.msgprint(__("Reposting has been started in the background."));
+				},
 			});
 		});
 	},
 
-	show_reposting_progress: function(frm) {
+	show_reposting_progress: function (frm) {
 		var bars = [];
 
 		let total_count = frm.doc.items_to_be_repost ? JSON.parse(frm.doc.items_to_be_repost).length : 0;
@@ -101,27 +111,27 @@
 			total_count = frm.doc.total_reposting_count;
 		}
 
-		let progress = flt(cint(frm.doc.current_index) / total_count * 100, 2) || 0.5;
-		var title = __('Reposting Completed {0}%', [progress]);
+		let progress = flt((cint(frm.doc.current_index) / total_count) * 100, 2) || 0.5;
+		var title = __("Reposting Completed {0}%", [progress]);
 
 		bars.push({
-			'title': title,
-			'width': progress + '%',
-			'progress_class': 'progress-bar-success'
+			title: title,
+			width: progress + "%",
+			progress_class: "progress-bar-success",
 		});
 
-		frm.dashboard.add_progress(__('Reposting Progress'), bars);
+		frm.dashboard.add_progress(__("Reposting Progress"), bars);
 	},
 
-	restart_reposting: function(frm) {
+	restart_reposting: function (frm) {
 		frappe.call({
 			method: "restart_reposting",
 			doc: frm.doc,
-			callback: function(r) {
+			callback: function (r) {
 				if (!r.exc) {
 					frm.refresh();
 				}
-			}
+			},
 		});
-	}
+	},
 });
diff --git a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.js b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.js
index 1f7bb4d..21f0784 100644
--- a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.js
+++ b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.js
@@ -1,24 +1,24 @@
 // Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Serial and Batch Bundle', {
+frappe.ui.form.on("Serial and Batch Bundle", {
 	setup(frm) {
-		frm.trigger('set_queries');
+		frm.trigger("set_queries");
 	},
 
 	refresh(frm) {
-		frm.trigger('toggle_fields');
-		frm.trigger('prepare_serial_batch_prompt');
+		frm.trigger("toggle_fields");
+		frm.trigger("prepare_serial_batch_prompt");
 	},
 
 	item_code(frm) {
 		frm.clear_custom_buttons();
-		frm.trigger('prepare_serial_batch_prompt');
+		frm.trigger("prepare_serial_batch_prompt");
 	},
 
 	type_of_transaction(frm) {
 		frm.clear_custom_buttons();
-		frm.trigger('prepare_serial_batch_prompt');
+		frm.trigger("prepare_serial_batch_prompt");
 	},
 
 	warehouse(frm) {
@@ -28,74 +28,77 @@
 				doc: frm.doc,
 				callback(r) {
 					refresh_field("entries");
-				}
-			})
+				},
+			});
 		}
 	},
 
 	has_serial_no(frm) {
-		frm.trigger('toggle_fields');
+		frm.trigger("toggle_fields");
 	},
 
 	has_batch_no(frm) {
-		frm.trigger('toggle_fields');
+		frm.trigger("toggle_fields");
 	},
 
 	prepare_serial_batch_prompt(frm) {
-		if (frm.doc.docstatus === 0 && frm.doc.item_code
-			&& frm.doc.type_of_transaction === "Inward") {
-			let label = frm.doc?.has_serial_no === 1
-				? __('Serial Nos') : __('Batch Nos');
+		if (frm.doc.docstatus === 0 && frm.doc.item_code && frm.doc.type_of_transaction === "Inward") {
+			let label = frm.doc?.has_serial_no === 1 ? __("Serial Nos") : __("Batch Nos");
 
 			if (frm.doc?.has_serial_no === 1 && frm.doc?.has_batch_no === 1) {
-				label = __('Serial and Batch Nos');
+				label = __("Serial and Batch Nos");
 			}
 
 			let fields = frm.events.get_prompt_fields(frm);
 
 			frm.add_custom_button(__("Make " + label), () => {
-				frappe.prompt(fields, (data) => {
-					frm.events.add_serial_batch(frm, data);
-				}, "Add " + label, "Make " + label);
+				frappe.prompt(
+					fields,
+					(data) => {
+						frm.events.add_serial_batch(frm, data);
+					},
+					"Add " + label,
+					"Make " + label
+				);
 			});
 		}
 	},
 
 	get_prompt_fields(frm) {
 		let attach_field = {
-			"label": __("Attach CSV File"),
-			"fieldname": "csv_file",
-			"fieldtype": "Attach"
-		}
+			label: __("Attach CSV File"),
+			fieldname: "csv_file",
+			fieldtype: "Attach",
+		};
 
 		if (!frm.doc.has_batch_no) {
-			attach_field.depends_on = "eval:doc.using_csv_file === 1"
+			attach_field.depends_on = "eval:doc.using_csv_file === 1";
 		}
 
 		let fields = [
 			{
-				"label": __("Import Using CSV file"),
-				"fieldname": "using_csv_file",
-				"default": 1,
-				"fieldtype": "Check",
+				label: __("Import Using CSV file"),
+				fieldname: "using_csv_file",
+				default: 1,
+				fieldtype: "Check",
 			},
 			attach_field,
 			{
-				"fieldtype": "Section Break",
-			}
-		]
+				fieldtype: "Section Break",
+			},
+		];
 
 		if (frm.doc.has_serial_no) {
 			fields.push({
-				"label": "Serial Nos",
-				"fieldname": "serial_nos",
-				"fieldtype": "Small Text",
-				"depends_on": "eval:doc.using_csv_file === 0"
-			})
+				label: "Serial Nos",
+				fieldname: "serial_nos",
+				fieldtype: "Small Text",
+				depends_on: "eval:doc.using_csv_file === 0",
+			});
 		}
 
 		if (frm.doc.has_batch_no) {
-			fields = attach_field
+			fields = attach_field;
 		}
 
 		return fields;
@@ -108,11 +111,11 @@
 			method: "add_serial_batch",
 			doc: frm.doc,
 			args: {
-				"data": prompt_data,
+				data: prompt_data,
 			},
 			callback(r) {
 				refresh_field("entries");
-			}
+			},
 		});
 	},
 
@@ -128,120 +131,119 @@
 
 	toggle_fields(frm) {
 		if (frm.doc.has_serial_no) {
-			frm.doc.entries.forEach(row => {
+			frm.doc.entries.forEach((row) => {
 				if (Math.abs(row.qty) !== 1) {
 					frappe.model.set_value(row.doctype, row.name, "qty", 1);
 				}
-			})
+			});
 		}
 
 		frm.fields_dict.entries.grid.update_docfield_property(
-			'serial_no', 'read_only', !frm.doc.has_serial_no
+			"serial_no",
+			"read_only",
+			!frm.doc.has_serial_no
 		);
 
-		frm.fields_dict.entries.grid.update_docfield_property(
-			'batch_no', 'read_only', !frm.doc.has_batch_no
-		);
+		frm.fields_dict.entries.grid.update_docfield_property("batch_no", "read_only", !frm.doc.has_batch_no);
 
-		frm.fields_dict.entries.grid.update_docfield_property(
-			'qty', 'read_only', frm.doc.has_serial_no
-		);
+		frm.fields_dict.entries.grid.update_docfield_property("qty", "read_only", frm.doc.has_serial_no);
 	},
 
 	set_queries(frm) {
-		frm.set_query('item_code', () => {
+		frm.set_query("item_code", () => {
 			return {
-				query: 'erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle.item_query',
+				query: "erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle.item_query",
 			};
 		});
 
-		frm.set_query('voucher_type', () => {
+		frm.set_query("voucher_type", () => {
 			return {
 				filters: {
-					'istable': 0,
-					'issingle': 0,
-					'is_submittable': 1,
-					'name': ['in', [
-						"Asset Capitalization",
-						"Asset Repair",
-						"Delivery Note",
-						"Installation Note",
-						"Job Card",
-						"Maintenance Schedule",
-						"POS Invoice",
-						"Pick List",
-						"Purchase Invoice",
-						"Purchase Receipt",
-						"Quotation",
-						"Sales Invoice",
-						"Stock Entry",
-						"Stock Reconciliation",
-						"Subcontracting Receipt",
-					]],
-				}
+					istable: 0,
+					issingle: 0,
+					is_submittable: 1,
+					name: [
+						"in",
+						[
+							"Asset Capitalization",
+							"Asset Repair",
+							"Delivery Note",
+							"Installation Note",
+							"Job Card",
+							"Maintenance Schedule",
+							"POS Invoice",
+							"Pick List",
+							"Purchase Invoice",
+							"Purchase Receipt",
+							"Quotation",
+							"Sales Invoice",
+							"Stock Entry",
+							"Stock Reconciliation",
+							"Subcontracting Receipt",
+						],
+					],
+				},
 			};
 		});
 
-		frm.set_query('voucher_no', () => {
+		frm.set_query("voucher_no", () => {
 			return {
 				filters: {
-					'docstatus': ["!=", 2],
-				}
+					docstatus: ["!=", 2],
+				},
 			};
 		});
 
-		frm.set_query('warehouse', () => {
+		frm.set_query("warehouse", () => {
 			return {
 				filters: {
-					'is_group': 0,
-					'company': frm.doc.company,
-				}
+					is_group: 0,
+					company: frm.doc.company,
+				},
 			};
 		});
 
-		frm.set_query('serial_no', 'entries', () => {
+		frm.set_query("serial_no", "entries", () => {
 			return {
 				filters: {
 					item_code: frm.doc.item_code,
-				}
+				},
 			};
 		});
 
-		frm.set_query('batch_no', 'entries', (doc) => {
-
-			if (doc.type_of_transaction ==="Outward") {
+		frm.set_query("batch_no", "entries", (doc) => {
+			if (doc.type_of_transaction === "Outward") {
 				return {
-					query : "erpnext.controllers.queries.get_batch_no",
+					query: "erpnext.controllers.queries.get_batch_no",
 					filters: {
 						item_code: doc.item_code,
 						warehouse: doc.warehouse,
-					}
-				}
+					},
+				};
 			} else {
 				return {
 					filters: {
 						item: doc.item_code,
 						disabled: 0,
-					}
+					},
 				};
 			}
 		});
 
-		frm.set_query('warehouse', 'entries', () => {
+		frm.set_query("warehouse", "entries", () => {
 			return {
 				filters: {
 					company: frm.doc.company,
-				}
+				},
 			};
 		});
-	}
+	},
 });
 
-
 frappe.ui.form.on("Serial and Batch Entry", {
 	entries_add(frm, cdt, cdn) {
 		if (frm.doc.warehouse) {
-			frappe.model.set_value(cdt, cdn, 'warehouse', frm.doc.warehouse);
+			frappe.model.set_value(cdt, cdn, "warehouse", frm.doc.warehouse);
 		}
 	},
-})
\ No newline at end of file
+});
diff --git a/erpnext/stock/doctype/serial_no/serial_no.js b/erpnext/stock/doctype/serial_no/serial_no.js
index 1cb9fd1..338ed61 100644
--- a/erpnext/stock/doctype/serial_no/serial_no.js
+++ b/erpnext/stock/doctype/serial_no/serial_no.js
@@ -1,39 +1,38 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-cur_frm.add_fetch("customer", "customer_name", "customer_name")
-cur_frm.add_fetch("supplier", "supplier_name", "supplier_name")
+cur_frm.add_fetch("customer", "customer_name", "customer_name");
+cur_frm.add_fetch("supplier", "supplier_name", "supplier_name");
 
-cur_frm.add_fetch("item_code", "item_name", "item_name")
-cur_frm.add_fetch("item_code", "description", "description")
-cur_frm.add_fetch("item_code", "item_group", "item_group")
-cur_frm.add_fetch("item_code", "brand", "brand")
+cur_frm.add_fetch("item_code", "item_name", "item_name");
+cur_frm.add_fetch("item_code", "description", "description");
+cur_frm.add_fetch("item_code", "item_group", "item_group");
+cur_frm.add_fetch("item_code", "brand", "brand");
 
-cur_frm.cscript.onload = function() {
-	cur_frm.set_query("item_code", function() {
-		return erpnext.queries.item({"is_stock_item": 1, "has_serial_no": 1})
+cur_frm.cscript.onload = function () {
+	cur_frm.set_query("item_code", function () {
+		return erpnext.queries.item({ is_stock_item: 1, has_serial_no: 1 });
 	});
 };
 
-frappe.ui.form.on("Serial No", "refresh", function(frm) {
+frappe.ui.form.on("Serial No", "refresh", function (frm) {
 	frm.toggle_enable("item_code", frm.doc.__islocal);
 });
 
-
 frappe.ui.form.on("Serial No", {
 	refresh(frm) {
-		frm.trigger("view_ledgers")
+		frm.trigger("view_ledgers");
 	},
 
 	view_ledgers(frm) {
 		frm.add_custom_button(__("View Ledgers"), () => {
 			frappe.route_options = {
-				"item_code": frm.doc.item_code,
-				"serial_no": frm.doc.name,
-				"posting_date": frappe.datetime.now_date(),
-				"posting_time": frappe.datetime.now_time()
+				item_code: frm.doc.item_code,
+				serial_no: frm.doc.name,
+				posting_date: frappe.datetime.now_date(),
+				posting_time: frappe.datetime.now_time(),
 			};
 			frappe.set_route("query-report", "Serial No Ledger");
-		}).addClass('btn-primary');
-	}
-})
\ No newline at end of file
+		}).addClass("btn-primary");
+	},
+});
diff --git a/erpnext/stock/doctype/shipment/shipment.js b/erpnext/stock/doctype/shipment/shipment.js
index 13a17a2..8843d38 100644
--- a/erpnext/stock/doctype/shipment/shipment.js
+++ b/erpnext/stock/doctype/shipment/shipment.js
@@ -1,34 +1,44 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Shipment', {
-	address_query: function(frm, link_doctype, link_name, is_your_company_address) {
+frappe.ui.form.on("Shipment", {
+	address_query: function (frm, link_doctype, link_name, is_your_company_address) {
 		return {
-			query: 'frappe.contacts.doctype.address.address.address_query',
+			query: "frappe.contacts.doctype.address.address.address_query",
 			filters: {
 				link_doctype: link_doctype,
 				link_name: link_name,
-				is_your_company_address: is_your_company_address
-			}
+				is_your_company_address: is_your_company_address,
+			},
 		};
 	},
-	contact_query: function(frm, link_doctype, link_name) {
+	contact_query: function (frm, link_doctype, link_name) {
 		return {
-			query: 'frappe.contacts.doctype.contact.contact.contact_query',
+			query: "frappe.contacts.doctype.contact.contact.contact_query",
 			filters: {
 				link_doctype: link_doctype,
-				link_name: link_name
-			}
+				link_name: link_name,
+			},
 		};
 	},
-	onload: function(frm) {
+	onload: function (frm) {
 		frm.set_query("delivery_address_name", () => {
 			let delivery_to = `delivery_${frappe.model.scrub(frm.doc.delivery_to_type)}`;
-			return frm.events.address_query(frm, frm.doc.delivery_to_type, frm.doc[delivery_to], frm.doc.delivery_to_type === 'Company' ? 1 : 0);
+			return frm.events.address_query(
+				frm,
+				frm.doc.delivery_to_type,
+				frm.doc[delivery_to],
+				frm.doc.delivery_to_type === "Company" ? 1 : 0
+			);
 		});
 		frm.set_query("pickup_address_name", () => {
 			let pickup_from = `pickup_${frappe.model.scrub(frm.doc.pickup_from_type)}`;
-			return frm.events.address_query(frm, frm.doc.pickup_from_type, frm.doc[pickup_from], frm.doc.pickup_from_type === 'Company' ? 1 : 0);
+			return frm.events.address_query(
+				frm,
+				frm.doc.pickup_from_type,
+				frm.doc[pickup_from],
+				frm.doc.pickup_from_type === "Company" ? 1 : 0
+			);
 		});
 		frm.set_query("delivery_contact_name", () => {
 			let delivery_to = `delivery_${frappe.model.scrub(frm.doc.delivery_to_type)}`;
@@ -38,8 +48,8 @@
 			let pickup_from = `pickup_${frappe.model.scrub(frm.doc.pickup_from_type)}`;
 			return frm.events.contact_query(frm, frm.doc.pickup_from_type, frm.doc[pickup_from]);
 		});
-		frm.set_query("delivery_note", "shipment_delivery_note", function() {
-			let customer = '';
+		frm.set_query("delivery_note", "shipment_delivery_note", function () {
+			let customer = "";
 			if (frm.doc.delivery_to_type == "Customer") {
 				customer = frm.doc.delivery_customer;
 			}
@@ -51,305 +61,329 @@
 					filters: {
 						customer: customer,
 						docstatus: 1,
-						status: ["not in", ["Cancelled"]]
-					}
+						status: ["not in", ["Cancelled"]],
+					},
 				};
 			}
 		});
 	},
-	refresh: function() {
-		$('div[data-fieldname=pickup_address] > div > .clearfix').hide();
-		$('div[data-fieldname=pickup_contact] > div > .clearfix').hide();
-		$('div[data-fieldname=delivery_address] > div > .clearfix').hide();
-		$('div[data-fieldname=delivery_contact] > div > .clearfix').hide();
+	refresh: function () {
+		$("div[data-fieldname=pickup_address] > div > .clearfix").hide();
+		$("div[data-fieldname=pickup_contact] > div > .clearfix").hide();
+		$("div[data-fieldname=delivery_address] > div > .clearfix").hide();
+		$("div[data-fieldname=delivery_contact] > div > .clearfix").hide();
 	},
-	before_save: function(frm) {
+	before_save: function (frm) {
 		let delivery_to = `delivery_${frappe.model.scrub(frm.doc.delivery_to_type)}`;
 		frm.set_value("delivery_to", frm.doc[delivery_to]);
 		let pickup_from = `pickup_${frappe.model.scrub(frm.doc.pickup_from_type)}`;
 		frm.set_value("pickup", frm.doc[pickup_from]);
 	},
-	set_pickup_company_address: function(frm) {
-		frappe.db.get_value('Address', {
-			address_title: frm.doc.pickup_company,
-			is_your_company_address: 1
-		}, 'name', (r) => {
-			frm.set_value("pickup_address_name", r.name);
-		});
+	set_pickup_company_address: function (frm) {
+		frappe.db.get_value(
+			"Address",
+			{
+				address_title: frm.doc.pickup_company,
+				is_your_company_address: 1,
+			},
+			"name",
+			(r) => {
+				frm.set_value("pickup_address_name", r.name);
+			}
+		);
 	},
-	set_delivery_company_address: function(frm) {
-		frappe.db.get_value('Address', {
-			address_title: frm.doc.delivery_company,
-			is_your_company_address: 1
-		}, 'name', (r) => {
-			frm.set_value("delivery_address_name", r.name);
-		});
+	set_delivery_company_address: function (frm) {
+		frappe.db.get_value(
+			"Address",
+			{
+				address_title: frm.doc.delivery_company,
+				is_your_company_address: 1,
+			},
+			"name",
+			(r) => {
+				frm.set_value("delivery_address_name", r.name);
+			}
+		);
 	},
-	pickup_from_type: function(frm) {
-		if (frm.doc.pickup_from_type == 'Company') {
-			frm.set_value("pickup_company", frappe.defaults.get_default('company'));
-			frm.set_value("pickup_customer", '');
-			frm.set_value("pickup_supplier", '');
+	pickup_from_type: function (frm) {
+		if (frm.doc.pickup_from_type == "Company") {
+			frm.set_value("pickup_company", frappe.defaults.get_default("company"));
+			frm.set_value("pickup_customer", "");
+			frm.set_value("pickup_supplier", "");
 		} else {
-			frm.trigger('clear_pickup_fields');
+			frm.trigger("clear_pickup_fields");
 		}
-		if (frm.doc.pickup_from_type == 'Customer') {
-			frm.set_value("pickup_company", '');
-			frm.set_value("pickup_supplier", '');
+		if (frm.doc.pickup_from_type == "Customer") {
+			frm.set_value("pickup_company", "");
+			frm.set_value("pickup_supplier", "");
 		}
-		if (frm.doc.pickup_from_type == 'Supplier') {
-			frm.set_value("pickup_customer", '');
-			frm.set_value("pickup_company", '');
+		if (frm.doc.pickup_from_type == "Supplier") {
+			frm.set_value("pickup_customer", "");
+			frm.set_value("pickup_company", "");
 		}
 	},
-	delivery_to_type: function(frm) {
-		if (frm.doc.delivery_to_type == 'Company') {
-			frm.set_value("delivery_company", frappe.defaults.get_default('company'));
-			frm.set_value("delivery_customer", '');
-			frm.set_value("delivery_supplier", '');
+	delivery_to_type: function (frm) {
+		if (frm.doc.delivery_to_type == "Company") {
+			frm.set_value("delivery_company", frappe.defaults.get_default("company"));
+			frm.set_value("delivery_customer", "");
+			frm.set_value("delivery_supplier", "");
 		} else {
-			frm.trigger('clear_delivery_fields');
+			frm.trigger("clear_delivery_fields");
 		}
-		if (frm.doc.delivery_to_type == 'Customer') {
-			frm.set_value("delivery_company", '');
-			frm.set_value("delivery_supplier", '');
+		if (frm.doc.delivery_to_type == "Customer") {
+			frm.set_value("delivery_company", "");
+			frm.set_value("delivery_supplier", "");
 		}
-		if (frm.doc.delivery_to_type == 'Supplier') {
-			frm.set_value("delivery_customer", '');
-			frm.set_value("delivery_company", '');
+		if (frm.doc.delivery_to_type == "Supplier") {
+			frm.set_value("delivery_customer", "");
+			frm.set_value("delivery_company", "");
 			frm.toggle_display("shipment_delivery_note", false);
 		} else {
 			frm.toggle_display("shipment_delivery_note", true);
 		}
 	},
-	delivery_address_name: function(frm) {
-		if (frm.doc.delivery_to_type == 'Company') {
-			erpnext.utils.get_address_display(frm, 'delivery_address_name', 'delivery_address', true);
+	delivery_address_name: function (frm) {
+		if (frm.doc.delivery_to_type == "Company") {
+			erpnext.utils.get_address_display(frm, "delivery_address_name", "delivery_address", true);
 		} else {
-			erpnext.utils.get_address_display(frm, 'delivery_address_name', 'delivery_address', false);
+			erpnext.utils.get_address_display(frm, "delivery_address_name", "delivery_address", false);
 		}
 	},
-	pickup_address_name: function(frm) {
-		if (frm.doc.pickup_from_type == 'Company') {
-			erpnext.utils.get_address_display(frm, 'pickup_address_name', 'pickup_address', true);
+	pickup_address_name: function (frm) {
+		if (frm.doc.pickup_from_type == "Company") {
+			erpnext.utils.get_address_display(frm, "pickup_address_name", "pickup_address", true);
 		} else {
-			erpnext.utils.get_address_display(frm, 'pickup_address_name', 'pickup_address', false);
+			erpnext.utils.get_address_display(frm, "pickup_address_name", "pickup_address", false);
 		}
 	},
-	get_contact_display: function(frm, contact_name, contact_type) {
+	get_contact_display: function (frm, contact_name, contact_type) {
 		frappe.call({
 			method: "frappe.contacts.doctype.contact.contact.get_contact_details",
 			args: { contact: contact_name },
-			callback: function(r) {
+			callback: function (r) {
 				if (r.message) {
 					if (!(r.message.contact_email && (r.message.contact_phone || r.message.contact_mobile))) {
-						if (contact_type == 'Delivery') {
-							frm.set_value('delivery_contact_name', '');
-							frm.set_value('delivery_contact', '');
+						if (contact_type == "Delivery") {
+							frm.set_value("delivery_contact_name", "");
+							frm.set_value("delivery_contact", "");
 						} else {
-							frm.set_value('pickup_contact_name', '');
-							frm.set_value('pickup_contact', '');
+							frm.set_value("pickup_contact_name", "");
+							frm.set_value("pickup_contact", "");
 						}
-						frappe.throw(__("Email or Phone/Mobile of the Contact are mandatory to continue.")
-							+ "</br>" + __("Please set Email/Phone for the contact")
-							+ ` <a href='/app/contact/${contact_name}'>${contact_name}</a>`);
+						frappe.throw(
+							__("Email or Phone/Mobile of the Contact are mandatory to continue.") +
+								"</br>" +
+								__("Please set Email/Phone for the contact") +
+								` <a href='/app/contact/${contact_name}'>${contact_name}</a>`
+						);
 					}
 					let contact_display = r.message.contact_display;
 					if (r.message.contact_email) {
-						contact_display += '<br>' + r.message.contact_email;
+						contact_display += "<br>" + r.message.contact_email;
 					}
 					if (r.message.contact_phone) {
-						contact_display += '<br>' + r.message.contact_phone;
+						contact_display += "<br>" + r.message.contact_phone;
 					}
 					if (r.message.contact_mobile && !r.message.contact_phone) {
-						contact_display += '<br>' + r.message.contact_mobile;
+						contact_display += "<br>" + r.message.contact_mobile;
 					}
-					if (contact_type == 'Delivery') {
-						frm.set_value('delivery_contact', contact_display);
+					if (contact_type == "Delivery") {
+						frm.set_value("delivery_contact", contact_display);
 						if (r.message.contact_email) {
-							frm.set_value('delivery_contact_email', r.message.contact_email);
+							frm.set_value("delivery_contact_email", r.message.contact_email);
 						}
 					} else {
-						frm.set_value('pickup_contact', contact_display);
+						frm.set_value("pickup_contact", contact_display);
 						if (r.message.contact_email) {
-							frm.set_value('pickup_contact_email', r.message.contact_email);
+							frm.set_value("pickup_contact_email", r.message.contact_email);
 						}
 					}
 				}
-			}
+			},
 		});
 	},
-	delivery_contact_name: function(frm) {
+	delivery_contact_name: function (frm) {
 		if (frm.doc.delivery_contact_name) {
-			frm.events.get_contact_display(frm, frm.doc.delivery_contact_name, 'Delivery');
+			frm.events.get_contact_display(frm, frm.doc.delivery_contact_name, "Delivery");
 		}
 	},
-	pickup_contact_name: function(frm) {
+	pickup_contact_name: function (frm) {
 		if (frm.doc.pickup_contact_name) {
-			frm.events.get_contact_display(frm, frm.doc.pickup_contact_name, 'Pickup');
+			frm.events.get_contact_display(frm, frm.doc.pickup_contact_name, "Pickup");
 		}
 	},
-	pickup_contact_person: function(frm) {
+	pickup_contact_person: function (frm) {
 		if (frm.doc.pickup_contact_person) {
 			frappe.call({
 				method: "erpnext.stock.doctype.shipment.shipment.get_company_contact",
 				args: { user: frm.doc.pickup_contact_person },
-				callback: function({ message }) {
+				callback: function ({ message }) {
 					const r = message;
 					let contact_display = `${r.first_name} ${r.last_name}`;
 					if (r.email) {
-						contact_display += `<br>${ r.email }`;
-						frm.set_value('pickup_contact_email', r.email);
+						contact_display += `<br>${r.email}`;
+						frm.set_value("pickup_contact_email", r.email);
 					}
 					if (r.phone) {
-						contact_display += `<br>${ r.phone }`;
+						contact_display += `<br>${r.phone}`;
 					}
 					if (r.mobile_no && !r.phone) {
-						contact_display += `<br>${ r.mobile_no }`;
+						contact_display += `<br>${r.mobile_no}`;
 					}
-					frm.set_value('pickup_contact', contact_display);
-				}
+					frm.set_value("pickup_contact", contact_display);
+				},
 			});
 		} else {
-			if (frm.doc.pickup_from_type === 'Company') {
+			if (frm.doc.pickup_from_type === "Company") {
 				frappe.call({
 					method: "erpnext.stock.doctype.shipment.shipment.get_company_contact",
 					args: { user: frappe.session.user },
-					callback: function({ message }) {
+					callback: function ({ message }) {
 						const r = message;
 						let contact_display = `${r.first_name} ${r.last_name}`;
 						if (r.email) {
-							contact_display += `<br>${ r.email }`;
-							frm.set_value('pickup_contact_email', r.email);
+							contact_display += `<br>${r.email}`;
+							frm.set_value("pickup_contact_email", r.email);
 						}
 						if (r.phone) {
-							contact_display += `<br>${ r.phone }`;
+							contact_display += `<br>${r.phone}`;
 						}
 						if (r.mobile_no && !r.phone) {
-							contact_display += `<br>${ r.mobile_no }`;
+							contact_display += `<br>${r.mobile_no}`;
 						}
-						frm.set_value('pickup_contact', contact_display);
-					}
+						frm.set_value("pickup_contact", contact_display);
+					},
 				});
 			}
 		}
 	},
-	set_company_contact: function(frm, delivery_type) {
-		frappe.db.get_value('User', { name: frappe.session.user }, ['full_name', 'last_name', 'email', 'phone', 'mobile_no'], (r) => {
-			if (!(r.last_name && r.email && (r.phone || r.mobile_no))) {
-				if (delivery_type == 'Delivery') {
-					frm.set_value('delivery_company', '');
-					frm.set_value('delivery_contact', '');
+	set_company_contact: function (frm, delivery_type) {
+		frappe.db.get_value(
+			"User",
+			{ name: frappe.session.user },
+			["full_name", "last_name", "email", "phone", "mobile_no"],
+			(r) => {
+				if (!(r.last_name && r.email && (r.phone || r.mobile_no))) {
+					if (delivery_type == "Delivery") {
+						frm.set_value("delivery_company", "");
+						frm.set_value("delivery_contact", "");
+					} else {
+						frm.set_value("pickup_company", "");
+						frm.set_value("pickup_contact", "");
+					}
+					frappe.throw(
+						__("Last Name, Email or Phone/Mobile of the user are mandatory to continue.") +
+							"</br>" +
+							__("Please first set Last Name, Email and Phone for the user") +
+							` <a href="/app/user/${frappe.session.user}">${frappe.session.user}</a>`
+					);
+				}
+				let contact_display = r.full_name;
+				if (r.email) {
+					contact_display += "<br>" + r.email;
+				}
+				if (r.phone) {
+					contact_display += "<br>" + r.phone;
+				}
+				if (r.mobile_no && !r.phone) {
+					contact_display += "<br>" + r.mobile_no;
+				}
+				if (delivery_type == "Delivery") {
+					frm.set_value("delivery_contact", contact_display);
+					if (r.email) {
+						frm.set_value("delivery_contact_email", r.email);
+					}
 				} else {
-					frm.set_value('pickup_company', '');
-					frm.set_value('pickup_contact', '');
-				}
-				frappe.throw(__("Last Name, Email or Phone/Mobile of the user are mandatory to continue.") + "</br>"
-					+ __("Please first set Last Name, Email and Phone for the user")
-					+ ` <a href="/app/user/${frappe.session.user}">${frappe.session.user}</a>`);
-			}
-			let contact_display = r.full_name;
-			if (r.email) {
-				contact_display += '<br>' + r.email;
-			}
-			if (r.phone) {
-				contact_display += '<br>' + r.phone;
-			}
-			if (r.mobile_no && !r.phone) {
-				contact_display += '<br>' + r.mobile_no;
-			}
-			if (delivery_type == 'Delivery') {
-				frm.set_value('delivery_contact', contact_display);
-				if (r.email) {
-					frm.set_value('delivery_contact_email', r.email);
-				}
-			} else {
-				frm.set_value('pickup_contact', contact_display);
-				if (r.email) {
-					frm.set_value('pickup_contact_email', r.email);
+					frm.set_value("pickup_contact", contact_display);
+					if (r.email) {
+						frm.set_value("pickup_contact_email", r.email);
+					}
 				}
 			}
-		});
-		frm.set_value('pickup_contact_person', frappe.session.user);
+		);
+		frm.set_value("pickup_contact_person", frappe.session.user);
 	},
-	pickup_company: function(frm) {
-		if (frm.doc.pickup_from_type == 'Company'  && frm.doc.pickup_company) {
-			frm.trigger('set_pickup_company_address');
-			frm.events.set_company_contact(frm, 'Pickup');
+	pickup_company: function (frm) {
+		if (frm.doc.pickup_from_type == "Company" && frm.doc.pickup_company) {
+			frm.trigger("set_pickup_company_address");
+			frm.events.set_company_contact(frm, "Pickup");
 		}
 	},
-	delivery_company: function(frm) {
-		if (frm.doc.delivery_to_type == 'Company' && frm.doc.delivery_company) {
-			frm.trigger('set_delivery_company_address');
-			frm.events.set_company_contact(frm, 'Delivery');
+	delivery_company: function (frm) {
+		if (frm.doc.delivery_to_type == "Company" && frm.doc.delivery_company) {
+			frm.trigger("set_delivery_company_address");
+			frm.events.set_company_contact(frm, "Delivery");
 		}
 	},
-	delivery_customer: function(frm) {
-		frm.trigger('clear_delivery_fields');
+	delivery_customer: function (frm) {
+		frm.trigger("clear_delivery_fields");
 		if (frm.doc.delivery_customer) {
-			frm.events.set_address_name(frm, 'Customer', frm.doc.delivery_customer, 'Delivery');
-			frm.events.set_contact_name(frm, 'Customer', frm.doc.delivery_customer, 'Delivery');
+			frm.events.set_address_name(frm, "Customer", frm.doc.delivery_customer, "Delivery");
+			frm.events.set_contact_name(frm, "Customer", frm.doc.delivery_customer, "Delivery");
 		}
 	},
-	delivery_supplier: function(frm) {
-		frm.trigger('clear_delivery_fields');
+	delivery_supplier: function (frm) {
+		frm.trigger("clear_delivery_fields");
 		if (frm.doc.delivery_supplier) {
-			frm.events.set_address_name(frm, 'Supplier', frm.doc.delivery_supplier, 'Delivery');
-			frm.events.set_contact_name(frm, 'Supplier', frm.doc.delivery_supplier, 'Delivery');
+			frm.events.set_address_name(frm, "Supplier", frm.doc.delivery_supplier, "Delivery");
+			frm.events.set_contact_name(frm, "Supplier", frm.doc.delivery_supplier, "Delivery");
 		}
 	},
-	pickup_customer: function(frm) {
+	pickup_customer: function (frm) {
 		if (frm.doc.pickup_customer) {
-			frm.events.set_address_name(frm, 'Customer', frm.doc.pickup_customer, 'Pickup');
-			frm.events.set_contact_name(frm, 'Customer', frm.doc.pickup_customer, 'Pickup');
+			frm.events.set_address_name(frm, "Customer", frm.doc.pickup_customer, "Pickup");
+			frm.events.set_contact_name(frm, "Customer", frm.doc.pickup_customer, "Pickup");
 		}
 	},
-	pickup_supplier: function(frm) {
+	pickup_supplier: function (frm) {
 		if (frm.doc.pickup_supplier) {
-			frm.events.set_address_name(frm, 'Supplier', frm.doc.pickup_supplier, 'Pickup');
-			frm.events.set_contact_name(frm, 'Supplier', frm.doc.pickup_supplier, 'Pickup');
+			frm.events.set_address_name(frm, "Supplier", frm.doc.pickup_supplier, "Pickup");
+			frm.events.set_contact_name(frm, "Supplier", frm.doc.pickup_supplier, "Pickup");
 		}
 	},
-	set_address_name: function(frm, ref_doctype, ref_docname, delivery_type) {
+	set_address_name: function (frm, ref_doctype, ref_docname, delivery_type) {
 		frappe.call({
 			method: "erpnext.stock.doctype.shipment.shipment.get_address_name",
 			args: {
 				ref_doctype: ref_doctype,
-				docname: ref_docname
+				docname: ref_docname,
 			},
-			callback: function(r) {
+			callback: function (r) {
 				if (r.message) {
-					if (delivery_type == 'Delivery') {
-						frm.set_value('delivery_address_name', r.message);
+					if (delivery_type == "Delivery") {
+						frm.set_value("delivery_address_name", r.message);
 					} else {
-						frm.set_value('pickup_address_name', r.message);
+						frm.set_value("pickup_address_name", r.message);
 					}
 				}
-			}
+			},
 		});
 	},
-	set_contact_name: function(frm, ref_doctype, ref_docname, delivery_type) {
+	set_contact_name: function (frm, ref_doctype, ref_docname, delivery_type) {
 		frappe.call({
 			method: "erpnext.stock.doctype.shipment.shipment.get_contact_name",
 			args: {
 				ref_doctype: ref_doctype,
-				docname: ref_docname
+				docname: ref_docname,
 			},
-			callback: function(r) {
+			callback: function (r) {
 				if (r.message) {
-					if (delivery_type == 'Delivery') {
-						frm.set_value('delivery_contact_name', r.message);
+					if (delivery_type == "Delivery") {
+						frm.set_value("delivery_contact_name", r.message);
 					} else {
-						frm.set_value('pickup_contact_name', r.message);
+						frm.set_value("pickup_contact_name", r.message);
 					}
 				}
-			}
+			},
 		});
 	},
-	add_template: function(frm) {
+	add_template: function (frm) {
 		if (frm.doc.parcel_template) {
 			frappe.model.with_doc("Shipment Parcel Template", frm.doc.parcel_template, () => {
-				let parcel_template = frappe.model.get_doc("Shipment Parcel Template", frm.doc.parcel_template);
+				let parcel_template = frappe.model.get_doc(
+					"Shipment Parcel Template",
+					frm.doc.parcel_template
+				);
 				let row = frappe.model.add_child(frm.doc, "Shipment Parcel", "shipment_parcel");
 				row.length = parcel_template.length;
 				row.width = parcel_template.width;
@@ -359,56 +393,71 @@
 			});
 		}
 	},
-	pickup_date: function(frm) {
+	pickup_date: function (frm) {
 		if (frm.doc.pickup_date < frappe.datetime.get_today()) {
 			frappe.throw(__("Pickup Date cannot be before this day"));
 		}
 	},
-	clear_pickup_fields: function(frm) {
-		let fields = ["pickup_address_name", "pickup_contact_name", "pickup_address", "pickup_contact", "pickup_contact_email", "pickup_contact_person"];
+	clear_pickup_fields: function (frm) {
+		let fields = [
+			"pickup_address_name",
+			"pickup_contact_name",
+			"pickup_address",
+			"pickup_contact",
+			"pickup_contact_email",
+			"pickup_contact_person",
+		];
 		for (let field of fields) {
-			frm.set_value(field,  '');
+			frm.set_value(field, "");
 		}
 	},
-	clear_delivery_fields: function(frm) {
-		let fields = ["delivery_address_name", "delivery_contact_name", "delivery_address", "delivery_contact", "delivery_contact_email"];
+	clear_delivery_fields: function (frm) {
+		let fields = [
+			"delivery_address_name",
+			"delivery_contact_name",
+			"delivery_address",
+			"delivery_contact",
+			"delivery_contact_email",
+		];
 		for (let field of fields) {
-			frm.set_value(field,  '');
+			frm.set_value(field, "");
 		}
 	},
-	remove_email_row: function(frm, table, fieldname) {
-		$.each(frm.doc[table] || [], function(i, detail) {
+	remove_email_row: function (frm, table, fieldname) {
+		$.each(frm.doc[table] || [], function (i, detail) {
 			if (detail.email === fieldname) {
 				cur_frm.get_field(table).grid.grid_rows[i].remove();
 			}
 		});
-	}
+	},
 });
 
-frappe.ui.form.on('Shipment Delivery Note', {
-	delivery_note: function(frm, cdt, cdn) {
+frappe.ui.form.on("Shipment Delivery Note", {
+	delivery_note: function (frm, cdt, cdn) {
 		let row = locals[cdt][cdn];
 		if (row.delivery_note) {
 			let row_index = row.idx - 1;
-			if (validate_duplicate(frm, 'shipment_delivery_note', row.delivery_note, row_index)) {
-				frappe.throw(__("You have entered a duplicate Delivery Note on Row") + ` ${row.idx}. ` + __("Please rectify and try again."));
+			if (validate_duplicate(frm, "shipment_delivery_note", row.delivery_note, row_index)) {
+				frappe.throw(
+					__("You have entered a duplicate Delivery Note on Row") +
+						` ${row.idx}. ` +
+						__("Please rectify and try again.")
+				);
 			}
 		}
 	},
-	grand_total: function(frm, cdt, cdn) {
+	grand_total: function (frm, cdt, cdn) {
 		let row = locals[cdt][cdn];
 		if (row.grand_total) {
-			var value_of_goods = parseFloat(frm.doc.value_of_goods)+parseFloat(row.grand_total);
+			var value_of_goods = parseFloat(frm.doc.value_of_goods) + parseFloat(row.grand_total);
 			frm.set_value("value_of_goods", Math.round(value_of_goods));
 			frm.refresh_fields("value_of_goods");
 		}
 	},
 });
 
-var validate_duplicate =  function(frm, table, fieldname, index) {
-	return (
-		table === 'shipment_delivery_note'
-			? frm.doc[table].some((detail, i) => detail.delivery_note === fieldname && !(index === i))
-			: frm.doc[table].some((detail, i) => detail.email === fieldname && !(index === i))
-	);
+var validate_duplicate = function (frm, table, fieldname, index) {
+	return table === "shipment_delivery_note"
+		? frm.doc[table].some((detail, i) => detail.delivery_note === fieldname && !(index === i))
+		: frm.doc[table].some((detail, i) => detail.email === fieldname && !(index === i));
 };
diff --git a/erpnext/stock/doctype/shipment/shipment_list.js b/erpnext/stock/doctype/shipment/shipment_list.js
index ae6a3c1..b333ccc 100644
--- a/erpnext/stock/doctype/shipment/shipment_list.js
+++ b/erpnext/stock/doctype/shipment/shipment_list.js
@@ -1,8 +1,8 @@
-frappe.listview_settings['Shipment'] = {
+frappe.listview_settings["Shipment"] = {
 	add_fields: ["status"],
-	get_indicator: function(doc) {
-		if (doc.status=='Booked') {
+	get_indicator: function (doc) {
+		if (doc.status == "Booked") {
 			return [__("Booked"), "green"];
 		}
-	}
+	},
 };
diff --git a/erpnext/stock/doctype/shipment_parcel_template/shipment_parcel_template.js b/erpnext/stock/doctype/shipment_parcel_template/shipment_parcel_template.js
index 785a3b3..3ef90fa 100644
--- a/erpnext/stock/doctype/shipment_parcel_template/shipment_parcel_template.js
+++ b/erpnext/stock/doctype/shipment_parcel_template/shipment_parcel_template.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Shipment Parcel Template', {
+frappe.ui.form.on("Shipment Parcel Template", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index 1b7089b..ac2fe58 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -5,91 +5,106 @@
 
 erpnext.landed_cost_taxes_and_charges.setup_triggers("Stock Entry");
 
-frappe.ui.form.on('Stock Entry', {
-	setup: function(frm) {
-		frm.ignore_doctypes_on_cancel_all = ['Serial and Batch Bundle'];
+frappe.ui.form.on("Stock Entry", {
+	setup: function (frm) {
+		frm.ignore_doctypes_on_cancel_all = ["Serial and Batch Bundle"];
 
-		frm.set_indicator_formatter('item_code', function(doc) {
+		frm.set_indicator_formatter("item_code", function (doc) {
 			if (!doc.s_warehouse) {
-				return 'blue';
+				return "blue";
 			} else {
-				return (doc.qty<=doc.actual_qty) ? 'green' : 'orange';
+				return doc.qty <= doc.actual_qty ? "green" : "orange";
 			}
 		});
 
-		frm.set_query('work_order', function() {
+		frm.set_query("work_order", function () {
 			return {
 				filters: [
-					['Work Order', 'docstatus', '=', 1],
-					['Work Order', 'qty', '>','`tabWork Order`.produced_qty'],
-					['Work Order', 'company', '=', frm.doc.company]
-				]
-			}
+					["Work Order", "docstatus", "=", 1],
+					["Work Order", "qty", ">", "`tabWork Order`.produced_qty"],
+					["Work Order", "company", "=", frm.doc.company],
+				],
+			};
 		});
 
-		frm.set_query('outgoing_stock_entry', function() {
+		frm.set_query("outgoing_stock_entry", function () {
 			return {
 				filters: [
-					['Stock Entry', 'docstatus', '=', 1],
-					['Stock Entry', 'per_transferred', '<','100'],
-				]
-			}
+					["Stock Entry", "docstatus", "=", 1],
+					["Stock Entry", "per_transferred", "<", "100"],
+				],
+			};
 		});
 
-		frm.set_query('source_warehouse_address', function() {
+		frm.set_query("source_warehouse_address", function () {
 			return {
 				filters: {
-					link_doctype: 'Warehouse',
-					link_name: frm.doc.from_warehouse
-				}
-			}
+					link_doctype: "Warehouse",
+					link_name: frm.doc.from_warehouse,
+				},
+			};
 		});
 
-		frm.set_query('target_warehouse_address', function() {
+		frm.set_query("target_warehouse_address", function () {
 			return {
 				filters: {
-					link_doctype: 'Warehouse',
-					link_name: frm.doc.to_warehouse
+					link_doctype: "Warehouse",
+					link_name: frm.doc.to_warehouse,
+				},
+			};
+		});
+
+		frappe.db.get_value(
+			"Stock Settings",
+			{ name: "Stock Settings" },
+			"sample_retention_warehouse",
+			(r) => {
+				if (r.sample_retention_warehouse) {
+					let filters = [
+						["Warehouse", "company", "=", frm.doc.company],
+						["Warehouse", "is_group", "=", 0],
+						["Warehouse", "name", "!=", r.sample_retention_warehouse],
+					];
+					frm.set_query("from_warehouse", function () {
+						return {
+							filters: filters,
+						};
+					});
+					frm.set_query("s_warehouse", "items", function () {
+						return {
+							filters: filters,
+						};
+					});
 				}
 			}
-		});
+		);
 
-		frappe.db.get_value('Stock Settings', {name: 'Stock Settings'}, 'sample_retention_warehouse', (r) => {
-			if (r.sample_retention_warehouse) {
-				let filters = [
-							["Warehouse", 'company', '=', frm.doc.company],
-							["Warehouse", "is_group", "=",0],
-							['Warehouse', 'name', '!=', r.sample_retention_warehouse]
-						]
-				frm.set_query("from_warehouse", function() {
-					return {
-						filters: filters
-					};
-				});
-				frm.set_query("s_warehouse", "items", function() {
-					return {
-						filters: filters
-					};
-				});
-			}
-		});
-
-		frm.set_query('batch_no', 'items', function(doc, cdt, cdn) {
+		frm.set_query("batch_no", "items", function (doc, cdt, cdn) {
 			let item = locals[cdt][cdn];
 			let filters = {};
 
-			if(!item.item_code) {
+			if (!item.item_code) {
 				frappe.throw(__("Please enter Item Code to get Batch Number"));
 			} else {
-				if (in_list(["Material Transfer for Manufacture", "Manufacture", "Repack", "Send to Subcontractor"], doc.purpose)) {
+				if (
+					in_list(
+						[
+							"Material Transfer for Manufacture",
+							"Manufacture",
+							"Repack",
+							"Send to Subcontractor",
+						],
+						doc.purpose
+					)
+				) {
 					filters = {
-						'item_code': item.item_code,
-						'posting_date': frm.doc.posting_date || frappe.datetime.nowdate()
-					}
+						item_code: item.item_code,
+						posting_date: frm.doc.posting_date || frappe.datetime.nowdate(),
+					};
 				} else {
 					filters = {
-						'item_code': item.item_code
-					}
+						item_code: item.item_code,
+					};
 				}
 
 				// User could want to select a manually created empty batch (no warehouse)
@@ -99,9 +114,9 @@
 				}
 
 				return {
-					query : "erpnext.controllers.queries.get_batch_no",
-					filters: filters
-				}
+					query: "erpnext.controllers.queries.get_batch_no",
+					filters: filters,
+				};
 			}
 		});
 
@@ -109,119 +124,125 @@
 			let row = locals[cdt][cdn];
 			return {
 				filters: {
-					'item_code': row.item_code,
-					'voucher_type': doc.doctype,
-					'voucher_no': ["in", [doc.name, ""]],
-					'is_cancelled': 0,
-				}
-			}
+					item_code: row.item_code,
+					voucher_type: doc.doctype,
+					voucher_no: ["in", [doc.name, ""]],
+					is_cancelled: 0,
+				},
+			};
 		});
 
-
 		frm.add_fetch("bom_no", "inspection_required", "inspection_required");
 		erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
 
-		frappe.db.get_single_value('Stock Settings', 'disable_serial_no_and_batch_selector')
-		.then((value) => {
+		frappe.db.get_single_value("Stock Settings", "disable_serial_no_and_batch_selector").then((value) => {
 			if (value) {
 				frappe.flags.hide_serial_batch_dialog = true;
 			}
 		});
 		attach_bom_items(frm.doc.bom_no);
 
-		if(!check_should_not_attach_bom_items(frm.doc.bom_no)) {
+		if (!check_should_not_attach_bom_items(frm.doc.bom_no)) {
 			erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
 		}
 	},
 
-	setup_quality_inspection: function(frm) {
+	setup_quality_inspection: function (frm) {
 		if (!frm.doc.inspection_required) {
 			return;
 		}
 
 		if (!frm.is_new() && frm.doc.docstatus === 0) {
-			frm.add_custom_button(__("Quality Inspection(s)"), () => {
-				let transaction_controller = new erpnext.TransactionController({ frm: frm });
-				transaction_controller.make_quality_inspection();
-			}, __("Create"));
-			frm.page.set_inner_btn_group_as_primary(__('Create'));
+			frm.add_custom_button(
+				__("Quality Inspection(s)"),
+				() => {
+					let transaction_controller = new erpnext.TransactionController({ frm: frm });
+					transaction_controller.make_quality_inspection();
+				},
+				__("Create")
+			);
+			frm.page.set_inner_btn_group_as_primary(__("Create"));
 		}
 
 		let quality_inspection_field = frm.get_docfield("items", "quality_inspection");
-		quality_inspection_field.get_route_options_for_new_doc = function(row) {
+		quality_inspection_field.get_route_options_for_new_doc = function (row) {
 			if (frm.is_new()) return {};
 			return {
-				"inspection_type": "Incoming",
-				"reference_type": frm.doc.doctype,
-				"reference_name": frm.doc.name,
-				"item_code": row.doc.item_code,
-				"description": row.doc.description,
-				"item_serial_no": row.doc.serial_no ? row.doc.serial_no.split("\n")[0] : null,
-				"batch_no": row.doc.batch_no
-			}
-		}
+				inspection_type: "Incoming",
+				reference_type: frm.doc.doctype,
+				reference_name: frm.doc.name,
+				item_code: row.doc.item_code,
+				description: row.doc.description,
+				item_serial_no: row.doc.serial_no ? row.doc.serial_no.split("\n")[0] : null,
+				batch_no: row.doc.batch_no,
+			};
+		};
 
-		frm.set_query("quality_inspection", "items", function(doc, cdt, cdn) {
+		frm.set_query("quality_inspection", "items", function (doc, cdt, cdn) {
 			var d = locals[cdt][cdn];
 
 			return {
-				query:"erpnext.stock.doctype.quality_inspection.quality_inspection.quality_inspection_query",
+				query: "erpnext.stock.doctype.quality_inspection.quality_inspection.quality_inspection_query",
 				filters: {
-					'item_code': d.item_code,
-					'reference_name': doc.name
-				}
-			}
+					item_code: d.item_code,
+					reference_name: doc.name,
+				},
+			};
 		});
 	},
 
-	outgoing_stock_entry: function(frm) {
+	outgoing_stock_entry: function (frm) {
 		frappe.call({
 			doc: frm.doc,
 			method: "set_items_for_stock_in",
-			callback: function() {
-				refresh_field('items');
-			}
+			callback: function () {
+				refresh_field("items");
+			},
 		});
 	},
 
-	refresh: function(frm) {
+	refresh: function (frm) {
 		frm.trigger("get_items_from_transit_entry");
 
-		if(!frm.doc.docstatus) {
-			frm.trigger('validate_purpose_consumption');
-			frm.add_custom_button(__('Material Request'), function() {
-				frappe.model.with_doctype('Material Request', function() {
-					var mr = frappe.model.get_new_doc('Material Request');
-					var items = frm.get_field('items').grid.get_selected_children();
-					if(!items.length) {
-						items = frm.doc.items;
-					}
+		if (!frm.doc.docstatus) {
+			frm.trigger("validate_purpose_consumption");
+			frm.add_custom_button(
+				__("Material Request"),
+				function () {
+					frappe.model.with_doctype("Material Request", function () {
+						var mr = frappe.model.get_new_doc("Material Request");
+						var items = frm.get_field("items").grid.get_selected_children();
+						if (!items.length) {
+							items = frm.doc.items;
+						}
 
-					mr.work_order = frm.doc.work_order;
-					items.forEach(function(item) {
-						var mr_item = frappe.model.add_child(mr, 'items');
-						mr_item.item_code = item.item_code;
-						mr_item.item_name = item.item_name;
-						mr_item.uom = item.uom;
-						mr_item.stock_uom = item.stock_uom;
-						mr_item.conversion_factor = item.conversion_factor;
-						mr_item.item_group = item.item_group;
-						mr_item.description = item.description;
-						mr_item.image = item.image;
-						mr_item.qty = item.qty;
-						mr_item.warehouse = item.s_warehouse;
-						mr_item.required_date = frappe.datetime.nowdate();
+						mr.work_order = frm.doc.work_order;
+						items.forEach(function (item) {
+							var mr_item = frappe.model.add_child(mr, "items");
+							mr_item.item_code = item.item_code;
+							mr_item.item_name = item.item_name;
+							mr_item.uom = item.uom;
+							mr_item.stock_uom = item.stock_uom;
+							mr_item.conversion_factor = item.conversion_factor;
+							mr_item.item_group = item.item_group;
+							mr_item.description = item.description;
+							mr_item.image = item.image;
+							mr_item.qty = item.qty;
+							mr_item.warehouse = item.s_warehouse;
+							mr_item.required_date = frappe.datetime.nowdate();
+						});
+						frappe.set_route("Form", "Material Request", mr.name);
 					});
-					frappe.set_route('Form', 'Material Request', mr.name);
-				});
-			}, __("Create"));
+				},
+				__("Create")
+			);
 		}
 
-		if(frm.doc.items) {
-			const has_alternative = frm.doc.items.find(i => i.allow_alternative_item === 1);
+		if (frm.doc.items) {
+			const has_alternative = frm.doc.items.find((i) => i.allow_alternative_item === 1);
 
 			if (frm.doc.docstatus == 0 && has_alternative) {
-				frm.add_custom_button(__('Alternate Item'), () => {
+				frm.add_custom_button(__("Alternate Item"), () => {
 					erpnext.utils.select_alternate_items({
 						frm: frm,
 						child_docname: "items",
@@ -229,111 +250,139 @@
 						child_doctype: "Stock Entry Detail",
 						original_item_field: "original_item",
 						condition: (d) => {
-							if (d.s_warehouse && d.allow_alternative_item) {return true;}
-						}
-					})
+							if (d.s_warehouse && d.allow_alternative_item) {
+								return true;
+							}
+						},
+					});
 				});
 			}
 		}
 
 		if (frm.doc.docstatus === 1) {
-			if (frm.doc.add_to_transit && frm.doc.purpose=='Material Transfer' && frm.doc.per_transferred < 100) {
-				frm.add_custom_button(__('End Transit'), function() {
+			if (
+				frm.doc.add_to_transit &&
+				frm.doc.purpose == "Material Transfer" &&
+				frm.doc.per_transferred < 100
+			) {
+				frm.add_custom_button(__("End Transit"), function () {
 					frappe.model.open_mapped_doc({
 						method: "erpnext.stock.doctype.stock_entry.stock_entry.make_stock_in_entry",
-						frm: frm
-					})
+						frm: frm,
+					});
 				});
 			}
 
 			if (frm.doc.per_transferred > 0) {
-				frm.add_custom_button(__('Received Stock Entries'), function() {
-					frappe.route_options = {
-						'outgoing_stock_entry': frm.doc.name,
-						'docstatus': ['!=', 2]
-					};
+				frm.add_custom_button(
+					__("Received Stock Entries"),
+					function () {
+						frappe.route_options = {
+							outgoing_stock_entry: frm.doc.name,
+							docstatus: ["!=", 2],
+						};
 
-					frappe.set_route('List', 'Stock Entry');
-				}, __("View"));
+						frappe.set_route("List", "Stock Entry");
+					},
+					__("View")
+				);
 			}
 		}
 
 		if (frm.doc.docstatus === 0) {
-			frm.add_custom_button(__('Purchase Invoice'), function() {
-				erpnext.utils.map_current_doc({
-					method: "erpnext.accounts.doctype.purchase_invoice.purchase_invoice.make_stock_entry",
-					source_doctype: "Purchase Invoice",
-					target: frm,
-					date_field: "posting_date",
-					setters: {
-						supplier: frm.doc.supplier || undefined,
-					},
-					get_query_filters: {
-						docstatus: 1
-					}
-				})
-			}, __("Get Items From"));
-
-			frm.add_custom_button(__('Material Request'), function() {
-				const allowed_request_types = ["Material Transfer", "Material Issue", "Customer Provided"];
-				const depends_on_condition = "eval:doc.material_request_type==='Customer Provided'";
-				const d = erpnext.utils.map_current_doc({
-					method: "erpnext.stock.doctype.material_request.material_request.make_stock_entry",
-					source_doctype: "Material Request",
-					target: frm,
-					date_field: "schedule_date",
-					setters: [{
-						fieldtype: 'Select',
-						label: __('Purpose'),
-						options: allowed_request_types.join("\n"),
-						fieldname: 'material_request_type',
-						default: "Material Transfer",
-						mandatory: 1,
-						change() {
-							if (this.value === 'Customer Provided') {
-								d.dialog.get_field("customer").set_focus();
-							}
+			frm.add_custom_button(
+				__("Purchase Invoice"),
+				function () {
+					erpnext.utils.map_current_doc({
+						method: "erpnext.accounts.doctype.purchase_invoice.purchase_invoice.make_stock_entry",
+						source_doctype: "Purchase Invoice",
+						target: frm,
+						date_field: "posting_date",
+						setters: {
+							supplier: frm.doc.supplier || undefined,
 						},
-					},
-					{
-						fieldtype: 'Link',
-						label: __('Customer'),
-						options: 'Customer',
-						fieldname: 'customer',
-						depends_on: depends_on_condition,
-						mandatory_depends_on: depends_on_condition,
-					}],
-					get_query_filters: {
-						docstatus: 1,
-						material_request_type: ["in", allowed_request_types],
-						status: ["not in", ["Transferred", "Issued", "Cancelled", "Stopped"]]
-					}
-				})
-			}, __("Get Items From"));
+						get_query_filters: {
+							docstatus: 1,
+						},
+					});
+				},
+				__("Get Items From")
+			);
+
+			frm.add_custom_button(
+				__("Material Request"),
+				function () {
+					const allowed_request_types = [
+						"Material Transfer",
+						"Material Issue",
+						"Customer Provided",
+					];
+					const depends_on_condition = "eval:doc.material_request_type==='Customer Provided'";
+					const d = erpnext.utils.map_current_doc({
+						method: "erpnext.stock.doctype.material_request.material_request.make_stock_entry",
+						source_doctype: "Material Request",
+						target: frm,
+						date_field: "schedule_date",
+						setters: [
+							{
+								fieldtype: "Select",
+								label: __("Purpose"),
+								options: allowed_request_types.join("\n"),
+								fieldname: "material_request_type",
+								default: "Material Transfer",
+								mandatory: 1,
+								change() {
+									if (this.value === "Customer Provided") {
+										d.dialog.get_field("customer").set_focus();
+									}
+								},
+							},
+							{
+								fieldtype: "Link",
+								label: __("Customer"),
+								options: "Customer",
+								fieldname: "customer",
+								depends_on: depends_on_condition,
+								mandatory_depends_on: depends_on_condition,
+							},
+						],
+						get_query_filters: {
+							docstatus: 1,
+							material_request_type: ["in", allowed_request_types],
+							status: ["not in", ["Transferred", "Issued", "Cancelled", "Stopped"]],
+						},
+					});
+				},
+				__("Get Items From")
+			);
 		}
 
 		if (frm.doc.docstatus === 0 && frm.doc.purpose == "Material Issue") {
-			frm.add_custom_button(__('Expired Batches'), function() {
-				frappe.call({
-					method: "erpnext.stock.doctype.stock_entry.stock_entry.get_expired_batch_items",
-					callback: function(r) {
-						if (!r.exc && r.message) {
-							frm.set_value("items", []);
-							r.message.forEach(function(element) {
-								let d = frm.add_child("items");
-								d.item_code = element.item;
-								d.s_warehouse = element.warehouse;
-								d.qty = element.qty;
-								d.uom = element.stock_uom;
-								d.conversion_factor = 1;
-								d.batch_no = element.batch_no;
-								d.transfer_qty = element.qty;
-								frm.refresh_fields();
-							});
-						}
-					}
-				});
-			}, __("Get Items From"));
+			frm.add_custom_button(
+				__("Expired Batches"),
+				function () {
+					frappe.call({
+						method: "erpnext.stock.doctype.stock_entry.stock_entry.get_expired_batch_items",
+						callback: function (r) {
+							if (!r.exc && r.message) {
+								frm.set_value("items", []);
+								r.message.forEach(function (element) {
+									let d = frm.add_child("items");
+									d.item_code = element.item;
+									d.s_warehouse = element.warehouse;
+									d.qty = element.qty;
+									d.uom = element.stock_uom;
+									d.conversion_factor = 1;
+									d.batch_no = element.batch_no;
+									d.transfer_qty = element.qty;
+									frm.refresh_fields();
+								});
+							}
+						},
+					});
+				},
+				__("Get Items From")
+			);
 		}
 
 		frm.events.show_bom_custom_button(frm);
@@ -342,8 +391,12 @@
 			frm.trigger("toggle_display_account_head");
 		}
 
-		if(frm.doc.docstatus==1 && frm.doc.purpose == "Material Receipt" && frm.get_sum('items', 			'sample_quantity')) {
-			frm.add_custom_button(__('Create Sample Retention Stock Entry'), function () {
+		if (
+			frm.doc.docstatus == 1 &&
+			frm.doc.purpose == "Material Receipt" &&
+			frm.get_sum("items", "sample_quantity")
+		) {
+			frm.add_custom_button(__("Create Sample Retention Stock Entry"), function () {
 				frm.trigger("make_retention_stock_entry");
 			});
 		}
@@ -351,81 +404,88 @@
 		frm.trigger("setup_quality_inspection");
 		attach_bom_items(frm.doc.bom_no);
 
-		if(!check_should_not_attach_bom_items(frm.doc.bom_no)) {
+		if (!check_should_not_attach_bom_items(frm.doc.bom_no)) {
 			erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
 		}
 
-		let sbb_field = frm.get_docfield('items', 'serial_and_batch_bundle');
+		let sbb_field = frm.get_docfield("items", "serial_and_batch_bundle");
 		if (sbb_field) {
 			sbb_field.get_route_options_for_new_doc = (row) => {
 				return {
-					'item_code': row.doc.item_code,
-					'voucher_type': frm.doc.doctype,
-				}
+					item_code: row.doc.item_code,
+					voucher_type: frm.doc.doctype,
+				};
 			};
 		}
 	},
 
-	get_items_from_transit_entry: function(frm) {
-		if (frm.doc.docstatus===0) {
-			frm.add_custom_button(__('Transit Entry'), function() {
-				erpnext.utils.map_current_doc({
-					method: "erpnext.stock.doctype.stock_entry.stock_entry.make_stock_in_entry",
-					source_doctype: "Stock Entry",
-					target: frm,
-					date_field: "posting_date",
-					setters: {
-						stock_entry_type: "Material Transfer",
-						purpose: "Material Transfer",
-					},
-					get_query_filters: {
-						docstatus: 1,
-						purpose: "Material Transfer",
-						add_to_transit: 1,
-					}
-				})
-			}, __("Get Items From"));
+	get_items_from_transit_entry: function (frm) {
+		if (frm.doc.docstatus === 0) {
+			frm.add_custom_button(
+				__("Transit Entry"),
+				function () {
+					erpnext.utils.map_current_doc({
+						method: "erpnext.stock.doctype.stock_entry.stock_entry.make_stock_in_entry",
+						source_doctype: "Stock Entry",
+						target: frm,
+						date_field: "posting_date",
+						setters: {
+							stock_entry_type: "Material Transfer",
+							purpose: "Material Transfer",
+						},
+						get_query_filters: {
+							docstatus: 1,
+							purpose: "Material Transfer",
+							add_to_transit: 1,
+						},
+					});
+				},
+				__("Get Items From")
+			);
 		}
 	},
 
-	before_save: function(frm) {
+	before_save: function (frm) {
 		frm.doc.items.forEach((item) => {
 			item.uom = item.uom || item.stock_uom;
-		})
+		});
 	},
 
-	stock_entry_type: function(frm){
-		frm.remove_custom_button('Bill of Materials', "Get Items From");
+	stock_entry_type: function (frm) {
+		frm.remove_custom_button("Bill of Materials", "Get Items From");
 		frm.events.show_bom_custom_button(frm);
-		frm.trigger('add_to_transit');
+		frm.trigger("add_to_transit");
 
 		frm.fields_dict.items.grid.update_docfield_property(
-			'basic_rate', 'read_only', frm.doc.purpose == "Material Receipt" ? 0 : 1
+			"basic_rate",
+			"read_only",
+			frm.doc.purpose == "Material Receipt" ? 0 : 1
 		);
 	},
 
-	purpose: function(frm) {
-		frm.trigger('validate_purpose_consumption');
+	purpose: function (frm) {
+		frm.trigger("validate_purpose_consumption");
 		frm.fields_dict.items.grid.refresh();
 		frm.cscript.toggle_related_fields(frm.doc);
 	},
 
-	validate_purpose_consumption: function(frm) {
-		frappe.call({
-			method: "erpnext.manufacturing.doctype.manufacturing_settings.manufacturing_settings.is_material_consumption_enabled",
-		}).then(r => {
-			if (cint(r.message) == 0
-				&& frm.doc.purpose=="Material Consumption for Manufacture") {
-				frm.set_value("purpose", 'Manufacture');
-				frappe.throw(__('Material Consumption is not set in Manufacturing Settings.'));
-			}
-		});
+	validate_purpose_consumption: function (frm) {
+		frappe
+			.call({
+				method: "erpnext.manufacturing.doctype.manufacturing_settings.manufacturing_settings.is_material_consumption_enabled",
+			})
+			.then((r) => {
+				if (cint(r.message) == 0 && frm.doc.purpose == "Material Consumption for Manufacture") {
+					frm.set_value("purpose", "Manufacture");
+					frappe.throw(__("Material Consumption is not set in Manufacturing Settings."));
+				}
+			});
 	},
 
-	company: function(frm) {
-		if(frm.doc.company) {
+	company: function (frm) {
+		if (frm.doc.company) {
 			var company_doc = frappe.get_doc(":Company", frm.doc.company);
-			if(company_doc.default_letter_head) {
+			if (company_doc.default_letter_head) {
 				frm.set_value("letter_head", company_doc.default_letter_head);
 			}
 			frm.trigger("toggle_display_account_head");
@@ -434,83 +494,84 @@
 		}
 	},
 
-	make_retention_stock_entry: function(frm) {
+	make_retention_stock_entry: function (frm) {
 		frappe.call({
 			method: "erpnext.stock.doctype.stock_entry.stock_entry.move_sample_to_retention_warehouse",
-			args:{
-				"company": frm.doc.company,
-				"items": frm.doc.items
+			args: {
+				company: frm.doc.company,
+				items: frm.doc.items,
 			},
 			callback: function (r) {
 				if (r.message) {
 					var doc = frappe.model.sync(r.message)[0];
 					frappe.set_route("Form", doc.doctype, doc.name);
+				} else {
+					frappe.msgprint(
+						__("Retention Stock Entry already created or Sample Quantity not provided")
+					);
 				}
-				else {
-					frappe.msgprint(__("Retention Stock Entry already created or Sample Quantity not provided"));
-				}
-			}
+			},
 		});
 	},
 
-	toggle_display_account_head: function(frm) {
+	toggle_display_account_head: function (frm) {
 		var enabled = erpnext.is_perpetual_inventory_enabled(frm.doc.company);
 		frm.fields_dict["items"].grid.set_column_disp(["cost_center", "expense_account"], enabled);
 	},
 
-	set_basic_rate: function(frm, cdt, cdn) {
+	set_basic_rate: function (frm, cdt, cdn) {
 		const item = locals[cdt][cdn];
 		item.transfer_qty = flt(item.qty) * flt(item.conversion_factor);
 
 		const args = {
-			'item_code'			: item.item_code,
-			'posting_date'		: frm.doc.posting_date,
-			'posting_time'		: frm.doc.posting_time,
-			'warehouse'			: cstr(item.s_warehouse) || cstr(item.t_warehouse),
-			'serial_no'			: item.serial_no,
-			'batch_no'          : item.batch_no,
-			'company'			: frm.doc.company,
-			'qty'				: item.s_warehouse ? -1*flt(item.transfer_qty) : flt(item.transfer_qty),
-			'voucher_type'		: frm.doc.doctype,
-			'voucher_no'		: item.name,
-			'allow_zero_valuation': 1,
+			item_code: item.item_code,
+			posting_date: frm.doc.posting_date,
+			posting_time: frm.doc.posting_time,
+			warehouse: cstr(item.s_warehouse) || cstr(item.t_warehouse),
+			serial_no: item.serial_no,
+			batch_no: item.batch_no,
+			company: frm.doc.company,
+			qty: item.s_warehouse ? -1 * flt(item.transfer_qty) : flt(item.transfer_qty),
+			voucher_type: frm.doc.doctype,
+			voucher_no: item.name,
+			allow_zero_valuation: 1,
 		};
 
 		if (item.item_code || item.serial_no) {
 			frappe.call({
 				method: "erpnext.stock.utils.get_incoming_rate",
 				args: {
-					args: args
+					args: args,
 				},
-				callback: function(r) {
-					frappe.model.set_value(cdt, cdn, 'basic_rate', (r.message || 0.0));
+				callback: function (r) {
+					frappe.model.set_value(cdt, cdn, "basic_rate", r.message || 0.0);
 					frm.events.calculate_basic_amount(frm, item);
-				}
+				},
 			});
 		}
 	},
 
-	get_warehouse_details: function(frm, cdt, cdn) {
+	get_warehouse_details: function (frm, cdt, cdn) {
 		var child = locals[cdt][cdn];
-		if(!child.bom_no) {
+		if (!child.bom_no) {
 			frappe.call({
 				method: "erpnext.stock.doctype.stock_entry.stock_entry.get_warehouse_details",
 				args: {
-					"args": {
-						'item_code': child.item_code,
-						'warehouse': cstr(child.s_warehouse) || cstr(child.t_warehouse),
-						'transfer_qty': child.transfer_qty,
-						'serial_and_batch_bundle': child.serial_and_batch_bundle,
-						'qty': child.s_warehouse ? -1* child.transfer_qty : child.transfer_qty,
-						'posting_date': frm.doc.posting_date,
-						'posting_time': frm.doc.posting_time,
-						'company': frm.doc.company,
-						'voucher_type': frm.doc.doctype,
-						'voucher_no': child.name,
-						'allow_zero_valuation': 1
-					}
+					args: {
+						item_code: child.item_code,
+						warehouse: cstr(child.s_warehouse) || cstr(child.t_warehouse),
+						transfer_qty: child.transfer_qty,
+						serial_and_batch_bundle: child.serial_and_batch_bundle,
+						qty: child.s_warehouse ? -1 * child.transfer_qty : child.transfer_qty,
+						posting_date: frm.doc.posting_date,
+						posting_time: frm.doc.posting_time,
+						company: frm.doc.company,
+						voucher_type: frm.doc.doctype,
+						voucher_no: child.name,
+						allow_zero_valuation: 1,
+					},
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (!r.exc) {
 						let fields = ["actual_qty", "basic_rate"];
 						if (frm.doc.purpose == "Material Receipt") {
@@ -518,72 +579,97 @@
 						}
 
 						fields.forEach((field) => {
-							frappe.model.set_value(cdt, cdn, field, (r.message[field] || 0.0));
+							frappe.model.set_value(cdt, cdn, field, r.message[field] || 0.0);
 						});
 						frm.events.calculate_basic_amount(frm, child);
 					}
-				}
+				},
 			});
 		}
 	},
 
-	show_bom_custom_button: function(frm){
-		if (frm.doc.docstatus === 0 &&
-			['Material Issue', 'Material Receipt', 'Material Transfer', 'Send to Subcontractor'].includes(frm.doc.purpose)) {
-			frm.add_custom_button(__('Bill of Materials'), function() {
-				frm.events.get_items_from_bom(frm);
-			}, __("Get Items From"));
+	show_bom_custom_button: function (frm) {
+		if (
+			frm.doc.docstatus === 0 &&
+			["Material Issue", "Material Receipt", "Material Transfer", "Send to Subcontractor"].includes(
+				frm.doc.purpose
+			)
+		) {
+			frm.add_custom_button(
+				__("Bill of Materials"),
+				function () {
+					frm.events.get_items_from_bom(frm);
+				},
+				__("Get Items From")
+			);
 		}
 	},
 
-	get_items_from_bom: function(frm) {
-		let filters = function(){
-			return {filters: { docstatus:1 }};
-		}
+	get_items_from_bom: function (frm) {
+		let filters = function () {
+			return { filters: { docstatus: 1 } };
+		};
 
 		let fields = [
-			{"fieldname":"bom", "fieldtype":"Link", "label":__("BOM"),
-			options:"BOM", reqd: 1, get_query: () => {
-				return {filters: { docstatus:1, "is_active": 1 }};
-			}},
-			{"fieldname":"source_warehouse", "fieldtype":"Link", "label":__("Source Warehouse"),
-			options:"Warehouse"},
-			{"fieldname":"target_warehouse", "fieldtype":"Link", "label":__("Target Warehouse"),
-			options:"Warehouse"},
-			{"fieldname":"qty", "fieldtype":"Float", "label":__("Quantity"),
-			reqd: 1, "default": 1},
-			{"fieldname":"fetch_exploded", "fieldtype":"Check",
-			"label":__("Fetch exploded BOM (including sub-assemblies)"), "default":1},
-			{"fieldname":"fetch", "label":__("Get Items from BOM"), "fieldtype":"Button"}
-		]
+			{
+				fieldname: "bom",
+				fieldtype: "Link",
+				label: __("BOM"),
+				options: "BOM",
+				reqd: 1,
+				get_query: () => {
+					return { filters: { docstatus: 1, is_active: 1 } };
+				},
+			},
+			{
+				fieldname: "source_warehouse",
+				fieldtype: "Link",
+				label: __("Source Warehouse"),
+				options: "Warehouse",
+			},
+			{
+				fieldname: "target_warehouse",
+				fieldtype: "Link",
+				label: __("Target Warehouse"),
+				options: "Warehouse",
+			},
+			{ fieldname: "qty", fieldtype: "Float", label: __("Quantity"), reqd: 1, default: 1 },
+			{
+				fieldname: "fetch_exploded",
+				fieldtype: "Check",
+				label: __("Fetch exploded BOM (including sub-assemblies)"),
+				default: 1,
+			},
+			{ fieldname: "fetch", label: __("Get Items from BOM"), fieldtype: "Button" },
+		];
 
 		// Exclude field 'Target Warehouse' in case of Material Issue
-		if (frm.doc.purpose == 'Material Issue'){
-			fields.splice(2,1);
+		if (frm.doc.purpose == "Material Issue") {
+			fields.splice(2, 1);
 		}
 		// Exclude field 'Source Warehouse' in case of Material Receipt
-		else if(frm.doc.purpose == 'Material Receipt'){
-			fields.splice(1,1);
+		else if (frm.doc.purpose == "Material Receipt") {
+			fields.splice(1, 1);
 		}
 
 		let d = new frappe.ui.Dialog({
 			title: __("Get Items from BOM"),
-			fields: fields
+			fields: fields,
 		});
-		d.get_input("fetch").on("click", function() {
+		d.get_input("fetch").on("click", function () {
 			let values = d.get_values();
-			if(!values) return;
+			if (!values) return;
 			values["company"] = frm.doc.company;
-			if(!frm.doc.company) frappe.throw(__("Company field is required"));
+			if (!frm.doc.company) frappe.throw(__("Company field is required"));
 			frappe.call({
 				method: "erpnext.manufacturing.doctype.bom.bom.get_bom_items",
 				args: values,
-				callback: function(r) {
+				callback: function (r) {
 					if (!r.message) {
 						frappe.throw(__("BOM does not contain any stock item"));
 					} else {
 						erpnext.utils.remove_empty_first_row(frm, "items");
-						$.each(r.message, function(i, item) {
+						$.each(r.message, function (i, item) {
 							let d = frappe.model.add_child(cur_frm.doc, "Stock Entry Detail", "items");
 							d.item_code = item.item_code;
 							d.item_name = item.item_name;
@@ -601,65 +687,74 @@
 					}
 					d.hide();
 					refresh_field("items");
-				}
+				},
 			});
-
 		});
 		d.show();
 	},
 
-	calculate_basic_amount: function(frm, item) {
-		item.basic_amount = flt(flt(item.transfer_qty) * flt(item.basic_rate),
-			precision("basic_amount", item));
+	calculate_basic_amount: function (frm, item) {
+		item.basic_amount = flt(
+			flt(item.transfer_qty) * flt(item.basic_rate),
+			precision("basic_amount", item)
+		);
 		frm.events.calculate_total_additional_costs(frm);
 	},
 
-	calculate_total_additional_costs: function(frm) {
+	calculate_total_additional_costs: function (frm) {
 		const total_additional_costs = frappe.utils.sum(
-			(frm.doc.additional_costs || []).map(function(c) { return flt(c.base_amount); })
+			(frm.doc.additional_costs || []).map(function (c) {
+				return flt(c.base_amount);
+			})
 		);
 
-		frm.set_value("total_additional_costs",
-			flt(total_additional_costs, precision("total_additional_costs")));
+		frm.set_value(
+			"total_additional_costs",
+			flt(total_additional_costs, precision("total_additional_costs"))
+		);
 	},
 
-	source_warehouse_address: function(frm) {
-		erpnext.utils.get_address_display(frm, 'source_warehouse_address', 'source_address_display', false);
+	source_warehouse_address: function (frm) {
+		erpnext.utils.get_address_display(frm, "source_warehouse_address", "source_address_display", false);
 	},
 
-	target_warehouse_address: function(frm) {
-		erpnext.utils.get_address_display(frm, 'target_warehouse_address', 'target_address_display', false);
+	target_warehouse_address: function (frm) {
+		erpnext.utils.get_address_display(frm, "target_warehouse_address", "target_address_display", false);
 	},
 
-	add_to_transit: function(frm) {
-		if(frm.doc.purpose=='Material Transfer') {
+	add_to_transit: function (frm) {
+		if (frm.doc.purpose == "Material Transfer") {
 			var filters = {
-				'is_group': 0,
-				'company': frm.doc.company
+				is_group: 0,
+				company: frm.doc.company,
+			};
+
+			if (frm.doc.add_to_transit) {
+				filters["warehouse_type"] = "Transit";
+				frm.set_value("to_warehouse", "");
+				frm.trigger("set_transit_warehouse");
 			}
 
-			if(frm.doc.add_to_transit){
-				filters['warehouse_type'] = 'Transit';
-				frm.set_value('to_warehouse', '');
-				frm.trigger('set_transit_warehouse');
-			}
-
-			frm.fields_dict.to_warehouse.get_query = function() {
+			frm.fields_dict.to_warehouse.get_query = function () {
 				return {
-					filters:filters
+					filters: filters,
 				};
 			};
 		}
 	},
 
-	set_transit_warehouse: function(frm) {
-		if(frm.doc.add_to_transit && frm.doc.purpose == 'Material Transfer' && !frm.doc.to_warehouse
-			&& frm.doc.from_warehouse) {
-			let dt = frm.doc.from_warehouse ? 'Warehouse' : 'Company';
+	set_transit_warehouse: function (frm) {
+		if (
+			frm.doc.add_to_transit &&
+			frm.doc.purpose == "Material Transfer" &&
+			!frm.doc.to_warehouse &&
+			frm.doc.from_warehouse
+		) {
+			let dt = frm.doc.from_warehouse ? "Warehouse" : "Company";
 			let dn = frm.doc.from_warehouse ? frm.doc.from_warehouse : frm.doc.company;
-			frappe.db.get_value(dt, dn, 'default_in_transit_warehouse', (r) => {
+			frappe.db.get_value(dt, dn, "default_in_transit_warehouse", (r) => {
 				if (r.default_in_transit_warehouse) {
-					frm.set_value('to_warehouse', r.default_in_transit_warehouse);
+					frm.set_value("to_warehouse", r.default_in_transit_warehouse);
 				}
 			});
 		}
@@ -673,7 +768,7 @@
 		if (frm.doc.purchase_order) {
 			frm.set_value("subcontracting_order", "");
 			erpnext.utils.map_current_doc({
-				method: 'erpnext.stock.doctype.stock_entry.stock_entry.get_items_from_subcontract_order',
+				method: "erpnext.stock.doctype.stock_entry.stock_entry.get_items_from_subcontract_order",
 				source_name: frm.doc.purchase_order,
 				target_doc: frm,
 				freeze: true,
@@ -685,7 +780,7 @@
 		if (frm.doc.subcontracting_order) {
 			frm.set_value("purchase_order", "");
 			erpnext.utils.map_current_doc({
-				method: 'erpnext.stock.doctype.stock_entry.stock_entry.get_items_from_subcontract_order',
+				method: "erpnext.stock.doctype.stock_entry.stock_entry.get_items_from_subcontract_order",
 				source_name: frm.doc.subcontracting_order,
 				target_doc: frm,
 				freeze: true,
@@ -695,20 +790,26 @@
 
 	process_loss_qty(frm) {
 		if (frm.doc.process_loss_qty) {
-			frm.doc.process_loss_percentage = flt(frm.doc.process_loss_qty / frm.doc.fg_completed_qty * 100, precision("process_loss_qty", frm.doc));
+			frm.doc.process_loss_percentage = flt(
+				(frm.doc.process_loss_qty / frm.doc.fg_completed_qty) * 100,
+				precision("process_loss_qty", frm.doc)
+			);
 			refresh_field("process_loss_percentage");
 		}
 	},
 
 	process_loss_percentage(frm) {
 		if (frm.doc.process_loss_percentage) {
-			frm.doc.process_loss_qty = flt((frm.doc.fg_completed_qty * frm.doc.process_loss_percentage) / 100 , precision("process_loss_qty", frm.doc));
+			frm.doc.process_loss_qty = flt(
+				(frm.doc.fg_completed_qty * frm.doc.process_loss_percentage) / 100,
+				precision("process_loss_qty", frm.doc)
+			);
 			refresh_field("process_loss_qty");
 		}
-	}
+	},
 });
 
-frappe.ui.form.on('Stock Entry Detail', {
+frappe.ui.form.on("Stock Entry Detail", {
 	qty(frm, cdt, cdn) {
 		frm.events.set_basic_rate(frm, cdt, cdn);
 	},
@@ -738,50 +839,50 @@
 
 	uom(doc, cdt, cdn) {
 		var d = locals[cdt][cdn];
-		if(d.uom && d.item_code){
+		if (d.uom && d.item_code) {
 			return frappe.call({
 				method: "erpnext.stock.doctype.stock_entry.stock_entry.get_uom_details",
 				args: {
 					item_code: d.item_code,
 					uom: d.uom,
-					qty: d.qty
+					qty: d.qty,
 				},
-				callback: function(r) {
-					if(r.message) {
+				callback: function (r) {
+					if (r.message) {
 						frappe.model.set_value(cdt, cdn, r.message);
 					}
-				}
+				},
 			});
 		}
 	},
 
 	item_code(frm, cdt, cdn) {
 		var d = locals[cdt][cdn];
-		if(d.item_code) {
+		if (d.item_code) {
 			var args = {
-				'item_code'			: d.item_code,
-				'warehouse'			: cstr(d.s_warehouse) || cstr(d.t_warehouse),
-				'transfer_qty'		: d.transfer_qty,
-				'serial_no'		: d.serial_no,
-				'batch_no'      : d.batch_no,
-				'bom_no'		: d.bom_no,
-				'expense_account'	: d.expense_account,
-				'cost_center'		: d.cost_center,
-				'company'		: frm.doc.company,
-				'qty'			: d.qty,
-				'voucher_type'		: frm.doc.doctype,
-				'voucher_no'		: d.name,
-				'allow_zero_valuation': 1,
+				item_code: d.item_code,
+				warehouse: cstr(d.s_warehouse) || cstr(d.t_warehouse),
+				transfer_qty: d.transfer_qty,
+				serial_no: d.serial_no,
+				batch_no: d.batch_no,
+				bom_no: d.bom_no,
+				expense_account: d.expense_account,
+				cost_center: d.cost_center,
+				company: frm.doc.company,
+				qty: d.qty,
+				voucher_type: frm.doc.doctype,
+				voucher_no: d.name,
+				allow_zero_valuation: 1,
 			};
 
 			return frappe.call({
 				doc: frm.doc,
 				method: "get_item_details",
 				args: args,
-				callback: function(r) {
-					if(r.message) {
+				callback: function (r) {
+					if (r.message) {
 						var d = locals[cdt][cdn];
-						$.each(r.message, function(k, v) {
+						$.each(r.message, function (k, v) {
 							if (v) {
 								frappe.model.set_value(cdt, cdn, k, v); // qty and it's subsequent fields weren't triggered
 							}
@@ -793,14 +894,18 @@
 							no_batch_serial_number_value = true;
 						}
 
-						if (no_batch_serial_number_value && !frappe.flags.hide_serial_batch_dialog && !frappe.flags.dialog_set) {
+						if (
+							no_batch_serial_number_value &&
+							!frappe.flags.hide_serial_batch_dialog &&
+							!frappe.flags.dialog_set
+						) {
 							frappe.flags.dialog_set = true;
 							erpnext.stock.select_batch_and_serial_no(frm, d);
 						} else {
 							frappe.flags.dialog_set = false;
 						}
 					}
-				}
+				},
 			});
 		}
 	},
@@ -824,36 +929,35 @@
 	add_serial_batch_bundle(frm, cdt, cdn) {
 		var child = locals[cdt][cdn];
 		erpnext.stock.select_batch_and_serial_no(frm, child);
-	}
+	},
 });
 
-var validate_sample_quantity = function(frm, cdt, cdn) {
+var validate_sample_quantity = function (frm, cdt, cdn) {
 	var d = locals[cdt][cdn];
 	if (d.sample_quantity && frm.doc.purpose == "Material Receipt") {
 		frappe.call({
-			method: 'erpnext.stock.doctype.stock_entry.stock_entry.validate_sample_quantity',
+			method: "erpnext.stock.doctype.stock_entry.stock_entry.validate_sample_quantity",
 			args: {
 				batch_no: d.batch_no,
 				item_code: d.item_code,
 				sample_quantity: d.sample_quantity,
-				qty: d.transfer_qty
+				qty: d.transfer_qty,
 			},
 			callback: (r) => {
 				frappe.model.set_value(cdt, cdn, "sample_quantity", r.message);
-			}
+			},
 		});
 	}
 };
 
-frappe.ui.form.on('Landed Cost Taxes and Charges', {
-	amount: function(frm, cdt, cdn) {
+frappe.ui.form.on("Landed Cost Taxes and Charges", {
+	amount: function (frm, cdt, cdn) {
 		frm.events.set_base_amount(frm, cdt, cdn);
-
 	},
 
-	expense_account: function(frm, cdt, cdn) {
+	expense_account: function (frm, cdt, cdn) {
 		frm.events.set_account_currency(frm, cdt, cdn);
-	}
+	},
 });
 
 erpnext.stock.StockEntry = class StockEntry extends erpnext.stock.StockController {
@@ -862,69 +966,68 @@
 
 		this.setup_posting_date_time_check();
 
-		this.frm.fields_dict.bom_no.get_query = function() {
+		this.frm.fields_dict.bom_no.get_query = function () {
 			return {
-				filters:{
-					"docstatus": 1,
-					"is_active": 1
-				}
+				filters: {
+					docstatus: 1,
+					is_active: 1,
+				},
 			};
 		};
 
-		this.frm.fields_dict.items.grid.get_field('item_code').get_query = function() {
-			return erpnext.queries.item({is_stock_item: 1});
+		this.frm.fields_dict.items.grid.get_field("item_code").get_query = function () {
+			return erpnext.queries.item({ is_stock_item: 1 });
 		};
 
-		this.frm.set_query("purchase_order", function() {
+		this.frm.set_query("purchase_order", function () {
 			return {
-				"filters": {
-					"docstatus": 1,
-					"is_old_subcontracting_flow": 1,
-					"company": me.frm.doc.company
-				}
+				filters: {
+					docstatus: 1,
+					is_old_subcontracting_flow: 1,
+					company: me.frm.doc.company,
+				},
 			};
 		});
 
-		this.frm.set_query("subcontracting_order", function() {
+		this.frm.set_query("subcontracting_order", function () {
 			return {
-				"filters": {
-					"docstatus": 1,
-					"company": me.frm.doc.company,
-					"status": ["not in", ["Completed", "Closed"]]
-				}
+				filters: {
+					docstatus: 1,
+					company: me.frm.doc.company,
+					status: ["not in", ["Completed", "Closed"]],
+				},
 			};
 		});
 
-		if(me.frm.doc.company && erpnext.is_perpetual_inventory_enabled(me.frm.doc.company)) {
+		if (me.frm.doc.company && erpnext.is_perpetual_inventory_enabled(me.frm.doc.company)) {
 			this.frm.add_fetch("company", "stock_adjustment_account", "expense_account");
 		}
 
-		this.frm.fields_dict.items.grid.get_field('expense_account').get_query = function() {
+		this.frm.fields_dict.items.grid.get_field("expense_account").get_query = function () {
 			if (erpnext.is_perpetual_inventory_enabled(me.frm.doc.company)) {
 				return {
 					filters: {
-						"company": me.frm.doc.company,
-						"is_group": 0
-					}
-				}
+						company: me.frm.doc.company,
+						is_group: 0,
+					},
+				};
 			}
-		}
+		};
 
 		if (me.frm.doc.purchase_order) {
 			this.frm.add_fetch("purchase_order", "supplier", "supplier");
-		}
-		else {
+		} else {
 			this.frm.add_fetch("subcontracting_order", "supplier", "supplier");
 		}
 
-		frappe.dynamic_link = { doc: this.frm.doc, fieldname: 'supplier', doctype: 'Supplier' }
-		this.frm.set_query("supplier_address", erpnext.queries.address_query)
+		frappe.dynamic_link = { doc: this.frm.doc, fieldname: "supplier", doctype: "Supplier" };
+		this.frm.set_query("supplier_address", erpnext.queries.address_query);
 	}
 
 	onload_post_render() {
 		var me = this;
-		this.set_default_account(function() {
-			if(me.frm.doc.__islocal && me.frm.doc.company && !me.frm.doc.amended_from) {
+		this.set_default_account(function () {
+			if (me.frm.doc.__islocal && me.frm.doc.company && !me.frm.doc.amended_from) {
 				me.frm.trigger("company");
 			}
 		});
@@ -940,7 +1043,7 @@
 		this.show_stock_ledger();
 		this.set_fields_onload_for_line_item();
 		erpnext.utils.view_serial_batch_nos(this.frm);
-		if (this.frm.doc.docstatus===1 && erpnext.is_perpetual_inventory_enabled(this.frm.doc.company)) {
+		if (this.frm.doc.docstatus === 1 && erpnext.is_perpetual_inventory_enabled(this.frm.doc.company)) {
 			this.show_general_ledger();
 		}
 		erpnext.hide_company(this.frm);
@@ -952,7 +1055,7 @@
 
 		if (item?.serial_no) {
 			// Replace all occurences of comma with line feed
-			item.serial_no = item.serial_no.replace(/,/g, '\n');
+			item.serial_no = item.serial_no.replace(/,/g, "\n");
 			item.conversion_factor = item.conversion_factor || 1;
 
 			let valid_serial_nos = [];
@@ -962,23 +1065,30 @@
 					valid_serial_nos.push(serialnos[i]);
 				}
 			}
-			frappe.model.set_value(item.doctype, item.name,
-				"qty", valid_serial_nos.length / item.conversion_factor);
+			frappe.model.set_value(
+				item.doctype,
+				item.name,
+				"qty",
+				valid_serial_nos.length / item.conversion_factor
+			);
 		}
 	}
 
 	set_fields_onload_for_line_item() {
-		if (this.frm.is_new() && this.frm.doc?.items
-			&& cint(frappe.user_defaults?.use_serial_batch_fields) === 1) {
-			this.frm.doc.items.forEach(item => {
+		if (
+			this.frm.is_new() &&
+			this.frm.doc?.items &&
+			cint(frappe.user_defaults?.use_serial_batch_fields) === 1
+		) {
+			this.frm.doc.items.forEach((item) => {
 				frappe.model.set_value(item.doctype, item.name, "use_serial_batch_fields", 1);
-			})
+			});
 		}
 	}
 
 	scan_barcode() {
 		frappe.flags.dialog_set = false;
-		const barcode_scanner = new erpnext.utils.BarcodeScanner({frm:this.frm});
+		const barcode_scanner = new erpnext.utils.BarcodeScanner({ frm: this.frm });
 		barcode_scanner.process_scan();
 	}
 
@@ -993,32 +1103,35 @@
 	set_default_account(callback) {
 		var me = this;
 
-		if(this.frm.doc.company && erpnext.is_perpetual_inventory_enabled(this.frm.doc.company)) {
+		if (this.frm.doc.company && erpnext.is_perpetual_inventory_enabled(this.frm.doc.company)) {
 			return this.frm.call({
 				method: "erpnext.accounts.utils.get_company_default",
 				args: {
-					"fieldname": "stock_adjustment_account",
-					"company": this.frm.doc.company
+					fieldname: "stock_adjustment_account",
+					company: this.frm.doc.company,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (!r.exc) {
-						$.each(me.frm.doc.items || [], function(i, d) {
-							if(!d.expense_account) d.expense_account = r.message;
+						$.each(me.frm.doc.items || [], function (i, d) {
+							if (!d.expense_account) d.expense_account = r.message;
 						});
-						if(callback) callback();
+						if (callback) callback();
 					}
-				}
+				},
 			});
 		}
 	}
 
 	clean_up() {
 		// Clear Work Order record from locals, because it is updated via Stock Entry
-		if(this.frm.doc.work_order &&
-			in_list(["Manufacture", "Material Transfer for Manufacture", "Material Consumption for Manufacture"],
-				this.frm.doc.purpose)) {
-			frappe.model.remove_from_locals("Work Order",
-				this.frm.doc.work_order);
+		if (
+			this.frm.doc.work_order &&
+			in_list(
+				["Manufacture", "Material Transfer for Manufacture", "Material Consumption for Manufacture"],
+				this.frm.doc.purpose
+			)
+		) {
+			frappe.model.remove_from_locals("Work Order", this.frm.doc.work_order);
 		}
 	}
 
@@ -1028,22 +1141,22 @@
 
 	get_items() {
 		var me = this;
-		if(!this.frm.doc.fg_completed_qty || !this.frm.doc.bom_no)
+		if (!this.frm.doc.fg_completed_qty || !this.frm.doc.bom_no)
 			frappe.throw(__("BOM and Manufacturing Quantity are required"));
 
-		if(this.frm.doc.work_order || this.frm.doc.bom_no) {
+		if (this.frm.doc.work_order || this.frm.doc.bom_no) {
 			// if work order / bom is mentioned, get items
 			return this.frm.call({
 				doc: me.frm.doc,
 				freeze: true,
 				method: "get_items",
-				callback: function(r) {
-					if(!r.exc) refresh_field("items");
-					if(me.frm.doc.bom_no) {
+				callback: function (r) {
+					if (!r.exc) refresh_field("items");
+					if (me.frm.doc.bom_no) {
 						attach_bom_items(me.frm.doc.bom_no);
 						erpnext.accounts.dimensions.update_dimension(me.frm, me.frm.doctype);
 					}
-				}
+				},
 			});
 		}
 	}
@@ -1051,7 +1164,7 @@
 	work_order() {
 		var me = this;
 		this.toggle_enable_bom();
-		if(!me.frm.doc.work_order || me.frm.doc.job_card) {
+		if (!me.frm.doc.work_order || me.frm.doc.job_card) {
 			return;
 		}
 
@@ -1059,27 +1172,34 @@
 			method: "erpnext.stock.doctype.stock_entry.stock_entry.get_work_order_details",
 			args: {
 				work_order: me.frm.doc.work_order,
-				company: me.frm.doc.company
+				company: me.frm.doc.company,
 			},
-			callback: function(r) {
+			callback: function (r) {
 				if (!r.exc) {
-					$.each(["from_bom", "bom_no", "fg_completed_qty", "use_multi_level_bom"], function(i, field) {
-						me.frm.set_value(field, r.message[field]);
-					})
+					$.each(
+						["from_bom", "bom_no", "fg_completed_qty", "use_multi_level_bom"],
+						function (i, field) {
+							me.frm.set_value(field, r.message[field]);
+						}
+					);
 
 					if (me.frm.doc.purpose == "Material Transfer for Manufacture" && !me.frm.doc.to_warehouse)
 						me.frm.set_value("to_warehouse", r.message["wip_warehouse"]);
 
-
-					if (me.frm.doc.purpose == "Manufacture" || me.frm.doc.purpose == "Material Consumption for Manufacture" ) {
+					if (
+						me.frm.doc.purpose == "Manufacture" ||
+						me.frm.doc.purpose == "Material Consumption for Manufacture"
+					) {
 						if (me.frm.doc.purpose == "Manufacture") {
-							if (!me.frm.doc.to_warehouse) me.frm.set_value("to_warehouse", r.message["fg_warehouse"]);
+							if (!me.frm.doc.to_warehouse)
+								me.frm.set_value("to_warehouse", r.message["fg_warehouse"]);
 						}
-						if (!me.frm.doc.from_warehouse) me.frm.set_value("from_warehouse", r.message["wip_warehouse"]);
+						if (!me.frm.doc.from_warehouse)
+							me.frm.set_value("from_warehouse", r.message["wip_warehouse"]);
 					}
 					me.get_items();
 				}
-			}
+			},
 		});
 	}
 
@@ -1088,13 +1208,17 @@
 	}
 
 	add_excise_button() {
-		if(frappe.boot.sysdefaults.country === "India")
-			this.frm.add_custom_button(__("Excise Invoice"), function() {
-				var excise = frappe.model.make_new_doc_and_get_name('Journal Entry');
-				excise = locals['Journal Entry'][excise];
-				excise.voucher_type = 'Excise Entry';
-				frappe.set_route('Form', 'Journal Entry', excise.name);
-			}, __('Create'));
+		if (frappe.boot.sysdefaults.country === "India")
+			this.frm.add_custom_button(
+				__("Excise Invoice"),
+				function () {
+					var excise = frappe.model.make_new_doc_and_get_name("Journal Entry");
+					excise = locals["Journal Entry"][excise];
+					excise.voucher_type = "Excise Entry";
+					frappe.set_route("Form", "Journal Entry", excise.name);
+				},
+				__("Create")
+			);
 	}
 
 	items_add(doc, cdt, cdn) {
@@ -1104,8 +1228,8 @@
 			this.frm.script_manager.copy_from_first_row("items", row, ["expense_account", "cost_center"]);
 		}
 
-		if(!row.s_warehouse) row.s_warehouse = this.frm.doc.from_warehouse;
-		if(!row.t_warehouse) row.t_warehouse = this.frm.doc.to_warehouse;
+		if (!row.s_warehouse) row.s_warehouse = this.frm.doc.from_warehouse;
+		if (!row.t_warehouse) row.t_warehouse = this.frm.doc.to_warehouse;
 
 		if (cint(frappe.user_defaults?.use_serial_batch_fields)) {
 			frappe.model.set_value(row.doctype, row.name, "use_serial_batch_fields", 1);
@@ -1113,7 +1237,7 @@
 	}
 
 	from_warehouse(doc) {
-		this.frm.trigger('set_transit_warehouse');
+		this.frm.trigger("set_transit_warehouse");
 		this.set_warehouse_in_children(doc.items, "s_warehouse", doc.from_warehouse);
 	}
 
@@ -1131,32 +1255,54 @@
 	}
 
 	toggle_related_fields(doc) {
-		this.frm.toggle_enable("from_warehouse", doc.purpose!='Material Receipt');
-		this.frm.toggle_enable("to_warehouse", doc.purpose!='Material Issue');
+		this.frm.toggle_enable("from_warehouse", doc.purpose != "Material Receipt");
+		this.frm.toggle_enable("to_warehouse", doc.purpose != "Material Issue");
 
-		this.frm.fields_dict["items"].grid.set_column_disp("retain_sample", doc.purpose=='Material Receipt');
-		this.frm.fields_dict["items"].grid.set_column_disp("sample_quantity", doc.purpose=='Material Receipt');
+		this.frm.fields_dict["items"].grid.set_column_disp(
+			"retain_sample",
+			doc.purpose == "Material Receipt"
+		);
+		this.frm.fields_dict["items"].grid.set_column_disp(
+			"sample_quantity",
+			doc.purpose == "Material Receipt"
+		);
 
 		this.frm.cscript.toggle_enable_bom();
 
-		if (doc.purpose == 'Send to Subcontractor') {
-			doc.customer = doc.customer_name = doc.customer_address =
-				doc.delivery_note_no = doc.sales_invoice_no = null;
+		if (doc.purpose == "Send to Subcontractor") {
+			doc.customer =
+				doc.customer_name =
+				doc.customer_address =
+				doc.delivery_note_no =
+				doc.sales_invoice_no =
+					null;
 		} else {
-			doc.customer = doc.customer_name = doc.customer_address =
-				doc.delivery_note_no = doc.sales_invoice_no = doc.supplier =
-				doc.supplier_name = doc.supplier_address = doc.purchase_receipt_no =
-				doc.address_display = null;
+			doc.customer =
+				doc.customer_name =
+				doc.customer_address =
+				doc.delivery_note_no =
+				doc.sales_invoice_no =
+				doc.supplier =
+				doc.supplier_name =
+				doc.supplier_address =
+				doc.purchase_receipt_no =
+				doc.address_display =
+					null;
 		}
-		if(doc.purpose == "Material Receipt") {
+		if (doc.purpose == "Material Receipt") {
 			this.frm.set_value("from_bom", 0);
 		}
 
 		// Addition costs based on purpose
-		this.frm.toggle_display(["additional_costs", "total_additional_costs", "additional_costs_section"],
-			doc.purpose!='Material Issue');
+		this.frm.toggle_display(
+			["additional_costs", "total_additional_costs", "additional_costs_section"],
+			doc.purpose != "Material Issue"
+		);
 
-		this.frm.fields_dict["items"].grid.set_column_disp("additional_cost", doc.purpose!='Material Issue');
+		this.frm.fields_dict["items"].grid.set_column_disp(
+			"additional_cost",
+			doc.purpose != "Material Issue"
+		);
 	}
 
 	supplier(doc) {
@@ -1167,50 +1313,46 @@
 erpnext.stock.select_batch_and_serial_no = (frm, item) => {
 	let path = "assets/erpnext/js/utils/serial_no_batch_selector.js";
 
-	frappe.db.get_value("Item", item.item_code, ["has_batch_no", "has_serial_no"])
-		.then((r) => {
-			if (r.message && (r.message.has_batch_no || r.message.has_serial_no)) {
-				item.has_serial_no = r.message.has_serial_no;
-				item.has_batch_no = r.message.has_batch_no;
-				item.type_of_transaction = item.s_warehouse ? "Outward" : "Inward";
+	frappe.db.get_value("Item", item.item_code, ["has_batch_no", "has_serial_no"]).then((r) => {
+		if (r.message && (r.message.has_batch_no || r.message.has_serial_no)) {
+			item.has_serial_no = r.message.has_serial_no;
+			item.has_batch_no = r.message.has_batch_no;
+			item.type_of_transaction = item.s_warehouse ? "Outward" : "Inward";
 
-				frappe.require(path, function() {
-					new erpnext.SerialBatchPackageSelector(
-						frm, item, (r) => {
-							if (r) {
-								frappe.model.set_value(item.doctype, item.name, {
-									"serial_and_batch_bundle": r.name,
-									"use_serial_batch_fields": 0,
-									"qty": Math.abs(r.total_qty) / flt(item.conversion_factor || 1, precision("conversion_factor", item))
-								});
-							}
-						}
-					);
+			frappe.require(path, function () {
+				new erpnext.SerialBatchPackageSelector(frm, item, (r) => {
+					if (r) {
+						frappe.model.set_value(item.doctype, item.name, {
+							serial_and_batch_bundle: r.name,
+							use_serial_batch_fields: 0,
+							qty:
+								Math.abs(r.total_qty) /
+								flt(item.conversion_factor || 1, precision("conversion_factor", item)),
+						});
+					}
 				});
-			}
-		});
-}
+			});
+		}
+	});
+};
 
 function attach_bom_items(bom_no) {
 	if (!bom_no) {
-		return
+		return;
 	}
 
-	if (check_should_not_attach_bom_items(bom_no)) return
-	frappe.db.get_doc("BOM",bom_no).then(bom => {
-		const {name, items} = bom
-		erpnext.stock.bom = {name, items:{}}
-		items.forEach(item => {
+	if (check_should_not_attach_bom_items(bom_no)) return;
+	frappe.db.get_doc("BOM", bom_no).then((bom) => {
+		const { name, items } = bom;
+		erpnext.stock.bom = { name, items: {} };
+		items.forEach((item) => {
 			erpnext.stock.bom.items[item.item_code] = item;
 		});
 	});
 }
 
 function check_should_not_attach_bom_items(bom_no) {
-  return (
-	bom_no === undefined ||
-	(erpnext.stock.bom && erpnext.stock.bom.name === bom_no)
-  );
+	return bom_no === undefined || (erpnext.stock.bom && erpnext.stock.bom.name === bom_no);
 }
 
-extend_cscript(cur_frm.cscript, new erpnext.stock.StockEntry({frm: cur_frm}));
+extend_cscript(cur_frm.cscript, new erpnext.stock.StockEntry({ frm: cur_frm }));
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry_list.js b/erpnext/stock/doctype/stock_entry/stock_entry_list.js
index af29d49..8a1c808 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry_list.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry_list.js
@@ -1,19 +1,25 @@
-frappe.listview_settings['Stock Entry'] = {
-	add_fields: ["`tabStock Entry`.`from_warehouse`", "`tabStock Entry`.`to_warehouse`",
-		"`tabStock Entry`.`purpose`", "`tabStock Entry`.`work_order`", "`tabStock Entry`.`bom_no`",
-		"`tabStock Entry`.`is_return`"],
+frappe.listview_settings["Stock Entry"] = {
+	add_fields: [
+		"`tabStock Entry`.`from_warehouse`",
+		"`tabStock Entry`.`to_warehouse`",
+		"`tabStock Entry`.`purpose`",
+		"`tabStock Entry`.`work_order`",
+		"`tabStock Entry`.`bom_no`",
+		"`tabStock Entry`.`is_return`",
+	],
 	get_indicator: function (doc) {
-		if(doc.is_return===1 && doc.purpose === "Material Transfer for Manufacture") {
-			return [__("Material Returned from WIP"), "orange",
-				"is_return,=,1|purpose,=,Material Transfer for Manufacture|docstatus,<,2"];
+		if (doc.is_return === 1 && doc.purpose === "Material Transfer for Manufacture") {
+			return [
+				__("Material Returned from WIP"),
+				"orange",
+				"is_return,=,1|purpose,=,Material Transfer for Manufacture|docstatus,<,2",
+			];
 		} else if (doc.docstatus === 0) {
 			return [__("Draft"), "red", "docstatus,=,0"];
-
-		} else if (doc.purpose === 'Send to Warehouse' && doc.per_transferred < 100) {
+		} else if (doc.purpose === "Send to Warehouse" && doc.per_transferred < 100) {
 			// not delivered & overdue
 			return [__("Goods In Transit"), "grey", "per_transferred,<,100"];
-
-		} else if (doc.purpose === 'Send to Warehouse' && doc.per_transferred === 100) {
+		} else if (doc.purpose === "Send to Warehouse" && doc.per_transferred === 100) {
 			return [__("Goods Transferred"), "green", "per_transferred,=,100"];
 		} else if (doc.docstatus === 2) {
 			return [__("Canceled"), "red", "docstatus,=,2"];
@@ -22,21 +28,30 @@
 		}
 	},
 	column_render: {
-		"from_warehouse": function(doc) {
+		from_warehouse: function (doc) {
 			var html = "";
-			if(doc.from_warehouse) {
-				html += '<span class="filterable h6"\
-					data-filter="from_warehouse,=,'+doc.from_warehouse+'">'
-						+doc.from_warehouse+' </span>';
+			if (doc.from_warehouse) {
+				html +=
+					'<span class="filterable h6"\
+					data-filter="from_warehouse,=,' +
+					doc.from_warehouse +
+					'">' +
+					doc.from_warehouse +
+					" </span>";
 			}
 			// if(doc.from_warehouse || doc.to_warehouse) {
 			// 	html += '<i class="fa fa-arrow-right text-muted"></i> ';
 			// }
-			if(doc.to_warehouse) {
-				html += '<span class="filterable h6"\
-				data-filter="to_warehouse,=,'+doc.to_warehouse+'">'+doc.to_warehouse+'</span>';
+			if (doc.to_warehouse) {
+				html +=
+					'<span class="filterable h6"\
+				data-filter="to_warehouse,=,' +
+					doc.to_warehouse +
+					'">' +
+					doc.to_warehouse +
+					"</span>";
 			}
 			return html;
-		}
-	}
+		},
+	},
 };
diff --git a/erpnext/stock/doctype/stock_entry_type/stock_entry_type.js b/erpnext/stock/doctype/stock_entry_type/stock_entry_type.js
index c554278..21e60fb 100644
--- a/erpnext/stock/doctype/stock_entry_type/stock_entry_type.js
+++ b/erpnext/stock/doctype/stock_entry_type/stock_entry_type.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Stock Entry Type', {
+frappe.ui.form.on("Stock Entry Type", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.js b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.js
index 23018aa..7196dc9 100644
--- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.js
+++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.js
@@ -1,8 +1,8 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Stock Ledger Entry', {
-	refresh: function(frm) {
-		frm.page.btn_secondary.hide()
-	}
+frappe.ui.form.on("Stock Ledger Entry", {
+	refresh: function (frm) {
+		frm.page.btn_secondary.hide();
+	},
 });
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
index ba7f9c5..4a85360 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
@@ -6,27 +6,27 @@
 
 frappe.ui.form.on("Stock Reconciliation", {
 	setup(frm) {
-		frm.ignore_doctypes_on_cancel_all = ['Serial and Batch Bundle'];
+		frm.ignore_doctypes_on_cancel_all = ["Serial and Batch Bundle"];
 	},
 
-	onload: function(frm) {
+	onload: function (frm) {
 		frm.add_fetch("item_code", "item_name", "item_name");
 
 		// end of life
-		frm.set_query("item_code", "items", function(doc, cdt, cdn) {
+		frm.set_query("item_code", "items", function (doc, cdt, cdn) {
 			return {
 				query: "erpnext.controllers.queries.item_query",
-				filters:{
-					"is_stock_item": 1
-				}
-			}
+				filters: {
+					is_stock_item: 1,
+				},
+			};
 		});
-		frm.set_query("batch_no", "items", function(doc, cdt, cdn) {
+		frm.set_query("batch_no", "items", function (doc, cdt, cdn) {
 			var item = locals[cdt][cdn];
 			return {
 				filters: {
-					'item': item.item_code
-				}
+					item: item.item_code,
+				},
 			};
 		});
 
@@ -34,27 +34,27 @@
 			let row = locals[cdt][cdn];
 			return {
 				filters: {
-					'item_code': row.item_code,
-					'voucher_type': doc.doctype,
-					'voucher_no': ["in", [doc.name, ""]],
-					'is_cancelled': 0,
-				}
-			}
+					item_code: row.item_code,
+					voucher_type: doc.doctype,
+					voucher_no: ["in", [doc.name, ""]],
+					is_cancelled: 0,
+				},
+			};
 		});
 
-		let sbb_field = frm.get_docfield('items', 'serial_and_batch_bundle');
+		let sbb_field = frm.get_docfield("items", "serial_and_batch_bundle");
 		if (sbb_field) {
 			sbb_field.get_route_options_for_new_doc = (row) => {
 				return {
-					'item_code': row.doc.item_code,
-					'warehouse': row.doc.warehouse,
-					'voucher_type': frm.doc.doctype,
-				}
+					item_code: row.doc.item_code,
+					warehouse: row.doc.warehouse,
+					voucher_type: frm.doc.doctype,
+				};
 			};
 		}
 
 		if (frm.doc.company) {
-			erpnext.queries.setup_queries(frm, "Warehouse", function() {
+			erpnext.queries.setup_queries(frm, "Warehouse", function () {
 				return erpnext.queries.warehouse(frm.doc);
 			});
 		}
@@ -66,57 +66,57 @@
 		erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
 	},
 
-	company: function(frm) {
+	company: function (frm) {
 		frm.trigger("toggle_display_account_head");
 		erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
 	},
 
-	refresh: function(frm) {
-		if(frm.doc.docstatus < 1) {
-			frm.add_custom_button(__("Fetch Items from Warehouse"), function() {
+	refresh: function (frm) {
+		if (frm.doc.docstatus < 1) {
+			frm.add_custom_button(__("Fetch Items from Warehouse"), function () {
 				frm.events.get_items(frm);
 			});
 		}
 
-		if(frm.doc.company) {
+		if (frm.doc.company) {
 			frm.trigger("toggle_display_account_head");
 		}
 	},
 
-	scan_barcode: function(frm) {
-		const barcode_scanner = new erpnext.utils.BarcodeScanner({frm:frm});
+	scan_barcode: function (frm) {
+		const barcode_scanner = new erpnext.utils.BarcodeScanner({ frm: frm });
 		barcode_scanner.process_scan();
 	},
 
-	scan_mode: function(frm) {
+	scan_mode: function (frm) {
 		if (frm.doc.scan_mode) {
 			frappe.show_alert({
 				message: __("Scan mode enabled, existing quantity will not be fetched."),
-				indicator: "green"
+				indicator: "green",
 			});
 		}
 	},
 
-	set_warehouse: function(frm) {
-		let transaction_controller = new erpnext.TransactionController({frm:frm});
+	set_warehouse: function (frm) {
+		let transaction_controller = new erpnext.TransactionController({ frm: frm });
 		transaction_controller.autofill_warehouse(frm.doc.items, "warehouse", frm.doc.set_warehouse);
 	},
 
-	get_items: function(frm) {
+	get_items: function (frm) {
 		let fields = [
 			{
-				label: 'Warehouse',
-				fieldname: 'warehouse',
-				fieldtype: 'Link',
-				options: 'Warehouse',
+				label: "Warehouse",
+				fieldname: "warehouse",
+				fieldtype: "Link",
+				options: "Warehouse",
 				reqd: 1,
-				"get_query": function() {
+				get_query: function () {
 					return {
-						"filters": {
-							"company": frm.doc.company,
-						}
+						filters: {
+							company: frm.doc.company,
+						},
 					};
-				}
+				},
 			},
 			{
 				label: "Item Code",
@@ -127,57 +127,62 @@
 			{
 				label: __("Ignore Empty Stock"),
 				fieldname: "ignore_empty_stock",
-				fieldtype: "Check"
-			}
+				fieldtype: "Check",
+			},
 		];
 
-		frappe.prompt(fields, function(data) {
-			frappe.call({
-				method: "erpnext.stock.doctype.stock_reconciliation.stock_reconciliation.get_items",
-				args: {
-					warehouse: data.warehouse,
-					posting_date: frm.doc.posting_date,
-					posting_time: frm.doc.posting_time,
-					company: frm.doc.company,
-					item_code: data.item_code,
-					ignore_empty_stock: data.ignore_empty_stock
-				},
-				callback: function(r) {
-					if (r.exc || !r.message || !r.message.length) return;
+		frappe.prompt(
+			fields,
+			function (data) {
+				frappe.call({
+					method: "erpnext.stock.doctype.stock_reconciliation.stock_reconciliation.get_items",
+					args: {
+						warehouse: data.warehouse,
+						posting_date: frm.doc.posting_date,
+						posting_time: frm.doc.posting_time,
+						company: frm.doc.company,
+						item_code: data.item_code,
+						ignore_empty_stock: data.ignore_empty_stock,
+					},
+					callback: function (r) {
+						if (r.exc || !r.message || !r.message.length) return;
 
-					frm.clear_table("items");
+						frm.clear_table("items");
 
-					r.message.forEach((row) => {
-						let item = frm.add_child("items");
-						$.extend(item, row);
+						r.message.forEach((row) => {
+							let item = frm.add_child("items");
+							$.extend(item, row);
 
-						item.qty = item.qty || 0;
-						item.valuation_rate = item.valuation_rate || 0;
-					});
-					frm.refresh_field("items");
-				}
-			});
-		}, __("Get Items"), __("Update"));
+							item.qty = item.qty || 0;
+							item.valuation_rate = item.valuation_rate || 0;
+						});
+						frm.refresh_field("items");
+					},
+				});
+			},
+			__("Get Items"),
+			__("Update")
+		);
 	},
 
-	posting_date: function(frm) {
+	posting_date: function (frm) {
 		frm.trigger("set_valuation_rate_and_qty_for_all_items");
 	},
 
-	posting_time: function(frm) {
+	posting_time: function (frm) {
 		frm.trigger("set_valuation_rate_and_qty_for_all_items");
 	},
 
-	set_valuation_rate_and_qty_for_all_items: function(frm) {
-		frm.doc.items.forEach(row => {
+	set_valuation_rate_and_qty_for_all_items: function (frm) {
+		frm.doc.items.forEach((row) => {
 			frm.events.set_valuation_rate_and_qty(frm, row.doctype, row.name);
 		});
 	},
 
-	set_valuation_rate_and_qty: function(frm, cdt, cdn) {
+	set_valuation_rate_and_qty: function (frm, cdt, cdn) {
 		var d = frappe.model.get_doc(cdt, cdn);
 
-		if(d.item_code && d.warehouse) {
+		if (d.item_code && d.warehouse) {
 			frappe.call({
 				method: "erpnext.stock.doctype.stock_reconciliation.stock_reconciliation.get_stock_balance_for",
 				args: {
@@ -185,9 +190,9 @@
 					warehouse: d.warehouse,
 					posting_date: frm.doc.posting_date,
 					posting_time: frm.doc.posting_time,
-					batch_no: d.batch_no
+					batch_no: d.batch_no,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					const row = frappe.model.get_doc(cdt, cdn);
 					if (!frm.doc.scan_mode) {
 						frappe.model.set_value(cdt, cdn, "qty", r.message.qty);
@@ -198,17 +203,22 @@
 					frappe.model.set_value(cdt, cdn, "current_amount", r.message.rate * r.message.qty);
 					frappe.model.set_value(cdt, cdn, "amount", row.qty * row.valuation_rate);
 					frappe.model.set_value(cdt, cdn, "current_serial_no", r.message.serial_nos);
-					frappe.model.set_value(cdt, cdn, "use_serial_batch_fields", r.message.use_serial_batch_fields);
+					frappe.model.set_value(
+						cdt,
+						cdn,
+						"use_serial_batch_fields",
+						r.message.use_serial_batch_fields
+					);
 
 					if (frm.doc.purpose == "Stock Reconciliation" && !frm.doc.scan_mode) {
 						frappe.model.set_value(cdt, cdn, "serial_no", r.message.serial_nos);
 					}
-				}
+				},
 			});
 		}
 	},
 
-	set_amount_quantity: function(doc, cdt, cdn) {
+	set_amount_quantity: function (doc, cdt, cdn) {
 		var d = frappe.model.get_doc(cdt, cdn);
 		if (d.qty && d.valuation_rate) {
 			frappe.model.set_value(cdt, cdn, "amount", flt(d.qty) * flt(d.valuation_rate));
@@ -216,34 +226,35 @@
 			frappe.model.set_value(cdt, cdn, "amount_difference", flt(d.amount) - flt(d.current_amount));
 		}
 	},
-	toggle_display_account_head: function(frm) {
-		frm.toggle_display(['expense_account', 'cost_center'],
-			erpnext.is_perpetual_inventory_enabled(frm.doc.company));
+	toggle_display_account_head: function (frm) {
+		frm.toggle_display(
+			["expense_account", "cost_center"],
+			erpnext.is_perpetual_inventory_enabled(frm.doc.company)
+		);
 	},
-	purpose: function(frm) {
+	purpose: function (frm) {
 		frm.trigger("set_expense_account");
 	},
-	set_expense_account: function(frm) {
+	set_expense_account: function (frm) {
 		if (frm.doc.company && erpnext.is_perpetual_inventory_enabled(frm.doc.company)) {
 			return frm.call({
 				method: "erpnext.stock.doctype.stock_reconciliation.stock_reconciliation.get_difference_account",
 				args: {
-					"purpose": frm.doc.purpose,
-					"company": frm.doc.company
+					purpose: frm.doc.purpose,
+					company: frm.doc.company,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					if (!r.exc) {
 						frm.set_value("expense_account", r.message);
 					}
-				}
+				},
 			});
 		}
-	}
+	},
 });
 
 frappe.ui.form.on("Stock Reconciliation Item", {
-
-	warehouse: function(frm, cdt, cdn) {
+	warehouse: function (frm, cdt, cdn) {
 		var child = locals[cdt][cdn];
 		if (child.batch_no && !frm.doc.scan_mode) {
 			frappe.model.set_value(child.cdt, child.cdn, "batch_no", "");
@@ -252,7 +263,7 @@
 		frm.events.set_valuation_rate_and_qty(frm, cdt, cdn);
 	},
 
-	item_code: function(frm, cdt, cdn) {
+	item_code: function (frm, cdt, cdn) {
 		var child = locals[cdt][cdn];
 		if (child.batch_no && !frm.doc.scan_mode) {
 			frappe.model.set_value(cdt, cdn, "batch_no", "");
@@ -261,28 +272,28 @@
 		frm.events.set_valuation_rate_and_qty(frm, cdt, cdn);
 	},
 
-	batch_no: function(frm, cdt, cdn) {
+	batch_no: function (frm, cdt, cdn) {
 		frm.events.set_valuation_rate_and_qty(frm, cdt, cdn);
 	},
 
-	qty: function(frm, cdt, cdn) {
+	qty: function (frm, cdt, cdn) {
 		frm.events.set_amount_quantity(frm, cdt, cdn);
 	},
 
-	valuation_rate: function(frm, cdt, cdn) {
+	valuation_rate: function (frm, cdt, cdn) {
 		frm.events.set_amount_quantity(frm, cdt, cdn);
 	},
 
-	serial_no: function(frm, cdt, cdn) {
+	serial_no: function (frm, cdt, cdn) {
 		var child = locals[cdt][cdn];
 
 		if (child.serial_no) {
-			const serial_nos = child.serial_no.trim().split('\n');
+			const serial_nos = child.serial_no.trim().split("\n");
 			frappe.model.set_value(cdt, cdn, "qty", serial_nos.length);
 		}
 	},
 
-	items_add: function(frm, cdt, cdn) {
+	items_add: function (frm, cdt, cdn) {
 		var item = frappe.get_doc(cdt, cdn);
 		if (!item.warehouse && frm.doc.set_warehouse) {
 			frappe.model.set_value(cdt, cdn, "warehouse", frm.doc.set_warehouse);
@@ -291,8 +302,7 @@
 
 	add_serial_batch_bundle(frm, cdt, cdn) {
 		erpnext.utils.pick_serial_and_batch_bundle(frm, cdt, cdn, "Inward");
-	}
-
+	},
 });
 
 erpnext.stock.StockReconciliation = class StockReconciliation extends erpnext.stock.StockController {
@@ -304,30 +314,30 @@
 		if (me.frm.doc.company && erpnext.is_perpetual_inventory_enabled(me.frm.doc.company)) {
 			this.frm.add_fetch("company", "cost_center", "cost_center");
 		}
-		this.frm.fields_dict["expense_account"].get_query = function() {
-			if(erpnext.is_perpetual_inventory_enabled(me.frm.doc.company)) {
+		this.frm.fields_dict["expense_account"].get_query = function () {
+			if (erpnext.is_perpetual_inventory_enabled(me.frm.doc.company)) {
 				return {
-					"filters": {
-						'company': me.frm.doc.company,
-						"is_group": 0
-					}
-				}
+					filters: {
+						company: me.frm.doc.company,
+						is_group: 0,
+					},
+				};
 			}
-		}
-		this.frm.fields_dict["cost_center"].get_query = function() {
-			if(erpnext.is_perpetual_inventory_enabled(me.frm.doc.company)) {
+		};
+		this.frm.fields_dict["cost_center"].get_query = function () {
+			if (erpnext.is_perpetual_inventory_enabled(me.frm.doc.company)) {
 				return {
-					"filters": {
-						'company': me.frm.doc.company,
-						"is_group": 0
-					}
-				}
+					filters: {
+						company: me.frm.doc.company,
+						is_group: 0,
+					},
+				};
 			}
-		}
+		};
 	}
 
 	refresh() {
-		if(this.frm.doc.docstatus > 0) {
+		if (this.frm.doc.docstatus > 0) {
 			this.show_stock_ledger();
 			erpnext.utils.view_serial_batch_nos(this.frm);
 			if (erpnext.is_perpetual_inventory_enabled(this.frm.doc.company)) {
@@ -335,7 +345,6 @@
 			}
 		}
 	}
-
 };
 
-cur_frm.cscript = new erpnext.stock.StockReconciliation({frm: cur_frm});
+cur_frm.cscript = new erpnext.stock.StockReconciliation({ frm: cur_frm });
diff --git a/erpnext/stock/doctype/stock_reposting_settings/stock_reposting_settings.js b/erpnext/stock/doctype/stock_reposting_settings/stock_reposting_settings.js
index 5f81679..e8c1437 100644
--- a/erpnext/stock/doctype/stock_reposting_settings/stock_reposting_settings.js
+++ b/erpnext/stock/doctype/stock_reposting_settings/stock_reposting_settings.js
@@ -1,23 +1,23 @@
 // Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Stock Reposting Settings', {
-	refresh: function(frm) {
-		frm.trigger('convert_to_item_based_reposting');
+frappe.ui.form.on("Stock Reposting Settings", {
+	refresh: function (frm) {
+		frm.trigger("convert_to_item_based_reposting");
 	},
 
-	convert_to_item_based_reposting: function(frm) {
-		frm.add_custom_button(__('Convert to Item Based Reposting'), function() {
+	convert_to_item_based_reposting: function (frm) {
+		frm.add_custom_button(__("Convert to Item Based Reposting"), function () {
 			frm.call({
-				method: 'convert_to_item_wh_reposting',
+				method: "convert_to_item_wh_reposting",
 				frezz: true,
 				doc: frm.doc,
-				callback: function(r) {
+				callback: function (r) {
 					if (!r.exc) {
 						frm.reload_doc();
 					}
-				}
-			})
-		})
-	}
+				},
+			});
+		});
+	},
 });
diff --git a/erpnext/stock/doctype/stock_reservation_entry/stock_reservation_entry.js b/erpnext/stock/doctype/stock_reservation_entry/stock_reservation_entry.js
index f60a037..a8d56b4 100644
--- a/erpnext/stock/doctype/stock_reservation_entry/stock_reservation_entry.js
+++ b/erpnext/stock/doctype/stock_reservation_entry/stock_reservation_entry.js
@@ -1,43 +1,43 @@
 // Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Stock Reservation Entry', {
+frappe.ui.form.on("Stock Reservation Entry", {
 	refresh(frm) {
-		frm.trigger('set_queries');
-		frm.trigger('toggle_read_only_fields');
-		frm.trigger('hide_rate_related_fields');
-		frm.trigger('hide_primary_action_button');
-		frm.trigger('make_sb_entries_warehouse_read_only');
+		frm.trigger("set_queries");
+		frm.trigger("toggle_read_only_fields");
+		frm.trigger("hide_rate_related_fields");
+		frm.trigger("hide_primary_action_button");
+		frm.trigger("make_sb_entries_warehouse_read_only");
 	},
 
 	has_serial_no(frm) {
-		frm.trigger('toggle_read_only_fields');
+		frm.trigger("toggle_read_only_fields");
 	},
 
 	has_batch_no(frm) {
-		frm.trigger('toggle_read_only_fields');
+		frm.trigger("toggle_read_only_fields");
 	},
 
 	warehouse(frm) {
 		if (frm.doc.warehouse) {
 			frm.doc.sb_entries.forEach((row) => {
-				frappe.model.set_value(row.doctype, row.name, 'warehouse', frm.doc.warehouse);
+				frappe.model.set_value(row.doctype, row.name, "warehouse", frm.doc.warehouse);
 			});
 		}
 	},
 
 	set_queries(frm) {
-		frm.set_query('warehouse', () => {
+		frm.set_query("warehouse", () => {
 			return {
 				filters: {
-					'is_group': 0,
-					'company': frm.doc.company,
-				}
+					is_group: 0,
+					company: frm.doc.company,
+				},
 			};
 		});
 
-		frm.set_query('serial_no', 'sb_entries', function(doc, cdt, cdn) {
-			var selected_serial_nos = doc.sb_entries.map(row => {
+		frm.set_query("serial_no", "sb_entries", function (doc, cdt, cdn) {
+			var selected_serial_nos = doc.sb_entries.map((row) => {
 				return row.serial_no;
 			});
 			var row = locals[cdt][cdn];
@@ -45,82 +45,86 @@
 				filters: {
 					item_code: doc.item_code,
 					warehouse: row.warehouse,
-					status: 'Active',
-					name: ['not in', selected_serial_nos],
-				}
-			}
+					status: "Active",
+					name: ["not in", selected_serial_nos],
+				},
+			};
 		});
 
-		frm.set_query('batch_no', 'sb_entries', function(doc, cdt, cdn) {
+		frm.set_query("batch_no", "sb_entries", function (doc, cdt, cdn) {
 			let filters = {
 				item: doc.item_code,
-				batch_qty: ['>', 0],
+				batch_qty: [">", 0],
 				disabled: 0,
-			}
+			};
 
 			if (!doc.has_serial_no) {
-				var selected_batch_nos = doc.sb_entries.map(row => {
+				var selected_batch_nos = doc.sb_entries.map((row) => {
 					return row.batch_no;
 				});
 
-				filters.name = ['not in', selected_batch_nos];
+				filters.name = ["not in", selected_batch_nos];
 			}
 
-			return { filters: filters }
+			return { filters: filters };
 		});
 	},
 
 	toggle_read_only_fields(frm) {
 		if (frm.doc.has_serial_no) {
-			frm.doc.sb_entries.forEach(row => {
+			frm.doc.sb_entries.forEach((row) => {
 				if (row.qty !== 1) {
-					frappe.model.set_value(row.doctype, row.name, 'qty', 1);
+					frappe.model.set_value(row.doctype, row.name, "qty", 1);
 				}
-			})
+			});
 		}
 
 		frm.fields_dict.sb_entries.grid.update_docfield_property(
-			'serial_no', 'read_only', !frm.doc.has_serial_no
+			"serial_no",
+			"read_only",
+			!frm.doc.has_serial_no
 		);
 
 		frm.fields_dict.sb_entries.grid.update_docfield_property(
-			'batch_no', 'read_only', !frm.doc.has_batch_no
+			"batch_no",
+			"read_only",
+			!frm.doc.has_batch_no
 		);
 
 		// Qty will always be 1 for Serial No.
-		frm.fields_dict.sb_entries.grid.update_docfield_property(
-			'qty', 'read_only', frm.doc.has_serial_no
-		);
+		frm.fields_dict.sb_entries.grid.update_docfield_property("qty", "read_only", frm.doc.has_serial_no);
 
-		frm.set_df_property('sb_entries', 'allow_on_submit', frm.doc.from_voucher_type == "Pick List" ? 0 : 1);
+		frm.set_df_property(
+			"sb_entries",
+			"allow_on_submit",
+			frm.doc.from_voucher_type == "Pick List" ? 0 : 1
+		);
 	},
 
 	hide_rate_related_fields(frm) {
-		['incoming_rate', 'outgoing_rate', 'stock_value_difference', 'is_outward', 'stock_queue'].forEach(field => {
-			frm.fields_dict.sb_entries.grid.update_docfield_property(
-				field, 'hidden', 1
-			);
-		});
+		["incoming_rate", "outgoing_rate", "stock_value_difference", "is_outward", "stock_queue"].forEach(
+			(field) => {
+				frm.fields_dict.sb_entries.grid.update_docfield_property(field, "hidden", 1);
+			}
+		);
 	},
 
 	hide_primary_action_button(frm) {
 		// Hide 'Amend' button on cancelled document
 		if (frm.doc.docstatus == 2) {
-			frm.page.btn_primary.hide()
+			frm.page.btn_primary.hide();
 		}
 	},
 
 	make_sb_entries_warehouse_read_only(frm) {
-		frm.fields_dict.sb_entries.grid.update_docfield_property(
-			'warehouse', 'read_only', 1
-		);
+		frm.fields_dict.sb_entries.grid.update_docfield_property("warehouse", "read_only", 1);
 	},
 });
 
-frappe.ui.form.on('Serial and Batch Entry', {
+frappe.ui.form.on("Serial and Batch Entry", {
 	sb_entries_add(frm, cdt, cdn) {
 		if (frm.doc.warehouse) {
-			frappe.model.set_value(cdt, cdn, 'warehouse', frm.doc.warehouse);
+			frappe.model.set_value(cdt, cdn, "warehouse", frm.doc.warehouse);
 		}
 	},
-});
\ No newline at end of file
+});
diff --git a/erpnext/stock/doctype/stock_reservation_entry/stock_reservation_entry_list.js b/erpnext/stock/doctype/stock_reservation_entry/stock_reservation_entry_list.js
index 5b390f7..d2194a4 100644
--- a/erpnext/stock/doctype/stock_reservation_entry/stock_reservation_entry_list.js
+++ b/erpnext/stock/doctype/stock_reservation_entry/stock_reservation_entry_list.js
@@ -1,17 +1,17 @@
 // Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.listview_settings['Stock Reservation Entry'] = {
+frappe.listview_settings["Stock Reservation Entry"] = {
 	get_indicator: function (doc) {
 		const status_colors = {
-                  'Draft': 'red',
-                  'Partially Reserved': 'orange',
-                  'Reserved': 'blue',
-                  'Partially Delivered': 'purple',
-                  'Delivered': 'green',
-                  'Cancelled': 'red',
+			Draft: "red",
+			"Partially Reserved": "orange",
+			Reserved: "blue",
+			"Partially Delivered": "purple",
+			Delivered: "green",
+			Cancelled: "red",
 		};
 
-            return [__(doc.status), status_colors[doc.status], 'status,=,' + doc.status];
+		return [__(doc.status), status_colors[doc.status], "status,=," + doc.status];
 	},
-};
\ No newline at end of file
+};
diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.js b/erpnext/stock/doctype/stock_settings/stock_settings.js
index 89ac4b5..1972b19 100644
--- a/erpnext/stock/doctype/stock_settings/stock_settings.js
+++ b/erpnext/stock/doctype/stock_settings/stock_settings.js
@@ -1,29 +1,31 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Stock Settings', {
-	refresh: function(frm) {
-		let filters = function() {
+frappe.ui.form.on("Stock Settings", {
+	refresh: function (frm) {
+		let filters = function () {
 			return {
-				filters : {
-					is_group : 0
-				}
+				filters: {
+					is_group: 0,
+				},
 			};
 		};
 
 		frm.set_query("default_warehouse", filters);
 		frm.set_query("sample_retention_warehouse", filters);
 	},
-	allow_negative_stock: function(frm) {
+	allow_negative_stock: function (frm) {
 		if (!frm.doc.allow_negative_stock) {
 			return;
 		}
 
-		let msg = __("Using negative stock disables FIFO/Moving average valuation when inventory is negative.");
+		let msg = __(
+			"Using negative stock disables FIFO/Moving average valuation when inventory is negative."
+		);
 		msg += " ";
-		msg += __("This is considered dangerous from accounting point of view.")
+		msg += __("This is considered dangerous from accounting point of view.");
 		msg += "<br>";
-		msg += ("Do you still want to enable negative inventory?");
+		msg += "Do you still want to enable negative inventory?";
 
 		frappe.confirm(
 			msg,
@@ -32,5 +34,5 @@
 				frm.set_value("allow_negative_stock", 0);
 			}
 		);
-	}
+	},
 });
diff --git a/erpnext/stock/doctype/uom_category/uom_category.js b/erpnext/stock/doctype/uom_category/uom_category.js
index 48026da..b53190f 100644
--- a/erpnext/stock/doctype/uom_category/uom_category.js
+++ b/erpnext/stock/doctype/uom_category/uom_category.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('UOM Category', {
-	refresh: function() {
-
-	}
+frappe.ui.form.on("UOM Category", {
+	refresh: function () {},
 });
diff --git a/erpnext/stock/doctype/variant_field/variant_field.js b/erpnext/stock/doctype/variant_field/variant_field.js
index 13db3f9..8455d91 100644
--- a/erpnext/stock/doctype/variant_field/variant_field.js
+++ b/erpnext/stock/doctype/variant_field/variant_field.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Variant Field', {
-	refresh: function() {
-
-	}
+frappe.ui.form.on("Variant Field", {
+	refresh: function () {},
 });
diff --git a/erpnext/stock/doctype/warehouse/warehouse.js b/erpnext/stock/doctype/warehouse/warehouse.js
index 3819c0b2..195ecb6 100644
--- a/erpnext/stock/doctype/warehouse/warehouse.js
+++ b/erpnext/stock/doctype/warehouse/warehouse.js
@@ -35,18 +35,15 @@
 
 	refresh: function (frm) {
 		frm.toggle_display("warehouse_name", frm.doc.__islocal);
-		frm.toggle_display(
-			["address_html", "contact_html"],
-			!frm.doc.__islocal
-		);
+		frm.toggle_display(["address_html", "contact_html"], !frm.doc.__islocal);
 
 		if (!frm.is_new()) {
 			frappe.contacts.render_address_and_contact(frm);
 
 			let enable_toggle = frm.doc.disabled ? "Enable" : "Disable";
 			frm.add_custom_button(__(enable_toggle), () => {
-				frm.set_value('disabled', 1 - frm.doc.disabled);
-				frm.save()
+				frm.set_value("disabled", 1 - frm.doc.disabled);
+				frm.save();
 			});
 
 			frm.add_custom_button(__("Stock Balance"), function () {
@@ -61,25 +58,20 @@
 					: __("Convert to Group", null, "Warehouse"),
 				function () {
 					convert_to_group_or_ledger(frm);
-				},
+				}
 			);
-
 		} else {
 			frappe.contacts.clear_address_and_contact(frm);
 		}
 
-
 		if (!frm.doc.is_group && frm.doc.__onload && frm.doc.__onload.account) {
-			frm.add_custom_button(
-				__("General Ledger", null, "Warehouse"),
-				function () {
-					frappe.route_options = {
-						account: frm.doc.__onload.account,
-						company: frm.doc.company,
-					};
-					frappe.set_route("query-report", "General Ledger");
-				}
-			);
+			frm.add_custom_button(__("General Ledger", null, "Warehouse"), function () {
+				frappe.route_options = {
+					account: frm.doc.__onload.account,
+					company: frm.doc.company,
+				};
+				frappe.set_route("query-report", "General Ledger");
+			});
 		}
 
 		frm.toggle_enable(["is_group", "company"], false);
diff --git a/erpnext/stock/doctype/warehouse/warehouse_tree.js b/erpnext/stock/doctype/warehouse/warehouse_tree.js
index eb635e6..d9070b3 100644
--- a/erpnext/stock/doctype/warehouse/warehouse_tree.js
+++ b/erpnext/stock/doctype/warehouse/warehouse_tree.js
@@ -1,20 +1,25 @@
-frappe.treeview_settings['Warehouse'] = {
+frappe.treeview_settings["Warehouse"] = {
 	get_tree_nodes: "erpnext.stock.doctype.warehouse.warehouse.get_children",
 	add_tree_node: "erpnext.stock.doctype.warehouse.warehouse.add_node",
 	get_tree_root: false,
 	root_label: "Warehouses",
-	filters: [{
-		fieldname: "company",
-		fieldtype:"Select",
-		options: erpnext.utils.get_tree_options("company"),
-		label: __("Company"),
-		default: erpnext.utils.get_tree_default("company")
-	}],
-	fields:[
-		{fieldtype:'Data', fieldname: 'warehouse_name',
-			label:__('New Warehouse Name'), reqd:true},
-		{fieldtype:'Check', fieldname:'is_group', label:__('Is Group'),
-			description: __("Child nodes can be only created under 'Group' type nodes")}
+	filters: [
+		{
+			fieldname: "company",
+			fieldtype: "Select",
+			options: erpnext.utils.get_tree_options("company"),
+			label: __("Company"),
+			default: erpnext.utils.get_tree_default("company"),
+		},
 	],
-	ignore_fields:["parent_warehouse"],
-}
+	fields: [
+		{ fieldtype: "Data", fieldname: "warehouse_name", label: __("New Warehouse Name"), reqd: true },
+		{
+			fieldtype: "Check",
+			fieldname: "is_group",
+			label: __("Is Group"),
+			description: __("Child nodes can be only created under 'Group' type nodes"),
+		},
+	],
+	ignore_fields: ["parent_warehouse"],
+};
diff --git a/erpnext/stock/doctype/warehouse_type/warehouse_type.js b/erpnext/stock/doctype/warehouse_type/warehouse_type.js
index 4c4b89c..521b07a 100644
--- a/erpnext/stock/doctype/warehouse_type/warehouse_type.js
+++ b/erpnext/stock/doctype/warehouse_type/warehouse_type.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Warehouse Type', {
+frappe.ui.form.on("Warehouse Type", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/stock/page/stock_balance/stock_balance.js b/erpnext/stock/page/stock_balance/stock_balance.js
index 90b8d45..a5fba9f 100644
--- a/erpnext/stock/page/stock_balance/stock_balance.js
+++ b/erpnext/stock/page/stock_balance/stock_balance.js
@@ -1,103 +1,101 @@
-frappe.pages['stock-balance'].on_page_load = function(wrapper) {
+frappe.pages["stock-balance"].on_page_load = function (wrapper) {
 	var page = frappe.ui.make_app_page({
 		parent: wrapper,
-		title: __('Stock Summary'),
-		single_column: true
+		title: __("Stock Summary"),
+		single_column: true,
 	});
 	page.start = 0;
 
 	page.warehouse_field = page.add_field({
-		fieldname: 'warehouse',
-		label: __('Warehouse'),
-		fieldtype:'Link',
-		options:'Warehouse',
+		fieldname: "warehouse",
+		label: __("Warehouse"),
+		fieldtype: "Link",
+		options: "Warehouse",
 		default: frappe.route_options && frappe.route_options.warehouse,
-		change: function() {
+		change: function () {
 			page.item_dashboard.start = 0;
 			page.item_dashboard.refresh();
-		}
+		},
 	});
 
 	page.item_field = page.add_field({
-		fieldname: 'item_code',
-		label: __('Item'),
-		fieldtype:'Link',
-		options:'Item',
+		fieldname: "item_code",
+		label: __("Item"),
+		fieldtype: "Link",
+		options: "Item",
 		default: frappe.route_options && frappe.route_options.item_code,
-		change: function() {
+		change: function () {
 			page.item_dashboard.start = 0;
 			page.item_dashboard.refresh();
-		}
+		},
 	});
 
 	page.item_group_field = page.add_field({
-		fieldname: 'item_group',
-		label: __('Item Group'),
-		fieldtype:'Link',
-		options:'Item Group',
+		fieldname: "item_group",
+		label: __("Item Group"),
+		fieldtype: "Link",
+		options: "Item Group",
 		default: frappe.route_options && frappe.route_options.item_group,
-		change: function() {
+		change: function () {
 			page.item_dashboard.start = 0;
 			page.item_dashboard.refresh();
-		}
+		},
 	});
 
 	page.sort_selector = new frappe.ui.SortSelector({
-		parent: page.wrapper.find('.page-form'),
+		parent: page.wrapper.find(".page-form"),
 		args: {
-			sort_by: 'projected_qty',
-			sort_order: 'asc',
+			sort_by: "projected_qty",
+			sort_order: "asc",
 			options: [
-				{fieldname: 'projected_qty', label: __('Projected qty')},
-				{fieldname: 'reserved_qty', label: __('Reserved for sale')},
-				{fieldname: 'reserved_qty_for_production', label: __('Reserved for manufacturing')},
-				{fieldname: 'reserved_qty_for_sub_contract', label: __('Reserved for sub contracting')},
-				{fieldname: 'actual_qty', label: __('Actual qty in stock')},
-			]
+				{ fieldname: "projected_qty", label: __("Projected qty") },
+				{ fieldname: "reserved_qty", label: __("Reserved for sale") },
+				{ fieldname: "reserved_qty_for_production", label: __("Reserved for manufacturing") },
+				{ fieldname: "reserved_qty_for_sub_contract", label: __("Reserved for sub contracting") },
+				{ fieldname: "actual_qty", label: __("Actual qty in stock") },
+			],
 		},
-		change: function(sort_by, sort_order) {
+		change: function (sort_by, sort_order) {
 			page.item_dashboard.sort_by = sort_by;
 			page.item_dashboard.sort_order = sort_order;
 			page.item_dashboard.start = 0;
 			page.item_dashboard.refresh();
-		}
+		},
 	});
 
 	// page.sort_selector.wrapper.css({'margin-right': '15px', 'margin-top': '4px'});
 
-	frappe.require('item-dashboard.bundle.js', function() {
+	frappe.require("item-dashboard.bundle.js", function () {
 		page.item_dashboard = new erpnext.stock.ItemDashboard({
 			parent: page.main,
 			page_length: 20,
-			method: 'erpnext.stock.dashboard.item_dashboard.get_data',
-			template: 'item_dashboard_list'
-		})
+			method: "erpnext.stock.dashboard.item_dashboard.get_data",
+			template: "item_dashboard_list",
+		});
 
-		page.item_dashboard.before_refresh = function() {
+		page.item_dashboard.before_refresh = function () {
 			this.item_code = page.item_field.get_value();
 			this.warehouse = page.warehouse_field.get_value();
 			this.item_group = page.item_group_field.get_value();
-		}
+		};
 
 		page.item_dashboard.refresh();
 
 		// item click
-		var setup_click = function(doctype) {
-			page.main.on('click', 'a[data-type="'+ doctype.toLowerCase() +'"]', function() {
-				var name = $(this).attr('data-name');
-				var field = page[doctype.toLowerCase() + '_field'];
-				if(field.get_value()===name) {
-					frappe.set_route('Form', doctype, name)
+		var setup_click = function (doctype) {
+			page.main.on("click", 'a[data-type="' + doctype.toLowerCase() + '"]', function () {
+				var name = $(this).attr("data-name");
+				var field = page[doctype.toLowerCase() + "_field"];
+				if (field.get_value() === name) {
+					frappe.set_route("Form", doctype, name);
 				} else {
 					field.set_input(name);
 					page.item_dashboard.refresh();
 				}
 			});
-		}
+		};
 
-		setup_click('Item');
-		setup_click('Warehouse');
+		setup_click("Item");
+		setup_click("Warehouse");
 	});
-
-
-}
+};
diff --git a/erpnext/stock/page/warehouse_capacity_summary/warehouse_capacity_summary.js b/erpnext/stock/page/warehouse_capacity_summary/warehouse_capacity_summary.js
index c175a4a..b4502fc 100644
--- a/erpnext/stock/page/warehouse_capacity_summary/warehouse_capacity_summary.js
+++ b/erpnext/stock/page/warehouse_capacity_summary/warehouse_capacity_summary.js
@@ -1,98 +1,98 @@
-frappe.pages['warehouse-capacity-summary'].on_page_load = function(wrapper) {
+frappe.pages["warehouse-capacity-summary"].on_page_load = function (wrapper) {
 	var page = frappe.ui.make_app_page({
 		parent: wrapper,
-		title: __('Warehouse Capacity Summary'),
-		single_column: true
+		title: __("Warehouse Capacity Summary"),
+		single_column: true,
 	});
-	page.set_secondary_action('Refresh', () => page.capacity_dashboard.refresh(), 'refresh');
+	page.set_secondary_action("Refresh", () => page.capacity_dashboard.refresh(), "refresh");
 	page.start = 0;
 
 	page.company_field = page.add_field({
-		fieldname: 'company',
-		label: __('Company'),
-		fieldtype: 'Link',
-		options: 'Company',
+		fieldname: "company",
+		label: __("Company"),
+		fieldtype: "Link",
+		options: "Company",
 		reqd: 1,
 		default: frappe.defaults.get_default("company"),
-		change: function() {
+		change: function () {
 			page.capacity_dashboard.start = 0;
 			page.capacity_dashboard.refresh();
-		}
+		},
 	});
 
 	page.warehouse_field = page.add_field({
-		fieldname: 'warehouse',
-		label: __('Warehouse'),
-		fieldtype: 'Link',
-		options: 'Warehouse',
-		change: function() {
+		fieldname: "warehouse",
+		label: __("Warehouse"),
+		fieldtype: "Link",
+		options: "Warehouse",
+		change: function () {
 			page.capacity_dashboard.start = 0;
 			page.capacity_dashboard.refresh();
-		}
+		},
 	});
 
 	page.item_field = page.add_field({
-		fieldname: 'item_code',
-		label: __('Item'),
-		fieldtype: 'Link',
-		options: 'Item',
-		change: function() {
+		fieldname: "item_code",
+		label: __("Item"),
+		fieldtype: "Link",
+		options: "Item",
+		change: function () {
 			page.capacity_dashboard.start = 0;
 			page.capacity_dashboard.refresh();
-		}
+		},
 	});
 
 	page.parent_warehouse_field = page.add_field({
-		fieldname: 'parent_warehouse',
-		label: __('Parent Warehouse'),
-		fieldtype: 'Link',
-		options: 'Warehouse',
-		get_query: function() {
+		fieldname: "parent_warehouse",
+		label: __("Parent Warehouse"),
+		fieldtype: "Link",
+		options: "Warehouse",
+		get_query: function () {
 			return {
 				filters: {
-					"is_group": 1
-				}
+					is_group: 1,
+				},
 			};
 		},
-		change: function() {
+		change: function () {
 			page.capacity_dashboard.start = 0;
 			page.capacity_dashboard.refresh();
-		}
+		},
 	});
 
 	page.sort_selector = new frappe.ui.SortSelector({
-		parent: page.wrapper.find('.page-form'),
+		parent: page.wrapper.find(".page-form"),
 		args: {
-			sort_by: 'stock_capacity',
-			sort_order: 'desc',
+			sort_by: "stock_capacity",
+			sort_order: "desc",
 			options: [
-				{fieldname: 'stock_capacity', label: __('Capacity (Stock UOM)')},
-				{fieldname: 'percent_occupied', label: __('% Occupied')},
-				{fieldname: 'actual_qty', label: __('Balance Qty (Stock)')}
-			]
+				{ fieldname: "stock_capacity", label: __("Capacity (Stock UOM)") },
+				{ fieldname: "percent_occupied", label: __("% Occupied") },
+				{ fieldname: "actual_qty", label: __("Balance Qty (Stock)") },
+			],
 		},
-		change: function(sort_by, sort_order) {
+		change: function (sort_by, sort_order) {
 			page.capacity_dashboard.sort_by = sort_by;
 			page.capacity_dashboard.sort_order = sort_order;
 			page.capacity_dashboard.start = 0;
 			page.capacity_dashboard.refresh();
-		}
+		},
 	});
 
-	frappe.require('item-dashboard.bundle.js', function() {
-		$(frappe.render_template('warehouse_capacity_summary_header')).appendTo(page.main);
+	frappe.require("item-dashboard.bundle.js", function () {
+		$(frappe.render_template("warehouse_capacity_summary_header")).appendTo(page.main);
 
 		page.capacity_dashboard = new erpnext.stock.ItemDashboard({
 			page_name: "warehouse-capacity-summary",
 			page_length: 10,
 			parent: page.main,
-			sort_by: 'stock_capacity',
-			sort_order: 'desc',
-			method: 'erpnext.stock.dashboard.warehouse_capacity_dashboard.get_data',
-			template: 'warehouse_capacity_summary'
+			sort_by: "stock_capacity",
+			sort_order: "desc",
+			method: "erpnext.stock.dashboard.warehouse_capacity_dashboard.get_data",
+			template: "warehouse_capacity_summary",
 		});
 
-		page.capacity_dashboard.before_refresh = function() {
+		page.capacity_dashboard.before_refresh = function () {
 			this.item_code = page.item_field.get_value();
 			this.warehouse = page.warehouse_field.get_value();
 			this.parent_warehouse = page.parent_warehouse_field.get_value();
@@ -101,12 +101,12 @@
 
 		page.capacity_dashboard.refresh();
 
-		let setup_click = function(doctype) {
-			page.main.on('click', 'a[data-type="'+ doctype.toLowerCase() +'"]', function() {
-				var name = $(this).attr('data-name');
-				var field = page[doctype.toLowerCase() + '_field'];
-				if (field.get_value()===name) {
-					frappe.set_route('Form', doctype, name);
+		let setup_click = function (doctype) {
+			page.main.on("click", 'a[data-type="' + doctype.toLowerCase() + '"]', function () {
+				var name = $(this).attr("data-name");
+				var field = page[doctype.toLowerCase() + "_field"];
+				if (field.get_value() === name) {
+					frappe.set_route("Form", doctype, name);
 				} else {
 					field.set_input(name);
 					page.capacity_dashboard.refresh();
@@ -114,7 +114,7 @@
 			});
 		};
 
-		setup_click('Item');
-		setup_click('Warehouse');
+		setup_click("Item");
+		setup_click("Warehouse");
 	});
 };
diff --git a/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.js b/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.js
index 5ead48d..5ec424f 100644
--- a/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.js
+++ b/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.js
@@ -2,34 +2,34 @@
 // For license information, please see license.txt
 
 frappe.query_reports["Batch Item Expiry Status"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"width": "80",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
-			"reqd": 1,
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			width: "80",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
+			reqd: 1,
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"width": "80",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1,
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			width: "80",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
 		},
 		{
-			"fieldname":"item",
-			"label": __("Item"),
-			"fieldtype": "Link",
-			"options": "Item",
-			"width": "100",
-			"get_query": function () {
+			fieldname: "item",
+			label: __("Item"),
+			fieldtype: "Link",
+			options: "Item",
+			width: "100",
+			get_query: function () {
 				return {
-					filters: {"has_batch_no": 1}
-				}
-			}
-		}
-	]
-}
+					filters: { has_batch_no: 1 },
+				};
+			},
+		},
+	],
+};
diff --git a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.js b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.js
index 2a65e38..352fb19 100644
--- a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.js
+++ b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.js
@@ -2,87 +2,90 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Batch-Wise Balance History"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"width": "80",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
-			"reqd": 1
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			width: "80",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
+			reqd: 1,
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"width": "80",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			width: "80",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
 		},
 		{
-			"fieldname":"item_code",
-			"label": __("Item Code"),
-			"fieldtype": "Link",
-			"options": "Item",
-			"get_query": function() {
+			fieldname: "item_code",
+			label: __("Item Code"),
+			fieldtype: "Link",
+			options: "Item",
+			get_query: function () {
 				return {
 					filters: {
-						"has_batch_no": 1
-					}
+						has_batch_no: 1,
+					},
 				};
-			}
+			},
 		},
 		{
-			"fieldname":"warehouse",
-			"label": __("Warehouse"),
-			"fieldtype": "Link",
-			"options": "Warehouse",
-			"get_query": function() {
-				let company = frappe.query_report.get_filter_value('company');
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			options: "Warehouse",
+			get_query: function () {
+				let company = frappe.query_report.get_filter_value("company");
 				return {
 					filters: {
-						"company": company
-					}
+						company: company,
+					},
 				};
-			}
+			},
 		},
 		{
-			"fieldname":"batch_no",
-			"label": __("Batch No"),
-			"fieldtype": "Link",
-			"options": "Batch",
-			"get_query": function() {
-				let item_code = frappe.query_report.get_filter_value('item_code');
+			fieldname: "batch_no",
+			label: __("Batch No"),
+			fieldtype: "Link",
+			options: "Batch",
+			get_query: function () {
+				let item_code = frappe.query_report.get_filter_value("item_code");
 				return {
 					filters: {
-						"item": item_code
-					}
+						item: item_code,
+					},
 				};
-			}
+			},
 		},
 	],
-	"formatter": function (value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		if (column.fieldname == "Batch" && data && !!data["Batch"]) {
 			value = data["Batch"];
-			column.link_onclick = "frappe.query_reports['Batch-Wise Balance History'].set_batch_route_to_stock_ledger(" + JSON.stringify(data) + ")";
+			column.link_onclick =
+				"frappe.query_reports['Batch-Wise Balance History'].set_batch_route_to_stock_ledger(" +
+				JSON.stringify(data) +
+				")";
 		}
 
 		value = default_formatter(value, row, column, data);
 		return value;
 	},
-	"set_batch_route_to_stock_ledger": function (data) {
+	set_batch_route_to_stock_ledger: function (data) {
 		frappe.route_options = {
-			"batch_no": data["Batch"]
+			batch_no: data["Batch"],
 		};
 
 		frappe.set_route("query-report", "Stock Ledger");
-	}
-}
+	},
+};
diff --git a/erpnext/stock/report/bom_search/bom_search.js b/erpnext/stock/report/bom_search/bom_search.js
index e9e763c..b6f3c96 100644
--- a/erpnext/stock/report/bom_search/bom_search.js
+++ b/erpnext/stock/report/bom_search/bom_search.js
@@ -2,41 +2,41 @@
 // For license information, please see license.txt
 
 frappe.query_reports["BOM Search"] = {
-	"filters": [
+	filters: [
 		{
 			fieldname: "item1",
 			label: __("Item 1"),
 			fieldtype: "Link",
-			options: "Item"
+			options: "Item",
 		},
 		{
 			fieldname: "item2",
 			label: __("Item 2"),
 			fieldtype: "Link",
-			options: "Item"
+			options: "Item",
 		},
 		{
 			fieldname: "item3",
 			label: __("Item 3"),
 			fieldtype: "Link",
-			options: "Item"
+			options: "Item",
 		},
 		{
 			fieldname: "item4",
 			label: __("Item 4"),
 			fieldtype: "Link",
-			options: "Item"
+			options: "Item",
 		},
 		{
 			fieldname: "item5",
 			label: __("Item 5"),
 			fieldtype: "Link",
-			options: "Item"
+			options: "Item",
 		},
 		{
 			fieldname: "search_sub_assemblies",
 			label: __("Search Sub Assemblies"),
 			fieldtype: "Check",
 		},
-	]
-}
+	],
+};
diff --git a/erpnext/stock/report/cogs_by_item_group/cogs_by_item_group.js b/erpnext/stock/report/cogs_by_item_group/cogs_by_item_group.js
index a032285..ecca3b1 100644
--- a/erpnext/stock/report/cogs_by_item_group/cogs_by_item_group.js
+++ b/erpnext/stock/report/cogs_by_item_group/cogs_by_item_group.js
@@ -1,31 +1,29 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
-
 frappe.query_reports["COGS By Item Group"] = {
 	filters: [
-    {
-      label: __("Company"),
-      fieldname: "company",
-      fieldtype: "Link",
-      options: "Company",
-      mandatory: true,
-      default: frappe.defaults.get_user_default("Company"),
-    },
-    {
-      label: __("From Date"),
-      fieldname: "from_date",
-      fieldtype: "Date",
-      mandatory: true,
-      default: frappe.datetime.year_start(),
-    },
-    {
-      label: __("To Date"),
-      fieldname: "to_date",
-      fieldtype: "Date",
-      mandatory: true,
-      default: frappe.datetime.get_today(),
-    },
-	]
+		{
+			label: __("Company"),
+			fieldname: "company",
+			fieldtype: "Link",
+			options: "Company",
+			mandatory: true,
+			default: frappe.defaults.get_user_default("Company"),
+		},
+		{
+			label: __("From Date"),
+			fieldname: "from_date",
+			fieldtype: "Date",
+			mandatory: true,
+			default: frappe.datetime.year_start(),
+		},
+		{
+			label: __("To Date"),
+			fieldname: "to_date",
+			fieldtype: "Date",
+			mandatory: true,
+			default: frappe.datetime.get_today(),
+		},
+	],
 };
diff --git a/erpnext/stock/report/delayed_item_report/delayed_item_report.js b/erpnext/stock/report/delayed_item_report/delayed_item_report.js
index cf6e12f..aecf0fa 100644
--- a/erpnext/stock/report/delayed_item_report/delayed_item_report.js
+++ b/erpnext/stock/report/delayed_item_report/delayed_item_report.js
@@ -1,62 +1,61 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Delayed Item Report"] = {
-	"filters": [
+	filters: [
 		{
 			fieldname: "company",
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
 			default: frappe.defaults.get_default("company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"from_date",
+			fieldname: "from_date",
 			label: __("From Date"),
 			fieldtype: "Date",
 			default: frappe.datetime.month_start(),
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
 			default: frappe.datetime.now_date(),
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"sales_order",
+			fieldname: "sales_order",
 			label: __("Sales Order"),
 			fieldtype: "Link",
 			options: "Sales Order",
 		},
 		{
-			fieldname:"customer",
+			fieldname: "customer",
 			label: __("Customer"),
 			fieldtype: "Link",
 			options: "Customer",
 		},
 		{
-			fieldname:"customer_group",
+			fieldname: "customer_group",
 			label: __("Customer Group"),
 			fieldtype: "Link",
 			options: "Customer Group",
 		},
 		{
-			fieldname:"item_group",
+			fieldname: "item_group",
 			label: __("Item Group"),
 			fieldtype: "Link",
 			options: "Item Group",
 		},
 		{
-			fieldname:"based_on",
+			fieldname: "based_on",
 			label: __("Based On"),
 			fieldtype: "Select",
 			options: ["Delivery Note", "Sales Invoice"],
 			default: "Sales Invoice",
-			reqd: 1
+			reqd: 1,
 		},
-	]
-}
+	],
+};
diff --git a/erpnext/stock/report/delayed_order_report/delayed_order_report.js b/erpnext/stock/report/delayed_order_report/delayed_order_report.js
index cf489c9..3aa6f91 100644
--- a/erpnext/stock/report/delayed_order_report/delayed_order_report.js
+++ b/erpnext/stock/report/delayed_order_report/delayed_order_report.js
@@ -1,62 +1,61 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Delayed Order Report"] = {
-	"filters": [
+	filters: [
 		{
 			fieldname: "company",
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
 			default: frappe.defaults.get_default("company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"from_date",
+			fieldname: "from_date",
 			label: __("From Date"),
 			fieldtype: "Date",
 			default: frappe.datetime.month_start(),
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
 			default: frappe.datetime.now_date(),
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"sales_order",
+			fieldname: "sales_order",
 			label: __("Sales Order"),
 			fieldtype: "Link",
 			options: "Sales Order",
 		},
 		{
-			fieldname:"customer",
+			fieldname: "customer",
 			label: __("Customer"),
 			fieldtype: "Link",
 			options: "Customer",
 		},
 		{
-			fieldname:"customer_group",
+			fieldname: "customer_group",
 			label: __("Customer Group"),
 			fieldtype: "Link",
 			options: "Customer Group",
 		},
 		{
-			fieldname:"item_group",
+			fieldname: "item_group",
 			label: __("Item Group"),
 			fieldtype: "Link",
 			options: "Item Group",
 		},
 		{
-			fieldname:"based_on",
+			fieldname: "based_on",
 			label: __("Based On"),
 			fieldtype: "Select",
 			options: ["Delivery Note", "Sales Invoice"],
 			default: "Sales Invoice",
-			reqd: 1
+			reqd: 1,
 		},
-	]
-}
+	],
+};
diff --git a/erpnext/stock/report/delivery_note_trends/delivery_note_trends.js b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.js
index 8a04565..5e7dc8b 100644
--- a/erpnext/stock/report/delivery_note_trends/delivery_note_trends.js
+++ b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.js
@@ -1,8 +1,8 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.require("assets/erpnext/js/sales_trends_filters.js", function() {
+frappe.require("assets/erpnext/js/sales_trends_filters.js", function () {
 	frappe.query_reports["Delivery Note Trends"] = {
-		filters: erpnext.get_sales_trends_filters()
-	}
+		filters: erpnext.get_sales_trends_filters(),
+	};
 });
diff --git a/erpnext/stock/report/fifo_queue_vs_qty_after_transaction_comparison/fifo_queue_vs_qty_after_transaction_comparison.js b/erpnext/stock/report/fifo_queue_vs_qty_after_transaction_comparison/fifo_queue_vs_qty_after_transaction_comparison.js
index bc86979..38266aa 100644
--- a/erpnext/stock/report/fifo_queue_vs_qty_after_transaction_comparison/fifo_queue_vs_qty_after_transaction_comparison.js
+++ b/erpnext/stock/report/fifo_queue_vs_qty_after_transaction_comparison/fifo_queue_vs_qty_after_transaction_comparison.js
@@ -1,49 +1,45 @@
 // Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
-const DIFFERNCE_FIELD_NAMES = [
-	"fifo_qty_diff",
-	"fifo_value_diff",
-];
+const DIFFERNCE_FIELD_NAMES = ["fifo_qty_diff", "fifo_value_diff"];
 
 frappe.query_reports["FIFO Queue vs Qty After Transaction Comparison"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "item_code",
-			"fieldtype": "Link",
-			"label": "Item",
-			"options": "Item",
-			get_query: function() {
+			fieldname: "item_code",
+			fieldtype: "Link",
+			label: "Item",
+			options: "Item",
+			get_query: function () {
 				return {
-					filters: {is_stock_item: 1, has_serial_no: 0}
-				}
-			}
+					filters: { is_stock_item: 1, has_serial_no: 0 },
+				};
+			},
 		},
 		{
-			"fieldname": "item_group",
-			"fieldtype": "Link",
-			"label": "Item Group",
-			"options": "Item Group",
+			fieldname: "item_group",
+			fieldtype: "Link",
+			label: "Item Group",
+			options: "Item Group",
 		},
 		{
-			"fieldname": "warehouse",
-			"fieldtype": "Link",
-			"label": "Warehouse",
-			"options": "Warehouse",
+			fieldname: "warehouse",
+			fieldtype: "Link",
+			label: "Warehouse",
+			options: "Warehouse",
 		},
 		{
-			"fieldname": "from_date",
-			"fieldtype": "Date",
-			"label": "From Posting Date",
+			fieldname: "from_date",
+			fieldtype: "Date",
+			label: "From Posting Date",
 		},
 		{
-			"fieldname": "to_date",
-			"fieldtype": "Date",
-			"label": "From Posting Date",
-		}
+			fieldname: "to_date",
+			fieldtype: "Date",
+			label: "From Posting Date",
+		},
 	],
-	formatter (value, row, column, data, default_formatter) {
+	formatter(value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 		if (DIFFERNCE_FIELD_NAMES.includes(column.fieldname) && Math.abs(data[column.fieldname]) > 0.001) {
 			value = "<span style='color:red'>" + value + "</span>";
diff --git a/erpnext/stock/report/incorrect_balance_qty_after_transaction/incorrect_balance_qty_after_transaction.js b/erpnext/stock/report/incorrect_balance_qty_after_transaction/incorrect_balance_qty_after_transaction.js
index 0f9120b..8c4e6d4 100644
--- a/erpnext/stock/report/incorrect_balance_qty_after_transaction/incorrect_balance_qty_after_transaction.js
+++ b/erpnext/stock/report/incorrect_balance_qty_after_transaction/incorrect_balance_qty_after_transaction.js
@@ -1,27 +1,26 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Incorrect Balance Qty After Transaction"] = {
-	"filters": [
+	filters: [
 		{
 			label: __("Company"),
 			fieldtype: "Link",
 			fieldname: "company",
 			options: "Company",
 			default: frappe.defaults.get_user_default("Company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			label: __('Item Code'),
-			fieldtype: 'Link',
-			fieldname: 'item_code',
-			options: 'Item'
+			label: __("Item Code"),
+			fieldtype: "Link",
+			fieldname: "item_code",
+			options: "Item",
 		},
 		{
-			label: __('Warehouse'),
-			fieldtype: 'Link',
-			fieldname: 'warehouse'
-		}
-	]
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			fieldname: "warehouse",
+		},
+	],
 };
diff --git a/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.js b/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.js
index a061d04..51948ca 100644
--- a/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.js
+++ b/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.js
@@ -1,35 +1,34 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Incorrect Serial No Valuation"] = {
-	"filters": [
+	filters: [
 		{
-			label: __('Item Code'),
-			fieldtype: 'Link',
-			fieldname: 'item_code',
-			options: 'Item',
-			get_query: function() {
+			label: __("Item Code"),
+			fieldtype: "Link",
+			fieldname: "item_code",
+			options: "Item",
+			get_query: function () {
 				return {
 					filters: {
-						'has_serial_no': 1
-					}
-				}
-			}
+						has_serial_no: 1,
+					},
+				};
+			},
 		},
 		{
-			label: __('From Date'),
-			fieldtype: 'Date',
-			fieldname: 'from_date',
+			label: __("From Date"),
+			fieldtype: "Date",
+			fieldname: "from_date",
 			reqd: 1,
 			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
 		},
 		{
-			label: __('To Date'),
-			fieldtype: 'Date',
-			fieldname: 'to_date',
+			label: __("To Date"),
+			fieldtype: "Date",
+			fieldname: "to_date",
 			reqd: 1,
 			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
-		}
-	]
+		},
+	],
 };
diff --git a/erpnext/stock/report/incorrect_stock_value_report/incorrect_stock_value_report.js b/erpnext/stock/report/incorrect_stock_value_report/incorrect_stock_value_report.js
index 174d033..0a6ca3f 100644
--- a/erpnext/stock/report/incorrect_stock_value_report/incorrect_stock_value_report.js
+++ b/erpnext/stock/report/incorrect_stock_value_report/incorrect_stock_value_report.js
@@ -1,36 +1,35 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Incorrect Stock Value Report"] = {
-	"filters": [
+	filters: [
 		{
-			"label": __("Company"),
-			"fieldname": "company",
-			"fieldtype": "Link",
-			"options": "Company",
-			"reqd": 1,
-			"default": frappe.defaults.get_user_default("Company")
+			label: __("Company"),
+			fieldname: "company",
+			fieldtype: "Link",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"label": __("Account"),
-			"fieldname": "account",
-			"fieldtype": "Link",
-			"options": "Account",
-			get_query: function() {
-				var company = frappe.query_report.get_filter_value('company');
+			label: __("Account"),
+			fieldname: "account",
+			fieldtype: "Link",
+			options: "Account",
+			get_query: function () {
+				var company = frappe.query_report.get_filter_value("company");
 				return {
 					filters: {
-						"account_type": "Stock",
-						"company": company
-					}
-				}
-			}
+						account_type: "Stock",
+						company: company,
+					},
+				};
+			},
 		},
 		{
-			"label": __("From Date"),
-			"fieldname": "from_date",
-			"fieldtype": "Date"
-		}
-	]
+			label: __("From Date"),
+			fieldname: "from_date",
+			fieldtype: "Date",
+		},
+	],
 };
diff --git a/erpnext/stock/report/item_price_stock/item_price_stock.js b/erpnext/stock/report/item_price_stock/item_price_stock.js
index c4684da..72d8d23 100644
--- a/erpnext/stock/report/item_price_stock/item_price_stock.js
+++ b/erpnext/stock/report/item_price_stock/item_price_stock.js
@@ -1,14 +1,13 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Item Price Stock"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"item_code",
-			"label": __("Item"),
-			"fieldtype": "Link",
-			"options": "Item"
-		}
-	]
-}
+			fieldname: "item_code",
+			label: __("Item"),
+			fieldtype: "Link",
+			options: "Item",
+		},
+	],
+};
diff --git a/erpnext/stock/report/item_prices/item_prices.js b/erpnext/stock/report/item_prices/item_prices.js
index 77bca44..868b503 100644
--- a/erpnext/stock/report/item_prices/item_prices.js
+++ b/erpnext/stock/report/item_prices/item_prices.js
@@ -2,16 +2,16 @@
 // For license information, please see license.txt
 
 frappe.query_reports["Item Prices"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "items",
-			"label": __("Items Filter"),
-			"fieldtype": "Select",
-			"options": "Enabled Items only\nDisabled Items only\nAll Items",
-			"default": "Enabled Items only",
-			"on_change": function(query_report) {
+			fieldname: "items",
+			label: __("Items Filter"),
+			fieldtype: "Select",
+			options: "Enabled Items only\nDisabled Items only\nAll Items",
+			default: "Enabled Items only",
+			on_change: function (query_report) {
 				query_report.trigger_refresh();
-			}
-		}
-	]
-}
+			},
+		},
+	],
+};
diff --git a/erpnext/stock/report/item_shortage_report/item_shortage_report.js b/erpnext/stock/report/item_shortage_report/item_shortage_report.js
index 5642038..d293b89 100644
--- a/erpnext/stock/report/item_shortage_report/item_shortage_report.js
+++ b/erpnext/stock/report/item_shortage_report/item_shortage_report.js
@@ -1,26 +1,25 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Item Shortage Report"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"width": "80",
-			"options": "Company",
-			"reqd": 1,
-			"default": frappe.defaults.get_default("company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_default("company"),
 		},
 		{
-			"fieldname": "warehouse",
-			"label": __("Warehouse"),
-			"fieldtype": "MultiSelectList",
-			"width": "100",
-			get_data: function(txt) {
-				return frappe.db.get_link_options('Warehouse', txt);
-			}
-		}
-	]
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "MultiSelectList",
+			width: "100",
+			get_data: function (txt) {
+				return frappe.db.get_link_options("Warehouse", txt);
+			},
+		},
+	],
 };
diff --git a/erpnext/stock/report/item_variant_details/item_variant_details.js b/erpnext/stock/report/item_variant_details/item_variant_details.js
index b902294..37c149a 100644
--- a/erpnext/stock/report/item_variant_details/item_variant_details.js
+++ b/erpnext/stock/report/item_variant_details/item_variant_details.js
@@ -1,9 +1,8 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Item Variant Details"] = {
-	"filters": [
+	filters: [
 		{
 			reqd: 1,
 			default: "",
@@ -13,9 +12,9 @@
 			fieldtype: "Link",
 			get_query: () => {
 				return {
-					filters: { "has_variants": 1 }
-				}
-			}
-		}
-	]
-}
+					filters: { has_variants: 1 },
+				};
+			},
+		},
+	],
+};
diff --git a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.js b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.js
index 3f8d90d..8d46b14 100644
--- a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.js
+++ b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.js
@@ -2,31 +2,31 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Itemwise Recommended Reorder Level"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today()
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname":"item_group",
-			"label": __("Item Group"),
-			"fieldtype": "Link",
-			"options": "Item Group",
-			"reqd": 1
+			fieldname: "item_group",
+			label: __("Item Group"),
+			fieldtype: "Link",
+			options: "Item Group",
+			reqd: 1,
 		},
 		{
-			"fieldname":"brand",
-			"label": __("Brand"),
-			"fieldtype": "Link",
-			"options": "Brand"
-		}
-	]
-}
+			fieldname: "brand",
+			label: __("Brand"),
+			fieldtype: "Link",
+			options: "Brand",
+		},
+	],
+};
diff --git a/erpnext/stock/report/product_bundle_balance/product_bundle_balance.js b/erpnext/stock/report/product_bundle_balance/product_bundle_balance.js
index 4458a72..5cef5c7 100644
--- a/erpnext/stock/report/product_bundle_balance/product_bundle_balance.js
+++ b/erpnext/stock/report/product_bundle_balance/product_bundle_balance.js
@@ -2,51 +2,51 @@
 // For license information, please see license.txt
 
 frappe.query_reports["Product Bundle Balance"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"date",
-			"label": __("Date"),
-			"fieldtype": "Date",
-			"width": "80",
-			"reqd": 1,
-			"default": frappe.datetime.get_today(),
+			fieldname: "date",
+			label: __("Date"),
+			fieldtype: "Date",
+			width: "80",
+			reqd: 1,
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname": "item_code",
-			"label": __("Item"),
-			"fieldtype": "Link",
-			"width": "80",
-			"options": "Item",
-			"get_query": function() {
+			fieldname: "item_code",
+			label: __("Item"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Item",
+			get_query: function () {
 				return {
 					query: "erpnext.controllers.queries.item_query",
-					filters: {"is_stock_item": 0}
+					filters: { is_stock_item: 0 },
 				};
-			}
+			},
 		},
 		{
-			"fieldname": "item_group",
-			"label": __("Item Group"),
-			"fieldtype": "Link",
-			"width": "80",
-			"options": "Item Group"
+			fieldname: "item_group",
+			label: __("Item Group"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Item Group",
 		},
 		{
-			"fieldname":"brand",
-			"label": __("Brand"),
-			"fieldtype": "Link",
-			"options": "Brand"
+			fieldname: "brand",
+			label: __("Brand"),
+			fieldtype: "Link",
+			options: "Brand",
 		},
 		{
-			"fieldname": "warehouse",
-			"label": __("Warehouse"),
-			"fieldtype": "Link",
-			"width": "80",
-			"options": "Warehouse"
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Warehouse",
 		},
 	],
-	"initial_depth": 0,
-	"formatter": function(value, row, column, data, default_formatter) {
+	initial_depth: 0,
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 		if (!data.parent_item) {
 			value = $(`<span>${value}</span>`);
@@ -54,5 +54,5 @@
 			value = $value.wrap("<p></p>").parent().html();
 		}
 		return value;
-	}
+	},
 };
diff --git a/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.js b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.js
index 695efac..bddfe5d 100644
--- a/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.js
+++ b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.js
@@ -1,8 +1,8 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.require("assets/erpnext/js/purchase_trends_filters.js", function() {
+frappe.require("assets/erpnext/js/purchase_trends_filters.js", function () {
 	frappe.query_reports["Purchase Receipt Trends"] = {
-		filters: erpnext.get_purchase_trends_filters()
-	}
+		filters: erpnext.get_purchase_trends_filters(),
+	};
 });
diff --git a/erpnext/stock/report/reserved_stock/reserved_stock.js b/erpnext/stock/report/reserved_stock/reserved_stock.js
index 2b075e2..29a97ad 100644
--- a/erpnext/stock/report/reserved_stock/reserved_stock.js
+++ b/erpnext/stock/report/reserved_stock/reserved_stock.js
@@ -15,10 +15,7 @@
 			fieldname: "from_date",
 			label: __("From Date"),
 			fieldtype: "Date",
-			default: frappe.datetime.add_months(
-				frappe.datetime.get_today(),
-				-1
-			),
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
 			reqd: 1,
 		},
 		{
@@ -72,7 +69,7 @@
 			get_query: () => ({
 				filters: {
 					name: ["in", ["Sales Order"]],
-				}
+				},
 			}),
 		},
 		{
@@ -98,7 +95,7 @@
 			get_query: () => ({
 				filters: {
 					name: ["in", ["Pick List", "Purchase Receipt"]],
-				}
+				},
 			}),
 		},
 		{
@@ -126,13 +123,7 @@
 			fieldname: "status",
 			label: __("Status"),
 			fieldtype: "Select",
-			options: [
-				"",
-				"Partially Reserved",
-				"Reserved",
-				"Partially Delivered",
-				"Delivered",
-			],
+			options: ["", "Partially Reserved", "Reserved", "Partially Delivered", "Delivered"],
 		},
 		{
 			fieldname: "project",
@@ -165,17 +156,14 @@
 						value = "<span style='color:green'>" + value + "</span>";
 						break;
 				}
-			}
-			else if (column.fieldname == "delivered_qty") {
+			} else if (column.fieldname == "delivered_qty") {
 				if (data.delivered_qty > 0) {
 					if (data.reserved_qty > data.delivered_qty) {
 						value = "<span style='color:blue'>" + value + "</span>";
-					}
-					else {
+					} else {
 						value = "<span style='color:green'>" + value + "</span>";
 					}
-				}
-				else {
+				} else {
 					value = "<span style='color:red'>" + value + "</span>";
 				}
 			}
diff --git a/erpnext/stock/report/serial_and_batch_summary/serial_and_batch_summary.js b/erpnext/stock/report/serial_and_batch_summary/serial_and_batch_summary.js
index 10e5925..3b66cb0 100644
--- a/erpnext/stock/report/serial_and_batch_summary/serial_and_batch_summary.js
+++ b/erpnext/stock/report/serial_and_batch_summary/serial_and_batch_summary.js
@@ -3,93 +3,93 @@
 /* eslint-disable */
 
 frappe.query_reports["Serial and Batch Summary"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today()
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname":"item_code",
-			"label": __("Item"),
-			"fieldtype": "Link",
-			"options": "Item",
+			fieldname: "item_code",
+			label: __("Item"),
+			fieldtype: "Link",
+			options: "Item",
 		},
 		{
-			"fieldname":"warehouse",
-			"label": __("Warehouse"),
-			"fieldtype": "Link",
-			"options": "Warehouse",
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			options: "Warehouse",
 		},
 		{
-			"fieldname":"voucher_type",
-			"label": __("Voucher Type"),
-			"fieldtype": "Link",
-			"options": "DocType",
-			get_query: function() {
+			fieldname: "voucher_type",
+			label: __("Voucher Type"),
+			fieldtype: "Link",
+			options: "DocType",
+			get_query: function () {
 				return {
 					query: "erpnext.stock.report.serial_and_batch_summary.serial_and_batch_summary.get_voucher_type",
-				}
-			}
+				};
+			},
 		},
 		{
-			"fieldname":"voucher_no",
-			"label": __("Voucher No"),
-			"fieldtype": "MultiSelectList",
-			get_data: function(txt) {
+			fieldname: "voucher_no",
+			label: __("Voucher No"),
+			fieldtype: "MultiSelectList",
+			get_data: function (txt) {
 				if (!frappe.query_report.filters) return;
 
-				let voucher_type = frappe.query_report.get_filter_value('voucher_type');
+				let voucher_type = frappe.query_report.get_filter_value("voucher_type");
 				if (!voucher_type) return;
 
 				return frappe.db.get_link_options(voucher_type, txt);
 			},
 		},
 		{
-			"fieldname":"serial_no",
-			"label": __("Serial No"),
-			"fieldtype": "Link",
-			"options": "Serial No",
-			get_query: function() {
+			fieldname: "serial_no",
+			label: __("Serial No"),
+			fieldtype: "Link",
+			options: "Serial No",
+			get_query: function () {
 				return {
 					query: "erpnext.stock.report.serial_and_batch_summary.serial_and_batch_summary.get_serial_nos",
 					filters: {
-						"item_code": frappe.query_report.get_filter_value('item_code'),
-						"voucher_type": frappe.query_report.get_filter_value('voucher_type'),
-						"voucher_no": frappe.query_report.get_filter_value('voucher_no'),
-					}
-				}
-			}
+						item_code: frappe.query_report.get_filter_value("item_code"),
+						voucher_type: frappe.query_report.get_filter_value("voucher_type"),
+						voucher_no: frappe.query_report.get_filter_value("voucher_no"),
+					},
+				};
+			},
 		},
 		{
-			"fieldname":"batch_no",
-			"label": __("Batch No"),
-			"fieldtype": "Link",
-			"options": "Batch",
-			get_query: function() {
+			fieldname: "batch_no",
+			label: __("Batch No"),
+			fieldtype: "Link",
+			options: "Batch",
+			get_query: function () {
 				return {
 					query: "erpnext.stock.report.serial_and_batch_summary.serial_and_batch_summary.get_batch_nos",
 					filters: {
-						"item_code": frappe.query_report.get_filter_value('item_code'),
-						"voucher_type": frappe.query_report.get_filter_value('voucher_type'),
-						"voucher_no": frappe.query_report.get_filter_value('voucher_no'),
-					}
-				}
-			}
-		}
-	]
+						item_code: frappe.query_report.get_filter_value("item_code"),
+						voucher_type: frappe.query_report.get_filter_value("voucher_type"),
+						voucher_no: frappe.query_report.get_filter_value("voucher_no"),
+					},
+				};
+			},
+		},
+	],
 };
diff --git a/erpnext/stock/report/serial_no_ledger/serial_no_ledger.js b/erpnext/stock/report/serial_no_ledger/serial_no_ledger.js
index fe977c6..376fe41 100644
--- a/erpnext/stock/report/serial_no_ledger/serial_no_ledger.js
+++ b/erpnext/stock/report/serial_no_ledger/serial_no_ledger.js
@@ -1,70 +1,69 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Serial No Ledger"] = {
-	"filters": [
+	filters: [
 		{
-			'label': __('Item Code'),
-			'fieldtype': 'Link',
-			'fieldname': 'item_code',
-			'reqd': 1,
-			'options': 'Item',
-			get_query: function() {
+			label: __("Item Code"),
+			fieldtype: "Link",
+			fieldname: "item_code",
+			reqd: 1,
+			options: "Item",
+			get_query: function () {
 				return {
 					filters: {
-						'has_serial_no': 1
-					}
-				}
-			}
+						has_serial_no: 1,
+					},
+				};
+			},
 		},
 		{
-			'label': __('Warehouse'),
-			'fieldtype': 'Link',
-			'fieldname': 'warehouse',
-			'options': 'Warehouse',
-			get_query: function() {
-				let company = frappe.query_report.get_filter_value('company');
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			fieldname: "warehouse",
+			options: "Warehouse",
+			get_query: function () {
+				let company = frappe.query_report.get_filter_value("company");
 
 				if (company) {
 					return {
 						filters: {
-							'company': company
-						}
-					}
+							company: company,
+						},
+					};
 				}
-			}
+			},
 		},
 		{
-			'label': __('Serial No'),
-			'fieldtype': 'Link',
-			'fieldname': 'serial_no',
-			'options': 'Serial No',
-			get_query: function() {
-				let item_code = frappe.query_report.get_filter_value('item_code');
-				let warehouse = frappe.query_report.get_filter_value('warehouse');
+			label: __("Serial No"),
+			fieldtype: "Link",
+			fieldname: "serial_no",
+			options: "Serial No",
+			get_query: function () {
+				let item_code = frappe.query_report.get_filter_value("item_code");
+				let warehouse = frappe.query_report.get_filter_value("warehouse");
 
-				let query_filters = {'item_code': item_code};
+				let query_filters = { item_code: item_code };
 				if (warehouse) {
-					query_filters['warehouse'] = warehouse;
+					query_filters["warehouse"] = warehouse;
 				}
 
 				return {
-					filters: query_filters
-				}
-			}
+					filters: query_filters,
+				};
+			},
 		},
 		{
-			'label': __('As On Date'),
-			'fieldtype': 'Date',
-			'fieldname': 'posting_date',
-			'default': frappe.datetime.get_today()
+			label: __("As On Date"),
+			fieldtype: "Date",
+			fieldname: "posting_date",
+			default: frappe.datetime.get_today(),
 		},
 		{
-			'label': __('Posting Time'),
-			'fieldtype': 'Time',
-			'fieldname': 'posting_time',
-			'default': frappe.datetime.get_time()
+			label: __("Posting Time"),
+			fieldtype: "Time",
+			fieldname: "posting_time",
+			default: frappe.datetime.get_time(),
 		},
-	]
+	],
 };
diff --git a/erpnext/stock/report/stock_ageing/stock_ageing.js b/erpnext/stock/report/stock_ageing/stock_ageing.js
index db463b7..6410841 100644
--- a/erpnext/stock/report/stock_ageing/stock_ageing.js
+++ b/erpnext/stock/report/stock_ageing/stock_ageing.js
@@ -2,74 +2,74 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Stock Ageing"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("As On Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1
+			fieldname: "to_date",
+			label: __("As On Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
 		},
 		{
-			"fieldname":"warehouse",
-			"label": __("Warehouse"),
-			"fieldtype": "Link",
-			"options": "Warehouse",
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			options: "Warehouse",
 			get_query: () => {
 				const company = frappe.query_report.get_filter_value("company");
 				return {
 					filters: {
-						...company && {company},
-					}
+						...(company && { company }),
+					},
 				};
-			}
+			},
 		},
 		{
-			"fieldname":"item_code",
-			"label": __("Item"),
-			"fieldtype": "Link",
-			"options": "Item"
+			fieldname: "item_code",
+			label: __("Item"),
+			fieldtype: "Link",
+			options: "Item",
 		},
 		{
-			"fieldname":"brand",
-			"label": __("Brand"),
-			"fieldtype": "Link",
-			"options": "Brand"
+			fieldname: "brand",
+			label: __("Brand"),
+			fieldtype: "Link",
+			options: "Brand",
 		},
 		{
-			"fieldname":"range1",
-			"label": __("Ageing Range 1"),
-			"fieldtype": "Int",
-			"default": "30",
-			"reqd": 1
+			fieldname: "range1",
+			label: __("Ageing Range 1"),
+			fieldtype: "Int",
+			default: "30",
+			reqd: 1,
 		},
 		{
-			"fieldname":"range2",
-			"label": __("Ageing Range 2"),
-			"fieldtype": "Int",
-			"default": "60",
-			"reqd": 1
+			fieldname: "range2",
+			label: __("Ageing Range 2"),
+			fieldtype: "Int",
+			default: "60",
+			reqd: 1,
 		},
 		{
-			"fieldname":"range3",
-			"label": __("Ageing Range 3"),
-			"fieldtype": "Int",
-			"default": "90",
-			"reqd": 1
+			fieldname: "range3",
+			label: __("Ageing Range 3"),
+			fieldtype: "Int",
+			default: "90",
+			reqd: 1,
 		},
 		{
-			"fieldname":"show_warehouse_wise_stock",
-			"label": __("Show Warehouse-wise Stock"),
-			"fieldtype": "Check",
-			"default": 0
-		}
-	]
-}
+			fieldname: "show_warehouse_wise_stock",
+			label: __("Show Warehouse-wise Stock"),
+			fieldtype: "Check",
+			default: 0,
+		},
+	],
+};
diff --git a/erpnext/stock/report/stock_analytics/stock_analytics.js b/erpnext/stock/report/stock_analytics/stock_analytics.js
index e033fd9..dae64d9 100644
--- a/erpnext/stock/report/stock_analytics/stock_analytics.js
+++ b/erpnext/stock/report/stock_analytics/stock_analytics.js
@@ -1,40 +1,39 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Stock Analytics"] = {
-	"filters": [
+	filters: [
 		{
 			fieldname: "item_group",
 			label: __("Item Group"),
 			fieldtype: "Link",
-			options:"Item Group",
+			options: "Item Group",
 			default: "",
 		},
 		{
 			fieldname: "item_code",
 			label: __("Item"),
 			fieldtype: "Link",
-			options:"Item",
+			options: "Item",
 			default: "",
-			get_query: () => ({filters: { 'is_stock_item': 1 }}),
+			get_query: () => ({ filters: { is_stock_item: 1 } }),
 		},
 		{
 			fieldname: "value_quantity",
 			label: __("Value Or Qty"),
 			fieldtype: "Select",
 			options: [
-				{ "value": "Value", "label": __("Value") },
-				{ "value": "Quantity", "label": __("Quantity") }
+				{ value: "Value", label: __("Value") },
+				{ value: "Quantity", label: __("Quantity") },
 			],
 			default: "Value",
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "brand",
 			label: __("Brand"),
 			fieldtype: "Link",
-			options:"Brand",
+			options: "Brand",
 			default: "",
 		},
 		{
@@ -51,92 +50,91 @@
 			fieldtype: "Link",
 			options: "Warehouse",
 			default: "",
-			get_query: function() {
-				const company = frappe.query_report.get_filter_value('company');
+			get_query: function () {
+				const company = frappe.query_report.get_filter_value("company");
 				return {
-					filters: { 'company': company }
-				}
-			}
+					filters: { company: company },
+				};
+			},
 		},
 		{
 			fieldname: "from_date",
 			label: __("From Date"),
 			fieldtype: "Date",
 			default: frappe.defaults.get_global_default("year_start_date"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
 			default: frappe.defaults.get_global_default("year_end_date"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "range",
 			label: __("Range"),
 			fieldtype: "Select",
 			options: [
-				{ "value": "Weekly", "label": __("Weekly") },
-				{ "value": "Monthly", "label": __("Monthly") },
-				{ "value": "Quarterly", "label": __("Quarterly") },
-				{ "value": "Yearly", "label": __("Yearly") }
+				{ value: "Weekly", label: __("Weekly") },
+				{ value: "Monthly", label: __("Monthly") },
+				{ value: "Quarterly", label: __("Quarterly") },
+				{ value: "Yearly", label: __("Yearly") },
 			],
 			default: "Monthly",
-			reqd: 1
-		}
+			reqd: 1,
+		},
 	],
-	after_datatable_render: function(datatable_obj) {
-		$(datatable_obj.wrapper).find(".dt-row-0").find('input[type=checkbox]').click();
+	after_datatable_render: function (datatable_obj) {
+		$(datatable_obj.wrapper).find(".dt-row-0").find("input[type=checkbox]").click();
 	},
 	get_datatable_options(options) {
 		return Object.assign(options, {
 			checkboxColumn: true,
 			events: {
-				onCheckRow: function(data) {
+				onCheckRow: function (data) {
 					let row_name = data[2].content;
 					let row_values = data.slice(7).map(function (column) {
 						return column.content;
-					})
-					let entry  = {
-						'name':row_name,
-						'values':row_values
-					}
+					});
+					let entry = {
+						name: row_name,
+						values: row_values,
+					};
 
 					let raw_data = frappe.query_report.chart.data;
 					let new_datasets = raw_data.datasets;
 
 					var found = false;
 
-					for(var i=0; i < new_datasets.length;i++){
-						if(new_datasets[i].name == row_name){
+					for (var i = 0; i < new_datasets.length; i++) {
+						if (new_datasets[i].name == row_name) {
 							found = true;
-							new_datasets.splice(i,1);
+							new_datasets.splice(i, 1);
 							break;
 						}
 					}
 
-					if(!found){
+					if (!found) {
 						new_datasets.push(entry);
 					}
 
 					let new_data = {
 						labels: raw_data.labels,
-						datasets: new_datasets
-					}
+						datasets: new_datasets,
+					};
 
 					setTimeout(() => {
-						frappe.query_report.chart.update(new_data)
-					},500)
-
+						frappe.query_report.chart.update(new_data);
+					}, 500);
 
 					setTimeout(() => {
 						frappe.query_report.chart.draw(true);
-					}, 1000)
+					}, 1000);
 
 					frappe.query_report.raw_chart_data = new_data;
 				},
-			}
+			},
 		});
-	}
-}
+	},
+};
diff --git a/erpnext/stock/report/stock_and_account_value_comparison/stock_and_account_value_comparison.js b/erpnext/stock/report/stock_and_account_value_comparison/stock_and_account_value_comparison.js
index ffef11a..1e2022e 100644
--- a/erpnext/stock/report/stock_and_account_value_comparison/stock_and_account_value_comparison.js
+++ b/erpnext/stock/report/stock_and_account_value_comparison/stock_and_account_value_comparison.js
@@ -1,37 +1,36 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Stock and Account Value Comparison"] = {
-	"filters": [
+	filters: [
 		{
-			"label": __("Company"),
-			"fieldname": "company",
-			"fieldtype": "Link",
-			"options": "Company",
-			"reqd": 1,
-			"default": frappe.defaults.get_user_default("Company")
+			label: __("Company"),
+			fieldname: "company",
+			fieldtype: "Link",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"label": __("Account"),
-			"fieldname": "account",
-			"fieldtype": "Link",
-			"options": "Account",
-			get_query: function() {
-				var company = frappe.query_report.get_filter_value('company');
+			label: __("Account"),
+			fieldname: "account",
+			fieldtype: "Link",
+			options: "Account",
+			get_query: function () {
+				var company = frappe.query_report.get_filter_value("company");
 				return {
 					filters: {
-						"account_type": "Stock",
-						"company": company
-					}
-				}
-			}
+						account_type: "Stock",
+						company: company,
+					},
+				};
+			},
 		},
 		{
-			"label": __("As On Date"),
-			"fieldname": "as_on_date",
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
+			label: __("As On Date"),
+			fieldname: "as_on_date",
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
 		},
 	],
 
@@ -42,7 +41,7 @@
 	},
 
 	onload(report) {
-		report.page.add_inner_button(__("Create Reposting Entries"), function() {
+		report.page.add_inner_button(__("Create Reposting Entries"), function () {
 			let message = `<div>
 				<p>
 					Reposting Entries will change the value of
@@ -54,7 +53,7 @@
 				</div>
 			`;
 			let indexes = frappe.query_report.datatable.rowmanager.getCheckedRows();
-			let selected_rows = indexes.map(i => frappe.query_report.data[i]);
+			let selected_rows = indexes.map((i) => frappe.query_report.data[i]);
 
 			if (!selected_rows.length) {
 				frappe.throw(__("Please select rows to create Reposting Entries"));
@@ -65,11 +64,10 @@
 					method: "erpnext.stock.report.stock_and_account_value_comparison.stock_and_account_value_comparison.create_reposting_entries",
 					args: {
 						rows: selected_rows,
-						company: frappe.query_report.get_filter_values().company
-					}
+						company: frappe.query_report.get_filter_values().company,
+					},
 				});
-
 			});
 		});
-	}
+	},
 };
diff --git a/erpnext/stock/report/stock_balance/stock_balance.js b/erpnext/stock/report/stock_balance/stock_balance.js
index fe6e83e..ca2c053 100644
--- a/erpnext/stock/report/stock_balance/stock_balance.js
+++ b/erpnext/stock/report/stock_balance/stock_balance.js
@@ -2,119 +2,118 @@
 // For license information, please see license.txt
 
 frappe.query_reports["Stock Balance"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"width": "80",
-			"options": "Company",
-			"default": frappe.defaults.get_default("company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Company",
+			default: frappe.defaults.get_default("company"),
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"width": "80",
-			"reqd": 1,
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			width: "80",
+			reqd: 1,
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"width": "80",
-			"reqd": 1,
-			"default": frappe.datetime.get_today()
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			width: "80",
+			reqd: 1,
+			default: frappe.datetime.get_today(),
 		},
 		{
-			"fieldname": "item_group",
-			"label": __("Item Group"),
-			"fieldtype": "Link",
-			"width": "80",
-			"options": "Item Group"
+			fieldname: "item_group",
+			label: __("Item Group"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Item Group",
 		},
 		{
-			"fieldname": "item_code",
-			"label": __("Item"),
-			"fieldtype": "Link",
-			"width": "80",
-			"options": "Item",
-			"get_query": function() {
+			fieldname: "item_code",
+			label: __("Item"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Item",
+			get_query: function () {
 				return {
 					query: "erpnext.controllers.queries.item_query",
 				};
-			}
+			},
 		},
 		{
-			"fieldname": "warehouse",
-			"label": __("Warehouse"),
-			"fieldtype": "Link",
-			"width": "80",
-			"options": "Warehouse",
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Warehouse",
 			get_query: () => {
 				let warehouse_type = frappe.query_report.get_filter_value("warehouse_type");
 				let company = frappe.query_report.get_filter_value("company");
 
 				return {
 					filters: {
-						...warehouse_type && {warehouse_type},
-						...company && {company}
-					}
-				}
-			}
+						...(warehouse_type && { warehouse_type }),
+						...(company && { company }),
+					},
+				};
+			},
 		},
 		{
-			"fieldname": "warehouse_type",
-			"label": __("Warehouse Type"),
-			"fieldtype": "Link",
-			"width": "80",
-			"options": "Warehouse Type"
+			fieldname: "warehouse_type",
+			label: __("Warehouse Type"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Warehouse Type",
 		},
 		{
-			"fieldname": "valuation_field_type",
-			"label": __("Valuation Field Type"),
-			"fieldtype": "Select",
-			"width": "80",
-			"options": "Currency\nFloat",
-			"default": "Currency"
+			fieldname: "valuation_field_type",
+			label: __("Valuation Field Type"),
+			fieldtype: "Select",
+			width: "80",
+			options: "Currency\nFloat",
+			default: "Currency",
 		},
 		{
-			"fieldname":"include_uom",
-			"label": __("Include UOM"),
-			"fieldtype": "Link",
-			"options": "UOM"
+			fieldname: "include_uom",
+			label: __("Include UOM"),
+			fieldtype: "Link",
+			options: "UOM",
 		},
 		{
-			"fieldname": "show_variant_attributes",
-			"label": __("Show Variant Attributes"),
-			"fieldtype": "Check"
+			fieldname: "show_variant_attributes",
+			label: __("Show Variant Attributes"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": 'show_stock_ageing_data',
-			"label": __('Show Stock Ageing Data'),
-			"fieldtype": 'Check'
+			fieldname: "show_stock_ageing_data",
+			label: __("Show Stock Ageing Data"),
+			fieldtype: "Check",
 		},
 		{
-			"fieldname": 'ignore_closing_balance',
-			"label": __('Ignore Closing Balance'),
-			"fieldtype": 'Check',
-			"default": 0
+			fieldname: "ignore_closing_balance",
+			label: __("Ignore Closing Balance"),
+			fieldtype: "Check",
+			default: 0,
 		},
 	],
 
-	"formatter": function (value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 
 		if (column.fieldname == "out_qty" && data && data.out_qty > 0) {
 			value = "<span style='color:red'>" + value + "</span>";
-		}
-		else if (column.fieldname == "in_qty" && data && data.in_qty > 0) {
+		} else if (column.fieldname == "in_qty" && data && data.in_qty > 0) {
 			value = "<span style='color:green'>" + value + "</span>";
 		}
 
 		return value;
-	}
+	},
 };
 
-erpnext.utils.add_inventory_dimensions('Stock Balance', 8);
\ No newline at end of file
+erpnext.utils.add_inventory_dimensions("Stock Balance", 8);
diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.js b/erpnext/stock/report/stock_ledger/stock_ledger.js
index baccd55..d4c11de 100644
--- a/erpnext/stock/report/stock_ledger/stock_ledger.js
+++ b/erpnext/stock/report/stock_ledger/stock_ledger.js
@@ -2,116 +2,115 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Stock Ledger"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-			"reqd": 1
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+			reqd: 1,
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"default": frappe.datetime.get_today(),
-			"reqd": 1
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			default: frappe.datetime.get_today(),
+			reqd: 1,
 		},
 		{
-			"fieldname":"warehouse",
-			"label": __("Warehouse"),
-			"fieldtype": "Link",
-			"options": "Warehouse",
-			"get_query": function() {
-				const company = frappe.query_report.get_filter_value('company');
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			options: "Warehouse",
+			get_query: function () {
+				const company = frappe.query_report.get_filter_value("company");
 				return {
-					filters: { 'company': company }
-				}
-			}
+					filters: { company: company },
+				};
+			},
 		},
 		{
-			"fieldname":"item_code",
-			"label": __("Item"),
-			"fieldtype": "Link",
-			"options": "Item",
-			"get_query": function() {
+			fieldname: "item_code",
+			label: __("Item"),
+			fieldtype: "Link",
+			options: "Item",
+			get_query: function () {
 				return {
-					query: "erpnext.controllers.queries.item_query"
-				}
-			}
+					query: "erpnext.controllers.queries.item_query",
+				};
+			},
 		},
 		{
-			"fieldname":"item_group",
-			"label": __("Item Group"),
-			"fieldtype": "Link",
-			"options": "Item Group"
+			fieldname: "item_group",
+			label: __("Item Group"),
+			fieldtype: "Link",
+			options: "Item Group",
 		},
 		{
-			"fieldname":"batch_no",
-			"label": __("Batch No"),
-			"fieldtype": "Link",
-			"options": "Batch",
+			fieldname: "batch_no",
+			label: __("Batch No"),
+			fieldtype: "Link",
+			options: "Batch",
 			on_change() {
-				const batch_no = frappe.query_report.get_filter_value('batch_no');
+				const batch_no = frappe.query_report.get_filter_value("batch_no");
 				if (batch_no) {
-					frappe.query_report.set_filter_value('segregate_serial_batch_bundle', 1);
+					frappe.query_report.set_filter_value("segregate_serial_batch_bundle", 1);
 				} else {
-					frappe.query_report.set_filter_value('segregate_serial_batch_bundle', 0);
+					frappe.query_report.set_filter_value("segregate_serial_batch_bundle", 0);
 				}
-			}
+			},
 		},
 		{
-			"fieldname":"brand",
-			"label": __("Brand"),
-			"fieldtype": "Link",
-			"options": "Brand"
+			fieldname: "brand",
+			label: __("Brand"),
+			fieldtype: "Link",
+			options: "Brand",
 		},
 		{
-			"fieldname":"voucher_no",
-			"label": __("Voucher #"),
-			"fieldtype": "Data"
+			fieldname: "voucher_no",
+			label: __("Voucher #"),
+			fieldtype: "Data",
 		},
 		{
-			"fieldname":"project",
-			"label": __("Project"),
-			"fieldtype": "Link",
-			"options": "Project"
+			fieldname: "project",
+			label: __("Project"),
+			fieldtype: "Link",
+			options: "Project",
 		},
 		{
-			"fieldname":"include_uom",
-			"label": __("Include UOM"),
-			"fieldtype": "Link",
-			"options": "UOM"
+			fieldname: "include_uom",
+			label: __("Include UOM"),
+			fieldtype: "Link",
+			options: "UOM",
 		},
 		{
-			"fieldname": "valuation_field_type",
-			"label": __("Valuation Field Type"),
-			"fieldtype": "Select",
-			"width": "80",
-			"options": "Currency\nFloat",
-			"default": "Currency"
+			fieldname: "valuation_field_type",
+			label: __("Valuation Field Type"),
+			fieldtype: "Select",
+			width: "80",
+			options: "Currency\nFloat",
+			default: "Currency",
 		},
 		{
-			"fieldname": "segregate_serial_batch_bundle",
-			"label": __("Segregate Serial / Batch Bundle"),
-			"fieldtype": "Check",
-			"default": 0
-		}
+			fieldname: "segregate_serial_batch_bundle",
+			label: __("Segregate Serial / Batch Bundle"),
+			fieldtype: "Check",
+			default: 0,
+		},
 	],
-	"formatter": function (value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 		if (column.fieldname == "out_qty" && data && data.out_qty < 0) {
 			value = "<span style='color:red'>" + value + "</span>";
-		}
-		else if (column.fieldname == "in_qty" && data && data.in_qty > 0) {
+		} else if (column.fieldname == "in_qty" && data && data.in_qty > 0) {
 			value = "<span style='color:green'>" + value + "</span>";
 		}
 
@@ -119,4 +118,4 @@
 	},
 };
 
-erpnext.utils.add_inventory_dimensions('Stock Ledger', 10);
\ No newline at end of file
+erpnext.utils.add_inventory_dimensions("Stock Ledger", 10);
diff --git a/erpnext/stock/report/stock_ledger_invariant_check/stock_ledger_invariant_check.js b/erpnext/stock/report/stock_ledger_invariant_check/stock_ledger_invariant_check.js
index 3f67bff..1b05d3a 100644
--- a/erpnext/stock/report/stock_ledger_invariant_check/stock_ledger_invariant_check.js
+++ b/erpnext/stock/report/stock_ledger_invariant_check/stock_ledger_invariant_check.js
@@ -1,44 +1,43 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 const DIFFERENCE_FIELD_NAMES = [
-	'difference_in_qty',
-	'fifo_qty_diff',
-	'fifo_value_diff',
-	'fifo_valuation_diff',
-	'valuation_diff',
-	'fifo_difference_diff',
-	'diff_value_diff'
+	"difference_in_qty",
+	"fifo_qty_diff",
+	"fifo_value_diff",
+	"fifo_valuation_diff",
+	"valuation_diff",
+	"fifo_difference_diff",
+	"diff_value_diff",
 ];
 
-frappe.query_reports['Stock Ledger Invariant Check'] = {
-	'filters': [
+frappe.query_reports["Stock Ledger Invariant Check"] = {
+	filters: [
 		{
-			'fieldname': 'item_code',
-			'fieldtype': 'Link',
-			'label': 'Item',
-			'mandatory': 1,
-			'options': 'Item',
-			get_query: function() {
+			fieldname: "item_code",
+			fieldtype: "Link",
+			label: "Item",
+			mandatory: 1,
+			options: "Item",
+			get_query: function () {
 				return {
-					filters: {is_stock_item: 1, has_serial_no: 0}
-				}
-			}
+					filters: { is_stock_item: 1, has_serial_no: 0 },
+				};
+			},
 		},
 		{
-			'fieldname': 'warehouse',
-			'fieldtype': 'Link',
-			'label': 'Warehouse',
-			'mandatory': 1,
-			'options': 'Warehouse',
-		}
+			fieldname: "warehouse",
+			fieldtype: "Link",
+			label: "Warehouse",
+			mandatory: 1,
+			options: "Warehouse",
+		},
 	],
 
-	formatter (value, row, column, data, default_formatter) {
+	formatter(value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 		if (DIFFERENCE_FIELD_NAMES.includes(column.fieldname) && Math.abs(data[column.fieldname]) > 0.001) {
-			value = '<span style="color:red">' + value + '</span>';
+			value = '<span style="color:red">' + value + "</span>";
 		}
 		return value;
 	},
@@ -50,7 +49,7 @@
 	},
 
 	onload(report) {
-		report.page.add_inner_button(__('Create Reposting Entry'), () => {
+		report.page.add_inner_button(__("Create Reposting Entry"), () => {
 			let message = `
 				<div>
 					<p>
@@ -62,23 +61,21 @@
 					<p>Are you sure you want to create a Reposting Entry?</p>
 				</div>`;
 			let indexes = frappe.query_report.datatable.rowmanager.getCheckedRows();
-			let selected_rows = indexes.map(i => frappe.query_report.data[i]);
+			let selected_rows = indexes.map((i) => frappe.query_report.data[i]);
 
 			if (!selected_rows.length) {
-				frappe.throw(__('Please select a row to create a Reposting Entry'));
-			}
-			else if (selected_rows.length > 1) {
-				frappe.throw(__('Please select only one row to create a Reposting Entry'));
-			}
-			else {
+				frappe.throw(__("Please select a row to create a Reposting Entry"));
+			} else if (selected_rows.length > 1) {
+				frappe.throw(__("Please select only one row to create a Reposting Entry"));
+			} else {
 				frappe.confirm(__(message), () => {
 					frappe.call({
-						method: 'erpnext.stock.report.stock_ledger_invariant_check.stock_ledger_invariant_check.create_reposting_entries',
+						method: "erpnext.stock.report.stock_ledger_invariant_check.stock_ledger_invariant_check.create_reposting_entries",
 						args: {
 							rows: selected_rows,
 							item_code: frappe.query_report.get_filter_values().item_code,
 							warehouse: frappe.query_report.get_filter_values().warehouse,
-						}
+						},
 					});
 				});
 			}
diff --git a/erpnext/stock/report/stock_ledger_variance/stock_ledger_variance.js b/erpnext/stock/report/stock_ledger_variance/stock_ledger_variance.js
index bf3a397..07e7b59 100644
--- a/erpnext/stock/report/stock_ledger_variance/stock_ledger_variance.js
+++ b/erpnext/stock/report/stock_ledger_variance/stock_ledger_variance.js
@@ -8,60 +8,55 @@
 	"fifo_valuation_diff",
 	"valuation_diff",
 	"fifo_difference_diff",
-	"diff_value_diff"
+	"diff_value_diff",
 ];
 
 frappe.query_reports["Stock Ledger Variance"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"reqd": 1,
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname": "item_code",
-			"fieldtype": "Link",
-			"label": __("Item"),
-			"options": "Item",
-			get_query: function() {
+			fieldname: "item_code",
+			fieldtype: "Link",
+			label: __("Item"),
+			options: "Item",
+			get_query: function () {
 				return {
-					filters: {is_stock_item: 1, has_serial_no: 0}
-				}
-			}
+					filters: { is_stock_item: 1, has_serial_no: 0 },
+				};
+			},
 		},
 		{
-			"fieldname": "warehouse",
-			"fieldtype": "Link",
-			"label": __("Warehouse"),
-			"options": "Warehouse",
-			get_query: function() {
+			fieldname: "warehouse",
+			fieldtype: "Link",
+			label: __("Warehouse"),
+			options: "Warehouse",
+			get_query: function () {
 				return {
-					filters: {is_group: 0, disabled: 0}
-				}
-			}
+					filters: { is_group: 0, disabled: 0 },
+				};
+			},
 		},
 		{
-			"fieldname": "difference_in",
-			"fieldtype": "Select",
-			"label": __("Difference In"),
-			"options": [
-				"",
-				"Qty",
-				"Value",
-				"Valuation",
-			],
+			fieldname: "difference_in",
+			fieldtype: "Select",
+			label: __("Difference In"),
+			options: ["", "Qty", "Value", "Valuation"],
 		},
 		{
-			"fieldname": "include_disabled",
-			"fieldtype": "Check",
-			"label": __("Include Disabled"),
-		}
+			fieldname: "include_disabled",
+			fieldtype: "Check",
+			label: __("Include Disabled"),
+		},
 	],
 
-	formatter (value, row, column, data, default_formatter) {
+	formatter(value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 
 		if (DIFFERENCE_FIELD_NAMES.includes(column.fieldname) && Math.abs(data[column.fieldname]) > 0.001) {
@@ -78,7 +73,7 @@
 	},
 
 	onload(report) {
-		report.page.add_inner_button(__('Create Reposting Entries'), () => {
+		report.page.add_inner_button(__("Create Reposting Entries"), () => {
 			let message = `
 				<div>
 					<p>
@@ -90,7 +85,7 @@
 					<p>Are you sure you want to create Reposting Entries?</p>
 				</div>`;
 			let indexes = frappe.query_report.datatable.rowmanager.getCheckedRows();
-			let selected_rows = indexes.map(i => frappe.query_report.data[i]);
+			let selected_rows = indexes.map((i) => frappe.query_report.data[i]);
 
 			if (!selected_rows.length) {
 				frappe.throw(__("Please select rows to create Reposting Entries"));
@@ -98,10 +93,10 @@
 
 			frappe.confirm(__(message), () => {
 				frappe.call({
-					method: 'erpnext.stock.report.stock_ledger_invariant_check.stock_ledger_invariant_check.create_reposting_entries',
+					method: "erpnext.stock.report.stock_ledger_invariant_check.stock_ledger_invariant_check.create_reposting_entries",
 					args: {
 						rows: selected_rows,
-					}
+					},
 				});
 			});
 		});
diff --git a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.js b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.js
index cb109f8..6e333aa 100644
--- a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.js
+++ b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.js
@@ -2,55 +2,55 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Stock Projected Qty"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname":"warehouse",
-			"label": __("Warehouse"),
-			"fieldtype": "Link",
-			"options": "Warehouse",
-			"get_query": () => {
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			options: "Warehouse",
+			get_query: () => {
 				return {
 					filters: {
-						company: frappe.query_report.get_filter_value('company')
-					}
-				}
-			}
+						company: frappe.query_report.get_filter_value("company"),
+					},
+				};
+			},
 		},
 		{
-			"fieldname":"item_code",
-			"label": __("Item"),
-			"fieldtype": "Link",
-			"options": "Item",
-			"get_query": function() {
+			fieldname: "item_code",
+			label: __("Item"),
+			fieldtype: "Link",
+			options: "Item",
+			get_query: function () {
 				return {
-					query: "erpnext.controllers.queries.item_query"
-				}
-			}
+					query: "erpnext.controllers.queries.item_query",
+				};
+			},
 		},
 		{
-			"fieldname":"item_group",
-			"label": __("Item Group"),
-			"fieldtype": "Link",
-			"options": "Item Group"
+			fieldname: "item_group",
+			label: __("Item Group"),
+			fieldtype: "Link",
+			options: "Item Group",
 		},
 		{
-			"fieldname":"brand",
-			"label": __("Brand"),
-			"fieldtype": "Link",
-			"options": "Brand"
+			fieldname: "brand",
+			label: __("Brand"),
+			fieldtype: "Link",
+			options: "Brand",
 		},
 		{
-			"fieldname":"include_uom",
-			"label": __("Include UOM"),
-			"fieldtype": "Link",
-			"options": "UOM"
-		}
-	]
-}
+			fieldname: "include_uom",
+			label: __("Include UOM"),
+			fieldtype: "Link",
+			options: "UOM",
+		},
+	],
+};
diff --git a/erpnext/stock/report/stock_qty_vs_serial_no_count/stock_qty_vs_serial_no_count.js b/erpnext/stock/report/stock_qty_vs_serial_no_count/stock_qty_vs_serial_no_count.js
index 7a48798..26cccb8 100644
--- a/erpnext/stock/report/stock_qty_vs_serial_no_count/stock_qty_vs_serial_no_count.js
+++ b/erpnext/stock/report/stock_qty_vs_serial_no_count/stock_qty_vs_serial_no_count.js
@@ -1,42 +1,40 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Stock Qty vs Serial No Count"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1,
 		},
 		{
-			"fieldname":"warehouse",
-			"label": __("Warehouse"),
-			"fieldtype": "Link",
-			"options": "Warehouse",
-			"get_query": function() {
-				const company = frappe.query_report.get_filter_value('company');
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			options: "Warehouse",
+			get_query: function () {
+				const company = frappe.query_report.get_filter_value("company");
 				return {
-					filters: { 'company': company }
-				}
+					filters: { company: company },
+				};
 			},
-			"reqd": 1
+			reqd: 1,
 		},
 	],
 
-	"formatter": function (value, row, column, data, default_formatter) {
+	formatter: function (value, row, column, data, default_formatter) {
 		value = default_formatter(value, row, column, data);
 		if (column.fieldname == "difference" && data) {
 			if (data.difference > 0) {
 				value = "<span style='color:red'>" + value + "</span>";
-			}
-			else if (data.difference < 0) {
+			} else if (data.difference < 0) {
 				value = "<span style='color:red'>" + value + "</span>";
 			}
 		}
 		return value;
-	}
+	},
 };
diff --git a/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.js b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.js
index 5b00647..92a01c4 100644
--- a/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.js
+++ b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.js
@@ -2,27 +2,27 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.query_reports["Supplier-Wise Sales Analytics"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"supplier",
-			"label": __("Supplier"),
-			"fieldtype": "Link",
-			"options": "Supplier",
-			"width": "80"
+			fieldname: "supplier",
+			label: __("Supplier"),
+			fieldtype: "Link",
+			options: "Supplier",
+			width: "80",
 		},
 		{
-			"fieldname":"from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"width": "80",
-			"default": frappe.datetime.month_start()
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			width: "80",
+			default: frappe.datetime.month_start(),
 		},
 		{
-			"fieldname":"to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"width": "80",
-			"default": frappe.datetime.month_end()
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			width: "80",
+			default: frappe.datetime.month_end(),
 		},
-	]
-}
+	],
+};
diff --git a/erpnext/stock/report/total_stock_summary/total_stock_summary.js b/erpnext/stock/report/total_stock_summary/total_stock_summary.js
index 3d247f6..1d31566 100644
--- a/erpnext/stock/report/total_stock_summary/total_stock_summary.js
+++ b/erpnext/stock/report/total_stock_summary/total_stock_summary.js
@@ -1,27 +1,26 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Total Stock Summary"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"group_by",
-			"label": __("Group By"),
-			"fieldtype": "Select",
-			"width": "80",
-			"reqd": 1,
-			"options": ["Warehouse", "Company"],
-			"default": "Warehouse",
+			fieldname: "group_by",
+			label: __("Group By"),
+			fieldtype: "Select",
+			width: "80",
+			reqd: 1,
+			options: ["Warehouse", "Company"],
+			default: "Warehouse",
 		},
 		{
-			"fieldname": "company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"width": "80",
-			"options": "Company",
-			"reqd": 1,
-			"default": frappe.defaults.get_user_default("Company"),
-			"depends_on": "eval: doc.group_by != 'Company'",
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_user_default("Company"),
+			depends_on: "eval: doc.group_by != 'Company'",
 		},
-	]
-}
+	],
+};
diff --git a/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.js b/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.js
index 8d6b283..137c786 100644
--- a/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.js
+++ b/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.js
@@ -1,51 +1,50 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Warehouse wise Item Balance Age and Value"] = {
-        "filters": [
-{
-                        "fieldname":"from_date",
-                        "label": __("From Date"),
-                        "fieldtype": "Date",
-                        "width": "80",
-                        "reqd": 1,
-                        "default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
-                },
-                {
-                        "fieldname":"to_date",
-                        "label": __("To Date"),
-                        "fieldtype": "Date",
-                        "width": "80",
-                        "reqd": 1,
-                        "default": frappe.datetime.get_today()
-                },
-                {
-                        "fieldname": "item_group",
-                        "label": __("Item Group"),
-                        "fieldtype": "Link",
-                        "width": "80",
-                        "options": "Item Group"
-                },
-                {
-                        "fieldname": "item_code",
-                        "label": __("Item"),
-                        "fieldtype": "Link",
-                        "width": "80",
-                        "options": "Item"
-                },
-                {
-                        "fieldname": "warehouse",
-                        "label": __("Warehouse"),
-                        "fieldtype": "Link",
-                        "width": "80",
-                        "options": "Warehouse"
-                },
-                {
-                        "fieldname": "filter_total_zero_qty",
-                        "label": __("Filter Total Zero Qty"),
-                        "fieldtype": "Check",
-                        "default": 1
-                },
-        ]
-}
+	filters: [
+		{
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			width: "80",
+			reqd: 1,
+			default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+		},
+		{
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			width: "80",
+			reqd: 1,
+			default: frappe.datetime.get_today(),
+		},
+		{
+			fieldname: "item_group",
+			label: __("Item Group"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Item Group",
+		},
+		{
+			fieldname: "item_code",
+			label: __("Item"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Item",
+		},
+		{
+			fieldname: "warehouse",
+			label: __("Warehouse"),
+			fieldtype: "Link",
+			width: "80",
+			options: "Warehouse",
+		},
+		{
+			fieldname: "filter_total_zero_qty",
+			label: __("Filter Total Zero Qty"),
+			fieldtype: "Check",
+			default: 1,
+		},
+	],
+};
diff --git a/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.js b/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.js
index 4a77052..ea09092 100644
--- a/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.js
+++ b/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.js
@@ -1,27 +1,25 @@
 // Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Warehouse Wise Stock Balance"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"reqd": 1,
-			"default": frappe.defaults.get_user_default("Company")
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			reqd: 1,
+			default: frappe.defaults.get_user_default("Company"),
 		},
 		{
-			"fieldname":"show_disabled_warehouses",
-			"label": __("Show Disabled Warehouses"),
-			"fieldtype": "Check",
-			"default": 0
-
-		}
+			fieldname: "show_disabled_warehouses",
+			label: __("Show Disabled Warehouses"),
+			fieldtype: "Check",
+			default: 0,
+		},
 	],
-	"initial_depth": 3,
-	"tree": true,
-	"parent_field": "parent_warehouse",
-	"name_field": "warehouse"
+	initial_depth: 3,
+	tree: true,
+	parent_field: "parent_warehouse",
+	name_field: "warehouse",
 };
diff --git a/erpnext/subcontracting/doctype/subcontracting_bom/subcontracting_bom.js b/erpnext/subcontracting/doctype/subcontracting_bom/subcontracting_bom.js
index a7f0d7a..43aac4a 100644
--- a/erpnext/subcontracting/doctype/subcontracting_bom/subcontracting_bom.js
+++ b/erpnext/subcontracting/doctype/subcontracting_bom/subcontracting_bom.js
@@ -1,40 +1,40 @@
 // Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Subcontracting BOM', {
-    setup: (frm) => {
-		frm.trigger('set_queries');
+frappe.ui.form.on("Subcontracting BOM", {
+	setup: (frm) => {
+		frm.trigger("set_queries");
 	},
 
-    set_queries: (frm) => {
-        frm.set_query('finished_good', () => {
-            return {
-                filters: {
-                    disabled: 0,
-                    is_stock_item: 1,
-                    default_bom: ['!=', ''],
-                    is_sub_contracted_item: 1,
-                }
-            }
-        });
+	set_queries: (frm) => {
+		frm.set_query("finished_good", () => {
+			return {
+				filters: {
+					disabled: 0,
+					is_stock_item: 1,
+					default_bom: ["!=", ""],
+					is_sub_contracted_item: 1,
+				},
+			};
+		});
 
-        frm.set_query('finished_good_bom', () => {
-            return {
-                filters: {
-                    docstatus: 1,
-                    is_active: 1,
-                    item: frm.doc.finished_good,
-                }
-            }
-        });
+		frm.set_query("finished_good_bom", () => {
+			return {
+				filters: {
+					docstatus: 1,
+					is_active: 1,
+					item: frm.doc.finished_good,
+				},
+			};
+		});
 
-        frm.set_query('service_item', () => {
-            return {
-                filters: {
-                    disabled: 0,
-                    is_stock_item: 0,
-                }
-            }
-        });
-    }
+		frm.set_query("service_item", () => {
+			return {
+				filters: {
+					disabled: 0,
+					is_stock_item: 0,
+				},
+			};
+		});
+	},
 });
diff --git a/erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order.js b/erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order.js
index 4c8a0ad..9d788f0 100644
--- a/erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order.js
+++ b/erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order.js
@@ -1,101 +1,100 @@
 // Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.provide('erpnext.buying');
+frappe.provide("erpnext.buying");
 
 erpnext.landed_cost_taxes_and_charges.setup_triggers("Subcontracting Order");
 
-frappe.ui.form.on('Subcontracting Order', {
+frappe.ui.form.on("Subcontracting Order", {
 	setup: (frm) => {
 		frm.get_field("items").grid.cannot_add_rows = true;
 		frm.get_field("items").grid.only_sortable();
 
-		frm.set_indicator_formatter('item_code',
-			(doc) => (doc.qty <= doc.received_qty) ? 'green' : 'orange');
+		frm.set_indicator_formatter("item_code", (doc) => (doc.qty <= doc.received_qty ? "green" : "orange"));
 
-		frm.set_query('supplier_warehouse', () => {
+		frm.set_query("supplier_warehouse", () => {
 			return {
 				filters: {
 					company: frm.doc.company,
-					is_group: 0
-				}
+					is_group: 0,
+				},
 			};
 		});
 
-		frm.set_query('purchase_order', () => {
+		frm.set_query("purchase_order", () => {
 			return {
 				filters: {
 					docstatus: 1,
 					is_subcontracted: 1,
-					is_old_subcontracting_flow: 0
-				}
+					is_old_subcontracting_flow: 0,
+				},
 			};
 		});
 
-		frm.set_query('set_warehouse', () => {
+		frm.set_query("set_warehouse", () => {
 			return {
 				filters: {
 					company: frm.doc.company,
-					is_group: 0
-				}
+					is_group: 0,
+				},
 			};
 		});
 
-		frm.set_query('warehouse', 'items', () => ({
+		frm.set_query("warehouse", "items", () => ({
 			filters: {
 				company: frm.doc.company,
-				is_group: 0
-			}
+				is_group: 0,
+			},
 		}));
 
-		frm.set_query('expense_account', 'items', () => ({
-			query: 'erpnext.controllers.queries.get_expense_account',
+		frm.set_query("expense_account", "items", () => ({
+			query: "erpnext.controllers.queries.get_expense_account",
 			filters: {
-				company: frm.doc.company
-			}
+				company: frm.doc.company,
+			},
 		}));
 
-		frm.set_query('bom', 'items', (doc, cdt, cdn) => {
+		frm.set_query("bom", "items", (doc, cdt, cdn) => {
 			let d = locals[cdt][cdn];
 			return {
 				filters: {
 					item: d.item_code,
 					is_active: 1,
 					docstatus: 1,
-					company: frm.doc.company
-				}
+					company: frm.doc.company,
+				},
 			};
 		});
 
-		frm.set_query('set_reserve_warehouse', () => {
+		frm.set_query("set_reserve_warehouse", () => {
 			return {
 				filters: {
 					company: frm.doc.company,
-					name: ['!=', frm.doc.supplier_warehouse],
-					is_group: 0
-				}
+					name: ["!=", frm.doc.supplier_warehouse],
+					is_group: 0,
+				},
 			};
 		});
 	},
 
 	onload: (frm) => {
 		if (!frm.doc.transaction_date) {
-			frm.set_value('transaction_date', frappe.datetime.get_today());
+			frm.set_value("transaction_date", frappe.datetime.get_today());
 		}
 	},
 
 	purchase_order: (frm) => {
-		frm.set_value('service_items', null);
-		frm.set_value('items', null);
-		frm.set_value('supplied_items', null);
+		frm.set_value("service_items", null);
+		frm.set_value("items", null);
+		frm.set_value("supplied_items", null);
 
 		if (frm.doc.purchase_order) {
 			erpnext.utils.map_current_doc({
-				method: 'erpnext.buying.doctype.purchase_order.purchase_order.make_subcontracting_order',
+				method: "erpnext.buying.doctype.purchase_order.purchase_order.make_subcontracting_order",
 				source_name: frm.doc.purchase_order,
 				target_doc: frm,
 				freeze: true,
-				freeze_message: __('Mapping Subcontracting Order ...'),
+				freeze_message: __("Mapping Subcontracting Order ..."),
 			});
 		}
 	},
@@ -103,13 +102,21 @@
 	refresh: function (frm) {
 		if (frm.doc.docstatus == 1 && frm.has_perm("submit")) {
 			if (frm.doc.status == "Closed") {
-				frm.add_custom_button(__('Re-open'), () => frm.events.update_subcontracting_order_status(frm), __("Status"));
-			} else if(flt(frm.doc.per_received, 2) < 100) {
-				frm.add_custom_button(__('Close'), () => frm.events.update_subcontracting_order_status(frm, "Closed"), __("Status"));
+				frm.add_custom_button(
+					__("Re-open"),
+					() => frm.events.update_subcontracting_order_status(frm),
+					__("Status")
+				);
+			} else if (flt(frm.doc.per_received, 2) < 100) {
+				frm.add_custom_button(
+					__("Close"),
+					() => frm.events.update_subcontracting_order_status(frm, "Closed"),
+					__("Status")
+				);
 			}
 		}
 
-		frm.trigger('get_materials_from_supplier');
+		frm.trigger("get_materials_from_supplier");
 	},
 
 	update_subcontracting_order_status(frm, status) {
@@ -131,7 +138,7 @@
 		let sco_rm_details = [];
 
 		if (frm.doc.status != "Closed" && frm.doc.supplied_items) {
-			frm.doc.supplied_items.forEach(d => {
+			frm.doc.supplied_items.forEach((d) => {
 				if (d.total_supplied_qty > 0 && d.total_supplied_qty != d.consumed_qty) {
 					sco_rm_details.push(d.name);
 				}
@@ -139,43 +146,47 @@
 		}
 
 		if (sco_rm_details && sco_rm_details.length) {
-			frm.add_custom_button(__('Return of Components'), () => {
-				frm.call({
-					method: 'erpnext.controllers.subcontracting_controller.get_materials_from_supplier',
-					freeze: true,
-					freeze_message: __('Creating Stock Entry'),
-					args: {
-						subcontract_order: frm.doc.name,
-						rm_details: sco_rm_details,
-						order_doctype: cur_frm.doc.doctype
-					},
-					callback: function (r) {
-						if (r && r.message) {
-							const doc = frappe.model.sync(r.message);
-							frappe.set_route("Form", doc[0].doctype, doc[0].name);
-						}
-					}
-				});
-			}, __('Create'));
+			frm.add_custom_button(
+				__("Return of Components"),
+				() => {
+					frm.call({
+						method: "erpnext.controllers.subcontracting_controller.get_materials_from_supplier",
+						freeze: true,
+						freeze_message: __("Creating Stock Entry"),
+						args: {
+							subcontract_order: frm.doc.name,
+							rm_details: sco_rm_details,
+							order_doctype: cur_frm.doc.doctype,
+						},
+						callback: function (r) {
+							if (r && r.message) {
+								const doc = frappe.model.sync(r.message);
+								frappe.set_route("Form", doc[0].doctype, doc[0].name);
+							}
+						},
+					});
+				},
+				__("Create")
+			);
 		}
-	}
+	},
 });
 
-frappe.ui.form.on('Landed Cost Taxes and Charges', {
+frappe.ui.form.on("Landed Cost Taxes and Charges", {
 	amount: function (frm, cdt, cdn) {
 		frm.events.set_base_amount(frm, cdt, cdn);
 	},
 
 	expense_account: function (frm, cdt, cdn) {
 		frm.events.set_account_currency(frm, cdt, cdn);
-	}
+	},
 });
 
 erpnext.buying.SubcontractingOrderController = class SubcontractingOrderController {
 	setup() {
 		this.frm.custom_make_buttons = {
-			'Subcontracting Receipt': 'Subcontracting Receipt',
-			'Stock Entry': 'Material to Supplier',
+			"Subcontracting Receipt": "Subcontracting Receipt",
+			"Stock Entry": "Material to Supplier",
 		};
 	}
 
@@ -183,14 +194,22 @@
 		var me = this;
 
 		if (doc.docstatus == 1) {
-			if (!['Closed', 'Completed'].includes(doc.status)) {
+			if (!["Closed", "Completed"].includes(doc.status)) {
 				if (flt(doc.per_received) < 100) {
-					cur_frm.add_custom_button(__('Subcontracting Receipt'), this.make_subcontracting_receipt, __('Create'));
+					cur_frm.add_custom_button(
+						__("Subcontracting Receipt"),
+						this.make_subcontracting_receipt,
+						__("Create")
+					);
 					if (me.has_unsupplied_items()) {
-						cur_frm.add_custom_button(__('Material to Supplier'), this.make_stock_entry, __('Transfer'));
+						cur_frm.add_custom_button(
+							__("Material to Supplier"),
+							this.make_stock_entry,
+							__("Transfer")
+						);
 					}
 				}
-				cur_frm.page.set_inner_btn_group_as_primary(__('Create'));
+				cur_frm.page.set_inner_btn_group_as_primary(__("Create"));
 			}
 		}
 	}
@@ -216,30 +235,32 @@
 	}
 
 	has_unsupplied_items() {
-		return this.frm.doc['supplied_items'].some(item => item.required_qty > (item.supplied_qty - item.returned_qty));
+		return this.frm.doc["supplied_items"].some(
+			(item) => item.required_qty > item.supplied_qty - item.returned_qty
+		);
 	}
 
 	make_subcontracting_receipt() {
 		frappe.model.open_mapped_doc({
-			method: 'erpnext.subcontracting.doctype.subcontracting_order.subcontracting_order.make_subcontracting_receipt',
+			method: "erpnext.subcontracting.doctype.subcontracting_order.subcontracting_order.make_subcontracting_receipt",
 			frm: cur_frm,
-			freeze_message: __('Creating Subcontracting Receipt ...')
+			freeze_message: __("Creating Subcontracting Receipt ..."),
 		});
 	}
 
 	make_stock_entry() {
 		frappe.call({
-			method: 'erpnext.controllers.subcontracting_controller.make_rm_stock_entry',
+			method: "erpnext.controllers.subcontracting_controller.make_rm_stock_entry",
 			args: {
 				subcontract_order: cur_frm.doc.name,
-				order_doctype: cur_frm.doc.doctype
+				order_doctype: cur_frm.doc.doctype,
 			},
 			callback: (r) => {
 				var doclist = frappe.model.sync(r.message);
-				frappe.set_route('Form', doclist[0].doctype, doclist[0].name);
-			}
+				frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
+			},
 		});
 	}
 };
 
-extend_cscript(cur_frm.cscript, new erpnext.buying.SubcontractingOrderController({ frm: cur_frm }));
\ No newline at end of file
+extend_cscript(cur_frm.cscript, new erpnext.buying.SubcontractingOrderController({ frm: cur_frm }));
diff --git a/erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order_list.js b/erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order_list.js
index ec54944..895ffdb 100644
--- a/erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order_list.js
+++ b/erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order_list.js
@@ -1,18 +1,18 @@
 // Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.listview_settings['Subcontracting Order'] = {
+frappe.listview_settings["Subcontracting Order"] = {
 	get_indicator: function (doc) {
 		const status_colors = {
-			"Draft": "grey",
-			"Open": "orange",
+			Draft: "grey",
+			Open: "orange",
 			"Partially Received": "yellow",
-			"Completed": "green",
+			Completed: "green",
 			"Partial Material Transferred": "purple",
 			"Material Transferred": "blue",
-			"Closed": "green",
-			"Cancelled": "red",
+			Closed: "green",
+			Cancelled: "red",
 		};
 		return [__(doc.status), status_colors[doc.status], "status,=," + doc.status];
 	},
-};
\ No newline at end of file
+};
diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js
index 0535799..aeff2f6 100644
--- a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js
+++ b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js
@@ -1,20 +1,20 @@
 // Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.provide('erpnext.buying');
+frappe.provide("erpnext.buying");
 
-erpnext.landed_cost_taxes_and_charges.setup_triggers('Subcontracting Receipt');
+erpnext.landed_cost_taxes_and_charges.setup_triggers("Subcontracting Receipt");
 
-frappe.ui.form.on('Subcontracting Receipt', {
+frappe.ui.form.on("Subcontracting Receipt", {
 	setup: (frm) => {
-		frm.ignore_doctypes_on_cancel_all = ['Serial and Batch Bundle'];
-		frm.get_field('supplied_items').grid.cannot_add_rows = true;
-		frm.get_field('supplied_items').grid.only_sortable();
-		frm.trigger('set_queries');
+		frm.ignore_doctypes_on_cancel_all = ["Serial and Batch Bundle"];
+		frm.get_field("supplied_items").grid.cannot_add_rows = true;
+		frm.get_field("supplied_items").grid.only_sortable();
+		frm.trigger("set_queries");
 
 		frm.custom_make_buttons = {
-			'Purchase Receipt': 'Purchase Receipt',
-		}
+			"Purchase Receipt": "Purchase Receipt",
+		};
 	},
 
 	on_submit(frm) {
@@ -24,198 +24,222 @@
 	refresh_serial_batch_bundle_field(frm) {
 		frappe.route_hooks.after_submit = (frm_obj) => {
 			frm_obj.reload_doc();
-		}
+		};
 	},
 
 	refresh: (frm) => {
 		if (frm.doc.docstatus === 1) {
-			frm.add_custom_button(__('Stock Ledger'), () => {
-				frappe.route_options = {
-					voucher_no: frm.doc.name,
-					from_date: frm.doc.posting_date,
-					to_date: moment(frm.doc.modified).format('YYYY-MM-DD'),
-					company: frm.doc.company,
-					show_cancelled_entries: frm.doc.docstatus === 2
-				}
-				frappe.set_route('query-report', 'Stock Ledger');
-			}, __('View'));
+			frm.add_custom_button(
+				__("Stock Ledger"),
+				() => {
+					frappe.route_options = {
+						voucher_no: frm.doc.name,
+						from_date: frm.doc.posting_date,
+						to_date: moment(frm.doc.modified).format("YYYY-MM-DD"),
+						company: frm.doc.company,
+						show_cancelled_entries: frm.doc.docstatus === 2,
+					};
+					frappe.set_route("query-report", "Stock Ledger");
+				},
+				__("View")
+			);
 
-			frm.add_custom_button(__('Accounting Ledger'), () => {
-				frappe.route_options = {
-					voucher_no: frm.doc.name,
-					from_date: frm.doc.posting_date,
-					to_date: moment(frm.doc.modified).format('YYYY-MM-DD'),
-					company: frm.doc.company,
-					group_by: 'Group by Voucher (Consolidated)',
-					show_cancelled_entries: frm.doc.docstatus === 2
-				}
-				frappe.set_route('query-report', 'General Ledger');
-			}, __('View'));
+			frm.add_custom_button(
+				__("Accounting Ledger"),
+				() => {
+					frappe.route_options = {
+						voucher_no: frm.doc.name,
+						from_date: frm.doc.posting_date,
+						to_date: moment(frm.doc.modified).format("YYYY-MM-DD"),
+						company: frm.doc.company,
+						group_by: "Group by Voucher (Consolidated)",
+						show_cancelled_entries: frm.doc.docstatus === 2,
+					};
+					frappe.set_route("query-report", "General Ledger");
+				},
+				__("View")
+			);
 
 			if (frm.doc.is_return === 0) {
-				frm.add_custom_button(__('Purchase Receipt'), () => {
-					frappe.model.open_mapped_doc({
-						method: 'erpnext.subcontracting.doctype.subcontracting_receipt.subcontracting_receipt.make_purchase_receipt',
-						frm: frm,
-						freeze: true,
-						freeze_message: __('Creating Purchase Receipt ...')
-					});
-				}, __('Create'));
+				frm.add_custom_button(
+					__("Purchase Receipt"),
+					() => {
+						frappe.model.open_mapped_doc({
+							method: "erpnext.subcontracting.doctype.subcontracting_receipt.subcontracting_receipt.make_purchase_receipt",
+							frm: frm,
+							freeze: true,
+							freeze_message: __("Creating Purchase Receipt ..."),
+						});
+					},
+					__("Create")
+				);
 			}
 		}
 
 		if (!frm.doc.is_return && frm.doc.docstatus === 1 && frm.doc.per_returned < 100) {
-			frm.add_custom_button(__('Subcontract Return'), () => {
-				frappe.model.open_mapped_doc({
-					method: 'erpnext.subcontracting.doctype.subcontracting_receipt.subcontracting_receipt.make_subcontract_return',
-					frm: frm
-				});
-			}, __('Create'));
-			frm.page.set_inner_btn_group_as_primary(__('Create'));
+			frm.add_custom_button(
+				__("Subcontract Return"),
+				() => {
+					frappe.model.open_mapped_doc({
+						method: "erpnext.subcontracting.doctype.subcontracting_receipt.subcontracting_receipt.make_subcontract_return",
+						frm: frm,
+					});
+				},
+				__("Create")
+			);
+			frm.page.set_inner_btn_group_as_primary(__("Create"));
 		}
 
 		if (frm.doc.docstatus === 0) {
-			frm.add_custom_button(__('Subcontracting Order'), () => {
-				if (!frm.doc.supplier) {
-					frappe.throw({
-						title: __('Mandatory'),
-						message: __('Please Select a Supplier')
-					});
-				}
-
-				erpnext.utils.map_current_doc({
-					method: 'erpnext.subcontracting.doctype.subcontracting_order.subcontracting_order.make_subcontracting_receipt',
-					source_doctype: 'Subcontracting Order',
-					target: frm,
-					setters: {
-						supplier: frm.doc.supplier,
-					},
-					get_query_filters: {
-						docstatus: 1,
-						per_received: ['<', 100],
-						company: frm.doc.company,
-						status: ['!=', 'Closed'],
+			frm.add_custom_button(
+				__("Subcontracting Order"),
+				() => {
+					if (!frm.doc.supplier) {
+						frappe.throw({
+							title: __("Mandatory"),
+							message: __("Please Select a Supplier"),
+						});
 					}
-				});
-			}, __('Get Items From'));
 
-			frm.fields_dict.supplied_items.grid.update_docfield_property('consumed_qty', 'read_only', frm.doc.__onload && frm.doc.__onload.backflush_based_on === 'BOM');
+					erpnext.utils.map_current_doc({
+						method: "erpnext.subcontracting.doctype.subcontracting_order.subcontracting_order.make_subcontracting_receipt",
+						source_doctype: "Subcontracting Order",
+						target: frm,
+						setters: {
+							supplier: frm.doc.supplier,
+						},
+						get_query_filters: {
+							docstatus: 1,
+							per_received: ["<", 100],
+							company: frm.doc.company,
+							status: ["!=", "Closed"],
+						},
+					});
+				},
+				__("Get Items From")
+			);
+
+			frm.fields_dict.supplied_items.grid.update_docfield_property(
+				"consumed_qty",
+				"read_only",
+				frm.doc.__onload && frm.doc.__onload.backflush_based_on === "BOM"
+			);
 		}
 
-		frm.trigger('setup_quality_inspection');
-		frm.trigger('set_route_options_for_new_doc');
+		frm.trigger("setup_quality_inspection");
+		frm.trigger("set_route_options_for_new_doc");
 	},
 
 	set_warehouse: (frm) => {
-		set_warehouse_in_children(frm.doc.items, 'warehouse', frm.doc.set_warehouse);
+		set_warehouse_in_children(frm.doc.items, "warehouse", frm.doc.set_warehouse);
 	},
 
 	rejected_warehouse: (frm) => {
-		set_warehouse_in_children(frm.doc.items, 'rejected_warehouse', frm.doc.rejected_warehouse);
+		set_warehouse_in_children(frm.doc.items, "rejected_warehouse", frm.doc.rejected_warehouse);
 	},
 
 	get_scrap_items: (frm) => {
 		frappe.call({
 			doc: frm.doc,
-			method: 'get_scrap_items',
+			method: "get_scrap_items",
 			args: {
-				recalculate_rate: true
+				recalculate_rate: true,
 			},
 			freeze: true,
-			freeze_message: __('Getting Scrap Items'),
+			freeze_message: __("Getting Scrap Items"),
 			callback: (r) => {
 				if (!r.exc) {
 					frm.refresh();
 				}
-			}
+			},
 		});
 	},
 
 	set_queries: (frm) => {
-		frm.set_query('set_warehouse', () => {
+		frm.set_query("set_warehouse", () => {
 			return {
 				filters: {
 					company: frm.doc.company,
-					is_group: 0
-				}
-			}
+					is_group: 0,
+				},
+			};
 		});
 
-		frm.set_query('rejected_warehouse', () => {
+		frm.set_query("rejected_warehouse", () => {
 			return {
 				filters: {
 					company: frm.doc.company,
-					is_group: 0
-				}
-			}
+					is_group: 0,
+				},
+			};
 		});
 
-		frm.set_query('supplier_warehouse', () => {
+		frm.set_query("supplier_warehouse", () => {
 			return {
 				filters: {
 					company: frm.doc.company,
-					is_group: 0
-				}
-			}
+					is_group: 0,
+				},
+			};
 		});
 
-		frm.set_query('warehouse', 'items', () => ({
+		frm.set_query("warehouse", "items", () => ({
 			filters: {
 				company: frm.doc.company,
-				is_group: 0
-			}
+				is_group: 0,
+			},
 		}));
 
-		frm.set_query('rejected_warehouse', 'items', () => ({
+		frm.set_query("rejected_warehouse", "items", () => ({
 			filters: {
 				company: frm.doc.company,
-				is_group: 0
-			}
+				is_group: 0,
+			},
 		}));
 
-		frm.set_query('expense_account', 'items', () => {
+		frm.set_query("expense_account", "items", () => {
 			return {
-				query: 'erpnext.controllers.queries.get_expense_account',
-				filters: { 'company': frm.doc.company }
-			}
+				query: "erpnext.controllers.queries.get_expense_account",
+				filters: { company: frm.doc.company },
+			};
 		});
 
-		frm.set_query('batch_no', 'items', (doc, cdt, cdn) => {
+		frm.set_query("batch_no", "items", (doc, cdt, cdn) => {
 			var row = locals[cdt][cdn];
 			return {
 				filters: {
-					item: row.item_code
-				}
-			}
+					item: row.item_code,
+				},
+			};
 		});
 
-		frm.set_query('serial_and_batch_bundle', 'items', (doc, cdt, cdn) => {
+		frm.set_query("serial_and_batch_bundle", "items", (doc, cdt, cdn) => {
 			return frm.events.get_serial_and_batch_bundle_filters(doc, cdt, cdn);
 		});
 
-		frm.set_query('rejected_serial_and_batch_bundle', 'items', (doc, cdt, cdn) => {
+		frm.set_query("rejected_serial_and_batch_bundle", "items", (doc, cdt, cdn) => {
 			return frm.events.get_serial_and_batch_bundle_filters(doc, cdt, cdn);
 		});
 
-		frm.set_query('batch_no', 'supplied_items', (doc, cdt, cdn) => {
+		frm.set_query("batch_no", "supplied_items", (doc, cdt, cdn) => {
 			var row = locals[cdt][cdn];
 			return {
 				filters: {
-					item: row.rm_item_code
-				}
-			}
+					item: row.rm_item_code,
+				},
+			};
 		});
 
-		frm.set_query('serial_and_batch_bundle', 'supplied_items', (doc, cdt, cdn) => {
+		frm.set_query("serial_and_batch_bundle", "supplied_items", (doc, cdt, cdn) => {
 			let row = locals[cdt][cdn];
 			return {
 				filters: {
-					'item_code': row.rm_item_code,
-					'voucher_type': doc.doctype,
-					'voucher_no': ['in', [doc.name, '']],
-					'is_cancelled': 0,
-				}
-			}
+					item_code: row.rm_item_code,
+					voucher_type: doc.doctype,
+					voucher_no: ["in", [doc.name, ""]],
+					is_cancelled: 0,
+				},
+			};
 		});
 	},
 
@@ -223,12 +247,12 @@
 		let row = locals[cdt][cdn];
 		return {
 			filters: {
-				'item_code': row.item_code,
-				'voucher_type': doc.doctype,
-				'voucher_no': ['in', [doc.name, '']],
-				'is_cancelled': 0,
-			}
-		}
+				item_code: row.item_code,
+				voucher_type: doc.doctype,
+				voucher_no: ["in", [doc.name, ""]],
+				is_cancelled: 0,
+			},
+		};
 	},
 
 	setup_quality_inspection: (frm) => {
@@ -239,48 +263,48 @@
 	},
 
 	set_route_options_for_new_doc: (frm) => {
-		let batch_no_field = frm.get_docfield('items', 'batch_no');
+		let batch_no_field = frm.get_docfield("items", "batch_no");
 		if (batch_no_field) {
 			batch_no_field.get_route_options_for_new_doc = (row) => {
 				return {
-					'item': row.doc.item_code
-				}
-			}
+					item: row.doc.item_code,
+				};
+			};
 		}
 
-		let item_sbb_field = frm.get_docfield('items', 'serial_and_batch_bundle');
+		let item_sbb_field = frm.get_docfield("items", "serial_and_batch_bundle");
 		if (item_sbb_field) {
 			item_sbb_field.get_route_options_for_new_doc = (row) => {
 				return {
-					'item_code': row.doc.item_code,
-					'voucher_type': frm.doc.doctype,
-				}
-			}
+					item_code: row.doc.item_code,
+					voucher_type: frm.doc.doctype,
+				};
+			};
 		}
 
-		let rejected_item_sbb_field = frm.get_docfield('items', 'rejected_serial_and_batch_bundle');
+		let rejected_item_sbb_field = frm.get_docfield("items", "rejected_serial_and_batch_bundle");
 		if (rejected_item_sbb_field) {
 			rejected_item_sbb_field.get_route_options_for_new_doc = (row) => {
 				return {
-					'item_code': row.doc.item_code,
-					'voucher_type': frm.doc.doctype,
-				}
-			}
+					item_code: row.doc.item_code,
+					voucher_type: frm.doc.doctype,
+				};
+			};
 		}
 
-		let rm_sbb_field = frm.get_docfield('supplied_items', 'serial_and_batch_bundle');
+		let rm_sbb_field = frm.get_docfield("supplied_items", "serial_and_batch_bundle");
 		if (rm_sbb_field) {
 			rm_sbb_field.get_route_options_for_new_doc = (row) => {
 				return {
-					'item_code': row.doc.rm_item_code,
-					'voucher_type': frm.doc.doctype,
-				}
-			}
+					item_code: row.doc.rm_item_code,
+					voucher_type: frm.doc.doctype,
+				};
+			};
 		}
 	},
 });
 
-frappe.ui.form.on('Landed Cost Taxes and Charges', {
+frappe.ui.form.on("Landed Cost Taxes and Charges", {
 	amount: (frm, cdt, cdn) => {
 		set_missing_values(frm);
 		frm.events.set_base_amount(frm, cdt, cdn);
@@ -292,10 +316,10 @@
 
 	additional_costs_remove: (frm) => {
 		set_missing_values(frm);
-	}
+	},
 });
 
-frappe.ui.form.on('Subcontracting Receipt Item', {
+frappe.ui.form.on("Subcontracting Receipt Item", {
 	item_code(frm) {
 		set_missing_values(frm);
 	},
@@ -313,7 +337,7 @@
 	},
 });
 
-frappe.ui.form.on('Subcontracting Receipt Supplied Item', {
+frappe.ui.form.on("Subcontracting Receipt Supplied Item", {
 	consumed_qty(frm) {
 		set_missing_values(frm);
 	},
@@ -322,14 +346,14 @@
 let set_warehouse_in_children = (child_table, warehouse_field, warehouse) => {
 	let transaction_controller = new erpnext.TransactionController();
 	transaction_controller.autofill_warehouse(child_table, warehouse_field, warehouse);
-}
+};
 
 let set_missing_values = (frm) => {
 	frappe.call({
 		doc: frm.doc,
-		method: 'set_missing_values',
+		method: "set_missing_values",
 		callback: (r) => {
 			if (!r.exc) frm.refresh();
 		},
 	});
-}
+};
diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt_list.js b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt_list.js
index 14a4e4a..be6c0d0 100644
--- a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt_list.js
+++ b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt_list.js
@@ -1,14 +1,14 @@
 // Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.listview_settings['Subcontracting Receipt'] = {
+frappe.listview_settings["Subcontracting Receipt"] = {
 	get_indicator: function (doc) {
 		const status_colors = {
-			"Draft": "grey",
-			"Return": "gray",
+			Draft: "grey",
+			Return: "gray",
 			"Return Issued": "grey",
-			"Completed": "green",
+			Completed: "green",
 		};
 		return [__(doc.status), status_colors[doc.status], "status,=," + doc.status];
 	},
-};
\ No newline at end of file
+};
diff --git a/erpnext/support/doctype/issue/issue.js b/erpnext/support/doctype/issue/issue.js
index 9f91dc1..03d209e 100644
--- a/erpnext/support/doctype/issue/issue.js
+++ b/erpnext/support/doctype/issue/issue.js
@@ -1,40 +1,47 @@
 frappe.ui.form.on("Issue", {
-	onload: function(frm) {
+	onload: function (frm) {
 		frm.email_field = "raised_by";
 
-		frappe.db.get_value("Support Settings", {name: "Support Settings"},
-			["allow_resetting_service_level_agreement", "track_service_level_agreement"], (r) => {
+		frappe.db.get_value(
+			"Support Settings",
+			{ name: "Support Settings" },
+			["allow_resetting_service_level_agreement", "track_service_level_agreement"],
+			(r) => {
 				if (r && r.track_service_level_agreement == "0") {
 					frm.set_df_property("service_level_section", "hidden", 1);
 				}
 				if (r && r.allow_resetting_service_level_agreement == "0") {
 					frm.set_df_property("reset_service_level_agreement", "hidden", 1);
 				}
-			});
+			}
+		);
 
 		// buttons
 		if (frm.doc.status !== "Closed") {
-			frm.add_custom_button(__("Close"), function() {
+			frm.add_custom_button(__("Close"), function () {
 				frm.set_value("status", "Closed");
 				frm.save();
 			});
 
-			frm.add_custom_button(__("Task"), function() {
-				frappe.model.open_mapped_doc({
-					method: "erpnext.support.doctype.issue.issue.make_task",
-					frm: frm
-				});
-			}, __("Create"));
-
+			frm.add_custom_button(
+				__("Task"),
+				function () {
+					frappe.model.open_mapped_doc({
+						method: "erpnext.support.doctype.issue.issue.make_task",
+						frm: frm,
+					});
+				},
+				__("Create")
+			);
 		} else {
-			frm.add_custom_button(__("Reopen"), function() {
+			frm.add_custom_button(__("Reopen"), function () {
 				frm.set_value("status", "Open");
 				frm.save();
 			});
 		}
 	},
 
-	reset_service_level_agreement: function(frm) {
+	reset_service_level_agreement: function (frm) {
 		let reset_sla = new frappe.ui.Dialog({
 			title: __("Reset Service Level Agreement"),
 			fields: [
@@ -42,8 +49,8 @@
 					fieldtype: "Data",
 					fieldname: "reason",
 					label: __("Reason"),
-					reqd: 1
-				}
+					reqd: 1,
+				},
 			],
 			primary_action_label: __("Reset"),
 			primary_action: (values) => {
@@ -53,39 +60,42 @@
 
 				frappe.show_alert({
 					indicator: "green",
-					message: __("Resetting Service Level Agreement.")
+					message: __("Resetting Service Level Agreement."),
 				});
 
-				frappe.call("erpnext.support.doctype.service_level_agreement.service_level_agreement.reset_service_level_agreement", {
-					reason: values.reason,
-					user: frappe.session.user_email,
-					doctype: frm.doc.doctype,
-					docname: frm.doc.name,
-				}, () => {
-					reset_sla.enable_primary_action();
-					frm.refresh();
-					frappe.msgprint(__("Service Level Agreement was reset."));
-				});
-			}
+				frappe.call(
+					"erpnext.support.doctype.service_level_agreement.service_level_agreement.reset_service_level_agreement",
+					{
+						reason: values.reason,
+						user: frappe.session.user_email,
+						doctype: frm.doc.doctype,
+						docname: frm.doc.name,
+					},
+					() => {
+						reset_sla.enable_primary_action();
+						frm.refresh();
+						frappe.msgprint(__("Service Level Agreement was reset."));
+					}
+				);
+			},
 		});
 
 		reset_sla.show();
 	},
 
-
-	timeline_refresh: function(frm) {
+	timeline_refresh: function (frm) {
 		if (!frm.timeline.wrapper.find(".btn-split-issue").length) {
 			let split_issue_btn = $(`
 				<a class="action-btn btn-split-issue" title="${__("Split Issue")}">
-					${frappe.utils.icon('branch', 'sm')}
+					${frappe.utils.icon("branch", "sm")}
 				</a>
 			`);
 
 			let communication_box = frm.timeline.wrapper.find('.timeline-item[data-doctype="Communication"]');
-			communication_box.find('.actions').prepend(split_issue_btn);
+			communication_box.find(".actions").prepend(split_issue_btn);
 
 			if (!frm.timeline.wrapper.data("split-issue-event-attached")) {
-				frm.timeline.wrapper.on('click', '.btn-split-issue', (e) => {
+				frm.timeline.wrapper.on("click", ".btn-split-issue", (e) => {
 					var dialog = new frappe.ui.Dialog({
 						title: __("Split Issue"),
 						fields: [
@@ -94,20 +104,30 @@
 								fieldtype: "Data",
 								reqd: 1,
 								label: __("Subject"),
-								description: __("All communications including and above this shall be moved into the new Issue")
-							}
+								description: __(
+									"All communications including and above this shall be moved into the new Issue"
+								),
+							},
 						],
 						primary_action_label: __("Split"),
 						primary_action: () => {
-							frm.call("split_issue", {
-								subject: dialog.fields_dict.subject.value,
-								communication_id: e.currentTarget.closest(".timeline-item").getAttribute("data-name")
-							}, (r) => {
-								frappe.msgprint(`New issue created: <a href="/app/issue/${r.message}">${r.message}</a>`);
-								frm.reload_doc();
-								dialog.hide();
-							});
-						}
+							frm.call(
+								"split_issue",
+								{
+									subject: dialog.fields_dict.subject.value,
+									communication_id: e.currentTarget
+										.closest(".timeline-item")
+										.getAttribute("data-name"),
+								},
+								(r) => {
+									frappe.msgprint(
+										`New issue created: <a href="/app/issue/${r.message}">${r.message}</a>`
+									);
+									frm.reload_doc();
+									dialog.hide();
+								}
+							);
+						},
 					});
 					dialog.show();
 				});
diff --git a/erpnext/support/doctype/issue/issue_list.js b/erpnext/support/doctype/issue/issue_list.js
index 5c9d4ed..8aa1650 100644
--- a/erpnext/support/doctype/issue/issue_list.js
+++ b/erpnext/support/doctype/issue/issue_list.js
@@ -1,30 +1,30 @@
-frappe.listview_settings['Issue'] = {
-	colwidths: {"subject": 6},
-	add_fields: ['priority'],
+frappe.listview_settings["Issue"] = {
+	colwidths: { subject: 6 },
+	add_fields: ["priority"],
 	filters: [["status", "=", "Open"]],
-	onload: function(listview) {
+	onload: function (listview) {
 		var method = "erpnext.support.doctype.issue.issue.set_multiple_status";
 
-		listview.page.add_action_item(__("Set as Open"), function() {
-			listview.call_for_selected_items(method, {"status": "Open"});
+		listview.page.add_action_item(__("Set as Open"), function () {
+			listview.call_for_selected_items(method, { status: "Open" });
 		});
 
-		listview.page.add_action_item(__("Set as Closed"), function() {
-			listview.call_for_selected_items(method, {"status": "Closed"});
+		listview.page.add_action_item(__("Set as Closed"), function () {
+			listview.call_for_selected_items(method, { status: "Closed" });
 		});
 	},
-	get_indicator: function(doc) {
-		if (doc.status === 'Open') {
+	get_indicator: function (doc) {
+		if (doc.status === "Open") {
 			const color = {
-				'Low': 'yellow',
-				'Medium': 'orange',
-				'High': 'red'
+				Low: "yellow",
+				Medium: "orange",
+				High: "red",
 			};
-			return [__(doc.status), color[doc.priority] || 'red', `status,=,Open`];
-		} else if (doc.status === 'Closed') {
+			return [__(doc.status), color[doc.priority] || "red", `status,=,Open`];
+		} else if (doc.status === "Closed") {
 			return [__(doc.status), "green", "status,=," + doc.status];
 		} else {
 			return [__(doc.status), "gray", "status,=," + doc.status];
 		}
-	}
-}
+	},
+};
diff --git a/erpnext/support/doctype/issue_priority/issue_priority.js b/erpnext/support/doctype/issue_priority/issue_priority.js
index 37ce6a5..e777d06 100644
--- a/erpnext/support/doctype/issue_priority/issue_priority.js
+++ b/erpnext/support/doctype/issue_priority/issue_priority.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Issue Priority', {
+frappe.ui.form.on("Issue Priority", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/support/doctype/issue_type/issue_type.js b/erpnext/support/doctype/issue_type/issue_type.js
index 2b3d14e..aa0c456 100644
--- a/erpnext/support/doctype/issue_type/issue_type.js
+++ b/erpnext/support/doctype/issue_type/issue_type.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Issue Type', {
-	refresh: function(frm) {
-
-	}
+frappe.ui.form.on("Issue Type", {
+	refresh: function (frm) {},
 });
diff --git a/erpnext/support/doctype/service_level_agreement/service_level_agreement.js b/erpnext/support/doctype/service_level_agreement/service_level_agreement.js
index 4dbb0e7..a8b85de 100644
--- a/erpnext/support/doctype/service_level_agreement/service_level_agreement.js
+++ b/erpnext/support/doctype/service_level_agreement/service_level_agreement.js
@@ -1,121 +1,145 @@
 // Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Service Level Agreement', {
-	setup: function(frm) {
+frappe.ui.form.on("Service Level Agreement", {
+	setup: function (frm) {
 		if (cint(frm.doc.apply_sla_for_resolution) === 1) {
-			frm.get_field('priorities').grid.editable_fields = [
-				{fieldname: 'default_priority', columns: 1},
-				{fieldname: 'priority', columns: 2},
-				{fieldname: 'response_time', columns: 2},
-				{fieldname: 'resolution_time', columns: 2}
+			frm.get_field("priorities").grid.editable_fields = [
+				{ fieldname: "default_priority", columns: 1 },
+				{ fieldname: "priority", columns: 2 },
+				{ fieldname: "response_time", columns: 2 },
+				{ fieldname: "resolution_time", columns: 2 },
 			];
 		} else {
-			frm.get_field('priorities').grid.editable_fields = [
-				{fieldname: 'default_priority', columns: 1},
-				{fieldname: 'priority', columns: 2},
-				{fieldname: 'response_time', columns: 3},
+			frm.get_field("priorities").grid.editable_fields = [
+				{ fieldname: "default_priority", columns: 1 },
+				{ fieldname: "priority", columns: 2 },
+				{ fieldname: "response_time", columns: 3 },
 			];
 		}
 	},
 
-	refresh: function(frm) {
-		frm.trigger('fetch_status_fields');
-		frm.trigger('toggle_resolution_fields');
-		frm.trigger('default_service_level_agreement');
-		frm.trigger('entity');
+	refresh: function (frm) {
+		frm.trigger("fetch_status_fields");
+		frm.trigger("toggle_resolution_fields");
+		frm.trigger("default_service_level_agreement");
+		frm.trigger("entity");
 	},
 
-	default_service_level_agreement: function(frm) {
-		const field = frm.get_field('default_service_level_agreement');
+	default_service_level_agreement: function (frm) {
+		const field = frm.get_field("default_service_level_agreement");
 		if (frm.doc.default_service_level_agreement) {
-			field.set_description(__('SLA will be applied on every {0}', [frm.doc.document_type]));
+			field.set_description(__("SLA will be applied on every {0}", [frm.doc.document_type]));
 		} else {
-			field.set_description(__('Enable to apply SLA on every {0}', [frm.doc.document_type]));
+			field.set_description(__("Enable to apply SLA on every {0}", [frm.doc.document_type]));
 		}
 	},
 
-	document_type: function(frm) {
-		frm.trigger('fetch_status_fields');
-		frm.trigger('default_service_level_agreement');
+	document_type: function (frm) {
+		frm.trigger("fetch_status_fields");
+		frm.trigger("default_service_level_agreement");
 	},
 
-	entity_type: function(frm) {
-		frm.set_value('entity', undefined);
+	entity_type: function (frm) {
+		frm.set_value("entity", undefined);
 	},
 
-	entity: function(frm) {
-		const field = frm.get_field('entity');
+	entity: function (frm) {
+		const field = frm.get_field("entity");
 		if (frm.doc.entity) {
-			const and_descendants = frm.doc.entity_type != 'Customer' ? ' ' + __('or its descendants') : '';
+			const and_descendants = frm.doc.entity_type != "Customer" ? " " + __("or its descendants") : "";
 			field.set_description(
-				__('SLA will be applied if {1} is set as {2}{3}', [
-					frm.doc.document_type, frm.doc.entity_type,
-					frm.doc.entity, and_descendants
+				__("SLA will be applied if {1} is set as {2}{3}", [
+					frm.doc.document_type,
+					frm.doc.entity_type,
+					frm.doc.entity,
+					and_descendants,
 				])
 			);
 		} else {
-			field.set_description('');
+			field.set_description("");
 		}
 	},
 
-	fetch_status_fields: function(frm) {
+	fetch_status_fields: function (frm) {
 		let allow_statuses = [];
 		let exclude_statuses = [];
 
 		if (frm.doc.document_type) {
 			frappe.model.with_doctype(frm.doc.document_type, () => {
-				let statuses = frappe.meta.get_docfield(frm.doc.document_type, 'status', frm.doc.name).options;
-				statuses = statuses.split('\n');
+				let statuses = frappe.meta.get_docfield(
+					frm.doc.document_type,
+					"status",
+					frm.doc.name
+				).options;
+				statuses = statuses.split("\n");
 
-				exclude_statuses = ['Open', 'Closed'];
+				exclude_statuses = ["Open", "Closed"];
 				allow_statuses = statuses.filter((status) => !exclude_statuses.includes(status));
 
 				frm.fields_dict.pause_sla_on.grid.update_docfield_property(
-					'status', 'options', [''].concat(allow_statuses)
+					"status",
+					"options",
+					[""].concat(allow_statuses)
 				);
 
-				exclude_statuses = ['Open'];
+				exclude_statuses = ["Open"];
 				allow_statuses = statuses.filter((status) => !exclude_statuses.includes(status));
 				frm.fields_dict.sla_fulfilled_on.grid.update_docfield_property(
-					'status', 'options', [''].concat(allow_statuses)
+					"status",
+					"options",
+					[""].concat(allow_statuses)
 				);
 			});
 		}
 
-		frm.refresh_field('pause_sla_on');
+		frm.refresh_field("pause_sla_on");
 	},
 
-	apply_sla_for_resolution: function(frm) {
-		frm.trigger('toggle_resolution_fields');
+	apply_sla_for_resolution: function (frm) {
+		frm.trigger("toggle_resolution_fields");
 	},
 
-	toggle_resolution_fields: function(frm) {
+	toggle_resolution_fields: function (frm) {
 		if (cint(frm.doc.apply_sla_for_resolution) === 1) {
-			frm.fields_dict.priorities.grid.update_docfield_property('resolution_time', 'hidden', 0);
-			frm.fields_dict.priorities.grid.update_docfield_property('resolution_time', 'reqd', 1);
+			frm.fields_dict.priorities.grid.update_docfield_property("resolution_time", "hidden", 0);
+			frm.fields_dict.priorities.grid.update_docfield_property("resolution_time", "reqd", 1);
 		} else {
-			frm.fields_dict.priorities.grid.update_docfield_property('resolution_time', 'hidden', 1);
-			frm.fields_dict.priorities.grid.update_docfield_property('resolution_time', 'reqd', 0);
+			frm.fields_dict.priorities.grid.update_docfield_property("resolution_time", "hidden", 1);
+			frm.fields_dict.priorities.grid.update_docfield_property("resolution_time", "reqd", 0);
 		}
 
-		frm.refresh_field('priorities');
+		frm.refresh_field("priorities");
 	},
 
-	onload: function(frm) {
-		frm.set_query("document_type", function() {
+	onload: function (frm) {
+		frm.set_query("document_type", function () {
 			let invalid_doctypes = frappe.model.core_doctypes_list;
-			invalid_doctypes.push(frm.doc.doctype, 'Cost Center', 'Company');
+			invalid_doctypes.push(frm.doc.doctype, "Cost Center", "Company");
 
 			return {
 				filters: [
-					['DocType', 'issingle', '=', 0],
-					['DocType', 'istable', '=', 0],
-					['DocType', 'is_submittable', '=', 0],
-					['DocType', 'name', 'not in', invalid_doctypes],
-					['DocType', 'module', 'not in', ["Email", "Core", "Custom", "Event Streaming", "Social", "Data Migration", "Geo", "Desk"]]
-				]
+					["DocType", "issingle", "=", 0],
+					["DocType", "istable", "=", 0],
+					["DocType", "is_submittable", "=", 0],
+					["DocType", "name", "not in", invalid_doctypes],
+					[
+						"DocType",
+						"module",
+						"not in",
+						[
+							"Email",
+							"Core",
+							"Custom",
+							"Event Streaming",
+							"Social",
+							"Data Migration",
+							"Geo",
+							"Desk",
+						],
+					],
+				],
 			};
 		});
-	}
+	},
 });
diff --git a/erpnext/support/doctype/support_settings/support_settings.js b/erpnext/support/doctype/support_settings/support_settings.js
index 78adca8..3a1cb84 100644
--- a/erpnext/support/doctype/support_settings/support_settings.js
+++ b/erpnext/support/doctype/support_settings/support_settings.js
@@ -1,8 +1,8 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Support Settings', {
-	refresh: function(frm) {
+frappe.ui.form.on("Support Settings", {
+	refresh: function (frm) {
 		//
-	}
+	},
 });
diff --git a/erpnext/support/doctype/warranty_claim/warranty_claim.js b/erpnext/support/doctype/warranty_claim/warranty_claim.js
index 10cb37f..d7b77f7 100644
--- a/erpnext/support/doctype/warranty_claim/warranty_claim.js
+++ b/erpnext/support/doctype/warranty_claim/warranty_claim.js
@@ -43,10 +43,7 @@
 			doctype: "Customer",
 		};
 
-		if (
-			!frm.doc.__islocal &&
-			["Open", "Work In Progress"].includes(frm.doc.status)
-		) {
+		if (!frm.doc.__islocal && ["Open", "Work In Progress"].includes(frm.doc.status)) {
 			frm.add_custom_button(__("Maintenance Visit"), () => {
 				frappe.model.open_mapped_doc({
 					method: "erpnext.support.doctype.warranty_claim.warranty_claim.make_maintenance_visit",
diff --git a/erpnext/support/doctype/warranty_claim/warranty_claim_list.js b/erpnext/support/doctype/warranty_claim/warranty_claim_list.js
index e162e13..fdafb0e 100644
--- a/erpnext/support/doctype/warranty_claim/warranty_claim_list.js
+++ b/erpnext/support/doctype/warranty_claim/warranty_claim_list.js
@@ -1,4 +1,4 @@
-frappe.listview_settings['Warranty Claim'] = {
+frappe.listview_settings["Warranty Claim"] = {
 	add_fields: ["status", "customer", "item_code"],
-	filters:[["status","=", "Open"]]
+	filters: [["status", "=", "Open"]],
 };
diff --git a/erpnext/support/report/first_response_time_for_issues/first_response_time_for_issues.js b/erpnext/support/report/first_response_time_for_issues/first_response_time_for_issues.js
index a133770..ffe7387 100644
--- a/erpnext/support/report/first_response_time_for_issues/first_response_time_for_issues.js
+++ b/erpnext/support/report/first_response_time_for_issues/first_response_time_for_issues.js
@@ -1,43 +1,44 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["First Response Time for Issues"] = {
-	"filters": [
+	filters: [
 		{
-			"fieldname": "from_date",
-			"label": __("From Date"),
-			"fieldtype": "Date",
-			"reqd": 1,
-			"default": frappe.datetime.add_days(frappe.datetime.nowdate(), -30)
+			fieldname: "from_date",
+			label: __("From Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			default: frappe.datetime.add_days(frappe.datetime.nowdate(), -30),
 		},
 		{
-			"fieldname": "to_date",
-			"label": __("To Date"),
-			"fieldtype": "Date",
-			"reqd": 1,
-			"default":frappe.datetime.nowdate()
-		}
+			fieldname: "to_date",
+			label: __("To Date"),
+			fieldtype: "Date",
+			reqd: 1,
+			default: frappe.datetime.nowdate(),
+		},
 	],
-	get_chart_data: function(_columns, result) {
+	get_chart_data: function (_columns, result) {
 		return {
 			data: {
-				labels: result.map(d => d.creation_date),
-				datasets: [{
-					name: 'First Response Time',
-					values: result.map(d => d.first_response_time)
-				}]
+				labels: result.map((d) => d.creation_date),
+				datasets: [
+					{
+						name: "First Response Time",
+						values: result.map((d) => d.first_response_time),
+					},
+				],
 			},
 			type: "line",
 			tooltipOptions: {
-				formatTooltipY: d => {
+				formatTooltipY: (d) => {
 					let duration_options = {
 						hide_days: 0,
-						hide_seconds: 0
+						hide_seconds: 0,
 					};
 					return frappe.utils.get_formatted_duration(d, duration_options);
-				}
-			}
-		}
-	}
+				},
+			},
+		};
+	},
 };
diff --git a/erpnext/support/report/issue_analytics/issue_analytics.js b/erpnext/support/report/issue_analytics/issue_analytics.js
index be45b9b..7a800f4 100644
--- a/erpnext/support/report/issue_analytics/issue_analytics.js
+++ b/erpnext/support/report/issue_analytics/issue_analytics.js
@@ -1,16 +1,15 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Issue Analytics"] = {
-	"filters": [
+	filters: [
 		{
 			fieldname: "company",
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
 			default: frappe.defaults.get_user_default("Company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "based_on",
@@ -18,125 +17,124 @@
 			fieldtype: "Select",
 			options: ["Customer", "Issue Type", "Issue Priority", "Assigned To"],
 			default: "Customer",
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "from_date",
 			label: __("From Date"),
 			fieldtype: "Date",
 			default: frappe.defaults.get_global_default("year_start_date"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
 			default: frappe.defaults.get_global_default("year_end_date"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "range",
 			label: __("Range"),
 			fieldtype: "Select",
 			options: [
-				{ "value": "Weekly", "label": __("Weekly") },
-				{ "value": "Monthly", "label": __("Monthly") },
-				{ "value": "Quarterly", "label": __("Quarterly") },
-				{ "value": "Yearly", "label": __("Yearly") }
+				{ value: "Weekly", label: __("Weekly") },
+				{ value: "Monthly", label: __("Monthly") },
+				{ value: "Quarterly", label: __("Quarterly") },
+				{ value: "Yearly", label: __("Yearly") },
 			],
 			default: "Monthly",
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "status",
 			label: __("Status"),
 			fieldtype: "Select",
-			options:[
+			options: [
 				"",
-				{label: __('Open'), value: 'Open'},
-				{label: __('Replied'), value: 'Replied'},
-				{label: __('Resolved'), value: 'Resolved'},
-				{label: __('Closed'), value: 'Closed'}
-			]
+				{ label: __("Open"), value: "Open" },
+				{ label: __("Replied"), value: "Replied" },
+				{ label: __("Resolved"), value: "Resolved" },
+				{ label: __("Closed"), value: "Closed" },
+			],
 		},
 		{
 			fieldname: "priority",
 			label: __("Issue Priority"),
 			fieldtype: "Link",
-			options: "Issue Priority"
+			options: "Issue Priority",
 		},
 		{
 			fieldname: "customer",
 			label: __("Customer"),
 			fieldtype: "Link",
-			options: "Customer"
+			options: "Customer",
 		},
 		{
 			fieldname: "project",
 			label: __("Project"),
 			fieldtype: "Link",
-			options: "Project"
+			options: "Project",
 		},
 		{
 			fieldname: "assigned_to",
 			label: __("Assigned To"),
 			fieldtype: "Link",
-			options: "User"
-		}
+			options: "User",
+		},
 	],
-	after_datatable_render: function(datatable_obj) {
-		$(datatable_obj.wrapper).find(".dt-row-0").find('input[type=checkbox]').click();
+	after_datatable_render: function (datatable_obj) {
+		$(datatable_obj.wrapper).find(".dt-row-0").find("input[type=checkbox]").click();
 	},
 	get_datatable_options(options) {
 		return Object.assign(options, {
 			checkboxColumn: true,
 			events: {
-				onCheckRow: function(data) {
+				onCheckRow: function (data) {
 					if (data && data.length) {
 						let row_name = data[2].content;
-						let row_values = data.slice(3).map(function(column) {
+						let row_values = data.slice(3).map(function (column) {
 							return column.content;
-						})
-						let entry  = {
-							'name': row_name,
-							'values': row_values
-						}
+						});
+						let entry = {
+							name: row_name,
+							values: row_values,
+						};
 
 						let raw_data = frappe.query_report.chart.data;
 						let new_datasets = raw_data.datasets;
 
 						var found = false;
 
-						for(var i=0; i < new_datasets.length; i++){
-							if (new_datasets[i].name == row_name){
+						for (var i = 0; i < new_datasets.length; i++) {
+							if (new_datasets[i].name == row_name) {
 								found = true;
-								new_datasets.splice(i,1);
+								new_datasets.splice(i, 1);
 								break;
 							}
 						}
 
-						if (!found){
+						if (!found) {
 							new_datasets.push(entry);
 						}
 
 						let new_data = {
 							labels: raw_data.labels,
-							datasets: new_datasets
-						}
+							datasets: new_datasets,
+						};
 
 						setTimeout(() => {
-							frappe.query_report.chart.update(new_data)
-						},500)
-
+							frappe.query_report.chart.update(new_data);
+						}, 500);
 
 						setTimeout(() => {
 							frappe.query_report.chart.draw(true);
-						}, 1000)
+						}, 1000);
 
 						frappe.query_report.raw_chart_data = new_data;
 					}
 				},
-			}
+			},
 		});
-	}
+	},
 };
diff --git a/erpnext/support/report/issue_summary/issue_summary.js b/erpnext/support/report/issue_summary/issue_summary.js
index aee6f53..79c57d7 100644
--- a/erpnext/support/report/issue_summary/issue_summary.js
+++ b/erpnext/support/report/issue_summary/issue_summary.js
@@ -1,16 +1,15 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Issue Summary"] = {
-	"filters": [
+	filters: [
 		{
 			fieldname: "company",
 			label: __("Company"),
 			fieldtype: "Link",
 			options: "Company",
 			default: frappe.defaults.get_user_default("Company"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "based_on",
@@ -18,58 +17,58 @@
 			fieldtype: "Select",
 			options: ["Customer", "Issue Type", "Issue Priority", "Assigned To"],
 			default: "Customer",
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "from_date",
 			label: __("From Date"),
 			fieldtype: "Date",
 			default: frappe.defaults.get_global_default("year_start_date"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
 			default: frappe.defaults.get_global_default("year_end_date"),
-			reqd: 1
+			reqd: 1,
 		},
 		{
 			fieldname: "status",
 			label: __("Status"),
 			fieldtype: "Select",
-			options:[
+			options: [
 				"",
-				{label: __('Open'), value: 'Open'},
-				{label: __('Replied'), value: 'Replied'},
-				{label: __('On Hold'), value: 'On Hold'},
-				{label: __('Resolved'), value: 'Resolved'},
-				{label: __('Closed'), value: 'Closed'}
-			]
+				{ label: __("Open"), value: "Open" },
+				{ label: __("Replied"), value: "Replied" },
+				{ label: __("On Hold"), value: "On Hold" },
+				{ label: __("Resolved"), value: "Resolved" },
+				{ label: __("Closed"), value: "Closed" },
+			],
 		},
 		{
 			fieldname: "priority",
 			label: __("Issue Priority"),
 			fieldtype: "Link",
-			options: "Issue Priority"
+			options: "Issue Priority",
 		},
 		{
 			fieldname: "customer",
 			label: __("Customer"),
 			fieldtype: "Link",
-			options: "Customer"
+			options: "Customer",
 		},
 		{
 			fieldname: "project",
 			label: __("Project"),
 			fieldtype: "Link",
-			options: "Project"
+			options: "Project",
 		},
 		{
 			fieldname: "assigned_to",
 			label: __("Assigned To"),
 			fieldtype: "Link",
-			options: "User"
-		}
-	]
+			options: "User",
+		},
+	],
 };
diff --git a/erpnext/support/report/support_hour_distribution/support_hour_distribution.js b/erpnext/support/report/support_hour_distribution/support_hour_distribution.js
index 82ccc73..96d8e00 100644
--- a/erpnext/support/report/support_hour_distribution/support_hour_distribution.js
+++ b/erpnext/support/report/support_hour_distribution/support_hour_distribution.js
@@ -1,22 +1,21 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["Support Hour Distribution"] = {
-	"filters": [
+	filters: [
 		{
-			'lable': __("From Date"),
-			'fieldname': 'from_date',
-			'fieldtype': 'Date',
-			'default': frappe.datetime.nowdate(),
-			'reqd': 1
+			lable: __("From Date"),
+			fieldname: "from_date",
+			fieldtype: "Date",
+			default: frappe.datetime.nowdate(),
+			reqd: 1,
 		},
 		{
-			'lable': __("To Date"),
-			'fieldname': 'to_date',
-			'fieldtype': 'Date',
-			'default': frappe.datetime.nowdate(),
-			'reqd': 1
-		}
-	]
-}
+			lable: __("To Date"),
+			fieldname: "to_date",
+			fieldtype: "Date",
+			default: frappe.datetime.nowdate(),
+			reqd: 1,
+		},
+	],
+};
diff --git a/erpnext/support/web_form/issues/issues.js b/erpnext/support/web_form/issues/issues.js
index ffc5e98..8f56ebb 100644
--- a/erpnext/support/web_form/issues/issues.js
+++ b/erpnext/support/web_form/issues/issues.js
@@ -1,3 +1,3 @@
-frappe.ready(function() {
+frappe.ready(function () {
 	// bind events here
-})
+});
diff --git a/erpnext/telephony/doctype/call_log/call_log.js b/erpnext/telephony/doctype/call_log/call_log.js
index e7afa0b..1fd1526 100644
--- a/erpnext/telephony/doctype/call_log/call_log.js
+++ b/erpnext/telephony/doctype/call_log/call_log.js
@@ -1,21 +1,21 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Call Log', {
-	refresh: function(frm) {
+frappe.ui.form.on("Call Log", {
+	refresh: function (frm) {
 		frm.events.setup_recording_audio_control(frm);
-		const incoming_call = frm.doc.type == 'Incoming';
-		frm.add_custom_button(incoming_call ? __('Callback'): __('Call Again'), () => {
+		const incoming_call = frm.doc.type == "Incoming";
+		frm.add_custom_button(incoming_call ? __("Callback") : __("Call Again"), () => {
 			const number = incoming_call ? frm.doc.from : frm.doc.to;
 			frappe.phone_call.handler(number, frm);
 		});
 	},
 	setup_recording_audio_control(frm) {
-		const recording_wrapper = frm.get_field('recording_html').$wrapper;
-		if (!frm.doc.recording_url || frm.doc.recording_url == 'null') {
+		const recording_wrapper = frm.get_field("recording_html").$wrapper;
+		if (!frm.doc.recording_url || frm.doc.recording_url == "null") {
 			recording_wrapper.empty();
 		} else {
-			recording_wrapper.addClass('input-max-width');
+			recording_wrapper.addClass("input-max-width");
 			recording_wrapper.html(`
 				<audio
 					controls
@@ -23,5 +23,5 @@
 				</audio>
 			`);
 		}
-	}
+	},
 });
diff --git a/erpnext/telephony/doctype/incoming_call_settings/incoming_call_settings.js b/erpnext/telephony/doctype/incoming_call_settings/incoming_call_settings.js
index b80acdb..3a1d3e5 100644
--- a/erpnext/telephony/doctype/incoming_call_settings/incoming_call_settings.js
+++ b/erpnext/telephony/doctype/incoming_call_settings/incoming_call_settings.js
@@ -3,17 +3,17 @@
 
 function time_to_seconds(time_str) {
 	// Convert time string of format HH:MM:SS into seconds.
-	let seq = time_str.split(':');
+	let seq = time_str.split(":");
 	seq = seq.map((n) => parseInt(n));
-	return (seq[0]*60*60) + (seq[1]*60) + seq[2];
+	return seq[0] * 60 * 60 + seq[1] * 60 + seq[2];
 }
 
-function number_sort(array, ascending=true) {
+function number_sort(array, ascending = true) {
 	let array_copy = [...array];
 	if (ascending) {
-		array_copy.sort((a, b) => a-b); // ascending order
+		array_copy.sort((a, b) => a - b); // ascending order
 	} else {
-		array_copy.sort((a, b) => b-a); // descending order
+		array_copy.sort((a, b) => b - a); // descending order
 	}
 	return array_copy;
 }
@@ -54,7 +54,9 @@
 		let from_time_in_secs = time_to_seconds(record.from_time);
 		let to_time_in_secs = time_to_seconds(record.to_time);
 		if (from_time_in_secs >= to_time_in_secs) {
-			errors.push(__('Call Schedule Row {0}: To time slot should always be ahead of From time slot.', [row]));
+			errors.push(
+				__("Call Schedule Row {0}: To time slot should always be ahead of From time slot.", [row])
+			);
 		}
 	}
 
@@ -66,7 +68,7 @@
 function is_call_schedule_overlapped(day_schedule) {
 	// Check if any time slots are overlapped in a day schedule.
 	let timeslots = [];
-	day_schedule.forEach((record)=> {
+	day_schedule.forEach((record) => {
 		timeslots.push([time_to_seconds(record.from_time), time_to_seconds(record.to_time)]);
 	});
 
@@ -77,8 +79,8 @@
 	timeslots = number_sort(timeslots);
 
 	// Sorted timeslots will be in ascending order if not overlapped.
-	for (let i=1; i < timeslots.length; i++) {
-		if (check_timeslot_overlap(timeslots[i-1], timeslots[i])) {
+	for (let i = 1; i < timeslots.length; i++) {
+		if (check_timeslot_overlap(timeslots[i - 1], timeslots[i])) {
 			return true;
 		}
 	}
@@ -86,16 +88,16 @@
 }
 
 function validate_call_schedule_overlaps(schedule) {
-	let group_by_day = groupby(schedule, 'day_of_week');
+	let group_by_day = groupby(schedule, "day_of_week");
 	for (const [day, day_schedule] of Object.entries(group_by_day)) {
 		if (is_call_schedule_overlapped(day_schedule)) {
-			frappe.throw(__('Please fix overlapping time slots for {0}', [day]));
+			frappe.throw(__("Please fix overlapping time slots for {0}", [day]));
 		}
 	}
 }
 
-frappe.ui.form.on('Incoming Call Settings', {
+frappe.ui.form.on("Incoming Call Settings", {
 	validate(frm) {
 		validate_call_schedule(frm.doc.call_handling_schedule);
-	}
+	},
 });
diff --git a/erpnext/telephony/doctype/telephony_call_type/telephony_call_type.js b/erpnext/telephony/doctype/telephony_call_type/telephony_call_type.js
index efba2b8..474f5ec 100644
--- a/erpnext/telephony/doctype/telephony_call_type/telephony_call_type.js
+++ b/erpnext/telephony/doctype/telephony_call_type/telephony_call_type.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Telephony Call Type', {
+frappe.ui.form.on("Telephony Call Type", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/telephony/doctype/voice_call_settings/voice_call_settings.js b/erpnext/telephony/doctype/voice_call_settings/voice_call_settings.js
index 4a61b61..2014444 100644
--- a/erpnext/telephony/doctype/voice_call_settings/voice_call_settings.js
+++ b/erpnext/telephony/doctype/voice_call_settings/voice_call_settings.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Voice Call Settings', {
+frappe.ui.form.on("Voice Call Settings", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/templates/pages/projects.js b/erpnext/templates/pages/projects.js
index 7149cee..622ed42 100644
--- a/erpnext/templates/pages/projects.js
+++ b/erpnext/templates/pages/projects.js
@@ -1,120 +1,117 @@
-frappe.ready(function() {
-
-	$('.task-status-switch').on('click', function() {
+frappe.ready(function () {
+	$(".task-status-switch").on("click", function () {
 		var $btn = $(this);
-		if($btn.attr('data-status')==='Open') {
-			reload_items('completed', 'task', $btn);
+		if ($btn.attr("data-status") === "Open") {
+			reload_items("completed", "task", $btn);
 		} else {
-			reload_items('open', 'task', $btn);
+			reload_items("open", "task", $btn);
 		}
-	})
+	});
 
-
-	$('.issue-status-switch').on('click', function() {
+	$(".issue-status-switch").on("click", function () {
 		var $btn = $(this);
-		if($btn.attr('data-status')==='Open') {
-			reload_items('completed', 'issue', $btn);
+		if ($btn.attr("data-status") === "Open") {
+			reload_items("completed", "issue", $btn);
 		} else {
-			reload_items('open', 'issue', $btn);
+			reload_items("open", "issue", $btn);
 		}
-	})
+	});
 
 	var start = 10;
-	$(".more-tasks").click(function() {
-		more_items('task', true);
+	$(".more-tasks").click(function () {
+		more_items("task", true);
 	});
 
-	$(".more-issues").click(function() {
-		more_items('issue', true);
+	$(".more-issues").click(function () {
+		more_items("issue", true);
 	});
 
-	$(".more-timelogs").click(function() {
-		more_items('timelog', false);
+	$(".more-timelogs").click(function () {
+		more_items("timelog", false);
 	});
 
-	$(".more-timelines").click(function() {
-		more_items('timeline', false);
+	$(".more-timelines").click(function () {
+		more_items("timeline", false);
 	});
 
-	$(".file-size").each(function() {
+	$(".file-size").each(function () {
 		$(this).text(frappe.form.formatters.FileSize($(this).text()));
 	});
 
-
-	var reload_items = function(item_status, item, $btn) {
+	var reload_items = function (item_status, item, $btn) {
 		$.ajax({
 			method: "GET",
 			url: "/",
 			dataType: "json",
 			data: {
-				cmd: "erpnext.templates.pages.projects.get_"+ item +"_html",
-				project: '{{ doc.name }}',
+				cmd: "erpnext.templates.pages.projects.get_" + item + "_html",
+				project: "{{ doc.name }}",
 				item_status: item_status,
 			},
-			success: function(data) {
-				if(typeof data.message == 'undefined') {
-					$('.project-'+ item).html("No "+ item_status +" "+ item);
-					$(".more-"+ item).toggle(false);
+			success: function (data) {
+				if (typeof data.message == "undefined") {
+					$(".project-" + item).html("No " + item_status + " " + item);
+					$(".more-" + item).toggle(false);
 				}
-				$('.project-'+ item).html(data.message);
-				$(".more-"+ item).toggle(true);
+				$(".project-" + item).html(data.message);
+				$(".more-" + item).toggle(true);
 
 				// update status
-				if(item_status==='open') {
-					$btn.html(__('Show Completed')).attr('data-status', 'Open');
+				if (item_status === "open") {
+					$btn.html(__("Show Completed")).attr("data-status", "Open");
 				} else {
-					$btn.html(__('Show Open')).attr('data-status', 'Completed');
+					$btn.html(__("Show Open")).attr("data-status", "Completed");
 				}
-			}
+			},
 		});
+	};
 
-	}
-
-	var more_items = function(item, item_status){
-		if(item_status) {
-			item_status = $('.project-'+ item +'-section .btn-group .bold').hasClass('btn-completed-'+ item)
-				? 'completed' : 'open';
+	var more_items = function (item, item_status) {
+		if (item_status) {
+			item_status = $(".project-" + item + "-section .btn-group .bold").hasClass(
+				"btn-completed-" + item
+			)
+				? "completed"
+				: "open";
 		}
 		$.ajax({
 			method: "GET",
 			url: "/",
 			dataType: "json",
 			data: {
-				cmd: "erpnext.templates.pages.projects.get_"+ item +"_html",
-				project: '{{ doc.name }}',
+				cmd: "erpnext.templates.pages.projects.get_" + item + "_html",
+				project: "{{ doc.name }}",
 				start: start,
 				item_status: item_status,
 			},
-			success: function(data) {
-
-				$(data.message).appendTo('.project-'+ item);
-				if(typeof data.message == 'undefined') {
-					$(".more-"+ item).toggle(false);
+			success: function (data) {
+				$(data.message).appendTo(".project-" + item);
+				if (typeof data.message == "undefined") {
+					$(".more-" + item).toggle(false);
 				}
-				start = start+10;
-			}
+				start = start + 10;
+			},
 		});
-	}
+	};
 
-	var close_item = function(item, item_name){
+	var close_item = function (item, item_name) {
 		var args = {
-			project: '{{ doc.name }}',
+			project: "{{ doc.name }}",
 			item_name: item_name,
-		}
+		};
 		frappe.call({
 			btn: this,
 			type: "POST",
-			method: "erpnext.templates.pages.projects.set_"+ item +"_status",
+			method: "erpnext.templates.pages.projects.set_" + item + "_status",
 			args: args,
-			callback: function(r) {
-				if(r.exc) {
-					if(r._server_messages)
-						frappe.msgprint(r._server_messages);
+			callback: function (r) {
+				if (r.exc) {
+					if (r._server_messages) frappe.msgprint(r._server_messages);
 				} else {
 					$(this).remove();
 				}
-			}
-		})
+			},
+		});
 		return false;
-	}
+	};
 });
diff --git a/erpnext/utilities/doctype/rename_tool/rename_tool.js b/erpnext/utilities/doctype/rename_tool/rename_tool.js
index b8203f4..1b8b2be 100644
--- a/erpnext/utilities/doctype/rename_tool/rename_tool.js
+++ b/erpnext/utilities/doctype/rename_tool/rename_tool.js
@@ -1,17 +1,16 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-
 frappe.ui.form.on("Rename Tool", {
-	onload: function(frm) {
+	onload: function (frm) {
 		return frappe.call({
 			method: "erpnext.utilities.doctype.rename_tool.rename_tool.get_doctypes",
-			callback: function(r) {
+			callback: function (r) {
 				frm.set_df_property("select_doctype", "options", r.message);
-			}
+			},
 		});
 	},
-	refresh: function(frm) {
+	refresh: function (frm) {
 		frm.disable_save();
 
 		frm.get_field("file_to_rename").df.options = {
@@ -22,14 +21,14 @@
 		if (!frm.doc.file_to_rename) {
 			frm.get_field("rename_log").$wrapper.html("");
 		}
-		frm.page.set_primary_action(__("Rename"), function() {
+		frm.page.set_primary_action(__("Rename"), function () {
 			frm.get_field("rename_log").$wrapper.html("<p>Renaming...</p>");
 			frappe.call({
 				method: "erpnext.utilities.doctype.rename_tool.rename_tool.upload",
 				args: {
-					select_doctype: frm.doc.select_doctype
+					select_doctype: frm.doc.select_doctype,
 				},
-				callback: function(r) {
+				callback: function (r) {
 					let html = r.message.join("<br>");
 
 					if (r.exc) {
@@ -40,8 +39,8 @@
 					}
 
 					frm.get_field("rename_log").$wrapper.html(html);
-				}
+				},
 			});
 		});
-	}
-})
+	},
+});
diff --git a/erpnext/utilities/doctype/video/video.js b/erpnext/utilities/doctype/video/video.js
index e6c6efb..83e6d06 100644
--- a/erpnext/utilities/doctype/video/video.js
+++ b/erpnext/utilities/doctype/video/video.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Video', {
+frappe.ui.form.on("Video", {
 	refresh: function (frm) {
 		frm.events.toggle_youtube_statistics_section(frm);
 		frm.add_custom_button(__("Watch Video"), () => frappe.help.show_video(frm.doc.url, frm.doc.title));
@@ -9,9 +9,9 @@
 
 	toggle_youtube_statistics_section: (frm) => {
 		if (frm.doc.provider === "YouTube") {
-			frappe.db.get_single_value("Video Settings", "enable_youtube_tracking").then( val => {
+			frappe.db.get_single_value("Video Settings", "enable_youtube_tracking").then((val) => {
 				frm.toggle_display("youtube_tracking_section", val);
 			});
 		}
-	}
+	},
 });
diff --git a/erpnext/utilities/doctype/video/video_list.js b/erpnext/utilities/doctype/video/video_list.js
index 6f78f6e..a87e036 100644
--- a/erpnext/utilities/doctype/video/video_list.js
+++ b/erpnext/utilities/doctype/video/video_list.js
@@ -1,7 +1,7 @@
 frappe.listview_settings["Video"] = {
 	onload: (listview) => {
-		listview.page.add_menu_item(__("Video Settings"), function() {
-			frappe.set_route("Form","Video Settings", "Video Settings");
+		listview.page.add_menu_item(__("Video Settings"), function () {
+			frappe.set_route("Form", "Video Settings", "Video Settings");
 		});
-	}
-}
+	},
+};
diff --git a/erpnext/utilities/doctype/video_settings/video_settings.js b/erpnext/utilities/doctype/video_settings/video_settings.js
index 9ac8b9e..bb26988 100644
--- a/erpnext/utilities/doctype/video_settings/video_settings.js
+++ b/erpnext/utilities/doctype/video_settings/video_settings.js
@@ -1,8 +1,7 @@
 // Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Video Settings', {
+frappe.ui.form.on("Video Settings", {
 	// refresh: function(frm) {
-
 	// }
 });
diff --git a/erpnext/utilities/report/youtube_interactions/youtube_interactions.js b/erpnext/utilities/report/youtube_interactions/youtube_interactions.js
index adf2cf6..38f6c88 100644
--- a/erpnext/utilities/report/youtube_interactions/youtube_interactions.js
+++ b/erpnext/utilities/report/youtube_interactions/youtube_interactions.js
@@ -1,9 +1,8 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-
 frappe.query_reports["YouTube Interactions"] = {
-	"filters": [
+	filters: [
 		{
 			fieldname: "from_date",
 			label: __("From Date"),
@@ -11,10 +10,10 @@
 			default: frappe.datetime.add_months(frappe.datetime.now_date(), -12),
 		},
 		{
-			fieldname:"to_date",
+			fieldname: "to_date",
 			label: __("To Date"),
 			fieldtype: "Date",
 			default: frappe.datetime.now_date(),
-		}
-	]
+		},
+	],
 };
diff --git a/erpnext/utilities/web_form/addresses/addresses.js b/erpnext/utilities/web_form/addresses/addresses.js
index ffc5e98..8f56ebb 100644
--- a/erpnext/utilities/web_form/addresses/addresses.js
+++ b/erpnext/utilities/web_form/addresses/addresses.js
@@ -1,3 +1,3 @@
-frappe.ready(function() {
+frappe.ready(function () {
 	// bind events here
-})
+});
diff --git a/erpnext/www/book_appointment/index.js b/erpnext/www/book_appointment/index.js
index 71a34d4..0770d10 100644
--- a/erpnext/www/book_appointment/index.js
+++ b/erpnext/www/book_appointment/index.js
@@ -1,250 +1,259 @@
 frappe.ready(async () => {
-    initialise_select_date();
-})
+	initialise_select_date();
+});
 
 async function initialise_select_date() {
-    navigate_to_page(1);
-    await get_global_variables();
-    setup_date_picker();
-    setup_timezone_selector();
-    hide_next_button();
+	navigate_to_page(1);
+	await get_global_variables();
+	setup_date_picker();
+	setup_timezone_selector();
+	hide_next_button();
 }
 
 async function get_global_variables() {
-    // Using await through this file instead of then.
-    window.appointment_settings = (await frappe.call({
-        method: 'erpnext.www.book_appointment.index.get_appointment_settings'
-    })).message;
-    window.timezones = (await frappe.call({
-        method:'erpnext.www.book_appointment.index.get_timezones'
-    })).message;
+	// Using await through this file instead of then.
+	window.appointment_settings = (
+		await frappe.call({
+			method: "erpnext.www.book_appointment.index.get_appointment_settings",
+		})
+	).message;
+	window.timezones = (
+		await frappe.call({
+			method: "erpnext.www.book_appointment.index.get_timezones",
+		})
+	).message;
 }
 
 function setup_timezone_selector() {
-    let timezones_element = document.getElementById('appointment-timezone');
-    let local_timezone = moment.tz.guess()
-    window.timezones.forEach(timezone => {
-        let opt = document.createElement('option');
-        opt.value = timezone;
-        if (timezone == local_timezone) {
-            opt.selected = true;
-        }
-        opt.innerHTML = timezone;
-        timezones_element.appendChild(opt)
-    });
+	let timezones_element = document.getElementById("appointment-timezone");
+	let local_timezone = moment.tz.guess();
+	window.timezones.forEach((timezone) => {
+		let opt = document.createElement("option");
+		opt.value = timezone;
+		if (timezone == local_timezone) {
+			opt.selected = true;
+		}
+		opt.innerHTML = timezone;
+		timezones_element.appendChild(opt);
+	});
 }
 
 function setup_date_picker() {
-    let date_picker = document.getElementById('appointment-date');
-    let today = new Date();
-    date_picker.min = today.toISOString().substr(0, 10);
-    today.setDate(today.getDate() + window.appointment_settings.advance_booking_days);
-    date_picker.max = today.toISOString().substr(0, 10);
+	let date_picker = document.getElementById("appointment-date");
+	let today = new Date();
+	date_picker.min = today.toISOString().substr(0, 10);
+	today.setDate(today.getDate() + window.appointment_settings.advance_booking_days);
+	date_picker.max = today.toISOString().substr(0, 10);
 }
 
 function hide_next_button() {
-    let next_button = document.getElementById('next-button');
-    next_button.disabled = true;
-    next_button.onclick = () => frappe.msgprint(__("Please select a date and time"));
+	let next_button = document.getElementById("next-button");
+	next_button.disabled = true;
+	next_button.onclick = () => frappe.msgprint(__("Please select a date and time"));
 }
 
 function show_next_button() {
-    let next_button = document.getElementById('next-button');
-    next_button.disabled = false;
-    next_button.onclick = setup_details_page;
+	let next_button = document.getElementById("next-button");
+	next_button.disabled = false;
+	next_button.onclick = setup_details_page;
 }
 
 function on_date_or_timezone_select() {
-    let date_picker = document.getElementById('appointment-date');
-    let timezone = document.getElementById('appointment-timezone');
-    if (date_picker.value === '') {
-        clear_time_slots();
-        hide_next_button();
-        frappe.throw(__('Please select a date'));
-    }
-    window.selected_date = date_picker.value;
-    window.selected_timezone = timezone.value;
-    update_time_slots(date_picker.value, timezone.value);
-    let lead_text = document.getElementById('lead-text');
-    lead_text.innerHTML = __("Select Time")
+	let date_picker = document.getElementById("appointment-date");
+	let timezone = document.getElementById("appointment-timezone");
+	if (date_picker.value === "") {
+		clear_time_slots();
+		hide_next_button();
+		frappe.throw(__("Please select a date"));
+	}
+	window.selected_date = date_picker.value;
+	window.selected_timezone = timezone.value;
+	update_time_slots(date_picker.value, timezone.value);
+	let lead_text = document.getElementById("lead-text");
+	lead_text.innerHTML = __("Select Time");
 }
 
 async function get_time_slots(date, timezone) {
-    let slots = (await frappe.call({
-        method: 'erpnext.www.book_appointment.index.get_appointment_slots',
-        args: {
-            date: date,
-            timezone: timezone
-        }
-    })).message;
-    return slots;
+	let slots = (
+		await frappe.call({
+			method: "erpnext.www.book_appointment.index.get_appointment_slots",
+			args: {
+				date: date,
+				timezone: timezone,
+			},
+		})
+	).message;
+	return slots;
 }
 
 async function update_time_slots(selected_date, selected_timezone) {
-    let timeslot_container = document.getElementById('timeslot-container');
-    window.slots = await get_time_slots(selected_date, selected_timezone);
-    clear_time_slots();
-    if (window.slots.length <= 0) {
-        let message_div = document.createElement('p');
-        message_div.innerHTML = __("There are no slots available on this date");
-        timeslot_container.appendChild(message_div);
-        return
-    }
-    window.slots.forEach((slot, index) => {
-        // Get and append timeslot div
-        let timeslot_div = get_timeslot_div_layout(slot)
-        timeslot_container.appendChild(timeslot_div);
-    });
-    set_default_timeslot();
+	let timeslot_container = document.getElementById("timeslot-container");
+	window.slots = await get_time_slots(selected_date, selected_timezone);
+	clear_time_slots();
+	if (window.slots.length <= 0) {
+		let message_div = document.createElement("p");
+		message_div.innerHTML = __("There are no slots available on this date");
+		timeslot_container.appendChild(message_div);
+		return;
+	}
+	window.slots.forEach((slot, index) => {
+		// Get and append timeslot div
+		let timeslot_div = get_timeslot_div_layout(slot);
+		timeslot_container.appendChild(timeslot_div);
+	});
+	set_default_timeslot();
 }
 
 function get_timeslot_div_layout(timeslot) {
-    let start_time = new Date(timeslot.time)
-    let timeslot_div = document.createElement('div');
-    timeslot_div.classList.add('time-slot');
-    if (!timeslot.availability) {
-        timeslot_div.classList.add('unavailable')
-    }
-    timeslot_div.innerHTML = get_slot_layout(start_time);
-    timeslot_div.id = timeslot.time.substring(11, 19);
-    timeslot_div.addEventListener('click', select_time);
-    return timeslot_div
+	let start_time = new Date(timeslot.time);
+	let timeslot_div = document.createElement("div");
+	timeslot_div.classList.add("time-slot");
+	if (!timeslot.availability) {
+		timeslot_div.classList.add("unavailable");
+	}
+	timeslot_div.innerHTML = get_slot_layout(start_time);
+	timeslot_div.id = timeslot.time.substring(11, 19);
+	timeslot_div.addEventListener("click", select_time);
+	return timeslot_div;
 }
 
 function clear_time_slots() {
-    // Clear any existing divs in timeslot container
-    let timeslot_container = document.getElementById('timeslot-container');
-    while (timeslot_container.firstChild) {
-        timeslot_container.removeChild(timeslot_container.firstChild);
-    }
+	// Clear any existing divs in timeslot container
+	let timeslot_container = document.getElementById("timeslot-container");
+	while (timeslot_container.firstChild) {
+		timeslot_container.removeChild(timeslot_container.firstChild);
+	}
 }
 
 function get_slot_layout(time) {
-    let timezone = document.getElementById("appointment-timezone").value;
-    time = new Date(time);
-    let start_time_string = moment(time).tz(timezone).format("LT");
-    let end_time = moment(time).tz(timezone).add(window.appointment_settings.appointment_duration, 'minutes');
-    let end_time_string = end_time.format("LT");
-    return `<span style="font-size: 1.2em;">${start_time_string}</span><br><span class="text-muted small">${__("to") } ${end_time_string}</span>`;
+	let timezone = document.getElementById("appointment-timezone").value;
+	time = new Date(time);
+	let start_time_string = moment(time).tz(timezone).format("LT");
+	let end_time = moment(time).tz(timezone).add(window.appointment_settings.appointment_duration, "minutes");
+	let end_time_string = end_time.format("LT");
+	return `<span style="font-size: 1.2em;">${start_time_string}</span><br><span class="text-muted small">${__(
+		"to"
+	)} ${end_time_string}</span>`;
 }
 
 function select_time() {
-    if (this.classList.contains('unavailable')) {
-        return;
-    }
-    let selected_element = document.getElementsByClassName('selected');
-    if (!(selected_element.length > 0)) {
-        this.classList.add('selected');
-        show_next_button();
-        return;
-    }
-    selected_element = selected_element[0]
-    window.selected_time = this.id;
-    selected_element.classList.remove('selected');
-    this.classList.add('selected');
-    show_next_button();
+	if (this.classList.contains("unavailable")) {
+		return;
+	}
+	let selected_element = document.getElementsByClassName("selected");
+	if (!(selected_element.length > 0)) {
+		this.classList.add("selected");
+		show_next_button();
+		return;
+	}
+	selected_element = selected_element[0];
+	window.selected_time = this.id;
+	selected_element.classList.remove("selected");
+	this.classList.add("selected");
+	show_next_button();
 }
 
 function set_default_timeslot() {
-    let timeslots = document.getElementsByClassName('time-slot')
-    // Can't use a forEach here since, we need to break the loop after a timeslot is selected
-    for (let i = 0; i < timeslots.length; i++) {
-        const timeslot = timeslots[i];
-        if (!timeslot.classList.contains('unavailable')) {
-            timeslot.classList.add('selected');
-            break;
-        }
-    }
+	let timeslots = document.getElementsByClassName("time-slot");
+	// Can't use a forEach here since, we need to break the loop after a timeslot is selected
+	for (let i = 0; i < timeslots.length; i++) {
+		const timeslot = timeslots[i];
+		if (!timeslot.classList.contains("unavailable")) {
+			timeslot.classList.add("selected");
+			break;
+		}
+	}
 }
 
 function navigate_to_page(page_number) {
-    let page1 = document.getElementById('select-date-time');
-    let page2 = document.getElementById('enter-details');
-    switch (page_number) {
-        case 1:
-            page1.style.display = 'block';
-            page2.style.display = 'none';
-            break;
-        case 2:
-            page1.style.display = 'none';
-            page2.style.display = 'block';
-            break;
-        default:
-            break;
-    }
+	let page1 = document.getElementById("select-date-time");
+	let page2 = document.getElementById("enter-details");
+	switch (page_number) {
+		case 1:
+			page1.style.display = "block";
+			page2.style.display = "none";
+			break;
+		case 2:
+			page1.style.display = "none";
+			page2.style.display = "block";
+			break;
+		default:
+			break;
+	}
 }
 
 function setup_details_page() {
-    navigate_to_page(2)
-    let date_container = document.getElementsByClassName('date-span')[0];
-    let time_container = document.getElementsByClassName('time-span')[0];
-    setup_search_params();
-    date_container.innerHTML = moment(window.selected_date).format("MMM Do YYYY");
-    time_container.innerHTML = moment(window.selected_time, "HH:mm:ss").format("LT");
+	navigate_to_page(2);
+	let date_container = document.getElementsByClassName("date-span")[0];
+	let time_container = document.getElementsByClassName("time-span")[0];
+	setup_search_params();
+	date_container.innerHTML = moment(window.selected_date).format("MMM Do YYYY");
+	time_container.innerHTML = moment(window.selected_time, "HH:mm:ss").format("LT");
 }
 
 function setup_search_params() {
-    let search_params = new URLSearchParams(window.location.search);
-    let customer_name = search_params.get("name")
-    let customer_email = search_params.get("email")
-    let detail = search_params.get("details")
-    if (customer_name) {
-        let name_input = document.getElementById("customer_name");
-        name_input.value = customer_name;
-        name_input.disabled = true;
-    }
-    if(customer_email) {
-        let email_input = document.getElementById("customer_email");
-        email_input.value = customer_email;
-        email_input.disabled = true;
-    }
-    if(detail) {
-        let detail_input = document.getElementById("customer_notes");
-        detail_input.value = detail;
-        detail_input.disabled = true;
-    }
+	let search_params = new URLSearchParams(window.location.search);
+	let customer_name = search_params.get("name");
+	let customer_email = search_params.get("email");
+	let detail = search_params.get("details");
+	if (customer_name) {
+		let name_input = document.getElementById("customer_name");
+		name_input.value = customer_name;
+		name_input.disabled = true;
+	}
+	if (customer_email) {
+		let email_input = document.getElementById("customer_email");
+		email_input.value = customer_email;
+		email_input.disabled = true;
+	}
+	if (detail) {
+		let detail_input = document.getElementById("customer_notes");
+		detail_input.value = detail;
+		detail_input.disabled = true;
+	}
 }
 async function submit() {
-    let button = document.getElementById('submit-button');
-    button.disabled = true;
-    let form = document.querySelector('#customer-form');
-    if (!form.checkValidity()) {
-        form.reportValidity();
-        button.disabled = false;
-        return;
-    }
-    let contact = get_form_data();
-    let appointment =  frappe.call({
-        method: 'erpnext.www.book_appointment.index.create_appointment',
-        args: {
-            'date': window.selected_date,
-            'time': window.selected_time,
-            'contact': contact,
-            'tz':window.selected_timezone
-        },
-        callback: (response)=>{
-            if (response.message.status == "Unverified") {
-                frappe.show_alert(__("Please check your email to confirm the appointment"))
-            } else {
-                frappe.show_alert(__("Appointment Created Successfully"));
-            }
-            setTimeout(()=>{
-                let redirect_url = "/";
-                if (window.appointment_settings.success_redirect_url){
-                    redirect_url += window.appointment_settings.success_redirect_url;
-                }
-                window.location.href = redirect_url;},5000)
-        },
-        error: (err)=>{
-            frappe.show_alert(__("Something went wrong please try again"));
-            button.disabled = false;
-        }
-    });
+	let button = document.getElementById("submit-button");
+	button.disabled = true;
+	let form = document.querySelector("#customer-form");
+	if (!form.checkValidity()) {
+		form.reportValidity();
+		button.disabled = false;
+		return;
+	}
+	let contact = get_form_data();
+	let appointment = frappe.call({
+		method: "erpnext.www.book_appointment.index.create_appointment",
+		args: {
+			date: window.selected_date,
+			time: window.selected_time,
+			contact: contact,
+			tz: window.selected_timezone,
+		},
+		callback: (response) => {
+			if (response.message.status == "Unverified") {
+				frappe.show_alert(__("Please check your email to confirm the appointment"));
+			} else {
+				frappe.show_alert(__("Appointment Created Successfully"));
+			}
+			setTimeout(() => {
+				let redirect_url = "/";
+				if (window.appointment_settings.success_redirect_url) {
+					redirect_url += window.appointment_settings.success_redirect_url;
+				}
+				window.location.href = redirect_url;
+			}, 5000);
+		},
+		error: (err) => {
+			frappe.show_alert(__("Something went wrong please try again"));
+			button.disabled = false;
+		},
+	});
 }
 
 function get_form_data() {
-    let contact = {};
-    let inputs = ['name', 'skype', 'number', 'notes', 'email'];
-    inputs.forEach((id) => contact[id] = document.getElementById(`customer_${id}`).value)
-    return contact
+	let contact = {};
+	let inputs = ["name", "skype", "number", "notes", "email"];
+	inputs.forEach((id) => (contact[id] = document.getElementById(`customer_${id}`).value));
+	return contact;
 }