Merge pull request #37418 from barredterra/de-is-return

fix: german tranlations of "Is Return"
diff --git a/.github/helper/install.sh b/.github/helper/install.sh
index d1a97f8..915a463 100644
--- a/.github/helper/install.sh
+++ b/.github/helper/install.sh
@@ -4,7 +4,9 @@
 
 cd ~ || exit
 
-sudo apt update && sudo apt install redis-server libcups2-dev
+sudo apt update
+sudo apt remove mysql-server mysql-client
+sudo apt install libcups2-dev redis-server mariadb-client-10.6
 
 pip install frappe-bench
 
@@ -25,14 +27,14 @@
 
 
 if [ "$DB" == "mariadb" ];then
-    mysql --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL character_set_server = 'utf8mb4'"
-    mysql --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'"
+    mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL character_set_server = 'utf8mb4'"
+    mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'"
 
-    mysql --host 127.0.0.1 --port 3306 -u root -proot -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'"
-    mysql --host 127.0.0.1 --port 3306 -u root -proot -e "CREATE DATABASE test_frappe"
-    mysql --host 127.0.0.1 --port 3306 -u root -proot -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'"
+    mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'"
+    mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "CREATE DATABASE test_frappe"
+    mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'"
 
-    mysql --host 127.0.0.1 --port 3306 -u root -proot -e "FLUSH PRIVILEGES"
+    mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "FLUSH PRIVILEGES"
 fi
 
 if [ "$DB" == "postgres" ];then
diff --git a/.github/workflows/initiate_release.yml b/.github/workflows/initiate_release.yml
index ee60bad..7034773 100644
--- a/.github/workflows/initiate_release.yml
+++ b/.github/workflows/initiate_release.yml
@@ -30,23 +30,3 @@
           head: version-${{ matrix.version }}-hotfix
         env:
           GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
-
-  beta-release:
-    name: Release
-    runs-on: ubuntu-latest
-    strategy:
-      fail-fast: false
-
-    steps:
-      - uses: octokit/request-action@v2.x
-        with:
-          route: POST /repos/{owner}/{repo}/pulls
-          owner: frappe
-          repo: erpnext
-          title: |-
-            "chore: release v15 beta"
-          body: "Automated beta release."
-          base: version-15-beta
-          head: develop
-        env:
-          GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
diff --git a/.github/workflows/patch.yml b/.github/workflows/patch.yml
index 07b8de7..21dd3d4 100644
--- a/.github/workflows/patch.yml
+++ b/.github/workflows/patch.yml
@@ -28,7 +28,7 @@
           MARIADB_ROOT_PASSWORD: 'root'
         ports:
           - 3306:3306
-        options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
+        options: --health-cmd="mariadb-admin ping" --health-interval=5s --health-timeout=2s --health-retries=3
 
     steps:
       - name: Clone
diff --git a/.github/workflows/server-tests-mariadb.yml b/.github/workflows/server-tests-mariadb.yml
index 559be06..ccdfc8c 100644
--- a/.github/workflows/server-tests-mariadb.yml
+++ b/.github/workflows/server-tests-mariadb.yml
@@ -47,7 +47,7 @@
           MARIADB_ROOT_PASSWORD: 'root'
         ports:
           - 3306:3306
-        options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
+        options: --health-cmd="mariadb-admin ping" --health-interval=5s --health-timeout=2s --health-retries=3
 
     steps:
       - name: Clone
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py
index 38a5209..e6403fd 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.py
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py
@@ -271,16 +271,18 @@
 
 				# if no payment template is used by invoice and has a custom term(no `payment_term`), then invoice outstanding will be in 'None' key
 				latest = latest.get(d.payment_term) or latest.get(None)
-
 				# The reference has already been fully paid
 				if not latest:
 					frappe.throw(
 						_("{0} {1} has already been fully paid.").format(_(d.reference_doctype), d.reference_name)
 					)
 				# The reference has already been partly paid
