{ "id": "roo-file-15", "name": "Pman.Dialog.XtupleMiscellaneousCheck", "parent": "", "title": "", "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleMiscellaneousCheck.bjs", "items": [ { "listeners": { "show": "function (_self)\n{\n this.layout.getRegion('center').showPanel(0);\n}" }, "closable": false, "collapsible": false, "height": 350, "modal": true, "resizable": false, "title": "Create Miscellaneous Check", "width": 500, "xtype": "LayoutDialog", "|xns": "Roo", "items": [ { "|xns": "Roo", "xtype": "LayoutRegion", "*prop": "center" }, { "region": "center", "xtype": "ContentPanel", "|xns": "Roo", "items": [ { "listeners": { "|actioncomplete": "function(_self,action)\n{\n if (action.type == 'setdata') {\n if(_this.data.checkhead_id){\n _this.dialog.el.mask(\"Loading\");\n this.load({ method: 'GET', params: { '_id' : _this.data.checkhead_id }});\n return;\n }\n return;\n }\n if (action.type == 'load') {\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", "|rendered": "function (form)\n{\n _this.form= form;\n}\n" }, "labelWidth": 150, "method": "POST", "style": "margin:10px;", "xtype": "Form", "|url": "baseURL + '/Roo/checkhead.php'", "|xns": "Roo.form", "items": [ { "allowBlank": true, "fieldLabel": "Customer", "name": "cust_name", "readOnly": true, "width": 200, "xtype": "TextField", "|xns": "Roo.form" }, { "allowBlank": true, "fieldLabel": "Apply To Credit Memo", "name": "cmhead_number", "readOnly": true, "width": 200, "xtype": "TextField", "|xns": "Roo.form" }, { "allowBlank": false, "disabled": true, "displayField": "curr_name", "editable": false, "emptyText": "Select Currency", "fieldLabel": "Currency", "forceSelection": true, "hiddenName": "checkhead_curr_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "checkhead_curr_id_curr_name", "pageSize": 20, "qtip": "Select Currency", "queryParam": "query[curr_name]", "selectOnFocus": true, "tpl": "
{curr_name}
", "triggerAction": "all", "typeAhead": true, "valueField": "curr_id", "width": 200, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n \n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'curr_symbol' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|xns": "Roo.data", "|url": "baseURL + '/Roo/curr_symbol.php'" }, { "*prop": "reader", "xtype": "JsonReader", "|xns": "Roo.data", "id": "curr_id", "root": "data", "totalProperty": "total", "|fields": "[{\"name\":\"curr_id\",\"type\":\"int\"},\"curr_symbol\"]" } ] } ] }, { "allowBlank": false, "allowDecimals": true, "decimalPrecision": 2, "fieldLabel": "Amount", "name": "checkhead_amount", "width": 200, "xtype": "NumberField", "|xns": "Roo.form" }, { "allowBlank": false, "displayField": "bankaccnt_name", "editable": false, "emptyText": "Select Bank Accnt", "fieldLabel": "Post to", "forceSelection": true, "hiddenName": "checkhead_bankaccnt_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "checkhead_bankaccnt_id_name", "pageSize": 20, "qtip": "Select Bank Accnt", "queryParam": "query[bankaccnt_name]", "selectOnFocus": true, "tpl": "
{bankaccnt_name} - {bankaccnt_descrip}
", "triggerAction": "all", "typeAhead": true, "valueField": "bankaccnt_id", "width": 200, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n \n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'DESC', field: 'bankaccnt_id' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "method": "GET", "xtype": "HttpProxy", "|url": "baseURL + '/Roo/bankaccnt.php'", "|xns": "Roo.data" }, { "*prop": "reader", "id": "bankaccnt_id", "root": "data", "totalProperty": "total", "xtype": "JsonReader", "|fields": "[{\"name\":\"bankaccnt_id\",\"type\":\"int\"},\"bankaccnt_name\"]", "|xns": "Roo.data" } ] } ] }, { "allowBlank": false, "fieldLabel": "Date", "format": "Y-m-d", "name": "checkhead_checkdate", "width": 200, "xtype": "DateField", "|xns": "Roo.form" }, { "allowBlank": true, "fieldLabel": "Memo", "name": "checkhead_for", "width": 200, "xtype": "TextField", "|xns": "Roo.form" }, { "allowBlank": true, "fieldLabel": "Notes", "name": "checkhead_notes", "width": 300, "xtype": "TextArea", "|xns": "Roo.form" }, { "name": "checkhead_id", "xtype": "Hidden", "|xns": "Roo.form" }, { "name": "checkhead_recip_id", "xtype": "Hidden", "|xns": "Roo.form" }, { "name": "checkhead_recip_type", "xtype": "Hidden", "|xns": "Roo.form" }, { "name": "aropen_id", "xtype": "Hidden", "|xns": "Roo.form" }, { "name": "checkhead_misc", "xtype": "Hidden", "|xns": "Roo.form" }, { "name": "_create_and_post", "xtype": "Hidden", "|xns": "Roo.form" }, { "name": "remaining_total", "xtype": "Hidden", "|xns": "Roo.form" } ] } ] }, { "listeners": { "click": "function (_self, e)\n{\n _this.dialog.hide();\n}" }, "*prop": "buttons[]", "text": "Cancel", "xtype": "Button", "|xns": "Roo" }, { "listeners": { "click": "function (_self, e)\n{\n // do some checks?\n \n \n // _this.dialog.el.mask(\"Saving\");\n var a = _this.form.findField('checkhead_amount').getValue();\n var r = _this.form.findField('remaining_total').getValue();\n \n if(a - r > 0){\n Roo.MessageBox.alert(\"Error\", \"You must enter an amount less than or equal to the credit memo! The amount remaining of this credit memo is \" + r);\n _this.form.findField('checkhead_amount').setValue(r);\n return;\n }\n \n _this.form.doAction(\"submit\");\n\n}" }, "*prop": "buttons[]", "text": "Save", "xtype": "Button", "|xns": "Roo" } ] } ], "permname": "", "modOrder": "001" }