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');
114 url : baseURL + '/Roo/terms.php',
123 xtype : 'JsonReader',
131 'name': 'terms_code',
135 'name': 'terms_descrip',
139 totalProperty : 'total'
144 sortInfo : { field : 'crdate', direction: 'ASC' },
147 beforeload : function (_self, o)
149 o.params = o.params || {};
151 var s = _this.searchBox.getValue();
154 o.params['search[name]'] = s;
168 xtype : 'PagingToolbar',
169 emptyMsg : "No terms found",
172 displayMsg : "Displaying Terms{0} - {1} of {2}"
175 autoExpandColumn : 'terms_descrip',
182 xtype : 'ColumnModel',
185 renderer : function(v) { return String.format('{0}', v ? v : ''); },
188 dataIndex : 'terms_id'
192 xtype : 'ColumnModel',
195 renderer : function(v) { return String.format('{0}', v ? v : ''); },
198 dataIndex : 'terms_code'
202 xtype : 'ColumnModel',
203 header : 'Description',
205 renderer : function(v) { return String.format('{0}', v ? v : ''); },
208 dataIndex : 'terms_descrip'
212 xtype : 'ColumnModel',
215 renderer : function(v) {
216 var t = (v == 'D') ? 'Days' : 'Proximo';
218 return String.format('{0}', t);
222 dataIndex : 'terms_type'
226 xtype : 'ColumnModel',
229 renderer : function(v) { return String.format('{0}', v ? v : ''); },
232 dataIndex : 'terms_duedays'
236 xtype : 'ColumnModel',
238 header : 'Discount Days',
239 renderer : function(v) { return String.format('{0}', v ? v : ''); },
242 dataIndex : 'terms_discdays'
246 xtype : 'ColumnModel',
248 header : 'Cut Off Days',
249 renderer : function(v) { return String.format('{0}', v ? v : ''); },
252 dataIndex : 'terms_cutoffday'
256 xtype : 'ColumnModel',
258 header : 'Used in Payables',
259 renderer : function(v) {
260 var state = v ? '-checked' : '';
262 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
267 dataIndex : 'terms_ap'
271 xtype : 'ColumnModel',
272 header : 'Used in Receivables',
274 renderer : function(v) {
275 var state = v ? '-checked' : '';
277 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
282 dataIndex : 'terms_ar'
286 rowdblclick : function (_self, rowIndex, e)
288 var id = this.getDataSource().getAt(rowIndex).data.terms_id * 1;
291 Roo.MessageBox.alert('Error', 'Please select a row');
295 Pman.Dialog.XtupleTerms.show( {id : id}, function() {
296 _this.grid.footer.onClick('refresh');
303 if (_this.panel.active) {
304 this.footer.onClick('first');
323 activate : function() {
326 _this.grid.footer.onClick('first');
342 xtype : 'NestedLayoutPanel',