Merge pull request #21550 from frappe/new-translations

diff --git a/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py b/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py
index 14fdffc..7a85bfb 100644
--- a/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py
+++ b/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py
@@ -206,12 +206,13 @@
 		WHERE disabled = 0
 	""", as_dict=1)
 
-	default_dimensions = frappe.db.sql("""SELECT parent, company, default_dimension
-		FROM `tabAccounting Dimension Detail`""", as_dict=1)
+	default_dimensions = frappe.db.sql("""SELECT p.fieldname, c.company, c.default_dimension
+		FROM `tabAccounting Dimension Detail` c, `tabAccounting Dimension` p
+		WHERE c.parent = p.name""", as_dict=1)
 
 	default_dimensions_map = {}
 	for dimension in default_dimensions:
-		default_dimensions_map.setdefault(dimension['company'], {})
-		default_dimensions_map[dimension['company']][dimension['parent']] = dimension['default_dimension']
+		default_dimensions_map.setdefault(dimension.company, {})
+		default_dimensions_map[dimension.company][dimension.fieldname] = dimension.default_dimension
 
 	return dimension_filters, default_dimensions_map
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index d6ffdb6..41922a2 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -560,20 +560,20 @@
 
 			if self.write_off_based_on == 'Accounts Receivable':
 				jd1.party_type = "Customer"
-				jd1.credit = flt(d.outstanding_amount, self.precision("credit", "accounts"))
+				jd1.credit_in_account_currency = flt(d.outstanding_amount, self.precision("credit", "accounts"))
 				jd1.reference_type = "Sales Invoice"
 				jd1.reference_name = cstr(d.name)
 			elif self.write_off_based_on == 'Accounts Payable':
 				jd1.party_type = "Supplier"
-				jd1.debit = flt(d.outstanding_amount, self.precision("debit", "accounts"))
+				jd1.debit_in_account_currency = flt(d.outstanding_amount, self.precision("debit", "accounts"))
 				jd1.reference_type = "Purchase Invoice"
 				jd1.reference_name = cstr(d.name)
 
 		jd2 = self.append('accounts', {})
 		if self.write_off_based_on == 'Accounts Receivable':
-			jd2.debit = total
+			jd2.debit_in_account_currency = total
 		elif self.write_off_based_on == 'Accounts Payable':
-			jd2.credit = total
+			jd2.credit_in_account_currency = total
 
 		self.validate_total_debit_and_credit()
 
diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py
index bd8d8bd..7dd5b01 100644
--- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py
+++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py
@@ -7,6 +7,8 @@
 from frappe import _
 from erpnext.accounts.utils import get_account_currency
 from erpnext.controllers.accounts_controller import AccountsController
+from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (get_accounting_dimensions,
+	get_dimension_filters)
 
 class PeriodClosingVoucher(AccountsController):
 	def validate(self):
@@ -50,7 +52,15 @@
 	def make_gl_entries(self):
 		gl_entries = []
 		net_pl_balance = 0
-		pl_accounts = self.get_pl_balances()
+		dimension_fields = ['t1.cost_center']
+
+		accounting_dimensions = get_accounting_dimensions()
+		for dimension in accounting_dimensions:
+			dimension_fields.append('t1.{0}'.format(dimension))
+
+		dimension_filters, default_dimensions = get_dimension_filters()
+
+		pl_accounts = self.get_pl_balances(dimension_fields)
 
 		for acc in pl_accounts:
 			if flt(acc.balance_in_company_currency):
@@ -66,34 +76,41 @@
 						if flt(acc.balance_in_account_currency) > 0 else 0,
 					"credit": abs(flt(acc.balance_in_company_currency)) \
 						if flt(acc.balance_in_company_currency) > 0 else 0
-				}))
+				}, item=acc))
 
 				net_pl_balance += flt(acc.balance_in_company_currency)
 
 		if net_pl_balance:
 			cost_center = frappe.db.get_value("Company", self.company, "cost_center")
-			gl_entries.append(self.get_gl_dict({
+			gl_entry = self.get_gl_dict({
 				"account": self.closing_account_head,
 				"debit_in_account_currency": abs(net_pl_balance) if net_pl_balance > 0 else 0,
 				"debit": abs(net_pl_balance) if net_pl_balance > 0 else 0,
 				"credit_in_account_currency": abs(net_pl_balance) if net_pl_balance < 0 else 0,
 				"credit": abs(net_pl_balance) if net_pl_balance < 0 else 0,
 				"cost_center": cost_center
-			}))
+			})
+
+			for dimension in accounting_dimensions:
+				gl_entry.update({
+					dimension: default_dimensions.get(self.company, {}).get(dimension)
+				})
+
+			gl_entries.append(gl_entry)
 
 		from erpnext.accounts.general_ledger import make_gl_entries
 		make_gl_entries(gl_entries)
 
-	def get_pl_balances(self):
+	def get_pl_balances(self, dimension_fields):
 		"""Get balance for pl accounts"""
 		return frappe.db.sql("""
 			select
