Translation issue fixed in analytics/grid report

This commit is contained in:
Nabin Hait 2014-06-03 13:02:18 +05:30
parent abb62c76d8
commit b15764ef2c
7 changed files with 87 additions and 76 deletions

View File

@ -17,8 +17,9 @@ frappe.pages['financial-analytics'].onload = function(wrapper) {
erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({ erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({
filters: [ filters: [
{ {
fieldtype:"Select", label: __("PL or BS"), fieldtype:"Select", label: __("PL or BS"), fieldname: "pl_or_bs",
options:["Profit and Loss", "Balance Sheet"], options:[{"label": __("Profit and Loss"), "value": "Profit and Loss"},
{"label": __("Balance Sheet"), "value": "Balance Sheet"}],
filter: function(val, item, opts, me) { filter: function(val, item, opts, me) {
if(item._show) return true; if(item._show) return true;
@ -31,19 +32,21 @@ erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({
} }
}, },
{ {
fieldtype:"Select", label: __("Company"), fieldtype:"Select", label: __("Company"), fieldname: "company",
link:"Company", default_value: "Select Company...", link:"Company", default_value: __("Select Company..."),
filter: function(val, item, opts) { filter: function(val, item, opts) {
return item.company == val || val == opts.default_value || item._show; return item.company == val || val == opts.default_value || item._show;
} }
}, },
{fieldtype:"Select", label: __("Fiscal Year"), link:"Fiscal Year", {fieldtype:"Select", label: __("Fiscal Year"), link:"Fiscal Year", fieldname: "fiscal_year",
default_value: "Select Fiscal Year..."}, default_value: __("Select Fiscal Year...")},
{fieldtype:"Date", label: __("From Date")}, {fieldtype:"Date", label: __("From Date"), fieldname: "from_date"},
{fieldtype:"Label", label: __("To")}, {fieldtype:"Label", label: __("To")},
{fieldtype:"Date", label: __("To Date")}, {fieldtype:"Date", label: __("To Date"), fieldname: "to_date"},
{fieldtype:"Select", label: __("Range"), {fieldtype:"Select", label: __("Range"), fieldname: "range",
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]}, options:[{label: __("Daily"), value: "Daily"}, {label: __("Weekly"), value: "Weekly"},
{label: __("Monthly"), value: "Monthly"}, {label: __("Quarterly"), value: "Quarterly"},
{label: __("Yearly"), value: "Yearly"}]},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"}, {fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
{fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"} {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
], ],

View File

@ -86,21 +86,24 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({
this.columns = std_columns.concat(this.columns); this.columns = std_columns.concat(this.columns);
}, },
filters: [ filters: [
{fieldtype:"Select", label: __("Tree Type"), options:["Supplier Type", "Supplier", {fieldtype:"Select", label: __("Tree Type"), fieldname: "tree_type",
"Item Group", "Item"], options:["Supplier Type", "Supplier", "Item Group", "Item"],
filter: function(val, item, opts, me) { filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me); return me.apply_zero_filter(val, item, opts, me);
}}, }},
{fieldtype:"Select", label: __("Based On"), options:["Purchase Invoice", {fieldtype:"Select", label: __("Based On"), fieldname: "based_on",
"Purchase Order", "Purchase Receipt"]}, options:["Purchase Invoice", "Purchase Order", "Purchase Receipt"]},
{fieldtype:"Select", label: __("Value or Qty"), options:["Value", "Quantity"]}, {fieldtype:"Select", label: __("Value or Qty"), fieldname: "value_or_qty",
{fieldtype:"Select", label: __("Company"), link:"Company", options:["Value", "Quantity"]},
default_value: "Select Company..."}, {fieldtype:"Select", label: __("Company"), link:"Company", fieldname: "company",
{fieldtype:"Date", label: __("From Date")}, default_value: __("Select Company...")},
{fieldtype:"Date", label: __("From Date"), fieldname: "from_date"},
{fieldtype:"Label", label: __("To")}, {fieldtype:"Label", label: __("To")},
{fieldtype:"Date", label: __("To Date")}, {fieldtype:"Date", label: __("To Date"), fieldname: "to_date"},
{fieldtype:"Select", label: __("Range"), {fieldtype:"Select", label: __("Range"), fieldname: "range",
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]}, options:[{label: __("Daily"), value: "Daily"}, {label: __("Weekly"), value: "Weekly"},
{label: __("Monthly"), value: "Monthly"}, {label: __("Quarterly"), value: "Quarterly"},
{label: __("Yearly"), value: "Yearly"}]},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"}, {fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
{fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"} {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
], ],
@ -126,7 +129,7 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({
// Set parent supplier type for tree view // Set parent supplier type for tree view
$.each(frappe.report_dump.data["Supplier Type"], function(i, v) { $.each(frappe.report_dump.data["Supplier Type"], function(i, v) {
v['parent_supplier_type'] = "All Supplier Types" v['parent_supplier_type'] = __("All Supplier Types")
}) })
frappe.report_dump.data["Supplier Type"] = [{ frappe.report_dump.data["Supplier Type"] = [{
@ -136,7 +139,7 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({
frappe.report_dump.data["Supplier"].push({ frappe.report_dump.data["Supplier"].push({
name: __("Not Set"), name: __("Not Set"),
parent_supplier_type: "All Supplier Types", parent_supplier_type: __("All Supplier Types"),
id: "Not Set", id: "Not Set",
}); });
@ -219,7 +222,7 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({
$.each(this.data, function(i, item) { $.each(this.data, function(i, item) {
var parent = me.parent_map[item.name]; var parent = me.parent_map[item.name];
while(parent) { while(parent) {
parent_group = me.item_by_name[parent]; var parent_group = me.item_by_name[parent];
$.each(me.columns, function(c, col) { $.each(me.columns, function(c, col) {
if (col.formatter == me.currency_formatter) { if (col.formatter == me.currency_formatter) {

View File

@ -55,18 +55,19 @@ erpnext.AccountTreeGrid = frappe.views.TreeGridReport.extend({
}, },
filters: [ filters: [
{fieldtype: "Select", label: __("Company"), link:"Company", default_value: "Select Company...", {fieldtype: "Select", label: __("Company"), link:"Company", fieldname: "company",
default_value: __("Select Company..."),
filter: function(val, item, opts, me) { filter: function(val, item, opts, me) {
if (item.company == val || val == opts.default_value) { if (item.company == val || val == opts.default_value) {
return me.apply_zero_filter(val, item, opts, me); return me.apply_zero_filter(val, item, opts, me);
} }
return false; return false;
}}, }},
{fieldtype: "Select", label: __("Fiscal Year"), link:"Fiscal Year", {fieldtype: "Select", label: "Fiscal Year", link:"Fiscal Year", fieldname: "fiscal_year",
default_value: "Select Fiscal Year..."}, default_value: __("Select Fiscal Year...")},
{fieldtype: "Date", label: __("From Date")}, {fieldtype: "Date", label: __("From Date"), fieldname: "from_date"},
{fieldtype: "Label", label: __("To")}, {fieldtype: "Label", label: __("To")},
{fieldtype: "Date", label: __("To Date")}, {fieldtype: "Date", label: __("To Date"), fieldname: "to_date"},
{fieldtype: "Button", label: __("Refresh"), icon:"icon-refresh icon-white", {fieldtype: "Button", label: __("Refresh"), icon:"icon-refresh icon-white",
cssClass:"btn-info"}, cssClass:"btn-info"},
{fieldtype: "Button", label: __("Reset Filters"), icon: "icon-filter"}, {fieldtype: "Button", label: __("Reset Filters"), icon: "icon-filter"},
@ -83,7 +84,7 @@ erpnext.AccountTreeGrid = frappe.views.TreeGridReport.extend({
me.filter_inputs.to_date.val(dateutil.str_to_user(v.year_end_date)); me.filter_inputs.to_date.val(dateutil.str_to_user(v.year_end_date));
} }
}); });
me.set_route(); me.refresh();
}); });
me.show_zero_check() me.show_zero_check()
if(me.ignore_closing_entry) me.ignore_closing_entry(); if(me.ignore_closing_entry) me.ignore_closing_entry();

View File

@ -50,20 +50,21 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
this.columns = std_columns.concat(this.columns); this.columns = std_columns.concat(this.columns);
}, },
filters: [ filters: [
{fieldtype:"Select", label: __("Value or Qty"), options:["Value", "Quantity"], {fieldtype:"Select", label: __("Value or Qty"), fieldname: "value_or_qty",
options:["Value", "Quantity"],
filter: function(val, item, opts, me) { filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me); return me.apply_zero_filter(val, item, opts, me);
}}, }},
{fieldtype:"Select", label: __("Brand"), link:"Brand", {fieldtype:"Select", label: __("Brand"), link:"Brand", fieldname: "brand",
default_value: "Select Brand...", filter: function(val, item, opts) { default_value: __("Select Brand..."), filter: function(val, item, opts) {
return val == opts.default_value || item.brand == val || item._show; return val == opts.default_value || item.brand == val || item._show;
}, link_formatter: {filter_input: "brand"}}, }, link_formatter: {filter_input: "brand"}},
{fieldtype:"Select", label: __("Warehouse"), link:"Warehouse", {fieldtype:"Select", label: __("Warehouse"), link:"Warehouse", fieldname: "warehouse",
default_value: "Select Warehouse..."}, default_value: __("Select Warehouse...")},
{fieldtype:"Date", label: __("From Date")}, {fieldtype:"Date", label: __("From Date"), fieldname: "from_date"},
{fieldtype:"Label", label: __("To")}, {fieldtype:"Label", label: __("To")},
{fieldtype:"Date", label: __("To Date")}, {fieldtype:"Date", label: __("To Date"), fieldname: "to_date"},
{fieldtype:"Select", label: __("Range"), {fieldtype:"Select", label: __("Range"), fieldname: "range",
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]}, options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"}, {fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
{fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"} {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}

View File

@ -95,14 +95,17 @@ erpnext.SalesAnalytics = frappe.views.TreeGridReport.extend({
}}, }},
{fieldtype:"Select", fieldname: "based_on", label: __("Based On"), options:["Sales Invoice", {fieldtype:"Select", fieldname: "based_on", label: __("Based On"), options:["Sales Invoice",
"Sales Order", "Delivery Note"]}, "Sales Order", "Delivery Note"]},
{fieldtype:"Select", fieldname: "value_or_qty", label: __("Value or Qty"), options:["Value", "Quantity"]}, {fieldtype:"Select", fieldname: "value_or_qty", label: __("Value or Qty"),
options:[{label: __("Value"), value: "Value"}, {label: __("Quantity"), value: "Quantity"}]},
{fieldtype:"Select", fieldname: "company", label: __("Company"), link:"Company", {fieldtype:"Select", fieldname: "company", label: __("Company"), link:"Company",
default_value: "Select Company..."}, default_value: __("Select Company...")},
{fieldtype:"Date", fieldname: "from_date", label: __("From Date")}, {fieldtype:"Date", fieldname: "from_date", label: __("From Date")},
{fieldtype:"Label", fieldname: "to", label: __("To")}, {fieldtype:"Label", fieldname: "to", label: __("To")},
{fieldtype:"Date", fieldname: "to_date", label: __("To Date")}, {fieldtype:"Date", fieldname: "to_date", label: __("To Date")},
{fieldtype:"Select", fieldname: "range", label: __("Range"), {fieldtype:"Select", label: __("Range"), fieldname: "range",
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]}, options:[{label: __("Daily"), value: "Daily"}, {label: __("Weekly"), value: "Weekly"},
{label: __("Monthly"), value: "Monthly"}, {label: __("Quarterly"), value: "Quarterly"},
{label: __("Yearly"), value: "Yearly"}]},
{fieldtype:"Button", fieldname: "refresh", label: __("Refresh"), icon:"icon-refresh"}, {fieldtype:"Button", fieldname: "refresh", label: __("Refresh"), icon:"icon-refresh"},
{fieldtype:"Button", fieldname: "reset_filters", label: __("Reset Filters"), icon:"icon-filter"} {fieldtype:"Button", fieldname: "reset_filters", label: __("Reset Filters"), icon:"icon-filter"}
], ],

View File

@ -57,21 +57,21 @@ erpnext.StockBalance = erpnext.StockAnalytics.extend({
}, },
filters: [ filters: [
{fieldtype:"Select", label: __("Brand"), link:"Brand", {fieldtype:"Select", label: __("Brand"), link:"Brand", fieldname: "brand",
default_value: "Select Brand...", filter: function(val, item, opts) { default_value: __("Select Brand..."), filter: function(val, item, opts) {
return val == opts.default_value || item.brand == val || item._show; return val == opts.default_value || item.brand == val || item._show;
}, link_formatter: {filter_input: "brand"}}, }, link_formatter: {filter_input: "brand"}},
{fieldtype:"Select", label: __("Warehouse"), link:"Warehouse", {fieldtype:"Select", label: __("Warehouse"), link:"Warehouse", fieldname: "warehouse",
default_value: "Select Warehouse...", filter: function(val, item, opts, me) { default_value: __("Select Warehouse..."), filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me); return me.apply_zero_filter(val, item, opts, me);
}}, }},
{fieldtype:"Select", label: __("Project"), link:"Project", {fieldtype:"Select", label: __("Project"), link:"Project", fieldname: "project",
default_value: "Select Project...", filter: function(val, item, opts, me) { default_value: __("Select Project..."), filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me); return me.apply_zero_filter(val, item, opts, me);
}, link_formatter: {filter_input: "project"}}, }, link_formatter: {filter_input: "project"}},
{fieldtype:"Date", label: __("From Date")}, {fieldtype:"Date", label: __("From Date"), fieldname: "from_date"},
{fieldtype:"Label", label: __("To")}, {fieldtype:"Label", label: __("To")},
{fieldtype:"Date", label: __("To Date")}, {fieldtype:"Date", label: __("To Date"), fieldname: "to_date"},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"}, {fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
{fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"} {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
], ],