{ "id": "roo-file-4", "name": "Pman.Dialog.XtupleCreditMemoNew", "parent": "", "title": "", "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleCreditMemoNew.bjs", "items": [ { "listeners": { "show": "function (_self)\n{\n _this.form.findField('cmhead_cust_id').focus();\n}" }, "closable": false, "height": 120, "modal": true, "resizable": false, "title": "Create new Credit Memo", "width": 500, "xtype": "LayoutDialog", "|xns": "Roo", "items": [ { "|xns": "Roo", "xtype": "LayoutRegion", "*prop": "center" }, { "region": "center", "xtype": "ContentPanel", "|xns": "Roo", "items": [ { "listeners": { "rendered": "function (form)\n{\n _this.form = form;\n}" }, "xtype": "Form", "|xns": "Roo.form", "items": [ { "listeners": { "add": "function (combo)\n{\n \n Pman.Dialog.XtupleCustomer.show( { id : 0 } , function(res) {\n Roo.log(res);\n // fill in customer\n _this.form.findField('cmhed_cust_id_cust_name').setValue(res.cust_id);\n _this.form.findField('cmhed_cust_id_cust_name').el.dom.value = res.cust_name;\n \n })\n \n}\n\n" }, "allowBlank": false, "displayField": "cust_name", "editable": true, "fieldLabel": "Select Customer", "forceSelection": true, "hiddenName": "cmhead_cust_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "cmhead_cust_id_cust_name", "pageSize": 20, "qtip": "Select custinfo", "queryParam": "query[cust_name]", "selectOnFocus": true, "tpl": "
{cust_number}: {cust_name}
", "triggerAction": "all", "typeAhead": true, "valueField": "cust_id", "width": 300, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n // o.params._with_last_location = 1;\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'cust_name' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|xns": "Roo.data", "|url": "baseURL + '/Roo/custinfo.php'" }, { "*prop": "reader", "xtype": "JsonReader", "|xns": "Roo.data", "id": "cust_id", "root": "data", "totalProperty": "total", "|fields": "[{\"name\":\"cust_id\",\"type\":\"int\"},\"cust_name\"]" } ] } ] } ] } ] }, { "listeners": { "click": "function (_self, e)\n{\n _this.dialog.hide();\n \n }" }, "*prop": "buttons[]", "text": "Cancel", "xtype": "Button", "|xns": "Roo" }, { "listeners": { "click": "function (_self, e)\n{\n //_this.findField('cuinfo_\n \n // check if customer is filled in.\n if (_this.form.findField('cmhead_cust_id').getValue() < 1) {\n Roo.MessageBox.alert(\"Error\", \"Select a customer\");\n return;\n }\n \n var data = _this.form.getFieldValues();\n var c = _this.form.findField('cmhead_cust_id').lastData;\n \n data.cmhead_curr_id = c.cust_curr_id;\n data.cmhead_curr_id_curr_name = c.cust_curr_id_curr_name;\n \n data.cmhead_terms_id = c.cust_terms_id;\n data.cmhead_terms_id_terms_descrip = c.cust_terms_id_terms_descrip;\n \n // fill in staff in/c..\n \n data.cmhead_salesrep_id = Pman.Login.authUser.salesrep.salesrep_id;\n data.cmhead_salesrep_id_salesrep_name = Pman.Login.authUser.salesrep.salesrep_name;\n \n data.cmhead_docdate = new Date();\n \n data.cmhead_taxzone_id = c.cust_taxzone_id;\n data.cmhead_taxzone_id_taxzone_descrip = c.cust_taxzone_id_taxzone_descrip;\n data.cmhead_location_id = c.default_location_id,\n data.cmhead_location_id_location_name = c.default_location_name;\n\n Pman.Dialog.XtupleCreditMemo.show(data, function() {\n _this.dialog.hide();\n _this.callback();\n }); \n \n}" }, "*prop": "buttons[]", "text": "OK", "xtype": "Button", "|xns": "Roo" } ] } ], "permname": "", "modOrder": "001" }