Pman.Dialog.XtupleJournalEntry.bjs
[Pman.Xtuple] / Pman.Dialog.XtupleJournalEntry.bjs
1 {
2     "id": "roo-file-528",
3     "name": "Pman.Dialog.XtupleJournalEntry",
4     "parent": "",
5     "title": "",
6     "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleJournalEntry.bjs",
7     "items": [
8         {
9             "closable": false,
10             "collapsible": false,
11             "height": 600,
12             "modal": true,
13             "resizable": false,
14             "title": "Create / View  Transaction",
15             "width": 800,
16             "xtype": "LayoutDialog",
17             "|xns": "Roo",
18             "items": [
19                 {
20                     "*prop": "north",
21                     "height": 150,
22                     "xtype": "LayoutRegion",
23                     "|xns": "Roo"
24                 },
25                 {
26                     "|xns": "Roo",
27                     "xtype": "LayoutRegion",
28                     "*prop": "center"
29                 },
30                 {
31                     "region": "north",
32                     "xtype": "ContentPanel",
33                     "|xns": "Roo",
34                     "items": [
35                         {
36                             "listeners": {
37                                 "|actioncomplete": "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       //_this.dialog.el.mask(\"Loading\");\n       if (_this.data.gltrans_id) {\n            this.load({ method: 'GET', params: { '_id' : _this.data.gltrans_id }});\n           return;\n       }\n       _this.grid.footer.onClick('first'); // clear..\n       return;\n    }\n    if (action.type == 'load') {\n         _this.grid.footer.onClick('first');\n        return;\n    }\n    if (action.type =='submit') {\n    \n        \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",
38                                 "|rendered": "function (form)\n{\n    _this.form= form;\n}\n"
39                             },
40                             "labelAlign": "right",
41                             "method": "POST",
42                             "style": "margin:10px;",
43                             "xtype": "Form",
44                             "|url": "baseURL + '/Roo/gltrans.php'",
45                             "|xns": "Roo.form",
46                             "items": [
47                                 {
48                                     "labelAlign": "right",
49                                     "xtype": "Row",
50                                     "|xns": "Roo.form",
51                                     "items": [
52                                         {
53                                             "fieldLabel": "Sequence",
54                                             "name": "gltrans_sequence",
55                                             "readOnly": true,
56                                             "width": 100,
57                                             "xtype": "TextField",
58                                             "|xns": "Roo.form"
59                                         },
60                                         {
61                                             "fieldLabel": "Journal No.",
62                                             "name": "gltrans_journalnumber",
63                                             "readOnly": true,
64                                             "width": 75,
65                                             "xtype": "TextField",
66                                             "|xns": "Roo.form"
67                                         },
68                                         {
69                                             "fieldLabel": "Created By",
70                                             "name": "gltrans_username",
71                                             "width": 200,
72                                             "xtype": "TextField",
73                                             "|xns": "Roo.form"
74                                         }
75                                     ]
76                                 },
77                                 {
78                                     "labelAlign": "right",
79                                     "xtype": "Row",
80                                     "|xns": "Roo.form",
81                                     "items": [
82                                         {
83                                             "fieldLabel": "Date",
84                                             "format": "d/M/Y",
85                                             "name": "gltrans_date",
86                                             "useIso": true,
87                                             "width": 100,
88                                             "xtype": "DateField",
89                                             "|xns": "Roo.form"
90                                         },
91                                         {
92                                             "fieldLabel": "Created",
93                                             "name": "gltrans_created",
94                                             "readOnly": true,
95                                             "width": 150,
96                                             "xtype": "TextField",
97                                             "|xns": "Roo.form"
98                                         }
99                                     ]
100                                 },
101                                 {
102                                     "|xns": "Roo.form",
103                                     "xtype": "Row",
104                                     "items": [
105                                         {
106                                             "boxLabel": "Posted",
107                                             "fieldLabel": "Status",
108                                             "|inputValue": "true",
109                                             "name": "Posted",
110                                             "width": 100,
111                                             "xtype": "Checkbox",
112                                             "|xns": "Roo.form"
113                                         },
114                                         {
115                                             "hideLabels": true,
116                                             "xtype": "Row",
117                                             "|xns": "Roo.form",
118                                             "items": [
119                                                 {
120                                                     "boxLabel": "Recorded in Bank Reconcile",
121                                                     "fieldLabel": " ",
122                                                     "|inputValue": "true",
123                                                     "name": "gltrans_rec",
124                                                     "width": 200,
125                                                     "xtype": "Checkbox",
126                                                     "|xns": "Roo.form"
127                                                 },
128                                                 {
129                                                     "boxLabel": "Deleted",
130                                                     "fieldLabel": "Deleted",
131                                                     "|inputValue": "true",
132                                                     "name": "gltrans_deleted",
133                                                     "width": 75,
134                                                     "xtype": "Checkbox",
135                                                     "|xns": "Roo.form"
136                                                 }
137                                             ]
138                                         }
139                                     ]
140                                 },
141                                 {
142                                     "|xns": "Roo.form",
143                                     "xtype": "Row",
144                                     "items": [
145                                         {
146                                             "fieldLabel": "Source",
147                                             "name": "gltrans_source",
148                                             "readOnly": true,
149                                             "width": 100,
150                                             "xtype": "TextField",
151                                             "|xns": "Roo.form"
152                                         },
153                                         {
154                                             "fieldLabel": "Doc Type",
155                                             "name": "gltrans_doctype",
156                                             "readOnly": true,
157                                             "width": 100,
158                                             "xtype": "TextField",
159                                             "|xns": "Roo.form"
160                                         },
161                                         {
162                                             "fieldLabel": "References",
163                                             "name": "gltrans_misc_id",
164                                             "readOnly": true,
165                                             "width": 75,
166                                             "xtype": "TextField",
167                                             "|xns": "Roo.form"
168                                         },
169                                         {
170                                             "text": "Show",
171                                             "xtype": "Button",
172                                             "|xns": "Roo"
173                                         }
174                                     ]
175                                 },
176                                 {
177                                     "|xns": "Roo.form",
178                                     "xtype": "Row",
179                                     "items": [
180                                         {
181                                             "fieldLabel": "Doc No.",
182                                             "name": "gltrans_docnumber",
183                                             "width": 400,
184                                             "xtype": "TextField",
185                                             "|xns": "Roo.form"
186                                         },
187                                         {
188                                             "fieldLabel": "Doc No.",
189                                             "name": "gltrans_docnumber",
190                                             "width": 400,
191                                             "xtype": "TextField",
192                                             "|xns": "Roo.form"
193                                         }
194                                     ]
195                                 },
196                                 {
197                                     "fieldLabel": "Doc No.",
198                                     "name": "gltrans_docnumber",
199                                     "width": 400,
200                                     "xtype": "TextField",
201                                     "|xns": "Roo.form"
202                                 }
203                             ]
204                         }
205                     ]
206                 },
207                 {
208                     "listeners": {
209                         "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
210                     },
211                     "background": false,
212                     "fitContainer": true,
213                     "fitToframe": true,
214                     "region": "center",
215                     "tableName": "gltrans",
216                     "title": "gltrans",
217                     "xtype": "GridPanel",
218                     "|xns": "Roo",
219                     "items": [
220                         {
221                             "listeners": {
222                                 "|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}",
223                                 "|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"
224                             },
225                             "*prop": "grid",
226                             "autoExpandColumn": "gltrans_accnt_id",
227                             "loadMask": true,
228                             "xtype": "Grid",
229                             "|xns": "Roo.grid",
230                             "items": [
231                                 {
232                                     "listeners": {
233                                         "beforeload": "function (_self, options)\n{\n    this.removeAll();\n    if (!_this.form.findField('gltrans_sequence').getValue()) {\n        return false;\n    }\n    options.params.gltrans_sequence = _this.form.findField('gltrans_sequence').getValue();\n}"
234                                     },
235                                     "*prop": "dataSource",
236                                     "remoteSort": true,
237                                     "xtype": "Store",
238                                     "|sortInfo": "{ field : 'gltrans_source', direction: 'ASC' }",
239                                     "|xns": "Roo.data",
240                                     "items": [
241                                         {
242                                             "*prop": "proxy",
243                                             "xtype": "HttpProxy",
244                                             "method": "GET",
245                                             "|url": "baseURL + '/Roo/gltrans.php'",
246                                             "|xns": "Roo.data"
247                                         },
248                                         {
249                                             "|xns": "Roo.data",
250                                             "xtype": "JsonReader",
251                                             "totalProperty": "total",
252                                             "root": "data",
253                                             "*prop": "reader",
254                                             "id": "id",
255                                             "|fields": "[\n    {\n        'name': 'gltrans_id',\n        'type': 'int'\n    },\n    {\n        'name': 'gltrans_exported',\n        'type': 'int'\n    },\n    {\n        'name': 'gltrans_created',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'gltrans_date',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'gltrans_sequence',\n        'type': 'int'\n    },\n    {\n        'name': 'gltrans_accnt_id',\n        'type': 'int'\n    },\n    {\n        'name': 'gltrans_source',\n        'type': 'string'\n    },\n    {\n        'name': 'gltrans_docnumber',\n        'type': 'string'\n    },\n    {\n        'name': 'gltrans_misc_id',\n        'type': 'int'\n    },\n    {\n        'name': 'gltrans_amount',\n        'type': 'float'\n    },\n    {\n        'name': 'gltrans_notes',\n        'type': 'string'\n    },\n    {\n        'name': 'gltrans_journalnumber',\n        'type': 'int'\n    },\n    {\n        'name': 'gltrans_posted',\n        'type': 'int'\n    },\n    {\n        'name': 'gltrans_doctype',\n        'type': 'string'\n    },\n    {\n        'name': 'gltrans_rec',\n        'type': 'int'\n    },\n    {\n        'name': 'gltrans_username',\n        'type': 'string'\n    },\n    {\n        'name': 'gltrans_deleted',\n        'type': 'int'\n    }\n]"
256                                         }
257                                     ]
258                                 },
259                                 {
260                                     "*prop": "footer",
261                                     "xtype": "PagingToolbar",
262                                     "pageSize": 25,
263                                     "displayInfo": true,
264                                     "displayMsg": "Displaying gltrans{0} - {1} of {2}",
265                                     "emptyMsg": "No gltrans found",
266                                     "|xns": "Roo"
267                                 },
268                                 {
269                                     "*prop": "toolbar",
270                                     "xtype": "Toolbar",
271                                     "|xns": "Roo",
272                                     "items": [
273                                         {
274                                             "text": "Add",
275                                             "xtype": "Button",
276                                             "cls": "x-btn-text-icon",
277                                             "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
278                                             "listeners": {
279                                                 "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
280                                             },
281                                             "|xns": "Roo.Toolbar"
282                                         },
283                                         {
284                                             "|xns": "Roo.Toolbar",
285                                             "xtype": "Fill"
286                                         },
287                                         {
288                                             "text": "Delete",
289                                             "cls": "x-btn-text-icon",
290                                             "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
291                                             "xtype": "Button",
292                                             "listeners": {
293                                                 "|click": "function()\n{\n     Pman.genericDelete(_this, 'gltrans'); \n}\n        "
294                                             },
295                                             "|xns": "Roo.Toolbar"
296                                         }
297                                     ]
298                                 },
299                                 {
300                                     "*prop": "colModel[]",
301                                     "dataIndex": "gltrans_id",
302                                     "header": "ID#",
303                                     "width": 50,
304                                     "xtype": "ColumnModel",
305                                     "|renderer": "function(v) { return String.format('{0}', v); }",
306                                     "|xns": "Roo.grid"
307                                 },
308                                 {
309                                     "*prop": "colModel[]",
310                                     "dataIndex": "gltrans_accnt_id",
311                                     "header": "Account",
312                                     "width": 75,
313                                     "xtype": "ColumnModel",
314                                     "|renderer": "function(v,x,r) {\n\n     return String.format('{0}', r.data.gltrans_accnt_id_accnt_descrip); \n }",
315                                     "|xns": "Roo.grid"
316                                 },
317                                 {
318                                     "*prop": "colModel[]",
319                                     "align": "right",
320                                     "dataIndex": "gltrans_amount",
321                                     "header": "Gltrans amount",
322                                     "width": 100,
323                                     "xtype": "ColumnModel",
324                                     "|renderer": "function(v) { \n\n    var vv = Roo.util.Format.number(v,2);\n    if (v*1 < 0 ) {\n        return '<span style=\"color:red\">' + vv + '</span>';\n    }\n    return vv; \n}",
325                                     "|xns": "Roo.grid"
326                                 }
327                             ]
328                         }
329                     ]
330                 },
331                 {
332                     "listeners": {
333                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
334                     },
335                     "*prop": "buttons[]",
336                     "text": "Cancel",
337                     "xtype": "Button",
338                     "|xns": "Roo"
339                 },
340                 {
341                     "listeners": {
342                         "click": "function (_self, e)\n{\n    // do some checks?\n     \n    if (_this.data.gltrans_id) {\n        return;\n    }\n\n    _this.form.doAction(\"submit\");\n\n}"
343                     },
344                     "*prop": "buttons[]",
345                     "text": "Save",
346                     "xtype": "Button",
347                     "|xns": "Roo"
348                 }
349             ]
350         }
351     ],
352     "permname": "",
353     "modOrder": "001"
354 }