finished listviews

This commit is contained in:
Rushabh Mehta 2013-01-29 18:33:48 +05:30
parent abf8fe414b
commit dacfa901c6
12 changed files with 33 additions and 251 deletions

View File

@ -2,7 +2,7 @@
{
"creation": "2013-01-19 10:23:34",
"docstatus": 0,
"modified": "2013-01-29 16:27:58",
"modified": "2013-01-29 18:19:58",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -62,6 +62,7 @@
"fieldname": "voucher_type",
"fieldtype": "Select",
"in_filter": 1,
"in_list_view": 1,
"label": "Voucher Type",
"oldfieldname": "voucher_type",
"oldfieldtype": "Select",
@ -119,6 +120,7 @@
"fieldname": "total_debit",
"fieldtype": "Currency",
"in_filter": 1,
"in_list_view": 1,
"label": "Total Debit",
"no_copy": 1,
"oldfieldname": "total_debit",
@ -222,6 +224,7 @@
"doctype": "DocField",
"fieldname": "remark",
"fieldtype": "Small Text",
"in_list_view": 1,
"label": "Remark",
"no_copy": 1,
"oldfieldname": "remark",
@ -346,6 +349,7 @@
"fieldname": "total_amount",
"fieldtype": "Data",
"hidden": 1,
"in_list_view": 0,
"label": "Total Amount",
"no_copy": 1,
"print_hide": 1,

View File

@ -1,39 +0,0 @@
wn.doclistviews['Journal Voucher'] = wn.views.ListView.extend({
init: function(d) {
this._super(d);
this.fields = this.fields.concat([
'`tabJournal Voucher`.voucher_type',
'`tabJournal Voucher`.remark',
'`tabJournal Voucher`.total_debit',
'`tabJournal Voucher`.company',
"`tabJournal Voucher`.posting_date",
]);
this.stats = this.stats.concat(['voucher_type', 'company']);
},
prepare_data: function(data) {
this._super(data);
if(!data.remark) data.remark = '';
if(data.remark.length> 30) {
data.remark = '<span title="'+data.remark+'">' + data.remark.substr(0,30)
+ '...</span>';
}
},
columns: [
{width: '3%', content: 'check'},
{width: '5%', content: 'avatar'},
{width: '3%', content: 'docstatus'},
{width: '12%', content: 'name'},
{width: '15%', content: 'voucher_type'},
{width: '32%', content: 'remark+tags', css: {'color':'#222'}},
{
width: '18%',
content: function(parent, data) {
$(parent).html(format_currency(data.total_debit, erpnext.get_currency(data.company)));
},
css: {'text-align':'right'}
},
{width: '12%', content:'posting_date',
css: {'text-align': 'right', 'color':'#777'},
title: "Journal Voucher Date", type: "date"}
],
});

View File

@ -1,8 +1,8 @@
[
{
"creation": "2013-01-21 18:19:17",
"creation": "2013-01-29 17:54:09",
"docstatus": 0,
"modified": "2013-01-29 16:27:58",
"modified": "2013-01-29 18:25:24",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -89,6 +89,7 @@
"fieldname": "supplier_name",
"fieldtype": "Text",
"hidden": 1,
"in_list_view": 1,
"label": "Name",
"oldfieldname": "supplier_name",
"oldfieldtype": "Data",
@ -434,6 +435,7 @@
"doctype": "DocField",
"fieldname": "grand_total_import",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Grand Total (Import)",
"oldfieldname": "grand_total_import",
"oldfieldtype": "Currency",
@ -481,6 +483,7 @@
"fieldname": "outstanding_amount",
"fieldtype": "Currency",
"in_filter": 1,
"in_list_view": 1,
"label": "Outstanding Amount",
"no_copy": 1,
"oldfieldname": "outstanding_amount",

View File

@ -1,47 +0,0 @@
// render
wn.doclistviews['Purchase Invoice'] = wn.views.ListView.extend({
init: function(d) {
this._super(d);
this.fields = this.fields.concat([
'`tabPurchase Invoice`.supplier_name',
'`tabPurchase Invoice`.credit_to',
'`tabPurchase Invoice`.currency',
'IFNULL(`tabPurchase Invoice`.grand_total_import, 0) as grand_total_import',
'IFNULL(`tabPurchase Invoice`.grand_total, 0) as grand_total',
'IFNULL(`tabPurchase Invoice`.outstanding_amount, 0) as outstanding_amount',
"`tabPurchase Invoice`.posting_date"
]);
this.stats = this.stats.concat(['company']);
},
prepare_data: function(data) {
this._super(data);
data.paid = data.docstatus == 1 ?
flt(((data.grand_total - data.outstanding_amount) / data.grand_total) * 100, 2) : 0;
},
columns: [
{width: '3%', content: 'check'},
{width: '5%', content: 'avatar'},
{width: '3%', content: 'docstatus'},
{width: '15%', content: 'name'},
{
width: '34%',
content: function(parent, data) {
$(parent).html(data.supplier_name?data.supplier_name:data.credit_to)
},
css: {color: '#222'}
},
{
width: '18%',
content: function(parent, data) {
$(parent).html(format_currency(data.grand_total_import, data.currency))
},
css: {'text-align':'right'}
},
{width: '10%', content: 'paid', type:'bar-graph', label:'Paid'},
{width: '12%', content:'posting_date',
css: {'text-align': 'right', 'color':'#777'},
title: "Purchase Invoice Date", type: "date"},
]
});

View File

@ -1,8 +1,8 @@
[
{
"creation": "2013-01-23 19:57:17",
"creation": "2013-01-29 17:54:09",
"docstatus": 0,
"modified": "2013-01-29 16:28:02",
"modified": "2013-01-29 18:22:52",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -118,6 +118,7 @@
"fieldname": "customer_name",
"fieldtype": "Data",
"hidden": 1,
"in_list_view": 1,
"label": "Name",
"oldfieldname": "customer_name",
"oldfieldtype": "Data",
@ -493,6 +494,7 @@
"doctype": "DocField",
"fieldname": "outstanding_amount",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Outstanding Amount",
"no_copy": 1,
"oldfieldname": "outstanding_amount",
@ -513,6 +515,7 @@
"doctype": "DocField",
"fieldname": "grand_total_export",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Grand Total (Export)",
"oldfieldname": "grand_total_export",
"oldfieldtype": "Currency",

View File

@ -1,44 +0,0 @@
// render
wn.doclistviews['Sales Invoice'] = wn.views.ListView.extend({
init: function(d) {
this._super(d);
this.fields = this.fields.concat([
"`tabSales Invoice`.customer_name",
"`tabSales Invoice`.debit_to",
"ifnull(`tabSales Invoice`.outstanding_amount,0) as outstanding_amount",
"ifnull(`tabSales Invoice`.grand_total,0) as grand_total",
"`tabSales Invoice`.currency",
"ifnull(`tabSales Invoice`.grand_total_export,0) as grand_total_export",
"`tabSales Invoice`.posting_date",
]);
},
prepare_data: function(data) {
this._super(data);
data.paid = (data.docstatus == 1) ?
flt((data.grand_total - data.outstanding_amount) / data.grand_total * 100, 2) : 0;
},
columns: [
{width: '3%', content: 'check'},
{width: '5%', content: 'avatar'},
{width: '3%', content: 'docstatus'},
{width: '15%', content: 'name'},
{
width: '34%',
content: function(parent, data) {
$(parent).html(data.customer_name?data.customer_name:data.debit_to)
},
css: {color: '#222'}
},
{
width: '18%',
content: function(parent, data) {
$(parent).html(format_currency(data.grand_total_export, data.currency))
},
css: {'text-align':'right'}
},
{width: '10%', content: 'paid', type:'bar-graph', label:'Paid'},
{width: '12%', content:'posting_date',
css: {'text-align': 'right', 'color':'#777'},
title: "Sales Invoice Date", type: "date"}
]
});

View File

@ -1,8 +1,8 @@
[
{
"creation": "2013-01-22 15:11:37",
"creation": "2013-01-29 17:54:10",
"docstatus": 0,
"modified": "2013-01-29 16:27:59",
"modified": "2013-01-29 18:16:48",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -71,6 +71,7 @@
"fieldname": "supplier_name",
"fieldtype": "Data",
"hidden": 1,
"in_list_view": 1,
"label": "Name",
"read_only": 1
},
@ -402,6 +403,7 @@
"doctype": "DocField",
"fieldname": "grand_total_import",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Grand Total (Import)",
"no_copy": 0,
"oldfieldname": "grand_total_import",
@ -725,7 +727,8 @@
"description": "% of materials received against this Purchase Order",
"doctype": "DocField",
"fieldname": "per_received",
"fieldtype": "Float",
"fieldtype": "Percent",
"in_list_view": 1,
"label": "% Received",
"no_copy": 1,
"oldfieldname": "per_received",
@ -738,7 +741,8 @@
"description": "% of materials billed against this Purchase Order.",
"doctype": "DocField",
"fieldname": "per_billed",
"fieldtype": "Float",
"fieldtype": "Percent",
"in_list_view": 1,
"label": "% Billed",
"no_copy": 1,
"oldfieldname": "per_billed",

View File

@ -1,38 +0,0 @@
// 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",
"`tabPurchase Order`.transaction_date",
]);
this.stats = this.stats.concat(['status', 'company']);
},
columns: [
{width: '3%', content: 'check'},
{width: '5%', content: 'avatar'},
{width: '3%', content: 'docstatus'},
{width: '15%', content: 'name'},
{width: '28%', content: 'supplier_name+tags', css: {color:'#222'}},
{
width: '18%',
content: function(parent, data) {
$(parent).html(format_currency(data.grand_total_import, data.currency))
},
css: {'text-align':'right'}
},
{width: '8%', content: 'per_received', type:'bar-graph', label:'Received'},
{width: '8%', content: 'per_billed', type:'bar-graph', label:'Billed'},
{width: '12%', content:'transaction_date',
css: {'text-align': 'right', 'color':'#777'},
title: "Purchase Order Date", type: "date"}
]
});

View File

@ -2,7 +2,7 @@
{
"creation": "2013-01-21 18:19:20",
"docstatus": 0,
"modified": "2013-01-23 16:59:33",
"modified": "2013-01-29 18:14:11",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -183,6 +183,7 @@
"doctype": "DocField",
"fieldname": "requested_by",
"fieldtype": "Data",
"in_list_view": 0,
"label": "Requested By",
"no_copy": 1,
"oldfieldname": "requested_by",
@ -226,6 +227,7 @@
"fieldname": "status",
"fieldtype": "Select",
"in_filter": 1,
"in_list_view": 1,
"label": "Status",
"no_copy": 1,
"oldfieldname": "status",
@ -242,7 +244,8 @@
"description": "% of materials ordered against this Purchase Requisition",
"doctype": "DocField",
"fieldname": "per_ordered",
"fieldtype": "Float",
"fieldtype": "Percent",
"in_list_view": 1,
"label": "% Ordered",
"no_copy": 1,
"oldfieldname": "per_ordered",
@ -280,6 +283,7 @@
"doctype": "DocField",
"fieldname": "remark",
"fieldtype": "Small Text",
"in_list_view": 1,
"label": "Remarks",
"no_copy": 1,
"oldfieldname": "remark",

View File

@ -1,37 +0,0 @@
// render
wn.doclistviews['Purchase Request'] = wn.views.ListView.extend({
init: function(d) {
this._super(d)
this.fields = this.fields.concat([
"`tabPurchase Request`.status",
"IFNULL(`tabPurchase Request`.per_ordered, 0) as per_ordered",
"`tabPurchase Request`.remark",
"`tabPurchase Request`.transaction_date",
]);
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: '3%', content: 'check'},
{width: '5%', content:'avatar'},
{width: '3%', content:'docstatus'},
{width: '17%', content:'name'},
{width: '50%', content:'status_html+remark+tags', css: {'color': '#222'}},
{width: '10%', content: 'per_ordered', type:'bar-graph', label:'Ordered'},
{width: '12%', content:'transaction_date',
css: {'text-align': 'right', 'color':'#777'},
title: "Quotation Date", type: "date"}
]
});

View File

@ -1,8 +1,8 @@
[
{
"creation": "2013-01-21 18:19:20",
"creation": "2013-01-29 17:54:11",
"docstatus": 0,
"modified": "2013-01-29 16:27:59",
"modified": "2013-01-29 18:11:12",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -71,6 +71,7 @@
"fieldname": "supplier_name",
"fieldtype": "Data",
"hidden": 1,
"in_list_view": 1,
"label": "Name",
"read_only": 1
},
@ -357,6 +358,7 @@
"doctype": "DocField",
"fieldname": "grand_total_import",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Grand Total (Import)",
"no_copy": 0,
"oldfieldname": "grand_total_import",

View File

@ -1,33 +0,0 @@
// render
wn.doclistviews['Supplier Quotation'] = wn.views.ListView.extend({
init: function(d) {
this._super(d)
this.fields = this.fields.concat([
"`tabSupplier Quotation`.supplier_name",
"`tabSupplier Quotation`.currency",
"ifnull(`tabSupplier Quotation`.grand_total_import,0) as grand_total_import",
"`tabSupplier Quotation`.transaction_date",
]);
this.stats = this.stats.concat(['status', 'company']);
},
columns: [
{width: '3%', content: 'check'},
{width: '5%', content:'avatar'},
{width: '3%', content:'docstatus'},
{width: '15%', content:'name'},
{width: '44%', content:'supplier_name+tags', css: {color:'#222'}},
{
width: '18%',
content: function(parent, data) {
$(parent).html(format_currency(data.grand_total_import, data.currency))
},
css: {'text-align':'right'}
},
{width: '12%', content:'transaction_date',
css: {'text-align': 'right', 'color':'#777'},
title: "Supplier Quotation Date", type: "date"}
]
});