Merge pull request #17658 from deepeshgarg007/territory_item_code_develop

fix: Inactive Sales Item report fixes
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index 42c84da..bfc5e6d 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -375,10 +375,18 @@
 	show_modal_for_manufacturers: function(frm) {
 		var dialog = new frappe.ui.Dialog({
 			fields: [
-				{fieldtype:'Link', options:'Manufacturer',
-					reqd:1, label:'Manufacturer'},
-				{fieldtype:'Data', label:'Manufacturer Part Number',
-					fieldname: 'manufacturer_part_no'},
+				{
+					fieldtype: 'Link',
+					fieldname: 'manufacturer',
+					options: 'Manufacturer',
+					label: 'Manufacturer',
+					reqd: 1,
+				},
+				{
+					fieldtype: 'Data',
+					label: 'Manufacturer Part Number',
+					fieldname: 'manufacturer_part_no'
+				},
 			]
 		});
 
@@ -389,7 +397,7 @@
 			// call the server to make the variant
 			data.template = frm.doc.name;
 			frappe.call({
-				method:"erpnext.controllers.item_variant.get_variant",
+				method: "erpnext.controllers.item_variant.get_variant",
 				args: data,
 				callback: function(r) {
 					var doclist = frappe.model.sync(r.message);
@@ -464,7 +472,7 @@
 
 				me.multiple_variant_dialog.hide();
 				frappe.call({
-					method:"erpnext.controllers.item_variant.enqueue_multiple_variant_creation",
+					method: "erpnext.controllers.item_variant.enqueue_multiple_variant_creation",
 					args: {
 						"item": frm.doc.name,
 						"args": selected_attributes
@@ -514,9 +522,9 @@
 			let p = new Promise(resolve => {
 				if(!d.numeric_values) {
 					frappe.call({
-						method:"frappe.client.get_list",
-						args:{
-							doctype:"Item Attribute Value",
+						method: "frappe.client.get_list",
+						args: {
+							doctype: "Item Attribute Value",
 							filters: [
 								["parent","=", d.attribute]
 							],
@@ -534,9 +542,9 @@
 					});
 				} else {
 					frappe.call({
-						method:"frappe.client.get",
-						args:{
-							doctype:"Item Attribute",
+						method: "frappe.client.get",
+						args: {
+							doctype: "Item Attribute",
 							name: d.attribute
 						}
 					}).then((r) => {
@@ -599,7 +607,7 @@
 			var args = d.get_values();
 			if(!args) return;
 			frappe.call({
-				method:"erpnext.controllers.item_variant.get_variant",
+				method: "erpnext.controllers.item_variant.get_variant",
 				btn: d.get_primary_btn(),
 				args: {
 					"template": frm.doc.name,
@@ -622,7 +630,7 @@
 					} else {
 						d.hide();
 						frappe.call({
-							method:"erpnext.controllers.item_variant.create_variant",
+							method: "erpnext.controllers.item_variant.create_variant",
 							args: {
 								"item": frm.doc.name,
 								"args": d.get_values()
@@ -660,8 +668,8 @@
 				.on('input', function(e) {
 					var term = e.target.value;
 					frappe.call({
-						method:"erpnext.stock.doctype.item.item.get_item_attribute",
-						args:{
+						method: "erpnext.stock.doctype.item.item.get_item_attribute",
+						args: {
 							parent: i,
 							attribute_value: term
 						},
@@ -723,7 +731,7 @@
 		var row = locals[cdt][cdn];
 		if (row.uom) {
 			frappe.call({
-				method:"erpnext.stock.doctype.item.item.get_uom_conv_factor",
+				method: "erpnext.stock.doctype.item.item.get_uom_conv_factor",
 				args: {
 					"uom": row.uom,
 					"stock_uom": frm.doc.stock_uom