diff --git a/erpnext/accounts/doctype/journal_voucher/listview.js b/erpnext/accounts/doctype/journal_voucher/listview.js index f3c6a74607..94d698f523 100644 --- a/erpnext/accounts/doctype/journal_voucher/listview.js +++ b/erpnext/accounts/doctype/journal_voucher/listview.js @@ -7,7 +7,7 @@ wn.doclistviews['Journal Voucher'] = wn.views.ListView.extend({ '`tabJournal Voucher`.total_debit', '`tabJournal Voucher`.company', ]); - this.stats = this.stats.concat(['voucher_type']); + this.stats = this.stats.concat(['voucher_type', 'company']); }, prepare_data: function(data) { this._super(data); diff --git a/erpnext/buying/doctype/supplier/listview.js b/erpnext/buying/doctype/supplier/listview.js index 86e22d6f63..45ab1a4396 100644 --- a/erpnext/buying/doctype/supplier/listview.js +++ b/erpnext/buying/doctype/supplier/listview.js @@ -4,8 +4,9 @@ wn.doclistviews['Supplier'] = wn.views.ListView.extend({ this._super(d) this.fields = this.fields.concat([ "`tabSupplier`.supplier_type", + "`tabSupplier`.supplier_name", ]); - this.stats = this.stats.concat([]); + //this.stats = this.stats.concat(['company']); }, prepare_data: function(data) { @@ -14,7 +15,8 @@ wn.doclistviews['Supplier'] = wn.views.ListView.extend({ columns: [ {width: '5%', content:'avatar'}, - {width: '50%', content:'name'}, + {width: '20%', content:'name'}, + {width: '30%', content:'supplier_name'}, {width: '10%', content:'tags'}, {width: '23%', content:'supplier_type', css: {'color': '#aaa'}}, {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} diff --git a/erpnext/hr/doctype/appraisal/listview.js b/erpnext/hr/doctype/appraisal/listview.js new file mode 100644 index 0000000000..34653f3687 --- /dev/null +++ b/erpnext/hr/doctype/appraisal/listview.js @@ -0,0 +1,31 @@ +// render +wn.doclistviews['Appraisal'] = wn.views.ListView.extend({ + init: function(d) { + this._super(d) + this.fields = this.fields.concat([ + "`tabAppraisal`.employee_name", + "`tabAppraisal`.start_date", + "`tabAppraisal`.end_date", + "`tabAppraisal`.total_score", + "`tabAppraisal`.status", + ]); + this.stats = this.stats.concat(['company']); + }, + + prepare_data: function(data) { + this._super(data); + data.start_date = wn.datetime.str_to_user(data.start_date); + data.end_date = wn.datetime.str_to_user(data.end_date); + data.date_range = data.start_date + " to " + data.end_date; + }, + + columns: [ + {width: '3%', content: 'docstatus'}, + {width: '15%', content: 'name'}, + {width: '28%', content: 'employee_name'}, + {width: '12%', content: 'status+tags'}, + {width: '12%', content: 'total_score', css: {'text-align': 'right'}}, + {width: '30%', content:'date_range', + css: {'text-align': 'right', 'color': '#777'}}, +] +}); \ No newline at end of file diff --git a/erpnext/hr/doctype/attendance/listview.js b/erpnext/hr/doctype/attendance/listview.js new file mode 100644 index 0000000000..45729eacb2 --- /dev/null +++ b/erpnext/hr/doctype/attendance/listview.js @@ -0,0 +1,28 @@ +// render +wn.doclistviews['Attendance'] = wn.views.ListView.extend({ + init: function(d) { + this._super(d) + this.fields = this.fields.concat([ + "`tabAttendance`.att_date", + "`tabAttendance`.employee_name", + "`tabAttendance`.`status`", + + ]); + this.stats = this.stats.concat(['company']); + }, + + prepare_data: function(data) { + this._super(data); + data.att_date = wn.datetime.str_to_user(data.att_date); + }, + + columns: [ + {width: '3%', content:'docstatus'}, + {width: '12%', content:'name'}, + {width: '50%', content:'employee_name'}, + {width: '13%', content:'status'}, + {width: '10%', content:'tags'}, + //{width: '23%', content:'supplier_type', css: {'color': '#aaa'}}, + {width: '12%', content:'att_date', css: {'text-align': 'right', 'color':'#777'}} + ] +}); \ No newline at end of file diff --git a/erpnext/hr/doctype/employee/listview.js b/erpnext/hr/doctype/employee/listview.js new file mode 100644 index 0000000000..3aa87d29b1 --- /dev/null +++ b/erpnext/hr/doctype/employee/listview.js @@ -0,0 +1,46 @@ +// render +wn.doclistviews['Employee'] = wn.views.ListView.extend({ + init: function(d) { + this._super(d) + this.fields = this.fields.concat([ + "`tabEmployee`.employee_name", + "`tabEmployee`.employee_number", + "`tabEmployee`.employment_type", + "`tabEmployee`.designation", + "`tabEmployee`.department", + "`tabEmployee`.branch", + "`tabEmployee`.company", + "`tabEmployee`.reports_to", + "`tabEmployee`.date_of_joining", + ]); + this.stats = this.stats.concat(['company']); + }, + + prepare_data: function(data) { + this._super(data); + + data.employee_name = data.employee_name + + (data.employee_number ? ' [' + data.employee_number + ']' : ''); + + data.date_of_joining = wn.datetime.str_to_user(data.date_of_joining); + data.designation = data.designation + + (data.employment_type ? ' [' + data.employment_type + ']' : ''); + + var concat_list = []; + data.designation && concat_list.push(data.designation); + data.department && concat_list.push(data.department); + data.company && concat_list.push(data.company); + data.branch && concat_list.push(data.branch); + data.description = concat_list.join(", "); + }, + + columns: [ + {width: '3%', content: 'docstatus'}, + {width: '12%', content: 'name'}, + {width: '25%', content: 'employee_name'}, + {width: '48%', content: 'description+tags', + css: {'color': '#aaa'}}, + {width: '12%', content:'date_of_joining', + css: {'text-align': 'right', 'color': '#777'}}, +] +}); \ No newline at end of file diff --git a/erpnext/hr/doctype/expense_claim/listview.js b/erpnext/hr/doctype/expense_claim/listview.js new file mode 100644 index 0000000000..8f9fea11c1 --- /dev/null +++ b/erpnext/hr/doctype/expense_claim/listview.js @@ -0,0 +1,41 @@ +// render +wn.doclistviews['Expense Claim'] = wn.views.ListView.extend({ + init: function(d) { + this._super(d) + this.fields = this.fields.concat([ + "`tabExpense Claim`.employee_name", + "`tabExpense Claim`.posting_date", + "`tabExpense Claim`.approval_status", + "`tabExpense Claim`.total_claimed_amount", + "`tabExpense Claim`.total_sanctioned_amount", + "`tabExpense Claim`.company", + ]); + this.stats = this.stats.concat(['company']); + }, + + prepare_data: function(data) { + this._super(data); + data.posting_date = wn.datetime.str_to_user(data.posting_date); + data.employee_name = data.employee_name + 'claimed ' + + wn.boot.company[data.company].default_currency + ' ' + + fmt_money(data.total_claimed_amount); + }, + + columns: [ + {width: '5%', content: 'avatar'}, + {width: '3%', content: 'docstatus'}, + {width: '12%', content: 'name'}, + {width: '44%', content: 'employee_name+tags'}, + {width: '10%', content: 'approval_status'}, + { + width: '12%', + content: function(parent, data) { + $(parent).html(wn.boot.company[data.company].default_currency + + ' ' + fmt_money(data.total_sanctioned_amount)); + }, + css: {'text-align': 'right'}, + }, + {width: '12%', content: 'posting_date', + css: {'text-align': 'right', 'color': '#777'}}, + ] +}); \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_application/listview.js b/erpnext/hr/doctype/leave_application/listview.js new file mode 100644 index 0000000000..0f1b1b7ff7 --- /dev/null +++ b/erpnext/hr/doctype/leave_application/listview.js @@ -0,0 +1,36 @@ +// render +wn.doclistviews['Leave Application'] = wn.views.ListView.extend({ + init: function(d) { + this._super(d) + this.fields = this.fields.concat([ + "`tabLeave Application`.employee_name", + "`tabLeave Application`.total_leave_days", + "`tabLeave Application`.from_date", + "`tabLeave Application`.to_date", + + ]); + this.stats = this.stats.concat(['company']); + }, + + prepare_data: function(data) { + this._super(data); + data.from_date = wn.datetime.str_to_user(data.from_date); + data.to_date = wn.datetime.str_to_user(data.to_date); + data.date_range = (data.from_date === data.to_date) + ? data.from_date + : data.from_date + " to " + data.to_date; + data.total_leave_days = data.total_leave_days<=1 + ? data.total_leave_days + " day" + : data.total_leave_days + " days" + }, + + columns: [ + {width: '5%', content:'avatar'}, + {width: '3%', content:'docstatus'}, + {width: '12%', content:'name'}, + {width: '40%', content:'employee_name+tags'}, + {width: '10%', content:'total_leave_days', + css: {'color':'#777'}}, + {width: '30%', content:'date_range'}, + ] +}); \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_slip/listview.js b/erpnext/hr/doctype/salary_slip/listview.js new file mode 100644 index 0000000000..cb3cfe4185 --- /dev/null +++ b/erpnext/hr/doctype/salary_slip/listview.js @@ -0,0 +1,46 @@ +// render +wn.doclistviews['Salary Slip'] = wn.views.ListView.extend({ + init: function(d) { + this._super(d) + this.fields = this.fields.concat([ + "`tabSalary Slip`.employee_name", + "`tabSalary Slip`.designation", + "`tabSalary Slip`.branch", + "`tabSalary Slip`.rounded_total", + "`tabSalary Slip`.company", + "`tabSalary Slip`.month", + "`tabSalary Slip`.fiscal_year", + ]); + this.stats = this.stats.concat(['company']); + }, + + prepare_data: function(data) { + this._super(data); + var concat_list = []; + data.designation && concat_list.push(data.designation); + data.branch && concat_list.push(data.branch); + data.description = concat_list.join(", "); + data.month = month_list[cint(data.month)-1] + " [" + data.fiscal_year + "]"; + }, + + columns: [ + {width: '3%', content: 'docstatus'}, + {width: '14%', content: 'name'}, + {width: '20%', content: 'employee_name'}, + {width: '30%', content: 'description+tags', css: {'color': '#aaa'}}, + {width: '17%', content:'month', css: {'text-align': 'right', 'color':'#aaa'}}, + { + width: '16%', + content: function(parent, data) { + $(parent).html( + ( + data.company + ? wn.boot.company[data.company].default_currency + : sys_defaults.currency + ) + + ' ' + fmt_money(data.rounded_total)); + }, + css: {'text-align': 'right'}, + }, +] +}); \ No newline at end of file diff --git a/erpnext/production/doctype/bom/listview.js b/erpnext/production/doctype/bom/listview.js new file mode 100644 index 0000000000..e1398479d8 --- /dev/null +++ b/erpnext/production/doctype/bom/listview.js @@ -0,0 +1,47 @@ +// render +wn.doclistviews['BOM'] = wn.views.ListView.extend({ + init: function(d) { + this._super(d); + this.fields = this.fields.concat([ + '`tabBOM`.item', + '`tabBOM`.uom', + 'IFNULL(`tabBOM`.quantity, 0) as quantity', + '`tabBOM`.is_active', + '`tabBOM`.costing_date', + '`tabBOM`.total_cost', + '`tabBOM`.description', + ]); + this.stats = this.stats.concat(['company']); + }, + + prepare_data: function(data) { + this._super(data); + data.costing_date = wn.datetime.str_to_user(data.costing_date); + data.description = (data.is_active === 'Yes' ? '' : '[Inactive] ') + data.description; + }, + + columns: [ + {width: '3%', content: 'docstatus'}, + {width: '15%', content: 'name'}, + {width: '15%', content: 'item'}, + {width: '26%', content: 'description+tags'}, + { + width: '12%', + content: function(parent, data) { + $(parent).html(data.quantity + ' ' + data.uom) + }, + css: {'text-align':'right'}, + }, + { + width: '20%', + content: function(parent, data) { + $(parent).html(sys_defaults.currency + " " + + fmt_money(data.total_cost)); + }, + css: {'text-align': 'right'}, + }, + {width: '12%', content:'costing_date', css: { + 'text-align': 'right', 'color':'#777' + }}, + ] +}); diff --git a/erpnext/production/doctype/production_order/listview.js b/erpnext/production/doctype/production_order/listview.js new file mode 100644 index 0000000000..5f510297ee --- /dev/null +++ b/erpnext/production/doctype/production_order/listview.js @@ -0,0 +1,39 @@ +// render +wn.doclistviews['Production Order'] = wn.views.ListView.extend({ + init: function(d) { + this._super(d); + this.fields = this.fields.concat([ + '`tabProduction Order`.production_item', + '`tabProduction Order`.fg_warehouse', + '`tabProduction Order`.stock_uom', + 'IFNULL(`tabProduction Order`.qty, 0) as qty', + '`tabProduction Order`.posting_date', + '`tabProduction Order`.status', + ]); + this.stats = this.stats.concat(['company']); + }, + + prepare_data: function(data) { + this._super(data); + data.posting_date = wn.datetime.str_to_user(data.posting_date); + }, + + columns: [ + {width: '5%', content: 'avatar'}, + {width: '3%', content: 'docstatus'}, + {width: '20%', content: 'name'}, + {width: '16%', content: 'production_item'}, + {width: '20%', content: 'fg_warehouse'}, + {width: '12%', content: 'status+tags'}, + { + width: '12%', + content: function(parent, data) { + $(parent).html(data.qty + ' ' + data.stock_uom) + }, + css: {'text-align':'right'} + }, + {width: '12%', content:'posting_date', css: { + 'text-align': 'right', 'color':'#777' + }}, + ] +}); diff --git a/erpnext/stock/doctype/item/listview.js b/erpnext/stock/doctype/item/listview.js index 7f0dbc8ae9..a483e35cbc 100644 --- a/erpnext/stock/doctype/item/listview.js +++ b/erpnext/stock/doctype/item/listview.js @@ -12,12 +12,15 @@ wn.doclistviews['Item'] = wn.views.ListView.extend({ prepare_data: function(data) { this._super(data); data.description = repl("%(item_name)s | %(description)s", data); + if(data.description && data.description.length > 50) { + data.description = '' + data.description.substr(0,50) + '...'; + } }, columns: [ {width: '5%', content:'avatar'}, {width: '20%', content:'name'}, - {width: '63%', content:'tags+description', css: {'color': '#aaa'}}, + {width: '63%', content:'tags+description', css: {'color': '#777'}}, {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} ] });