-				t1.account, t1.cost_center, t2.account_currency,
+				t1.account, t2.account_currency, {dimension_fields},
 				sum(t1.debit_in_account_currency) - sum(t1.credit_in_account_currency) as balance_in_account_currency,
 				sum(t1.debit) - sum(t1.credit) as balance_in_company_currency
 			from `tabGL Entry` t1, `tabAccount` t2
 			where t1.account = t2.name and t2.report_type = 'Profit and Loss'
 			and t2.docstatus < 2 and t2.company = %s
 			and t1.posting_date between %s and %s
-			group by t1.account, t1.cost_center
-		""", (self.company, self.get("year_start_date"), self.posting_date), as_dict=1)
+			group by t1.account, {dimension_fields}
+		""".format(dimension_fields = ', '.join(dimension_fields)), (self.company, self.get("year_start_date"), self.posting_date), as_dict=1)
diff --git a/erpnext/accounts/doctype/share_transfer/share_transfer.py b/erpnext/accounts/doctype/share_transfer/share_transfer.py
index 65f248e..4024b81 100644
--- a/erpnext/accounts/doctype/share_transfer/share_transfer.py
+++ b/erpnext/accounts/doctype/share_transfer/share_transfer.py
@@ -168,18 +168,20 @@
 		return 'Outside'
 
 	def folio_no_validation(self):
-		shareholders = ['from_shareholder', 'to_shareholder']
-		shareholders = [shareholder for shareholder in shareholders if self.get(shareholder) is not '']
-		for shareholder in shareholders:
-			doc = self.get_shareholder_doc(self.get(shareholder))
+		shareholder_fields = ['from_shareholder', 'to_shareholder']
+		for shareholder_field in shareholder_fields:
+			shareholder_name = self.get(shareholder_field)
+			if not shareholder_name:
+				continue
+			doc = self.get_shareholder_doc(shareholder_name)
 			if doc.company != self.company:
 				frappe.throw(_('The shareholder does not belong to this company'))
 			if not doc.folio_no:
 				doc.folio_no = self.from_folio_no \
-					if (shareholder == 'from_shareholder') else self.to_folio_no
+					if (shareholder_field == 'from_shareholder') else self.to_folio_no
 				doc.save()
 			else:
-				if doc.folio_no and doc.folio_no != (self.from_folio_no if (shareholder == 'from_shareholder') else self.to_folio_no):
+				if doc.folio_no and doc.folio_no != (self.from_folio_no if (shareholder_field == 'from_shareholder') else self.to_folio_no):
 					frappe.throw(_('The folio numbers are not matching'))
 
 	def autoname_folio(self, shareholder, is_company=False):
diff --git a/erpnext/assets/doctype/asset/asset.py b/erpnext/assets/doctype/asset/asset.py
index ecbfeb7..06dfa19 100644
--- a/erpnext/assets/doctype/asset/asset.py
+++ b/erpnext/assets/doctype/asset/asset.py
@@ -22,6 +22,7 @@
 		self.validate_item()
 		self.set_missing_values()
 		self.prepare_depreciation_data()
+		self.validate_gross_and_purchase_amount()
 		if self.get("schedules"):
 			self.validate_expected_value_after_useful_life()
 
@@ -124,6 +125,12 @@
 
 		if self.available_for_use_date and getdate(self.available_for_use_date) < getdate(self.purchase_date):
 			frappe.throw(_("Available-for-use Date should be after purchase date"))
