erp_commerce 3.0.7 → 3.0.8
Sign up to get free protection for your applications and to get access to all the features.
data/lib/erp_commerce/version.rb
CHANGED
@@ -0,0 +1,329 @@
|
|
1
|
+
//
|
2
|
+
//form to manage pricing
|
3
|
+
//
|
4
|
+
|
5
|
+
Ext.define("Compass.ErpApp.Desktop.Applications.ProductManager.ProductPricingPanel",{
|
6
|
+
extend:"Ext.panel.Panel",
|
7
|
+
alias:'widget.productmanager_productpricingpanel',
|
8
|
+
updatePrice : function(rec){
|
9
|
+
this.addEditPriceBtn.setText('Update Price');
|
10
|
+
this.cancelBtn.show();
|
11
|
+
this.addPriceFormPanel.getForm().setValues(rec.data);
|
12
|
+
},
|
13
|
+
|
14
|
+
deletePrice : function(rec){
|
15
|
+
var self = this;
|
16
|
+
Ext.MessageBox.confirm('Confirm', 'Are you sure you want to delete this price?', function(btn){
|
17
|
+
if(btn == 'no'){
|
18
|
+
return false;
|
19
|
+
}
|
20
|
+
else
|
21
|
+
{
|
22
|
+
Ext.Ajax.request({
|
23
|
+
url: '/erp_products/erp_app/desktop/product_manager/delete_price/'+rec.get('pricing_plan_id'),
|
24
|
+
success: function(response) {
|
25
|
+
var obj = Ext.decode(response.responseText);
|
26
|
+
if(obj.success){
|
27
|
+
Ext.getCmp('productListPanel').loadProducts();
|
28
|
+
self.pricesGridPanel.getStore().load();
|
29
|
+
}
|
30
|
+
else{
|
31
|
+
Ext.Msg.alert('Error', 'Error deleting price.');
|
32
|
+
}
|
33
|
+
},
|
34
|
+
failure: function(response) {
|
35
|
+
Ext.Msg.alert('Error', 'Error deleting price.');
|
36
|
+
}
|
37
|
+
});
|
38
|
+
}
|
39
|
+
});
|
40
|
+
},
|
41
|
+
|
42
|
+
constructor : function(config) {
|
43
|
+
var self = this;
|
44
|
+
var productTypeId = Compass.ErpApp.Desktop.Applications.ProductManager.selectedProductTypeId;
|
45
|
+
|
46
|
+
this.pricesGridPanel = Ext.create("Ext.grid.Panel",{
|
47
|
+
layout:'fit',
|
48
|
+
region:'center',
|
49
|
+
split:true,
|
50
|
+
columns: [
|
51
|
+
{
|
52
|
+
header:'Description',
|
53
|
+
width:310,
|
54
|
+
sortable: false,
|
55
|
+
dataIndex: 'description'
|
56
|
+
},
|
57
|
+
{
|
58
|
+
header: 'Price',
|
59
|
+
width: 75,
|
60
|
+
sortable: true,
|
61
|
+
dataIndex: 'price',
|
62
|
+
renderer:function(v){
|
63
|
+
return v.toFixed(2);
|
64
|
+
}
|
65
|
+
},
|
66
|
+
{
|
67
|
+
header: 'Currency',
|
68
|
+
width: 75,
|
69
|
+
sortable: true,
|
70
|
+
dataIndex: 'currency_display'
|
71
|
+
},
|
72
|
+
{
|
73
|
+
header: 'From Date',
|
74
|
+
width: 90,
|
75
|
+
sortable: true,
|
76
|
+
dataIndex: 'from_date',
|
77
|
+
renderer: Ext.util.Format.dateRenderer('m/d/Y')
|
78
|
+
},
|
79
|
+
{
|
80
|
+
header: 'Thru Date',
|
81
|
+
width: 90,
|
82
|
+
sortable: true,
|
83
|
+
dataIndex: 'thru_date',
|
84
|
+
renderer: Ext.util.Format.dateRenderer('m/d/Y')
|
85
|
+
},
|
86
|
+
{
|
87
|
+
menuDisabled:true,
|
88
|
+
resizable:false,
|
89
|
+
xtype:'actioncolumn',
|
90
|
+
header:'Update',
|
91
|
+
align:'center',
|
92
|
+
width:60,
|
93
|
+
items:[{
|
94
|
+
icon:'/images/icons/edit/edit_16x16.png',
|
95
|
+
tooltip:'Update',
|
96
|
+
handler :function(grid, rowIndex, colIndex){
|
97
|
+
var rec = grid.getStore().getAt(rowIndex);
|
98
|
+
self.updatePrice(rec);
|
99
|
+
}
|
100
|
+
}]
|
101
|
+
},
|
102
|
+
{
|
103
|
+
menuDisabled:true,
|
104
|
+
resizable:false,
|
105
|
+
xtype:'actioncolumn',
|
106
|
+
header:'Delete',
|
107
|
+
align:'center',
|
108
|
+
width:60,
|
109
|
+
items:[{
|
110
|
+
icon:'/images/icons/delete/delete_16x16.png',
|
111
|
+
tooltip:'Delete',
|
112
|
+
handler :function(grid, rowIndex, colIndex){
|
113
|
+
var rec = grid.getStore().getAt(rowIndex);
|
114
|
+
self.deletePrice(rec);
|
115
|
+
}
|
116
|
+
}]
|
117
|
+
},
|
118
|
+
{
|
119
|
+
menuDisabled:true,
|
120
|
+
resizable:false,
|
121
|
+
xtype:'actioncolumn',
|
122
|
+
header:'Comment',
|
123
|
+
align:'center',
|
124
|
+
width:60,
|
125
|
+
items:[{
|
126
|
+
getClass: function(v, meta, rec) { // Or return a class from a function
|
127
|
+
this.items[0].tooltip = rec.get('comments');
|
128
|
+
return 'info-col';
|
129
|
+
},
|
130
|
+
handler: function(grid, rowIndex, colIndex) {
|
131
|
+
return false;
|
132
|
+
}
|
133
|
+
}]
|
134
|
+
}
|
135
|
+
],
|
136
|
+
loadMask: true,
|
137
|
+
stripeRows: true,
|
138
|
+
store: Ext.create("Ext.data.Store",{
|
139
|
+
autoLoad: true,
|
140
|
+
proxy:{
|
141
|
+
type:'ajax',
|
142
|
+
url: '/erp_products/erp_app/desktop/product_manager/prices/'+productTypeId,
|
143
|
+
reader:{
|
144
|
+
root: 'prices',
|
145
|
+
type:'json'
|
146
|
+
}
|
147
|
+
},
|
148
|
+
fields:[{
|
149
|
+
name:'price',
|
150
|
+
type:'decimal'
|
151
|
+
}, 'currency', 'currency_display', 'from_date', 'thru_date', 'description','comments','pricing_plan_id']
|
152
|
+
})
|
153
|
+
});
|
154
|
+
|
155
|
+
this.addEditPriceBtn = Ext.create("Ext.button.Button",{
|
156
|
+
scope:this,
|
157
|
+
text:'Add Price',
|
158
|
+
handler:function(btn){
|
159
|
+
var formPanel = btn.findParentByType('form');
|
160
|
+
var basicForm = formPanel.getForm();
|
161
|
+
|
162
|
+
basicForm.submit({
|
163
|
+
reset:true,
|
164
|
+
success:function(form, action){
|
165
|
+
var obj = Ext.decode(action.response.responseText);
|
166
|
+
if(obj.success){
|
167
|
+
self.addEditPriceBtn.setText('Add Price');
|
168
|
+
self.cancelBtn.hide();
|
169
|
+
Ext.getCmp('productListPanel').loadProducts();
|
170
|
+
self.pricesGridPanel.getStore().load();
|
171
|
+
}
|
172
|
+
else{
|
173
|
+
Ext.Msg.alert("Error", 'Error creating price');
|
174
|
+
}
|
175
|
+
},
|
176
|
+
failure:function(form, action){
|
177
|
+
Ext.Msg.alert("Error", 'Error creating price');
|
178
|
+
}
|
179
|
+
});
|
180
|
+
}
|
181
|
+
});
|
182
|
+
|
183
|
+
this.cancelBtn = Ext.create("Ext.button.Button",{
|
184
|
+
text:'Cancel',
|
185
|
+
hidden:true,
|
186
|
+
handler:function(btn){
|
187
|
+
var formPanel = btn.findParentByType('form');
|
188
|
+
var basicForm = formPanel.getForm();
|
189
|
+
basicForm.reset();
|
190
|
+
self.addEditPriceBtn.setText('Add Price');
|
191
|
+
self.cancelBtn.hide();
|
192
|
+
}
|
193
|
+
});
|
194
|
+
|
195
|
+
this.addPriceFormPanel = Ext.create("Ext.form.Panel",{
|
196
|
+
layout:'anchor',
|
197
|
+
collapsible:true,
|
198
|
+
split:true,
|
199
|
+
height:175,
|
200
|
+
frame:true,
|
201
|
+
region:'south',
|
202
|
+
buttonAlign:'center',
|
203
|
+
bodyStyle:'padding:5px 5px 0',
|
204
|
+
url:'/erp_products/erp_app/desktop/product_manager/new_and_update_price',
|
205
|
+
items: [
|
206
|
+
{
|
207
|
+
xtype:'textfield',
|
208
|
+
width:400,
|
209
|
+
name:'description',
|
210
|
+
fieldLabel:'Description'
|
211
|
+
},
|
212
|
+
{
|
213
|
+
layout:'column',
|
214
|
+
xtype:'container',
|
215
|
+
frame:false,
|
216
|
+
border:false,
|
217
|
+
defaults:{
|
218
|
+
columnWidth:0.25,
|
219
|
+
border:false,
|
220
|
+
frame:false,
|
221
|
+
xtype:'container',
|
222
|
+
bodyStyle:'padding:0 18px 0 0'
|
223
|
+
},
|
224
|
+
items:[{
|
225
|
+
items:[
|
226
|
+
{
|
227
|
+
fieldLabel:'Price',
|
228
|
+
xtype:'numberfield',
|
229
|
+
width:200,
|
230
|
+
layout:'anchor',
|
231
|
+
allowBlank:false,
|
232
|
+
name:'price'
|
233
|
+
}
|
234
|
+
]
|
235
|
+
},
|
236
|
+
{
|
237
|
+
items:[
|
238
|
+
{
|
239
|
+
fieldLabel:'Currency',
|
240
|
+
xtype:'combo',
|
241
|
+
width:200,
|
242
|
+
id : 'call_center_party_country',
|
243
|
+
allowBlank : false,
|
244
|
+
store :Ext.create("Ext.data.Store",{
|
245
|
+
autoLoad: true,
|
246
|
+
proxy:{
|
247
|
+
type:'ajax',
|
248
|
+
url: '/erp_products/erp_app/desktop/product_manager/currencies',
|
249
|
+
reader:{
|
250
|
+
root: 'currencies',
|
251
|
+
type:'json'
|
252
|
+
}
|
253
|
+
},
|
254
|
+
fields: [
|
255
|
+
{
|
256
|
+
name:'internal_identifier'
|
257
|
+
},
|
258
|
+
{
|
259
|
+
name:'id'
|
260
|
+
}
|
261
|
+
]
|
262
|
+
}),
|
263
|
+
hiddenName: 'currency',
|
264
|
+
hiddenField: 'currency',
|
265
|
+
valueField: 'id',
|
266
|
+
displayField: 'internal_identifier',
|
267
|
+
forceSelection : true,
|
268
|
+
triggerAction : 'all',
|
269
|
+
name:'currency'
|
270
|
+
}
|
271
|
+
]
|
272
|
+
},
|
273
|
+
{
|
274
|
+
items:[
|
275
|
+
{
|
276
|
+
fieldLabel:'From Date',
|
277
|
+
xtype:'datefield',
|
278
|
+
width:200,
|
279
|
+
allowBlank:false,
|
280
|
+
name:'from_date'
|
281
|
+
}
|
282
|
+
]
|
283
|
+
},
|
284
|
+
{
|
285
|
+
items:[
|
286
|
+
{
|
287
|
+
fieldLabel:'Thru Date',
|
288
|
+
xtype:'datefield',
|
289
|
+
width:200,
|
290
|
+
allowBlank:false,
|
291
|
+
name:'thru_date'
|
292
|
+
}
|
293
|
+
]
|
294
|
+
}]
|
295
|
+
},
|
296
|
+
{
|
297
|
+
xtype:'textarea',
|
298
|
+
height:50,
|
299
|
+
width:400,
|
300
|
+
name:'comments',
|
301
|
+
fieldLabel:'Comments'
|
302
|
+
},
|
303
|
+
{
|
304
|
+
xtype:'hidden',
|
305
|
+
name:'product_type_id',
|
306
|
+
value:productTypeId
|
307
|
+
},
|
308
|
+
{
|
309
|
+
xtype:'hidden',
|
310
|
+
name:'pricing_plan_id'
|
311
|
+
}
|
312
|
+
],
|
313
|
+
buttons:[
|
314
|
+
this.addEditPriceBtn,
|
315
|
+
this.cancelBtn
|
316
|
+
]
|
317
|
+
});
|
318
|
+
|
319
|
+
config = Ext.apply({
|
320
|
+
title:'Pricing',
|
321
|
+
layout:'border',
|
322
|
+
items:[this.pricesGridPanel,this.addPriceFormPanel]
|
323
|
+
}, config);
|
324
|
+
|
325
|
+
this.callParent([config]);
|
326
|
+
}
|
327
|
+
});
|
328
|
+
|
329
|
+
Compass.ErpApp.Desktop.Applications.ProductManager.widgets.push({xtype:'productmanager_productpricingpanel'});
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erp_commerce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,33 +9,43 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-02-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aasm
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- - =
|
19
|
+
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: 2.3.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - '='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.3.1
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: activemerchant
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
|
-
- - =
|
35
|
+
- - '='
|
31
36
|
- !ruby/object:Gem::Version
|
32
37
|
version: 1.20.4
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - '='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.20.4
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: erp_orders
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ~>
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: '3.0'
|
44
54
|
type: :runtime
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: prismpay
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ! '>='
|
@@ -54,10 +69,15 @@ dependencies:
|
|
54
69
|
version: '0'
|
55
70
|
type: :runtime
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
58
78
|
- !ruby/object:Gem::Dependency
|
59
79
|
name: erp_dev_svcs
|
60
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
61
81
|
none: false
|
62
82
|
requirements:
|
63
83
|
- - ~>
|
@@ -65,7 +85,12 @@ dependencies:
|
|
65
85
|
version: '3.0'
|
66
86
|
type: :development
|
67
87
|
prerelease: false
|
68
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '3.0'
|
69
94
|
description: The CompassAE Commerce Engine uses the engines that implement Parties,
|
70
95
|
Products and Orders, and adds the ability to conduct commerce. It implements a pricing
|
71
96
|
engine, fees, payment gateways.
|
@@ -151,6 +176,7 @@ files:
|
|
151
176
|
- lib/erp_commerce/version.rb
|
152
177
|
- lib/erp_commerce.rb
|
153
178
|
- lib/tasks/erp_commerce_tasks.rake
|
179
|
+
- public/javascripts/extensions/compass_ae/erp_app/desktop/applications/product_manager/product_pricing_panel.js
|
154
180
|
- GPL-3-LICENSE
|
155
181
|
- Rakefile
|
156
182
|
- README.md
|
@@ -217,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
243
|
version: '0'
|
218
244
|
requirements: []
|
219
245
|
rubyforge_project:
|
220
|
-
rubygems_version: 1.8.
|
246
|
+
rubygems_version: 1.8.24
|
221
247
|
signing_key:
|
222
248
|
specification_version: 3
|
223
249
|
summary: The CompassAE Commerce Engine uses the engines that implement Parties, Products
|