[fix] Account Currency and Balance fixed in chart of accounts #4019
diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js
index 04e4f63..abd7612 100644
--- a/erpnext/accounts/page/accounts_browser/accounts_browser.js
+++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js
@@ -166,7 +166,7 @@
 				var dr_or_cr = node.data.balance < 0 ? "Cr" : "Dr";
 				if (me.ctype == 'Account' && node.data && node.data.balance!==undefined) {
 					$('<span class="balance-area pull-right text-muted small">'
-						+ format_currency(Math.abs(node.data.balance), node.data.currency)
+						+ format_currency(Math.abs(node.data.balance), node.data.account_currency)
 						+ " " + dr_or_cr
 						+ '</span>').insertBefore(node.$ul);
 				}
diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.py b/erpnext/accounts/page/accounts_browser/accounts_browser.py
index 593794a..80101ce 100644
--- a/erpnext/accounts/page/accounts_browser/accounts_browser.py
+++ b/erpnext/accounts/page/accounts_browser/accounts_browser.py
@@ -21,8 +21,7 @@
 
 	# root
 	if args['parent'] in ("Accounts", "Cost Centers"):
-		select_cond = ", root_type, report_type" if args["parent"]=="Accounts" else ""
-
+		select_cond = ", root_type, report_type, account_currency" if ctype=="Account" else ""
 		acc = frappe.db.sql(""" select
 			name as value, is_group as expandable %s
 			from `tab%s`
@@ -35,19 +34,17 @@
 			sort_root_accounts(acc)
 	else:
 		# other
+		select_cond = ", account_currency" if ctype=="Account" else ""
 		acc = frappe.db.sql("""select
-			name as value, is_group as expandable
+			name as value, is_group as expandable %s
 	 		from `tab%s`
 			where ifnull(parent_%s,'') = %s
 			and docstatus<2
-			order by name""" % (ctype, ctype.lower().replace(' ','_'), '%s'),
+			order by name""" % (select_cond, ctype, ctype.lower().replace(' ','_'), '%s'),
 				args['parent'], as_dict=1)
 
 	if ctype == 'Account':
-		currency = frappe.db.sql("select default_currency from `tabCompany` where name = %s", company)[0][0]
 		for each in acc:
-			bal = get_balance_on(each.get("value"))
-			each["currency"] = currency
-			each["balance"] = flt(bal)
+			each["balance"] = flt(get_balance_on(each.get("value")))
 
 	return acc
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index e1bb9ea..04084ed 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -94,6 +94,11 @@
 				select name from `tabAccount` ac where ac.name = gle.account
 				and ac.lft >= %s and ac.rgt <= %s
 			)""" % (acc.lft, acc.rgt))
+			
+			# If group and currency same as company, 
+			# always return balance based on debit and credit in company currency
+			if acc.account_currency == frappe.db.get_value("Company", acc.company, "default_currency"):
+				in_account_currency = False
 		else:
 			cond.append("""gle.account = "%s" """ % (account.replace('"', '\\"'), ))