erp_commerce 3.1.0 → 3.1.1
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:'float'
|
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.1.
|
4
|
+
version: 3.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-02-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aasm
|
@@ -151,6 +151,7 @@ files:
|
|
151
151
|
- lib/erp_commerce/version.rb
|
152
152
|
- lib/erp_commerce.rb
|
153
153
|
- lib/tasks/erp_commerce_tasks.rake
|
154
|
+
- public/javascripts/extensions/compass_ae/erp_app/desktop/applications/product_manager/product_pricing_panel.js
|
154
155
|
- GPL-3-LICENSE
|
155
156
|
- Rakefile
|
156
157
|
- README.md
|
@@ -256,18 +257,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
256
257
|
- - ! '>='
|
257
258
|
- !ruby/object:Gem::Version
|
258
259
|
version: '0'
|
259
|
-
segments:
|
260
|
-
- 0
|
261
|
-
hash: -2772235375728567952
|
262
260
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
263
261
|
none: false
|
264
262
|
requirements:
|
265
263
|
- - ! '>='
|
266
264
|
- !ruby/object:Gem::Version
|
267
265
|
version: '0'
|
268
|
-
segments:
|
269
|
-
- 0
|
270
|
-
hash: -2772235375728567952
|
271
266
|
requirements: []
|
272
267
|
rubyforge_project:
|
273
268
|
rubygems_version: 1.8.24
|