-				elif latest.outstanding_amount < latest.invoice_amount and flt(
-					d.outstanding_amount, d.precision("outstanding_amount")
-				) != flt(latest.outstanding_amount, d.precision("outstanding_amount")):
+				elif (
+					latest.outstanding_amount < latest.invoice_amount
+					and flt(d.outstanding_amount, d.precision("outstanding_amount"))
+					!= flt(latest.outstanding_amount, d.precision("outstanding_amount"))
+					and d.payment_term == ""
+				):
 					frappe.throw(
 						_(
 							"{0} {1} has already been partly paid. Please use the 'Get Outstanding Invoice' or the 'Get Outstanding Orders' button to get the latest outstanding amounts."
@@ -1751,11 +1753,10 @@
 										"voucher_type": d.voucher_type,
 										"posting_date": d.posting_date,
 										"invoice_amount": flt(d.invoice_amount),
-										"outstanding_amount": flt(d.outstanding_amount),
-										"payment_term_outstanding": payment_term_outstanding,
-										"allocated_amount": payment_term_outstanding
+										"outstanding_amount": payment_term_outstanding
 										if payment_term_outstanding
 										else d.outstanding_amount,
+										"payment_term_outstanding": payment_term_outstanding,
 										"payment_amount": payment_term.payment_amount,
 										"payment_term": payment_term.payment_term,
 										"account": d.account,
diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py
index 11d6d5f..df4f1b2 100644
--- a/erpnext/accounts/doctype/payment_request/payment_request.py
+++ b/erpnext/accounts/doctype/payment_request/payment_request.py
@@ -249,7 +249,7 @@
 		if (
 			party_account_currency == ref_doc.company_currency and party_account_currency != self.currency
 		):
-			party_amount = ref_doc.base_grand_total
+			party_amount = ref_doc.get("base_rounded_total") or ref_doc.get("base_grand_total")
 		else:
 			party_amount = self.grand_total
 
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
index 85ed126..2433268 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -539,8 +539,9 @@
 			]
 			child_tables = {"items": ("expense_account",), "taxes": ("account_head",)}
 			self.needs_repost = self.check_if_fields_updated(fields_to_check, child_tables)
-			self.validate_for_repost()
-			self.db_set("repost_required", self.needs_repost)
+			if self.needs_repost:
+				self.validate_for_repost()
+				self.db_set("repost_required", self.needs_repost)
 
 	def make_gl_entries(self, gl_entries=None, from_repost=False):
 		if not gl_entries:
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index f380825..f6d9c93 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -536,8 +536,9 @@
 				"taxes": ("account_head",),
 			}
 			self.needs_repost = self.check_if_fields_updated(fields_to_check, child_tables)
-			self.validate_for_repost()
-			self.db_set("repost_required", self.needs_repost)
+			if self.needs_repost:
+				self.validate_for_repost()
+				self.db_set("repost_required", self.needs_repost)
 
 	def set_paid_amount(self):
 		paid_amount = 0.0
diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
index abeaab1..5d2764b 100644
--- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
+++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
@@ -157,7 +157,6 @@
    "oldfieldname": "description",
    "oldfieldtype": "Text",
    "print_width": "200px",
