Pman.Tab.XtupleCurrency.bjs
authorEdward <edward@roojs.com>
Fri, 27 Dec 2013 06:43:40 +0000 (14:43 +0800)
committerEdward <edward@roojs.com>
Fri, 27 Dec 2013 06:43:40 +0000 (14:43 +0800)
Pman.Tab.XtupleCurrency.js

Pman.Tab.XtupleCurrency.bjs
Pman.Tab.XtupleCurrency.js

index 27248db..5501066 100644 (file)
                                                 },
                                                 {
                                                     "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\n     var sel  = _this.rgrid.getSelectionModel().getSelected();\n    if (!sel) {\n        Roo.MessageBox.alert(\"Error\", \"Select a rate\");\n        return;\n    }\n    \n    Roo.MessageBox.confirm(\"Are you sure\", \"Are you sure you want to delete this rate?\",\n        function(r) {\n            if (r != 'yes') {\n                return;\n            }\n            new Pman.Request({\n                mask : 'Deleting',\n                url : baseURL + '/Roo/curr_rate',\n                method : 'POST',\n                params :  {\n                    _delete : sel.data.curr_rate_id\n                },\n                success : function() {\n                    _this.rgrid.ds.load({});\n                }\n            })\n            \n        }\n    );\n            \n            \n   \n}"
                                                     },
                                                     "cls": "x-btn-text-icon",
                                                     "text": "Delete",
index d1402d0..495e4fb 100644 (file)
@@ -264,36 +264,26 @@ Pman.Tab.XtupleCurrency = new Roo.XComponent({
                                             click : function ()
                                             {
                                             
-                                                 var sel  = _this.invgrid.getSelectionModel().getSelected();
+                                                 var sel  = _this.rgrid.getSelectionModel().getSelected();
                                                 if (!sel) {
-                                                    Roo.MessageBox.alert("Error", "Select a invoice");
+                                                    Roo.MessageBox.alert("Error", "Select a rate");
                                                     return;
                                                 }
-                                                // check current status of shipment..
                                                 
-                                                var params =  {
-                                            //        cobmisc_id : sel.data.cobmisc_id,
-                                                    _void : 1
-                                                };
-                                                if (sel.data.cobmisc_id * 1) {
-                                                    params.cobmisc_id = sel.data.cobmisc_id * 1 ;
-                                                }
-                                                if (sel.data.cobmisc_invchead_id_invchead_id * 1) {    
-                                                    params.invchead_id  =  sel.data.cobmisc_invchead_id_invchead_id * 1;
-                                                }
-                                                
-                                                Roo.MessageBox.confirm("Are you sure", "Are you sure you want to VOID that invoice?",
+                                                Roo.MessageBox.confirm("Are you sure", "Are you sure you want to delete this rate?",
                                                     function(r) {
                                                         if (r != 'yes') {
                                                             return;
                                                         }
                                                         new Pman.Request({
-                                                            mask : 'Sending',
-                                                            url : baseURL + '/Roo/cobmisc',
+                                                            mask : 'Deleting',
+                                                            url : baseURL + '/Roo/curr_rate',
                                                             method : 'POST',
-                                                            params :  params,
+                                                            params :  {
+                                                                _delete : sel.data.curr_rate_id
+                                                            },
                                                             success : function() {
-                                                                _this.invgrid.ds.load({});
+                                                                _this.rgrid.ds.load({});
                                                             }
                                                         })