+	
+	def validate_gross_and_purchase_amount(self):
+		if self.gross_purchase_amount and self.gross_purchase_amount != self.purchase_receipt_amount:
+			frappe.throw(_("Gross Purchase Amount should be {} to purchase amount of one single Asset. {}\
+				Please do not book expense of multiple assets against one single Asset.")
+				.format(frappe.bold("equal"), "<br>"), title=_("Invalid Gross Purchase Amount"))
 
 	def cancel_auto_gen_movement(self):
 		movements = frappe.db.sql(
diff --git a/erpnext/assets/doctype/asset/test_asset.py b/erpnext/assets/doctype/asset/test_asset.py
index 050b30d..a0f8d15 100644
--- a/erpnext/assets/doctype/asset/test_asset.py
+++ b/erpnext/assets/doctype/asset/test_asset.py
@@ -79,7 +79,6 @@
 		doc.set_missing_values()
 		self.assertEquals(doc.items[0].is_fixed_asset, 1)
 
-
 	def test_schedule_for_straight_line_method(self):
 		pr = make_purchase_receipt(item_code="Macbook Pro",
 			qty=1, rate=100000.0, location="Test Location")
@@ -596,6 +595,7 @@
 		"purchase_date": "2015-01-01",
 		"calculate_depreciation": 0,
 		"gross_purchase_amount": 100000,
+		"purchase_receipt_amount": 100000,
 		"expected_value_after_useful_life": 10000,
 		"warehouse": args.warehouse or "_Test Warehouse - _TC",
 		"available_for_use_date": "2020-06-06",
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
index 512d44e..c4ec30f 100755
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
@@ -325,7 +325,11 @@
 def send_confirmation_msg(doc):
 	if frappe.db.get_single_value('Healthcare Settings', 'send_appointment_confirmation'):
 		message = frappe.db.get_single_value('Healthcare Settings', 'appointment_confirmation_msg')
-		send_message(doc, message)
+		try:
+			send_message(doc, message)
+		except Exception:
+			frappe.log_error(frappe.get_traceback(), _('Appointment Confirmation Message Not Sent'))
+			frappe.msgprint(_('Appointment Confirmation Message Not Sent'), indicator='orange')
 
 
 @frappe.whitelist()
diff --git a/erpnext/hub_node/api.py b/erpnext/hub_node/api.py
index 2035174..42f9000 100644
--- a/erpnext/hub_node/api.py
+++ b/erpnext/hub_node/api.py
@@ -144,17 +144,9 @@
 			'hub_category': item.get('hub_category'),
 			'image_list': item.get('image_list')
 		}
-		if frappe.db.exists('Hub Tracked Item', item_code):
-			items_to_update.append(item)
-			hub_tracked_item = frappe.get_doc('Hub Tracked Item', item_code)
-			hub_tracked_item.update(hub_dict)
-			hub_tracked_item.save()
-		else:
-			frappe.get_doc(hub_dict).insert(ignore_if_duplicate=True)
+		frappe.get_doc(hub_dict).insert(ignore_if_duplicate=True)
 
-	items_to_publish = list(filter(lambda x: x not in items_to_update, items_to_publish))
-	new_items = map_fields(items_to_publish)
-	existing_items = map_fields(items_to_update)
+	items = map_fields(items_to_publish)
 
 	try:
 		item_sync_preprocess(len(items))
@@ -162,8 +154,7 @@
 
 		# TODO: Publish Progress
 		connection = get_hub_connection()
-		connection.insert_many(new_items)
-		connection.bulk_update(existing_items)
+		connection.insert_many(items)
 
 		item_sync_postprocess()
 	except Exception as e:
@@ -179,6 +170,7 @@
 
 	if response:
 		frappe.db.set_value('Item', item_code, 'publish_in_hub', 0)
+		frappe.delete_doc('Hub Tracked Item', item_code)
 	else:
 		frappe.throw(_('Unable to update remote activity'))
 