-   "reqd": 1,
    "width": "200px"
   },
   {
@@ -912,4 +911,4 @@
  "sort_field": "modified",
  "sort_order": "DESC",
  "states": []
-}
\ No newline at end of file
+}
diff --git a/erpnext/accounts/report/balance_sheet/balance_sheet.js b/erpnext/accounts/report/balance_sheet/balance_sheet.js
index ecc13d7..c2b57f7 100644
--- a/erpnext/accounts/report/balance_sheet/balance_sheet.js
+++ b/erpnext/accounts/report/balance_sheet/balance_sheet.js
@@ -1,25 +1,23 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.require("assets/erpnext/js/financial_statements.js", function () {
-	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);
+erpnext.utils.add_dimensions("Balance Sheet", 10);
 
-	frappe.query_reports["Balance Sheet"]["filters"].push({
-		fieldname: "accumulated_values",
-		label: __("Accumulated Values"),
-		fieldtype: "Check",
-		default: 1,
-	});
+frappe.query_reports["Balance Sheet"]["filters"].push({
+	fieldname: "accumulated_values",
+	label: __("Accumulated Values"),
+	fieldtype: "Check",
+	default: 1,
+});
 
-	frappe.query_reports["Balance Sheet"]["filters"].push({
-		fieldname: "include_default_book_entries",
-		label: __("Include Default Book Entries"),
-		fieldtype: "Check",
-		default: 1,
-	});
+frappe.query_reports["Balance Sheet"]["filters"].push({
+	fieldname: "include_default_book_entries",
+	label: __("Include Default Book Entries"),
+	fieldtype: "Check",
+	default: 1,
 });
diff --git a/erpnext/accounts/report/cash_flow/cash_flow.js b/erpnext/accounts/report/cash_flow/cash_flow.js
index a2c34c6..6b8ed27 100644
--- a/erpnext/accounts/report/cash_flow/cash_flow.js
+++ b/erpnext/accounts/report/cash_flow/cash_flow.js
@@ -1,24 +1,24 @@
 // Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.require("assets/erpnext/js/financial_statements.js", function() {
-	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
-	// of this if you are working here.
+// 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
+// of this if you are working here.
 
-	frappe.query_reports["Cash Flow"]["filters"].splice(8, 1);
+frappe.query_reports["Cash Flow"]["filters"].splice(8, 1);
 
-	frappe.query_reports["Cash Flow"]["filters"].push(
-		{
-			"fieldname": "include_default_book_entries",
-			"label": __("Include Default Book Entries"),
-			"fieldtype": "Check",
-			"default": 1
-		}
-	);
-});
+frappe.query_reports["Cash Flow"]["filters"].push(
+	{
+		"fieldname": "include_default_book_entries",
+		"label": __("Include Default Book 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 1afa8d5..590408c 100644
--- a/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.js
+++ b/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.js
@@ -2,152 +2,150 @@
 // For license information, please see license.txt
 
 
-frappe.require("assets/erpnext/js/financial_statements.js", function() {
-	frappe.query_reports["Consolidated Financial Statement"] = {
-		"filters": [
-			{
-				"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');
-
-					frappe.query_report.refresh();
-				}
-			},
-			{
-				"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":"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
-						});
-					});
-				}
-			},
-			{
-				"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
-						});
-					});
-				}
-			},
-			{
-				"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": "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": "include_default_book_entries",
-				"label": __("Include Default Book Entries"),
-				"fieldtype": "Check",
-				"default": 1
-			},
-			{
-				"fieldname": "show_zero_values",
-				"label": __("Show zero values"),
-				"fieldtype": "Check"
-			}
-		],
-		"formatter": function(value, row, column, data, default_formatter) {
-			if (data && column.fieldname=="account") {
-				value = data.account_name || value;
-
-				column.link_onclick =
-				"erpnext.financial_statements.open_general_ledger(" + JSON.stringify(data) + ")";
-				column.is_tree = true;
-			}
-
-			if (data && data.account && column.apply_currency_formatter) {
-				data.currency = erpnext.get_currency(column.company_name);
-			}
-
-			value = default_formatter(value, row, column, data);
-			if (!data.parent_account) {
-				value = $(`<span>${value}</span>`);
-
-				var $value = $(value).css("font-weight", "bold");
-
-				value = $value.wrap("<p></p>").parent().html();
-			}
-			return value;
+frappe.query_reports["Consolidated Financial Statement"] = {
+	"filters": [
+		{
+			"fieldname":"company",
+			"label": __("Company"),
+			"fieldtype": "Link",
+			"options": "Company",
+			"default": frappe.defaults.get_user_default("Company"),
+			"reqd": 1
 		},
-		onload: function() {
-			let fiscal_year = erpnext.utils.get_fiscal_year(frappe.datetime.get_today());
+		{
+			"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.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
+				frappe.query_report.refresh();
+			}
+		},
+		{
+			"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":"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
+					});
 				});
-			});
+			}
+		},
+		{
+			"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
+					});
+				});
+			}
+		},
+		{
+			"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": "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": "include_default_book_entries",
+			"label": __("Include Default Book Entries"),
+			"fieldtype": "Check",
+			"default": 1
+		},
+		{
+			"fieldname": "show_zero_values",
+			"label": __("Show zero values"),
+			"fieldtype": "Check"
 		}
+	],
+	"formatter": function(value, row, column, data, default_formatter) {
+		if (data && column.fieldname=="account") {
+			value = data.account_name || value;
+
+			column.link_onclick =
+				"erpnext.financial_statements.open_general_ledger(" + JSON.stringify(data) + ")";
+			column.is_tree = true;
+		}
+
+		if (data && data.account && column.apply_currency_formatter) {
+			data.currency = erpnext.get_currency(column.company_name);
+		}
+
+		value = default_formatter(value, row, column, data);
+		if (!data.parent_account) {
+			value = $(`<span>${value}</span>`);
+
+			var $value = $(value).css("font-weight", "bold");
+
+			value = $value.wrap("<p></p>").parent().html();
+		}
+		return value;
+	},
+	onload: function() {
+		let fiscal_year = erpnext.utils.get_fiscal_year(frappe.datetime.get_today());
+
+		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
+			});
+		});
 	}
-});
+}
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 79e5a09..51fa8c8 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
@@ -2,83 +2,81 @@
 // For license information, please see license.txt
 
 
