{ "id": "roo-file-393", "name": "Pman.Tab.XtupleSalesInvoice", "parent": "Pman.Tab.XtupleSales", "title": "", "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleSalesInvoice.bjs", "items": [ { "listeners": { "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" }, ".builderCfg": "{\"cols\":[{\"table\":\"invchead\",\"column\":\"invchead_ordernumber\",\"columnshort\":\"invchead_ordernumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Sales Order#\"},{\"table\":\"invchead\",\"column\":\"invchead_orderdate\",\"columnshort\":\"invchead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"},{\"table\":\"invchead\",\"column\":\"invchead_posted\",\"columnshort\":\"invchead_posted\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Posted\"},{\"table\":\"invchead\",\"column\":\"invchead_printed\",\"columnshort\":\"invchead_printed\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Printed?\"},{\"table\":\"invchead\",\"column\":\"invchead_invcdate\",\"columnshort\":\"invchead_invcdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Invoiced\"},{\"table\":\"invchead\",\"column\":\"invchead_billto_name\",\"columnshort\":\"invchead_billto_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Bill To\"}],\"cols_ex\":[\"invchead_billto_name\"],\"table\":\"invchead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}", "background": true, "fitContainer": true, "fitToframe": true, "region": "center", "tableName": "invchead", "title": "Invoices", "xtype": "GridPanel", "|xns": "Roo", "items": [ { "listeners": { "|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}", "|rowdblclick": "function (_self, rowIndex, e)\n{\n \n \n var d = this.getDataSource().getAt(rowIndex).data;\n \n if (d.cohead_id) {\n \n Pman.Dialog.XtupleSalesOrder.show( {\n cohead_id : d.cohead_id\n \n }, function() {\n _this.grid.footer.onClick('refresh');\n // updated..\n Pman.Tab.XtupleSales.grid.footer.onClick('first');\n }); \n return;\n }\n \n // other wise not a sales order related..\n \n \n Pman.Dialog.XtupleInvc.show( {\n _id : d.invchead_id\n \n }, function() {\n _this.grid.footer.onClick('refresh');\n // updated..\n Pman.Tab.XtupleSales.grid.footer.onClick('first');\n }); \n \n}\n" }, "*prop": "grid", "autoExpandColumn": "cust_name", "loadMask": true, "xtype": "Grid", "|xns": "Roo.grid", "items": [ { "listeners": { "beforeload": "function (_self, o)\n{\n if (_this.ordernumber.getValue().length) {\n o.params['query[invchead_ordernumber]'] = _this.ordernumber.getValue();\n }\n \n if (_this.invcnumber.getValue().length) {\n o.params['query[invchead_invcnumber]'] = _this.invcnumber.getValue();\n }\n \n \n if (_this.customer.getValue()) {\n o.params.invchead_cust_id = _this.customer.getValue();\n }\n if (_this.fromDate.getValue()) {\n o.params['search[fromDate]'] = _this.fromDate.getValue().format('Y-m-d');\n }\n if (_this.toDate.getValue()) {\n o.params['search[toDate]'] = _this.toDate.getValue().format('Y-m-d');\n }\n o.params._show_status = _this.status.getValue();\n \n o.params._with_salesorder = 1;\n}" }, "*prop": "dataSource", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ field : 'invchead_invcdate', direction: 'DESC' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|url": "baseURL + '/Roo/invchead.php'", "|xns": "Roo.data" }, { "|xns": "Roo.data", "xtype": "JsonReader", "totalProperty": "total", "root": "data", ".builderCfg": "{\"cols\":[{\"table\":\"invchead\",\"column\":\"invchead_ordernumber\",\"columnshort\":\"invchead_ordernumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Sales Order#\"},{\"table\":\"invchead\",\"column\":\"invchead_orderdate\",\"columnshort\":\"invchead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"},{\"table\":\"invchead\",\"column\":\"invchead_posted\",\"columnshort\":\"invchead_posted\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Posted\"},{\"table\":\"invchead\",\"column\":\"invchead_printed\",\"columnshort\":\"invchead_printed\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Printed?\"},{\"table\":\"invchead\",\"column\":\"invchead_invcdate\",\"columnshort\":\"invchead_invcdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Invoiced\"},{\"table\":\"invchead\",\"column\":\"invchead_billto_name\",\"columnshort\":\"invchead_billto_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Bill To\"}],\"cols_ex\":[\"invchead_billto_name\"],\"table\":\"invchead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}", "*prop": "reader", "id": "id", "|fields": "[\n {\n 'name': 'invchead_ordernumber',\n 'type': 'string'\n },\n {\n 'name': 'invchead_orderdate',\n 'type': 'date'\n },\n {\n 'name': 'invchead_posted',\n 'type': 'boolean'\n },\n {\n 'name': 'invchead_printed',\n 'type': 'boolean'\n },\n {\n 'name': 'invchead_invcdate',\n 'type': 'date'\n },\n {\n 'name': 'invchead_billto_name',\n 'type': 'string'\n }\n]" } ] }, { "*prop": "footer", "xtype": "PagingToolbar", "pageSize": 25, "displayInfo": true, "displayMsg": "Displaying invchead{0} - {1} of {2}", "emptyMsg": "No invchead found", "|xns": "Roo", "items": [ { "listeners": { "click": "function (_self, e)\n{\n new Pman.Download({\n grid: _this.grid\n });\n Roo.MessageBox.alert(\"Notice\", \"Download should start soon\");\n}" }, "text": "Download", "xtype": "Button", "|xns": "Roo.Toolbar" } ] }, { "*prop": "toolbar", "xtype": "Toolbar", "|xns": "Roo", "items": [ { "listeners": { "render": "function (_self)\n{\n _this.invcnumber = _self;\n}", "specialkey": "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}" }, "emptyText": "Invoice #", "width": 70, "xtype": "TextField", "|xns": "Roo.form" }, { "listeners": { "render": "function (_self)\n{\n _this.ordernumber = _self;\n}", "select": "function (combo, record, index)\n{\n Roo.log('select');\n _this.grid.footer.onClick('first');\n}" }, "allowBlank": true, "displayField": "invchead_ordernumber", "editable": true, "emptyText": "Order", "fieldLabel": "ordernumber", "forceSelection": true, "hiddenName": "invchead_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "invchead_ordernumber", "pageSize": 20, "qtip": "Select invchead", "queryParam": "query[invchead_ordernumber]", "selectOnFocus": true, "tpl": "