Pman.Tab.XtupleTransfer.bjs
authorEdward <edward@roojs.com>
Mon, 20 Jan 2014 06:21:38 +0000 (14:21 +0800)
committerEdward <edward@roojs.com>
Mon, 20 Jan 2014 06:21:38 +0000 (14:21 +0800)
Pman.Tab.XtupleTransfer.js

Pman.Tab.XtupleTransfer.bjs
Pman.Tab.XtupleTransfer.js

index 1b2bb09..4d8c5d3 100644 (file)
                                 },
                                 {
                                     "listeners": {
-                                        "|click": "function()\n{\n       var sel = _this.postedCombo.getValue();\n       if (sel.match(/^office-/)) {\n        Roo.Msg.alert('Error', \"You can not Post transfer from coid office\");\n        return;\n     }\n    \n    var s = _this.grid.selModel.getSelected();\n    if (!s) {\n        Roo.MessageBox.alert(\"Error\", \"Select a row to void\");\n        return;\n    }\n    \n    var voidposted = function(){\n        new Pman.Request({\n            url : baseURL + '/Roo/invhist_transfer',\n            method : 'POST',\n            mask : \"Voiding\",\n            params : {\n                invhist_transfer_id : s.data.invhist_transfer_id,\n                _void : 1\n            },\n            success : function () \n            {\n                _this.grid.footer.onClick('refresh');\n            }\n        });\n    }\n    \n    var voidunposted = function(){\n        new Pman.Request({\n            url : baseURL + '/Roo/invhist_transfer',\n            method : 'POST',\n            mask : \"Voiding\",\n            params : {\n                invhist_transfer_id : s.data.invhist_transfer_id,\n                invhist_transfer_void : 1\n            },\n            success : function () \n            {\n                _this.grid.footer.onClick('refresh');\n            }\n        });\n    }\n    \n    \n    var posted = s.data.invhist_transfer_posted;\n    \n    Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to void that\", \n        function(r) {\n            if (r != 'yes') {\n                return;\n            }\n            if(posted){\n                voidposted();\n                return;\n            }       \n            voidunposted();\n        }\n    )\n    \n}\n        "
+                                        "|click": "function()\n{\n       var sel = _this.postedCombo.getValue();\n       if (sel.match(/^office-/)) {\n        Roo.Msg.alert('Error', \"You can not Post transfer from coid office\");\n        return;\n     }\n    \n    var s = _this.grid.selModel.getSelected();\n    if (!s) {\n        Roo.MessageBox.alert(\"Error\", \"Select a row to void\");\n        return;\n    }\n    \n    var voidposted = function(){\n        new Pman.Request({\n            url : baseURL + '/Roo/invhist_transfer',\n            method : 'POST',\n            mask : \"Voiding\",\n            params : {\n                invhist_transfer_id : s.data.invhist_transfer_id,\n                _void : 1\n            },\n            success : function () \n            {\n                _this.grid.footer.onClick('refresh');\n            }\n        });\n    }\n    /*\n    var voidunposted = function(){\n        new Pman.Request({\n            url : baseURL + '/Roo/invhist_transfer',\n            method : 'POST',\n            mask : \"Voiding\",\n            params : {\n                invhist_transfer_id : s.data.invhist_transfer_id,\n                invhist_transfer_void : 1\n            },\n            success : function () \n            {\n                _this.grid.footer.onClick('refresh');\n            }\n        });\n    }\n    */\n    \n    Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to void that\", \n        function(r) {\n            if (r != 'yes') {\n                return;\n            }\n            voidposted();\n            return;\n        }\n    )\n    \n}\n        "
                                     },
                                     "cls": "x-btn-text-icon",
                                     "text": "Void",
index 3dceca7..df681cb 100644 (file)
@@ -564,7 +564,7 @@ Pman.Tab.XtupleTransfer = new Roo.XComponent({
                                             }
                                         });
                                     }
-                                    
+                                    /*
                                     var voidunposted = function(){
                                         new Pman.Request({
                                             url : baseURL + '/Roo/invhist_transfer',
@@ -580,20 +580,15 @@ Pman.Tab.XtupleTransfer = new Roo.XComponent({
                                             }
                                         });
                                     }
-                                    
-                                    
-                                    var posted = s.data.invhist_transfer_posted;
+                                    */
                                     
                                     Roo.MessageBox.confirm("Confirm", "Are you sure you want to void that", 
                                         function(r) {
                                             if (r != 'yes') {
                                                 return;
                                             }
-                                            if(posted){
-                                                voidposted();
-                                                return;
-                                            }       
-                                            voidunposted();
+                                            voidposted();
+                                            return;
                                         }
                                     )