mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 20:29:09 +00:00
Balance in chart of accounts in both company and account currency
This commit is contained in:
@@ -166,7 +166,10 @@ erpnext.AccountsChart = Class.extend({
|
|||||||
var dr_or_cr = node.data.balance < 0 ? "Cr" : "Dr";
|
var dr_or_cr = node.data.balance < 0 ? "Cr" : "Dr";
|
||||||
if (me.ctype == 'Account' && node.data && node.data.balance!==undefined) {
|
if (me.ctype == 'Account' && node.data && node.data.balance!==undefined) {
|
||||||
$('<span class="balance-area pull-right text-muted small">'
|
$('<span class="balance-area pull-right text-muted small">'
|
||||||
+ format_currency(Math.abs(node.data.balance), node.data.account_currency)
|
+ (node.data.balance_in_account_currency ?
|
||||||
|
(format_currency(Math.abs(node.data.balance_in_account_currency),
|
||||||
|
node.data.account_currency) + " / ") : "")
|
||||||
|
+ format_currency(Math.abs(node.data.balance), node.data.company_currency)
|
||||||
+ " " + dr_or_cr
|
+ " " + dr_or_cr
|
||||||
+ '</span>').insertBefore(node.$ul);
|
+ '</span>').insertBefore(node.$ul);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,12 @@ def get_children():
|
|||||||
args['parent'], as_dict=1)
|
args['parent'], as_dict=1)
|
||||||
|
|
||||||
if ctype == 'Account':
|
if ctype == 'Account':
|
||||||
|
company_currency = frappe.db.get_value("Company", company, "default_currency")
|
||||||
for each in acc:
|
for each in acc:
|
||||||
each["balance"] = flt(get_balance_on(each.get("value")))
|
each["company_currency"] = company_currency
|
||||||
|
each["balance"] = flt(get_balance_on(each.get("value"), in_account_currency=False))
|
||||||
|
|
||||||
|
if each.account_currency != company_currency:
|
||||||
|
each["balance_in_account_currency"] = flt(get_balance_on(each.get("value")))
|
||||||
|
|
||||||
return acc
|
return acc
|
||||||
|
|||||||
Reference in New Issue
Block a user