Merge pull request #37304 from GursheenK/party-totals-payable-report

fix: only float row values for total in AP summary
diff --git a/erpnext/accounts/doctype/bank_clearance/test_bank_clearance.py b/erpnext/accounts/doctype/bank_clearance/test_bank_clearance.py
index c7404d1..2a18830 100644
--- a/erpnext/accounts/doctype/bank_clearance/test_bank_clearance.py
+++ b/erpnext/accounts/doctype/bank_clearance/test_bank_clearance.py
@@ -35,13 +35,13 @@
 		from lending.loan_management.doctype.loan.test_loan import (
 			create_loan,
 			create_loan_accounts,
-			create_loan_type,
+			create_loan_product,
 			create_repayment_entry,
 			make_loan_disbursement_entry,
 		)
 
 		def create_loan_masters():
-			create_loan_type(
+			create_loan_product(
 				"Clearance Loan",
 				2000000,
 				13.5,
diff --git a/erpnext/accounts/doctype/bank_transaction/test_bank_transaction.py b/erpnext/accounts/doctype/bank_transaction/test_bank_transaction.py
index 0c328ff..2a504f6 100644
--- a/erpnext/accounts/doctype/bank_transaction/test_bank_transaction.py
+++ b/erpnext/accounts/doctype/bank_transaction/test_bank_transaction.py
@@ -410,7 +410,7 @@
 def create_loan_and_repayment():
 	from lending.loan_management.doctype.loan.test_loan import (
 		create_loan,
-		create_loan_type,
+		create_loan_product,
 		create_repayment_entry,
 		make_loan_disbursement_entry,
 	)
@@ -420,7 +420,7 @@
 
 	from erpnext.setup.doctype.employee.test_employee import make_employee
 
-	create_loan_type(
+	create_loan_product(
 		"Personal Loan",
 		500000,
 		8.4,
@@ -441,7 +441,7 @@
 			"applicant_type": "Employee",
 			"company": "_Test Company",
 			"applicant": applicant,
-			"loan_type": "Personal Loan",
+			"loan_product": "Personal Loan",
 			"loan_amount": 5000,
 			"repayment_method": "Repay Fixed Amount per Period",
 			"monthly_repayment_amount": 500,
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index f3c0181..e489882 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -1385,6 +1385,7 @@
    "depends_on": "eval:doc.is_subcontracted",
    "fieldname": "supplier_warehouse",
    "fieldtype": "Link",
+   "ignore_user_permissions": 1,
    "label": "Supplier Warehouse",
    "no_copy": 1,
    "options": "Warehouse",
@@ -1593,7 +1594,7 @@
  "idx": 204,
  "is_submittable": 1,
  "links": [],
- "modified": "2023-09-21 12:22:04.545106",
+ "modified": "2023-10-01 21:01:47.282533",
  "modified_by": "Administrator",
  "module": "Accounts",
  "name": "Purchase Invoice",
diff --git a/erpnext/accounts/report/profitability_analysis/profitability_analysis.js b/erpnext/accounts/report/profitability_analysis/profitability_analysis.js
index c9accef..ebd0ec1 100644
--- a/erpnext/accounts/report/profitability_analysis/profitability_analysis.js
+++ b/erpnext/accounts/report/profitability_analysis/profitability_analysis.js
@@ -112,7 +112,7 @@
 				"to_fiscal_year": data.fiscal_year
 			};
 
-			if(data.based_on == 'cost_center'){
+			if(data.based_on == 'Cost Center'){
 				frappe.route_options["cost_center"] = data.account
 			} else {
 				frappe.route_options["project"] = data.account
diff --git a/erpnext/assets/doctype/asset/asset.js b/erpnext/assets/doctype/asset/asset.js
index 962292b..ba7940c 100644
--- a/erpnext/assets/doctype/asset/asset.js
+++ b/erpnext/assets/doctype/asset/asset.js
@@ -239,7 +239,7 @@
 
 		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`, {'color': 'var(--text-muted)'});
+		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});
@@ -340,7 +340,8 @@
 			method: "erpnext.assets.doctype.asset.asset.get_item_details",
 			args: {
 				item_code: frm.doc.item_code,
-				asset_category: frm.doc.asset_category
+				asset_category: frm.doc.asset_category,
+				gross_purchase_amount: frm.doc.gross_purchase_amount
 			},
 			callback: function(r, rt) {
 				if(r.message) {
@@ -546,7 +547,21 @@
 				}
 			});
 		}
-	}
+	},
+
+	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);
+			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);
+			frappe.flags.from_set_salvage_value_percentage_or_expected_value_after_useful_life = false;
+		}
+	},
 });
 
 frappe.ui.form.on('Asset Finance Book', {
@@ -557,9 +572,19 @@
 
 	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_depreciation_rate(frm, row);
 	},
 
+	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);
+		}
+	},
+
 	frequency_of_depreciation: function(frm, cdt, cdn) {
 		const row = locals[cdt][cdn];
 		frm.events.set_depreciation_rate(frm, row);
diff --git a/erpnext/assets/doctype/asset/asset.py b/erpnext/assets/doctype/asset/asset.py
index 0dbed87..2e69fe5 100644
--- a/erpnext/assets/doctype/asset/asset.py
+++ b/erpnext/assets/doctype/asset/asset.py
@@ -198,7 +198,9 @@
 			self.asset_category = frappe.get_cached_value("Item", self.item_code, "asset_category")
 
 		if self.item_code and not self.get("finance_books"):
-			finance_books = get_item_details(self.item_code, self.asset_category)
+			finance_books = get_item_details(
+				self.item_code, self.asset_category, self.gross_purchase_amount
+			)
 			self.set("finance_books", finance_books)
 
 	def validate_finance_books(self):
@@ -797,7 +799,7 @@
 
 
 @frappe.whitelist()
-def get_item_details(item_code, asset_category):
+def get_item_details(item_code, asset_category, gross_purchase_amount):
 	asset_category_doc = frappe.get_doc("Asset Category", asset_category)
 	books = []
 	for d in asset_category_doc.finance_books:
@@ -807,7 +809,11 @@
 				"depreciation_method": d.depreciation_method,
 				"total_number_of_depreciations": d.total_number_of_depreciations,
 				"frequency_of_depreciation": d.frequency_of_depreciation,
-				"start_date": nowdate(),
+				"daily_depreciation": d.daily_depreciation,
+				"salvage_value_percentage": d.salvage_value_percentage,
+				"expected_value_after_useful_life": flt(gross_purchase_amount)
+				* flt(d.salvage_value_percentage / 100),
+				"depreciation_start_date": d.depreciation_start_date or nowdate(),
 			}
 		)
 
diff --git a/erpnext/assets/doctype/asset_activity/asset_activity.json b/erpnext/assets/doctype/asset_activity/asset_activity.json
index 476fb27..00992e2 100644
--- a/erpnext/assets/doctype/asset_activity/asset_activity.json
+++ b/erpnext/assets/doctype/asset_activity/asset_activity.json
@@ -75,13 +75,14 @@
  "in_create": 1,
  "index_web_pages_for_search": 1,
  "links": [],
- "modified": "2023-08-01 11:09:52.584482",
+ "modified": "2023-09-29 15:56:17.608643",
  "modified_by": "Administrator",
  "module": "Assets",
  "name": "Asset Activity",
  "owner": "Administrator",
  "permissions": [
   {
+   "delete": 1,
    "email": 1,
    "read": 1,
    "report": 1,
@@ -89,6 +90,7 @@
    "share": 1
   },
   {
+   "delete": 1,
    "email": 1,
    "read": 1,
    "report": 1,
@@ -96,6 +98,7 @@
    "share": 1
   },
   {
+   "delete": 1,
    "email": 1,
    "read": 1,
    "report": 1,
diff --git a/erpnext/assets/doctype/asset_finance_book/asset_finance_book.json b/erpnext/assets/doctype/asset_finance_book/asset_finance_book.json
index 4121302..2c27dc9 100644
--- a/erpnext/assets/doctype/asset_finance_book/asset_finance_book.json
+++ b/erpnext/assets/doctype/asset_finance_book/asset_finance_book.json
@@ -12,6 +12,7 @@
   "column_break_5",
   "frequency_of_depreciation",
   "depreciation_start_date",
+  "salvage_value_percentage",
   "expected_value_after_useful_life",
   "value_after_depreciation",
   "rate_of_depreciation"
@@ -91,12 +92,17 @@
    "fieldname": "daily_depreciation",
    "fieldtype": "Check",
    "label": "Daily Depreciation"
+  },
+  {
+   "fieldname": "salvage_value_percentage",
+   "fieldtype": "Percent",
+   "label": "Salvage Value Percentage"
   }
  ],
  "index_web_pages_for_search": 1,
  "istable": 1,
  "links": [],
- "modified": "2023-08-10 22:10:36.576199",
+ "modified": "2023-09-29 15:39:52.740594",
  "modified_by": "Administrator",
  "module": "Assets",
  "name": "Asset Finance Book",
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index 5b5cc2b..f74df66 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -477,6 +477,7 @@
    "depends_on": "eval:doc.is_subcontracted",
    "fieldname": "supplier_warehouse",
    "fieldtype": "Link",
+   "ignore_user_permissions": 1,
    "label": "Supplier Warehouse",
    "options": "Warehouse"
   },
@@ -1274,7 +1275,7 @@
  "idx": 105,
  "is_submittable": 1,
  "links": [],
- "modified": "2023-09-13 16:21:07.361700",
+ "modified": "2023-10-01 20:58:07.851037",
  "modified_by": "Administrator",
  "module": "Buying",
  "name": "Purchase Order",
diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.json b/erpnext/manufacturing/doctype/production_plan/production_plan.json
index 0d0fd5e..4a00416 100644
--- a/erpnext/manufacturing/doctype/production_plan/production_plan.json
+++ b/erpnext/manufacturing/doctype/production_plan/production_plan.json
@@ -228,7 +228,7 @@
   },
   {
    "default": "0",
-   "description": "If enabled, the system won't create material requests for the available items.",
+   "description": "If enabled, the system will create material requests even if the stock exists in the 'Raw Materials Warehouse'.",
    "fieldname": "ignore_existing_ordered_qty",
    "fieldtype": "Check",
    "label": "Ignore Available Stock"
@@ -422,7 +422,7 @@
  "index_web_pages_for_search": 1,
  "is_submittable": 1,
  "links": [],
- "modified": "2023-07-28 13:37:43.926686",
+ "modified": "2023-09-29 11:41:03.246059",
  "modified_by": "Administrator",
  "module": "Manufacturing",
  "name": "Production Plan",
diff --git a/erpnext/regional/__init__.py b/erpnext/regional/__init__.py
index ec2db81..bd5d540 100644
--- a/erpnext/regional/__init__.py
+++ b/erpnext/regional/__init__.py
@@ -10,7 +10,7 @@
 
 def check_deletion_permission(doc, method):
 	region = get_region(doc.company)
-	if region in ["Nepal", "France"] and doc.docstatus != 0:
+	if region in ["Nepal"] and doc.docstatus != 0:
 		frappe.throw(_("Deletion is not permitted for country {0}").format(region))
 
 
@@ -20,7 +20,7 @@
 	Called on submit of Sales Invoice and Payment Entry.
 	"""
 	region = get_region()
-	if region not in ["France", "Germany"]:
+	if region not in ["Germany"]:
 		return
 
 	data = str(doc.as_dict())
diff --git a/erpnext/regional/address_template/templates/france.html b/erpnext/regional/address_template/templates/france.html
deleted file mode 100644
index 752331e..0000000
--- a/erpnext/regional/address_template/templates/france.html
+++ /dev/null
@@ -1,5 +0,0 @@
-{% if address_line1 %}{{ address_line1 }}{% endif -%}
-{% if address_line2 %}<br>{{ address_line2 }}{% endif -%}
-{% if pincode %}<br>{{ pincode }}{% endif -%}
-{% if city %} {{ city }}{% endif -%}
-{% if country %}<br>{{ country }}{% endif -%}
diff --git a/erpnext/regional/france/__init__.py b/erpnext/regional/france/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/regional/france/__init__.py
+++ /dev/null
diff --git a/erpnext/regional/france/setup.py b/erpnext/regional/france/setup.py
deleted file mode 100644
index da772d6..0000000
--- a/erpnext/regional/france/setup.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-
-import frappe
-from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
-
-
-def setup(company=None, patch=True):
-	make_custom_fields()
-	add_custom_roles_for_reports()
-
-
-def make_custom_fields():
-	custom_fields = {
-		"Company": [
-			dict(fieldname="siren_number", label="SIREN Number", fieldtype="Data", insert_after="website")
-		]
-	}
-
-	create_custom_fields(custom_fields)
-
-
-def add_custom_roles_for_reports():
-	report_name = "Fichier des Ecritures Comptables [FEC]"
-
-	if not frappe.db.get_value("Custom Role", dict(report=report_name)):
-		frappe.get_doc(
-			dict(doctype="Custom Role", report=report_name, roles=[dict(role="Accounts Manager")])
-		).insert()
diff --git a/erpnext/regional/france/utils.py b/erpnext/regional/france/utils.py
deleted file mode 100644
index 65dfd2d..0000000
--- a/erpnext/regional/france/utils.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright (c) 2018, Frappe Technologies and contributors
-# For license information, please see license.txt
-
-
-# don't remove this function it is used in tests
-def test_method():
-	"""test function"""
-	return "overridden"
diff --git "a/erpnext/regional/report/fichier_des_ecritures_comptables_\133fec\135/__init__.py" "b/erpnext/regional/report/fichier_des_ecritures_comptables_\133fec\135/__init__.py"
deleted file mode 100644
index e69de29..0000000
--- "a/erpnext/regional/report/fichier_des_ecritures_comptables_\133fec\135/__init__.py"
+++ /dev/null
diff --git "a/erpnext/regional/report/fichier_des_ecritures_comptables_\133fec\135/fichier_des_ecritures_comptables_\133fec\135.js" "b/erpnext/regional/report/fichier_des_ecritures_comptables_\133fec\135/fichier_des_ecritures_comptables_\133fec\135.js"
deleted file mode 100644
index b85b58f..0000000
--- "a/erpnext/regional/report/fichier_des_ecritures_comptables_\133fec\135/fichier_des_ecritures_comptables_\133fec\135.js"
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.query_reports["Fichier des Ecritures Comptables [FEC]"] = {
-	"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
-		}
-	],
-	onload: function(query_report) {
-		query_report.page.add_inner_button(__("Export"), function() {
-			fec_export(query_report);
-		});
-
-		query_report.add_make_chart_button = function() {
-			//
-		};
-
-		query_report.export_report = function() {
-			fec_export(query_report);
-		};
-	}
-};
-
-let fec_export = function(query_report) {
-	const fiscal_year = query_report.get_values().fiscal_year;
-	const company = query_report.get_values().company;
-
-	frappe.db.get_value("Company", company, "siren_number", (value) => {
-		const company_data = value.siren_number;
-		if (company_data === null || company_data === undefined) {
-			frappe.msgprint(__("Please register the SIREN number in the company information file"));
-		} else {
-			frappe.db.get_value("Fiscal Year", fiscal_year, "year_end_date", (r) => {
-				const fy = r.year_end_date;
-				const title = company_data + "FEC" + moment(fy).format('YYYYMMDD');
-				const column_row = query_report.columns.map(col => col.label);
-				const column_data = query_report.get_data_for_csv(false);
-				const result = [column_row].concat(column_data);
-				downloadify(result, null, title);
-			});
-
-		}
-	});
-};
-
-let downloadify = function(data, roles, title) {
-	if (roles && roles.length && !has_common(roles, roles)) {
-		frappe.msgprint(__("Export not allowed. You need {0} role to export.", [frappe.utils.comma_or(roles)]));
-		return;
-	}
-
-	const filename = title + ".txt";
-	let csv_data = to_tab_csv(data);
-	const a = document.createElement('a');
-
-	if ("download" in a) {
-		// Used Blob object, because it can handle large files
-		let blob_object = new Blob([csv_data], {
-			type: 'text/csv;charset=UTF-8'
-		});
-		a.href = URL.createObjectURL(blob_object);
-		a.download = filename;
-
-	} else {
-		// use old method
-		a.href = 'data:attachment/csv,' + encodeURIComponent(csv_data);
-		a.download = filename;
-		a.target = "_blank";
-	}
-
-	document.body.appendChild(a);
-	a.click();
-
-	document.body.removeChild(a);
-};
-
-let to_tab_csv = function(data) {
-	let res = [];
-	$.each(data, function(i, row) {
-		res.push(row.join("\t"));
-	});
-	return res.join("\n");
-};
diff --git "a/erpnext/regional/report/fichier_des_ecritures_comptables_\133fec\135/fichier_des_ecritures_comptables_\133fec\135.json" "b/erpnext/regional/report/fichier_des_ecritures_comptables_\133fec\135/fichier_des_ecritures_comptables_\133fec\135.json"
deleted file mode 100644
index 9b48e11..0000000
--- "a/erpnext/regional/report/fichier_des_ecritures_comptables_\133fec\135/fichier_des_ecritures_comptables_\133fec\135.json"
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "add_total_row": 0, 
- "apply_user_permissions": 0, 
- "creation": "2018-01-10 15:10:16.650129", 
- "disabled": 0, 
- "docstatus": 0, 
- "doctype": "Report", 
- "idx": 0, 
- "is_standard": "Yes", 
- "modified": "2018-01-11 10:27:25.595485", 
- "modified_by": "Administrator", 
- "module": "Regional", 
- "name": "Fichier des Ecritures Comptables [FEC]", 
- "owner": "Administrator", 
- "ref_doctype": "GL Entry", 
- "report_name": "Fichier des Ecritures Comptables [FEC]", 
- "report_type": "Script Report", 
- "roles": []
-}
\ No newline at end of file
diff --git "a/erpnext/regional/report/fichier_des_ecritures_comptables_\133fec\135/fichier_des_ecritures_comptables_\133fec\135.py" "b/erpnext/regional/report/fichier_des_ecritures_comptables_\133fec\135/fichier_des_ecritures_comptables_\133fec\135.py"
deleted file mode 100644
index 6717989..0000000
--- "a/erpnext/regional/report/fichier_des_ecritures_comptables_\133fec\135/fichier_des_ecritures_comptables_\133fec\135.py"
+++ /dev/null
@@ -1,339 +0,0 @@
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-import re
-
-import frappe
-from frappe import _
-from frappe.utils import format_datetime
-
-COLUMNS = [
-	{
-		"label": "JournalCode",
-		"fieldname": "JournalCode",
-		"fieldtype": "Data",
-		"width": 90,
-	},
-	{
-		"label": "JournalLib",
-		"fieldname": "JournalLib",
-		"fieldtype": "Data",
-		"width": 90,
-	},
-	{
-		"label": "EcritureNum",
-		"fieldname": "EcritureNum",
-		"fieldtype": "Data",
-		"width": 90,
-	},
-	{
-		"label": "EcritureDate",
-		"fieldname": "EcritureDate",
-		"fieldtype": "Data",
-		"width": 90,
-	},
-	{
-		"label": "CompteNum",
-		"fieldname": "CompteNum",
-		"fieldtype": "Link",
-		"options": "Account",
-		"width": 100,
-	},
-	{
-		"label": "CompteLib",
-		"fieldname": "CompteLib",
-		"fieldtype": "Link",
-		"options": "Account",
-		"width": 200,
-	},
-	{
-		"label": "CompAuxNum",
-		"fieldname": "CompAuxNum",
-		"fieldtype": "Data",
-		"width": 90,
-	},
-	{
-		"label": "CompAuxLib",
-		"fieldname": "CompAuxLib",
-		"fieldtype": "Data",
-		"width": 90,
-	},
-	{
-		"label": "PieceRef",
-		"fieldname": "PieceRef",
-		"fieldtype": "Data",
-		"width": 90,
-	},
-	{
-		"label": "PieceDate",
-		"fieldname": "PieceDate",
-		"fieldtype": "Data",
-		"width": 90,
-	},
-	{
-		"label": "EcritureLib",
-		"fieldname": "EcritureLib",
-		"fieldtype": "Data",
-		"width": 90,
-	},
-	{
-		"label": "Debit",
-		"fieldname": "Debit",
-		"fieldtype": "Data",
-		"width": 90,
-	},
-	{
-		"label": "Credit",
-		"fieldname": "Credit",
-		"fieldtype": "Data",
-		"width": 90,
-	},
-	{
-		"label": "EcritureLet",
-		"fieldname": "EcritureLet",
-		"fieldtype": "Data",
-		"width": 90,
-	},
-	{
-		"label": "DateLet",
-		"fieldname": "DateLet",
-		"fieldtype": "Data",
-		"width": 90,
-	},
-	{
-		"label": "ValidDate",
-		"fieldname": "ValidDate",
-		"fieldtype": "Data",
-		"width": 90,
-	},
-	{
-		"label": "Montantdevise",
-		"fieldname": "Montantdevise",
-		"fieldtype": "Data",
-		"width": 90,
-	},
-	{
-		"label": "Idevise",
-		"fieldname": "Idevise",
-		"fieldtype": "Data",
-		"width": 90,
-	},
-]
-
-
-def execute(filters=None):
-	validate_filters(filters)
-	return COLUMNS, get_result(
-		company=filters["company"],
-		fiscal_year=filters["fiscal_year"],
-	)
-
-
-def validate_filters(filters):
-	if not filters.get("company"):
-		frappe.throw(_("{0} is mandatory").format(_("Company")))
-
-	if not filters.get("fiscal_year"):
-		frappe.throw(_("{0} is mandatory").format(_("Fiscal Year")))
-
-
-def get_gl_entries(company, fiscal_year):
-	gle = frappe.qb.DocType("GL Entry")
-	sales_invoice = frappe.qb.DocType("Sales Invoice")
-	purchase_invoice = frappe.qb.DocType("Purchase Invoice")
-	journal_entry = frappe.qb.DocType("Journal Entry")
-	payment_entry = frappe.qb.DocType("Payment Entry")
-	customer = frappe.qb.DocType("Customer")
-	supplier = frappe.qb.DocType("Supplier")
-	employee = frappe.qb.DocType("Employee")
-
-	debit = frappe.query_builder.functions.Sum(gle.debit).as_("debit")
-	credit = frappe.query_builder.functions.Sum(gle.credit).as_("credit")
-	debit_currency = frappe.query_builder.functions.Sum(gle.debit_in_account_currency).as_(
-		"debitCurr"
-	)
-	credit_currency = frappe.query_builder.functions.Sum(gle.credit_in_account_currency).as_(
-		"creditCurr"
-	)
-
-	query = (
-		frappe.qb.from_(gle)
-		.left_join(sales_invoice)
-		.on(gle.voucher_no == sales_invoice.name)
-		.left_join(purchase_invoice)
-		.on(gle.voucher_no == purchase_invoice.name)
-		.left_join(journal_entry)
-		.on(gle.voucher_no == journal_entry.name)
-		.left_join(payment_entry)
-		.on(gle.voucher_no == payment_entry.name)
-		.left_join(customer)
-		.on(gle.party == customer.name)
-		.left_join(supplier)
-		.on(gle.party == supplier.name)
-		.left_join(employee)
-		.on(gle.party == employee.name)
-		.select(
-			gle.posting_date.as_("GlPostDate"),
-			gle.name.as_("GlName"),
-			gle.account,
-			gle.transaction_date,
-			debit,
-			credit,
-			debit_currency,
-			credit_currency,
-			gle.voucher_type,
-			gle.voucher_no,
-			gle.against_voucher_type,
-			gle.against_voucher,
-			gle.account_currency,
-			gle.against,
-			gle.party_type,
-			gle.party,
-			sales_invoice.name.as_("InvName"),
-			sales_invoice.title.as_("InvTitle"),
-			sales_invoice.posting_date.as_("InvPostDate"),
-			purchase_invoice.name.as_("PurName"),
-			purchase_invoice.title.as_("PurTitle"),
-			purchase_invoice.posting_date.as_("PurPostDate"),
-			journal_entry.cheque_no.as_("JnlRef"),
-			journal_entry.posting_date.as_("JnlPostDate"),
-			journal_entry.title.as_("JnlTitle"),
-			payment_entry.name.as_("PayName"),
-			payment_entry.posting_date.as_("PayPostDate"),
-			payment_entry.title.as_("PayTitle"),
-			customer.customer_name,
-			customer.name.as_("cusName"),
-			supplier.supplier_name,
-			supplier.name.as_("supName"),
-			employee.employee_name,
-			employee.name.as_("empName"),
-		)
-		.where((gle.company == company) & (gle.fiscal_year == fiscal_year))
-		.groupby(gle.voucher_type, gle.voucher_no, gle.account)
-		.orderby(gle.posting_date, gle.voucher_no)
-	)
-
-	return query.run(as_dict=True)
-
-
-def get_result(company, fiscal_year):
-	data = get_gl_entries(company, fiscal_year)
-
-	result = []
-
-	company_currency = frappe.get_cached_value("Company", company, "default_currency")
-	accounts = frappe.get_all(
-		"Account", filters={"Company": company}, fields=["name", "account_number"]
-	)
-
-	for d in data:
-		JournalCode = re.split("-|/|[0-9]", d.get("voucher_no"))[0]
-
-		if d.get("voucher_no").startswith("{0}-".format(JournalCode)) or d.get("voucher_no").startswith(
-			"{0}/".format(JournalCode)
-		):
-			EcritureNum = re.split("-|/", d.get("voucher_no"))[1]
-		else:
-			EcritureNum = re.search(r"{0}(\d+)".format(JournalCode), d.get("voucher_no"), re.IGNORECASE)[1]
-
-		EcritureDate = format_datetime(d.get("GlPostDate"), "yyyyMMdd")
-
-		account_number = [
-			account.account_number for account in accounts if account.name == d.get("account")
-		]
-		if account_number[0] is not None:
-			CompteNum = account_number[0]
-		else:
-			frappe.throw(
-				_(
-					"Account number for account {0} is not available.<br> Please setup your Chart of Accounts correctly."
-				).format(d.get("account"))
-			)
-
-		if d.get("party_type") == "Customer":
-			CompAuxNum = d.get("cusName")
-			CompAuxLib = d.get("customer_name")
-
-		elif d.get("party_type") == "Supplier":
-			CompAuxNum = d.get("supName")
-			CompAuxLib = d.get("supplier_name")
-
-		elif d.get("party_type") == "Employee":
-			CompAuxNum = d.get("empName")
-			CompAuxLib = d.get("employee_name")
-
-		elif d.get("party_type") == "Student":
-			CompAuxNum = d.get("stuName")
-			CompAuxLib = d.get("student_name")
-
-		elif d.get("party_type") == "Member":
-			CompAuxNum = d.get("memName")
-			CompAuxLib = d.get("member_name")
-
-		else:
-			CompAuxNum = ""
-			CompAuxLib = ""
-
-		ValidDate = format_datetime(d.get("GlPostDate"), "yyyyMMdd")
-
-		PieceRef = d.get("voucher_no") or "Sans Reference"
-
-		# EcritureLib is the reference title unless it is an opening entry
-		if d.get("is_opening") == "Yes":
-			EcritureLib = _("Opening Entry Journal")
-		if d.get("voucher_type") == "Sales Invoice":
-			EcritureLib = d.get("InvTitle")
-		elif d.get("voucher_type") == "Purchase Invoice":
-			EcritureLib = d.get("PurTitle")
-		elif d.get("voucher_type") == "Journal Entry":
-			EcritureLib = d.get("JnlTitle")
-		elif d.get("voucher_type") == "Payment Entry":
-			EcritureLib = d.get("PayTitle")
-		else:
-			EcritureLib = d.get("voucher_type")
-
-		PieceDate = format_datetime(d.get("GlPostDate"), "yyyyMMdd")
-
-		debit = "{:.2f}".format(d.get("debit")).replace(".", ",")
-
-		credit = "{:.2f}".format(d.get("credit")).replace(".", ",")
-
-		Idevise = d.get("account_currency")
-
-		if Idevise != company_currency:
-			Montantdevise = (
-				"{:.2f}".format(d.get("debitCurr")).replace(".", ",")
-				if d.get("debitCurr") != 0
-				else "{:.2f}".format(d.get("creditCurr")).replace(".", ",")
-			)
-		else:
-			Montantdevise = (
-				"{:.2f}".format(d.get("debit")).replace(".", ",")
-				if d.get("debit") != 0
-				else "{:.2f}".format(d.get("credit")).replace(".", ",")
-			)
-
-		row = [
-			JournalCode,
-			d.get("voucher_type"),
-			EcritureNum,
-			EcritureDate,
-			CompteNum,
-			d.get("account"),
-			CompAuxNum,
-			CompAuxLib,
-			PieceRef,
-			PieceDate,
-			EcritureLib,
-			debit,
-			credit,
-			"",
-			"",
-			ValidDate,
-			Montantdevise,
-			Idevise,
-		]
-
-		result.append(row)
-
-	return result
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
index 912b908..c8a9e3e 100755
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
@@ -464,6 +464,7 @@
    "depends_on": "eval:doc.is_subcontracted",
    "fieldname": "supplier_warehouse",
    "fieldtype": "Link",
+   "ignore_user_permissions": 1,
    "label": "Supplier Warehouse",
    "no_copy": 1,
    "oldfieldname": "supplier_warehouse",
@@ -1241,7 +1242,7 @@
  "idx": 261,
  "is_submittable": 1,
  "links": [],
- "modified": "2023-07-04 17:23:17.025390",
+ "modified": "2023-10-01 21:00:44.556816",
  "modified_by": "Administrator",
  "module": "Stock",
  "name": "Purchase Receipt",
diff --git a/erpnext/tests/test_regional.py b/erpnext/tests/test_regional.py
index 2c16def..55c8bb7 100644
--- a/erpnext/tests/test_regional.py
+++ b/erpnext/tests/test_regional.py
@@ -14,6 +14,3 @@
 	def test_regional_overrides(self):
 		frappe.flags.country = "Maldives"
 		self.assertEqual(test_method(), "original")
-
-		frappe.flags.country = "France"
-		self.assertEqual(test_method(), "overridden")