Pman.Dialog.XtupleJournalEntry.bjs
[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                                             "inputValue": "true",
109                                             "name": "Posted",
110                                             "valueOff": 0,
111                                             "width": 100,
112                                             "xtype": "Checkbox",
113                                             "|xns": "Roo.form"
114                                         },
115                                         {
116                                             "hideLabels": true,
117                                             "xtype": "Row",
118                                             "|xns": "Roo.form",
119                                             "items": [
120                                                 {
121                                                     "boxLabel": "Recorded in Bank Reconcile",
122                                                     "fieldLabel": " ",
123                                                     "|inputValue": "true",
124                                                     "name": "gltrans_rec",
125                                                     "width": 200,
126                                                     "xtype": "Checkbox",
127                                                     "|xns": "Roo.form"
128                                                 },
129                                                 {
130                                                     "boxLabel": "Deleted",
131                                                     "fieldLabel": "Deleted",
132                                                     "|inputValue": "true",
133                                                     "name": "gltrans_deleted",
134                                                     "width": 75,
135                                                     "xtype": "Checkbox",
136                                                     "|xns": "Roo.form"
137                                                 }
138                                             ]
139                                         }
140                                     ]
141                                 },
142                                 {
143                                     "|xns": "Roo.form",
144                                     "xtype": "Row",
145                                     "items": [
146                                         {
147                                             "fieldLabel": "Source",
148                                             "name": "gltrans_source",
149                                             "readOnly": true,
150                                             "width": 100,
151                                             "xtype": "TextField",
152                                             "|xns": "Roo.form"
153                                         },
154                                         {
155                                             "fieldLabel": "Doc Type",
156                                             "name": "gltrans_doctype",
157                                             "readOnly": true,
158                                             "width": 100,
159                                             "xtype": "TextField",
160                                             "|xns": "Roo.form"
161                                         },
162                                         {
163                                             "fieldLabel": "References",
164                                             "name": "gltrans_misc_id",
165                                             "readOnly": true,
166                                             "width": 75,
167                                             "xtype": "TextField",
168                                             "|xns": "Roo.form"
169                                         },
170                                         {
171                                             "text": "Show",
172                                             "xtype": "Button",
173                                             "|xns": "Roo"
174                                         }
175                                     ]
176                                 },
177                                 {
178                                     "|xns": "Roo.form",
179                                     "xtype": "Row",
180                                     "items": [
181                                         {
182                                             "fieldLabel": "Doc No.",
183                                             "name": "gltrans_docnumber",
184                                             "width": 100,
185                                             "xtype": "TextField",
186                                             "|xns": "Roo.form"
187                                         },
188                                         {
189                                             "fieldLabel": "Notes",
190                                             "name": "gltrans_notes",
191                                             "width": 300,
192                                             "xtype": "TextField",
193                                             "|xns": "Roo.form"
194                                         }
195                                     ]
196                                 }
197                             ]
198                         }
199                     ]
200                 },
201                 {
202                     "listeners": {
203                         "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
204                     },
205                     "background": false,
206                     "fitContainer": true,
207                     "fitToframe": true,
208                     "region": "center",
209                     "tableName": "gltrans",
210                     "title": "gltrans",
211                     "xtype": "GridPanel",
212                     "|xns": "Roo",
213                     "items": [
214                         {
215                             "listeners": {
216                                 "|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}",
217                                 "|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"
218                             },
219                             "*prop": "grid",
220                             "autoExpandColumn": "gltrans_accnt_id",
221                             "loadMask": true,
222                             "xtype": "Grid",
223                             "|xns": "Roo.grid",
224                             "items": [
225                                 {
226                                     "listeners": {
227                                         "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}"
228                                     },
229                                     "*prop": "dataSource",
230                                     "remoteSort": true,
231                                     "xtype": "Store",
232                                     "|sortInfo": "{ field : 'gltrans_source', direction: 'ASC' }",
233                                     "|xns": "Roo.data",
234                                     "items": [
235                                         {
236                                             "*prop": "proxy",
237                                             "xtype": "HttpProxy",
238                                             "method": "GET",
239                                             "|url": "baseURL + '/Roo/gltrans.php'",
240                                             "|xns": "Roo.data"
241                                         },
242                                         {
243                                             "|xns": "Roo.data",
244                                             "xtype": "JsonReader",
245                                             "totalProperty": "total",
246                                             "root": "data",
247                                             "*prop": "reader",
248                                             "id": "id",
249                                             "|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]"
250                                         }
251                                     ]
252                                 },
253                                 {
254                                     "*prop": "footer",
255                                     "xtype": "PagingToolbar",
256                                     "pageSize": 25,
257                                     "displayInfo": true,
258                                     "displayMsg": "Displaying gltrans{0} - {1} of {2}",
259                                     "emptyMsg": "No gltrans found",
260                                     "|xns": "Roo"
261                                 },
262                                 {
263                                     "*prop": "toolbar",
264                                     "xtype": "Toolbar",
265                                     "|xns": "Roo",
266                                     "items": [
267                                         {
268                                             "text": "Add",
269                                             "xtype": "Button",
270                                             "cls": "x-btn-text-icon",
271                                             "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
272                                             "listeners": {
273                                                 "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
274                                             },
275                                             "|xns": "Roo.Toolbar"
276                                         },
277                                         {
278                                             "|xns": "Roo.Toolbar",
279                                             "xtype": "Fill"
280                                         },
281                                         {
282                                             "text": "Delete",
283                                             "cls": "x-btn-text-icon",
284                                             "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
285                                             "xtype": "Button",
286                                             "listeners": {
287                                                 "|click": "function()\n{\n     Pman.genericDelete(_this, 'gltrans'); \n}\n        "
288                                             },
289                                             "|xns": "Roo.Toolbar"
290                                         }
291                                     ]
292                                 },
293                                 {
294                                     "*prop": "colModel[]",
295                                     "dataIndex": "gltrans_id",
296                                     "header": "ID#",
297                                     "width": 50,
298                                     "xtype": "ColumnModel",
299                                     "|renderer": "function(v) { return String.format('{0}', v); }",
300                                     "|xns": "Roo.grid"
301                                 },
302                                 {
303                                     "*prop": "colModel[]",
304                                     "dataIndex": "gltrans_accnt_id",
305                                     "header": "Account",
306                                     "width": 75,
307                                     "xtype": "ColumnModel",
308                                     "|renderer": "function(v,x,r) {\n\n     return String.format('{0}', r.data.gltrans_accnt_id_accnt_descrip); \n }",
309                                     "|xns": "Roo.grid"
310                                 },
311                                 {
312                                     "*prop": "colModel[]",
313                                     "align": "right",
314                                     "dataIndex": "gltrans_amount",
315                                     "header": "Gltrans amount",
316                                     "width": 100,
317                                     "xtype": "ColumnModel",
318                                     "|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}",
319                                     "|xns": "Roo.grid"
320                                 }
321                             ]
322                         }
323                     ]
324                 },
325                 {
326                     "listeners": {
327                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
328                     },
329                     "*prop": "buttons[]",
330                     "text": "Cancel",
331                     "xtype": "Button",
332                     "|xns": "Roo"
333                 },
334                 {
335                     "listeners": {
336                         "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}"
337                     },
338                     "*prop": "buttons[]",
339                     "text": "Save",
340                     "xtype": "Button",
341                     "|xns": "Roo"
342                 }
343             ]
344         }
345     ],
346     "permname": "",
347     "modOrder": "001"
348 }