Pman.Dialog.XtupleCustomer.bjs
authorEdward <edward@roojs.com>
Tue, 10 Feb 2015 07:17:49 +0000 (15:17 +0800)
committerEdward <edward@roojs.com>
Tue, 10 Feb 2015 07:17:49 +0000 (15:17 +0800)
Pman.Dialog.XtupleCustomer.js

Pman.Dialog.XtupleCustomer.bjs
Pman.Dialog.XtupleCustomer.js

index 5044d89..489c461 100644 (file)
                             "items" : [
                                 {
                                     "listeners" : {
-                                        "beforeload" : "function (_self, o)\n{\n    o.params = o.params || {}\n    \n    var cust_id = _this.form.findField('cust_id').getValue() * 1;\n    \n    if(cust_id < 1){\n        this.removeAll();\n        return false;\n    }\n\n    o.params.ontable = 'custinfo';\n    o.params.onid = cust_id;\n}",
-                                        "load" : "function (_self, records, options)\n{\n    function setText(str) {\n    \n        _this.hgrid.footer.el.select('.sales-footer-text', \n                true).first().dom.innerHTML = str;\n    }\n    \n    \n    if (!records.length) {\n        //_this.footertext.setText('');\n        Roo.log(\"no records\");\n        setText('');\n        return;\n    }\n    new Pman.Request({\n        method : 'GET',\n        url : baseURL + '/Roo/cohist',\n        params : {\n            _sums : 1,\n            \n            cust_id : _this.form.findField('cust_id').getValue(),\n            startDate : _this.dateFrom.getValue(),\n            endDate :  _this.dateTo.getValue()\n        },\n        success : function(res) \n        {\n            setText(\"Total Orders : \" + parseInt(res.data[0].total_orders) + \n                    \"  Total Shipped : \" + parseInt(res.data[0].total_shipped) +                  \n                   \"   Total Value: \" + res.data[0].total_basecurr + \" \" +\n                    Roo.util.Format.number(res.data[0].total_value,2)\n            );\n        }\n    });\n    \n        \n}"
+                                        "beforeload" : "function (_self, o)\n{\n    o.params = o.params || {}\n    \n    var cust_id = _this.form.findField('cust_id').getValue() * 1;\n    \n    if(cust_id < 1){\n        this.removeAll();\n        return false;\n    }\n\n    o.params.ontable = 'custinfo';\n    o.params.onid = cust_id;\n}"
                                     },
                                     "xtype" : "Store",
                                     "remoteSort" : true,
index f919edf..942a393 100644 (file)
@@ -1942,43 +1942,6 @@ Pman.Dialog.XtupleCustomer = {
                                   
                                       o.params.ontable = 'custinfo';
                                       o.params.onid = cust_id;
-                                  },
-                               load : function (_self, records, options)
-                                  {
-                                      function setText(str) {
-                                      
-                                          _this.hgrid.footer.el.select('.sales-footer-text', 
-                                                  true).first().dom.innerHTML = str;
-                                      }
-                                      
-                                      
-                                      if (!records.length) {
-                                          //_this.footertext.setText('');
-                                          Roo.log("no records");
-                                          setText('');
-                                          return;
-                                      }
-                                      new Pman.Request({
-                                          method : 'GET',
-                                          url : baseURL + '/Roo/cohist',
-                                          params : {
-                                              _sums : 1,
-                                              
-                                              cust_id : _this.form.findField('cust_id').getValue(),
-                                              startDate : _this.dateFrom.getValue(),
-                                              endDate :  _this.dateTo.getValue()
-                                          },
-                                          success : function(res) 
-                                          {
-                                              setText("Total Orders : " + parseInt(res.data[0].total_orders) + 
-                                                      "  Total Shipped : " + parseInt(res.data[0].total_shipped) +                  
-                                                     "   Total Value: " + res.data[0].total_basecurr + " " +
-                                                      Roo.util.Format.number(res.data[0].total_value,2)
-                                              );
-                                          }
-                                      });
-                                      
-                                          
                                   }
                             },
                             items : [