Pman.Dialog.XtupleSalesOrderNew.bjs
authorEdward <edward@roojs.com>
Fri, 6 Dec 2013 09:16:35 +0000 (17:16 +0800)
committerEdward <edward@roojs.com>
Fri, 6 Dec 2013 09:16:35 +0000 (17:16 +0800)
Pman.Dialog.XtupleSalesOrderNew.js

Pman.Dialog.XtupleSalesOrderNew.bjs
Pman.Dialog.XtupleSalesOrderNew.js

index 33c6c57..03cfd20 100644 (file)
                 },
                 {
                     "listeners": {
-                        "click": "function (_self, e)\n{\n   //_this.findField('cuinfo_\n   \n   // check if customer is filled in.\n   if (_this.form.findField('cohead_cust_id').getValue() < 1) {\n        Roo.MessageBox.alert(\"Error\", \"Select a customer\");\n        return;\n   }\n   \n   var data = _this.form.getFieldValues();\n   var c = _this.form.findField('cohead_cust_id').lastData;\n\n   var cur = _this.form.findField('cohead_curr_id').lastData;   \n   \n   data.cohead_curr_id      = cur.curr_id;\n//   data.cohead_curr_id_curr_name = cur.cust_curr_id_curr_name;\n   data.cohead_curr_id_curr_name = cur.curr_name;\n   \n   data.cohead_terms_id      = c.cust_terms_id;\n   data.cohead_terms_id_terms_descrip = c.cust_terms_id_terms_descrip;\n   \n   // fill in staff in/c..\n   \n   data.cohead_salesrep_id =  Pman.Login.authUser.salesrep.salesrep_id;\n   data.cohead_salesrep_id_salesrep_name =  Pman.Login.authUser.salesrep.salesrep_name;\n   \n   data.cohead_display_salesrep_id = c.cust_salesrep_id;\n   data.cohead_display_salesrep_id_salesrep_name = c.cust_salesrep_id_salesrep_name;\n   \n   data.cohead_orderdate = new Date();\n   \n   \n   data.cohead_location_src = c.default_location_id;\n   data.cohead_location_src_location_name = c.default_location_name;\n   \n   data.cohead_taxzone_id = c.cust_taxzone_id_taxzone_id;\n   data.cohead_taxzone_id_taxzone_descrip = c.cust_taxzone_id_taxzone_descrip;\n   \n   // if customer is online .. .then do not fill this stuff in..\n   \n   if (c.cust_custtype_id_custtype_code == 'ONLINE') {\n         Pman.Dialog.XtupleSalesOrder.show(data, function() {\n            _this.dialog.hide();\n            _this.callback()\n         });    \n         return;\n     }\n   \n   new Pman.Request({\n        url : baseURL + '/Roo/cntct.php',\n        method : 'GET',\n        params : {\n            '_id' : c.cust_cntct_id\n        },\n        success : function (res){\n            if(res.data[0]){\n                for(var i in res.data[0]) {\n                    data['cohead_billto_cntct_id_' + i] = res.data[0][i];\n                }\n             }\n             Roo.log(data);\n             Pman.Dialog.XtupleSalesOrder.show(data, function() {\n                _this.dialog.hide();\n                _this.callback()\n             }); \n        }\n    });\n   \n   \n   \n}"
+                        "click": "function (_self, e)\n{\n   //_this.findField('cuinfo_\n   \n   // check if customer is filled in.\n   if (_this.form.findField('cohead_cust_id').getValue() < 1) {\n        Roo.MessageBox.alert(\"Error\", \"Select a customer\");\n        return;\n   }\n   \n   var data = _this.form.getFieldValues();\n   var c = _this.form.findField('cohead_cust_id').lastData;\n\n   var cur = _this.form.findField('cohead_curr_id').lastData;   \n   \n   data.cohead_curr_id      = cur.curr_id;\n//   data.cohead_curr_id_curr_name = cur.cust_curr_id_curr_name;\n   data.cohead_curr_id_curr_name = cur.curr_name;\n   \n   data.cohead_terms_id      = c.cust_terms_id;\n   data.cohead_terms_id_terms_descrip = c.cust_terms_id_terms_descrip;\n   \n   // fill in staff in/c..\n   \n   data.cohead_salesrep_id =  Pman.Login.authUser.salesrep.salesrep_id;\n   data.cohead_salesrep_id_salesrep_name =  Pman.Login.authUser.salesrep.salesrep_name;\n   \n   data.cohead_display_salesrep_id = c.cust_salesrep_id;\n   data.cohead_display_salesrep_id_salesrep_name = c.cust_salesrep_id_salesrep_name;\n   \n   data.cohead_orderdate = new Date();\n   \n   \n   data.cohead_location_src = c.default_location_id;\n   data.cohead_location_src_location_name = c.default_location_name;\n   \n   data.cohead_taxzone_id = c.cust_taxzone_id_taxzone_id;\n   data.cohead_taxzone_id_taxzone_descrip = c.cust_taxzone_id_taxzone_descrip;\n   \n   // if customer is online .. .then do not fill this stuff in..\n   \n   if (c.cust_custtype_id_custtype_code == 'ONLINE') {\n         Pman.Dialog.XtupleSalesOrder.show(data, function() {\n            _this.dialog.hide();\n            _this.callback()\n         });    \n         return;\n     }\n   \n   new Pman.Request({\n        url : baseURL + '/Roo/cntct.php',\n        method : 'GET',\n        params : {\n            '_id' : c.cust_cntct_id\n        },\n        success : function (res){\n            if(res.data[0]){\n                for(var i in res.data[0]) {\n                    data['cohead_billto_cntct_id_' + i] = res.data[0][i];\n                }\n             }\n             Roo.log('with cntct');\n             Roo.log(data);\n             Pman.Dialog.XtupleSalesOrder.show(data, function() {\n                _this.dialog.hide();\n                _this.callback()\n             }); \n        }\n    });\n   \n   \n   \n}"
                     },
                     "*prop": "buttons[]",
                     "text": "OK",
index efe93c2..e22df5a 100644 (file)
@@ -274,6 +274,7 @@ Pman.Dialog.XtupleSalesOrderNew = {
                                             data['cohead_billto_cntct_id_' + i] = res.data[0][i];
                                         }
                                      }
+                                     Roo.log('with cntct');
                                      Roo.log(data);
                                      Pman.Dialog.XtupleSalesOrder.show(data, function() {
                                         _this.dialog.hide();