-frappe.require("assets/erpnext/js/financial_statements.js", function() {
-	frappe.query_reports["Dimension-wise Accounts Balance Report"] = {
-		"filters": [
-			{
-				"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) {
-					var fiscal_year = query_report.get_values().fiscal_year;
-					if (!fiscal_year) {
-						return;
-					}
-					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
-						});
-					});
+frappe.query_reports["Dimension-wise Accounts Balance Report"] = {
+	"filters": [
+		{
+			"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) {
+				var fiscal_year = query_report.get_values().fiscal_year;
+				if (!fiscal_year) {
+					return;
 				}
-			},
-			{
-				"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": "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,
-			},
-		],
-		"formatter": erpnext.financial_statements.formatter,
-		"tree": true,
-		"name_field": "account",
-		"parent_field": "parent_account",
-		"initial_depth": 3
-	}
+				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
+					});
+				});
+			}
+		},
+		{
+			"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": "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,
+		},
+	],
+	"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);
-			});
-		});
+			   {fields:['document_type']}).then((res) => {
+				   res.forEach((dimension) => {
+					   options.push(dimension.document_type);
+				   });
+			   });
 	return options
 }
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 f6b0b8c..40d4259 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
@@ -2,20 +2,15 @@
 // For license information, please see license.txt
 
 
-frappe.query_reports["Gross and Net Profit Report"] = {
-	"filters": [
+frappe.query_reports["Gross and Net Profit Report"] = $.extend(
+	{},
+	erpnext.financial_statements
+);
 
-	]
-}
-frappe.require("assets/erpnext/js/financial_statements.js", function() {
-	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/profit_and_loss_statement/profit_and_loss_statement.js b/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.js
index 9fe93b9..e5898bf 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,18 +1,16 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.require("assets/erpnext/js/financial_statements.js", function () {
-	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);
+erpnext.utils.add_dimensions("Profit and Loss Statement", 10);
 
-	frappe.query_reports["Profit and Loss Statement"]["filters"].push({
-		fieldname: "accumulated_values",
-		label: __("Accumulated Values"),
-		fieldtype: "Check",
-		default: 1,
-	});
+frappe.query_reports["Profit and Loss Statement"]["filters"].push({
+	fieldname: "accumulated_values",
+	label: __("Accumulated Values"),
+	fieldtype: "Check",
+	default: 1,
 });
diff --git a/erpnext/accounts/report/profitability_analysis/profitability_analysis.js b/erpnext/accounts/report/profitability_analysis/profitability_analysis.js
index ebd0ec1..4a3d9bb 100644
--- a/erpnext/accounts/report/profitability_analysis/profitability_analysis.js
+++ b/erpnext/accounts/report/profitability_analysis/profitability_analysis.js
@@ -1,133 +1,131 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.require("assets/erpnext/js/financial_statements.js", function() {
-	frappe.query_reports["Profitability Analysis"] = {
-		"filters": [
-			{
-				"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){
-					let based_on = query_report.get_values().based_on;
-					if(based_on!='Accounting Dimension'){
-						frappe.query_report.set_filter_value({
-							accounting_dimension: ''
-						});
-					}
-				}
-			},
-			{
-				"fieldname": "accounting_dimension",
-				"label": __("Accounting Dimension"),
-				"fieldtype": "Link",
-				"options": "Accounting Dimension",
-				"get_query": () =>{
-					return {
-						filters: {
-							"disabled": 0
-						}
-					}
-				}
-			},
-			{
-				"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) {
-						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
-						});
+frappe.query_reports["Profitability Analysis"] = {
+	"filters": [
+		{
+			"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){
+				let based_on = query_report.get_values().based_on;
+				if(based_on!='Accounting Dimension'){
+					frappe.query_report.set_filter_value({
+						accounting_dimension: ''
 					});
 				}
-			},
-			{
-				"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": "show_zero_values",
-				"label": __("Show zero values"),
-				"fieldtype": "Check"
 			}
-		],
-		"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) + ")";
-				column.is_tree = true;
-			}
-
-			value = default_formatter(value, row, column, data);
-
-			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) {
-					$value.addClass("text-danger");
+		},
+		{
+			"fieldname": "accounting_dimension",
+			"label": __("Accounting Dimension"),
+			"fieldtype": "Link",
+			"options": "Accounting Dimension",
+			"get_query": () =>{
+				return {
+					filters: {
+						"disabled": 0
+					}
 				}
+			}
+		},
+		{
+			"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) {
+					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
+					});
+				});
+			}
+		},
+		{
+			"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": "show_zero_values",
+			"label": __("Show zero values"),
+			"fieldtype": "Check"
+		}
+	],
+	"formatter": function(value, row, column, data, default_formatter) {
+		if (column.fieldname=="account") {
+			value = data.account_name;
 
-				value = $value.wrap("<p></p>").parent().html();
+			column.link_onclick =
+				"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') {
+			value = $(`<span>${value}</span>`);
+			var $value = $(value).css("font-weight", "bold");
+			if (data.warn_if_negative && data[column.fieldname] < 0) {
+				$value.addClass("text-danger");
 			}
 
-			return value;
-		},
-		"open_profit_and_loss_statement": function(data) {
-			if (!data.account) return;
+			value = $value.wrap("<p></p>").parent().html();
+		}
 
-			frappe.route_options = {
-				"company": frappe.query_report.get_filter_value('company'),
-				"from_fiscal_year": data.fiscal_year,
-				"to_fiscal_year": data.fiscal_year
-			};
+		return value;
+	},
+	"open_profit_and_loss_statement": function(data) {
+		if (!data.account) return;
 
-			if(data.based_on == 'Cost Center'){
-				frappe.route_options["cost_center"] = data.account
-			} else {
-				frappe.route_options["project"] = data.account
-			}
+		frappe.route_options = {
+			"company": frappe.query_report.get_filter_value('company'),
+			"from_fiscal_year": data.fiscal_year,
+			"to_fiscal_year": data.fiscal_year
+		};
 
-			frappe.set_route("query-report", "Profit and Loss Statement");
-		},
-		"tree": true,
-		"name_field": "account",
-		"parent_field": "parent_account",
-		"initial_depth": 3
-	}
+		if(data.based_on == 'Cost Center'){
+			frappe.route_options["cost_center"] = data.account
+		} else {
+			frappe.route_options["project"] = data.account
+		}
 
