Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
4f20f693c4
@ -109,11 +109,11 @@ erpnext.AccountsChart = Class.extend({
|
|||||||
|
|
||||||
},
|
},
|
||||||
onrender: function(treenode) {
|
onrender: function(treenode) {
|
||||||
if (ctype == 'Account') {
|
if (ctype == 'Account' && treenode.data) {
|
||||||
var bal = treenode.data && treenode.data.balance.split(' ') || ['',''];
|
if(treenode.data.balance) {
|
||||||
if (bal && flt(bal[1])) {
|
|
||||||
treenode.parent.append('<span class="balance-area">'
|
treenode.parent.append('<span class="balance-area">'
|
||||||
+ format_currency(bal[1], bal[0]) + '</span>');
|
+ format_currency(treenode.data.balance, treenode.data.currency)
|
||||||
|
+ '</span>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
import webnotes.defaults
|
import webnotes.defaults
|
||||||
|
from webnotes.utils import flt
|
||||||
from accounts.utils import get_balance_on
|
from accounts.utils import get_balance_on
|
||||||
|
|
||||||
@webnotes.whitelist()
|
@webnotes.whitelist()
|
||||||
@ -53,6 +53,7 @@ def get_children():
|
|||||||
currency = webnotes.conn.sql("select default_currency from `tabCompany` where name = %s", company)[0][0]
|
currency = webnotes.conn.sql("select default_currency from `tabCompany` where name = %s", company)[0][0]
|
||||||
for each in acc:
|
for each in acc:
|
||||||
bal = get_balance_on(each.get("value"))
|
bal = get_balance_on(each.get("value"))
|
||||||
each['balance'] = currency + ' ' + str(bal or 0)
|
each["currency"] = currency
|
||||||
|
each["balance"] = flt(bal)
|
||||||
|
|
||||||
return acc
|
return acc
|
||||||
|
Loading…
Reference in New Issue
Block a user