3 "name": "Pman.Tab.XtupleSalesInvoice",
4 "parent": "Pman.Tab.XtupleSales",
6 "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleSalesInvoice.bjs",
10 "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
12 ".builderCfg": "{\"cols\":[{\"table\":\"invchead\",\"column\":\"invchead_ordernumber\",\"columnshort\":\"invchead_ordernumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Sales Order#\"},{\"table\":\"invchead\",\"column\":\"invchead_orderdate\",\"columnshort\":\"invchead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"},{\"table\":\"invchead\",\"column\":\"invchead_posted\",\"columnshort\":\"invchead_posted\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Posted\"},{\"table\":\"invchead\",\"column\":\"invchead_printed\",\"columnshort\":\"invchead_printed\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Printed?\"},{\"table\":\"invchead\",\"column\":\"invchead_invcdate\",\"columnshort\":\"invchead_invcdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Invoiced\"},{\"table\":\"invchead\",\"column\":\"invchead_billto_name\",\"columnshort\":\"invchead_billto_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Bill To\"}],\"cols_ex\":[\"invchead_billto_name\"],\"table\":\"invchead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
17 "tableName": "invchead",
24 "|render": "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}",
25 "|rowdblclick": "function (_self, rowIndex, e)\n{\n \n \n var d = this.getDataSource().getAt(rowIndex).data;\n \n if (d.cohead_id) {\n \n Pman.Dialog.XtupleSalesOrder.show( {\n cohead_id : d.cohead_id\n \n }, function() {\n _this.grid.footer.onClick('refresh');\n // updated..\n Pman.Tab.XtupleSales.grid.footer.onClick('first');\n }); \n return;\n }\n \n // other wise not a sales order related..\n \n \n Pman.Dialog.XtupleInvc.show( {\n _id : d.invchead_id\n \n }, function() {\n _this.grid.footer.onClick('refresh');\n // updated..\n Pman.Tab.XtupleSales.grid.footer.onClick('first');\n }); \n \n}\n"
28 "autoExpandColumn": "cust_name",
35 "beforeload": "function (_self, o)\n{\n if (_this.ordernumber.getValue().length) {\n o.params['query[invchead_ordernumber]'] = _this.ordernumber.getValue();\n }\n \n if (_this.invcnumber.getValue().length) {\n o.params['query[invchead_invcnumber]'] = _this.invcnumber.getValue();\n }\n \n \n if (_this.customer.getValue()) {\n o.params.invchead_cust_id = _this.customer.getValue();\n }\n if (_this.fromDate.getValue()) {\n o.params['search[fromDate]'] = _this.fromDate.getValue().format('Y-m-d');\n }\n if (_this.toDate.getValue()) {\n o.params['search[toDate]'] = _this.toDate.getValue().format('Y-m-d');\n }\n o.params._show_status = _this.status.getValue();\n \n o.params._with_salesorder = 1;\n}"
37 "*prop": "dataSource",
40 "|sortInfo": "{ field : 'invchead_invcdate', direction: 'DESC' }",
47 "|url": "baseURL + '/Roo/invchead.php'",
52 "xtype": "JsonReader",
53 "totalProperty": "total",
55 ".builderCfg": "{\"cols\":[{\"table\":\"invchead\",\"column\":\"invchead_ordernumber\",\"columnshort\":\"invchead_ordernumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Sales Order#\"},{\"table\":\"invchead\",\"column\":\"invchead_orderdate\",\"columnshort\":\"invchead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"},{\"table\":\"invchead\",\"column\":\"invchead_posted\",\"columnshort\":\"invchead_posted\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Posted\"},{\"table\":\"invchead\",\"column\":\"invchead_printed\",\"columnshort\":\"invchead_printed\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Printed?\"},{\"table\":\"invchead\",\"column\":\"invchead_invcdate\",\"columnshort\":\"invchead_invcdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Invoiced\"},{\"table\":\"invchead\",\"column\":\"invchead_billto_name\",\"columnshort\":\"invchead_billto_name\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"Bill To\"}],\"cols_ex\":[\"invchead_billto_name\"],\"table\":\"invchead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
58 "|fields": "[\n {\n 'name': 'invchead_ordernumber',\n 'type': 'string'\n },\n {\n 'name': 'invchead_orderdate',\n 'type': 'date'\n },\n {\n 'name': 'invchead_posted',\n 'type': 'boolean'\n },\n {\n 'name': 'invchead_printed',\n 'type': 'boolean'\n },\n {\n 'name': 'invchead_invcdate',\n 'type': 'date'\n },\n {\n 'name': 'invchead_billto_name',\n 'type': 'string'\n }\n]"
64 "xtype": "PagingToolbar",
67 "displayMsg": "Displaying invchead{0} - {1} of {2}",
68 "emptyMsg": "No invchead found",
73 "click": "function (_self, e)\n{\n new Pman.Download({\n grid: _this.grid\n });\n Roo.MessageBox.alert(\"Notice\", \"Download should start soon\");\n}"
88 "render": "function (_self)\n{\n _this.invcnumber = _self;\n}",
89 "specialkey": "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}"
91 "emptyText": "Invoice #",
98 "render": "function (_self)\n{\n _this.ordernumber = _self;\n}",
99 "select": "function (combo, record, index)\n{\n Roo.log('select');\n _this.grid.footer.onClick('first');\n}"
102 "displayField": "invchead_ordernumber",
104 "emptyText": "Order",
105 "fieldLabel": "ordernumber",
106 "forceSelection": true,
107 "hiddenName": "invchead_id",
109 "loadingText": "Searching...",
111 "name": "invchead_ordernumber",
113 "qtip": "Select invchead",
114 "queryParam": "query[invchead_ordernumber]",
115 "selectOnFocus": true,
116 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{invchead_ordernumber}</b> </div>",
117 "triggerAction": "all",
118 "valueField": "invchead_ordernumber",
126 "|sortInfo": "{ direction : 'ASC', field: 'invchead_ordernumber' }",
130 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
135 "xtype": "HttpProxy",
138 "|url": "baseURL + '/Roo/invchead.php'"
142 "xtype": "JsonReader",
146 "totalProperty": "total",
147 "|fields": "[{\"name\":\"invchead_id\",\"type\":\"int\"},\"invchead_ordernumber\"]"
155 "render": "function (_self)\n{\n _this.customer = _self;\n}",
156 "select": "function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n}"
159 "displayField": "cust_name",
161 "emptyText": "Select Customer",
162 "fieldLabel": "cust_name",
163 "forceSelection": true,
164 "hiddenName": "cust_id",
166 "loadingText": "Searching...",
170 "qtip": "Select custinfo",
171 "queryParam": "query[cust_name]",
172 "selectOnFocus": true,
173 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{cust_name}</b> </div>",
174 "triggerAction": "all",
175 "valueField": "cust_id",
183 "|sortInfo": "{ direction : 'ASC', field: 'cust_name' }",
187 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
192 "xtype": "HttpProxy",
195 "|url": "baseURL + '/Roo/custinfo.php'"
199 "xtype": "JsonReader",
203 "totalProperty": "total",
204 "|fields": "[{\"name\":\"cust_id\",\"type\":\"int\"},\"cust_name\"]"
212 "render": "function (_self)\n{\n _this.status = _self;\n}",
213 "beforeselect": "function (combo, record, index)\n{\n (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}"
216 "displayField": "fname",
218 "fieldLabel": "Status",
219 "hiddenName": "status",
223 "triggerAction": "all",
225 "valueField": "ftype",
232 "xtype": "SimpleStore",
233 "|data": "[ \n [ 'U', \"Unpaid\"],\n [ 'NV' , \"Not Void Only\"],\n [ 'V' , \"Void Only\"], \n [ 'A', \"All\"] \n]\n",
234 "|fields": "[ 'ftype', 'fname']",
242 "|xns": "Roo.Toolbar"
246 "select": "function (combo, date)\n{\n _this.grid.footer.onClick('first');\n}",
247 "render": "function (_self)\n{\n _this.fromDate = _self;\n}"
250 "xtype": "DateField",
256 "|xns": "Roo.Toolbar"
260 "select": "function (combo, date)\n{\n _this.grid.footer.onClick('first');\n}",
261 "render": "function (_self)\n{\n _this.toDate = _self;\n}"
264 "xtype": "DateField",
268 "|xns": "Roo.Toolbar",
273 "|click": "function ()\n{\n\n if (!Pman.hasPerm('Xtuple.InvoiceAll', 'S')) {\n Roo.MessageBox.alert(\"Error\", \"You do not have permissions to do that, please contact the administrator to void invoices, or edit the sales order.\");\n return;\n \n }\n \n \n var sel = _this.grid.getSelectionModel().getSelected();\n if (!sel) {\n Roo.MessageBox.alert(\"Error\", \"Select a invoice\");\n return;\n }\n // check current status of shipment..\n \n Roo.MessageBox.confirm(\"Are you sure\", \"Are you sure you want to VOID that invoice?\",\n function(r) {\n if (r != 'yes') {\n return;\n }\n new Pman.Request({\n mask : 'Sending',\n url : baseURL + '/Roo/invchead',\n method : 'POST',\n params : {\n invchead_id : sel.data.invchead_id,\n _void : 1\n },\n success : function() {\n _this.grid.footer.onClick('refresh');\n }\n })\n \n }\n );\n \n \n \n}"
275 "cls": "x-btn-text-icon",
276 "text": "Void Invoice",
278 "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
279 "|xns": "Roo.Toolbar"
284 "*prop": "colModel[]",
286 "dataIndex": "invchead_ordernumber",
287 "header": "Sales Order#",
289 "xtype": "ColumnModel",
290 "|renderer": "function(v) { return String.format('{0}', v); }",
294 "*prop": "colModel[]",
296 "dataIndex": "invchead_invcnumber",
297 "header": "Invoice#",
299 "xtype": "ColumnModel",
300 "|renderer": "function(v,x,r) {\n if (r.data.invchead_void) { \n var vv = v.split('x-').shift();\n return String.format('<s>{0}</s>', vv); \n }\n return String.format('{0}', v);\n }",
304 "xtype": "ColumnModel",
305 ".builderCfg": "{\"table\":\"invchead\",\"column\":\"invchead_orderdate\",\"columnshort\":\"invchead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"}",
308 "dataIndex": "invchead_orderdate",
309 "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
311 "*prop": "colModel[]"
314 "*prop": "colModel[]",
315 "dataIndex": "invchead_posted",
318 "xtype": "ColumnModel",
319 "|renderer": "function(v,x,r) { \n \n if (r.data.invchead_void) { \n return String.format('<s>VOID</s>', v); \n }\n \n return String.format('{0}', v); \n}",
323 "*prop": "colModel[]",
324 "dataIndex": "invchead_void",
328 "xtype": "ColumnModel",
329 "|renderer": "function(v,x,r) { \n \n \n return String.format('{0}', v); \n}",
333 "*prop": "colModel[]",
334 "dataIndex": "invchead_salesrep_id_salesrep_name",
335 "header": "Sales Rep",
337 "xtype": "ColumnModel",
338 "|renderer": "function(v) { return String.format('{0}', v); }",
342 "*prop": "colModel[]",
343 "dataIndex": "cust_salesrep_id_salesrep_name",
344 "header": "Customer Rep",
346 "xtype": "ColumnModel",
347 "|renderer": "function(v) { return String.format('{0}', v); }",
351 "*prop": "colModel[]",
352 ".builderCfg": "{\"table\":\"invchead\",\"column\":\"invchead_printed\",\"columnshort\":\"invchead_printed\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Printed?\"}",
353 "dataIndex": "invchead_printed",
354 "header": "Printed?",
357 "xtype": "ColumnModel",
358 "|renderer": "function(v) { return String.format('{0}', v); }",
362 "xtype": "ColumnModel",
363 ".builderCfg": "{\"table\":\"invchead\",\"column\":\"invchead_invcdate\",\"columnshort\":\"invchead_invcdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Invoiced\"}",
364 "header": "Invoiced",
366 "dataIndex": "invchead_invcdate",
367 "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
369 "*prop": "colModel[]"
372 "*prop": "colModel[]",
373 "dataIndex": "cust_addr_id_addr_postalcode",
374 "header": "Customer Postcode",
376 "xtype": "ColumnModel",
377 "|renderer": "function(v) { return String.format('{0}', v); }",
381 "*prop": "colModel[]",
382 "dataIndex": "cust_addr_id_addr_state",
383 "header": "Customer State",
385 "xtype": "ColumnModel",
386 "|renderer": "function(v) { return String.format('{0}', v); }",
390 "*prop": "colModel[]",
391 "dataIndex": "cust_name",
392 "header": "Customer",
394 "xtype": "ColumnModel",
395 "|renderer": "function(v) { return String.format('{0}', v); }",
399 "*prop": "colModel[]",
400 "dataIndex": "invchead_curr_id_curr_symbol",
401 "header": "Currency",
403 "xtype": "ColumnModel",
404 "|renderer": "function(v) { return String.format('{0}', v ? v : '??'); }",
408 "*prop": "colModel[]",
410 "dataIndex": "invchead_total",
413 "xtype": "ColumnModel",
414 "|renderer": "function(v) { return v ? Roo.util.Format.usMoney( v) : ''; }",
418 "*prop": "colModel[]",
420 "dataIndex": "aropen_amount",
423 "xtype": "ColumnModel",
424 "|renderer": "function(v) { return v ? Roo.util.Format.usMoney( v) : ''; }",