-
Notifications
You must be signed in to change notification settings - Fork 0
/
AllPaymentsGridpanel.js
143 lines (134 loc) · 5.03 KB
/
AllPaymentsGridpanel.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/*
* File: app/view/AllPaymentsGridpanel.js
*
* This file was generated by Sencha Architect version 3.0.4.
* http://www.sencha.com/products/architect/
*
* This file requires use of the Ext JS 4.2.x library, under independent license.
* License of Sencha Architect does not include license for Ext JS 4.2.x. For more
* details see http://www.sencha.com/license or contact license@sencha.com.
*
* This file will be auto-generated each and everytime you save your project.
*
* Do NOT hand edit this file.
*/
Ext.define('cobuy.view.AllPaymentsGridpanel', {
extend: 'Ext.grid.Panel',
alias: 'widget.allpaymentsgridpanel',
requires: [
'Ext.grid.RowNumberer',
'Ext.grid.column.Number',
'Ext.grid.column.Date',
'Ext.grid.View'
],
height: 250,
width: 400,
store: 'Payments',
initComponent: function() {
var me = this;
Ext.applyIf(me, {
columns: [
{
xtype: 'rownumberer',
width: 50,
dataIndex: 'string',
text: 'S/n'
},
{
xtype: 'gridcolumn',
width: 200,
dataIndex: 'status',
text: 'Payment Status'
},
{
xtype: 'gridcolumn',
width: 200,
dataIndex: 'delivery_type',
text: 'Delivery Type'
},
{
xtype: 'gridcolumn',
width: 300,
dataIndex: 'invoice_number',
text: 'Invoice Number'
},
{
xtype: 'gridcolumn',
width: 200,
dataIndex: 'payment_mode',
text: 'Payment Mode'
},
{
xtype: 'gridcolumn',
renderer: function(value, metaData, record, rowIndex, colIndex, store, view) {
var orders = Ext.getStore('Orders');
var thisorder = orders.findRecord('id', value);
return thisorder!== null ? thisorder.get('order_number'): value;
},
width: 200,
dataIndex: 'order_id',
text: 'Order Number'
},
{
xtype: 'gridcolumn',
renderer: function(value, metaData, record, rowIndex, colIndex, store, view) {
var accountnumberStore = Ext.getStore('Bankers');
var account = accountnumberStore.findRecord('id', value);
return account!== null ? account.get('account_number'): value;
},
width: 200,
dataIndex: 'bank_account_id',
text: 'Bank Account'
},
{
xtype: 'numbercolumn',
width: 300,
dataIndex: 'revenue',
text: 'Revenue(=N=)'
},
{
xtype: 'numbercolumn',
width: 300,
dataIndex: 'gross_amount',
text: 'Amount(=N=)'
},
{
xtype: 'numbercolumn',
width: 300,
dataIndex: 'delivery_charges',
text: 'Delivery Charges(=N=)'
},
{
xtype: 'numbercolumn',
width: 300,
dataIndex: 'vat',
text: 'Vat(=N=)'
},
{
xtype: 'datecolumn',
width: 300,
dataIndex: 'payment_date',
text: 'Payment Date',
format: 'd/m/Y'
},
{
xtype: 'gridcolumn',
renderer: function(value, metaData, record, rowIndex, colIndex, store, view) {
var userStore = Ext.getStore('AllMembers');
var user = userStore.findRecord('id', value);
if(user.get('middlename') === null || user.get('middlename') === undefined){
var name = user.get('firstname') + " " + user.get('lastname');
}else{
var name = user.get('firstname') + " " + user.get('middlename') + " " + user.get('lastname');
}
return user!== null ? name: value;
},
width: 300,
dataIndex: 'paid_by',
text: 'Paid By'
}
]
});
me.callParent(arguments);
}
});