{ "name" : "Pman.Dialog.XtupleCustomer", "parent" : "Pman", "title" : "", "path" : "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleCustomer.bjs", "permname" : "", "modOrder" : "001", "items" : [ { "modal" : true, "collapsible" : false, "title" : "Customer Information", "xtype" : "LayoutDialog", "width" : 900, "$ xns" : "Roo", "closable" : false, "resizable" : true, "height" : 670, "# builderCfg" : "{\"cols\":[{\"table\":\"custinfo\",\"column\":\"cust_custtype_id\",\"columnshort\":\"cust_custtype_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"custtype_id\",\"deps\":[{\"table\":\"custtype\",\"column\":\"cust_custtype_id_custtype_code\",\"columnshort\":\"custtype_code\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"custtype\",\"column\":\"cust_custtype_id_custtype_descrip\",\"columnshort\":\"custtype_descrip\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"custtype\",\"column\":\"cust_custtype_id_custtype_char\",\"columnshort\":\"custtype_char\",\"ctype\":\"bool\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Customer Type\",\"display\":\"cust_custtype_id_custtype_descrip\"},{\"table\":\"custinfo\",\"column\":\"cust_salesrep_id\",\"columnshort\":\"cust_salesrep_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"salesrep_id\",\"deps\":[{\"table\":\"salesrep\",\"column\":\"cust_salesrep_id_salesrep_active\",\"columnshort\":\"salesrep_active\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"salesrep\",\"column\":\"cust_salesrep_id_salesrep_number\",\"columnshort\":\"salesrep_number\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"salesrep\",\"column\":\"cust_salesrep_id_salesrep_name\",\"columnshort\":\"salesrep_name\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"salesrep\",\"column\":\"cust_salesrep_id_salesrep_commission\",\"columnshort\":\"salesrep_commission\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"salesrep\",\"column\":\"cust_salesrep_id_salesrep_method\",\"columnshort\":\"salesrep_method\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"salesrep\",\"column\":\"cust_salesrep_id_salesrep_emp_id\",\"columnshort\":\"salesrep_emp_id\",\"ctype\":\"int4\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Sales Rep\",\"display\":\"cust_salesrep_id_salesrep_name\"},{\"table\":\"custinfo\",\"column\":\"cust_commprcnt\",\"columnshort\":\"cust_commprcnt\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"cust_commprcnt\"},{\"table\":\"custinfo\",\"column\":\"cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Name\"},{\"table\":\"custinfo\",\"column\":\"cust_creditlmt\",\"columnshort\":\"cust_creditlmt\",\"ctype\":\"int4\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Credit Limit\",\"display\":\"cust_creditlmt_curr_id_curr_symbol\"},{\"table\":\"custinfo\",\"column\":\"cust_creditrating\",\"columnshort\":\"cust_creditrating\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Credit Rating\"},{\"table\":\"custinfo\",\"column\":\"cust_financecharge\",\"columnshort\":\"cust_financecharge\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Apply Finance Charge\"},{\"table\":\"custinfo\",\"column\":\"cust_backorder\",\"columnshort\":\"cust_backorder\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Allow Back Order\"},{\"table\":\"custinfo\",\"column\":\"cust_partialship\",\"columnshort\":\"cust_partialship\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Allow Partial Shipment\"},{\"table\":\"custinfo\",\"column\":\"cust_terms_id\",\"columnshort\":\"cust_terms_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"terms_id\",\"deps\":[{\"table\":\"terms\",\"column\":\"cust_terms_id_terms_code\",\"columnshort\":\"terms_code\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"terms\",\"column\":\"cust_terms_id_terms_descrip\",\"columnshort\":\"terms_descrip\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"terms\",\"column\":\"cust_terms_id_terms_type\",\"columnshort\":\"terms_type\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"terms\",\"column\":\"cust_terms_id_terms_duedays\",\"columnshort\":\"terms_duedays\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"terms\",\"column\":\"cust_terms_id_terms_discdays\",\"columnshort\":\"terms_discdays\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"terms\",\"column\":\"cust_terms_id_terms_discprcnt\",\"columnshort\":\"terms_discprcnt\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"terms\",\"column\":\"cust_terms_id_terms_cutoffday\",\"columnshort\":\"terms_cutoffday\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"terms\",\"column\":\"cust_terms_id_terms_ap\",\"columnshort\":\"terms_ap\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"terms\",\"column\":\"cust_terms_id_terms_ar\",\"columnshort\":\"terms_ar\",\"ctype\":\"bool\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Terms\",\"display\":\"cust_terms_id_terms_descrip\"},{\"table\":\"custinfo\",\"column\":\"cust_discntprcnt\",\"columnshort\":\"cust_discntprcnt\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Discount Percent\"},{\"table\":\"custinfo\",\"column\":\"cust_balmethod\",\"columnshort\":\"cust_balmethod\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Balance Method\"},{\"table\":\"custinfo\",\"column\":\"cust_ffshipto\",\"columnshort\":\"cust_ffshipto\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"is ff Ship To\"},{\"table\":\"custinfo\",\"column\":\"cust_shipform_id\",\"columnshort\":\"cust_shipform_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"shipform_id\",\"deps\":[{\"table\":\"shipform\",\"column\":\"cust_shipform_id_shipform_name\",\"columnshort\":\"shipform_name\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"shipform\",\"column\":\"cust_shipform_id_shipform_report_id\",\"columnshort\":\"shipform_report_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"shipform\",\"column\":\"cust_shipform_id_shipform_report_name\",\"columnshort\":\"shipform_report_name\",\"ctype\":\"text\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Shipment Form\",\"display\":\"cust_shipform_id_shipform_name\"},{\"table\":\"custinfo\",\"column\":\"cust_shipvia\",\"columnshort\":\"cust_shipvia\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship Via\"},{\"table\":\"custinfo\",\"column\":\"cust_creditstatus\",\"columnshort\":\"cust_creditstatus\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Credit Status\"},{\"table\":\"custinfo\",\"column\":\"cust_comments\",\"columnshort\":\"cust_comments\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Comments\"},{\"table\":\"custinfo\",\"column\":\"cust_ffbillto\",\"columnshort\":\"cust_ffbillto\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"is ff Bill To\"},{\"table\":\"custinfo\",\"column\":\"cust_number\",\"columnshort\":\"cust_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Customer #\"},{\"table\":\"custinfo\",\"column\":\"cust_dateadded\",\"columnshort\":\"cust_dateadded\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Added\"},{\"table\":\"custinfo\",\"column\":\"cust_curr_id\",\"columnshort\":\"cust_curr_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"curr_id\",\"deps\":[{\"table\":\"curr_symbol\",\"column\":\"cust_curr_id_curr_base\",\"columnshort\":\"curr_base\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"curr_symbol\",\"column\":\"cust_curr_id_curr_name\",\"columnshort\":\"curr_name\",\"ctype\":\"varchar\",\"desc\":\"\"},{\"table\":\"curr_symbol\",\"column\":\"cust_curr_id_curr_symbol\",\"columnshort\":\"curr_symbol\",\"ctype\":\"varchar\",\"desc\":\"\"},{\"table\":\"curr_symbol\",\"column\":\"cust_curr_id_curr_abbr\",\"columnshort\":\"curr_abbr\",\"ctype\":\"varchar\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Currency\",\"display\":\"cust_curr_id_curr_symbol\"},{\"table\":\"custinfo\",\"column\":\"cust_creditlmt_curr_id\",\"columnshort\":\"cust_creditlmt_curr_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"curr_id\",\"deps\":[{\"table\":\"curr_symbol\",\"column\":\"cust_creditlmt_curr_id_curr_base\",\"columnshort\":\"curr_base\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"curr_symbol\",\"column\":\"cust_creditlmt_curr_id_curr_name\",\"columnshort\":\"curr_name\",\"ctype\":\"varchar\",\"desc\":\"\"},{\"table\":\"curr_symbol\",\"column\":\"cust_creditlmt_curr_id_curr_symbol\",\"columnshort\":\"curr_symbol\",\"ctype\":\"varchar\",\"desc\":\"\"},{\"table\":\"curr_symbol\",\"column\":\"cust_creditlmt_curr_id_curr_abbr\",\"columnshort\":\"curr_abbr\",\"ctype\":\"varchar\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Credit Limit Currency\",\"display\":\"cust_creditlmt_curr_id_curr_symbol\"},{\"table\":\"custinfo\",\"column\":\"cust_cntct_id\",\"columnshort\":\"cust_cntct_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"cntct_id\",\"deps\":[{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_crmacct_id\",\"columnshort\":\"cntct_crmacct_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_addr_id\",\"columnshort\":\"cntct_addr_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_first_name\",\"columnshort\":\"cntct_first_name\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_last_name\",\"columnshort\":\"cntct_last_name\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_honorific\",\"columnshort\":\"cntct_honorific\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_initials\",\"columnshort\":\"cntct_initials\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_active\",\"columnshort\":\"cntct_active\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_phone\",\"columnshort\":\"cntct_phone\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_phone2\",\"columnshort\":\"cntct_phone2\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_fax\",\"columnshort\":\"cntct_fax\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_email\",\"columnshort\":\"cntct_email\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_webaddr\",\"columnshort\":\"cntct_webaddr\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_notes\",\"columnshort\":\"cntct_notes\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_title\",\"columnshort\":\"cntct_title\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_number\",\"columnshort\":\"cntct_number\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_middle\",\"columnshort\":\"cntct_middle\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_suffix\",\"columnshort\":\"cntct_suffix\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_owner_username\",\"columnshort\":\"cntct_owner_username\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_cntct_id_cntct_name\",\"columnshort\":\"cntct_name\",\"ctype\":\"text\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Contact\",\"display\":\"cust_cntct_id_cntct_name\"},{\"table\":\"custinfo\",\"column\":\"cust_corrcntct_id\",\"columnshort\":\"cust_corrcntct_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"cntct_id\",\"deps\":[{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_crmacct_id\",\"columnshort\":\"cntct_crmacct_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_addr_id\",\"columnshort\":\"cntct_addr_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_first_name\",\"columnshort\":\"cntct_first_name\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_last_name\",\"columnshort\":\"cntct_last_name\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_honorific\",\"columnshort\":\"cntct_honorific\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_initials\",\"columnshort\":\"cntct_initials\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_active\",\"columnshort\":\"cntct_active\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_phone\",\"columnshort\":\"cntct_phone\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_phone2\",\"columnshort\":\"cntct_phone2\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_fax\",\"columnshort\":\"cntct_fax\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_email\",\"columnshort\":\"cntct_email\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_webaddr\",\"columnshort\":\"cntct_webaddr\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_notes\",\"columnshort\":\"cntct_notes\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_title\",\"columnshort\":\"cntct_title\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_number\",\"columnshort\":\"cntct_number\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_middle\",\"columnshort\":\"cntct_middle\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_suffix\",\"columnshort\":\"cntct_suffix\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_owner_username\",\"columnshort\":\"cntct_owner_username\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cust_corrcntct_id_cntct_name\",\"columnshort\":\"cntct_name\",\"ctype\":\"text\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Corr? Contact\",\"display\":\"cust_corrcntct_id_cntct_name\"},{\"table\":\"custinfo\",\"column\":\"cust_taxzone_id\",\"columnshort\":\"cust_taxzone_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"taxzone_id\",\"deps\":[{\"table\":\"taxzone\",\"column\":\"cust_taxzone_id_taxzone_code\",\"columnshort\":\"taxzone_code\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"taxzone\",\"column\":\"cust_taxzone_id_taxzone_descrip\",\"columnshort\":\"taxzone_descrip\",\"ctype\":\"text\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Tax Zone\",\"display\":\"cust_taxzone_id_taxzone_descrip\"}],\"cols_ex\":[\"cust_custtype_id_custtype_descrip\",\"cust_salesrep_id_salesrep_name\",\"cust_terms_id_terms_descrip\",\"cust_shipform_id_shipform_name\",\"cust_curr_id_curr_symbol\",\"cust_creditlmt_curr_id_curr_symbol\",\"cust_cntct_id_cntct_name\",\"cust_corrcntct_id_cntct_name\",\"cust_taxzone_id_taxzone_descrip\"],\"table\":\"custinfo\",\"xtype\":\"LayoutDialog\",\"|xns\":\"Roo\"}", "items" : [ { "alwaysShowTabs" : true, "xtype" : "LayoutRegion", "$ xns" : "Roo", "tabPosition" : "top", "* prop" : "center", "items" : [ { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "xtype" : "Fill", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "click" : "function (_self, e)\n{\n var cid = _this.form.findField('cust_id').getValue();\n if(!cid){\n Roo.Msg.alert('Error','please save the customer first');\n return;\n }\n \n Pman.Dialog.XtupleCustomerCode.show({cust_id : cid}, function(res){\n _this.form.reset();\n _this.form.fireEvent('actioncomplete', _this.form, { type: 'setdata', data: {cust_id : res.cust_id} });\n \n });\n \n}" }, "text" : "Change Customer Code", "xtype" : "Button", "$ xns" : "Roo.Toolbar" } ] } ] }, { "background" : false, "region" : "center", "title" : "Details", "xtype" : "NestedLayoutPanel", "$ xns" : "Roo", "items" : [ { "xtype" : "BorderLayout", "$ xns" : "Roo", "* prop" : "layout", "items" : [ { "xtype" : "LayoutRegion", "$ xns" : "Roo", "* prop" : "center" }, { "xtype" : "LayoutRegion", "width" : 300, "$ xns" : "Roo", "* prop" : "east" }, { "region" : "center", "xtype" : "ContentPanel", "$ xns" : "Roo", "items" : [ { "listeners" : { "|actioncomplete" : "function(_self,action)\n{\n if (action.type == 'setdata') {\n \n _this.dialog.layout.getRegion('center').showPanel(0);\n \n if (_this.data.cust_id) {\n this.load({ method: 'GET', params: { '_id' : _this.data.cust_id, '_with_char' : true }});\n return;\n } \n this.findField('cust_active').setValue(true);\n _this.grid.ds.load({});\n _this.dialog.setTitle(\"New Customer\");\n\n \n \n return;\n }\n if (action.type == 'load') {\n \n _this.dialog.setTitle(\"Edit Customer (\" + _this.data.cust_id +\") \" + _this.form.findField('cust_name').getValue() );\n \n _this.grid.ds.load({});\n \n \n return;\n }\n if (action.type =='submit') {\n \n \n if (_this.data.cust_id > 0 ) {\n \n \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 // carry on editing.. and set data..\n\n _this.data.cust_id = action.result.data.cust_id;\n _this.form.fireEvent('actioncomplete', \n _this.form, { type: 'setdata', data: _this.data });\n \n \n }\n}\n", "|rendered" : "function (form)\n{\n _this.form= form;\n}\n" }, "$ url" : "baseURL + '/Roo/custinfo.php'", "xtype" : "Form", "method" : "POST", "style" : "margin:10px;", "$ xns" : "Roo.form", "items" : [ { "xtype" : "FieldSet", "legend" : "Basic Details", "style" : "width:460px", "$ xns" : "Roo.form", "items" : [ { "fieldLabel" : "Login Email", "vtype" : "email", "xtype" : "TextField", "allowBlank" : false, "width" : 300, "$ xns" : "Roo.form", "name" : "cust_login_email" }, { "listeners" : { "keyup" : "function (_self, e)\n{\n if (!(_this.form.findField('cust_id').getValue() * 1)) {\n \n _this.form.findField('cust_number').setValue(this.getValue().replace(/[^a-z0-9]/ig, '').toUpperCase());\n \n }\n}" }, "fieldLabel" : "Name", "xtype" : "TextField", "allowBlank" : false, "width" : 300, "$ xns" : "Roo.form", "name" : "cust_name" }, { "xtype" : "Row", "$ xns" : "Roo.form", "items" : [ { "fieldLabel" : "Customer #", "xtype" : "TextField", "allowBlank" : false, "readOnly" : true, "width" : 150, "$ xns" : "Roo.form", "name" : "cust_number" }, { "listWidth" : 250, "triggerAction" : "all", "fieldLabel" : "BG Company", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "charopt_value", "emptyText" : "", "hiddenName" : "cust_char_internalcompany", "minChars" : 2, "valueField" : "charopt_value", "xtype" : "ComboBox", "allowBlank" : true, "typeAhead" : true, "editable" : false, "width" : 70, "$ xns" : "Roo.form", "name" : "cust_char_internalcompany", "qtip" : "Select charopt", "tpl" : "
{charopt_value}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params.charopt_char_id_char_name = 'INTERNALCOMPANY';\n o.params['!charopt_value'] = baseURL.split('/').pop().split('.').shift();\n \n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'id' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/charopt.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"charopt_value\",\"type\":\"string\"}]", "* prop" : "reader", "totalProperty" : "total" } ] } ] } ] }, { "xtype" : "Row", "$ xns" : "Roo.form", "width" : 500, "items" : [ { "fieldLabel" : "Active", "$ inputValue" : true, "xtype" : "Checkbox", "valueOff" : 0, "width" : 100, "$ xns" : "Roo.form", "name" : "cust_active" }, { "labelAlign" : "right", "xtype" : "Row", "labelWidth" : 50, "$ xns" : "Roo.form", "items" : [ { "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Type", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "custtype_descrip", "emptyText" : "Select Type", "hiddenName" : "cust_custtype_id", "minChars" : 2, "valueField" : "custtype_id", "xtype" : "ComboBox", "allowBlank" : false, "typeAhead" : true, "editable" : false, "width" : 160, "$ xns" : "Roo.form", "name" : "cust_custtype_id_custtype_descrip", "qtip" : "Select custtype", "queryParam" : "q[cust_descript]", "tpl" : "
{custtype_code} {custtype_descrip}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ xns" : "Roo.data", "$ sortInfo" : "{ direction : 'ASC', field: 'id' }", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/custtype.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"custtype_code\",\"type\":\"string\"}]", "* prop" : "reader", "totalProperty" : "total" } ] } ] } ] } ] }, { "fieldLabel" : "AU POST #", "xtype" : "TextField", "width" : 150, "$ xns" : "Roo.form", "name" : "cust_char_au_post_accno" }, { "listWidth" : 250, "triggerAction" : "all", "fieldLabel" : "Forecast Type", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "charopt_value", "emptyText" : "", "hiddenName" : "cust_char_salesforecast", "minChars" : 2, "valueField" : "charopt_value", "xtype" : "ComboBox", "allowBlank" : true, "typeAhead" : true, "editable" : false, "width" : 150, "$ xns" : "Roo.form", "name" : "cust_char_salesforecast", "qtip" : "Select charopt", "tpl" : "
{charopt_value}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params.charopt_char_id_char_name = 'SALESFORECAST';\n \n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'id' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/charopt.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"charopt_value\",\"type\":\"string\"}]", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "fieldLabel" : "Comments", "xtype" : "TextArea", "width" : 300, "$ xns" : "Roo.form", "name" : "cust_comments", "height" : 50 }, { "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Currency", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "curr_symbol", "emptyText" : "Select curr_symbol", "hiddenName" : "cust_curr_id", "minChars" : 2, "valueField" : "curr_id", "xtype" : "ComboBox", "allowBlank" : false, "typeAhead" : true, "editable" : false, "width" : 100, "$ xns" : "Roo.form", "name" : "cust_curr_id_curr_symbol", "qtip" : "Select curr_symbol", "queryParam" : "query[curr_symbol]", "tpl" : "
{curr_symbol}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'curr_symbol' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/curr_symbol.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "curr_id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[{\"name\":\"curr_id\",\"type\":\"int\"},\"curr_symbol\"]", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "listWidth" : 400, "triggerAction" : "all", "forceSelection" : true, "selectOnFocus" : true, "fieldLabel" : "Tax Zone", "pageSize" : 20, "xtype" : "ComboBox", "emptyText" : "Select taxzone", "minChars" : 2, "valueField" : "taxzone_id", "displayField" : "taxzone_descrip", "hiddenName" : "cust_taxzone_id", "allowBlank" : false, "typeAhead" : true, "editable" : false, "$ xns" : "Roo.form", "width" : 300, "qtip" : "Select taxzone", "tpl" : "
{taxzone_descrip}
", "queryParam" : "query[taxzone_descrip]", "name" : "cust_taxzone_id_taxzone_descrip", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'taxzone_descrip' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/taxzone.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "taxzone_id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[{\"name\":\"taxzone_id\",\"type\":\"int\"},\"taxzone_descrip\"]", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "listWidth" : 400, "triggerAction" : "all", "forceSelection" : true, "selectOnFocus" : true, "fieldLabel" : "Sales Rep", "pageSize" : 20, "xtype" : "ComboBox", "emptyText" : "Select salesrep", "minChars" : 2, "valueField" : "salesrep_id", "displayField" : "salesrep_name", "hiddenName" : "cust_salesrep_id", "allowBlank" : false, "typeAhead" : true, "editable" : false, "$ xns" : "Roo.form", "width" : 300, "qtip" : "Select salesrep", "tpl" : "
{salesrep_name}
", "queryParam" : "query[salesrep_name]", "name" : "cust_salesrep_id_salesrep_name", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'salesrep_name' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/salesrep.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "salesrep_id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[{\"name\":\"salesrep_id\",\"type\":\"int\"},\"salesrep_name\"]", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "alwaysQuery" : true, "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Price Level", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 50, "displayField" : "ipshead_name", "emptyText" : "Select price level", "hiddenName" : "ipshead_id", "minChars" : 2, "valueField" : "ipshead_id", "xtype" : "ComboBox", "allowBlank" : true, "typeAhead" : true, "editable" : false, "width" : 300, "$ xns" : "Roo.form", "name" : "ipshead_id_name", "qtip" : "Select ipshead", "queryParam" : "q", "tpl" : "
{ipshead_name}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n o.params.ipshead_curr_id = _this.form.findField('cust_curr_id').getValue();\n // set more here\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'ipshead_id_name' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/ipshead.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"ipshead_name\",\"type\":\"string\"}]", "* prop" : "reader", "totalProperty" : "total" } ] } ] } ] }, { "xtype" : "FieldSet", "legend" : "Financial", "style" : "width:420px", "$ xns" : "Roo.form", "items" : [ { "listWidth" : 400, "triggerAction" : "all", "forceSelection" : true, "selectOnFocus" : true, "fieldLabel" : "Terms", "pageSize" : 20, "xtype" : "ComboBox", "emptyText" : "Select terms", "minChars" : 2, "valueField" : "terms_id", "displayField" : "terms_descrip", "hiddenName" : "cust_terms_id", "allowBlank" : false, "typeAhead" : true, "editable" : false, "$ xns" : "Roo.form", "width" : 300, "qtip" : "Select terms", "tpl" : "
{terms_descrip}
", "queryParam" : "query[terms_descrip]", "name" : "cust_terms_id_terms_descrip", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'terms_descrip' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/terms.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "terms_id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[{\"name\":\"terms_id\",\"type\":\"int\"},\"terms_descrip\"]", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "fieldLabel" : "Credit Limit", "align" : "right", "xtype" : "NumberField", "$ xns" : "Roo.form", "width" : 100, "name" : "cust_creditlmt" } ] }, { "xtype" : "FieldSet", "legend" : "Shipping", "style" : "width:420px", "$ xns" : "Roo.form", "items" : [ { "listWidth" : 400, "triggerAction" : "all", "forceSelection" : true, "selectOnFocus" : true, "fieldLabel" : "Shipment Form", "pageSize" : 20, "xtype" : "ComboBox", "emptyText" : "Select shipform", "minChars" : 2, "valueField" : "shipform_id", "displayField" : "shipform_name", "hiddenName" : "cust_shipform_id", "allowBlank" : false, "typeAhead" : true, "editable" : false, "$ xns" : "Roo.form", "width" : 300, "qtip" : "Select shipform", "tpl" : "
{shipform_name}
", "queryParam" : "query[shipform_name]", "name" : "cust_shipform_id_shipform_name", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'shipform_name' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/shipform.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "shipform_id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[{\"name\":\"shipform_id\",\"type\":\"int\"},\"shipform_name\"]", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "fieldLabel" : "Ship Via", "xtype" : "TextField", "$ xns" : "Roo.form", "width" : 300, "name" : "cust_shipvia" } ] }, { "xtype" : "FieldSet", "legend" : "Reference", "style" : "width:420px", "$ xns" : "Roo.form", "items" : [ { "fieldLabel" : "Date Added", "format" : "Y-m-d", "xtype" : "TextField", "readOnly" : true, "width" : 100, "$ xns" : "Roo.form", "name" : "cust_dateadded" } ] }, { "xtype" : "Hidden", "$ xns" : "Roo.form", "name" : "cust_cntct_id" }, { "xtype" : "Hidden", "$ xns" : "Roo.form", "name" : "cust_creditlmt_curr_id" }, { "$ update" : "function() {\n var ship = [];\n _this.grid.ds.each(function(r) {\n if (r.data.is_ship * 1) {\n ship.push(r.data.cntct_id);\n }\n });\n this.setValue(ship.join(','));\n}\n", "xtype" : "Hidden", "$ xns" : "Roo.form", "name" : "shiplist" }, { "xtype" : "Hidden", "$ xns" : "Roo.form", "name" : "cust_id" } ] } ] }, { "listeners" : { "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.ds.load({});\n }\n}" }, "background" : false, "fitToframe" : true, "region" : "east", "title" : "cntct", "xtype" : "GridPanel", "fitContainer" : true, "$ xns" : "Roo", "# builderCfg" : "{\"cols\":[{\"table\":\"addr\",\"column\":\"cntct_addr_id_addr_line1\",\"columnshort\":\"addr_line1\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"},{\"table\":\"addr\",\"column\":\"cntct_addr_id_addr_line2\",\"columnshort\":\"addr_line2\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"cntct_addr_id_addr_line3\",\"columnshort\":\"addr_line3\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"cntct_addr_id_addr_country\",\"columnshort\":\"addr_country\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"cntct\",\"column\":\"cntct_phone\",\"columnshort\":\"cntct_phone\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"cntct\",\"column\":\"cntct_phone2\",\"columnshort\":\"cntct_phone2\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"cntct\",\"column\":\"cntct_name\",\"columnshort\":\"cntct_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}],\"cols_ex\":[\"cntct_addr_id_addr_line1\"],\"table\":\"cntct\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}", "tableName" : "cntct", "items" : [ { "listeners" : { "|rowdblclick" : "function (_self, rowIndex, e)\n{\n \n var d =this.getDataSource().getAt(rowIndex).data;\n Pman.Dialog.XtupleContact.show( \n {\n cntct_id : d.cntct_id , \n customer_id : _this.form.findField('cust_id').getValue()\n } , function() {\n _this.grid.ds.load({});\n });\n}\n", "cellclick" : "function (_self, rowIndex, columnIndex, e)\n{\n\n if (columnIndex > 1 ) {\n return;\n } \n var d = this.ds.getAt(rowIndex);\n var f = this.cm.getDataIndex(columnIndex);\n \n // toggle it..\n\n d.set(f, d.data[f] * 1 ? 0 : 1);\n \n \n if (f == 'is_main' && d.data[f] > 0 ) { // removed..\n // set new main contact - remove old..\n var cc = _this.form.findField('cust_cntct_id');\n var old = cc.getValue() * 1;\n if (old > 1) {\n this.ds.each(function(r) {\n if (r.data.cntct_id == old) {\n r.set('is_main', 0);\n }\n });\n }\n cc.setValue(d.data.cntct_id);\n }\n // sort out shipping.\n _this.form.findField('shiplist').update();\n \n \n}", "|render" : "function() \n{\n _this.grid = this; \n\n if (_this.panel.active) {\n this.ds.load({});\n }\n}" }, "autoExpandColumn" : "cntct_addr_id_addr_line1", "xtype" : "Grid", "loadMask" : true, "$ xns" : "Roo.grid", "* prop" : "grid", "# builderCfg" : "{\"cols\":[{\"table\":\"addr\",\"column\":\"cntct_addr_id_addr_line1\",\"columnshort\":\"addr_line1\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"},{\"table\":\"addr\",\"column\":\"cntct_addr_id_addr_line2\",\"columnshort\":\"addr_line2\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"cntct_addr_id_addr_line3\",\"columnshort\":\"addr_line3\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"cntct_addr_id_addr_country\",\"columnshort\":\"addr_country\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"cntct\",\"column\":\"cntct_phone\",\"columnshort\":\"cntct_phone\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"cntct\",\"column\":\"cntct_phone2\",\"columnshort\":\"cntct_phone2\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"cntct\",\"column\":\"cntct_name\",\"columnshort\":\"cntct_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}],\"cols_ex\":[\"cntct_addr_id_addr_line1\"],\"table\":\"cntct\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}", "items" : [ { "listeners" : { "beforeload" : "function (_self, options)\n{\n options.params = options.params || {};\n options.params.limit = 99;\n options.params._customer_id = _this.form.findField('cust_id').getValue() * 1;\n if (options.params._customer_id < 1) {\n this.removeAll();\n _this.grid.view.el.mask(\"Save first\");\n return false;\n }\n options.params._add_is_types = 1;\n _this.grid.view.el.unmask(); \n}", "load" : "function (_self, records, options)\n{\n var cc = _this.form.findField('cust_cntct_id');\n var old = cc.getValue() * 1;\n if (old > 1) {\n Roo.each(records,function(r) {\n if (r.data.cntct_id == old) {\n r.set('is_main',1);\n }\n });\n }\n (function() { \n _this.form.findField('shiplist').update();\n }).defer(50);\n}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field : 'cntct_name', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "dataSource", "items" : [ { "$ url" : "baseURL + '/Roo/cntct.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[\n {\n 'name': 'cntct_addr_id_addr_line1',\n 'type': 'string'\n },\n {\n 'name': 'cntct_addr_id_addr_line2',\n 'type': 'string'\n },\n {\n 'name': 'cntct_addr_id_addr_line3',\n 'type': 'string'\n },\n {\n 'name': 'cntct_addr_id_addr_country',\n 'type': 'string'\n },\n {\n 'name': 'cntct_phone',\n 'type': 'string'\n },\n {\n 'name': 'cntct_phone2',\n 'type': 'string'\n },\n {\n 'name': 'cntct_name',\n 'type': 'string'\n }\n]", "* prop" : "reader", "totalProperty" : "total", "# builderCfg" : "{\"cols\":[{\"table\":\"addr\",\"column\":\"cntct_addr_id_addr_line1\",\"columnshort\":\"addr_line1\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"},{\"table\":\"addr\",\"column\":\"cntct_addr_id_addr_line2\",\"columnshort\":\"addr_line2\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"cntct_addr_id_addr_line3\",\"columnshort\":\"addr_line3\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"cntct_addr_id_addr_country\",\"columnshort\":\"addr_country\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"cntct\",\"column\":\"cntct_phone\",\"columnshort\":\"cntct_phone\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"cntct\",\"column\":\"cntct_phone2\",\"columnshort\":\"cntct_phone2\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"cntct\",\"column\":\"cntct_name\",\"columnshort\":\"cntct_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}],\"cols_ex\":[\"cntct_addr_id_addr_line1\"],\"table\":\"cntct\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}" } ] }, { "xtype" : "RowSelectionModel", "singleSelect" : true, "$ xns" : "Roo.grid", "* prop" : "sm" }, { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "xtype" : "Fill", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "|click" : "function()\n{\n \n \n Pman.Dialog.XtupleQuickContact.show( \n {\n _id : 0,\n customer_id : _this.form.findField('cust_id').getValue()\n },\n \n function (data) {\n _this.grid.ds.load({});\n }\n ); \n\n \n}\n" }, "text" : "Add", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "|click" : "function()\n{\n // will this work?\n var sel = _this.grid.sm.getSelected();\n if (!sel || !sel.data.cntct_id) {\n Roo.MessageBox.alert(\"Error\", \"Select a contact to delete\");\n return;\n }\n new Pman.Request({\n url : baseURL + '/Roo/cntct',\n method : 'POST',\n params : {\n _delete : sel.data.cntct_id\n },\n success : function() \n {\n _this.grid.ds.load({});\n }\n });\n \n \n \n}\n " }, "text" : "Delete", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'", "$ xns" : "Roo.Toolbar" } ] }, { "xtype" : "ColumnModel", "header" : "Main", "width" : 30, "$ renderer" : "function(v,x,r) { \n\n return '';\n \n \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "is_main" }, { "xtype" : "ColumnModel", "header" : "Ship", "width" : 30, "$ renderer" : "function(v,x,r) { \n\n// simple view of address:\n return '';\n \n \n \n \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "is_ship" }, { "xtype" : "ColumnModel", "header" : "Contact / Address", "width" : 200, "$ renderer" : "function(v,x,r) { \n\n// simple view of address:\n\n var add = [];\n Roo.each([ 'line1', 'line2', 'line3', 'city', 'state', 'country'], function (k) {\n if (!r.data['cntct_addr_id_addr_' + k].length) {\n return;\n }\n add.push(String.format(\"{0}\", r.data['cntct_addr_id_addr_' + k]));\n \n });\n\n return String.format(\n 'Name: {0}
' + \n 'Phone: {1} / Mobile: {2}
' + \n 'Email: {3}' + \n (add.length ? '
' : '') + '' + add.join('
') + '
',\n \n r.data.cntct_name,\n r.data.cntct_phone,\n r.data.cntct_phone2,\n \n r.data.cntct_email\n );\n \n \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "cntct_addr_id_addr_line1" } ] } ] } ] } ] }, { "listeners" : { "|activate" : "function() {\n _this.hpanel = this;\n if (_this.hgrid) {\n _this.hgrid.footer.onClick('first');\n }\n}" }, "fitToframe" : true, "background" : true, "region" : "center", "title" : "History", "xtype" : "GridPanel", "fitContainer" : true, "$ xns" : "Roo", "tableName" : "cohist", "items" : [ { "listeners" : { "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n _this.grid.footer.onClick('first');\n }); \n}\n", "|render" : "function() \n{\n _this.hgrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.hpanel.active) {\n this.footer.onClick('first');\n }\n}" }, "autoExpandColumn" : "item_descrip1", "xtype" : "Grid", "loadMask" : true, "$ xns" : "Roo.grid", "* prop" : "grid", "items" : [ { "listeners" : { "beforeload" : "function (_self, o)\n{\n\n \n Roo.apply(o.params, {\n _group : 'salesHistory',\n _name : 'detail',\n 'cust_id:number' : _this.form.findField('cust_id').getValue(),\n 'credit:text' : 'credit',\n 'return:text' : 'return',\n 'includeFormatted:int' : 1,\n 'startDate:text' : _this.dateFrom.getValue(),\n 'endDate:text' : _this.dateTo.getValue()\n });\n \n \n \n}", "load" : "function (_self, records, options)\n{\n function setText(str) {\n \n _this.hgrid.footer.el.select('.sales-footer-text', \n true).first().dom.innerHTML = str;\n }\n \n \n if (!records.length) {\n //_this.footertext.setText('');\n Roo.log(\"no records\");\n setText('');\n return;\n }\n new Pman.Request({\n method : 'GET',\n url : baseURL + '/Roo/cohist',\n params : {\n _sums : 1,\n \n cust_id : _this.form.findField('cust_id').getValue(),\n startDate : _this.dateFrom.getValue(),\n endDate : _this.dateTo.getValue()\n },\n success : function(res) \n {\n setText(\"Total Orders : \" + parseInt(res.data[0].total_orders) + \n \" Total Shipped : \" + parseInt(res.data[0].total_shipped) + \n \" Total Value: \" + res.data[0].total_basecurr + \" \" +\n Roo.util.Format.number(res.data[0].total_value,2)\n );\n }\n });\n \n \n}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field : 'cohist_shipvia', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "dataSource", "items" : [ { "$ url" : "baseURL + '/Roo/metasql.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[\n {\n 'name': 'cohist_id',\n 'type': 'int'\n },\n {\n 'name': 'cohist_cust_id',\n 'type': 'int'\n },\n {\n 'name': 'cohist_itemsite_id',\n 'type': 'int'\n },\n {\n 'name': 'cohist_shipdate',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'cohist_shipvia',\n 'type': 'string'\n },\n {\n 'name': 'cohist_ordernumber',\n 'type': 'string'\n },\n {\n 'name': 'cohist_orderdate',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'cohist_invcnumber',\n 'type': 'string'\n },\n {\n 'name': 'cohist_invcdate',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'cohist_qtyshipped',\n 'type': 'float'\n },\n {\n 'name': 'cohist_unitprice',\n 'type': 'float'\n },\n {\n 'name': 'cohist_shipto_id',\n 'type': 'int'\n },\n {\n 'name': 'cohist_salesrep_id',\n 'type': 'int'\n },\n {\n 'name': 'cohist_duedate',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'cohist_imported',\n 'type': 'int'\n },\n {\n 'name': 'cohist_billtoname',\n 'type': 'string'\n },\n {\n 'name': 'cohist_billtoaddress1',\n 'type': 'string'\n },\n {\n 'name': 'cohist_billtoaddress2',\n 'type': 'string'\n },\n {\n 'name': 'cohist_billtoaddress3',\n 'type': 'string'\n },\n {\n 'name': 'cohist_billtocity',\n 'type': 'string'\n },\n {\n 'name': 'cohist_billtostate',\n 'type': 'string'\n },\n {\n 'name': 'cohist_billtozip',\n 'type': 'string'\n },\n {\n 'name': 'cohist_shiptoname',\n 'type': 'string'\n },\n {\n 'name': 'cohist_shiptoaddress1',\n 'type': 'string'\n },\n {\n 'name': 'cohist_shiptoaddress2',\n 'type': 'string'\n },\n {\n 'name': 'cohist_shiptoaddress3',\n 'type': 'string'\n },\n {\n 'name': 'cohist_shiptocity',\n 'type': 'string'\n },\n {\n 'name': 'cohist_shiptostate',\n 'type': 'string'\n },\n {\n 'name': 'cohist_shiptozip',\n 'type': 'string'\n },\n {\n 'name': 'cohist_commission',\n 'type': 'float'\n },\n {\n 'name': 'cohist_commissionpaid',\n 'type': 'int'\n },\n {\n 'name': 'cohist_unitcost',\n 'type': 'float'\n },\n {\n 'name': 'cohist_misc_type',\n 'type': 'string'\n },\n {\n 'name': 'cohist_misc_descrip',\n 'type': 'string'\n },\n {\n 'name': 'cohist_misc_id',\n 'type': 'int'\n },\n {\n 'name': 'cohist_doctype',\n 'type': 'string'\n },\n {\n 'name': 'cohist_promisedate',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'cohist_ponumber',\n 'type': 'string'\n },\n {\n 'name': 'cohist_curr_id',\n 'type': 'int'\n },\n {\n 'name': 'cohist_sequence',\n 'type': 'int'\n },\n {\n 'name': 'cohist_taxtype_id',\n 'type': 'int'\n },\n {\n 'name': 'cohist_taxzone_id',\n 'type': 'int'\n },\n {\n 'name': 'cohist_curr_id_curr_id',\n 'type': 'int'\n },\n {\n 'name': 'cohist_curr_id_curr_base',\n 'type': 'int'\n },\n {\n 'name': 'cohist_curr_id_curr_name',\n 'type': 'string'\n },\n {\n 'name': 'cohist_curr_id_curr_symbol',\n 'type': 'string'\n },\n {\n 'name': 'cohist_curr_id_curr_abbr',\n 'type': 'string'\n },\n {\n 'name': 'cohist_taxzone_id_taxzone_id',\n 'type': 'int'\n },\n {\n 'name': 'cohist_taxzone_id_taxzone_code',\n 'type': 'string'\n },\n {\n 'name': 'cohist_taxzone_id_taxzone_descrip',\n 'type': 'string'\n },\n {\n 'name': 'cohist_taxtype_id_taxtype_id',\n 'type': 'int'\n },\n {\n 'name': 'cohist_taxtype_id_taxtype_name',\n 'type': 'string'\n },\n {\n 'name': 'cohist_taxtype_id_taxtype_descrip',\n 'type': 'string'\n },\n {\n 'name': 'cohist_taxtype_id_taxtype_sys',\n 'type': 'int'\n }\n]", "* prop" : "reader", "totalProperty" : "total" } ] }, { "pageSize" : 25, "xtype" : "PagingToolbar", "emptyMsg" : "No cohist found", "$ xns" : "Roo", "displayMsg" : "Displaying Sales {0} - {1} of {2}", "displayInfo" : true, "* prop" : "footer", "items" : [ { "text" : "", "xtype" : "TextItem", "$ xns" : "Roo.Toolbar" } ] }, { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "text" : "From", "xtype" : "TextItem", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "render" : "function (_self)\n{\n _this.dateFrom = _self;\n}" }, "format" : "d/M/Y", "xtype" : "DateField", "useIso" : true, "| value" : "(function() {return (new Date()).add(Date.MONTH, -3); })()", "$ xns" : "Roo.form" }, { "text" : "To", "xtype" : "TextItem", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "render" : "function (_self)\n{\n_this.dateTo = _self;\n}" }, "format" : "d/M/Y", "xtype" : "DateField", "useIso" : true, "| value" : "(function() {return (new Date()) })()", "$ xns" : "Roo.form" }, { "listeners" : { "click" : "function (_self, e)\n{\n _this.hgrid.footer.onClick('first');\n}" }, "text" : "Refresh", "xtype" : "Button", "$ xns" : "Roo.Toolbar" }, { "xtype" : "Fill", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "click" : "function (_self, e)\n{\n new Pman.Download({\n grid : _this.hgrid\n });\n}" }, "text" : "Download", "xtype" : "Button", "$ xns" : "Roo.Toolbar" } ] }, { "xtype" : "ColumnModel", "header" : "Customer", "width" : 75, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "cust_name" }, { "xtype" : "ColumnModel", "header" : "Order", "width" : 75, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "cohist_ordernumber" }, { "xtype" : "ColumnModel", "header" : "Invoice Month", "width" : 75, "$ renderer" : "function(v) { \n \n return String.format('{0}',v);\n }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "invmonth" }, { "xtype" : "ColumnModel", "header" : "Invoice date", "width" : 75, "$ renderer" : "function(v) { \n var d = Date.parseDate(v, 'Y-m-d');\n return String.format('{0}', d ? d.format('d/M/Y') : '');\n }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "cohead_orderdate" }, { "xtype" : "ColumnModel", "header" : "Invoice date", "width" : 75, "$ renderer" : "function(v) { \n var d = Date.parseDate(v, 'Y-m-d');\n return String.format('{0}', d ? d.format('d/M/Y') : '');\n }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "cohist_invcdate" }, { "xtype" : "ColumnModel", "header" : "Invoice#", "width" : 75, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "cohist_invcnumber" }, { "xtype" : "ColumnModel", "header" : "Item No.", "width" : 75, "$ renderer" : "function(v) { return String.format('{0}', v ? v : ''); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "item_number" }, { "xtype" : "ColumnModel", "header" : "Description", "width" : 200, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "item_descrip1" }, { "align" : "right", "xtype" : "ColumnModel", "header" : "Qty", "width" : 70, "$ renderer" : "function(v) { return parseInt(v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "cohist_qtyshipped" }, { "xtype" : "ColumnModel", "header" : "Currency", "width" : 75, "$ renderer" : "function(v) { return String.format('{0}', v.split(/\\s+/)[0]); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "currabbr" }, { "align" : "right", "xtype" : "ColumnModel", "header" : "Unit Price", "width" : 75, "$ renderer" : "function(v) { return Roo.util.Format.number( v, 2); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "cohist_unitprice" }, { "align" : "right", "xtype" : "ColumnModel", "header" : "Ext Cost", "width" : 75, "$ renderer" : "function(v) { return Roo.util.Format.number( v, 2); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "extprice" } ] } ] }, { "listeners" : { "|activate" : "function() {\n _this.ipanel = this;\n if (_this.igrid) {\n _this.igrid.footer.onClick('first');\n }\n}" }, "region" : "center", "fitToframe" : true, "background" : true, "title" : "Images", "xtype" : "GridPanel", "fitContainer" : true, "$ xns" : "Roo", "tableName" : "Images", "items" : [ { "listeners" : { "rowdblclick" : "function (_self, rowIndex, e)\n{\n var s = _self.getDataSource().getAt(rowIndex);\n \n new Pman.Download({\n url : baseURL + '/Images/Download/' + s.data.id\n });\n \n}", "|render" : "function() \n{\n _this.igrid = this; \n\n if (_this.ipanel.active) {\n this.footer.onClick('first');\n }\n}" }, "autoExpandColumn" : "imgtype", "xtype" : "Grid", "loadMask" : true, "$ xns" : "Roo.grid", "* prop" : "grid", "items" : [ { "listeners" : { "beforeload" : "function (_self, o)\n{\n o.params = o.params || {}\n \n var cust_id = _this.form.findField('cust_id').getValue() * 1;\n \n if(cust_id < 1){\n this.removeAll();\n return false;\n }\n\n o.params.ontable = 'custinfo';\n o.params.onid = cust_id;\n}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field : 'id', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "dataSource", "items" : [ { "$ url" : "baseURL + '/Roo/Images.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'filename',\n 'type': 'string'\n },\n {\n 'name': 'imgtype',\n 'type': 'string'\n },\n {\n 'name': 'created',\n 'type': 'date',\n 'dateFormat': 'Y-m-d H:i:s'\n }\n]", "* prop" : "reader", "totalProperty" : "total" } ] }, { "pageSize" : 25, "xtype" : "PagingToolbar", "emptyMsg" : "No Images found", "$ xns" : "Roo", "displayMsg" : "Displaying Images {0} - {1} of {2}", "displayInfo" : true, "* prop" : "footer" }, { "xtype" : "ColumnModel", "header" : "Image", "width" : 100, "$ renderer" : "function(v,x,r) {\n return String.format('', baseURL, v, r.data.filename);\n}", "$ xns" : "Roo.grid", "* prop" : "cm[]", "dataIndex" : "id" }, { "xtype" : "ColumnModel", "width" : 150, "header" : "Date", "$ renderer" : "function(v) { \n return String.format('{0}', v ? v.format('d/M/Y') : '');\n }", "$ xns" : "Roo.grid", "* prop" : "cm[]", "dataIndex" : "created" }, { "xtype" : "ColumnModel", "header" : "File Name", "width" : 200, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "cm[]", "dataIndex" : "filename" }, { "xtype" : "ColumnModel", "header" : "Type", "width" : 200, "$ renderer" : "function(v) { \n return String.format('{0}',v);\n }", "$ xns" : "Roo.grid", "* prop" : "cm[]", "dataIndex" : "imgtype" } ] } ] }, { "listeners" : { "click" : "function (_self, e)\n{\n _this.dialog.hide();\n}" }, "text" : "Cancel", "xtype" : "Button", "$ xns" : "Roo", "* prop" : "buttons[]" }, { "listeners" : { "click" : "function (_self, e)\n{\n // do some checks?\n \n var bg_comp = _this.form.findField('cust_char_internalcompany').getValue();\n var ctype = _this.form.findField('cust_custtype_id').el.dom.value;\n if (bg_comp.length && !ctype.match(/internal/i)) {\n Roo.MessageBox.alert(\"Error\" ,\n \"BG Company should only be set for internal companies\"\n );\n return;\n }\n \n \n \n \n \n \n \n _this.form.doAction(\"submit\");\n\n}" }, "text" : "Save", "xtype" : "Button", "$ xns" : "Roo", "* prop" : "buttons[]" } ] } ] }