3 "name": "Pman.Dialog.XtupleMiscellaneousCheck",
6 "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleMiscellaneousCheck.bjs",
10 "show": "function (_self)\n{\n this.layout.getRegion('center').showPanel(0);\n}"
17 "title": "Create Miscellaneous Check",
19 "xtype": "LayoutDialog",
24 "xtype": "LayoutRegion",
29 "xtype": "ContentPanel",
34 "|actioncomplete": "function(_self,action)\n{\n if (action.type == 'setdata') {\n if(_this.data.checkhead_id){\n _this.dialog.el.mask(\"Loading\");\n this.load({ method: 'GET', params: { '_id' : _this.data.checkhead_id }});\n return;\n }\n return;\n }\n if (action.type == 'load') {\n _this.dialog.el.unmask();\n return;\n }\n if (action.type =='submit') {\n \n _this.dialog.el.unmask();\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}\n",
35 "|rendered": "function (form)\n{\n _this.form= form;\n}\n"
39 "style": "margin:10px;",
41 "|url": "baseURL + '/Roo/checkhead.php'",
46 "fieldLabel": "Customer",
55 "fieldLabel": "Apply To Credit Memo",
56 "name": "cmhead_number",
65 "displayField": "curr_name",
67 "emptyText": "Select Currency",
68 "fieldLabel": "Currency",
69 "forceSelection": true,
70 "hiddenName": "checkhead_curr_id",
72 "loadingText": "Searching...",
74 "name": "checkhead_curr_id_curr_name",
76 "qtip": "Select Currency",
77 "queryParam": "query[curr_name]",
78 "selectOnFocus": true,
79 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{curr_name}</b> </div>",
80 "triggerAction": "all",
82 "valueField": "curr_id",
89 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n \n}\n"
94 "|sortInfo": "{ direction : 'ASC', field: 'curr_symbol' }",
102 "|url": "baseURL + '/Roo/curr_symbol.php'"
106 "xtype": "JsonReader",
110 "totalProperty": "total",
111 "|fields": "[{\"name\":\"curr_id\",\"type\":\"int\"},\"curr_symbol\"]"
119 "allowDecimals": true,
120 "decimalPrecision": 2,
121 "fieldLabel": "Amount",
122 "name": "checkhead_amount",
124 "xtype": "NumberField",
129 "displayField": "bankaccnt_name",
131 "emptyText": "Select Bank Accnt",
132 "fieldLabel": "Post to",
133 "forceSelection": true,
134 "hiddenName": "checkhead_bankaccnt_id",
136 "loadingText": "Searching...",
138 "name": "checkhead_bankaccnt_id_name",
140 "qtip": "Select Bank Accnt",
141 "queryParam": "query[bankaccnt_name]",
142 "selectOnFocus": true,
143 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{bankaccnt_name} - {bankaccnt_descrip}</b> </div>",
144 "triggerAction": "all",
146 "valueField": "bankaccnt_id",
153 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n \n}\n"
158 "|sortInfo": "{ direction : 'DESC', field: 'bankaccnt_id' }",
164 "xtype": "HttpProxy",
165 "|url": "baseURL + '/Roo/bankaccnt.php'",
170 "id": "bankaccnt_id",
172 "totalProperty": "total",
173 "xtype": "JsonReader",
174 "|fields": "[{\"name\":\"bankaccnt_id\",\"type\":\"int\"},\"bankaccnt_name\"]",
183 "fieldLabel": "Date",
185 "name": "checkhead_checkdate",
187 "xtype": "DateField",
192 "fieldLabel": "Memo",
193 "name": "checkhead_for",
195 "xtype": "TextField",
200 "fieldLabel": "Notes",
201 "name": "checkhead_notes",
207 "name": "checkhead_id",
212 "name": "checkhead_recip_id",
217 "name": "checkhead_recip_type",
227 "name": "checkhead_misc",
232 "name": "_create_and_post",
237 "name": "remaining_total",
247 "click": "function (_self, e)\n{\n _this.dialog.hide();\n}"
249 "*prop": "buttons[]",
256 "click": "function (_self, e)\n{\n // do some checks?\n \n \n // _this.dialog.el.mask(\"Saving\");\n var a = _this.form.findField('checkhead_amount').getValue();\n var r = _this.form.findField('remaining_total').getValue();\n \n if(a - r > 0){\n Roo.MessageBox.alert(\"Error\", \"You must enter an amount less than or equal to the credit memo! The amount remaining of this credit memo is \" + r);\n _this.form.findField('checkhead_amount').setValue(r);\n return;\n }\n \n _this.form.doAction(\"submit\");\n\n}"
258 "*prop": "buttons[]",