mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-28 14:18:24 +00:00
show order type icon in sales order list view
This commit is contained in:
@@ -3,21 +3,23 @@ wn.doclistviews['Sales Order'] = wn.views.ListView.extend({
|
||||
init: function(d) {
|
||||
this._super(d)
|
||||
this.fields = this.fields.concat([
|
||||
"`tabSales Order`.customer_name",
|
||||
"`tabSales Order`.customer_name",
|
||||
"`tabSales Order`.status",
|
||||
"`tabSales Order`.order_type",
|
||||
"ifnull(`tabSales Order`.per_delivered,0) as per_delivered",
|
||||
"ifnull(`tabSales Order`.per_billed,0) as per_billed",
|
||||
"`tabSales Order`.currency",
|
||||
"ifnull(`tabSales Order`.grand_total_export,0) as grand_total_export"
|
||||
]);
|
||||
this.stats = this.stats.concat(['status', 'company']);
|
||||
this.stats = this.stats.concat(['status', 'order_type', 'company']);
|
||||
},
|
||||
|
||||
columns: [
|
||||
{width: '3%', content: 'check'},
|
||||
{width: '5%', content:'avatar'},
|
||||
{width: '3%', content:'docstatus'},
|
||||
{width: '15%', content:'name'},
|
||||
{width: '32%', content:'customer_name+tags', css: {color:'#222'}},
|
||||
{width: '5%', content: 'avatar'},
|
||||
{width: '3%', content: 'docstatus'},
|
||||
{width: '15%', content: 'name'},
|
||||
{width: '29%', content: 'customer_name+tags', css: {color:'#222'}},
|
||||
{
|
||||
width: '18%',
|
||||
content: function(parent, data) {
|
||||
@@ -25,7 +27,19 @@ wn.doclistviews['Sales Order'] = wn.views.ListView.extend({
|
||||
},
|
||||
css: {'text-align':'right'}
|
||||
},
|
||||
{width: '8%', content: 'per_delivered', type:'bar-graph', label:'Delivered'},
|
||||
{
|
||||
width: '11%',
|
||||
content: function(parent, data, me) {
|
||||
var order_type = data.order_type.toLowerCase();
|
||||
|
||||
if (order_type === 'sales') {
|
||||
me.render_icon(parent, 'icon-tag', data.order_type);
|
||||
me.render_bar_graph(parent, data, 'per_billed', 'Delivered');
|
||||
} else if (order_type === 'maintenance') {
|
||||
me.render_icon(parent, 'icon-wrench', data.order_type);
|
||||
}
|
||||
},
|
||||
},
|
||||
{width: '8%', content: 'per_billed', type:'bar-graph', label:'Billed'},
|
||||
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user