Customer/Supplier Name in sales/purchase analytics (#8717)

This commit is contained in:
Nabin Hait 2017-05-06 12:45:37 +05:30 committed by GitHub
parent 6e7407962f
commit 7228e1af6e
2 changed files with 7 additions and 9 deletions

View File

@ -35,11 +35,7 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({
item_key: "supplier",
parent_field: "parent_supplier_type",
formatter: function(item) {
// return repl('<a href="#Report/stock-invoices/customer=%(enc_value)s">%(value)s</a>', {
// value: item.name,
// enc_value: encodeURIComponent(item.name)
// });
return item.name;
return item.supplier_name ? item.supplier_name + " (" + item.name + ")" : item.name;
}
},
"Supplier": {
@ -47,7 +43,7 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({
show: false,
item_key: "supplier",
formatter: function(item) {
return item.name;
return item.supplier_name ? item.supplier_name + " (" + item.name + ")" : item.name;
}
},
"Item Group": {

View File

@ -34,14 +34,16 @@ erpnext.SalesAnalytics = frappe.views.TreeGridReport.extend({
show: true,
item_key: "customer",
parent_field: "parent_customer_group",
formatter: function(item) { return item.customer_name || item.name; }
formatter: function(item) {
return item.customer_name? item.customer_name + " (" + item.name + ")" : item.name;
}
},
"Customer": {
label: __("Customer"),
show: false,
item_key: "customer",
formatter: function(item) {
return item.customer_name || item.name;
return item.customer_name? item.customer_name + " (" + item.name + ")" : item.name;
}
},
"Item Group": {
@ -67,7 +69,7 @@ erpnext.SalesAnalytics = frappe.views.TreeGridReport.extend({
item_key: "customer",
parent_field: "parent_territory",
formatter: function(item) {
return item.name;
return item.customer_name? item.customer_name + " (" + item.name + ")" : item.name;
}
}
}