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