Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleCreditMemoNew.bjs
1 {
2     "id": "roo-file-4",
3     "name": "Pman.Dialog.XtupleCreditMemoNew",
4     "parent": "",
5     "title": "",
6     "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleCreditMemoNew.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "show": "function (_self)\n{\n    _this.form.findField('cmhead_cust_id').focus();\n}"
11             },
12             "closable": false,
13             "height": 120,
14             "modal": true,
15             "resizable": false,
16             "title": "Create new Credit Memo",
17             "width": 500,
18             "xtype": "LayoutDialog",
19             "|xns": "Roo",
20             "items": [
21                 {
22                     "|xns": "Roo",
23                     "xtype": "LayoutRegion",
24                     "*prop": "center"
25                 },
26                 {
27                     "region": "center",
28                     "xtype": "ContentPanel",
29                     "|xns": "Roo",
30                     "items": [
31                         {
32                             "listeners": {
33                                 "rendered": "function (form)\n{\n  _this.form = form;\n}"
34                             },
35                             "xtype": "Form",
36                             "|xns": "Roo.form",
37                             "items": [
38                                 {
39                                     "listeners": {
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.findField('cmhed_cust_id_cust_name').setValue(res.cust_id);\n        _this.form.findField('cmhed_cust_id_cust_name').el.dom.value = res.cust_name;\n        \n    })\n    \n}\n\n"
41                                     },
42                                     "allowBlank": false,
43                                     "displayField": "cust_name",
44                                     "editable": true,
45                                     "fieldLabel": "Select Customer",
46                                     "forceSelection": true,
47                                     "hiddenName": "cmhead_cust_id",
48                                     "listWidth": 400,
49                                     "loadingText": "Searching...",
50                                     "minChars": 2,
51                                     "name": "cmhead_cust_id_cust_name",
52                                     "pageSize": 20,
53                                     "qtip": "Select custinfo",
54                                     "queryParam": "query[cust_name]",
55                                     "selectOnFocus": true,
56                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\">{cust_number}: <b>{cust_name}</b> </div>",
57                                     "triggerAction": "all",
58                                     "typeAhead": true,
59                                     "valueField": "cust_id",
60                                     "width": 300,
61                                     "xtype": "ComboBox",
62                                     "|xns": "Roo.form",
63                                     "items": [
64                                         {
65                                             "listeners": {
66                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n   // o.params._with_last_location = 1;\n}\n"
67                                             },
68                                             "*prop": "store",
69                                             "remoteSort": true,
70                                             "xtype": "Store",
71                                             "|sortInfo": "{ direction : 'ASC', field: 'cust_name' }",
72                                             "|xns": "Roo.data",
73                                             "items": [
74                                                 {
75                                                     "*prop": "proxy",
76                                                     "xtype": "HttpProxy",
77                                                     "method": "GET",
78                                                     "|xns": "Roo.data",
79                                                     "|url": "baseURL + '/Roo/custinfo.php'"
80                                                 },
81                                                 {
82                                                     "*prop": "reader",
83                                                     "xtype": "JsonReader",
84                                                     "|xns": "Roo.data",
85                                                     "id": "cust_id",
86                                                     "root": "data",
87                                                     "totalProperty": "total",
88                                                     "|fields": "[{\"name\":\"cust_id\",\"type\":\"int\"},\"cust_name\"]"
89                                                 }
90                                             ]
91                                         }
92                                     ]
93                                 }
94                             ]
95                         }
96                     ]
97                 },
98                 {
99                     "listeners": {
100                         "click": "function (_self, e)\n{\n   _this.dialog.hide();\n \n }"
101                     },
102                     "*prop": "buttons[]",
103                     "text": "Cancel",
104                     "xtype": "Button",
105                     "|xns": "Roo"
106                 },
107                 {
108                     "listeners": {
109                         "click": "function (_self, e)\n{\n   //_this.findField('cuinfo_\n   \n   // check if customer is filled in.\n   if (_this.form.findField('cmhead_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('cmhead_cust_id').lastData;\n   \n   data.cmhead_curr_id      = c.cust_curr_id;\n   data.cmhead_curr_id_curr_name = c.cust_curr_id_curr_name;\n   \n   data.cmhead_terms_id      = c.cust_terms_id;\n   data.cmhead_terms_id_terms_descrip = c.cust_terms_id_terms_descrip;\n   \n   // fill in staff in/c..\n   \n   data.cmhead_salesrep_id =  Pman.Login.authUser.salesrep.salesrep_id;\n   data.cmhead_salesrep_id_salesrep_name =  Pman.Login.authUser.salesrep.salesrep_name;\n   \n   data.cmhead_docdate = new Date();\n   \n   data.cmhead_taxzone_id = c.cust_taxzone_id;\n   data.cmhead_taxzone_id_taxzone_descrip = c.cust_taxzone_id_taxzone_descrip;\n   data.cmhead_location_id = c.default_location_id,\n   data.cmhead_location_id_location_name = c.default_location_name;\n\n   Pman.Dialog.XtupleCreditMemo.show(data, function() {\n    _this.dialog.hide();\n    _this.callback();\n   }); \n   \n}"
110                     },
111                     "*prop": "buttons[]",
112                     "text": "OK",
113                     "xtype": "Button",
114                     "|xns": "Roo"
115                 }
116             ]
117         }
118     ],
119     "permname": "",
120     "modOrder": "001"
121 }