diff --git a/erpnext/manufacturing/doctype/work_order/work_order.js b/erpnext/manufacturing/doctype/work_order/work_order.js
index 4314517..c125571 100644
--- a/erpnext/manufacturing/doctype/work_order/work_order.js
+++ b/erpnext/manufacturing/doctype/work_order/work_order.js
@@ -122,12 +122,8 @@
 	},
 
 	source_warehouse: function(frm) {
-		if (frm.doc.source_warehouse) {
-			frm.doc.required_items.forEach(d => {
-				frappe.model.set_value(d.doctype, d.name,
-					"source_warehouse", frm.doc.source_warehouse);
-			});
-		}
+		let transaction_controller = new erpnext.TransactionController();
+		transaction_controller.autofill_warehouse(frm.doc.required_items, "source_warehouse", frm.doc.source_warehouse);
 	},
 
 	refresh: function(frm) {
diff --git a/erpnext/public/js/controllers/buying.js b/erpnext/public/js/controllers/buying.js
index d5dc412..9c56189 100644
--- a/erpnext/public/js/controllers/buying.js
+++ b/erpnext/public/js/controllers/buying.js
@@ -253,6 +253,13 @@
 		}
 	},
 
+	rejected_warehouse: function(doc, cdt) {
+		// trigger autofill_warehouse only if parent rejected_warehouse field is triggered
+		if (["Purchase Invoice", "Purchase Receipt"].includes(cdt)) {
+			this.autofill_warehouse(doc.items, "rejected_warehouse", doc.rejected_warehouse);
+		}
+	},
+
 	category: function(doc, cdt, cdn) {
 		// should be the category field of tax table
 		if(cdt != doc.doctype) {
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index c9d7728..28c2102 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -1903,21 +1903,16 @@
 	},
 
 	set_reserve_warehouse: function() {
-		this.autofill_warehouse("reserve_warehouse");
+		this.autofill_warehouse(this.frm.doc.supplied_items, "reserve_warehouse", this.frm.doc.set_reserve_warehouse);
 	},
 
 	set_warehouse: function() {
-		this.autofill_warehouse("warehouse");
+		this.autofill_warehouse(this.frm.doc.items, "warehouse", this.frm.doc.set_warehouse);
 	},
 
-	autofill_warehouse : function (warehouse_field) {
-		// set warehouse in all child table rows
-		var me = this;
-		let warehouse = (warehouse_field === "warehouse") ? me.frm.doc.set_warehouse : me.frm.doc.set_reserve_warehouse;
-		let child_table = (warehouse_field === "warehouse") ? me.frm.doc.items : me.frm.doc.supplied_items;
-		let doctype = (warehouse_field === "warehouse") ? (me.frm.doctype + " Item") : (me.frm.doctype + " Item Supplied");
-
-		if(warehouse) {
+	autofill_warehouse : function (child_table, warehouse_field, warehouse) {
+		if (warehouse && child_table && child_table.length) {
+			let doctype = child_table[0].doctype;
 			$.each(child_table || [], function(i, item) {
 				frappe.model.set_value(doctype, item.name, warehouse_field, warehouse);
 			});
diff --git a/erpnext/public/js/utils/dimension_tree_filter.js b/erpnext/public/js/utils/dimension_tree_filter.js
index b223fc5..b6720c0 100644
--- a/erpnext/public/js/utils/dimension_tree_filter.js
+++ b/erpnext/public/js/utils/dimension_tree_filter.js
@@ -46,7 +46,7 @@
 					if(frm.doc.company && Object.keys(default_dimensions || {}).length > 0
 						&& default_dimensions[frm.doc.company]) {
 
-						let default_dimension = default_dimensions[frm.doc.company][dimension['document_type']];
+						let default_dimension = default_dimensions[frm.doc.company][dimension['fieldname']];
 
 						if(default_dimension) {
 							if (frappe.meta.has_field(doctype, dimension['fieldname'])) {
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index 095b7c3..4a7dd5a 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -429,7 +429,7 @@
 		if (doc.has_serial_no && doc.serial_no) {
 			args['serial_no'] = doc.serial_no
 		}
-		
+
 		return frappe.call({
 			method: 'erpnext.stock.doctype.batch.batch.get_batch_no',
 			args: args,
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js
index 68836b4..60f6a68 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.js
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.js
@@ -101,17 +101,6 @@
 				})
 			}, __('Create'));
 		}
-	},
-
-	to_warehouse: function(frm) {
-		if(frm.doc.to_warehouse) {
-			["items", "packed_items"].forEach(doctype => {
-				frm.doc[doctype].forEach(d => {
-					frappe.model.set_value(d.doctype, d.name,
-						"target_warehouse", frm.doc.to_warehouse);
-				});
-			});
-		}
 	}
 });
 
@@ -287,6 +276,14 @@
 				frappe.ui.form.is_saving = false;
 			}
 		})