-	erpnext.dimension_filters.forEach((dimension) => {
-		frappe.query_reports["Profitability Analysis"].filters[1].options.push(dimension["document_type"]);
-	});
+		frappe.set_route("query-report", "Profit and Loss Statement");
+	},
+	"tree": true,
+	"name_field": "account",
+	"parent_field": "parent_account",
+	"initial_depth": 3
+}
 
+erpnext.dimension_filters.forEach((dimension) => {
+	frappe.query_reports["Profitability Analysis"].filters[1].options.push(dimension["document_type"]);
 });
+
diff --git a/erpnext/accounts/report/trial_balance/trial_balance.js b/erpnext/accounts/report/trial_balance/trial_balance.js
index c12ab0f..edd40b6 100644
--- a/erpnext/accounts/report/trial_balance/trial_balance.js
+++ b/erpnext/accounts/report/trial_balance/trial_balance.js
@@ -1,118 +1,116 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-frappe.require("assets/erpnext/js/financial_statements.js", function() {
-	frappe.query_reports["Trial Balance"] = {
-		"filters": [
-			{
-				"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) {
-					var fiscal_year = query_report.get_values().fiscal_year;
-					if (!fiscal_year) {
-						return;
-					}
-					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
-						});
+frappe.query_reports["Trial Balance"] = {
+	"filters": [
+		{
+			"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) {
+				var fiscal_year = query_report.get_values().fiscal_year;
+				if (!fiscal_year) {
+					return;
+				}
+				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
 					});
-				}
-			},
-			{
-				"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": "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,
-						}
+				});
+			}
+		},
+		{
+			"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": "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,
 					}
 				}
-			},
-			{
-				"fieldname": "project",
-				"label": __("Project"),
-				"fieldtype": "Link",
-				"options": "Project"
-			},
-			{
-				"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": "with_period_closing_entry",
-				"label": __("Period Closing Entry"),
-				"fieldtype": "Check",
-				"default": 1
-			},
-			{
-				"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": "include_default_book_entries",
-				"label": __("Include Default Book Entries"),
-				"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
-	}
+		},
+		{
+			"fieldname": "project",
+			"label": __("Project"),
+			"fieldtype": "Link",
+			"options": "Project"
+		},
+		{
+			"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": "with_period_closing_entry",
+			"label": __("Period Closing Entry"),
+			"fieldtype": "Check",
+			"default": 1
+		},
+		{
+			"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": "include_default_book_entries",
+			"label": __("Include Default Book Entries"),
+			"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
+}
 
-	erpnext.utils.add_dimensions('Trial Balance', 6);
-});
+erpnext.utils.add_dimensions('Trial Balance', 6);
diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json
index f79b622..6b29984 100644
--- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json
+++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json
@@ -180,7 +180,6 @@
    "oldfieldname": "description",
    "oldfieldtype": "Small Text",
    "print_width": "300px",
-   "reqd": 1,
    "width": "300px"
   },
   {
@@ -916,4 +915,4 @@
  "sort_order": "DESC",
  "states": [],
  "track_changes": 1
-}
\ No newline at end of file
+}
diff --git a/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json b/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json
index e07f462..82fcfa2 100644
--- a/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json
+++ b/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json
@@ -84,7 +84,6 @@
    "oldfieldname": "description",
    "oldfieldtype": "Small Text",
    "print_width": "300px",
