3 "name": "Pman.Tab.XtupleMetric",
4 "parent": "Pman.Admin",
6 "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleMetric.bjs",
10 "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
16 "tableName": "metric",
23 "|render": "function() \n{\n _this.grid = this; \n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}",
24 "beforeedit": "function (e)\n{\n var r = e.record.data.poitem_qty_received * 1;\n \n if(r > 0){\n Roo.MessageBox.alert(\"Error\", \"This item has been receipted\");\n return false;\n }\n \n var status = _this.form.findField('pohead_status').getValue();\n \n if(status == 'C'){\n Roo.MessageBox.alert(\"Error\", \"This PO has been closed\");\n return false;\n }\n \n \n}"
27 "autoExpandColumn": "metric_value",
30 "xtype": "EditorGrid",
35 "beforeload": "function (_self, o){\n o.params = o.params || {};\n \n}\n"
37 "*prop": "dataSource",
40 "|sortInfo": "{ field : 'metric_name', direction: 'ASC' }",
48 "|url": "baseURL + '/Xtuple/Roo/Metric.php'",
55 "totalProperty": "total",
56 "xtype": "JsonReader",
57 "|fields": "[\n {\n 'name': 'metric_id',\n 'type': 'int'\n },\n {\n 'name': 'metric_name',\n 'type': 'string'\n },\n {\n 'name': 'metric_value',\n 'type': 'string'\n },\n {\n 'name': 'metric_module',\n 'type': 'string'\n }\n]",
69 "|click": "function()\n{\n var status = _this.form.findField('pohead_status').getValue();\n \n if(status == 'C'){\n Roo.MessageBox.alert(\"Error\", \"This PO has been closed\");\n return;\n }\n \n var ct = _this.grid.ds.getCount();\n \n var last = ct ? _this.grid.ds.getAt(ct-1).data.poitem_linenumber * 1 + 1 : 1;\n \n var dt = _this.form.findField('pohead_orderdate').getValue();\n \n var nr = _this.grid.ds.reader.newRow({\n poitem_id : 0,\n poitem_linenumber : last,\n item_number : '',\n item_descrip1 : '',\n poitem_duedate : dt,\n poitem_qty_ordered : 1,\n poitem_unitprice : 0\n });\n \n _this.grid.stopEditing();\n _this.grid.ds.insert(_this.grid.ds.getCount(), nr); \n _this.grid.startEditing(_this.grid.ds.getCount()-1, 1);\n}\n"
71 "cls": "x-btn-text-icon",
74 "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
79 "|click": "function ()\n{\n var status = _this.form.findField('pohead_status').getValue();\n \n if(status == 'C'){\n Roo.MessageBox.alert(\"Error\", \"This PO has been closed\");\n return;\n }\n \n var cs = _this.grid.getSelectionModel().getSelectedCell();\n if (!cs) {\n Roo.MessageBox.alert(\"Error\", \"Select a cell\");\n return;\n }\n _this.grid.stopEditing();\n var r = _this.grid.ds.getAt(cs[0]);\n \n if(r.data.poitem_qty_received * 1 > 0){\n Roo.MessageBox.alert(\"Error\", \"This item has been receipted\");\n return;\n }\n \n \n _this.grid.ds.remove(r);\n \n}"
81 "cls": "x-btn-text-icon",
84 "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
92 "emptyMsg": "No Metric found",
94 "xtype": "PagingToolbar",
98 "*prop": "colModel[]",
99 "dataIndex": "metric_id",
102 "xtype": "ColumnModel",
103 "|renderer": "function(v) { return String.format('{0}', v); }",
107 "*prop": "colModel[]",
108 "dataIndex": "metric_name",
111 "xtype": "ColumnModel",
112 "|renderer": "function(v) { return String.format('{0}', v); }",
116 "*prop": "colModel[]",
117 "dataIndex": "metric_value",
120 "xtype": "ColumnModel",
121 "|renderer": "function(v) { return String.format('{0}', v); }",
125 "*prop": "colModel[]",
126 "dataIndex": "metric_module",
129 "xtype": "ColumnModel",
130 "|renderer": "function(v) { return String.format('{0}', v ? v.format('Y-m-d') : ''); }",
134 "*prop": "colModel[]",
136 "dataIndex": "poitem_qty_ordered",
139 "xtype": "ColumnModel",
140 "|renderer": "function(v) { return String.format('{0}', v); }",
145 "xtype": "GridEditor",
150 "allowDecimals": false,
151 "decimalPrecision": 0,
153 "style": "text-align:right",
154 "xtype": "NumberField",
162 "*prop": "colModel[]",
164 "dataIndex": "poitem_qty_received",
165 "header": "Received",
167 "xtype": "ColumnModel",
168 "|renderer": "function(v,x,r) { \n return String.format(\n r.data.poitem_qty_ordered != (v-r.data.poitem_qty_returned) ? '<span style=\"color:red\">{0}</span>': '{0}',\n v - r.data.poitem_qty_returned);\n}",
172 "*prop": "colModel[]",
174 "dataIndex": "poitem_qty_vouchered",
175 "header": "Vouchered",
177 "xtype": "ColumnModel",
178 "|renderer": "function(v,x,r) { \n return String.format(\n r.data.poitem_qty_ordered != v ? '<span style=\"color:red\">{0}</span>': '{0}',\n v);\n}",
182 "*prop": "colModel[]",
184 "dataIndex": "poitem_unitprice",
185 "header": "Unit price",
187 "xtype": "ColumnModel",
188 "|renderer": "function(v) { return String.format('{0}', (v || v == 0) ? parseFloat(v).toFixed(3) : ''); }",
193 "xtype": "GridEditor",
199 "allowDecimals": false,
200 "decimalPrecision": 0,
202 "style": "text-align:right",
203 "xtype": "NumberField",