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