+	},
+
+	to_warehouse: function() {
+		let packed_items_table = this.frm.doc["packed_items"];
+		this.autofill_warehouse(this.frm.doc["items"], "target_warehouse", this.frm.doc.to_warehouse);
+		if (packed_items_table && packed_items_table.length) {
+			this.autofill_warehouse(packed_items_table, "target_warehouse", this.frm.doc.to_warehouse);
+		}
 	}
 
 });
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index e4412e0..53b986c 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -875,39 +875,17 @@
 		if(!row.t_warehouse) row.t_warehouse = this.frm.doc.to_warehouse;
 	},
 
-	source_mandatory: ["Material Issue", "Material Transfer", "Send to Subcontractor",
-		"Material Transfer for Manufacture", "Send to Warehouse", "Receive at Warehouse"],
-	target_mandatory: ["Material Receipt", "Material Transfer", "Send to Subcontractor",
-		"Material Transfer for Manufacture", "Send to Warehouse", "Receive at Warehouse"],
-
 	from_warehouse: function(doc) {
-		var me = this;
-		this.set_warehouse_if_different("s_warehouse", doc.from_warehouse, function(row) {
-			return me.source_mandatory.indexOf(me.frm.doc.purpose)!==-1;
-		});
+		this.set_warehouse_in_children(doc.items, "s_warehouse", doc.from_warehouse);
 	},
 
 	to_warehouse: function(doc) {
-		var me = this;
-		this.set_warehouse_if_different("t_warehouse", doc.to_warehouse, function(row) {
-			return me.target_mandatory.indexOf(me.frm.doc.purpose)!==-1;
-		});
+		this.set_warehouse_in_children(doc.items, "t_warehouse", doc.to_warehouse);
 	},
 
