Pman.Tab.XtupleMetric.bjs
authorEdward <edward@roojs.com>
Tue, 5 Aug 2014 07:01:06 +0000 (15:01 +0800)
committerEdward <edward@roojs.com>
Tue, 5 Aug 2014 07:01:06 +0000 (15:01 +0800)
Pman.Tab.XtupleMetric.js

Pman.Tab.XtupleMetric.bjs
Pman.Tab.XtupleMetric.js

index 63f1a0d..a9c816d 100644 (file)
                                     "xtype": "Button",
                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.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": "Remove",
+                                    "xtype": "Button",
+                                    "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
+                                    "|xns": "Roo.Toolbar"
                                 }
                             ]
                         },
index 40cde54..89b9ebc 100644 (file)
@@ -194,6 +194,57 @@ Pman.Tab.XtupleMetric = new Roo.XComponent({
                             cls : 'x-btn-text-icon',
                             text : "Add",
                             icon : Roo.rootURL + 'images/default/dd/drop-add.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 : "Remove",
+                            icon : rootURL + '/Pman/templates/images/trash.gif'
                         }
                     ]
                 },