Skip to content

Commit

Permalink
Customer/Supplier Name in sales/purchase analytics (#8717)
Browse files Browse the repository at this point in the history
  • Loading branch information
nabinhait authored May 6, 2017
1 parent 6e74079 commit 7228e1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 2 additions & 6 deletions erpnext/buying/page/purchase_analytics/purchase_analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,15 @@ 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": {
label: __("Supplier"),
show: false,
item_key: "supplier",
formatter: function(item) {
return item.name;
return item.supplier_name ? item.supplier_name + " (" + item.name + ")" : item.name;
}
},
"Item Group": {
Expand Down
8 changes: 5 additions & 3 deletions erpnext/selling/page/sales_analytics/sales_analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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;
}
}
}
Expand Down

0 comments on commit 7228e1a

Please sign in to comment.