some buying listviews
This commit is contained in:
parent
18ffd2a1b8
commit
66722dfe69
33
erpnext/buying/doctype/indent/listview.js
Normal file
33
erpnext/buying/doctype/indent/listview.js
Normal file
@ -0,0 +1,33 @@
|
||||
// render
|
||||
wn.doclistviews['Indent'] = wn.views.ListView.extend({
|
||||
init: function(d) {
|
||||
this._super(d)
|
||||
this.fields = this.fields.concat([
|
||||
"`tabIndent`.status",
|
||||
"IFNULL(`tabIndent`.per_ordered, 0) as per_ordered",
|
||||
"`tabIndent`.remark",
|
||||
]);
|
||||
this.stats = this.stats.concat(['status', 'company']);
|
||||
},
|
||||
|
||||
prepare_data: function(data) {
|
||||
this._super(data);
|
||||
if(['Stopped', 'Cancelled'].indexOf(data.status)!=-1) {
|
||||
data.label_type = 'important';
|
||||
} else if(data.status == 'Submitted') {
|
||||
data.label_type = 'success';
|
||||
}
|
||||
|
||||
data.status_html = repl('<span class="label label-%(label_type)s">%(status)s</span>', data);
|
||||
},
|
||||
|
||||
columns: [
|
||||
{width: '5%', content:'avatar'},
|
||||
{width: '3%', content:'docstatus'},
|
||||
{width: '17%', content:'name'},
|
||||
{width: '53%', content:'status_html+tags+remark', css: {'color': '#aaa'}},
|
||||
{width: '10%', content: 'per_ordered', type:'bar-graph', label:'Ordered'},
|
||||
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
|
||||
]
|
||||
});
|
||||
|
33
erpnext/buying/doctype/purchase_order/listview.js
Normal file
33
erpnext/buying/doctype/purchase_order/listview.js
Normal file
@ -0,0 +1,33 @@
|
||||
// render
|
||||
wn.doclistviews['Purchase Order'] = wn.views.ListView.extend({
|
||||
init: function(d) {
|
||||
this._super(d)
|
||||
this.fields = this.fields.concat([
|
||||
"`tabPurchase Order`.supplier_name",
|
||||
"ifnull(`tabPurchase Order`.per_received,0) as per_received",
|
||||
"ifnull(`tabPurchase Order`.per_billed,0) as per_billed",
|
||||
"`tabPurchase Order`.currency",
|
||||
"ifnull(`tabPurchase Order`.grand_total_import,0) as grand_total_import"
|
||||
]);
|
||||
this.stats = this.stats.concat(['status', 'company']);
|
||||
},
|
||||
|
||||
columns: [
|
||||
{width: '5%', content:'avatar'},
|
||||
{width: '3%', content:'docstatus'},
|
||||
{width: '15%', content:'name'},
|
||||
{width: '35%', content:'tags+supplier_name', css: {color:'#aaa'}},
|
||||
{
|
||||
width: '18%',
|
||||
content: function(parent, data) {
|
||||
$(parent).html(data.currency + ' ' + fmt_money(data.grand_total_import))
|
||||
},
|
||||
css: {'text-align':'right'}
|
||||
},
|
||||
{width: '8%', content: 'per_received', type:'bar-graph', label:'Delivered'},
|
||||
{width: '8%', content: 'per_billed', type:'bar-graph', label:'Billed'},
|
||||
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
|
||||
]
|
||||
|
||||
});
|
||||
|
23
erpnext/buying/doctype/supplier/listview.js
Normal file
23
erpnext/buying/doctype/supplier/listview.js
Normal file
@ -0,0 +1,23 @@
|
||||
// render
|
||||
wn.doclistviews['Supplier'] = wn.views.ListView.extend({
|
||||
init: function(d) {
|
||||
this._super(d)
|
||||
this.fields = this.fields.concat([
|
||||
"`tabSupplier`.supplier_type",
|
||||
]);
|
||||
this.stats = this.stats.concat([]);
|
||||
},
|
||||
|
||||
prepare_data: function(data) {
|
||||
this._super(data);
|
||||
},
|
||||
|
||||
columns: [
|
||||
{width: '5%', content:'avatar'},
|
||||
{width: '50%', content:'name'},
|
||||
{width: '10%', content:'tags'},
|
||||
{width: '23%', content:'supplier_type', css: {'color': '#aaa'}},
|
||||
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
|
||||
]
|
||||
});
|
||||
|
@ -6,17 +6,18 @@ wn.doclistviews['Item'] = wn.views.ListView.extend({
|
||||
"`tabItem`.item_name",
|
||||
"`tabItem`.description",
|
||||
]);
|
||||
this.stats = this.stats.concat(['default_warehouse', 'brand']);
|
||||
},
|
||||
|
||||
prepare_data: function(data) {
|
||||
this._super(data);
|
||||
data.description = repl("[%(item_name)s] %(description)s", data);
|
||||
data.description = repl("%(item_name)s | %(description)s", data);
|
||||
},
|
||||
|
||||
columns: [
|
||||
{width: '5%', content:'avatar'},
|
||||
{width: '20%', content:'name'},
|
||||
{width: '63%', content:'description', css: {'color': '#aaa'}},
|
||||
{width: '63%', content:'tags+description', css: {'color': '#aaa'}},
|
||||
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
|
||||
]
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user