-   "reqd": 1,
    "width": "300px"
   },
   {
@@ -270,4 +269,4 @@
  "sort_field": "modified",
  "sort_order": "DESC",
  "track_changes": 1
-}
\ No newline at end of file
+}
diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json
index 638cde0..8d491fb 100644
--- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json
+++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json
@@ -126,7 +126,6 @@
    "oldfieldname": "description",
    "oldfieldtype": "Small Text",
    "print_width": "300px",
-   "reqd": 1,
    "width": "300px"
   },
   {
@@ -569,4 +568,4 @@
  "sort_field": "modified",
  "sort_order": "DESC",
  "track_changes": 1
-}
\ No newline at end of file
+}
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 6812940..e170044 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -13,6 +13,7 @@
 	add_days,
 	add_months,
 	cint,
+	comma_and,
 	flt,
 	fmt_money,
 	formatdate,
@@ -181,6 +182,17 @@
 		self.validate_party_account_currency()
 
 		if self.doctype in ["Purchase Invoice", "Sales Invoice"]:
+			if invalid_advances := [
+				x for x in self.advances if not x.reference_type or not x.reference_name
+			]:
+				frappe.throw(
+					_(
+						"Rows: {0} in {1} section are Invalid. Reference Name should point to a valid Payment Entry or Journal Entry."
+					).format(
+						frappe.bold(comma_and([x.idx for x in invalid_advances])), frappe.bold(_("Advance Payments"))
+					)
+				)
+
 			pos_check_field = "is_pos" if self.doctype == "Sales Invoice" else "is_paid"
 			if cint(self.allocate_advances_automatically) and not cint(self.get(pos_check_field)):
 				self.set_advances()
diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py
index deef020..ddd9375 100644
--- a/erpnext/manufacturing/doctype/production_plan/production_plan.py
+++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py
@@ -8,7 +8,6 @@
 import frappe
 from frappe import _, msgprint
 from frappe.model.document import Document
-from frappe.query_builder import Case
 from frappe.query_builder.functions import IfNull, Sum
 from frappe.utils import (
 	add_days,
@@ -1618,21 +1617,13 @@
 	table = frappe.qb.DocType("Production Plan")
 	child = frappe.qb.DocType("Material Request Plan Item")
 
-	completed_production_plans = get_completed_production_plans()
+	non_completed_production_plans = get_non_completed_production_plans()
 
-	case = Case()
 	query = (
 		frappe.qb.from_(table)
 		.inner_join(child)
 		.on(table.name == child.parent)
-		.select(
-			Sum(
-				child.quantity
-				* IfNull(
-					case.when(child.material_request_type == "Purchase", child.conversion_factor).else_(1.0), 1.0
-				)
-			)
-		)
+		.select(Sum(child.required_bom_qty))
 		.where(
 			(table.docstatus == 1)
 			& (child.item_code == item_code)
@@ -1641,8 +1632,8 @@
 		)
 	)
 
-	if completed_production_plans:
-		query = query.where(table.name.notin(completed_production_plans))
+	if non_completed_production_plans:
+		query = query.where(table.name.isin(non_completed_production_plans))
 
 	query = query.run()
 
@@ -1653,7 +1644,7 @@
 
 	reserved_qty_for_production = flt(
 		get_reserved_qty_for_production(
-			item_code, warehouse, completed_production_plans, check_production_plan=True
+			item_code, warehouse, non_completed_production_plans, check_production_plan=True
 		)
 	)
 
@@ -1663,7 +1654,7 @@
 	return reserved_qty_for_production_plan - reserved_qty_for_production
 
 
-def get_completed_production_plans():
+def get_non_completed_production_plans():
 	table = frappe.qb.DocType("Production Plan")
 	child = frappe.qb.DocType("Production Plan Item")
 
@@ -1675,7 +1666,7 @@
 		.where(
 			(table.docstatus == 1)
 			& (table.status.notin(["Completed", "Closed"]))
-			& (child.ordered_qty >= child.planned_qty)
+			& (child.planned_qty > child.ordered_qty)
 		)
 	).run(as_dict=True)
 
diff --git a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py
index 4ff9d29..6ab9232 100644
--- a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py
+++ b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py
@@ -6,8 +6,8 @@
 
 from erpnext.controllers.item_variant import create_variant
 from erpnext.manufacturing.doctype.production_plan.production_plan import (
-	get_completed_production_plans,
 	get_items_for_material_requests,
+	get_non_completed_production_plans,
 	get_sales_orders,
 	get_warehouse_list,
 )
@@ -1143,9 +1143,9 @@
 
 		self.assertEqual(after_qty, before_qty)
 
-		completed_plans = get_completed_production_plans()
+		completed_plans = get_non_completed_production_plans()
 		for plan in plans:
