Anand Doshi
13 years ago
4 changed files with 92 additions and 2 deletions
@ -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'}} |
|||
] |
|||
}); |
|||
|
@ -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'}} |
|||
] |
|||
|
|||
}); |
|||
|
@ -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'}} |
|||
] |
|||
}); |
|||
|
Loading…
Reference in new issue