3 "name": "Pman.Tab.XtupleLanded",
4 "parent": "Pman.Tab.XtuplePurchases",
5 "title": "Pman.Tab.XtupleLanded",
6 "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleLanded.bjs",
11 "title": "Landed Costs",
12 "xtype": "NestedLayoutPanel",
17 "xtype": "BorderLayout",
22 "xtype": "LayoutRegion",
29 "xtype": "LayoutRegion",
34 "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
40 "tableName": "vohead",
47 "|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}",
48 "|rowdblclick": "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
51 "autoExpandColumn": "vohead_reference",
58 "beforeload": "function (_self, options)\n{\n options.params._landed = 1;\n if (!_this.vsearch) {\n return false;\n }\n options.params._landed_status = _this.status.getValue(); \n \n\n options.params._search = _this.vsearch.getValue();\n}",
59 "load": "function (_self, records, options)\n{\n_this.rgrid.footer.onClick('refresh');\n}"
61 "*prop": "dataSource",
64 "|sortInfo": "{ field : 'vohead_gldistdate', direction: 'DESC' }",
71 "|url": "baseURL + '/Roo/vohead.php'",
76 "xtype": "JsonReader",
77 "totalProperty": "total",
81 "|fields": "[\n {\n 'name': 'vohead_id',\n 'type': 'int'\n },\n {\n 'name': 'vohead_number',\n 'type': 'string'\n },\n {\n 'name': 'vohead_pohead_id',\n 'type': 'int'\n },\n {\n 'name': 'vohead_posted',\n 'type': 'int'\n },\n {\n 'name': 'vohead_duedate',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'vohead_invcnumber',\n 'type': 'string'\n },\n {\n 'name': 'vohead_amount',\n 'type': 'float'\n },\n {\n 'name': 'vohead_docdate',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'vohead_1099',\n 'type': 'int'\n },\n {\n 'name': 'vohead_distdate',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'vohead_reference',\n 'type': 'string'\n },\n {\n 'name': 'vohead_terms_id',\n 'type': 'int'\n },\n {\n 'name': 'vohead_vend_id',\n 'type': 'int'\n },\n {\n 'name': 'vohead_curr_id',\n 'type': 'int'\n },\n {\n 'name': 'vohead_adjtaxtype_id',\n 'type': 'int'\n },\n {\n 'name': 'vohead_freighttaxtype_id',\n 'type': 'int'\n },\n {\n 'name': 'vohead_gldistdate',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'vohead_misc',\n 'type': 'int'\n },\n {\n 'name': 'vohead_taxzone_id',\n 'type': 'int'\n },\n {\n 'name': 'vohead_taxtype_id',\n 'type': 'int'\n },\n {\n 'name': 'vohead_notes',\n 'type': 'string'\n }\n]"
87 "afterselectionchange": "function (_self)\n{\n _this.rsearch.setValue('');\n _this.rgrid.footer.onClick('first');\n}"
91 "xtype": "RowSelectionModel",
96 "xtype": "PagingToolbar",
99 "displayMsg": "Displaying vohead{0} - {1} of {2}",
100 "emptyMsg": "No vohead found",
110 "render": "function (_self)\n{\n _this.status = _self;\n}",
111 "select": "function (combo, record, index)\n{\n Roo.log('select');\n _this.grid.footer.onClick('first');\n}"
114 "displayField": "fname",
116 "fieldLabel": "Status",
117 "hiddenName": "cm_status",
120 "name": "cm_status_name",
121 "triggerAction": "all",
122 "value": "NOTASSIGN",
123 "valueField": "ftype",
130 "xtype": "SimpleStore",
131 "|data": "[ \n [ 'NOTASSIGN', \"Not Assigned\"],\n [ 'ASSIGNED' , \"Assigned\"]\n]\n",
132 "|fields": "[ 'ftype', 'fname']",
139 "render": "function (_self)\n{\n _this.vsearch = _self;\n}",
140 "specialkey": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
142 "xtype": "TextField",
147 "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
151 "|icon": "rootURL + '/Pman/templates/images/search.gif'",
152 "|xns": "Roo.Toolbar"
157 "*prop": "colModel[]",
158 "dataIndex": "vohead_gldistdate",
161 "xtype": "ColumnModel",
162 "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
166 "*prop": "colModel[]",
167 "dataIndex": "vohead_number",
170 "xtype": "ColumnModel",
171 "|renderer": "function(v,x,r) { \n return String.format('{0} / {1}', v,r.data.vohead_invcnumber); \n}",
175 "*prop": "colModel[]",
176 "dataIndex": "vohead_reference",
179 "xtype": "ColumnModel",
180 "|renderer": "function(v) { return String.format('{0}', v); }",
184 "*prop": "colModel[]",
185 "dataIndex": "vohead_vend_id_vend_name",
186 "header": "Vohead vend",
188 "xtype": "ColumnModel",
189 "|renderer": "function(v) { return String.format('{0}', v); }",
193 "*prop": "colModel[]",
195 "dataIndex": "vohead_total",
198 "xtype": "ColumnModel",
199 "|renderer": "function(v,x,r) { \n \n \n return String.format('{0} {1}', r.data.vohead_curr_id_curr_symbol,v); \n}",
203 "*prop": "colModel[]",
205 "dataIndex": "assigned",
206 "header": "Assigned",
208 "xtype": "ColumnModel",
209 "|renderer": "function(v,x,r) { \n return v ? String.format('${0}', v) : ''; \n}",
218 "|activate": "function() {\n _this.rpanel = this;\n //if (_this.rgrid) {\n // _this.rgrid.footer.onClick('first');\n //}\n}"
221 "fitContainer": true,
224 "tableName": "recvgrp",
226 "xtype": "GridPanel",
231 "|render": "function() \n{\n _this.rgrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n //if (_this.panel.active) {\n // this.footer.onClick('first');\n //}\n}",
232 "|rowdblclick": "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
235 "autoExpandColumn": "recvgrp_number",
242 "beforeload": "function (_self, o)\n{\n var sel = _this.grid.selModel.getSelected();\n if (!sel) {\n this.removeAll();\n return false;\n }\n o.params = o.params || {};\n o.params._landed_vohead = sel.data.vohead_id;\n o.params._search = _this.rsearch.getValue();\n \n \n}"
244 "*prop": "dataSource",
247 "|sortInfo": "{ field : 'recvgrp_date', direction: 'ASC' }",
252 "xtype": "HttpProxy",
254 "|url": "baseURL + '/Roo/recvgrp.php'",
259 "xtype": "JsonReader",
260 "totalProperty": "total",
264 "|fields": "[\n {\n 'name': 'recvgrp_id',\n 'type': 'int'\n },\n {\n 'name': 'recvgrp_number',\n 'type': 'string'\n }\n]"
270 "xtype": "PagingToolbar",
273 "displayMsg": "Displaying recvgrp{0} - {1} of {2}",
274 "emptyMsg": "No recvgrp found",
284 "render": "function (_self)\n{\n _this.rsearch = _self;\n}",
285 "specialkey": "function (_self, e)\n{\n_this.rgrid.footer.onClick('first');\n}"
287 "xtype": "TextField",
292 "|click": "function (_self, e)\n{\n_this.rgrid.footer.onClick('first');\n}"
296 "|icon": "rootURL + '/Pman/templates/images/search.gif'",
297 "|xns": "Roo.Toolbar"
300 "|xns": "Roo.Toolbar",
305 "click": "function (_self, e)\n{\n var recv = _this.rgrid.selModel.getSelected();\n var vo = _this.grid.selModel.getSelected();\n if (!vo || !recv) {\n return;\n }\n new Pman.Request({\n mask : 'saving',\n method : 'POST',\n url : baseURL + '/Roo/Recvgrpland',\n params : {\n recvgrpland_vohead_id : vo.data.vohead_id,\n recvgrpland_recvgrp_id : recv.data.recvgrp_id, \n recvgrpland_cost : vo.data.vohead_total,\n recvgrpland_curr_id : vo.data.vohead_curr_id\n },\n success : function () {\n _this.grid.footer.onClick('refresh');\n }\n });\n \n \n \n}"
307 "text": "Assign All",
309 "|xns": "Roo.Toolbar"
313 "click": "function (_self, e)\n{\n var recv = _this.rgrid.selModel.getSelected();\n var vo = _this.grid.selModel.getSelected();\n if (!vo || !recv) {\n return;\n }\n \n var avail = ((1*vo.data.vohead_total) - (1*vo.data.assigned)).toFixed(2);\n \n Roo.MessageBox.prompt(\"How much to assign?\",\n \"The total available to assign is \" + vo.data.vohead_curr_id_curr_symbol +\n ' ' + Roo.util.Format.number(avail,2),\n function (b, n) {\n if (b != 'ok') {\n return;\n }\n n = n*1;\n if (isNaN(n)) {\n Roo.MessageBox.alert(\"Error\", \"did not get a number\");\n return;\n }\n\n //vo.data.vohead_total\n if (n*1 > avail) {\n Roo.MessageBox.alert(\"Error\", \"you assigned to much, try again\");\n return;\n }\n \n \n new Pman.Request({\n mask : 'saving',\n method : 'POST',\n url : baseURL + '/Roo/Recvgrpland',\n params : {\n recvgrpland_vohead_id : vo.data.vohead_id,\n recvgrpland_recvgrp_id : recv.data.recvgrp_id, \n recvgrpland_cost : n,\n recvgrpland_curr_id : vo.data.vohead_curr_id\n },\n success : function () {\n _this.grid.footer.onClick('refresh');\n }\n });\n }\n );\n \n \n}\n\n"
315 "text": "Assign Some",
317 "|xns": "Roo.Toolbar"
321 "click": "function (_self, e)\n{\n var recv = _this.rgrid.selModel.getSelected();\n var vo = _this.grid.selModel.getSelected();\n if (!vo || !recv) {\n return;\n }\n var av = recv.data.assigned_landed * 1;\n if (!av) {\n return;\n }\n \n new Pman.Request({\n mask : 'saving',\n method : 'POST',\n url : baseURL + '/Roo/Recvgrpland',\n params : {\n _void : 1,\n recvgrpland_vohead_id : vo.data.vohead_id,\n recvgrpland_recvgrp_id : recv.data.recvgrp_id\n },\n success : function () {\n _this.grid.footer.onClick('refresh');\n }\n });\n \n \n \n}"
323 "text": "Remove Assign",
325 "|xns": "Roo.Toolbar"
330 "*prop": "colModel[]",
331 "dataIndex": "recvgrp_date",
334 "xtype": "ColumnModel",
335 "|renderer": "function(v) { return String.format('{0}', v.format('d/M/Y')); }",
339 "*prop": "colModel[]",
340 "dataIndex": "recvgrp_pohead_id_pohead_number",
343 "xtype": "ColumnModel",
344 "|renderer": "function(v) { return String.format('{0}', v); }",
348 "*prop": "colModel[]",
349 "dataIndex": "recvgrp_number",
352 "xtype": "ColumnModel",
353 "|renderer": "function(v) { return String.format('{0}', v); }",
357 "*prop": "colModel[]",
358 "dataIndex": "vend_name",
361 "xtype": "ColumnModel",
362 "|renderer": "function(v) { return String.format('{0}', v); }",
366 "*prop": "colModel[]",
367 "dataIndex": "recvgrp_location_id_location_descrip",
370 "xtype": "ColumnModel",
371 "|renderer": "function(v) { return String.format('{0}', v); }",
375 "*prop": "colModel[]",
377 "dataIndex": "recv_qty",
380 "xtype": "ColumnModel",
381 "|renderer": "function(v) { \n if (v*1 <= 0.0) {\n return '';\n }\n return Roo.util.Format.number(v, 2); \n}",
385 "*prop": "colModel[]",
387 "dataIndex": "recvgrp_landed_cost",
388 "header": "Old landed",
391 "xtype": "ColumnModel",
392 "|renderer": "function(v) { \n if (v*1 <= 0.0) {\n return '';\n }\n return Roo.util.Format.number(v, 2); \n}",
396 "*prop": "colModel[]",
398 "dataIndex": "assigned_landed",
399 "header": "Assigned Value",
401 "xtype": "ColumnModel",
402 "|renderer": "function(v,x,r) { \n if (v*1 <= 0.0) {\n \n if (r.data.total_landed_cost*1 > 0) {\n return '<span style=\"color:#ccc\">' + \n String.format('{0}', r.data.base_curr_symbol) + \n Roo.util.Format.number(r.data.total_landed_cost, 2) + '</span>';\n }\n \n return '';\n }\n return String.format('{0}', r.data.base_curr_symbol) + Roo.util.Format.number(v, 2); \n}",