erp_orders 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/GPL-3-LICENSE +674 -0
- data/README.rdoc +2 -0
- data/Rakefile +30 -0
- data/app/assets/javascripts/erp_orders/application.js +9 -0
- data/app/assets/stylesheets/erp_orders/application.css +7 -0
- data/app/controllers/erp_orders/erp_app/desktop/order_manager/base_controller.rb +147 -0
- data/app/controllers/erp_orders/erp_app/organizer/order_management/base_controller.rb +19 -0
- data/app/helpers/erp_orders/application_helper.rb +4 -0
- data/app/models/charge_line.rb +21 -0
- data/app/models/charge_line_payment_txn.rb +5 -0
- data/app/models/extensions/agreement.rb +6 -0
- data/app/models/extensions/money.rb +3 -0
- data/app/models/extensions/party.rb +3 -0
- data/app/models/extensions/product_instance.rb +3 -0
- data/app/models/extensions/product_type.rb +3 -0
- data/app/models/line_item_role_type.rb +4 -0
- data/app/models/order_line_item.rb +27 -0
- data/app/models/order_line_item_pty_role.rb +35 -0
- data/app/models/order_line_item_type.rb +4 -0
- data/app/models/order_txn.rb +381 -0
- data/app/models/order_txn_type.rb +4 -0
- data/app/views/layouts/erp_orders/application.html.erb +14 -0
- data/config/routes.rb +14 -0
- data/db/data_migrations/20110605231556_create_order_party_roles.rb +23 -0
- data/db/data_migrations/20110728201731_create_desktop_app_order_manager.rb +25 -0
- data/db/data_migrations/20110728201732_create_organizer_app_order_management.rb +14 -0
- data/db/migrate/20080805000060_base_orders.rb +175 -0
- data/db/migrate/20110602194707_update_order_txn_ship_to_bill_to.rb +25 -0
- data/lib/erp_orders/engine.rb +13 -0
- data/lib/erp_orders/extensions/active_record/acts_as_order_txn.rb +111 -0
- data/lib/erp_orders/extensions.rb +1 -0
- data/lib/erp_orders/version.rb +3 -0
- data/lib/erp_orders.rb +5 -0
- data/lib/tasks/erp_orders_tasks.rake +4 -0
- data/public/javascripts/erp_app/desktop/applications/order_manager/line_items_grid_panel.js +100 -0
- data/public/javascripts/erp_app/desktop/applications/order_manager/module.js +85 -0
- data/public/javascripts/erp_app/desktop/applications/order_manager/orders_grid_panel.js +163 -0
- data/public/javascripts/erp_app/desktop/applications/order_manager/payments_grid_panel.js +109 -0
- data/public/javascripts/erp_app/organizer/applications/order_management/base.js +127 -0
- data/public/javascripts/erp_app/organizer/applications/order_management/extensions.js +115 -0
- data/public/javascripts/erp_app/organizer/applications/order_management/line_items_grid_panel.js +99 -0
- data/public/javascripts/erp_app/organizer/applications/order_management/orders_grid_panel.js +205 -0
- data/public/javascripts/erp_app/organizer/applications/order_management/payments_grid_panel.js +93 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config/application.rb +49 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +8 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/spec.rb +27 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +12 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/models/charge_line_payment_txn_spec.rb +11 -0
- data/spec/models/charge_line_spec.rb +11 -0
- data/spec/models/line_item_role_type_spec.rb +11 -0
- data/spec/models/order_line_item_pty_role_spec.rb +13 -0
- data/spec/models/order_line_item_spec.rb +12 -0
- data/spec/models/order_line_item_type_spec.rb +14 -0
- data/spec/models/order_txn_spec.rb +11 -0
- data/spec/models/order_txn_type_spec.rb +11 -0
- data/spec/spec_helper.rb +60 -0
- metadata +203 -0
@@ -0,0 +1,127 @@
|
|
1
|
+
Ext.define("Compass.ErpApp.Organizer.Applications.OrderManagement.Layout",{
|
2
|
+
extend:"Ext.panel.Panel",
|
3
|
+
alias:'widget.organizer_orderslayout',
|
4
|
+
//private member orderId
|
5
|
+
orderId:null,
|
6
|
+
constructor : function(config) {
|
7
|
+
var southPanel = Ext.create("Ext.panel.Panel",{
|
8
|
+
layout:'fit',
|
9
|
+
region:'south',
|
10
|
+
height:300,
|
11
|
+
collapsible:true,
|
12
|
+
border:false,
|
13
|
+
items:[config['southComponent']]
|
14
|
+
});
|
15
|
+
|
16
|
+
var centerPanel = Ext.create("Ext.panel.Panel",{
|
17
|
+
layout:'fit',
|
18
|
+
region:'center',
|
19
|
+
autoScroll:true,
|
20
|
+
items:[config['centerComponent']]
|
21
|
+
})
|
22
|
+
|
23
|
+
config = Ext.apply({
|
24
|
+
layout:'border',
|
25
|
+
frame: false,
|
26
|
+
autoScroll:true,
|
27
|
+
region:'center',
|
28
|
+
items:[
|
29
|
+
centerPanel,
|
30
|
+
southPanel
|
31
|
+
]
|
32
|
+
|
33
|
+
}, config);
|
34
|
+
Compass.ErpApp.Organizer.Applications.OrderManagement.Layout.superclass.constructor.call(this, config);
|
35
|
+
},
|
36
|
+
|
37
|
+
/**
|
38
|
+
* set the private member orderId
|
39
|
+
* @param {Integer} orderId
|
40
|
+
*/
|
41
|
+
setOrderId : function(orderId){
|
42
|
+
this.orderId = orderId;
|
43
|
+
},
|
44
|
+
|
45
|
+
|
46
|
+
loadOrderDetails : function(orderId){
|
47
|
+
if(orderId == null){
|
48
|
+
Ext.Msg.alert('Error', 'Order must be selected.');
|
49
|
+
}
|
50
|
+
else{
|
51
|
+
this.orderId = orderId;
|
52
|
+
var tabPanel = this.query('tabpanel')[0];
|
53
|
+
|
54
|
+
var orderLineItemsGrid = tabPanel.query('organizerordermanagement_orderlineitemsgridpanel')[0];
|
55
|
+
orderLineItemsGrid.getStore().load({
|
56
|
+
params:{
|
57
|
+
order_id:this.orderId
|
58
|
+
}
|
59
|
+
});
|
60
|
+
|
61
|
+
tabPanel.setActiveTab(0);
|
62
|
+
}
|
63
|
+
},
|
64
|
+
|
65
|
+
loadRemoteData:function(){
|
66
|
+
this.orderId = null;
|
67
|
+
var ordersGridPanel = this.query('ordermanager_ordersgridpanel')[0]
|
68
|
+
ordersGridPanel.getStore().load();
|
69
|
+
}
|
70
|
+
|
71
|
+
});
|
72
|
+
|
73
|
+
Compass.ErpApp.Organizer.Applications.OrderManagement.Base = function(config){
|
74
|
+
|
75
|
+
//setup extensions
|
76
|
+
Compass.ErpApp.Organizer.Applications.OrderManagement.loadExtensions();
|
77
|
+
|
78
|
+
var treeMenuStore = Ext.create('Compass.ErpApp.Organizer.DefaultMenuTreeStore', {
|
79
|
+
url:'/erp_orders/erp_app/organizer/order_management/menu',
|
80
|
+
rootText:'Menu',
|
81
|
+
rootIconCls:'icon-content'
|
82
|
+
});
|
83
|
+
|
84
|
+
var menuTreePanel = {
|
85
|
+
xtype:'defaultmenutree',
|
86
|
+
title:'Order Management',
|
87
|
+
store:treeMenuStore
|
88
|
+
};
|
89
|
+
|
90
|
+
var southTabPanel = {
|
91
|
+
xtype:'tabpanel',
|
92
|
+
items:[{
|
93
|
+
xtype:'organizerordermanagement_orderlineitemsgridpanel',
|
94
|
+
title:'Line Items'
|
95
|
+
},{
|
96
|
+
xtype:'organizerordermanagement_paymentsgridpanel',
|
97
|
+
title:'Payments'
|
98
|
+
}]
|
99
|
+
};
|
100
|
+
|
101
|
+
var layout = {
|
102
|
+
id:'orders_layout',
|
103
|
+
xtype:'organizer_orderslayout',
|
104
|
+
centerComponent:{
|
105
|
+
id:'orders_grid',
|
106
|
+
xtype:'ordermanager_ordersgridpanel',
|
107
|
+
listeners:{
|
108
|
+
'itemclick':function(view, record, item, index, e, options){
|
109
|
+
var id = record.get("id");
|
110
|
+
var layout = view.findParentByType('organizer_orderslayout');
|
111
|
+
layout.loadOrderDetails(id);
|
112
|
+
}
|
113
|
+
}
|
114
|
+
},
|
115
|
+
southComponent:southTabPanel
|
116
|
+
};
|
117
|
+
|
118
|
+
this.setup = function(){
|
119
|
+
config['organizerLayout'].addApplication(menuTreePanel,[layout]);
|
120
|
+
};
|
121
|
+
|
122
|
+
this.loadRemoteData = function(){
|
123
|
+
|
124
|
+
};
|
125
|
+
|
126
|
+
};
|
127
|
+
|
@@ -0,0 +1,115 @@
|
|
1
|
+
Compass.ErpApp.Organizer.Applications.OrderManagement.loadExtensions = function(){
|
2
|
+
//add orders tab to individuals tab panel
|
3
|
+
var individualsTabPanel = Ext.getCmp('individualsTabPanel');
|
4
|
+
individualsTabPanel.add({
|
5
|
+
title:'Orders',
|
6
|
+
xtype:'ordermanager_ordersgridpanel',
|
7
|
+
columns: [
|
8
|
+
{
|
9
|
+
header:'Order Number',
|
10
|
+
sortable: true,
|
11
|
+
dataIndex: 'order_number'
|
12
|
+
},
|
13
|
+
{
|
14
|
+
header:'Status',
|
15
|
+
sortable: true,
|
16
|
+
width:150,
|
17
|
+
dataIndex: 'status'
|
18
|
+
},
|
19
|
+
{
|
20
|
+
header:'Total Price',
|
21
|
+
sortable: true,
|
22
|
+
dataIndex: 'total_price'
|
23
|
+
},
|
24
|
+
{
|
25
|
+
header:'First Name',
|
26
|
+
sortable: true,
|
27
|
+
width:150,
|
28
|
+
dataIndex: 'first_name'
|
29
|
+
},
|
30
|
+
{
|
31
|
+
header:'Last Name',
|
32
|
+
sortable: true,
|
33
|
+
width:150,
|
34
|
+
dataIndex: 'last_name'
|
35
|
+
},
|
36
|
+
{
|
37
|
+
header:'Email',
|
38
|
+
sortable: true,
|
39
|
+
dataIndex: 'email'
|
40
|
+
},
|
41
|
+
{
|
42
|
+
header:'Phone',
|
43
|
+
sortable: true,
|
44
|
+
dataIndex: 'phone'
|
45
|
+
},
|
46
|
+
{
|
47
|
+
header:'Created At',
|
48
|
+
sortable: true,
|
49
|
+
dataIndex: 'created_at',
|
50
|
+
width:150,
|
51
|
+
renderer: Ext.util.Format.dateRenderer('m/d/Y H:i:s')
|
52
|
+
},
|
53
|
+
{
|
54
|
+
menuDisabled:true,
|
55
|
+
resizable:false,
|
56
|
+
xtype:'actioncolumn',
|
57
|
+
header:'Order Details',
|
58
|
+
align:'center',
|
59
|
+
width:100,
|
60
|
+
items:[{
|
61
|
+
icon:'/images/icons/about/about_16x16.png',
|
62
|
+
tooltip:'View Order Details',
|
63
|
+
handler :function(grid, rowIndex, colIndex){
|
64
|
+
var rec = grid.getStore().getAt(rowIndex);
|
65
|
+
var orderId = rec.get('id');
|
66
|
+
|
67
|
+
var ordersLayout = Ext.getCmp('orders_layout');
|
68
|
+
ordersLayout.loadOrderDetails(orderId);
|
69
|
+
var ordersGridPanel = ordersLayout.query('ordermanager_ordersgridpanel')[0];
|
70
|
+
ordersGridPanel.getStore().load({
|
71
|
+
params:{
|
72
|
+
order_id:orderId,
|
73
|
+
start:1,
|
74
|
+
limit:1
|
75
|
+
}
|
76
|
+
})
|
77
|
+
|
78
|
+
Compass.ErpApp.Organizer.Layout.setActiveCenterItem('orders_layout', false);
|
79
|
+
}
|
80
|
+
}]
|
81
|
+
},
|
82
|
+
{
|
83
|
+
menuDisabled:true,
|
84
|
+
resizable:false,
|
85
|
+
xtype:'actioncolumn',
|
86
|
+
header:'Delete',
|
87
|
+
align:'center',
|
88
|
+
width:60,
|
89
|
+
items:[{
|
90
|
+
icon:'/images/icons/delete/delete_16x16.png',
|
91
|
+
tooltip:'Delete',
|
92
|
+
handler :function(grid, rowIndex, colIndex){
|
93
|
+
var rec = grid.getStore().getAt(rowIndex);
|
94
|
+
grid.deleteOrder(rec);
|
95
|
+
}
|
96
|
+
}]
|
97
|
+
}
|
98
|
+
],
|
99
|
+
listeners:{
|
100
|
+
activate:function(grid){
|
101
|
+
var contactsLayout = grid.findParentByType('contactslayout');
|
102
|
+
if(!Compass.ErpApp.Utility.isBlank(contactsLayout.partyId)){
|
103
|
+
var store = grid.getStore();
|
104
|
+
store.proxy.extraParams.party_id = contactsLayout.partyId;
|
105
|
+
store.load({
|
106
|
+
params:{
|
107
|
+
start:0,
|
108
|
+
limit:10
|
109
|
+
}
|
110
|
+
})
|
111
|
+
}
|
112
|
+
}
|
113
|
+
}
|
114
|
+
});
|
115
|
+
};
|
data/public/javascripts/erp_app/organizer/applications/order_management/line_items_grid_panel.js
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
Ext.define("Compass.ErpApp.Organizer.Applications.OrderManagement.OrderLineItemsGridPanel",{
|
2
|
+
extend:"Ext.grid.Panel",
|
3
|
+
alias:'widget.organizerordermanagement_orderlineitemsgridpanel',
|
4
|
+
initComponent : function(){
|
5
|
+
this.bbar = Ext.create("Ext.PagingToolbar",{
|
6
|
+
pageSize: 10,
|
7
|
+
store:this.store,
|
8
|
+
displayInfo: true,
|
9
|
+
displayMsg: '{0} - {1} of {2}',
|
10
|
+
emptyMsg: "Empty"
|
11
|
+
});
|
12
|
+
|
13
|
+
Compass.ErpApp.Organizer.Applications.OrderManagement.OrderLineItemsGridPanel.superclass.initComponent.call(this, arguments);
|
14
|
+
},
|
15
|
+
|
16
|
+
constructor : function(config) {
|
17
|
+
var store = Ext.create("Ext.data.Store",{
|
18
|
+
proxy:{
|
19
|
+
type:'ajax',
|
20
|
+
url: '/erp_orders/erp_app/desktop/order_manager/line_items',
|
21
|
+
reader:{
|
22
|
+
type:'json',
|
23
|
+
root: 'lineItems'
|
24
|
+
}
|
25
|
+
},
|
26
|
+
totalProperty: 'totalCount',
|
27
|
+
extraParams:{
|
28
|
+
order_id:null
|
29
|
+
},
|
30
|
+
fields:[
|
31
|
+
'product',
|
32
|
+
'quantity',
|
33
|
+
'sku',
|
34
|
+
{
|
35
|
+
name:'price',
|
36
|
+
type:'decimal'
|
37
|
+
},
|
38
|
+
'currency_display',
|
39
|
+
'id'
|
40
|
+
]
|
41
|
+
});
|
42
|
+
|
43
|
+
config = Ext.apply({
|
44
|
+
layout:'fit',
|
45
|
+
columns: [
|
46
|
+
{
|
47
|
+
header:'Product',
|
48
|
+
sortable: true,
|
49
|
+
dataIndex: 'product'
|
50
|
+
},
|
51
|
+
{
|
52
|
+
header:'SKU',
|
53
|
+
sortable: true,
|
54
|
+
dataIndex: 'sku'
|
55
|
+
},
|
56
|
+
{
|
57
|
+
header:'Quantity',
|
58
|
+
sortable: true,
|
59
|
+
dataIndex: 'quantity'
|
60
|
+
},
|
61
|
+
{
|
62
|
+
header:'Price',
|
63
|
+
sortable: true,
|
64
|
+
dataIndex: 'price',
|
65
|
+
renderer:function(v){
|
66
|
+
return v.toFixed(2);
|
67
|
+
}
|
68
|
+
|
69
|
+
},
|
70
|
+
{
|
71
|
+
header: 'Currency',
|
72
|
+
width: 75,
|
73
|
+
sortable: true,
|
74
|
+
dataIndex: 'currency_display'
|
75
|
+
|
76
|
+
}
|
77
|
+
],
|
78
|
+
loadMask: true,
|
79
|
+
autoScroll:true,
|
80
|
+
stripeRows: true,
|
81
|
+
store:store,
|
82
|
+
viewConfig:{
|
83
|
+
forceFit:true
|
84
|
+
},
|
85
|
+
listeners:{
|
86
|
+
activate:function(grid){
|
87
|
+
var layout = grid.findParentByType('organizer_orderslayout');
|
88
|
+
if(!Compass.ErpApp.Utility.isBlank(layout.orderId)){
|
89
|
+
var store = grid.getStore();
|
90
|
+
store.proxy.extraParams.order_id = layout.orderId;
|
91
|
+
store.load();
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}, config);
|
96
|
+
|
97
|
+
Compass.ErpApp.Organizer.Applications.OrderManagement.OrderLineItemsGridPanel.superclass.constructor.call(this, config);
|
98
|
+
}
|
99
|
+
});
|
@@ -0,0 +1,205 @@
|
|
1
|
+
Ext.define("Compass.ErpApp.Organizer.Applications.OrderManagement.OrdersGridPanel",{
|
2
|
+
extend:"Ext.grid.Panel",
|
3
|
+
alias:'widget.ordermanager_ordersgridpanel',
|
4
|
+
deleteOrder : function(rec){
|
5
|
+
var self = this;
|
6
|
+
Ext.MessageBox.confirm('Confirm', 'Are you sure you want to delete this order?', function(btn){
|
7
|
+
if(btn == 'no'){
|
8
|
+
return false;
|
9
|
+
}
|
10
|
+
else
|
11
|
+
{
|
12
|
+
var conn = new Ext.data.Connection();
|
13
|
+
conn.request({
|
14
|
+
url: '/erp_orders/erp_app/desktop/order_manager/delete/'+rec.get('id'),
|
15
|
+
success: function(response) {
|
16
|
+
var obj = Ext.util.JSON.decode(response.responseText);
|
17
|
+
if(obj.success){
|
18
|
+
self.getStore().load();
|
19
|
+
}
|
20
|
+
else{
|
21
|
+
Ext.Msg.alert('Error', 'Error deleting order.');
|
22
|
+
}
|
23
|
+
},
|
24
|
+
failure: function(response) {
|
25
|
+
Ext.Msg.alert('Error', 'Error deleting order.');
|
26
|
+
}
|
27
|
+
});
|
28
|
+
}
|
29
|
+
});
|
30
|
+
},
|
31
|
+
|
32
|
+
initComponent : function(){
|
33
|
+
this.bbar = Ext.create("Ext.PagingToolbar",{
|
34
|
+
pageSize: this.initialConfig['pageSize'] || 50,
|
35
|
+
store:this.store,
|
36
|
+
displayInfo: true,
|
37
|
+
displayMsg: '{0} - {1} of {2}',
|
38
|
+
emptyMsg: "Empty"
|
39
|
+
});
|
40
|
+
|
41
|
+
Compass.ErpApp.Organizer.Applications.OrderManagement.OrdersGridPanel.superclass.initComponent.call(this, arguments);
|
42
|
+
},
|
43
|
+
|
44
|
+
constructor : function(config) {
|
45
|
+
var store = Ext.create("Ext.data.Store",{
|
46
|
+
proxy:{
|
47
|
+
type:'ajax',
|
48
|
+
url: '/erp_orders/erp_app/desktop/order_manager',
|
49
|
+
reader:{
|
50
|
+
type:'json',
|
51
|
+
root: 'orders'
|
52
|
+
}
|
53
|
+
},
|
54
|
+
totalProperty: 'totalCount',
|
55
|
+
idProperty: 'id',
|
56
|
+
fields:[
|
57
|
+
'total_price',
|
58
|
+
'order_number',
|
59
|
+
'status',
|
60
|
+
'first_name',
|
61
|
+
'last_name',
|
62
|
+
'email',
|
63
|
+
'phone',
|
64
|
+
'id',
|
65
|
+
'created_at',
|
66
|
+
'payor_party_id'
|
67
|
+
]
|
68
|
+
});
|
69
|
+
|
70
|
+
config = Ext.apply({
|
71
|
+
columns: [
|
72
|
+
{
|
73
|
+
header:'Order Number',
|
74
|
+
sortable: true,
|
75
|
+
dataIndex: 'order_number'
|
76
|
+
},
|
77
|
+
{
|
78
|
+
header:'Status',
|
79
|
+
sortable: true,
|
80
|
+
width:150,
|
81
|
+
dataIndex: 'status'
|
82
|
+
},
|
83
|
+
{
|
84
|
+
header:'Total Price',
|
85
|
+
sortable: true,
|
86
|
+
dataIndex: 'total_price'
|
87
|
+
},
|
88
|
+
{
|
89
|
+
header:'First Name',
|
90
|
+
sortable: true,
|
91
|
+
width:150,
|
92
|
+
dataIndex: 'first_name'
|
93
|
+
},
|
94
|
+
{
|
95
|
+
header:'Last Name',
|
96
|
+
sortable: true,
|
97
|
+
width:150,
|
98
|
+
dataIndex: 'last_name'
|
99
|
+
},
|
100
|
+
{
|
101
|
+
header:'Email',
|
102
|
+
sortable: true,
|
103
|
+
dataIndex: 'email'
|
104
|
+
},
|
105
|
+
{
|
106
|
+
header:'Phone',
|
107
|
+
sortable: true,
|
108
|
+
dataIndex: 'phone'
|
109
|
+
},
|
110
|
+
{
|
111
|
+
header:'Created At',
|
112
|
+
sortable: true,
|
113
|
+
dataIndex: 'created_at',
|
114
|
+
width:150,
|
115
|
+
renderer: Ext.util.Format.dateRenderer('m/d/Y H:i:s')
|
116
|
+
},
|
117
|
+
{
|
118
|
+
menuDisabled:true,
|
119
|
+
resizable:false,
|
120
|
+
xtype:'actioncolumn',
|
121
|
+
header:'Payor Info',
|
122
|
+
align:'center',
|
123
|
+
width:100,
|
124
|
+
items:[{
|
125
|
+
icon:'/images/icons/about/about_16x16.png',
|
126
|
+
tooltip:'View Payor Info',
|
127
|
+
handler :function(grid, rowIndex, colIndex){
|
128
|
+
var rec = grid.getStore().getAt(rowIndex);
|
129
|
+
var payorPartyId = rec.get('payor_party_id');
|
130
|
+
|
131
|
+
if(Compass.ErpApp.Utility.isBlank(payorPartyId)){
|
132
|
+
Ext.Msg.alert('Status', 'No Buyer data has been collected yet.')
|
133
|
+
return false;
|
134
|
+
}
|
135
|
+
|
136
|
+
var individualsGrid = Ext.getCmp('individualSearchGrid');
|
137
|
+
|
138
|
+
var index = individualsGrid.getStore().find("id", payorPartyId);
|
139
|
+
var record = individualsGrid.getStore().getAt(index);
|
140
|
+
individualsGrid.getSelectionModel().select([record], false);
|
141
|
+
Compass.ErpApp.Organizer.Layout.setActiveCenterItem('individuals_search_grid');
|
142
|
+
var individualsTabPanel = Ext.getCmp('individualsTabPanel');
|
143
|
+
var ordersGridPanel = individualsTabPanel.query('ordermanager_ordersgridpanel')[0];
|
144
|
+
individualsTabPanel.setActiveTab(ordersGridPanel.id);
|
145
|
+
}
|
146
|
+
}]
|
147
|
+
},
|
148
|
+
{
|
149
|
+
menuDisabled:true,
|
150
|
+
resizable:false,
|
151
|
+
xtype:'actioncolumn',
|
152
|
+
header:'Delete',
|
153
|
+
align:'center',
|
154
|
+
width:60,
|
155
|
+
items:[{
|
156
|
+
icon:'/images/icons/delete/delete_16x16.png',
|
157
|
+
tooltip:'Delete',
|
158
|
+
handler :function(grid, rowIndex, colIndex){
|
159
|
+
var rec = grid.getStore().getAt(rowIndex);
|
160
|
+
grid.deleteOrder(rec);
|
161
|
+
}
|
162
|
+
}]
|
163
|
+
}
|
164
|
+
],
|
165
|
+
loadMask: true,
|
166
|
+
autoScroll:true,
|
167
|
+
stripeRows: true,
|
168
|
+
store:store,
|
169
|
+
tbar:{
|
170
|
+
items:[
|
171
|
+
{
|
172
|
+
xtype:'numberfield',
|
173
|
+
hideLabel:true,
|
174
|
+
emptyText:'Order Number'
|
175
|
+
},
|
176
|
+
{
|
177
|
+
text:'Search',
|
178
|
+
iconCls:'icon-search',
|
179
|
+
handler:function(btn){
|
180
|
+
var orderNumber = btn.findParentByType('toolbar').query('numberfield')[0].getValue();
|
181
|
+
var store = btn.findParentByType('ordermanager_ordersgridpanel').getStore();
|
182
|
+
store.load({
|
183
|
+
params:{
|
184
|
+
order_number:orderNumber
|
185
|
+
}
|
186
|
+
});
|
187
|
+
}
|
188
|
+
},
|
189
|
+
'|',
|
190
|
+
{
|
191
|
+
text: 'All',
|
192
|
+
xtype:'button',
|
193
|
+
iconCls: 'icon-eye',
|
194
|
+
handler: function(btn) {
|
195
|
+
btn.findParentByType('ordermanager_ordersgridpanel').store.proxy.extraParams.order_number = null;
|
196
|
+
btn.findParentByType('ordermanager_ordersgridpanel').store.load();
|
197
|
+
}
|
198
|
+
},
|
199
|
+
]
|
200
|
+
}
|
201
|
+
}, config);
|
202
|
+
|
203
|
+
Compass.ErpApp.Organizer.Applications.OrderManagement.OrdersGridPanel.superclass.constructor.call(this, config);
|
204
|
+
}
|
205
|
+
});
|
data/public/javascripts/erp_app/organizer/applications/order_management/payments_grid_panel.js
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
Ext.define("Compass.ErpApp.Organizer.Applications.OrderManagement.PaymentsGridPanel",{
|
2
|
+
extend:"Ext.grid.Panel",
|
3
|
+
alias:'widget.organizerordermanagement_paymentsgridpanel',
|
4
|
+
constructor : function(config) {
|
5
|
+
var store = Ext.create("Ext.data.Store",{
|
6
|
+
proxy:{
|
7
|
+
type:'ajax',
|
8
|
+
url: '/erp_orders/erp_app/desktop/order_manager/payments',
|
9
|
+
reader:{
|
10
|
+
type:'json',
|
11
|
+
root: 'payments'
|
12
|
+
}
|
13
|
+
},
|
14
|
+
extraParam:{
|
15
|
+
order_id:null
|
16
|
+
},
|
17
|
+
fields:[
|
18
|
+
'authorization',
|
19
|
+
'status',
|
20
|
+
'created_at',
|
21
|
+
{
|
22
|
+
name:'amount',
|
23
|
+
type:'decimal'
|
24
|
+
},
|
25
|
+
'currency_display',
|
26
|
+
'id',
|
27
|
+
'success'
|
28
|
+
]
|
29
|
+
});
|
30
|
+
|
31
|
+
config = Ext.apply({
|
32
|
+
layout:'fit',
|
33
|
+
columns: [
|
34
|
+
{
|
35
|
+
header:'Authorization Number',
|
36
|
+
sortable: true,
|
37
|
+
dataIndex: 'authorization'
|
38
|
+
},
|
39
|
+
{
|
40
|
+
header:'Status',
|
41
|
+
sortable: true,
|
42
|
+
dataIndex: 'status'
|
43
|
+
},
|
44
|
+
{
|
45
|
+
header:'Successful',
|
46
|
+
sortable: true,
|
47
|
+
dataIndex: 'success'
|
48
|
+
},
|
49
|
+
{
|
50
|
+
header:'Amount',
|
51
|
+
sortable: true,
|
52
|
+
dataIndex: 'amount',
|
53
|
+
renderer:function(v){
|
54
|
+
return v.toFixed(2);
|
55
|
+
}
|
56
|
+
|
57
|
+
},
|
58
|
+
{
|
59
|
+
header: 'Currency',
|
60
|
+
width: 75,
|
61
|
+
sortable: true,
|
62
|
+
dataIndex: 'currency_display'
|
63
|
+
|
64
|
+
},
|
65
|
+
{
|
66
|
+
header: 'Created At',
|
67
|
+
sortable: true,
|
68
|
+
dataIndex: 'created_at',
|
69
|
+
renderer: Ext.util.Format.dateRenderer('m/d/Y H:i:s')
|
70
|
+
}
|
71
|
+
],
|
72
|
+
loadMask: true,
|
73
|
+
autoScroll:true,
|
74
|
+
stripeRows: true,
|
75
|
+
store:store,
|
76
|
+
viewConfig:{
|
77
|
+
forceFit:true
|
78
|
+
},
|
79
|
+
listeners:{
|
80
|
+
activate:function(grid){
|
81
|
+
var layout = grid.findParentByType('organizer_orderslayout');
|
82
|
+
if(!Compass.ErpApp.Utility.isBlank(layout.orderId)){
|
83
|
+
var store = grid.getStore();
|
84
|
+
store.proxy.extraParams.order_id = layout.orderId;
|
85
|
+
store.load();
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}, config);
|
90
|
+
|
91
|
+
Compass.ErpApp.Organizer.Applications.OrderManagement.PaymentsGridPanel.superclass.constructor.call(this, config);
|
92
|
+
}
|
93
|
+
});
|
data/spec/dummy/Rakefile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
3
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
4
|
+
|
5
|
+
require File.expand_path('../config/application', __FILE__)
|
6
|
+
|
7
|
+
Dummy::Application.load_tasks
|
@@ -0,0 +1,9 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
+
// be included in the compiled file accessible from http://example.com/assets/application.js
|
4
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
|
+
// the compiled file.
|
6
|
+
//
|
7
|
+
//= require jquery
|
8
|
+
//= require jquery_ujs
|
9
|
+
//= require_tree .
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
3
|
+
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
|
+
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
|
+
*= require_self
|
6
|
+
*= require_tree .
|
7
|
+
*/
|