3 "name": "Pman.Tab.XtupleExpenses",
4 "parent": "Pman.Tab.XtupleSales",
5 "title": "Pman.Tab.XtupleExpenses",
6 "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleExpenses.bjs",
10 "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
16 "tableName": "expense",
23 "|render": "function() \n{\n _this.grid = this; \n _this.dialog = Pman.Dialog.XtupleExpenses;\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}",
24 "|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"
27 "autoExpandColumn": "expense_memo",
34 "beforeload": "function (_self, options)\n{\n options.params._applyPerms = 1;\n}"
36 "*prop": "dataSource",
39 "|sortInfo": "{ field : 'expense_id', direction: 'DESC' }",
46 "|url": "baseURL + '/Roo/expense.php'",
51 "xtype": "JsonReader",
52 "totalProperty": "total",
56 "|fields": "[\n {\n 'name': 'expense_id',\n 'type': 'int'\n },\n {\n 'name': 'expense_accnt_id',\n 'type': 'int'\n },\n {\n 'name': 'expense_emp_id',\n 'type': 'int'\n },\n {\n 'name': 'expense_number',\n 'type': 'string'\n },\n {\n 'name': 'expense_trandate',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'expense_created',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'expense_modified',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'expense_duedate',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'expense_memo',\n 'type': 'string'\n },\n {\n 'name': 'expense_status',\n 'type': 'string'\n },\n {\n 'name': 'expense_advance',\n 'type': 'float'\n },\n {\n 'name': 'expense_amount',\n 'type': 'float'\n },\n {\n 'name': 'expense_tax',\n 'type': 'float'\n },\n {\n 'name': 'expense_total',\n 'type': 'float'\n }\n]"
62 "xtype": "PagingToolbar",
65 "displayMsg": "Displaying expense{0} - {1} of {2}",
66 "emptyMsg": "No expense found",
76 "|click": "function()\n{\n if (!_this.dialog) return;\n _this.dialog.show( { \n expense_id : 0,\n expense_emp_id_emp_name : Pman.Login.authUser.name\n } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
78 "cls": "x-btn-text-icon",
81 "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
85 "|xns": "Roo.Toolbar",
90 "|click": "function()\n{\n var rec = _this.grid.selModel.getSelected();\n if (!rec) {\n Roo.MessageBox.alert(\"Error\", \"Select a line to delete\");\n return;\n }\n if (['Draft', ''].indexOf(rec.data.expense_status) < 0) {\n Roo.MessageBox.alert(\"Error\", \"You can only delete draft entries\");\n return;\n }\n \n Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to delete that?\", function(r) {\n if (r!='yes') {\n return;\n }\n \n \n new Pman.Request({\n mask : 'Deleting',\n url : baseURL + '/Roo/expense',\n method : 'POST',\n params : {\n _delete : rec.data.expense_id\n },\n success : function()\n {\n _this.grid.ds.remove(rec); \n }\n });\n });\n \n}\n "
92 "cls": "x-btn-text-icon",
95 "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
101 "*prop": "colModel[]",
102 "dataIndex": "expense_emp_id_emp_name",
103 "header": "Employee",
105 "xtype": "ColumnModel",
106 "|renderer": "function(v) { return String.format('{0}', v); }",
110 "*prop": "colModel[]",
111 "dataIndex": "expense_number",
114 "xtype": "ColumnModel",
115 "|renderer": "function(v) { return String.format('{0}', v); }",
119 "*prop": "colModel[]",
120 "dataIndex": "expense_trandate",
121 "header": "Post Date",
123 "xtype": "ColumnModel",
124 "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
128 "*prop": "colModel[]",
129 "dataIndex": "expense_duedate",
130 "header": "Due Date",
132 "xtype": "ColumnModel",
133 "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
137 "*prop": "colModel[]",
138 "dataIndex": "expense_memo",
141 "xtype": "ColumnModel",
142 "|renderer": "function(v) { return String.format('{0}', v); }",
146 "*prop": "colModel[]",
147 "dataIndex": "expense_status",
150 "xtype": "ColumnModel",
151 "|renderer": "function(v) { return String.format('{0}', v); }",
155 "*prop": "colModel[]",
157 "dataIndex": "expense_advance",
160 "xtype": "ColumnModel",
161 "|renderer": "function(v) { return String.format('{0}', (1*v).toFixed(2)); }",
165 "*prop": "colModel[]",
167 "dataIndex": "expense_amount",
170 "xtype": "ColumnModel",
171 "|renderer": "function(v) { return String.format('{0}', (1*v).toFixed(2)); }",
175 "*prop": "colModel[]",
177 "dataIndex": "expense_tax",
180 "xtype": "ColumnModel",
181 "|renderer": "function(v) { return String.format('{0}', (1*v).toFixed(2)); }",
185 "*prop": "colModel[]",
187 "dataIndex": "expense_total",
190 "xtype": "ColumnModel",
191 "|renderer": "function(v) { return String.format('{0}', (1*v).toFixed(2)); }",