Remove unnecessary columns Analytics Reports (#13344)

This commit is contained in:
Faris Ansari 2018-03-22 11:12:02 +05:30 committed by GitHub
parent 4fc74333bd
commit 34dd079a68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 34 deletions

View File

@ -67,10 +67,7 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({
this.tree_grid = this.tree_grids[this.tree_type]; this.tree_grid = this.tree_grids[this.tree_type];
var std_columns = [ var std_columns = [
{id: "_check", name: __("Plot"), field: "_check", width: 30, {id: "name", name: this.tree_grid.label, field: "name", width: 300},
formatter: this.check_formatter},
{id: "name", name: this.tree_grid.label, field: "name", width: 300,
formatter: this.tree_formatter},
{id: "total", name: "Total", field: "total", plot: false, {id: "total", name: "Total", field: "total", plot: false,
formatter: this.currency_formatter} formatter: this.currency_formatter}
]; ];
@ -103,8 +100,7 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({
this.trigger_refresh_on_change(["value_or_qty", "tree_type", "based_on", "company"]); this.trigger_refresh_on_change(["value_or_qty", "tree_type", "based_on", "company"]);
this.show_zero_check() this.show_zero_check();
this.setup_chart_check();
}, },
init_filter_values: function() { init_filter_values: function() {
this._super(); this._super();

View File

@ -42,10 +42,7 @@ erpnext.AppointmentAnalytics = frappe.views.TreeGridReport.extend({
this.tree_grid = this.tree_grids[this.tree_type]; this.tree_grid = this.tree_grids[this.tree_type];
var std_columns = [ var std_columns = [
{id: "_check", name: __("Plot"), field: "_check", width: 40, {id: "name", name: this.tree_grid.label, field: "name", width: 300},
formatter: this.check_formatter},
{id: "name", name: this.tree_grid.label, field: "name", width: 300,
formatter: this.tree_formatter},
{id: "total", name: "Total", field: "total", plot: false, {id: "total", name: "Total", field: "total", plot: false,
formatter: this.currency_formatter} formatter: this.currency_formatter}
]; ];
@ -87,7 +84,6 @@ erpnext.AppointmentAnalytics = frappe.views.TreeGridReport.extend({
this.trigger_refresh_on_change(["tree_type", "physician", "department", "status", "type"]); this.trigger_refresh_on_change(["tree_type", "physician", "department", "status", "type"]);
// this.show_zero_check() // this.show_zero_check()
this.setup_chart_check();
}, },
init_filter_values: function() { init_filter_values: function() {
this._super(); this._super();

View File

@ -26,9 +26,7 @@ erpnext.ProductionAnalytics = frappe.views.GridReportWithPlot.extend({
setup_columns: function() { setup_columns: function() {
var std_columns = [ var std_columns = [
{id: "_check", name: __("Plot"), field: "_check", width: 30, {id: "name", name: __("Status"), field: "name", width: 100}
formatter: this.check_formatter},
{id: "name", name: __("Status"), field: "name", width: 100},
]; ];
this.make_date_range_columns(); this.make_date_range_columns();
@ -51,8 +49,7 @@ erpnext.ProductionAnalytics = frappe.views.GridReportWithPlot.extend({
this.trigger_refresh_on_change(["company"]); this.trigger_refresh_on_change(["company"]);
this.trigger_refresh_on_change(["range"]); this.trigger_refresh_on_change(["range"]);
this.show_zero_check() this.show_zero_check();
this.setup_chart_check();
}, },
init_filter_values: function() { init_filter_values: function() {
@ -64,7 +61,9 @@ erpnext.ProductionAnalytics = frappe.views.GridReportWithPlot.extend({
var chart_data = this.get_chart_data ? this.get_chart_data() : null; var chart_data = this.get_chart_data ? this.get_chart_data() : null;
this.chart = new Chart(".chart", { const parent = this.wrapper.find('.chart')[0];
this.chart = new Chart(parent, {
height: 200,
data: chart_data, data: chart_data,
type: 'line' type: 'line'
}); });

View File

@ -36,8 +36,7 @@ erpnext.AccountTreeGrid = frappe.views.TreeGridReport.extend({
}, },
setup_columns: function() { setup_columns: function() {
this.columns = [ this.columns = [
{id: "name", name: __("Account"), field: "name", width: 300, cssClass: "cell-title", {id: "name", name: __("Account"), field: "name", width: 300, cssClass: "cell-title"},
formatter: this.tree_formatter},
{id: "opening_dr", name: __("Opening (Dr)"), field: "opening_dr", width: 100, {id: "opening_dr", name: __("Opening (Dr)"), field: "opening_dr", width: 100,
formatter: this.currency_formatter}, formatter: this.currency_formatter},
{id: "opening_cr", name: __("Opening (Cr)"), field: "opening_cr", width: 100, {id: "opening_cr", name: __("Opening (Cr)"), field: "opening_cr", width: 100,

View File

@ -34,10 +34,7 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
}, },
setup_columns: function() { setup_columns: function() {
var std_columns = [ var std_columns = [
{id: "_check", name: __("Plot"), field: "_check", width: 30, {id: "name", name: __("Item"), field: "name", width: 300},
formatter: this.check_formatter},
{id: "name", name: __("Item"), field: "name", width: 300,
formatter: this.tree_formatter},
{id: "brand", name: __("Brand"), field: "brand", width: 100}, {id: "brand", name: __("Brand"), field: "brand", width: 100},
{id: "stock_uom", name: __("UOM"), field: "stock_uom", width: 100}, {id: "stock_uom", name: __("UOM"), field: "stock_uom", width: 100},
{id: "opening", name: __("Opening"), field: "opening", hidden: true, {id: "opening", name: __("Opening"), field: "opening", hidden: true,
@ -77,7 +74,6 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
this.trigger_refresh_on_change(["value_or_qty", "brand", "warehouse", "range"]); this.trigger_refresh_on_change(["value_or_qty", "brand", "warehouse", "range"]);
this.show_zero_check(); this.show_zero_check();
this.setup_chart_check();
}, },
init_filter_values: function() { init_filter_values: function() {
this._super(); this._super();

View File

@ -34,7 +34,7 @@ erpnext.SalesAnalytics = frappe.views.TreeGridReport.extend({
item_key: "customer", item_key: "customer",
parent_field: "parent_customer_group", parent_field: "parent_customer_group",
formatter: function(item) { formatter: function(item) {
return item.customer_name? item.customer_name + " (" + item.name + ")" : item.name; return item.customer_name? item.customer_name + " (" + item.name + ")" : item.name;
} }
}, },
"Customer": { "Customer": {
@ -77,10 +77,7 @@ erpnext.SalesAnalytics = frappe.views.TreeGridReport.extend({
this.tree_grid = this.tree_grids[this.tree_type]; this.tree_grid = this.tree_grids[this.tree_type];
var std_columns = [ var std_columns = [
{id: "check", name: "Plot", field: "check", width: 30, {id: "name", name: this.tree_grid.label, field: "name", width: 300},
formatter: this.check_formatter},
{id: "name", name: this.tree_grid.label, field: "name", width: 300,
formatter: this.tree_formatter},
{id: "total", name: "Total", field: "total", plot: false, {id: "total", name: "Total", field: "total", plot: false,
formatter: this.currency_formatter} formatter: this.currency_formatter}
]; ];
@ -114,8 +111,7 @@ erpnext.SalesAnalytics = frappe.views.TreeGridReport.extend({
this.trigger_refresh_on_change(["value_or_qty", "tree_type", "based_on", "company"]); this.trigger_refresh_on_change(["value_or_qty", "tree_type", "based_on", "company"]);
this.show_zero_check() this.show_zero_check();
this.setup_chart_check();
}, },
init_filter_values: function() { init_filter_values: function() {
this._super(); this._super();

View File

@ -33,7 +33,7 @@ erpnext.SupportAnalytics = frappe.views.GridReportWithPlot.extend({
{fieldname: "range", fieldtype:"Select", label: __("Range"), {fieldname: "range", fieldtype:"Select", label: __("Range"),
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"], default_value: "Monthly"} options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"], default_value: "Monthly"}
], ],
init_filter_values: function() { init_filter_values: function() {
this._super(); this._super();
this.filter_inputs.range.val('Monthly'); this.filter_inputs.range.val('Monthly');
@ -41,8 +41,6 @@ erpnext.SupportAnalytics = frappe.views.GridReportWithPlot.extend({
setup_columns: function() { setup_columns: function() {
var std_columns = [ var std_columns = [
{id: "_check", name: __("Plot"), field: "_check", width: 30,
formatter: this.check_formatter},
{id: "name", name: __("Status"), field: "name", width: 100}, {id: "name", name: __("Status"), field: "name", width: 100},
]; ];
this.make_date_range_columns(); this.make_date_range_columns();