-			self.assertTrue(plan in completed_plans)
+			self.assertFalse(plan in completed_plans)
 
 	def test_resered_qty_for_production_plan_for_material_requests_with_multi_UOM(self):
 		from erpnext.stock.utils import get_or_make_bin
diff --git a/erpnext/manufacturing/doctype/work_order/work_order.py b/erpnext/manufacturing/doctype/work_order/work_order.py
index 3dc33ac..f9fddcb 100644
--- a/erpnext/manufacturing/doctype/work_order/work_order.py
+++ b/erpnext/manufacturing/doctype/work_order/work_order.py
@@ -1515,7 +1515,7 @@
 def get_reserved_qty_for_production(
 	item_code: str,
 	warehouse: str,
-	completed_production_plans: list = None,
+	non_completed_production_plans: list = None,
 	check_production_plan: bool = False,
 ) -> float:
 	"""Get total reserved quantity for any item in specified warehouse"""
@@ -1538,19 +1538,22 @@
 			& (wo_item.parent == wo.name)
 			& (wo.docstatus == 1)
 			& (wo_item.source_warehouse == warehouse)
-			& (wo.status.notin(["Stopped", "Completed", "Closed"]))
-			& (
-				(wo_item.required_qty > wo_item.transferred_qty)
-				| (wo_item.required_qty > wo_item.consumed_qty)
-			)
 		)
 	)
 
 	if check_production_plan:
 		query = query.where(wo.production_plan.isnotnull())
+	else:
+		query = query.where(
+			(wo.status.notin(["Stopped", "Completed", "Closed"]))
+			& (
+				(wo_item.required_qty > wo_item.transferred_qty)
+				| (wo_item.required_qty > wo_item.consumed_qty)
+			)
+		)
 
-	if completed_production_plans:
-		query = query.where(wo.production_plan.notin(completed_production_plans))
+	if non_completed_production_plans:
+		query = query.where(wo.production_plan.isin(non_completed_production_plans))
 
 	return query.run()[0][0] or 0.0
 
diff --git a/erpnext/projects/doctype/task_depends_on/task_depends_on.json b/erpnext/projects/doctype/task_depends_on/task_depends_on.json
index dbbe9d3..5102986 100644
--- a/erpnext/projects/doctype/task_depends_on/task_depends_on.json
+++ b/erpnext/projects/doctype/task_depends_on/task_depends_on.json
@@ -1,156 +1,52 @@
 {
- "allow_copy": 0, 
- "allow_import": 0, 
- "allow_rename": 0, 
- "beta": 0, 
- "creation": "2015-04-29 04:52:48.868079", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "", 
- "editable_grid": 1, 
+ "actions": [],
+ "creation": "2015-04-29 04:52:48.868079",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+  "task",
+  "column_break_2",
+  "subject",
+  "project"
+ ],
  "fields": [
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "task", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Task", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Task", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
+   "fieldname": "task",
+   "fieldtype": "Link",
+   "in_list_view": 1,
+   "label": "Task",
+   "options": "Task"
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_2", 
-   "fieldtype": "Column Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
+   "fieldname": "column_break_2",
+   "fieldtype": "Column Break"
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "subject", 
-   "fieldtype": "Text", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Subject", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
+   "fetch_from": "task.subject",
+   "fieldname": "subject",
+   "fieldtype": "Text",
+   "in_list_view": 1,
+   "label": "Subject",
+   "read_only": 1
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "project", 
-   "fieldtype": "Text", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Project", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
+   "fetch_from": "task.project",
+   "fieldname": "project",
+   "fieldtype": "Text",
+   "label": "Project",
+   "read_only": 1
   }
- ], 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 0, 
- "image_view": 0, 
- "in_create": 0, 
-
- "is_submittable": 0, 
- "issingle": 0, 
- "istable": 1, 
- "max_attachments": 0, 
- "modified": "2017-02-24 04:56:04.862502", 
- "modified_by": "Administrator", 
- "module": "Projects", 
- "name": "Task Depends On", 
- "name_case": "", 
- "owner": "Administrator", 
- "permissions": [], 
- "quick_entry": 0, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "show_name_in_global_search": 0, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "track_changes": 0, 
- "track_seen": 0
+ ],
+ "istable": 1,
+ "links": [],
+ "modified": "2023-10-09 11:34:14.335853",
+ "modified_by": "Administrator",
+ "module": "Projects",
+ "name": "Task Depends On",
+ "owner": "Administrator",
+ "permissions": [],
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "states": []
 }
\ No newline at end of file
diff --git a/erpnext/public/js/erpnext.bundle.js b/erpnext/public/js/erpnext.bundle.js
index 0e1b23b..dee9a06 100644
--- a/erpnext/public/js/erpnext.bundle.js
+++ b/erpnext/public/js/erpnext.bundle.js
@@ -30,5 +30,6 @@
 import "./utils/sales_common.js";
 import "./controllers/buying.js";
 import "./utils/demo.js";
