1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Tab');
7 Pman.Tab.XtupleTerms = new Roo.XComponent({
8 part : ["Xtuple", "Terms" ],
9 order : '700-Pman.Tab.XtupleTerms',
11 parent : 'Pman.Tab.XtupleAccountsTab',
12 name : "unnamed module",
23 xtype : 'LayoutRegion',
27 xtype : 'BorderLayout',
35 xtype : 'RowSelectionModel',
48 specialkey : function (_self, e)
50 _this.grid.footer.onClick('first');
52 render : function (_self)
54 _this.searchBox = _self;
59 '|xns' : 'Roo.Toolbar',
62 icon : rootURL + '/Pman/templates/images/search.gif',
65 click : function (_self, e)
67 _this.grid.footer.onClick('first');
72 '|xns' : 'Roo.Toolbar',
75 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
78 click : function (_self, e)
80 _this.searchBox.setValue('');
\r
82 _this.grid.footer.onClick('first');
\r
87 '|xns' : 'Roo.Toolbar',
92 '|xns' : 'Roo.Toolbar',
95 cls : 'x-btn-text-icon',
96 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
102 Pman.Dialog.XtupleTerms.show( { id : 0 } , function() {
103 _this.grid.footer.onClick('first');
109 '|xns' : 'Roo.Toolbar',
114 '|xns' : 'Roo.Toolbar',
117 cls : 'x-btn-text-icon',
118 icon : rootURL + '/Pman/templates/images/trash.gif',
123 var sel = _this.grid.getSelectionModel().getSelected();
125 if(!sel || sel.data.terms_id * 1 < 1){
126 Roo.MessageBox.alert("Error", "Please select a terms");
130 Roo.MessageBox.confirm("Confirm", "Are you sure you want to delete the terms?",
136 url : baseURL + '/Roo/terms.php',
139 _delete : sel.data.terms_id * 1
141 success : function(res) {
142 _this.grid.footer.onClick('first');
159 url : baseURL + '/Roo/terms.php',
168 xtype : 'JsonReader',
176 'name': 'terms_code',
180 'name': 'terms_descrip',
184 totalProperty : 'total'
189 sortInfo : { field : 'terms_id', direction: 'ASC' },
192 beforeload : function (_self, o)
194 o.params = o.params || {};
196 var s = _this.searchBox.getValue();
199 o.params['search[name]'] = s;
213 xtype : 'PagingToolbar',
214 emptyMsg : "No terms found",
217 displayMsg : "Displaying Terms{0} - {1} of {2}"
220 autoExpandColumn : 'terms_descrip',
227 xtype : 'ColumnModel',
230 renderer : function(v) { return String.format('{0}', v ? v : ''); },
233 dataIndex : 'terms_id'
237 xtype : 'ColumnModel',
240 renderer : function(v) { return String.format('{0}', v ? v : ''); },
243 dataIndex : 'terms_code'
247 xtype : 'ColumnModel',
249 header : 'Description',
250 renderer : function(v) { return String.format('{0}', v ? v : ''); },
253 dataIndex : 'terms_descrip'
257 xtype : 'ColumnModel',
260 renderer : function(v) {
261 var t = (v == 'D') ? 'Days' : 'Proximo';
263 return String.format('{0}', t);
267 dataIndex : 'terms_type'
271 xtype : 'ColumnModel',
274 renderer : function(v) {
275 return String.format('{0}', v);
280 dataIndex : 'terms_duedays'
284 xtype : 'ColumnModel',
285 header : 'Discount Days',
287 renderer : function(v) {
288 return String.format('{0}', v);
293 dataIndex : 'terms_discdays'
297 xtype : 'ColumnModel',
298 header : 'Cut Off Days',
300 renderer : function(v) {
301 return String.format('{0}', v);
306 dataIndex : 'terms_cutoffday'
310 xtype : 'ColumnModel',
311 header : 'Used in Payables',
313 renderer : function(v) {
314 var state = v ? '-checked' : '';
316 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
321 dataIndex : 'terms_ap'
325 xtype : 'ColumnModel',
327 header : 'Used in Receivables',
328 renderer : function(v) {
329 var state = v ? '-checked' : '';
331 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
336 dataIndex : 'terms_ar'
340 rowdblclick : function (_self, rowIndex, e)
342 var id = this.getDataSource().getAt(rowIndex).data.terms_id * 1;
345 Roo.MessageBox.alert('Error', 'Please select a row');
349 Pman.Dialog.XtupleTerms.show( {id : id}, function() {
350 _this.grid.footer.onClick('refresh');
357 if (_this.panel.active) {
358 this.footer.onClick('first');
377 activate : function() {
380 _this.grid.footer.onClick('first');
396 xtype : 'NestedLayoutPanel',