show Net Profit only when company is selected

This commit is contained in:
Anand Doshi 2012-11-28 17:12:30 +05:30
parent 01bf10b8b6
commit 47514097be

View File

@ -142,6 +142,7 @@ erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({
this.update_groups(); this.update_groups();
this.accounts_initialized = true; this.accounts_initialized = true;
if(!me.is_default("company")) {
// show Net Profit / Loss // show Net Profit / Loss
var net_profit = { var net_profit = {
company: me.company, company: me.company,
@ -152,6 +153,7 @@ erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({
checked: false, checked: false,
is_pl_account: me.pl_or_bs=="Balance Sheet" ? "No" : "Yes", is_pl_account: me.pl_or_bs=="Balance Sheet" ? "No" : "Yes",
}; };
me.item_by_name[net_profit.name] = net_profit;
$.each(me.data, function(i, ac) { $.each(me.data, function(i, ac) {
if(!ac.parent_account && me.apply_filter(ac, "company")) { if(!ac.parent_account && me.apply_filter(ac, "company")) {
@ -178,6 +180,7 @@ erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({
}); });
this.data.push(net_profit); this.data.push(net_profit);
}
}, },
add_balance: function(field, account, gl) { add_balance: function(field, account, gl) {
account[field] = flt(account[field]) + account[field] = flt(account[field]) +