3 "name": "Pman.Dialog.XtupleSalesOrderNew",
6 "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleSalesOrderNew.bjs",
10 "show": "function (_self)\n{\n _this.form.findField('cohead_cust_id').focus();\n}"
16 "title": "Create new Sales Order",
18 "xtype": "LayoutDialog",
23 "xtype": "LayoutRegion",
28 "xtype": "ContentPanel",
33 "rendered": "function (form)\n{\n _this.form = form;\n}"
40 "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.setValues({\n cohead_cust_id: res.cust_id,\n cohead_cust_id_cust_name : res.cust_name,\n cohead_curr_id : res.cust_curr_id,\n cohead_curr_id_curr_name : res.cust_curr_id_curr_name\n });\n \n \n })\n \n}\n\n",
41 "select": "function (combo, record, index)\n{\n \n Roo.log(record);\n _this.form.setValues({\n cohead_curr_id : record.data.cust_curr_id,\n cohead_curr_id_curr_name : record.data.cust_curr_id_curr_name\n \n });\n}"
44 "displayField": "cust_name",
46 "fieldLabel": "Select Customer",
47 "forceSelection": true,
48 "hiddenName": "cohead_cust_id",
50 "loadingText": "Searching...",
52 "name": "cohead_cust_id_cust_name",
54 "qtip": "Select custinfo",
55 "queryParam": "query[cust_name_begin]",
56 "selectOnFocus": true,
57 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{cust_name}</b> ({cust_number})</div>",
58 "triggerAction": "all",
60 "valueField": "cust_id",
67 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n\n // o.params['search[with_location]'] = 1;\n}\n"
72 "|sortInfo": "{ direction : 'ASC', field: 'cust_name' }",
80 "|url": "baseURL + '/Roo/custinfo.php'"
84 "xtype": "JsonReader",
88 "totalProperty": "total",
89 "|fields": "[{\"name\":\"cust_id\",\"type\":\"int\"},\"cust_name\"]"
97 "displayField": "curr_name",
99 "emptyText": "Select Currency",
100 "fieldLabel": "Currency",
101 "forceSelection": true,
102 "hiddenName": "cohead_curr_id",
104 "loadingText": "Searching...",
106 "name": "cohead_curr_id_curr_name",
108 "qtip": "Select Currency",
109 "queryParam": "query[curr_name]",
110 "selectOnFocus": true,
111 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{curr_name}</b> </div>",
112 "triggerAction": "all",
114 "valueField": "curr_id",
121 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n \n}\n"
126 "|sortInfo": "{ direction : 'ASC', field: 'curr_symbol' }",
131 "xtype": "HttpProxy",
134 "|url": "baseURL + '/Roo/curr_symbol.php'"
138 "xtype": "JsonReader",
142 "totalProperty": "total",
143 "|fields": "[{\"name\":\"curr_id\",\"type\":\"int\"},\"curr_symbol\"]"
155 "click": "function (_self, e)\n{\n _this.dialog.hide();\n \n }"
157 "*prop": "buttons[]",
164 "click": "function (_self, e)\n{\n //_this.findField('cuinfo_\n \n // check if customer is filled in.\n if (_this.form.findField('cohead_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('cohead_cust_id').lastData;\n\n var cur = _this.form.findField('cohead_curr_id').lastData; \n \n data.cohead_curr_id = cur.curr_id;\n// data.cohead_curr_id_curr_name = cur.cust_curr_id_curr_name;\n data.cohead_curr_id_curr_name = cur.curr_name;\n \n data.cohead_terms_id = c.cust_terms_id;\n data.cohead_terms_id_terms_descrip = c.cust_terms_id_terms_descrip;\n \n // fill in staff in/c..\n \n data.cohead_salesrep_id = Pman.Login.authUser.salesrep.salesrep_id;\n data.cohead_salesrep_id_salesrep_name = Pman.Login.authUser.salesrep.salesrep_name;\n \n data.cohead_display_salesrep_id = c.cust_salesrep_id;\n data.cohead_display_salesrep_id_salesrep_name = c.cust_salesrep_id_salesrep_name;\n \n data.cohead_orderdate = new Date();\n \n \n data.cohead_location_src = c.default_location_id;\n data.cohead_location_src_location_name = c.default_location_name;\n \n data.cohead_taxzone_id = c.cust_taxzone_id_taxzone_id;\n data.cohead_taxzone_id_taxzone_descrip = c.cust_taxzone_id_taxzone_descrip;\n \n // if customer is online .. .then do not fill this stuff in..\n \n if (c.cust_custtype_id_custtype_code == 'ONLINE') {\n Pman.Dialog.XtupleSalesOrder.show(data, function() {\n _this.dialog.hide();\n _this.callback()\n }); \n return;\n }\n \n new Pman.Request({\n url : baseURL + '/Roo/cntct.php',\n method : 'GET',\n params : {\n '_id' : c.cust_cntct_id\n },\n success : function (res){\n if(res.data){\n for(var i in res.data) {\n data['cohead_billto_cntct_id_' + i] = res.data[i];\n }\n }\n Pman.Dialog.XtupleSalesOrder.show(data, function() {\n _this.dialog.hide();\n _this.callback()\n }); \n }\n });\n \n \n \n}"
166 "*prop": "buttons[]",