Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
375ba8ef0a
@ -76,7 +76,7 @@ erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({
|
|||||||
},
|
},
|
||||||
init_filter_values: function() {
|
init_filter_values: function() {
|
||||||
this._super();
|
this._super();
|
||||||
this.filter_inputs.range.val('Weekly');
|
this.filter_inputs.range.val('Monthly');
|
||||||
},
|
},
|
||||||
prepare_balances: function() {
|
prepare_balances: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
@ -142,42 +142,45 @@ erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({
|
|||||||
this.update_groups();
|
this.update_groups();
|
||||||
this.accounts_initialized = true;
|
this.accounts_initialized = true;
|
||||||
|
|
||||||
// show Net Profit / Loss
|
if(!me.is_default("company")) {
|
||||||
var net_profit = {
|
// show Net Profit / Loss
|
||||||
company: me.company,
|
var net_profit = {
|
||||||
id: "Net Profit / Loss",
|
company: me.company,
|
||||||
name: "Net Profit / Loss",
|
id: "Net Profit / Loss",
|
||||||
indent: 0,
|
name: "Net Profit / Loss",
|
||||||
opening: 0,
|
indent: 0,
|
||||||
checked: false,
|
opening: 0,
|
||||||
is_pl_account: me.pl_or_bs=="Balance Sheet" ? "No" : "Yes",
|
checked: false,
|
||||||
};
|
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")) {
|
||||||
if(me.pl_or_bs == "Balance Sheet") {
|
if(me.pl_or_bs == "Balance Sheet") {
|
||||||
var valid_account = ac.is_pl_account!="Yes";
|
var valid_account = ac.is_pl_account!="Yes";
|
||||||
var do_addition_for = "Debit";
|
var do_addition_for = "Debit";
|
||||||
} else {
|
} else {
|
||||||
var valid_account = ac.is_pl_account=="Yes";
|
var valid_account = ac.is_pl_account=="Yes";
|
||||||
var do_addition_for = "Credit";
|
var do_addition_for = "Credit";
|
||||||
}
|
}
|
||||||
if(valid_account) {
|
if(valid_account) {
|
||||||
$.each(me.columns, function(i, col) {
|
$.each(me.columns, function(i, col) {
|
||||||
if(col.formatter==me.currency_formatter) {
|
if(col.formatter==me.currency_formatter) {
|
||||||
if(!net_profit[col.field]) net_profit[col.field] = 0;
|
if(!net_profit[col.field]) net_profit[col.field] = 0;
|
||||||
if(ac.debit_or_credit==do_addition_for) {
|
if(ac.debit_or_credit==do_addition_for) {
|
||||||
net_profit[col.field] += ac[col.field];
|
net_profit[col.field] += ac[col.field];
|
||||||
} else {
|
} else {
|
||||||
net_profit[col.field] -= ac[col.field];
|
net_profit[col.field] -= ac[col.field];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
|
||||||
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]) +
|
||||||
|
@ -128,7 +128,7 @@ erpnext.PurchaseAnalytics = wn.views.TreeGridReport.extend({
|
|||||||
},
|
},
|
||||||
init_filter_values: function() {
|
init_filter_values: function() {
|
||||||
this._super();
|
this._super();
|
||||||
this.filter_inputs.range.val('Weekly');
|
this.filter_inputs.range.val('Monthly');
|
||||||
},
|
},
|
||||||
prepare_data: function() {
|
prepare_data: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
erpnext.updates = [
|
erpnext.updates = [
|
||||||
["28th November 2012", [
|
["28th November 2012", [
|
||||||
"Profile: Profile Settings (My Settings...) is now the Profile Form.",
|
"Profile: Profile Settings (My Settings...) is now the Profile Form.",
|
||||||
|
"Financial Analytics: Show Net Profit/Loss",
|
||||||
]],
|
]],
|
||||||
["27th November 2012", [
|
["27th November 2012", [
|
||||||
"Communication: Made common communication thread and added it in Lead, Contact.",
|
"Communication: Made common communication thread and added it in Lead, Contact.",
|
||||||
|
@ -92,6 +92,16 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
|||||||
cur_frm.add_custom_button('Unstop', cur_frm.cscript['Unstop Sales Order']);
|
cur_frm.add_custom_button('Unstop', cur_frm.cscript['Unstop Sales Order']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.cscript.order_type(doc);
|
||||||
|
}
|
||||||
|
|
||||||
|
cur_frm.cscript.order_type = function(doc) {
|
||||||
|
if(doc.order_type == "Sales") {
|
||||||
|
cur_frm.toggle_reqd("delivery_date", 1);
|
||||||
|
} else {
|
||||||
|
cur_frm.toggle_reqd("delivery_date", 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//customer
|
//customer
|
||||||
|
@ -136,7 +136,7 @@ erpnext.SalesAnalytics = wn.views.TreeGridReport.extend({
|
|||||||
},
|
},
|
||||||
init_filter_values: function() {
|
init_filter_values: function() {
|
||||||
this._super();
|
this._super();
|
||||||
this.filter_inputs.range.val('Weekly');
|
this.filter_inputs.range.val('Monthly');
|
||||||
},
|
},
|
||||||
prepare_data: function() {
|
prepare_data: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -103,7 +103,7 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
|
|||||||
},
|
},
|
||||||
init_filter_values: function() {
|
init_filter_values: function() {
|
||||||
this._super();
|
this._super();
|
||||||
this.filter_inputs.range.val('Weekly');
|
this.filter_inputs.range.val('Monthly');
|
||||||
},
|
},
|
||||||
prepare_data: function() {
|
prepare_data: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user