3 "name": "Pman.Dialog.XtupleVendorEdit",
6 "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleVendorEdit.bjs",
14 "title": "Edit / Create Vendor",
16 "xtype": "LayoutDialog",
22 "xtype": "LayoutRegion",
27 "xtype": "ContentPanel",
32 "|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",
33 "|rendered": "function (form)\n{\n _this.form= form;\n}\n"
36 "style": "margin:10px;",
38 "|url": "baseURL + '/Roo/vendinfo.php'",
42 "legend": "Basic Details",
43 "style": "width:450px",
49 "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}"
60 "fieldLabel": "Vendor #",
61 "name": "vend_number",
69 "fieldLabel": "Ship Via",
70 "name": "vend_shipvia",
78 "displayField": "curr_symbol",
80 "emptyText": "Select Currency",
81 "fieldLabel": "Currency",
82 "forceSelection": true,
83 "hiddenName": "vend_curr_id",
85 "loadingText": "Searching...",
87 "name": "vend_curr_id_curr_symbol",
89 "qtip": "Select Currency",
90 "queryParam": "query[curr_symbol]",
91 "selectOnFocus": true,
92 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{curr_symbol}</b> </div>",
93 "triggerAction": "all",
95 "valueField": "curr_id",
102 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n}\n"
107 "|sortInfo": "{ direction : 'ASC', field: 'curr_symbol' }",
112 "xtype": "HttpProxy",
115 "|url": "baseURL + '/Roo/curr_symbol.php'"
119 "xtype": "JsonReader",
123 "totalProperty": "total",
124 "|fields": "[{\"name\":\"curr_id\",\"type\":\"int\"},\"curr_symbol\"]"
133 "displayField": "terms_descrip",
135 "emptyText": "Select Terms",
136 "fieldLabel": "Terms",
137 "forceSelection": true,
138 "hiddenName": "vend_terms_id",
140 "loadingText": "Searching...",
142 "name": "vend_terms_id_terms_descrip",
144 "qtip": "Select Terms",
145 "queryParam": "query[terms_descrip]",
146 "selectOnFocus": true,
147 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{terms_descrip}</b> </div>",
148 "triggerAction": "all",
150 "valueField": "terms_id",
157 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n}\n"
162 "|sortInfo": "{ direction : 'ASC', field: 'terms_descrip' }",
167 "xtype": "HttpProxy",
170 "|url": "baseURL + '/Roo/terms.php'"
174 "xtype": "JsonReader",
178 "totalProperty": "total",
179 "|fields": "[{\"name\":\"terms_id\",\"type\":\"int\"},\"terms_descrip\"]"
188 "displayField": "taxzone_descrip",
190 "emptyText": "Select Taxzone",
191 "fieldLabel": "Tax Zone",
192 "forceSelection": true,
193 "hiddenName": "vend_taxzone_id",
195 "loadingText": "Searching...",
197 "name": "vend_taxzone_id_taxzone_descrip",
199 "qtip": "Select Taxzone",
200 "queryParam": "query[taxzone_descrip]",
201 "selectOnFocus": true,
202 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{taxzone_descrip}</b> </div>",
203 "triggerAction": "all",
205 "valueField": "taxzone_id",
212 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n}\n"
217 "|sortInfo": "{ direction : 'ASC', field: 'taxzone_descrip' }",
222 "xtype": "HttpProxy",
225 "|url": "baseURL + '/Roo/taxzone.php'"
229 "xtype": "JsonReader",
233 "totalProperty": "total",
234 "|fields": "[{\"name\":\"taxzone_id\",\"type\":\"int\"},\"taxzone_descrip\"]"
242 "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}",
243 "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}"
247 "displayField": "vendtype_descrip",
249 "emptyText": "Select Vendor Type",
250 "fieldLabel": "Type",
251 "forceSelection": true,
252 "hiddenName": "vend_vendtype_id",
254 "loadingText": "Searching...",
256 "name": "vend_vendtype_id_vendtype_descrip",
258 "qtip": "Select Vendor Type",
259 "queryParam": "query[vendtype_descrip]",
260 "selectOnFocus": true,
261 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{vendtype_descrip}</b> </div>",
262 "triggerAction": "all",
264 "valueField": "vendtype_id",
271 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n}\n"
276 "|sortInfo": "{ direction : 'ASC', field: 'vendtype_descrip' }",
282 "xtype": "HttpProxy",
283 "|url": "baseURL + '/Roo/vendtype.php'",
290 "totalProperty": "total",
291 "xtype": "JsonReader",
292 "|fields": "[{\"name\":\"vendtype_id\",\"type\":\"int\"},\"vendtype_descrip\"]",
300 "fieldLabel": "Active",
301 "inputValue": "true",
302 "name": "vend_active",
309 "fieldLabel": "Comments",
310 "name": "vend_comments",
319 "style": "width:450px;",
325 "add": "function (combo)\n{\n Pman.Dialog.XtupleAddress.show({addr_id : 0});\n}",
326 "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}",
327 "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}"
331 "displayField": "addr_number",
333 "emptyText": "Select Address",
334 "fieldLabel": "Address",
335 "forceSelection": true,
336 "hiddenName": "vend_addr_id",
338 "loadingText": "Searching...",
340 "name": "vend_addr_id_addr_number",
342 "qtip": "Select Address",
343 "queryParam": "query[address]",
344 "selectOnFocus": true,
345 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>#{addr_id} - {addr_number}</b> </div>",
346 "triggerAction": "all",
348 "valueField": "addr_id",
355 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n addr_active = 1;\n}\n"
360 "|sortInfo": "{ direction : 'DESC', field: 'addr_id' }",
366 "xtype": "HttpProxy",
367 "|url": "baseURL + '/Roo/addr.php'",
374 "totalProperty": "total",
375 "xtype": "JsonReader",
376 "|fields": "[{\"name\":\"addr_id\",\"type\":\"int\"},\"addr_number\"]",
385 "fieldLabel": "Notes",
390 "|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",
406 "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
409 "fitContainer": true,
412 "tableName": "itemsrc",
413 "title": "Supplier of",
414 "xtype": "GridPanel",
419 "|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}",
420 "|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"
423 "autoExpandColumn": "itemsrc_vend_item_descrip",
430 "beforeload": "function (_self, options)\n{\n options.params.itemsrc_vend_id = _this.form.findField('vend_id').getValue();\n}"
432 "*prop": "dataSource",
435 "|sortInfo": "{ field : 'itemsrc_vend_item_number', direction: 'ASC' }",
440 "xtype": "HttpProxy",
442 "|url": "baseURL + '/Roo/itemsrc.php'",
447 "xtype": "JsonReader",
448 "totalProperty": "total",
452 "|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]"
458 "xtype": "PagingToolbar",
461 "displayMsg": "Displaying itemsrc{0} - {1} of {2}",
462 "emptyMsg": "No itemsrc found",
473 "cls": "x-btn-text-icon",
474 "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
476 "|click": "function()\n{\n if (!_this.dialog) return;\n _this.dialog.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
478 "|xns": "Roo.Toolbar"
481 "|xns": "Roo.Toolbar",
486 "cls": "x-btn-text-icon",
487 "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
490 "|click": "function()\n{\n Pman.genericDelete(_this, 'itemsrc'); \n}\n "
492 "|xns": "Roo.Toolbar"
497 "*prop": "colModel[]",
498 "dataIndex": "itemsrc_id_item_number",
501 "xtype": "ColumnModel",
502 "|renderer": "function(v) { return String.format('{0}', v); }",
506 "*prop": "colModel[]",
507 "dataIndex": "itemsrc_vend_item_number",
508 "header": "Vendor item number",
510 "xtype": "ColumnModel",
511 "|renderer": "function(v) { return String.format('{0}', v); }",
515 "*prop": "colModel[]",
516 "dataIndex": "itemsrc_vend_item_descrip",
517 "header": "Vendor item description",
519 "xtype": "ColumnModel",
520 "|renderer": "function(v) { return String.format('{0}', v); }",
524 "*prop": "colModel[]",
525 "dataIndex": "itemsrc_vend_uom",
528 "xtype": "ColumnModel",
529 "|renderer": "function(v) { return String.format('{0}', v); }",
533 "*prop": "colModel[]",
534 "dataIndex": "itemsrc_minordqty",
535 "header": "Min ord qty",
537 "xtype": "ColumnModel",
538 "|renderer": "function(v) { return String.format('{0}', v); }",
542 "*prop": "colModel[]",
543 "dataIndex": "itemsrc_leadtime",
544 "header": "Lead time",
546 "xtype": "ColumnModel",
547 "|renderer": "function(v) { return String.format('{0}', v); }",
551 "*prop": "colModel[]",
552 "dataIndex": "itemsrc_active",
555 "xtype": "ColumnModel",
556 "|renderer": "function(v) { return String.format('{0}', v); }",
565 "click": "function (_self, e)\n{\n _this.dialog.hide();\n}"
567 "*prop": "buttons[]",
574 "click": "function (_self, e)\n{\n _this.form.doAction(\"submit\");\n\n}"
576 "*prop": "buttons[]",