3 "name": "Pman.Dialog.XtupleVendorEdit",
6 "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleVendorEdit.bjs",
10 "show": "function (_self)\n{\n this.layout.getRegion('center').showPanel(0);\n}"
17 "title": "Edit / Create Vendor",
19 "xtype": "LayoutDialog",
25 "xtype": "LayoutRegion",
30 "xtype": "ContentPanel",
35 "|actioncomplete": "function(_self,action)\n{\n if (action.type == 'setdata') {\n if(_this.data.vend_id){\n _this.dialog.el.mask(\"Loading\");\n this.load({ method: 'GET', params: { '_id' : _this.data.vend_id }}); \n }\n \n return;\n }\n if (action.type == 'load') {\n _this.data = action.result.data;\n _this.form.findField('addr_view').sync();\n _this.dialog.el.unmask();\n return;\n }\n if (action.type =='submit') {\n \n _this.dialog.el.unmask();\n _this.dialog.hide();\n \n if (_this.callback) {\n _this.callback.call(_this, _this.form.getValues());\n }\n _this.form.reset();\n return;\n }\n}\n",
36 "|rendered": "function (form)\n{\n _this.form= form;\n}\n"
39 "style": "margin:10px;",
41 "|url": "baseURL + '/Roo/vendinfo.php'",
45 "legend": "Basic Details",
46 "style": "width:450px",
52 "keyup": "function (_self, e)\n{\n if (!(_this.form.findField('vend_id').getValue() * 1)) {\n \n _this.form.findField('vend_number').setValue(this.getValue().replace(/[^a-z0-9]/ig, '').toUpperCase());\n \n }\n}"
63 "fieldLabel": "Vendor #",
64 "name": "vend_number",
72 "fieldLabel": "Ship Via",
73 "name": "vend_shipvia",
81 "displayField": "curr_symbol",
83 "emptyText": "Select Currency",
84 "fieldLabel": "Currency",
85 "forceSelection": true,
86 "hiddenName": "vend_curr_id",
88 "loadingText": "Searching...",
90 "name": "vend_curr_id_curr_symbol",
92 "qtip": "Select Currency",
93 "queryParam": "query[curr_symbol]",
94 "selectOnFocus": true,
95 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{curr_symbol}</b> </div>",
96 "triggerAction": "all",
98 "valueField": "curr_id",
105 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n}\n"
110 "|sortInfo": "{ direction : 'ASC', field: 'curr_symbol' }",
115 "xtype": "HttpProxy",
118 "|url": "baseURL + '/Roo/curr_symbol.php'"
122 "xtype": "JsonReader",
126 "totalProperty": "total",
127 "|fields": "[{\"name\":\"curr_id\",\"type\":\"int\"},\"curr_symbol\"]"
136 "displayField": "terms_descrip",
138 "emptyText": "Select Terms",
139 "fieldLabel": "Terms",
140 "forceSelection": true,
141 "hiddenName": "vend_terms_id",
143 "loadingText": "Searching...",
145 "name": "vend_terms_id_terms_descrip",
147 "qtip": "Select Terms",
148 "queryParam": "query[terms_descrip]",
149 "selectOnFocus": true,
150 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{terms_descrip}</b> </div>",
151 "triggerAction": "all",
153 "valueField": "terms_id",
160 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n}\n"
165 "|sortInfo": "{ direction : 'ASC', field: 'terms_descrip' }",
170 "xtype": "HttpProxy",
173 "|url": "baseURL + '/Roo/terms.php'"
177 "xtype": "JsonReader",
181 "totalProperty": "total",
182 "|fields": "[{\"name\":\"terms_id\",\"type\":\"int\"},\"terms_descrip\"]"
191 "displayField": "taxzone_descrip",
193 "emptyText": "Select Taxzone",
194 "fieldLabel": "Tax Zone",
195 "forceSelection": true,
196 "hiddenName": "vend_taxzone_id",
198 "loadingText": "Searching...",
200 "name": "vend_taxzone_id_taxzone_descrip",
202 "qtip": "Select Taxzone",
203 "queryParam": "query[taxzone_descrip]",
204 "selectOnFocus": true,
205 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{taxzone_descrip}</b> </div>",
206 "triggerAction": "all",
208 "valueField": "taxzone_id",
215 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n}\n"
220 "|sortInfo": "{ direction : 'ASC', field: 'taxzone_descrip' }",
225 "xtype": "HttpProxy",
228 "|url": "baseURL + '/Roo/taxzone.php'"
232 "xtype": "JsonReader",
236 "totalProperty": "total",
237 "|fields": "[{\"name\":\"taxzone_id\",\"type\":\"int\"},\"taxzone_descrip\"]"
245 "add": "function (combo)\n{\n Pman.Dialog.XtupleVendTypeEdit.show({vendtype_id : 0}, function(res){\n _this.form.findField('vend_vendtype_id').setFromData(res);\n \n });\n}",
246 "edit": "function (combo, record)\n{\n var s = _this.form.findField('vend_vendtype_id').getValue() * 1;\n if(s < 1){\n Roo.MessageBox.alert('Error','Please select a type');\n return;\n }\n\n Pman.Dialog.XtupleVendTypeEdit.show({vendtype_id : s}, function(res){\n\n _this.form.findField('vend_vendtype_id').setFromData(res);\n \n });\n}"
250 "displayField": "vendtype_descrip",
252 "emptyText": "Select Vendor Type",
253 "fieldLabel": "Type",
254 "forceSelection": true,
255 "hiddenName": "vend_vendtype_id",
257 "loadingText": "Searching...",
259 "name": "vend_vendtype_id_vendtype_descrip",
261 "qtip": "Select Vendor Type",
262 "queryParam": "query[vendtype_descrip]",
263 "selectOnFocus": true,
264 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{vendtype_descrip}</b> </div>",
265 "triggerAction": "all",
267 "valueField": "vendtype_id",
274 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n}\n"
279 "|sortInfo": "{ direction : 'ASC', field: 'vendtype_descrip' }",
285 "xtype": "HttpProxy",
286 "|url": "baseURL + '/Roo/vendtype.php'",
293 "totalProperty": "total",
294 "xtype": "JsonReader",
295 "|fields": "[{\"name\":\"vendtype_id\",\"type\":\"int\"},\"vendtype_descrip\"]",
303 "fieldLabel": "Active",
304 "inputValue": "true",
305 "name": "vend_active",
312 "fieldLabel": "Comments",
313 "name": "vend_comments",
322 "style": "width:450px;",
328 "add": "function (combo)\n{\n Pman.Dialog.XtupleAddress.show({addr_id : 0});\n}",
329 "edit": "function (combo, record)\n{\n var s = _this.form.findField('vend_addr_id').getValue() * 1;\n if(s < 1){\n Roo.MessageBox.alert('Error','Please select a address');\n return;\n }\n Pman.Dialog.XtupleAddress.show({addr_id : s});\n}",
330 "select": "function (combo, record, index)\n{\n for(var i in record.data) {\n _this.data['vend_addr_id_' + i] = record.data[i];\n }\n\n _this.form.findField('addr_view').sync();\n}"
334 "displayField": "addr_number",
336 "emptyText": "Select Address",
337 "fieldLabel": "Address",
338 "forceSelection": true,
339 "hiddenName": "vend_addr_id",
341 "loadingText": "Searching...",
343 "name": "vend_addr_id_addr_number",
345 "qtip": "Select Address",
346 "queryParam": "query[address]",
347 "selectOnFocus": true,
348 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>#{addr_id} - {addr_number}</b> </div>",
349 "triggerAction": "all",
351 "valueField": "addr_id",
358 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n addr_active = 1;\n}\n"
363 "|sortInfo": "{ direction : 'DESC', field: 'addr_id' }",
369 "xtype": "HttpProxy",
370 "|url": "baseURL + '/Roo/addr.php'",
377 "totalProperty": "total",
378 "xtype": "JsonReader",
379 "|fields": "[{\"name\":\"addr_id\",\"type\":\"int\"},\"addr_number\"]",
388 "fieldLabel": "Notes",
393 "|sync": "function() {\n var a = [ 'line1', 'line2', 'line3', 'city', 'state', 'country' ];\n var v = [];\n \n Roo.each(a, function(e) {\n if (_this.data['vend_addr_id_addr_' +e].length) {\n v.push(_this.data['vend_addr_id_addr_' +e]);\n }\n });\n \n this.setValue(v.join(\"\\n\"));\n}\n",
409 "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
412 "fitContainer": true,
415 "tableName": "itemsrc",
416 "title": "Supplier of",
417 "xtype": "GridPanel",
422 "|render": "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}",
423 "|rowdblclick": "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
426 "autoExpandColumn": "itemsrc_vend_item_descrip",
433 "beforeload": "function (_self, options)\n{\n options.params.itemsrc_vend_id = _this.form.findField('vend_id').getValue();\n}"
435 "*prop": "dataSource",
438 "|sortInfo": "{ field : 'itemsrc_id_item_number', direction: 'ASC' }",
443 "xtype": "HttpProxy",
445 "|url": "baseURL + '/Roo/itemsrc.php'",
450 "xtype": "JsonReader",
451 "totalProperty": "total",
455 "|fields": "[\n {\n 'name': 'itemsrc_id',\n 'type': 'int'\n },\n {\n 'name': 'itemsrc_item_id',\n 'type': 'int'\n },\n {\n 'name': 'itemsrc_item_id',\n 'type': 'int'\n },\n {\n 'name': 'itemsrc_vend_id',\n 'type': 'int'\n },\n {\n 'name': 'itemsrc_vend_id',\n 'type': 'int'\n },\n {\n 'name': 'itemsrc_vend_item_number',\n 'type': 'string'\n },\n {\n 'name': 'itemsrc_vend_item_descrip',\n 'type': 'string'\n },\n {\n 'name': 'itemsrc_comments',\n 'type': 'string'\n },\n {\n 'name': 'itemsrc_vend_uom',\n 'type': 'string'\n },\n {\n 'name': 'itemsrc_invvendoruomratio',\n 'type': 'float'\n },\n {\n 'name': 'itemsrc_minordqty',\n 'type': 'float'\n },\n {\n 'name': 'itemsrc_multordqty',\n 'type': 'float'\n },\n {\n 'name': 'itemsrc_leadtime',\n 'type': 'int'\n },\n {\n 'name': 'itemsrc_ranking',\n 'type': 'int'\n },\n {\n 'name': 'itemsrc_active',\n 'type': 'int'\n },\n {\n 'name': 'itemsrc_manuf_name',\n 'type': 'string'\n },\n {\n 'name': 'itemsrc_manuf_item_number',\n 'type': 'string'\n },\n {\n 'name': 'itemsrc_manuf_item_descrip',\n 'type': 'string'\n },\n {\n 'name': 'itemsrc_default',\n 'type': 'int'\n },\n {\n 'name': 'itemsrc_upccode',\n 'type': 'string'\n }\n]"
461 "xtype": "PagingToolbar",
464 "displayMsg": "Displaying itemsrc{0} - {1} of {2}",
465 "emptyMsg": "No itemsrc found",
476 "cls": "x-btn-text-icon",
477 "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
479 "|click": "function()\n{\n if (!_this.dialog) return;\n _this.dialog.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
481 "|xns": "Roo.Toolbar"
484 "|xns": "Roo.Toolbar",
489 "cls": "x-btn-text-icon",
490 "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
493 "|click": "function()\n{\n Pman.genericDelete(_this, 'itemsrc'); \n}\n "
495 "|xns": "Roo.Toolbar"
500 "*prop": "colModel[]",
501 "dataIndex": "itemsrc_id_item_number",
504 "xtype": "ColumnModel",
505 "|renderer": "function(v) { return String.format('{0}', v); }",
509 "*prop": "colModel[]",
510 "dataIndex": "itemsrc_vend_item_number",
511 "header": "Vendor item number",
513 "xtype": "ColumnModel",
514 "|renderer": "function(v) { return String.format('{0}', v); }",
518 "*prop": "colModel[]",
519 "dataIndex": "itemsrc_vend_item_descrip",
520 "header": "Vendor item description",
522 "xtype": "ColumnModel",
523 "|renderer": "function(v) { return String.format('{0}', v); }",
527 "*prop": "colModel[]",
528 "dataIndex": "itemsrc_vend_uom",
531 "xtype": "ColumnModel",
532 "|renderer": "function(v) { return String.format('{0}', v); }",
536 "*prop": "colModel[]",
537 "dataIndex": "itemsrc_minordqty",
538 "header": "Min ord qty",
540 "xtype": "ColumnModel",
541 "|renderer": "function(v) { return String.format('{0}', v); }",
545 "*prop": "colModel[]",
546 "dataIndex": "itemsrc_leadtime",
547 "header": "Lead time",
549 "xtype": "ColumnModel",
550 "|renderer": "function(v) { return String.format('{0}', v); }",
554 "*prop": "colModel[]",
555 "dataIndex": "itemsrc_active",
558 "xtype": "ColumnModel",
559 "|renderer": "function(v) { return String.format('{0}', v); }",
568 "click": "function (_self, e)\n{\n _this.dialog.hide();\n}"
570 "*prop": "buttons[]",
577 "click": "function (_self, e)\n{\n _this.form.doAction(\"submit\");\n\n}"
579 "*prop": "buttons[]",