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"}
]
});