},
{
"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",
}
});
}
-
+ /*
var voidunposted = function(){
new Pman.Request({
url : baseURL + '/Roo/invhist_transfer',
}
});
}
-
-
- 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;
}
)