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