Merge pull request #32725 from ernestoruiz89/patch-10

fix: add translate function on remark text on  asset_value_adjustment.py
diff --git a/erpnext/accounts/doctype/bank_clearance/bank_clearance.js b/erpnext/accounts/doctype/bank_clearance/bank_clearance.js
index 63cc465..7e57c2f 100644
--- a/erpnext/accounts/doctype/bank_clearance/bank_clearance.js
+++ b/erpnext/accounts/doctype/bank_clearance/bank_clearance.js
@@ -4,6 +4,23 @@
 frappe.ui.form.on("Bank Clearance", {
 	setup: function(frm) {
 		frm.add_fetch("account", "account_currency", "account_currency");
+
+		frm.set_query("account", function() {
+			return {
+				"filters": {
+					"account_type": ["in",["Bank","Cash"]],
+					"is_group": 0,
+				}
+			};
+		});
+
+		frm.set_query("bank_account", function () {
+			return {
+				filters: {
+					'is_company_account': 1
+				},
+			};
+		});
 	},
 
 	onload: function(frm) {
@@ -12,14 +29,7 @@
 			locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]: "";
 		frm.set_value("account", default_bank_account);
 
-		frm.set_query("account", function() {
-			return {
-				"filters": {
-					"account_type": ["in",["Bank","Cash"]],
-					"is_group": 0
-				}
-			};
-		});
+
 
 		frm.set_value("from_date", frappe.datetime.month_start());
 		frm.set_value("to_date", frappe.datetime.month_end());
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 7eb5c42..1f41661 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
@@ -22,13 +22,13 @@
 			}
 			if (data.user != frappe.session.user) return;
 			if (data.count == data.total) {
-				setTimeout((title) => {
+				setTimeout(() => {
 					frm.doc.import_in_progress = false;
 					frm.clear_table("invoices");
 					frm.refresh_fields();
 					frm.page.clear_indicator();
-					frm.dashboard.hide_progress(title);
-					frappe.msgprint(__("Opening {0} Invoice created", [frm.doc.invoice_type]));
+					frm.dashboard.hide_progress();
+					frappe.msgprint(__("Opening {0} Invoices created", [frm.doc.invoice_type]));
 				}, 1500, data.title);
 				return;
 			}
@@ -51,13 +51,6 @@
 				method: "make_invoices",
 				freeze: 1,
 				freeze_message: __("Creating {0} Invoice", [frm.doc.invoice_type]),
-				callback: function(r) {
-					if (r.message.length == 1) {
-						frappe.msgprint(__("{0} Invoice created successfully.", [frm.doc.invoice_type]));
-					} else if (r.message.length < 50) {
-						frappe.msgprint(__("{0} Invoices created successfully.", [frm.doc.invoice_type]));
-					}
-				}
 			});
 		});
 
diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py
index f7df1ff..57fe405 100644
--- a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py
+++ b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py
@@ -255,8 +255,6 @@
 
 
 def publish(index, total, doctype):
-	if total < 50:
-		return
 	frappe.publish_realtime(
 		"opening_invoice_creation_progress",
 		dict(
diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
index 9de9036..a8f6f80 100644
--- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
+++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
@@ -214,6 +214,7 @@
    "reqd": 1
   },
   {
+   "default": "1",
    "depends_on": "eval:doc.uom != doc.stock_uom",
    "fieldname": "conversion_factor",
    "fieldtype": "Float",
@@ -820,6 +821,7 @@
   },
   {
    "collapsible": 1,
+   "collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount",
    "fieldname": "section_break_26",
    "fieldtype": "Section Break",
    "label": "Discount and Margin"
@@ -871,7 +873,7 @@
  "idx": 1,
  "istable": 1,
  "links": [],
- "modified": "2022-10-12 03:37:29.032732",
+ "modified": "2022-10-26 16:05:37.304788",
  "modified_by": "Administrator",
  "module": "Accounts",
  "name": "Purchase Invoice Item",
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 a307a6c..7f1a1ec 100644
--- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
+++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
@@ -247,6 +247,7 @@
   },
   {
    "collapsible": 1,
+   "collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount",
    "fieldname": "discount_and_margin",
    "fieldtype": "Section Break",
    "label": "Discount and Margin"
@@ -876,7 +877,7 @@
  "idx": 1,
  "istable": 1,
  "links": [],
- "modified": "2022-10-10 20:57:38.340026",
+ "modified": "2022-10-26 11:38:36.119339",
  "modified_by": "Administrator",
  "module": "Accounts",
  "name": "Sales Invoice Item",
diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js
index 7cf14e6..e1a30a4 100644
--- a/erpnext/accounts/report/accounts_payable/accounts_payable.js
+++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js
@@ -51,6 +51,8 @@
 				} else {
 					frappe.query_report.set_filter_value('tax_id', "");
 				}
+
+				frappe.query_report.refresh();
 			}
 		},
 		{
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index 8557c03..f2ee1eb 100755
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -748,7 +748,7 @@
 
 		self.add_accounting_dimensions_filters()
 
-	def get_cost_center_conditions(self, conditions):
+	def get_cost_center_conditions(self):
 		lft, rgt = frappe.db.get_value("Cost Center", self.filters.cost_center, ["lft", "rgt"])
 		cost_center_list = [
 			center.name
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.html b/erpnext/accounts/report/general_ledger/general_ledger.html
index 378fa37..c04f518 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.html
+++ b/erpnext/accounts/report/general_ledger/general_ledger.html
@@ -52,22 +52,22 @@
 					{% } %}
 					</td>
 					<td style="text-align: right">
-						{%= format_currency(data[i].debit, filters.presentation_currency) %}</td>
+						{%= format_currency(data[i].debit, filters.presentation_currency || data[i].account_currency) %}</td>
 					<td style="text-align: right">
-						{%= format_currency(data[i].credit, filters.presentation_currency) %}</td>
+						{%= format_currency(data[i].credit, filters.presentation_currency || data[i].account_currency) %}</td>
 			{% } else { %}
 				<td></td>
 				<td></td>
 				<td><b>{%= frappe.format(data[i].account, {fieldtype: "Link"}) || "&nbsp;" %}</b></td>
 				<td style="text-align: right">
-					{%= data[i].account && format_currency(data[i].debit, filters.presentation_currency) %}
+					{%= data[i].account && format_currency(data[i].debit, filters.presentation_currency || data[i].account_currency) %}
 				</td>
 				<td style="text-align: right">
-					{%= data[i].account && format_currency(data[i].credit, filters.presentation_currency) %}
+					{%= data[i].account && format_currency(data[i].credit, filters.presentation_currency || data[i].account_currency) %}
 				</td>
 			{% } %}
 				<td style="text-align: right">