-	set_warehouse_if_different: function(fieldname, value, condition) {
-		var changed = false;
-		for (var i=0, l=(this.frm.doc.items || []).length; i<l; i++) {
-			var row = this.frm.doc.items[i];
-			if (row[fieldname] != value) {
-				if (condition && !condition(row)) {
-					continue;
-				}
-
-				frappe.model.set_value(row.doctype, row.name, fieldname, value, "Link");
-				changed = true;
-			}
-		}
-		refresh_field("items");
+	set_warehouse_in_children: function(child_table, warehouse_field, warehouse) {
+		let transaction_controller = new erpnext.TransactionController();
+		transaction_controller.autofill_warehouse(child_table, warehouse_field, warehouse);
 	},
 
 	items_on_form_rendered: function(doc, grid_row) {
diff --git a/erpnext/stock/report/stock_balance/stock_balance.js b/erpnext/stock/report/stock_balance/stock_balance.js
index 537fa7c..7d22823 100644
--- a/erpnext/stock/report/stock_balance/stock_balance.js
+++ b/erpnext/stock/report/stock_balance/stock_balance.js
@@ -4,6 +4,14 @@
 frappe.query_reports["Stock Balance"] = {
 	"filters": [
 		{
+			"fieldname": "company",
+			"label": __("Company"),
+			"fieldtype": "Link",
+			"width": "80",
+			"options": "Company",
+			"default": frappe.defaults.get_default("company")
+		},
+		{
 			"fieldname":"from_date",
 			"label": __("From Date"),
 			"fieldtype": "Date",
@@ -27,12 +35,6 @@
 			"options": "Item Group"
 		},
 		{
-			"fieldname":"brand",
-			"label": __("Brand"),
-			"fieldtype": "Link",
-			"options": "Brand"
-		},
-		{
 			"fieldname": "item_code",
 			"label": __("Item"),
 			"fieldtype": "Link",
@@ -84,5 +86,18 @@
 			"label": __('Show Stock Ageing Data'),
 			"fieldtype": 'Check'
 		},
-	]
+	],
+
+	"formatter": function (value, row, column, data, default_formatter) {
+		value = default_formatter(value, row, column, data);
+
+		if (column.fieldname == "out_qty" && data && data.out_qty > 0) {
+			value = "<span style='color:red'>" + value + "</span>";
+		}
+		else if (column.fieldname == "in_qty" && data && data.in_qty > 0) {
+			value = "<span style='color:green'>" + value + "</span>";
+		}
+
+		return value;
+	}
 };
diff --git a/erpnext/stock/report/stock_balance/stock_balance.json b/erpnext/stock/report/stock_balance/stock_balance.json
index 2f20b20..8c45f0c 100644
--- a/erpnext/stock/report/stock_balance/stock_balance.json
+++ b/erpnext/stock/report/stock_balance/stock_balance.json
@@ -1,24 +1,26 @@
 {
- "add_total_row": 1, 
- "creation": "2014-10-10 17:58:11.577901", 
- "disabled": 0, 
- "docstatus": 0, 
- "doctype": "Report", 
- "idx": 2, 
- "is_standard": "Yes", 
- "modified": "2018-08-14 15:24:41.395557", 
- "modified_by": "Administrator", 
- "module": "Stock", 
- "name": "Stock Balance", 
- "owner": "Administrator", 
- "prepared_report": 1, 
- "ref_doctype": "Stock Ledger Entry", 
- "report_name": "Stock Balance", 
- "report_type": "Script Report", 
+ "add_total_row": 1,
+ "creation": "2014-10-10 17:58:11.577901",
+ "disable_prepared_report": 0,
+ "disabled": 0,
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 2,
+ "is_standard": "Yes",
+ "modified": "2020-04-30 13:46:14.680354",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Stock Balance",
+ "owner": "Administrator",
+ "prepared_report": 1,
+ "query": "",
+ "ref_doctype": "Stock Ledger Entry",
+ "report_name": "Stock Balance",
+ "report_type": "Script Report",
  "roles": [
   {
    "role": "Stock User"
-  }, 
+  },
   {
    "role": "Accounts Manager"
   }
diff --git a/erpnext/stock/report/stock_balance/stock_balance.py b/erpnext/stock/report/stock_balance/stock_balance.py
index ab87ee1..74a4f6e 100644
--- a/erpnext/stock/report/stock_balance/stock_balance.py
+++ b/erpnext/stock/report/stock_balance/stock_balance.py
@@ -94,8 +94,6 @@
 		{"label": _("Item"), "fieldname": "item_code", "fieldtype": "Link", "options": "Item", "width": 100},
 		{"label": _("Item Name"), "fieldname": "item_name", "width": 150},
 		{"label": _("Item Group"), "fieldname": "item_group", "fieldtype": "Link", "options": "Item Group", "width": 100},
-		{"label": _("Brand"), "fieldname": "brand", "fieldtype": "Link", "options": "Brand", "width": 90},
-		{"label": _("Description"), "fieldname": "description", "width": 140},
 		{"label": _("Warehouse"), "fieldname": "warehouse", "fieldtype": "Link", "options": "Warehouse", "width": 100},
 		{"label": _("Stock UOM"), "fieldname": "stock_uom", "fieldtype": "Link", "options": "UOM", "width": 90},
 		{"label": _("Balance Qty"), "fieldname": "bal_qty", "fieldtype": "Float", "width": 100, "convertible": "qty"},
@@ -132,6 +130,9 @@
 	else:
 		frappe.throw(_("'To Date' is required"))
 
+	if filters.get("company"):
+		conditions += " and sle.company = %s" % frappe.db.escape(filters.get("company"))
+
 	if filters.get("warehouse"):
 		warehouse_details = frappe.db.get_value("Warehouse",
 			filters.get("warehouse"), ["lft", "rgt"], as_dict=1)
@@ -233,8 +234,6 @@
 	if filters.get("item_code"):
 		conditions.append("item.name=%(item_code)s")
 	else:
-		if filters.get("brand"):
-			conditions.append("item.brand=%(brand)s")
 		if filters.get("item_group"):
 			conditions.append(get_item_group_condition(filters.get("item_group")))