Translation issue fixed in analytics/grid report
This commit is contained in:
parent
abb62c76d8
commit
b15764ef2c
@ -17,8 +17,9 @@ frappe.pages['financial-analytics'].onload = function(wrapper) {
|
||||
erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({
|
||||
filters: [
|
||||
{
|
||||
fieldtype:"Select", label: __("PL or BS"),
|
||||
options:["Profit and Loss", "Balance Sheet"],
|
||||
fieldtype:"Select", label: __("PL or BS"), fieldname: "pl_or_bs",
|
||||
options:[{"label": __("Profit and Loss"), "value": "Profit and Loss"},
|
||||
{"label": __("Balance Sheet"), "value": "Balance Sheet"}],
|
||||
filter: function(val, item, opts, me) {
|
||||
if(item._show) return true;
|
||||
|
||||
@ -31,19 +32,21 @@ erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({
|
||||
}
|
||||
},
|
||||
{
|
||||
fieldtype:"Select", label: __("Company"),
|
||||
link:"Company", default_value: "Select Company...",
|
||||
fieldtype:"Select", label: __("Company"), fieldname: "company",
|
||||
link:"Company", default_value: __("Select Company..."),
|
||||
filter: function(val, item, opts) {
|
||||
return item.company == val || val == opts.default_value || item._show;
|
||||
}
|
||||
},
|
||||
{fieldtype:"Select", label: __("Fiscal Year"), link:"Fiscal Year",
|
||||
default_value: "Select Fiscal Year..."},
|
||||
{fieldtype:"Date", label: __("From Date")},
|
||||
{fieldtype:"Select", label: __("Fiscal Year"), link:"Fiscal Year", fieldname: "fiscal_year",
|
||||
default_value: __("Select Fiscal Year...")},
|
||||
{fieldtype:"Date", label: __("From Date"), fieldname: "from_date"},
|
||||
{fieldtype:"Label", label: __("To")},
|
||||
{fieldtype:"Date", label: __("To Date")},
|
||||
{fieldtype:"Select", label: __("Range"),
|
||||
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
|
||||
{fieldtype:"Date", label: __("To Date"), fieldname: "to_date"},
|
||||
{fieldtype:"Select", label: __("Range"), fieldname: "range",
|
||||
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: __("Reset Filters"), icon: "icon-filter"}
|
||||
],
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
frappe.require("assets/erpnext/js/account_tree_grid.js");
|
||||
|
||||
frappe.pages['trial-balance'].onload = function(wrapper) {
|
||||
frappe.pages['trial-balance'].onload = function(wrapper) {
|
||||
frappe.ui.make_app_page({
|
||||
parent: wrapper,
|
||||
title: __('Trial Balance'),
|
||||
@ -13,26 +13,26 @@ frappe.pages['trial-balance'].onload = function(wrapper) {
|
||||
init: function(wrapper, title) {
|
||||
var me = this;
|
||||
this._super(wrapper, title);
|
||||
|
||||
|
||||
// period closing entry checkbox
|
||||
this.wrapper.bind("make", function() {
|
||||
$('<div style="margin: 10px 0px; "\
|
||||
class="with_period_closing_entry"><input type="checkbox" checked="checked">' +
|
||||
class="with_period_closing_entry"><input type="checkbox" checked="checked">' +
|
||||
__("With period closing entry") + '</div>')
|
||||
.appendTo(me.wrapper)
|
||||
.find("input").click(function() { me.refresh(); });
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
prepare_balances: function() {
|
||||
// store value of with closing entry
|
||||
this.with_period_closing_entry = this.wrapper
|
||||
.find(".with_period_closing_entry input:checked").length;
|
||||
this._super();
|
||||
},
|
||||
|
||||
|
||||
update_balances: function(account, posting_date, v) {
|
||||
// for period closing voucher,
|
||||
// for period closing voucher,
|
||||
// only consider them when adding "With Closing Entry is checked"
|
||||
if(v.voucher_type === "Period Closing Voucher") {
|
||||
if(this.with_period_closing_entry) {
|
||||
@ -44,8 +44,8 @@ frappe.pages['trial-balance'].onload = function(wrapper) {
|
||||
},
|
||||
})
|
||||
erpnext.trial_balance = new TrialBalance(wrapper, 'Trial Balance');
|
||||
|
||||
|
||||
|
||||
wrapper.appframe.add_module_icon("Accounts")
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -86,21 +86,24 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({
|
||||
this.columns = std_columns.concat(this.columns);
|
||||
},
|
||||
filters: [
|
||||
{fieldtype:"Select", label: __("Tree Type"), options:["Supplier Type", "Supplier",
|
||||
"Item Group", "Item"],
|
||||
{fieldtype:"Select", label: __("Tree Type"), fieldname: "tree_type",
|
||||
options:["Supplier Type", "Supplier", "Item Group", "Item"],
|
||||
filter: function(val, item, opts, me) {
|
||||
return me.apply_zero_filter(val, item, opts, me);
|
||||
}},
|
||||
{fieldtype:"Select", label: __("Based On"), options:["Purchase Invoice",
|
||||
"Purchase Order", "Purchase Receipt"]},
|
||||
{fieldtype:"Select", label: __("Value or Qty"), options:["Value", "Quantity"]},
|
||||
{fieldtype:"Select", label: __("Company"), link:"Company",
|
||||
default_value: "Select Company..."},
|
||||
{fieldtype:"Date", label: __("From Date")},
|
||||
{fieldtype:"Select", label: __("Based On"), fieldname: "based_on",
|
||||
options:["Purchase Invoice", "Purchase Order", "Purchase Receipt"]},
|
||||
{fieldtype:"Select", label: __("Value or Qty"), fieldname: "value_or_qty",
|
||||
options:["Value", "Quantity"]},
|
||||
{fieldtype:"Select", label: __("Company"), link:"Company", fieldname: "company",
|
||||
default_value: __("Select Company...")},
|
||||
{fieldtype:"Date", label: __("From Date"), fieldname: "from_date"},
|
||||
{fieldtype:"Label", label: __("To")},
|
||||
{fieldtype:"Date", label: __("To Date")},
|
||||
{fieldtype:"Select", label: __("Range"),
|
||||
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
|
||||
{fieldtype:"Date", label: __("To Date"), fieldname: "to_date"},
|
||||
{fieldtype:"Select", label: __("Range"), fieldname: "range",
|
||||
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: __("Reset Filters"), icon: "icon-filter"}
|
||||
],
|
||||
@ -126,7 +129,7 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({
|
||||
// Set parent supplier type for tree view
|
||||
|
||||
$.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"] = [{
|
||||
@ -136,7 +139,7 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({
|
||||
|
||||
frappe.report_dump.data["Supplier"].push({
|
||||
name: __("Not Set"),
|
||||
parent_supplier_type: "All Supplier Types",
|
||||
parent_supplier_type: __("All Supplier Types"),
|
||||
id: "Not Set",
|
||||
});
|
||||
|
||||
@ -219,7 +222,7 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({
|
||||
$.each(this.data, function(i, item) {
|
||||
var parent = me.parent_map[item.name];
|
||||
while(parent) {
|
||||
parent_group = me.item_by_name[parent];
|
||||
var parent_group = me.item_by_name[parent];
|
||||
|
||||
$.each(me.columns, function(c, col) {
|
||||
if (col.formatter == me.currency_formatter) {
|
||||
|
@ -55,18 +55,19 @@ erpnext.AccountTreeGrid = frappe.views.TreeGridReport.extend({
|
||||
|
||||
},
|
||||
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) {
|
||||
if (item.company == val || val == opts.default_value) {
|
||||
return me.apply_zero_filter(val, item, opts, me);
|
||||
}
|
||||
return false;
|
||||
}},
|
||||
{fieldtype: "Select", label: __("Fiscal Year"), link:"Fiscal Year",
|
||||
default_value: "Select Fiscal Year..."},
|
||||
{fieldtype: "Date", label: __("From Date")},
|
||||
{fieldtype: "Select", label: "Fiscal Year", link:"Fiscal Year", fieldname: "fiscal_year",
|
||||
default_value: __("Select Fiscal Year...")},
|
||||
{fieldtype: "Date", label: __("From Date"), fieldname: "from_date"},
|
||||
{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",
|
||||
cssClass:"btn-info"},
|
||||
{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.set_route();
|
||||
me.refresh();
|
||||
});
|
||||
me.show_zero_check()
|
||||
if(me.ignore_closing_entry) me.ignore_closing_entry();
|
||||
|
@ -10,11 +10,11 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
|
||||
page: wrapper,
|
||||
parent: $(wrapper).find('.layout-main'),
|
||||
appframe: wrapper.appframe,
|
||||
doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand",
|
||||
doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand",
|
||||
"Fiscal Year", "Serial No"],
|
||||
tree_grid: {
|
||||
show: true,
|
||||
parent_field: "parent_item_group",
|
||||
show: true,
|
||||
parent_field: "parent_item_group",
|
||||
formatter: function(item) {
|
||||
if(!item.is_group) {
|
||||
return repl("<a \
|
||||
@ -25,13 +25,13 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
|
||||
} else {
|
||||
return item.name;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
if(opts) $.extend(args, opts);
|
||||
|
||||
|
||||
this._super(args);
|
||||
},
|
||||
setup_columns: function() {
|
||||
@ -50,20 +50,21 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
|
||||
this.columns = std_columns.concat(this.columns);
|
||||
},
|
||||
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) {
|
||||
return me.apply_zero_filter(val, item, opts, me);
|
||||
}},
|
||||
{fieldtype:"Select", label: __("Brand"), link:"Brand",
|
||||
default_value: "Select Brand...", filter: function(val, item, opts) {
|
||||
{fieldtype:"Select", label: __("Brand"), link:"Brand", fieldname: "brand",
|
||||
default_value: __("Select Brand..."), filter: function(val, item, opts) {
|
||||
return val == opts.default_value || item.brand == val || item._show;
|
||||
}, link_formatter: {filter_input: "brand"}},
|
||||
{fieldtype:"Select", label: __("Warehouse"), link:"Warehouse",
|
||||
default_value: "Select Warehouse..."},
|
||||
{fieldtype:"Date", label: __("From Date")},
|
||||
{fieldtype:"Select", label: __("Warehouse"), link:"Warehouse", fieldname: "warehouse",
|
||||
default_value: __("Select Warehouse...")},
|
||||
{fieldtype:"Date", label: __("From Date"), fieldname: "from_date"},
|
||||
{fieldtype:"Label", label: __("To")},
|
||||
{fieldtype:"Date", label: __("To Date")},
|
||||
{fieldtype:"Select", label: __("Range"),
|
||||
{fieldtype:"Date", label: __("To Date"), fieldname: "to_date"},
|
||||
{fieldtype:"Select", label: __("Range"), fieldname: "range",
|
||||
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
|
||||
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
|
||||
{fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
|
||||
@ -71,7 +72,7 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
|
||||
setup_filters: function() {
|
||||
var me = this;
|
||||
this._super();
|
||||
|
||||
|
||||
this.trigger_refresh_on_change(["value_or_qty", "brand", "warehouse", "range"]);
|
||||
|
||||
this.show_zero_check();
|
||||
@ -83,7 +84,7 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
|
||||
},
|
||||
prepare_data: function() {
|
||||
var me = this;
|
||||
|
||||
|
||||
if(!this.data) {
|
||||
var items = this.prepare_tree("Item", "Item Group");
|
||||
|
||||
@ -109,10 +110,10 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
|
||||
me.reset_item_values(d);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
this.prepare_balances();
|
||||
this.update_groups();
|
||||
|
||||
|
||||
},
|
||||
prepare_balances: function() {
|
||||
var me = this;
|
||||
@ -127,16 +128,16 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
|
||||
var sl = data[i];
|
||||
sl.posting_datetime = sl.posting_date + " " + sl.posting_time;
|
||||
var posting_datetime = dateutil.str_to_obj(sl.posting_datetime);
|
||||
|
||||
|
||||
if(me.is_default("warehouse") ? true : me.warehouse == sl.warehouse) {
|
||||
var item = me.item_by_name[sl.item_code];
|
||||
|
||||
|
||||
if(me.value_or_qty!="Quantity") {
|
||||
var wh = me.get_item_warehouse(sl.warehouse, sl.item_code);
|
||||
var valuation_method = item.valuation_method ?
|
||||
var valuation_method = item.valuation_method ?
|
||||
item.valuation_method : sys_defaults.valuation_method;
|
||||
var is_fifo = valuation_method == "FIFO";
|
||||
|
||||
|
||||
var diff = me.get_value_diff(wh, sl, is_fifo);
|
||||
} else {
|
||||
var diff = sl.qty;
|
||||
@ -165,13 +166,13 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
|
||||
balance = item[col.field];
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var parent = me.parent_map[item.name];
|
||||
while(parent) {
|
||||
parent_group = me.item_by_name[parent];
|
||||
$.each(me.columns, function(c, col) {
|
||||
if (col.formatter == me.currency_formatter) {
|
||||
parent_group[col.field] =
|
||||
parent_group[col.field] =
|
||||
flt(parent_group[col.field])
|
||||
+ flt(item[col.field]);
|
||||
}
|
||||
@ -192,4 +193,4 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
|
||||
};
|
||||
frappe.set_route("query-report", "Stock Ledger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -95,14 +95,17 @@ erpnext.SalesAnalytics = frappe.views.TreeGridReport.extend({
|
||||
}},
|
||||
{fieldtype:"Select", fieldname: "based_on", label: __("Based On"), options:["Sales Invoice",
|
||||
"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",
|
||||
default_value: "Select Company..."},
|
||||
default_value: __("Select Company...")},
|
||||
{fieldtype:"Date", fieldname: "from_date", label: __("From Date")},
|
||||
{fieldtype:"Label", fieldname: "to", label: __("To")},
|
||||
{fieldtype:"Date", fieldname: "to_date", label: __("To Date")},
|
||||
{fieldtype:"Select", fieldname: "range", label: __("Range"),
|
||||
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
|
||||
{fieldtype:"Select", label: __("Range"), fieldname: "range",
|
||||
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: "reset_filters", label: __("Reset Filters"), icon:"icon-filter"}
|
||||
],
|
||||
|
@ -57,21 +57,21 @@ erpnext.StockBalance = erpnext.StockAnalytics.extend({
|
||||
},
|
||||
|
||||
filters: [
|
||||
{fieldtype:"Select", label: __("Brand"), link:"Brand",
|
||||
default_value: "Select Brand...", filter: function(val, item, opts) {
|
||||
{fieldtype:"Select", label: __("Brand"), link:"Brand", fieldname: "brand",
|
||||
default_value: __("Select Brand..."), filter: function(val, item, opts) {
|
||||
return val == opts.default_value || item.brand == val || item._show;
|
||||
}, link_formatter: {filter_input: "brand"}},
|
||||
{fieldtype:"Select", label: __("Warehouse"), link:"Warehouse",
|
||||
default_value: "Select Warehouse...", filter: function(val, item, opts, me) {
|
||||
{fieldtype:"Select", label: __("Warehouse"), link:"Warehouse", fieldname: "warehouse",
|
||||
default_value: __("Select Warehouse..."), filter: function(val, item, opts, me) {
|
||||
return me.apply_zero_filter(val, item, opts, me);
|
||||
}},
|
||||
{fieldtype:"Select", label: __("Project"), link:"Project",
|
||||
default_value: "Select Project...", filter: function(val, item, opts, me) {
|
||||
{fieldtype:"Select", label: __("Project"), link:"Project", fieldname: "project",
|
||||
default_value: __("Select Project..."), filter: function(val, item, opts, me) {
|
||||
return me.apply_zero_filter(val, item, opts, me);
|
||||
}, link_formatter: {filter_input: "project"}},
|
||||
{fieldtype:"Date", label: __("From Date")},
|
||||
{fieldtype:"Date", label: __("From Date"), fieldname: "from_date"},
|
||||
{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: __("Reset Filters"), icon: "icon-filter"}
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user