-					{%= format_currency(data[i].balance, filters.presentation_currency) %}
+					{%= format_currency(data[i].balance, filters.presentation_currency || data[i].account_currency) %}
 				</td>
 			</tr>
 		{% } %}
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 82e92e8..b8203bd 100644
--- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json
+++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json
@@ -777,6 +777,7 @@
   },
   {
    "collapsible": 1,
+   "collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount",
    "fieldname": "discount_and_margin_section",
    "fieldtype": "Section Break",
    "label": "Discount and Margin"
@@ -894,7 +895,7 @@
  "index_web_pages_for_search": 1,
  "istable": 1,
  "links": [],
- "modified": "2022-09-07 11:12:38.634976",
+ "modified": "2022-10-26 16:47:41.364387",
  "modified_by": "Administrator",
  "module": "Buying",
  "name": "Purchase Order Item",
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index f0e9e4b..1f3419f 100755
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -627,6 +627,7 @@
 				"field_map": {
 					"name": "sales_order",
 					"base_grand_total": "estimated_costing",
+					"net_total": "total_sales_amount",
 				},
 			},
 		},
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 2cf836f..ea0b25f 100644
--- a/erpnext/selling/doctype/sales_order_item/sales_order_item.json
+++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
@@ -272,6 +272,7 @@
   },
   {
    "collapsible": 1,
+   "collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount",
    "fieldname": "discount_and_margin",
    "fieldtype": "Section Break",
    "label": "Discount and Margin"
@@ -842,7 +843,7 @@
  "idx": 1,
  "istable": 1,
  "links": [],
- "modified": "2022-09-06 13:24:18.065312",
+ "modified": "2022-10-26 16:05:02.712705",
  "modified_by": "Administrator",
  "module": "Selling",
  "name": "Sales Order Item",
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 0a5cbab..77c3253 100644
--- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
+++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
@@ -261,6 +261,7 @@
   },
   {
    "collapsible": 1,
+   "collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount",
    "fieldname": "discount_and_margin",
    "fieldtype": "Section Break",
    "label": "Discount and Margin"
@@ -814,7 +815,7 @@
  "index_web_pages_for_search": 1,
  "istable": 1,
  "links": [],
- "modified": "2022-10-12 03:36:05.344847",
+ "modified": "2022-10-26 16:05:17.720768",
  "modified_by": "Administrator",
  "module": "Stock",
  "name": "Delivery Note Item",
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py
index 06ba936..b3ae7b5 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py
@@ -12,13 +12,17 @@
 			"Purchase Receipt": "return_against",
 		},
 		"internal_links": {
+			"Material Request": ["items", "material_request"],
 			"Purchase Order": ["items", "purchase_order"],
 			"Project": ["items", "project"],
 			"Quality Inspection": ["items", "quality_inspection"],
 		},
 		"transactions": [
 			{"label": _("Related"), "items": ["Purchase Invoice", "Landed Cost Voucher", "Asset"]},
-			{"label": _("Reference"), "items": ["Purchase Order", "Quality Inspection", "Project"]},
+			{
+				"label": _("Reference"),
+				"items": ["Material Request", "Purchase Order", "Quality Inspection", "Project"],
+			},
 			{"label": _("Returns"), "items": ["Purchase Receipt"]},
 			{"label": _("Subscription"), "items": ["Auto Repeat"]},
 		],
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 772736e..474ee92 100644
--- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
+++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
@@ -919,6 +919,7 @@
   },
   {
    "collapsible": 1,
+   "collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount",
    "fieldname": "discount_and_margin_section",
    "fieldtype": "Section Break",
    "label": "Discount and Margin"
@@ -1000,7 +1001,7 @@
  "idx": 1,
  "istable": 1,
  "links": [],
- "modified": "2022-10-12 03:37:59.516609",
+ "modified": "2022-10-26 16:06:02.524435",
  "modified_by": "Administrator",
  "module": "Stock",
  "name": "Purchase Receipt Item",