Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleJournalEntry.bjs
1 {
2     "id": "roo-file-16",
3     "name": "Pman.Dialog.XtupleJournalEntry",
4     "parent": "",
5     "title": "",
6     "path": "/home/edward/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                                             "name": "gltrans_posted",
109                                             "width": 100,
110                                             "xtype": "Checkbox",
111                                             "|inputValue": "true",
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": 100,
184                                             "xtype": "TextField",
185                                             "|xns": "Roo.form"
186                                         },
187                                         {
188                                             "fieldLabel": "Notes",
189                                             "name": "gltrans_notes",
190                                             "width": 300,
191                                             "xtype": "TextField",
192                                             "|xns": "Roo.form"
193                                         }
194                                     ]
195                                 }
196                             ]
197                         }
198                     ]
199                 },
200                 {
201                     "listeners": {
202                         "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
203                     },
204                     "background": false,
205                     "fitContainer": true,
206                     "fitToframe": true,
207                     "region": "center",
208                     "tableName": "gltrans",
209                     "title": "gltrans",
210                     "xtype": "GridPanel",
211                     "|xns": "Roo",
212                     "items": [
213                         {
214                             "listeners": {
215                                 "|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}",
216                                 "|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"
217                             },
218                             "*prop": "grid",
219                             "autoExpandColumn": "gltrans_accnt_id",
220                             "loadMask": true,
221                             "xtype": "Grid",
222                             "|xns": "Roo.grid",
223                             "items": [
224                                 {
225                                     "listeners": {
226                                         "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}"
227                                     },
228                                     "*prop": "dataSource",
229                                     "remoteSort": true,
230                                     "xtype": "Store",
231                                     "|sortInfo": "{ field : 'gltrans_source', direction: 'ASC' }",
232                                     "|xns": "Roo.data",
233                                     "items": [
234                                         {
235                                             "*prop": "proxy",
236                                             "xtype": "HttpProxy",
237                                             "method": "GET",
238                                             "|url": "baseURL + '/Roo/gltrans.php'",
239                                             "|xns": "Roo.data"
240                                         },
241                                         {
242                                             "|xns": "Roo.data",
243                                             "xtype": "JsonReader",
244                                             "totalProperty": "total",
245                                             "root": "data",
246                                             "*prop": "reader",
247                                             "id": "id",
248                                             "|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]"
249                                         }
250                                     ]
251                                 },
252                                 {
253                                     "*prop": "footer",
254                                     "xtype": "PagingToolbar",
255                                     "pageSize": 25,
256                                     "displayInfo": true,
257                                     "displayMsg": "Displaying gltrans{0} - {1} of {2}",
258                                     "emptyMsg": "No gltrans found",
259                                     "|xns": "Roo"
260                                 },
261                                 {
262                                     "*prop": "toolbar",
263                                     "xtype": "Toolbar",
264                                     "|xns": "Roo",
265                                     "items": [
266                                         {
267                                             "text": "Add",
268                                             "xtype": "Button",
269                                             "cls": "x-btn-text-icon",
270                                             "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
271                                             "listeners": {
272                                                 "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
273                                             },
274                                             "|xns": "Roo.Toolbar"
275                                         },
276                                         {
277                                             "|xns": "Roo.Toolbar",
278                                             "xtype": "Fill"
279                                         },
280                                         {
281                                             "text": "Delete",
282                                             "cls": "x-btn-text-icon",
283                                             "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
284                                             "xtype": "Button",
285                                             "listeners": {
286                                                 "|click": "function()\n{\n     Pman.genericDelete(_this, 'gltrans'); \n}\n        "
287                                             },
288                                             "|xns": "Roo.Toolbar"
289                                         }
290                                     ]
291                                 },
292                                 {
293                                     "*prop": "colModel[]",
294                                     "dataIndex": "gltrans_id",
295                                     "header": "ID#",
296                                     "width": 50,
297                                     "xtype": "ColumnModel",
298                                     "|renderer": "function(v) { return String.format('{0}', v); }",
299                                     "|xns": "Roo.grid"
300                                 },
301                                 {
302                                     "*prop": "colModel[]",
303                                     "dataIndex": "gltrans_accnt_id",
304                                     "header": "Account",
305                                     "width": 75,
306                                     "xtype": "ColumnModel",
307                                     "|renderer": "function(v,x,r) {\n\n     return String.format('{0}', r.data.gltrans_accnt_id_accnt_descrip); \n }",
308                                     "|xns": "Roo.grid"
309                                 },
310                                 {
311                                     "*prop": "colModel[]",
312                                     "align": "right",
313                                     "dataIndex": "gltrans_amount",
314                                     "header": "Gltrans amount",
315                                     "width": 100,
316                                     "xtype": "ColumnModel",
317                                     "|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}",
318                                     "|xns": "Roo.grid"
319                                 }
320                             ]
321                         }
322                     ]
323                 },
324                 {
325                     "listeners": {
326                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
327                     },
328                     "*prop": "buttons[]",
329                     "text": "Cancel",
330                     "xtype": "Button",
331                     "|xns": "Roo"
332                 },
333                 {
334                     "listeners": {
335                         "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}"
336                     },
337                     "*prop": "buttons[]",
338                     "text": "Save",
339                     "xtype": "Button",
340                     "|xns": "Roo"
341                 }
342             ]
343         }
344     ],
345     "permname": "",
346     "modOrder": "001"
347 }