2 "name" : "Pman.Tab.XtupleTerms",
3 "parent" : "Pman.Tab.XtupleAccountsTab",
5 "path" : "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleTerms.bjs",
13 "xtype" : "NestedLayoutPanel",
17 "xtype" : "BorderLayout",
22 "xtype" : "LayoutRegion",
28 "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
34 "xtype" : "GridPanel",
35 "fitContainer" : true,
37 "tableName" : "terms",
41 "rowdblclick" : "function (_self, rowIndex, e)\n{\n var id = this.getDataSource().getAt(rowIndex).data.terms_id * 1;\n\n if(id < 1){\n Roo.MessageBox.alert('Error', 'Please select a row');\n return;\n }\n \n Pman.Dialog.XtupleTerms.show( {id : id}, function() {\n _this.grid.footer.onClick('refresh');\n }); \n}\n",
42 "|render" : "function() \n{\n _this.grid = this; \n \n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}"
44 "autoExpandColumn" : "terms_descrip",
51 "Boolean singleSelect" : true,
52 "xtype" : "RowSelectionModel",
63 "specialkey" : "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}",
64 "render" : "function (_self)\n{\n _this.searchBox = _self;\n}"
66 "xtype" : "TextField",
71 "click" : "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}"
75 "$ icon" : "rootURL + '/Pman/templates/images/search.gif'",
76 "$ xns" : "Roo.Toolbar"
80 "click" : "function (_self, e)\n{\n _this.searchBox.setValue('');\r\n\r\n _this.grid.footer.onClick('first');\r\n}"
84 "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'",
85 "$ xns" : "Roo.Toolbar"
89 "$ xns" : "Roo.Toolbar"
93 "|click" : "function()\n{\n\n Pman.Dialog.XtupleTerms.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
97 "cls" : "x-btn-text-icon",
98 "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
99 "$ xns" : "Roo.Toolbar"
102 "xtype" : "Separator",
103 "$ xns" : "Roo.Toolbar"
107 "|click" : "function()\n{\n var sel = _this.grid.getSelectionModel().getSelected();\n\n if(!sel || sel.data.terms_id * 1 < 1){\n Roo.MessageBox.alert(\"Error\", \"Please select a terms\");\n return;\n }\n \n Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to delete the terms?\",\n function(r) {\n if (r != 'yes') {\n return;\n }\n new Pman.Request({\n url : baseURL + '/Roo/terms.php',\n method : 'POST',\n params : {\n _delete : sel.data.terms_id * 1\n }, \n success : function(res) {\n _this.grid.footer.onClick('first');\n }\n }); \n \n return;\n }\n );\n \n}\n "
111 "cls" : "x-btn-text-icon",
112 "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
113 "$ xns" : "Roo.Toolbar"
119 "beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n \n var s = _this.searchBox.getValue();\n \n if(s.length){\n o.params['search[name]'] = s;\n }\n \n \n}"
123 "$ sortInfo" : "{ field : 'terms_id', direction: 'ASC' }",
124 "$ xns" : "Roo.data",
125 "* prop" : "dataSource",
128 "$ url" : "baseURL + '/Roo/terms.php'",
130 "xtype" : "HttpProxy",
131 "$ xns" : "Roo.data",
137 "xtype" : "JsonReader",
138 "$ xns" : "Roo.data",
139 "$ fields" : "[\n {\n 'name': 'terms_id',\n 'type': 'int'\n },\n {\n 'name': 'terms_code',\n 'type': 'string'\n },\n {\n 'name': 'terms_descrip',\n 'type': 'string',\n }\n]",
141 "totalProperty" : "total"
147 "xtype" : "PagingToolbar",
148 "emptyMsg" : "No terms found",
150 "displayInfo" : true,
151 "displayMsg" : "Displaying Terms{0} - {1} of {2}",
155 "xtype" : "ColumnModel",
158 "$ renderer" : "function(v) { return String.format('{0}', v ? v : ''); }",
159 "$ xns" : "Roo.grid",
160 "Boolean sortable" : true,
162 "dataIndex" : "terms_id"
165 "xtype" : "ColumnModel",
168 "$ renderer" : "function(v) { return String.format('{0}', v ? v : ''); }",
169 "$ xns" : "Roo.grid",
170 "Boolean sortable" : true,
172 "dataIndex" : "terms_code"
175 "xtype" : "ColumnModel",
177 "header" : "Description",
178 "$ renderer" : "function(v) { return String.format('{0}', v ? v : ''); }",
179 "$ xns" : "Roo.grid",
180 "Boolean sortable" : true,
182 "dataIndex" : "terms_descrip"
185 "xtype" : "ColumnModel",
188 "$ renderer" : "function(v) { \n var t = (v == 'D') ? 'Days' : 'Proximo';\n \n return String.format('{0}', t); \n}",
189 "$ xns" : "Roo.grid",
190 "Boolean sortable" : true,
192 "dataIndex" : "terms_type"
195 "xtype" : "ColumnModel",
196 "header" : "Due Days",
198 "$ renderer" : "function(v) { \n return String.format('{0}', v); \n \n}",
199 "$ xns" : "Roo.grid",
200 "Boolean sortable" : true,
202 "dataIndex" : "terms_duedays"
205 "xtype" : "ColumnModel",
206 "header" : "Discount Days",
208 "$ renderer" : "function(v) { \n return String.format('{0}', v); \n \n}",
209 "$ xns" : "Roo.grid",
210 "Boolean sortable" : true,
212 "dataIndex" : "terms_discdays"
215 "xtype" : "ColumnModel",
216 "header" : "Cut Off Days",
218 "$ renderer" : "function(v) { \n return String.format('{0}', v); \n \n}",
219 "$ xns" : "Roo.grid",
220 "Boolean sortable" : true,
222 "dataIndex" : "terms_cutoffday"
225 "xtype" : "ColumnModel",
226 "header" : "Used in Payables",
228 "$ renderer" : "function(v) { \n var state = v ? '-checked' : '';\n\n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n \n }",
229 "$ xns" : "Roo.grid",
230 "Boolean sortable" : true,
232 "dataIndex" : "terms_ap"
235 "xtype" : "ColumnModel",
237 "header" : "Used in Receivables",
238 "$ renderer" : "function(v) { \n var state = v ? '-checked' : '';\n\n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n \n }",
239 "$ xns" : "Roo.grid",
240 "Boolean sortable" : true,
242 "dataIndex" : "terms_ar"