mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-16 19:49:18 +00:00
more listviews
This commit is contained in:
53
erpnext/projects/doctype/project/listview.js
Normal file
53
erpnext/projects/doctype/project/listview.js
Normal file
@@ -0,0 +1,53 @@
|
||||
// render
|
||||
wn.doclistviews['Project'] = wn.views.ListView.extend({
|
||||
init: function(d) {
|
||||
this._super(d);
|
||||
this.fields = this.fields.concat([
|
||||
'`tabProject`.project_name',
|
||||
'`tabProject`.status',
|
||||
'`tabProject`.is_active',
|
||||
'`tabProject`.priority',
|
||||
'IFNULL(`tabProject`.project_value, 0) as project_value',
|
||||
'IFNULL(`tabProject`.per_gross_margin, 0) as per_gross_margin',
|
||||
'`tabProject`.completion_date',
|
||||
]);
|
||||
//this.stats = this.stats.concat(['company']);
|
||||
},
|
||||
|
||||
prepare_data: function(data) {
|
||||
this._super(data);
|
||||
data.completion_date = wn.datetime.str_to_user(data.completion_date);
|
||||
},
|
||||
|
||||
columns: [
|
||||
{width: '3%', content: 'check'},
|
||||
{width: '3%', content: 'docstatus'},
|
||||
{width: '15%', content: 'name'},
|
||||
{width: '22%', content: 'project_name+tags'},
|
||||
{
|
||||
width: '20%',
|
||||
content: function(parent, data) {
|
||||
$(parent).html(data.status + " [" + data.priority + "] "
|
||||
+ (data.is_active=='No'?" [Inactive]":""));
|
||||
},
|
||||
},
|
||||
{
|
||||
width: '15%',
|
||||
content: function(parent, data) {
|
||||
$(parent).html(sys_defaults.currency + " "
|
||||
+ fmt_money(data.project_value));
|
||||
},
|
||||
css: {'text-align': 'right'},
|
||||
},
|
||||
{
|
||||
width: '10%',
|
||||
content: function(parent, data) {
|
||||
$(parent).html(fmt_money(data.per_gross_margin) + " %");
|
||||
},
|
||||
css: {'text-align': 'right'},
|
||||
},
|
||||
{width: '12%', content:'completion_date', css: {
|
||||
'text-align': 'right', 'color':'#777'
|
||||
}},
|
||||
]
|
||||
});
|
||||
38
erpnext/projects/doctype/task/listview.js
Normal file
38
erpnext/projects/doctype/task/listview.js
Normal file
@@ -0,0 +1,38 @@
|
||||
// render
|
||||
wn.doclistviews['Task'] = wn.views.ListView.extend({
|
||||
init: function(d) {
|
||||
this._super(d);
|
||||
this.fields = this.fields.concat([
|
||||
'`tabTask`.subject',
|
||||
'`tabTask`.status',
|
||||
'`tabTask`.opening_date',
|
||||
'`tabTask`.priority',
|
||||
'`tabTask`.allocated_to',
|
||||
]);
|
||||
},
|
||||
|
||||
prepare_data: function(data) {
|
||||
this._super(data);
|
||||
data.opening_date = wn.datetime.str_to_user(data.opening_date);
|
||||
},
|
||||
|
||||
columns: [
|
||||
{width: '3%', content: 'check'},
|
||||
{width: '5%', content: 'avatar'},
|
||||
{width: '3%', content: 'docstatus'},
|
||||
{width: '12%', content: 'name'},
|
||||
{width: '30%', content: 'subject+tags'},
|
||||
{
|
||||
width: '15%',
|
||||
content: function(parent, data) {
|
||||
$(parent).html(data.status +
|
||||
(data.priority ? " [" + data.priority + "]" : "")
|
||||
);
|
||||
},
|
||||
},
|
||||
{width: '20%', content: 'allocated_to'},
|
||||
{width: '12%', content:'opening_date', css: {
|
||||
'text-align': 'right', 'color':'#777'
|
||||
}},
|
||||
]
|
||||
});
|
||||
35
erpnext/projects/doctype/timesheet/listview.js
Normal file
35
erpnext/projects/doctype/timesheet/listview.js
Normal file
@@ -0,0 +1,35 @@
|
||||
// render
|
||||
wn.doclistviews['Timesheet'] = wn.views.ListView.extend({
|
||||
init: function(d) {
|
||||
this._super(d);
|
||||
this.fields = this.fields.concat([
|
||||
'`tabTimesheet`.status',
|
||||
'`tabTimesheet`.timesheet_date',
|
||||
'`tabTimesheet`.owner',
|
||||
'`tabTimesheet`.notes',
|
||||
|
||||
]);
|
||||
},
|
||||
|
||||
prepare_data: function(data) {
|
||||
this._super(data);
|
||||
data.timesheet_date = wn.datetime.str_to_user(data.timesheet_date);
|
||||
if(data.notes && data.notes.length > 50) {
|
||||
data.notes = '<span title="'+data.notes+'">' +
|
||||
data.notes.substr(0,50) + '...</span>';
|
||||
}
|
||||
},
|
||||
|
||||
columns: [
|
||||
{width: '3%', content: 'check'},
|
||||
{width: '5%', content: 'avatar'},
|
||||
{width: '3%', content: 'docstatus'},
|
||||
{width: '18%', content: 'name'},
|
||||
{width: '12%', content: 'status'},
|
||||
{width: '27%', content: 'notes+tags', css: {'color': '#777'}},
|
||||
{width: '20%', content: 'owner'},
|
||||
{width: '12%', content:'timesheet_date', css: {
|
||||
'text-align': 'right', 'color':'#777'
|
||||
}},
|
||||
]
|
||||
});
|
||||
Reference in New Issue
Block a user