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