+import "./financial_statements.js";
 
 // import { sum } from 'frappe/public/utils/util.js'
diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.json b/erpnext/selling/doctype/quotation_item/quotation_item.json
index dde2f9b..5016f1f 100644
--- a/erpnext/selling/doctype/quotation_item/quotation_item.json
+++ b/erpnext/selling/doctype/quotation_item/quotation_item.json
@@ -132,7 +132,6 @@
    "oldfieldname": "description",
    "oldfieldtype": "Small Text",
    "print_width": "300px",
-   "reqd": 1,
    "width": "300px"
   },
   {
@@ -677,4 +676,4 @@
  "sort_order": "DESC",
  "states": [],
  "track_changes": 1
-}
\ No newline at end of file
+}
diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.json b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
index 07565c3..e6f7456 100644
--- a/erpnext/selling/doctype/sales_order_item/sales_order_item.json
+++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
@@ -162,7 +162,6 @@
    "oldfieldname": "description",
    "oldfieldtype": "Small Text",
    "print_width": "300px",
-   "reqd": 1,
    "width": "300px"
   },
   {
@@ -906,4 +905,4 @@
  "sort_order": "DESC",
  "states": [],
  "track_changes": 1
-}
\ No newline at end of file
+}
diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
index d3236ba..612d674 100644
--- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
+++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
@@ -165,7 +165,6 @@
    "oldfieldname": "description",
    "oldfieldtype": "Small Text",
    "print_width": "300px",
-   "reqd": 1,
    "width": "300px"
   },
   {
@@ -903,4 +902,4 @@
  "sort_field": "modified",
  "sort_order": "DESC",
  "states": []
-}
\ No newline at end of file
+}
diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js
index bf3301f..9673a70 100644
--- a/erpnext/stock/doctype/material_request/material_request.js
+++ b/erpnext/stock/doctype/material_request/material_request.js
@@ -102,6 +102,12 @@
 
 		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'));
+			}
+
 			if (flt(frm.doc.per_ordered, precision) < 100) {
 				let add_create_pick_list_button = () => {
 					frm.add_custom_button(__('Pick List'),
@@ -148,11 +154,6 @@
 				}
 
 				frm.page.set_inner_btn_group_as_primary(__('Create'));
-
-				// stop
-				frm.add_custom_button(__('Stop'),
-					() => frm.events.update_status(frm, 'Stopped'));
-
 			}
 		}
 
diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.json b/erpnext/stock/doctype/material_request_item/material_request_item.json
index 770dacd..c585d6c 100644
--- a/erpnext/stock/doctype/material_request_item/material_request_item.json
+++ b/erpnext/stock/doctype/material_request_item/material_request_item.json
@@ -104,7 +104,6 @@
    "oldfieldname": "description",
    "oldfieldtype": "Text",
    "print_width": "250px",
-   "reqd": 1,
    "width": "250px"
   },
   {
@@ -472,4 +471,4 @@
  "sort_order": "DESC",
  "states": [],
  "track_changes": 1
-}
\ No newline at end of file
+}
diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
index d7419dc..d93d21c 100644
--- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
+++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
@@ -187,7 +187,6 @@
    "oldfieldname": "description",
    "oldfieldtype": "Text",
    "print_width": "300px",
-   "reqd": 1,
    "width": "300px"
   },
   {
@@ -1079,4 +1078,4 @@
  "sort_field": "modified",
  "sort_order": "DESC",
  "states": []
-}
\ No newline at end of file
+}
diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.json b/erpnext/stock/doctype/stock_settings/stock_settings.json
index 4fbc0eb..2052daa 100644
--- a/erpnext/stock/doctype/stock_settings/stock_settings.json
+++ b/erpnext/stock/doctype/stock_settings/stock_settings.json
@@ -428,7 +428,7 @@
  "index_web_pages_for_search": 1,
  "issingle": 1,
  "links": [],
- "modified": "2023-09-01 16:16:34.018947",
+ "modified": "2023-10-01 14:22:36.136111",
  "modified_by": "Administrator",
  "module": "Stock",
  "name": "Stock Settings",
@@ -442,6 +442,10 @@
    "role": "Stock Manager",
    "share": 1,
    "write": 1
+  },
+  {
+   "read": 1,
+   "role": "Sales User"
   }
  ],
  "quick_entry": 1,
@@ -449,4 +453,4 @@
  "sort_order": "ASC",
  "states": [],
  "track_changes": 1
-}
\ No newline at end of file
+}