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',
112 cls : 'x-btn-text-icon',
113 icon : rootURL + '/Pman/templates/images/trash.gif',
118 Pman.genericDelete(_this, 'ipshead');
128 url : baseURL + '/Roo/terms.php',
137 xtype : 'JsonReader',
145 'name': 'terms_code',
149 'name': 'terms_descrip',
153 totalProperty : 'total'
158 sortInfo : { field : 'terms_id', direction: 'ASC' },
161 beforeload : function (_self, o)
163 o.params = o.params || {};
165 var s = _this.searchBox.getValue();
168 o.params['search[name]'] = s;
182 xtype : 'PagingToolbar',
183 emptyMsg : "No terms found",
186 displayMsg : "Displaying Terms{0} - {1} of {2}"
189 autoExpandColumn : 'terms_descrip',
196 xtype : 'ColumnModel',
199 renderer : function(v) { return String.format('{0}', v ? v : ''); },
202 dataIndex : 'terms_id'
206 xtype : 'ColumnModel',
209 renderer : function(v) { return String.format('{0}', v ? v : ''); },
212 dataIndex : 'terms_code'
216 xtype : 'ColumnModel',
218 header : 'Description',
219 renderer : function(v) { return String.format('{0}', v ? v : ''); },
222 dataIndex : 'terms_descrip'
226 xtype : 'ColumnModel',
229 renderer : function(v) {
230 var t = (v == 'D') ? 'Days' : 'Proximo';
232 return String.format('{0}', t);
236 dataIndex : 'terms_type'
240 xtype : 'ColumnModel',
243 renderer : function(v) {
244 return String.format('{0}', v);
249 dataIndex : 'terms_duedays'
253 xtype : 'ColumnModel',
254 header : 'Discount Days',
256 renderer : function(v) {
257 return String.format('{0}', v);
262 dataIndex : 'terms_discdays'
266 xtype : 'ColumnModel',
267 header : 'Cut Off Days',
269 renderer : function(v) {
270 return String.format('{0}', v);
275 dataIndex : 'terms_cutoffday'
279 xtype : 'ColumnModel',
280 header : 'Used in Payables',
282 renderer : function(v) {
283 var state = v ? '-checked' : '';
285 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
290 dataIndex : 'terms_ap'
294 xtype : 'ColumnModel',
296 header : 'Used in Receivables',
297 renderer : function(v) {
298 var state = v ? '-checked' : '';
300 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
305 dataIndex : 'terms_ar'
309 rowdblclick : function (_self, rowIndex, e)
311 var id = this.getDataSource().getAt(rowIndex).data.terms_id * 1;
314 Roo.MessageBox.alert('Error', 'Please select a row');
318 Pman.Dialog.XtupleTerms.show( {id : id}, function() {
319 _this.grid.footer.onClick('refresh');
326 if (_this.panel.active) {
327 this.footer.onClick('first');
346 activate : function() {
349 _this.grid.footer.onClick('first');
365 xtype : 'NestedLayoutPanel',