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