{ "name" : "Pman.Tab.XtupleCustomer", "parent" : "Pman.Tab.XtupleSales", "title" : "", "path" : "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleCustomer.bjs", "permname" : "", "modOrder" : "700", "items" : [ { "listeners" : { "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" }, "fitToframe" : true, "region" : "center", "background" : true, "title" : "Customers", "xtype" : "GridPanel", "fitContainer" : true, "$ xns" : "Roo", "# builderCfg" : "{\"cols\":[{\"table\":\"custinfo\",\"column\":\"cust_active\",\"columnshort\":\"cust_active\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Active\"},{\"table\":\"custtype\",\"column\":\"cust_custtype_id_custtype_descrip\",\"columnshort\":\"custtype_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Customer type\"},{\"table\":\"salesrep\",\"column\":\"cust_salesrep_id_salesrep_name\",\"columnshort\":\"salesrep_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":0,\"title\":\"Sales Rep\"},{\"table\":\"custinfo\",\"column\":\"cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Name\"}],\"cols_ex\":[\"cust_name\"],\"table\":\"custinfo\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}", "tableName" : "custinfo", "items" : [ { "listeners" : { "|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('refresh');\n }); \n}\n", "|render" : "function() \n{\n _this.grid = this; \n _this.dialog = Pman.Dialog.XtupleCustomer;\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}" }, "autoExpandColumn" : "cust_name", "xtype" : "Grid", "loadMask" : true, "$ xns" : "Roo.grid", "* prop" : "grid", "# builderCfg" : "{\"cols\":[{\"table\":\"custinfo\",\"column\":\"cust_active\",\"columnshort\":\"cust_active\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Active\"},{\"table\":\"custtype\",\"column\":\"cust_custtype_id_custtype_descrip\",\"columnshort\":\"custtype_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Customer type\"},{\"table\":\"salesrep\",\"column\":\"cust_salesrep_id_salesrep_name\",\"columnshort\":\"salesrep_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":0,\"title\":\"Sales Rep\"},{\"table\":\"custinfo\",\"column\":\"cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Name\"}],\"cols_ex\":[\"cust_name\"],\"table\":\"custinfo\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}", "items" : [ { "listeners" : { "beforeload" : "function (_self, o)\n{\n if (!_this.officeCombo) {\n return false;\n }\n \n o.params = o.params || {};\n o.params['search[_mix]'] = _this.searchBox.getValue();\n if (!_this.activeBtn.pressed) {\n o.params.cust_active = 1;\n o.params.cust_aropen_active = 1;\n } \n var dt = _this.dateSearch.getValue(); \n if (dt) {\n o.params['search[orders_since]'] = dt.format('Y-m-d');\n }\n dt = _this.dateSearchNo.getValue(); \n if (dt) {\n o.params['search[no_orders_since]'] = dt.format('Y-m-d');\n }\n \n o.params['search[with_orders_since]'] = 1; //\n o.params['search[with_balance]'] = 1;\n o.params['search[with_address]'] = 1;\n o.params['_with_char'] = 1; \n o.params['_with_group_data'] = 1;\n o.params['search[_country]'] = _this.country.getValue();\n o.params._get = 1; // for download\n \n o.params['cust_char_internalcompany'] = _this.officeCombo.getValue();\n}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field : 'cust_name', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "dataSource", "items" : [ { "$ url" : "baseURL + '/Roo/custinfo.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n {\n 'name': 'cust_active',\n 'type': 'boolean'\n },\n {\n 'name': 'cust_custtype_id_custtype_descrip',\n 'type': 'string'\n },\n {\n 'name': 'cust_salesrep_id_salesrep_name',\n 'type': 'string'\n },\n {\n 'name': 'cust_name',\n 'type': 'string'\n }\n]", "$ xns" : "Roo.data", "* prop" : "reader", "# builderCfg" : "{\"cols\":[{\"table\":\"custinfo\",\"column\":\"cust_active\",\"columnshort\":\"cust_active\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Active\"},{\"table\":\"custtype\",\"column\":\"cust_custtype_id_custtype_descrip\",\"columnshort\":\"custtype_descrip\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Customer type\"},{\"table\":\"salesrep\",\"column\":\"cust_salesrep_id_salesrep_name\",\"columnshort\":\"salesrep_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":0,\"title\":\"Sales Rep\"},{\"table\":\"custinfo\",\"column\":\"cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Name\"}],\"cols_ex\":[\"cust_name\"],\"table\":\"custinfo\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}", "totalProperty" : "total" } ] }, { "pageSize" : 25, "xtype" : "PagingToolbar", "emptyMsg" : "No custinfo found", "$ xns" : "Roo", "displayInfo" : true, "displayMsg" : "Displaying custinfo{0} - {1} of {2}", "* prop" : "footer", "items" : [ { "text" : "Upload/Download", "xtype" : "Button", "$ xns" : "Roo.Toolbar", "items" : [ { "xtype" : "Menu", "$ xns" : "Roo.menu", "* prop" : "menu", "items" : [ { "listeners" : { "click" : "function (_self, e)\n{\n \n if (!Pman.hasPerm('Xtuple.CustomerDownload','S')) {\n Roo.MessageBox.alert(\"Error\", \"Permission Denied\");\n return;\n }\n \n var params = {\n '_group' : 'customer',\n '_name' : 'subscribers',\n 'limit' : 99999,\n 'csvTitles' : '*',\n 'csvCols' : '*'\n };\n \n \n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n params : params,\n method : 'GET'\n });\n \n Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n \n}" }, "text" : "Download Mailing list subscribers", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n \n if (!Pman.hasPerm('Xtuple.CustomerDownload','S')) {\n Roo.MessageBox.alert(\"Error\", \"Permission Denied\");\n return;\n }\n _this.grid.ds.proxy.conn.method = 'POST';\n new Pman.Download({\n grid : _this.grid\n });\n \n}" }, "text" : "Download Customers", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n \n if (!Pman.hasPerm('Admin.Admin_Tab','S')) {\n Roo.MessageBox.alert(\"Error\", \"Permission Denied\");\n return;\n }\n \n var c = _this.country.getValue();\n if(!c.length){\n Roo.MessageBox.alert(\"Error\", \"Please select a country\");\n return;\n }\n \n new Pman.Download({\n url : baseURL + '/Roo/custinfo',\n method : 'GET',\n params : {\n _my_json : 1,\n limit : 9999,\n 'search[_country]' : c,\n 'search[with_address]' : 1\n }\n \n });\n}" }, "text" : "Download Customers As Json", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n \n if (!Pman.hasPerm('Admin.Admin_Tab','S')) {\n Roo.MessageBox.alert(\"Error\", \"Permission Denied\");\n return;\n }\n \n Pman.Dialog.Image.show(\n {\n _url : baseURL+'/Xtuple/Import/Customers' \n \n },\n function (data) {\n _this.grid.footer.onClick('first');\n Roo.MessageBox.alert(\"Notice\", \"DONE\");\n// Roo.MessageBox.alert(\"Notice\", msg.join(\"\\n\"));\n\n }\n );\n \n}" }, "text" : "Upload Customers", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n \n if (!Pman.hasPerm('Admin.Admin_Tab','S')) {\n Roo.MessageBox.alert(\"Error\", \"Permission Denied\");\n return;\n }\n \n Pman.Dialog.Image.show(\n {\n _url : baseURL+'/Xtuple/Import/MyCustomers' \n \n },\n function (data) {\n _this.grid.footer.onClick('first');\n Roo.MessageBox.alert(\"Notice\", \"DONE\");\n// Roo.MessageBox.alert(\"Notice\", msg.join(\"\\n\"));\n\n }\n );\n \n}" }, "text" : "Upload Customers Json File", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n \n if (!Pman.hasPerm('Admin.Admin_Tab','S')) {\n Roo.MessageBox.alert(\"Error\", \"Permission Denied\");\n return;\n }\n \n Pman.Dialog.Image.show(\n {\n _url : baseURL+'/Xtuple/Import/AUPostAccounts' \n \n },\n function (data) {\n _this.grid.footer.onClick('first');\n Roo.MessageBox.alert(\"Notice\", data);\n\n }\n );\n \n}" }, "text" : "Upload AU Post Accounts", "xtype" : "Item", "$ xns" : "Roo.menu" } ] } ] } ] }, { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "text" : "Search : ", "xtype" : "TextItem", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "specialkey" : "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}", "render" : "function (_self)\n{\n _this.searchBox = _self;\n}" }, "xtype" : "TextField", "$ xns" : "Roo.form" }, { "listeners" : { "|click" : "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}" }, "xtype" : "Button", "cls" : "x-btn-icon", "$ icon" : "rootURL + '/Pman/templates/images/search.gif'", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "|click" : "function (_self, e)\n{\n _this.searchBox.setValue('');\n \n \n _this.grid.footer.onClick('first');\n}" }, "xtype" : "Button", "cls" : "x-btn-icon", "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "render" : "function (_self)\n{\n _this.officeCombo = _self;\n}", "select" : "function (combo, record, index)\n{\n\n _this.grid.footer.onClick('first');\n}" }, "listWidth" : 200, "triggerAction" : "all", "fieldLabel" : "Office", "displayField" : "office", "xtype" : "ComboBox", "hiddenName" : "office", "valueField" : "office", "allowBlank" : true, "editable" : false, "width" : 75, "$ xns" : "Roo.form", "mode" : "local", "name" : "office", "tpl" : "