Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleJournalEntry.bjs
index 24e3cf2..dc059f2 100644 (file)
@@ -1,14 +1,14 @@
 {
-    "id": "roo-file-528",
+    "id": "roo-file-16",
     "name": "Pman.Dialog.XtupleJournalEntry",
     "parent": "",
     "title": "",
-    "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleJournalEntry.bjs",
+    "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleJournalEntry.bjs",
     "items": [
         {
             "closable": false,
             "collapsible": false,
-            "height": 910,
+            "height": 600,
             "modal": true,
             "resizable": false,
             "title": "Create / View  Transaction",
@@ -34,7 +34,7 @@
                     "items": [
                         {
                             "listeners": {
-                                "|actioncomplete": "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       //_this.dialog.el.mask(\"Loading\");\n       //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n       return;\n    }\n    if (action.type == 'load') {\n        _this.dialog.el.unmask();\n        return;\n    }\n    if (action.type =='submit') {\n    \n        _this.dialog.el.unmask();\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",
+                                "|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",
                                 "|rendered": "function (form)\n{\n    _this.form= form;\n}\n"
                             },
                             "labelAlign": "right",
@@ -52,6 +52,7 @@
                                         {
                                             "fieldLabel": "Sequence",
                                             "name": "gltrans_sequence",
+                                            "readOnly": true,
                                             "width": 100,
                                             "xtype": "TextField",
                                             "|xns": "Roo.form"
@@ -59,6 +60,7 @@
                                         {
                                             "fieldLabel": "Journal No.",
                                             "name": "gltrans_journalnumber",
+                                            "readOnly": true,
                                             "width": 75,
                                             "xtype": "TextField",
                                             "|xns": "Roo.form"
@@ -87,8 +89,9 @@
                                             "|xns": "Roo.form"
                                         },
                                         {
-                                            "fieldLabel": "Entered",
-                                            "name": "gltrans_entered",
+                                            "fieldLabel": "Created",
+                                            "name": "gltrans_created",
+                                            "readOnly": true,
                                             "width": 150,
                                             "xtype": "TextField",
                                             "|xns": "Roo.form"
                                         {
                                             "boxLabel": "Posted",
                                             "fieldLabel": "Status",
-                                            "name": "Posted",
-                                            "width": 75,
+                                            "name": "gltrans_posted",
+                                            "width": 100,
                                             "xtype": "Checkbox",
+                                            "|inputValue": "true",
                                             "|xns": "Roo.form"
                                         },
                                         {
                                                 {
                                                     "boxLabel": "Recorded in Bank Reconcile",
                                                     "fieldLabel": " ",
+                                                    "|inputValue": "true",
                                                     "name": "gltrans_rec",
                                                     "width": 200,
                                                     "xtype": "Checkbox",
                                                 {
                                                     "boxLabel": "Deleted",
                                                     "fieldLabel": "Deleted",
+                                                    "|inputValue": "true",
                                                     "name": "gltrans_deleted",
                                                     "width": 75,
                                                     "xtype": "Checkbox",
                                         {
                                             "fieldLabel": "Source",
                                             "name": "gltrans_source",
+                                            "readOnly": true,
                                             "width": 100,
                                             "xtype": "TextField",
                                             "|xns": "Roo.form"
                                         {
                                             "fieldLabel": "Doc Type",
                                             "name": "gltrans_doctype",
+                                            "readOnly": true,
                                             "width": 100,
                                             "xtype": "TextField",
                                             "|xns": "Roo.form"
                                         {
                                             "fieldLabel": "References",
                                             "name": "gltrans_misc_id",
+                                            "readOnly": true,
                                             "width": 75,
                                             "xtype": "TextField",
                                             "|xns": "Roo.form"
+                                        },
+                                        {
+                                            "text": "Show",
+                                            "xtype": "Button",
+                                            "|xns": "Roo"
+                                        }
+                                    ]
+                                },
+                                {
+                                    "|xns": "Roo.form",
+                                    "xtype": "Row",
+                                    "items": [
+                                        {
+                                            "fieldLabel": "Doc No.",
+                                            "name": "gltrans_docnumber",
+                                            "width": 100,
+                                            "xtype": "TextField",
+                                            "|xns": "Roo.form"
+                                        },
+                                        {
+                                            "fieldLabel": "Notes",
+                                            "name": "gltrans_notes",
+                                            "width": 300,
+                                            "xtype": "TextField",
+                                            "|xns": "Roo.form"
+                                        }
+                                    ]
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "listeners": {
+                        "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
+                    },
+                    "background": false,
+                    "fitContainer": true,
+                    "fitToframe": true,
+                    "region": "center",
+                    "tableName": "gltrans",
+                    "title": "gltrans",
+                    "xtype": "GridPanel",
+                    "|xns": "Roo",
+                    "items": [
+                        {
+                            "listeners": {
+                                "|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}",
+                                "|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"
+                            },
+                            "*prop": "grid",
+                            "autoExpandColumn": "gltrans_accnt_id",
+                            "loadMask": true,
+                            "xtype": "Grid",
+                            "|xns": "Roo.grid",
+                            "items": [
+                                {
+                                    "listeners": {
+                                        "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}"
+                                    },
+                                    "*prop": "dataSource",
+                                    "remoteSort": true,
+                                    "xtype": "Store",
+                                    "|sortInfo": "{ field : 'gltrans_source', direction: 'ASC' }",
+                                    "|xns": "Roo.data",
+                                    "items": [
+                                        {
+                                            "*prop": "proxy",
+                                            "xtype": "HttpProxy",
+                                            "method": "GET",
+                                            "|url": "baseURL + '/Roo/gltrans.php'",
+                                            "|xns": "Roo.data"
+                                        },
+                                        {
+                                            "|xns": "Roo.data",
+                                            "xtype": "JsonReader",
+                                            "totalProperty": "total",
+                                            "root": "data",
+                                            "*prop": "reader",
+                                            "id": "id",
+                                            "|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]"
+                                        }
+                                    ]
+                                },
+                                {
+                                    "*prop": "footer",
+                                    "xtype": "PagingToolbar",
+                                    "pageSize": 25,
+                                    "displayInfo": true,
+                                    "displayMsg": "Displaying gltrans{0} - {1} of {2}",
+                                    "emptyMsg": "No gltrans found",
+                                    "|xns": "Roo"
+                                },
+                                {
+                                    "*prop": "toolbar",
+                                    "xtype": "Toolbar",
+                                    "|xns": "Roo",
+                                    "items": [
+                                        {
+                                            "text": "Add",
+                                            "xtype": "Button",
+                                            "cls": "x-btn-text-icon",
+                                            "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
+                                            "listeners": {
+                                                "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
+                                            },
+                                            "|xns": "Roo.Toolbar"
+                                        },
+                                        {
+                                            "|xns": "Roo.Toolbar",
+                                            "xtype": "Fill"
+                                        },
+                                        {
+                                            "text": "Delete",
+                                            "cls": "x-btn-text-icon",
+                                            "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
+                                            "xtype": "Button",
+                                            "listeners": {
+                                                "|click": "function()\n{\n     Pman.genericDelete(_this, 'gltrans'); \n}\n        "
+                                            },
+                                            "|xns": "Roo.Toolbar"
                                         }
                                     ]
                                 },
                                 {
-                                    "fieldLabel": "Doc No.",
-                                    "name": "gltrans_docnumber",
-                                    "width": 400,
-                                    "xtype": "TextField",
-                                    "|xns": "Roo.form"
+                                    "*prop": "colModel[]",
+                                    "dataIndex": "gltrans_id",
+                                    "header": "ID#",
+                                    "width": 50,
+                                    "xtype": "ColumnModel",
+                                    "|renderer": "function(v) { return String.format('{0}', v); }",
+                                    "|xns": "Roo.grid"
+                                },
+                                {
+                                    "*prop": "colModel[]",
+                                    "dataIndex": "gltrans_accnt_id",
+                                    "header": "Account",
+                                    "width": 75,
+                                    "xtype": "ColumnModel",
+                                    "|renderer": "function(v,x,r) {\n\n     return String.format('{0}', r.data.gltrans_accnt_id_accnt_descrip); \n }",
+                                    "|xns": "Roo.grid"
+                                },
+                                {
+                                    "*prop": "colModel[]",
+                                    "align": "right",
+                                    "dataIndex": "gltrans_amount",
+                                    "header": "Gltrans amount",
+                                    "width": 100,
+                                    "xtype": "ColumnModel",
+                                    "|renderer": "function(v) { \n\n    var vv = Roo.util.Format.number(v,2);\n    if (v*1 < 0 ) {\n        return '<span style=\"color:red\">' + vv + '</span>';\n    }\n    return vv; \n}",
+                                    "|xns": "Roo.grid"
                                 }
                             ]
                         }
                 },
                 {
                     "listeners": {
-                        "click": "function (_self, e)\n{\n    // do some checks?\n     \n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
+                        "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}"
                     },
                     "*prop": "buttons[]",
                     "text": "Save",