Pman.Dialog.XtupleTransfer.bjs
authorEdward <edward@roojs.com>
Tue, 21 Jan 2014 05:37:15 +0000 (13:37 +0800)
committerEdward <edward@roojs.com>
Tue, 21 Jan 2014 05:37:15 +0000 (13:37 +0800)
Pman.Dialog.XtupleTransfer.js

Pman.Dialog.XtupleTransfer.bjs
Pman.Dialog.XtupleTransfer.js

index 739a69a..4a73cd0 100644 (file)
                                     "items": [
                                         {
                                             "listeners": {
-                                                "|click": "function()\n{\n    var id = _this.form.findField('invhist_transfer_id').getValue();\n\n    if(id * 1 < 1){\n        return;\n    }\n    \n    var ar = [];\n    \n    _this.tgrid.ds.each(function (r) {\n        if(r.data.transfered_qty * 1 - r.data.expected_qty * 1 == 0){\n            //return;\n        }\n        \n        ar.push({\n            id : r.data.invhist_transfer_item_id\n        })\n   });\n   \n   if(!ar.length){\n        Roo.MessageBox.alert(\"Notice\", \"Nothing Wrong!\");\n        return;\n   }\n   \n    new Pman.Request({\n        url : baseURL + '/Roo/invhist_transfer',\n        method : 'POST',\n        mask: 'Fixing',\n        timeout : 1200000, //20 minutes...! - big xfer should be 10mins.\n        params : {\n            invhist_transfer_id : id,\n            _fix : Roo.encode(ar)\n        },\n        success : function () \n        {\n            _this.tgrid.footer.onClick('refresh');\n        }\n    });\n    \n    \n    \n}\n"
+                                                "|click": "function()\n{\n    var id = _this.form.findField('invhist_transfer_id').getValue();\n\n    if(id * 1 < 1){\n        return;\n    }\n    \n    var ar = [];\n    \n    _this.tgrid.ds.each(function (r) {\n        if (_this.data.invhist_transfer_posted && r.data.transfered_qty * 1 == 0 && r.data.expected_qty * 1 == 0) {\n//            return;\n        }\n        if(!_this.data.invhist_transfer_posted && r.data.transfered_qty * 1 - r.data.expected_qty * 1 == 0){\n            //return;\n        }\n        \n        ar.push({\n            id : r.data.invhist_transfer_item_id\n        })\n   });\n   \n   if(!ar.length){\n        Roo.MessageBox.alert(\"Notice\", \"Nothing Wrong!\");\n        return;\n   }\n   \n    new Pman.Request({\n        url : baseURL + '/Roo/invhist_transfer',\n        method : 'POST',\n        mask: 'Fixing',\n        timeout : 1200000, //20 minutes...! - big xfer should be 10mins.\n        params : {\n            invhist_transfer_id : id,\n            _fix : Roo.encode(ar)\n        },\n        success : function () \n        {\n            _this.tgrid.footer.onClick('refresh');\n        }\n    });\n    \n    \n    \n}\n"
                                             },
                                             "cls": "x-btn-text-icon",
                                             "text": "Fix Transfer",
index e2c0078..90931a8 100644 (file)
@@ -1596,7 +1596,10 @@ Pman.Dialog.XtupleTransfer = {
                                             var ar = [];
                                             
                                             _this.tgrid.ds.each(function (r) {
-                                                if(r.data.transfered_qty * 1 - r.data.expected_qty * 1 == 0){
+                                                if (_this.data.invhist_transfer_posted && r.data.transfered_qty * 1 == 0 && r.data.expected_qty * 1 == 0) {
+                                        //            return;
+                                                }
+                                                if(!_this.data.invhist_transfer_posted && r.data.transfered_qty * 1 - r.data.expected_qty * 1 == 0){
                                                     //return;
                                                 }