Fixed Company Default Currency in Accounts Browser
This commit is contained in:
parent
8d3f4b6fd8
commit
bb24e5ff06
@ -32,9 +32,12 @@ class DocType:
|
||||
# inc = get_value('Account','Income - '+r[1], 'balance')
|
||||
# exp = get_value('Account','Expenses - '+r[1], 'balance')
|
||||
# pl[r[0]] = flt(flt(inc) - flt(exp))
|
||||
|
||||
return {'cl':[r[0] for r in ret]}#, 'pl':pl}
|
||||
|
||||
def get_company_currency(self,arg=''):
|
||||
ret = sql("select default_currency from tabCompany where name=%s and docstatus != 2", arg)
|
||||
return ret[0]
|
||||
|
||||
# Get current balance
|
||||
# --------------------
|
||||
def get_bal(self,arg):
|
||||
|
@ -181,6 +181,11 @@ pscript.set_ac_head = function(parent_account, r,type) {
|
||||
$ds(d.sub_head);
|
||||
$ds(d.balance_area);
|
||||
|
||||
var callback = function(r,rt) {
|
||||
dcc = r.message;
|
||||
}
|
||||
$c_obj('GL Control', 'get_company_currency', pscript.ab_company_sel.value, callback);
|
||||
|
||||
if(r.name!='Root Node') {
|
||||
// Account group/ledger area
|
||||
if(type=='Account'){
|
||||
@ -199,7 +204,13 @@ pscript.set_ac_head = function(parent_account, r,type) {
|
||||
$ds(pscript.acc_add_btn);
|
||||
$dh(pscript.cc_add_btn);
|
||||
}
|
||||
d.balance.innerHTML = (sys_defaults.currency ? sys_defaults.currency :'Rs')+ ' ' + (r.balance ? fmt_money(r.balance) :'0.00');
|
||||
|
||||
var callback = function(r,rt) {
|
||||
dcc = r.message;
|
||||
}
|
||||
$c_obj('GL Control', 'get_company_currency', pscript.ab_company_sel.value, callback);
|
||||
|
||||
d.balance.innerHTML = (dcc ? dcc : sys_defaults.currency)+ ' ' + (r.balance ? fmt_money(r.balance) :'0.00');
|
||||
}
|
||||
//cost center group/ledger area
|
||||
else{
|
||||
|
Loading…
x
Reference in New Issue
Block a user