1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Tab.XtuplePriceLists = new Roo.XComponent({
6 part : ["Xtuple","PriceLists"],
7 order : '001-Pman.Tab.XtuplePriceLists',
9 parent : 'Pman.Tab.XtupleManage',
10 name : "Pman.Tab.XtuplePriceLists",
18 xtype: 'NestedLayoutPanel',
26 xtype: 'BorderLayout',
33 activate : function() {
36 _this.grid.footer.onClick('first');
44 tableName : 'ipshead',
45 title : "Price Lists",
53 _this.dialog = Pman.Dialog.XtuplePriceList
54 if (_this.panel.active) {
55 this.footer.onClick('first');
58 rowdblclick : function (_self, rowIndex, e)
60 if (!_this.dialog) return;
61 _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
62 _this.grid.footer.onClick('first');
67 autoExpandColumn : 'ipshead_descrip',
70 xtype: 'RowSelectionModel',
73 afterselectionchange : function (_self)
75 _this.igrid.footer.onClick('first');
84 sortInfo : { field : 'ipshead_name', direction: 'ASC' },
89 url : baseURL + '/Roo/ipshead.php'
94 totalProperty : 'total',
103 'name': 'ipshead_name',
107 'name': 'ipshead_descrip',
111 'name': 'ipshead_effective',
113 'dateFormat': 'Y-m-d'
116 'name': 'ipshead_expires',
118 'dateFormat': 'Y-m-d'
121 'name': 'ipshead_curr_id',
125 'name': 'ipshead_updated',
127 'dateFormat': 'Y-m-d'
130 'name': 'ipshead_curr_id_curr_id',
134 'name': 'ipshead_curr_id_curr_base',
138 'name': 'ipshead_curr_id_curr_name',
142 'name': 'ipshead_curr_id_curr_symbol',
146 'name': 'ipshead_curr_id_curr_abbr',
153 xtype: 'PagingToolbar',
156 displayMsg : "Displaying ipshead{0} - {1} of {2}",
157 emptyMsg : "No ipshead found",
168 click : function (_self, e)
172 url : baseURL + '/Roo/Ipsiteminfo',
179 text : "Download Price Matrix"
185 click : function (_self, e)
187 Pman.Dialog.Image.show(
189 _url : baseURL+'/Xtuple/Pricing'
195 msg.push("Deleted " + data.deleted + " Price(s)");
198 msg.push("Updated " + data.updated + " Price(s)");
201 msg.push("Added " + data.inserted + " Price(s)");
204 msg.push("No data changed");
206 Roo.MessageBox.alert("Notice", msg.join("\n"));
212 text : "Upload Price Matrix"
222 cls : 'x-btn-text-icon',
223 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
227 if (!_this.dialog) return;
228 _this.dialog.show( { id : 0 } , function() {
229 _this.grid.footer.onClick('first');
238 cls : 'x-btn-text-icon',
239 icon : rootURL + '/Pman/templates/images/trash.gif',
243 Pman.genericDelete(_this, 'ipshead');
251 xtype: 'ColumnModel',
253 dataIndex : 'ipshead_curr_id_curr_name',
254 header : 'Ipshead curr',
257 renderer : function(v) { return String.format('{0}', v); }
260 xtype: 'ColumnModel',
262 dataIndex : 'ipshead_name',
263 header : 'Ipshead name',
266 renderer : function(v) { return String.format('{0}', v); }
269 xtype: 'ColumnModel',
271 header : 'Ipshead descrip',
273 dataIndex : 'ipshead_descrip',
274 renderer : function(v) { return String.format('{0}', v); }
277 xtype: 'ColumnModel',
279 header : 'Ipshead effective',
281 dataIndex : 'ipshead_effective',
282 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
285 xtype: 'ColumnModel',
287 dataIndex : 'ipshead_expires',
288 header : 'Ipshead expires',
290 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
293 xtype: 'ColumnModel',
295 header : 'Ipshead updated',
297 dataIndex : 'ipshead_updated',
298 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
307 activate : function() {
310 // _this.igrid.footer.onClick('first');
327 //_this.dialog = Pman.Dialog.FILL_IN
328 if (_this.ipanel.active) {
329 //this.footer.onClick('first');
332 afteredit : function (e)
334 if(e.value == e.originalValue){
338 var p = _this.grid.getSelectionModel().getSelected();
340 if(!p || p.data.ipshead_id * 1 < 1){
341 Roo.MessageBox.alert('Error','Please select a price list');
346 url : baseURL +'/Roo/Item',
351 ipshead_id : p.data.ipshead_id,
352 item_id : e.record.data.item_id,
355 success : function() {
356 _this.igrid.footer.onClick('refresh');
362 beforeedit : function (e)
364 if(e.field != 'ipshead_price'){
370 autoExpandColumn : 'item_number',
377 beforeload : function (_self, o)
379 o.params = o.params || {}
381 var p = _this.grid.getSelectionModel().getSelected();
383 if(!p || p.data.ipshead_id * 1 < 1){
388 //o.params.item_active = 1;
389 o.params._ipshead_price = 1;
390 o.params._ipshead_id = p.data.ipshead_id;
395 sortInfo : { field : 'item_number', direction: 'ASC' },
400 url : baseURL + '/Roo/item.php'
407 totalProperty : 'total',
414 'name': 'item_number',
421 xtype: 'PagingToolbar',
430 xtype: 'ColumnModel',
432 dataIndex : 'item_number',
435 renderer : function(v) { return String.format('{0}', v); }
438 xtype: 'ColumnModel',
441 dataIndex : 'ipshead_price',
444 renderer : function(v) { return String.format('{0}', Roo.util.Format.number(v*1,2)); },
449 xtype: 'NumberField',
451 decimalPrecision : 2,
453 style : 'text-align:right'
462 xtype: 'LayoutRegion',
466 xtype: 'LayoutRegion',