Pman.Tab.XtupleSalesOrder.bjs
authorEdward <edward@roojs.com>
Tue, 25 Feb 2014 10:12:36 +0000 (18:12 +0800)
committerEdward <edward@roojs.com>
Tue, 25 Feb 2014 10:12:36 +0000 (18:12 +0800)
Pman.Tab.XtupleSalesOrder.js

Pman.Tab.XtupleSalesOrder.bjs
Pman.Tab.XtupleSalesOrder.js

index fafb554..cba4a5c 100644 (file)
                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.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}"
+                                                    },
+                                                    "cls": "x-btn-text-icon",
+                                                    "text": "Void / Unpost",
+                                                    "xtype": "Button",
+                                                    "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
+                                                    "|xns": "Roo.Toolbar"
+                                                },
                                                 {
                                                     "xtype": "Fill",
                                                     "|xns": "Roo.Toolbar"
index f663376..485d61b 100644 (file)
@@ -709,6 +709,57 @@ Pman.Tab.XtupleSalesOrder = new Roo.XComponent({
                                         text : "Clear Unpaid Orders",
                                         icon : Roo.rootURL + 'images/default/tree/leaf.gif'
                                     },
+                                    {
+                                        xtype: 'Button',
+                                        xns: Roo.Toolbar,
+                                        listeners : {
+                                            click : function ()
+                                            {
+                                            
+                                                 var sel  = _this.invgrid.getSelectionModel().getSelected();
+                                                if (!sel) {
+                                                    Roo.MessageBox.alert("Error", "Select a invoice");
+                                                    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?",
+                                                    function(r) {
+                                                        if (r != 'yes') {
+                                                            return;
+                                                        }
+                                                        new Pman.Request({
+                                                            mask : 'Sending',
+                                                            url : baseURL + '/Roo/cobmisc',
+                                                            method : 'POST',
+                                                            params :  params,
+                                                            success : function() {
+                                                                _this.invgrid.ds.load({});
+                                                            }
+                                                        })
+                                                        
+                                                    }
+                                                );
+                                                        
+                                                        
+                                               
+                                            }
+                                        },
+                                        cls : 'x-btn-text-icon',
+                                        text : "Void / Unpost",
+                                        icon : rootURL + '/Pman/templates/images/trash.gif'
+                                    },
                                     {
                                         xtype: 'Fill',
                                         xns: Roo.Toolbar