Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Tab.XtuplePurchasesVendors.bjs
index bbcb9e3..8a120da 100644 (file)
@@ -1,5 +1,5 @@
 {
-    "id": "roo-file-53",
+    "id": "roo-file-60",
     "name": "Pman.Tab.XtuplePurchasesVendors",
     "parent": "Pman.Tab.XtuplePurchases",
     "title": "",
@@ -56,7 +56,7 @@
                                         },
                                         {
                                             "listeners": {
-                                                "beforeload": "function (_self, options)\n{\n    \n    if (! _this.searchBox) {\n    // not rendered yet...\n        return false;\n            \n    }\n    options.params = options.params || {};\n    options.params._with_char = 1;\n    options.params['search[name]'] = _this.searchBox.getValue();\n}"
+                                                "beforeload": "function (_self, options)\n{\n    \n    if (! _this.searchBox) {\n    // not rendered yet...\n        return false;\n            \n    }\n    options.params = options.params || {};\n    options.params._with_char = 1;\n    options.params['search[name]'] = _this.searchBox.getValue();\n    \n    if (!_this.active.pressed) {\n        options.params.vend_active = 1;\n    } \n}"
                                             },
                                             "*prop": "dataSource",
                                             "remoteSort": true,
                                                 },
                                                 {
                                                     "listeners": {
-                                                        "|click": "function()\n{\n\n   Pman.Dialog.XtupleVendorEdit.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
+                                                        "toggle": "function (_self, pressed)\n{\n\n    this.setText(pressed ? \"Hide Inactive\" : \"Show Inactive\");\n    (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}",
+                                                        "render": "function (_self)\n{\n    _this.active = _self;\n}"
                                                     },
-                                                    "cls": "x-btn-text-icon",
-                                                    "text": "Add",
+                                                    "enableToggle": true,
+                                                    "text": "Show Inactive",
                                                     "xtype": "Button",
-                                                    "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
                                                     "|xns": "Roo.Toolbar"
                                                 },
+                                                {
+                                                    "|xns": "Roo.Toolbar",
+                                                    "xtype": "Fill"
+                                                },
                                                 {
                                                     "listeners": {
-                                                        "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelected();\n    if (!s)  {\n        Roo.MessageBox.alert(\"Error\", \"Select a Row\");\n        return;\n    }\n\n    Pman.Dialog.XtupleVendorEdit.show(s.data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n    \n}\n"
+                                                        "|click": "function()\n{\n\n   Pman.Dialog.XtupleVendorEdit.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
                                                     },
                                                     "cls": "x-btn-text-icon",
-                                                    "text": "Edit",
+                                                    "text": "Add",
                                                     "xtype": "Button",
-                                                    "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
+                                                    "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
                                                     "|xns": "Roo.Toolbar"
                                                 },
                                                 {
                                                     "listeners": {
-                                                        "|click": "function ()\n{\n\n     var sel  = _this.invgrid.getSelectionModel().getSelected();\n    if (!sel) {\n        Roo.MessageBox.alert(\"Error\", \"Select a invoice\");\n        return;\n    }\n    // check current status of shipment..\n    \n    var params =  {\n//        cobmisc_id : sel.data.cobmisc_id,\n        _void : 1\n    };\n    if (sel.data.cobmisc_id * 1) {\n        params.cobmisc_id = sel.data.cobmisc_id * 1 ;\n    }\n    if (sel.data.cobmisc_invchead_id_invchead_id * 1) {    \n        params.invchead_id  =  sel.data.cobmisc_invchead_id_invchead_id * 1;\n    }\n    \n    Roo.MessageBox.confirm(\"Are you sure\", \"Are you sure you want to VOID that invoice?\",\n        function(r) {\n            if (r != 'yes') {\n                return;\n            }\n            new Pman.Request({\n                mask : 'Sending',\n                url : baseURL + '/Roo/cobmisc',\n                method : 'POST',\n                params :  params,\n                success : function() {\n                    _this.invgrid.ds.load({});\n                }\n            })\n            \n        }\n    );\n            \n            \n   \n}"
+                                                        "|click": "function()\n{\n     var s = _this.grid.getSelectionModel().getSelected();\n     \n     if(!s || s.data.vend_id * 1 < 1){\n        Roo.MessageBox.alert('Error', 'Please select a row');\n        return;\n     }\n     \n     Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to delete that?\",\n        function(v) {\n            if (v != 'yes') {\n                return;\n            }\n             new Pman.Request({\n                method: 'POST',\n                url: baseURL+ '/Roo/vendinfo',\n                params : {\n                    _delete : s.data.vend_id\n                },\n                success : function() {\n                    _this.grid.footer.onClick('refresh');\n                }\n            });\n    });\n}\n        "
                                                     },
                                                     "cls": "x-btn-text-icon",
-                                                    "text": "Void / Unpost",
+                                                    "text": "Delete",
                                                     "xtype": "Button",
                                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
                                                     "|xns": "Roo.Toolbar"
                                                 },
-                                                {
-                                                    "|xns": "Roo.Toolbar",
-                                                    "xtype": "Fill"
-                                                },
                                                 {
                                                     "listeners": {
                                                         "click": "function (_self, e)\n{\n   Pman.Dialog.Image.show(\n       {\n            _url : baseURL+'/Xtuple/Import/Vendors' \n        \n       },\n       function (data) {\n            _this.grid.footer.onClick('first');\n            Roo.MessageBox.alert(\"Notice\", \"DONE\");\n//            Roo.MessageBox.alert(\"Notice\", msg.join(\"\\n\"));\n\n       }\n   );\n}"
                                             "|renderer": "function(v) { return String.format('{0}', v); }",
                                             "|xns": "Roo.grid"
                                         },
+                                        {
+                                            "*prop": "colModel[]",
+                                            "dataIndex": "vend_vendtype_id_vendtype_descrip",
+                                            "header": "Type",
+                                            "width": 150,
+                                            "xtype": "ColumnModel",
+                                            "|renderer": "function(v) { return String.format('{0}', v); }",
+                                            "|xns": "Roo.grid"
+                                        },
                                         {
                                             "*prop": "colModel[]",
                                             "dataIndex": "vend_char_internalcompany",