Pman.Dialog.XtupleSalesOrder.bjs
authoredward <edward@roojs.com>
Thu, 10 Aug 2017 04:58:50 +0000 (12:58 +0800)
committeredward <edward@roojs.com>
Thu, 10 Aug 2017 04:58:50 +0000 (12:58 +0800)
Pman.Dialog.XtupleSalesOrder.js

Pman.Dialog.XtupleSalesOrder.bjs
Pman.Dialog.XtupleSalesOrder.js

index 222292e..108fba4 100644 (file)
@@ -11,7 +11,7 @@
   "249ff431aa95198ad6814dd1d2799883" : "Select taxtype",
   "fce9a6a1bd2a2050eb86d33103f46fd3" : "Invoices",
   "a2fdeac60e3c5b6c51a92e027fb9d533" : "Target Delivery",
-  "96b0141273eabab320119c467cdcaf17" : "Total",
+  "96b0141273eabab320119c467cdcaf17" : "Total ",
   "d682c376c82f68bc65dcd05570d04dfc" : "Payments / Refunds / Credit Memos",
   "75ba8d70e3692ba200f0e0df37b4d2ae" : "IP address",
   "9f4f3d35db49c5c2bba70a321a42fa87" : "Find Products",
   "1d144309cbdf2536723621bf0eac9f33" : "or enter Address",
   "3d96cc39e5517a284e203ffc8cafcf51" : "Print Bambini Pronto Invoice",
   "9c9745a343efeacc9efe9b7222b27afb" : "Ref#",
-  "c43b0fbe81e21c0a874a155ce528eebf" : "Apply % Discount of : ",
+  "900eb3dcf3a7d639acbd2528ca5bbd52" : "Apply % Discount of : ",
   "e8586011952b0d098b0e568f20ca2b1f" : "Select Currency",
   "fa1cfdb383ea976facbdb20d40d2f811" : "Duplicate Selected",
   "6ac26fe4e9a39ac45fffe6d6920dac3a" : "Print Chinese Invoice",
   "182875b6c36a761f1e459624c1d93638" : "Profit",
   "3ffaf70863d6f46e2719050a37d9ef86" : "Order#",
-  "8fb8fbc1c0bc53b2d01121344410e444" : "Split sales",
-  "09466661df2abefeecf849e52fce8fb4" : "Total "
+  "8fb8fbc1c0bc53b2d01121344410e444" : "Split sales"
  },
  "items" : [
   {
       "activate" : "function (_self)\n{\n    // we need to reload to find out the subtotal.\n    if (!_this.data || !_this.data.cohead_id) {\n        return;\n    }\n    new Pman.Request({\n        method : 'GET',\n        url : baseURL + '/Roo/cohead',\n        params : { \n            _id : _this.data.cohead_id\n        },\n        success : function(res) {\n            _this.form.findField('cohead_subtotal').setValue(res.data.cohead_subtotal);\n            _this.form.findField('cohead_tax').setValue(res.data.cohead_tax);\n            _this.form.findField('cohead_uninvoiced').setValue(res.data.cohead_uninvoiced);\n            _this.form.findField('cohead_unshipped').setValue(res.data.cohead_unshipped);\n           _this.form.findField('cohead_pretax_discount').setValue(res.data.cohead_pretax_discount); \n            _this.form.findField('cohead_total').recalc(); \n            _this.form.findField('cohead_misc').recalc(); \n        }\n    });\n}"
      },
      "region" : "center",
-     "title" : "Order Details",
      "xtype" : "ContentPanel",
+     "title" : "Order Details",
      "$ xns" : "Roo",
      "items" : [
       {
         "|rendered" : "function (form)\n{\n    _this.form= form;\n}\n"
        },
        "$ url" : "baseURL + '/Roo/cohead.php'",
-       "method" : "POST",
        "xtype" : "Form",
+       "method" : "POST",
        "style" : "margin:10px;",
        "$ xns" : "Roo.form",
        "items" : [
         {
          "xtype" : "Column",
-         "$ xns" : "Roo.form",
          "width" : 435,
+         "$ xns" : "Roo.form",
          "items" : [
           {
+           "legend" : "Order",
            "xtype" : "FieldSet",
            "style" : "width:420px",
-           "legend" : "Order",
            "labelWidth" : 120,
            "$ xns" : "Roo.form",
            "items" : [
                "items" : [
                 {
                  "fieldLabel" : "Order#",
-                 "xtype" : "TextField",
                  "emptyText" : "Automatic",
+                 "xtype" : "TextField",
                  "allowBlank" : true,
                  "readOnly" : true,
                  "width" : 120,
                  "items" : [
                   {
                    "$ url" : "baseURL + '/Roo/location.php'",
-                   "method" : "GET",
                    "xtype" : "HttpProxy",
+                   "method" : "GET",
                    "$ xns" : "Roo.data",
                    "* prop" : "proxy"
                   },
            ]
           },
           {
+           "legend" : "Details",
            "xtype" : "FieldSet",
            "style" : "width:420px",
-           "legend" : "Details",
            "labelWidth" : 100,
            "$ xns" : "Roo.form",
            "items" : [
                  "items" : [
                   {
                    "$ url" : "baseURL + '/Roo/terms.php'",
-                   "xtype" : "HttpProxy",
                    "method" : "GET",
+                   "xtype" : "HttpProxy",
                    "$ xns" : "Roo.data",
                    "* prop" : "proxy"
                   },
                  "items" : [
                   {
                    "$ url" : "baseURL + '/Roo/salesrep.php'",
-                   "xtype" : "HttpProxy",
                    "method" : "GET",
+                   "xtype" : "HttpProxy",
                    "$ xns" : "Roo.data",
                    "* prop" : "proxy"
                   },
                  "items" : [
                   {
                    "$ url" : "baseURL + '/Roo/salesrep.php'",
-                   "xtype" : "HttpProxy",
                    "method" : "GET",
+                   "xtype" : "HttpProxy",
                    "$ xns" : "Roo.data",
                    "* prop" : "proxy"
                   },
            ]
           },
           {
+           "xtype" : "FieldSet",
            "legend" : "Billing",
            "style" : "width:420px",
-           "xtype" : "FieldSet",
            "$ xns" : "Roo.form",
            "items" : [
             {
                  "items" : [
                   {
                    "$ url" : "baseURL + '/Roo/cntct.php'",
-                   "xtype" : "HttpProxy",
                    "method" : "GET",
+                   "xtype" : "HttpProxy",
                    "$ xns" : "Roo.data",
                    "* prop" : "proxy"
                   },
                 "render" : "function (_self)\n{\n   Roo.log(this.el)\n   \n   \n   \n   this.el.on('click', function() { \n       var id = _this.form.findField('cohead_billto_cntct_id').getValue();\n        Pman.Dialog.XtupleQuickContact.show( \n            {\n              _id : id,\n              customer_id : _this.form.findField('cohead_cust_id').getValue()\n            },\n            \n            function (data) {\n            \n                for(var i in  data) {\n                    \n                    _this.data['cohead_billto_cntct_id_' + i] =  data[i];\n                }\n                \n                _this.form.findField('billto_address').update();\n                // fill in the select box..\n                _this.form.setValues( {\n                    cohead_billto_cntct_id : data.cntct_id,\n                    cohead_billto_cntct_id_cntct_name : data.cntct_first_name + ' '+ \n                            data.cntct_last_name\n                    \n                });\n                \n                        \n                Roo.log(data);\n            }\n        );\n   \n        Roo.log(\"Click text\");\n        \n        \n     });\n}"
                },
                "fieldLabel" : "or enter Address",
-               "$ update" : "function() {\n\n    var c = ['first_name', 'last_name' ] ;\n    var a = [ 'line1', 'line2', 'line3', 'city', 'state', 'country' ];\n    var v = [];\n    Roo.each(c, function(e) {\n        if (_this.data['cohead_billto_cntct_id_cntct_' +e].length) { \n            v.push(_this.data['cohead_billto_cntct_id_cntct_' +e]);\n        }\n    });\n    Roo.each(a, function(e) {\n        if (_this.data['cohead_billto_cntct_id_cntct_addr_id_addr_' +e].length) {\n            v.push(_this.data['cohead_billto_cntct_id_cntct_addr_id_addr_' +e]);\n        }\n    });\n\n    this.setValue(v.join(\"\\n\"));\n    \n    if(_this.data.cohead_billto_cntct_id_cntct_email.length){\n        _this.form.findField('billto_email').setValue(_this.data.cohead_billto_cntct_id_cntct_email);\n    }\n}\n",
                "xtype" : "TextArea",
+               "$ update" : "function() {\n\n    var c = ['first_name', 'last_name' ] ;\n    var a = [ 'line1', 'line2', 'line3', 'city', 'state', 'country' ];\n    var v = [];\n    Roo.each(c, function(e) {\n        if (_this.data['cohead_billto_cntct_id_cntct_' +e].length) { \n            v.push(_this.data['cohead_billto_cntct_id_cntct_' +e]);\n        }\n    });\n    Roo.each(a, function(e) {\n        if (_this.data['cohead_billto_cntct_id_cntct_addr_id_addr_' +e].length) {\n            v.push(_this.data['cohead_billto_cntct_id_cntct_addr_id_addr_' +e]);\n        }\n    });\n\n    this.setValue(v.join(\"\\n\"));\n    \n    if(_this.data.cohead_billto_cntct_id_cntct_email.length){\n        _this.form.findField('billto_email').setValue(_this.data.cohead_billto_cntct_id_cntct_email);\n    }\n}\n",
                "readOnly" : true,
                "$ xns" : "Roo.form",
                "name" : "billto_address"
          "$ xns" : "Roo.form",
          "items" : [
           {
+           "xtype" : "FieldSet",
            "style" : "width:420px",
            "legend" : "Price Details",
-           "xtype" : "FieldSet",
            "labelWidth" : 50,
            "$ xns" : "Roo.form",
            "items" : [
                    "items" : [
                     {
                      "$ url" : "baseURL + '/Roo/curr_symbol.php'",
-                     "xtype" : "HttpProxy",
                      "method" : "GET",
+                     "xtype" : "HttpProxy",
                      "$ xns" : "Roo.data",
                      "* prop" : "proxy"
                     },
                    "items" : [
                     {
                      "$ url" : "baseURL + '/Roo/taxzone.php'",
-                     "method" : "GET",
                      "xtype" : "HttpProxy",
+                     "method" : "GET",
                      "$ xns" : "Roo.data",
                      "* prop" : "proxy"
                     },
                   "keyup" : "function (_self, e)\n{\n    var pv =  parseFloat(_this.form.findField('cohead_subtotal').getValue());\n    var tax = parseFloat(_this.form.findField('cohead_tax').getValue());\n    var pd = parseFloat(_this.form.findField('cohead_pretax_discount').getValue());\n    \n    var n = this.getValue();\n    var discount = parseFloat(n * (pv + tax + pd) * 0.01);\n    \n    _this.form.findField('cohead_posttax_discount').setValue(discount);\n\n    _this.form.findField('cohead_total').recalc();\n    _this.form.findField('cohead_misc').recalc();\n    var val = discount * -1.0;\n     if (val > 0) {\n        _this.form.findField('cohead_misc_descrip').setValue(\"Discount of \" + val.toFixed(1)+'%');\n    }\n   \n    \n}"
                  },
                  "fieldLabel" : "%",
-                 "$ update" : "function() {\n    var m = _this.form.findField('cohead_misc_per');\n    var pv =  parseFloat(_this.form.findField('cohead_subtotal').getValue());\n    var tax = parseFloat(_this.form.findField('cohead_tax').getValue());\n    var pd = parseFloat(_this.form.findField('cohead_pretax_discount').getValue());\n    \n    var discount = parseFloat(_this.form.findField('cohead_posttax_discount').getValue());\n    \n    if (discount > 0.0) {\n        this.setValue(0);        \n        return;\n    }\n    if (pv < 0) {\n        this.setValue(0);        \n        return;\n    }\n    var val = ((discount) / (pv + tax + pd)) * -100;\n    \n    //Roo.log(\"update discount?\" + val);\n    this.setValue(val.toFixed(1));\n    \n     if (val > 0.0) {\n        _this.form.findField('cohead_misc_descrip').setValue(\"Discount of \" + val.toFixed(1)+'%');\n    \n    }\n    \n   \n}\n",
                  "xtype" : "NumberField",
+                 "$ update" : "function() {\n    var m = _this.form.findField('cohead_misc_per');\n    var pv =  parseFloat(_this.form.findField('cohead_subtotal').getValue());\n    var tax = parseFloat(_this.form.findField('cohead_tax').getValue());\n    var pd = parseFloat(_this.form.findField('cohead_pretax_discount').getValue());\n    \n    var discount = parseFloat(_this.form.findField('cohead_posttax_discount').getValue());\n    \n    if (discount > 0.0) {\n        this.setValue(0);        \n        return;\n    }\n    if (pv < 0) {\n        this.setValue(0);        \n        return;\n    }\n    var val = ((discount) / (pv + tax + pd)) * -100;\n    \n    //Roo.log(\"update discount?\" + val);\n    this.setValue(val.toFixed(1));\n    \n     if (val > 0.0) {\n        _this.form.findField('cohead_misc_descrip').setValue(\"Discount of \" + val.toFixed(1)+'%');\n    \n    }\n    \n   \n}\n",
                  "cls" : "roo-align-right",
                  "allowDecimals" : true,
                  "decimalPrecision" : 1,
            ]
           },
           {
+           "xtype" : "FieldSet",
            "legend" : "Shipping",
            "style" : "width:420px",
-           "xtype" : "FieldSet",
            "$ xns" : "Roo.form",
            "items" : [
             {
                   "check" : "function (_self, checked)\n{\n   if (!_this.form) {\n       return;\n   }\n   \n   if (_this.dataloading) {\n   \n       return;\n   }\n   \n   \n   if (checked) {\n   \n        // copy the cohead_billto_cntct_id\n        for (var i in _this.data) {\n            if (!i.match(/^cohead_billto_cntct_id/)) {\n                continue;\n            }\n            var ni = i.replace(/^cohead_billto_cntct_id/, 'cohead_shipto_cntct_id');\n            _this.data[ni] = _this.data[i];\n        }\n         _this.form.findField('shipto_address').update();\n         _this.form.setValues( {\n                cohead_shipto_cntct_id : _this.data.cohead_shipto_cntct_id,\n                cohead_shipto_cntct_id_cntct_name : _this.data.cohead_shipto_cntct_id_cntct_first_name + ' ' + \n                        _this.data.cohead_shipto_cntct_id_cntct_last_name \n                        \n                \n            });\n\n   \n    } else {\n         for (var i in _this.data) {\n            if (!i.match(/^cohead_billto_cntct_id/)) {\n                continue;\n            }\n            var ni = i.replace(/^cohead_billto_cntct_id/, 'cohead_shipto_cntct_id');\n            \n            _this.data[ni] = '';\n        }\n         _this.form.findField('shipto_address').update();\n         \n        _this.form.setValues( {\n                cohead_shipto_cntct_id : '',\n                cohead_shipto_cntct_id_cntct_name : '' \n                \n                \n            });\n    }\n    \n}"
                  },
                  "xtype" : "Checkbox",
-                 "$ xns" : "Roo.form",
                  "boxLabel" : "Same as Billing",
+                 "$ xns" : "Roo.form",
                  "name" : "_shipto_same"
                 }
                ]
                  "items" : [
                   {
                    "$ url" : "baseURL + '/Roo/cntct.php'",
-                   "xtype" : "HttpProxy",
                    "method" : "GET",
+                   "xtype" : "HttpProxy",
                    "$ xns" : "Roo.data",
                    "* prop" : "proxy"
                   },
                 "render" : "function (_self)\n{\n   Roo.log(this.el)\n   \n   \n   \n   this.el.on('click', function() { \n       var id = _this.form.findField('cohead_shipto_cntct_id').getValue();\n        Pman.Dialog.XtupleQuickContact.show( \n            {\n              _id : id,\n              customer_id : _this.form.findField('cohead_cust_id').getValue()\n            },\n            \n            function (data) {\n            \n                for(var i in  data) {\n                    \n                    _this.data['cohead_shipto_cntct_id_' + i] =  data[i];\n                }\n                \n                _this.form.findField('shipto_address').update();\n                // fill in the select box..\n                _this.form.setValues( {\n                    cohead_shipto_cntct_id : data.cntct_id,\n                    cohead_shipto_cntct_id_cntct_name : data.cntct_first_name + ' '+ \n                            data.cntct_last_name\n                    \n                });\n                \n                        \n                //Roo.log(data);\n            }\n        );\n   \n      //  Roo.log(\"Click text\");\n        \n        \n     });\n}"
                },
                "fieldLabel" : "Address",
-               "$ update" : "function() {\n\n    var c = ['first_name', 'last_name' ] ;\n    var a = [ 'line1', 'line2', 'line3', 'city', 'state', 'country' ];\n    var v = [];\n    \n    if (_this.data['cohead_shipto_vend_name'] && _this.data['cohead_shipto_vend_name'].length) {\n         v.push(_this.data['cohead_shipto_vend_name']);\n    }\n        if (_this.data['cohead_shipto_vendaddr_code'] && _this.data['cohead_shipto_vendaddr_code'].length) {\n         v.push(_this.data['cohead_shipto_vendaddr_code']);\n    }\n    Roo.each(c, function(e) {\n        if (_this.data['cohead_shipto_cntct_id_cntct_' +e] && \n            _this.data['cohead_shipto_cntct_id_cntct_' +e].length) {\n            v.push(_this.data['cohead_shipto_cntct_id_cntct_' +e]);\n        }\n    });\n    Roo.each(a, function(e) {\n        if (_this.data['cohead_shipto_cntct_id_cntct_addr_id_addr_' +e] && \n            _this.data['cohead_shipto_cntct_id_cntct_addr_id_addr_' +e].length) { \n            v.push(_this.data['cohead_shipto_cntct_id_cntct_addr_id_addr_' +e]);\n        }\n    });\n\n    this.setValue(v.join(\"\\n\"));\n}\n",
                "xtype" : "TextArea",
+               "$ update" : "function() {\n\n    var c = ['first_name', 'last_name' ] ;\n    var a = [ 'line1', 'line2', 'line3', 'city', 'state', 'country' ];\n    var v = [];\n    \n    if (_this.data['cohead_shipto_vend_name'] && _this.data['cohead_shipto_vend_name'].length) {\n         v.push(_this.data['cohead_shipto_vend_name']);\n    }\n        if (_this.data['cohead_shipto_vendaddr_code'] && _this.data['cohead_shipto_vendaddr_code'].length) {\n         v.push(_this.data['cohead_shipto_vendaddr_code']);\n    }\n    Roo.each(c, function(e) {\n        if (_this.data['cohead_shipto_cntct_id_cntct_' +e] && \n            _this.data['cohead_shipto_cntct_id_cntct_' +e].length) {\n            v.push(_this.data['cohead_shipto_cntct_id_cntct_' +e]);\n        }\n    });\n    Roo.each(a, function(e) {\n        if (_this.data['cohead_shipto_cntct_id_cntct_addr_id_addr_' +e] && \n            _this.data['cohead_shipto_cntct_id_cntct_addr_id_addr_' +e].length) { \n            v.push(_this.data['cohead_shipto_cntct_id_cntct_addr_id_addr_' +e]);\n        }\n    });\n\n    this.setValue(v.join(\"\\n\"));\n}\n",
                "readOnly" : true,
                "width" : 300,
                "$ xns" : "Roo.form",
       "deactivate" : "function (_self)\n{\n    if(_this.grid){\n        _this.grid.stopEditing();\n    }\n}",
       "|activate" : "function() {\n    _this.panel = this;\n    \n    try { if (MODULE.isBuilder) {\n        return;\n    } } catch(e) { }\n    \n    var id = _this.form.findField('cohead_id').getValue() * 1;\n    if (id < 1) {\n        Roo.MessageBox.alert(\"Save First\", \"Save the order first, before adding items\");\n        _this.dialog.layout.getRegion('center').showPanel(0);\n        return;\n    }\n    \n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    \n         //if (_this.form.findField('cohead_cust_id_cust_name').getValue() == 'Bloom and Grow HK') {\n         //   _this.xferAll.show();\n        // \n        // } else {\n        //     _this.xferAll.hide();\n        // }\n     }\n    \n}"
      },
+     "background" : true,
      "region" : "center",
      "fitToframe" : true,
-     "background" : true,
      "title" : "Order Items",
      "xtype" : "GridPanel",
      "fitContainer" : true,
       {
        "listeners" : {
         "beforeedit" : "function (e)\n{\n    // we can only edit if nothing is assigned to shipping or invoices..\n    \n    var rec = e.record\n\n    if (rec.data.coitem_qtyshipped > 0 || rec.data.cobill_billed > 0 || (rec.data.shipitem_shipped - rec.data.coitem_qtyshipped) > 0 ) {\n        Roo.MessageBox.alert(\"Error\", \"That item has been shipped, has a draft shipment  or invoices - void the shipments/invoices first\");\n        e.cancel = true;\n        return;\n    }\n    \n    if (rec.data.coitem_subnumber * 1 > 0) {\n        Roo.log(\"Edit container event\");\n        Roo.log(e); // if it's a tab.. \n\n        \n        switch(e.field) {\n            // allow editing of source / destination..\n            case 'coitem_shipto_id':\n            case 'coitem_location_src':            \n                return;\n            default : \n                break;\n        }\n        Roo.MessageBox.alert(\"Error\", \"That is a kit item, edit the container.\");\n        e.cancel = true;\n        return;\n    }\n    // zero off values..\n    //if (e.field == 'coitem_qtyord' && rec.data.coitem_qtyord == 0) {\n    //        e.value ='';\n    //    }\n    //    if (e.field == 'coitem_custprice' && rec.data.coitem_qtyord == 0.0) {\n    //        e.value ='';\n    //    }\n    \n    if (rec.data.item_type == 'K' && e.field == 'item_number') {\n        // you can not change the product type on kits' as it messing things up..\n        Roo.MessageBox.alert(\"Error\", \"That is a kit item,if you need to change it, delete it first.\");\n        e.cancel = true;\n        return;\n    }\n    \n}",
-        "celldblclick" : "function (_self, rowIndex, columnIndex, e)\n{\n    var rec = this.ds.getAt(rowIndex);\n    var di = this.cm.getDataIndex(columnIndex);\n    if (di != 'avail_qty') {\n        return;\n    }\n    \n    Pman.Dialog.XtupleInvHistory.show({\n        itemsite_item_id_item_number   : rec.data.item_number,\n       // itemsite_item_id_item_descript1 : rec.data.item_descrip1,\n        location_name : rec.data.coitem_location_src_location_name,\n        location_descrip : rec.data.coitem_location_src_location_descrip,\n        \n        invhist_transdate : _this.form.findField('cohead_targetdate').getValue() \n    }); \n    \n}",
         "|render" : "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    \n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
+        "celldblclick" : "function (_self, rowIndex, columnIndex, e)\n{\n    var rec = this.ds.getAt(rowIndex);\n    var di = this.cm.getDataIndex(columnIndex);\n    if (di != 'avail_qty') {\n        return;\n    }\n    \n    Pman.Dialog.XtupleInvHistory.show({\n        itemsite_item_id_item_number   : rec.data.item_number,\n       // itemsite_item_id_item_descript1 : rec.data.item_descrip1,\n        location_name : rec.data.coitem_location_src_location_name,\n        location_descrip : rec.data.coitem_location_src_location_descrip,\n        \n        invhist_transdate : _this.form.findField('cohead_targetdate').getValue() \n    }); \n    \n}",
         "afteredit" : "function (e)\n{\n    Roo.log('afteredit:' + e.record.data.coitem_linenumber);\n\n    \n   // if ( e.record && e.record.data.coitem_id) {\n        // as we disable update to the display on the ajax callback to \n        // allow editing flow to continue, and not refresh - we can only update\n        // these values after something has actually been edited.\n        // e.record.set('coitem_id', e.record.data.coitem_id);\n        // e.record.set('coitem_status', e.record.data.coitem_status);\n   // }\n    \n    if (e.field == 'item_number' || e.originalValue == e.value) {\n        // afterselect handles this...\n        return;\n    }\n    if (e.field == 'item_descrip1') {\n        e.record.set('coitem_memo', e.value);\n    }\n    var rate = _this.form.findField('taxzone_rate').getValue();\n    switch(e.field) {\n        case 'coitem_linedisc':\n           \n            var cp = parseFloat(e.record.data.coitem_custprice);\n           \n            if (isNaN(cp) || cp == 0.0) {\n                break;\n            }\n            \n            var dis = parseFloat(e.value);\n           \n            if (isNaN(dis)) {\n                break;\n            }\n            \n            e.record.set(\n                'coitem_price',\n                Math.max(0,cp * ((100.0 -  parseInt(e.value))/ 100.0) )  \n            );\n            \n           // donot need to set the subtotal here, coz we will render it automatically\n           // e.record.set(\n           //     'coitem_subtotal',\n           //      e.record.data.coitem_price * 1.0 * e.record.data.coitem_qtyord\n           // );\n            break;\n        \n        case  'coitem_price': // SELL@ price\n\n             var cp = parseFloat(e.record.data.coitem_custprice);\n             // list price is < price -- update it..\n             if (isNaN(cp) || cp == 0.0 || cp < e.value) {\n                e.record.set('coitem_custprice', e.value);\n                cp = e.value;\n             }\n             // update the discount calc.\n             \n             e.record.set('coitem_linedisc', Math.max(0, 100.0 -  (( e.value / cp) * 100.0)));  \n             \n             // donot need to set the subtotal here, coz we will render it automatically\n             //e.record.set(\n             //   'coitem_subtotal',\n              //   e.record.data.coitem_price * 1.0 * e.record.data.coitem_qtyord\n             //);\n             break;\n        \n        case 'coitem_custprice':\n            // modified customer price...\n            // just modify the discount.. -- leave the entered price the same..\n              var sp =  parseFloat(e.record.data.coitem_price);\n              var cp = parseFloat(e.value);\n              if (isNaN(cp) || cp == 0.0 || cp < e.value) {\n                    break;\n              }\n              \n             e.record.set('coitem_linedisc', Math.max(0, 100.0 -  (( sp / cp) * 100.0)));  \n             \n             break;\n             \n        case 'coitem_custprice_tax':\n              var cp = parseFloat(e.value / ( 1 + rate * 1 ));\n              var sp =  parseFloat(e.record.data.coitem_price);\n              \n              if (isNaN(cp) || cp == 0.0) {\n                    break;\n              }\n              e.record.set('coitem_custprice', cp);\n              e.record.set('coitem_linedisc', Math.max(0, 100.0 -  (( sp / cp) * 100.0)));  \n             \n             break; \n             \n         case  'coitem_price_tax':\n\n             var cp = parseFloat(e.record.data.coitem_custprice);\n             var sp = parseFloat(e.value / ( 1 + rate * 1 ));\n             if (isNaN(cp) || cp == 0.0 || cp < sp) {\n                e.record.set('coitem_custprice', sp);\n                cp = sp;\n             }\n             e.record.set('coitem_price', sp);\n             e.record.set('coitem_linedisc', Math.max(0, 100.0 -  (( sp / cp) * 100.0)));  \n             \n             break;\n      \n    }\n    \n     \n    \n    \n    var doupdate = function() { \n       if (!e.record.updatePending) {\n            Roo.log('doupdate...'  + e.record.data.coitem_linenumber);\n            Roo.log(e.record);\n            e.record.commit();\n            return;\n        }\n       Roo.log('doupdate pending...'   + e.record.data.coitem_linenumber);\n        // wait until it's not peding an update..\n        doupdate.defer(500);\n    }\n\n    if(e.record.data.coitem_id * 1 < 1 && !e.record.isInserting){ // insert\n        e.record.isInserting = 1;\n        e.record.isUpdating = 0;\n        doupdate();\n        return;\n    }\n    \n    // update\n    if(!e.record.isInserting && !e.record.isUpdating){\n        e.record.isUpdating = 1;\n        doupdate();\n        return;\n    }\n    \n    if(!e.record.updatePending){\n        e.record.updatePending = 1;\n        doupdate();\n        return;\n    }\n    Roo.log(\"got to end without doing an update?\"  + e.record.data.coitem_linenumber);\n    \n}\n",
         "rowclass" : "function (gridview, rowcfg)\n{\n    if (rowcfg.record.data.coitem_status == 'C' &&\n        rowcfg.record.data.shipitem_shipped * 1 < 1) {\n        \n        rowcfg.rowClass = 'strikethrough';\n    }\n     if (rowcfg.record.data.coitem_status == 'X'  ) {\n        \n        rowcfg.rowClass = 'strikethrough';\n    }\n    \n    if (!rowcfg.record.data.coitem_id) { \n            rowcfg.rowClass = 'dragon-not-saved';\n    }\n    \n    \n   // Roo.log(rowcfg);\n//    shipitem_shipped\n}"
        },
          "items" : [
           {
            "$ url" : "baseURL + '/Roo/coitem.php'",
-           "method" : "GET",
            "xtype" : "HttpProxy",
+           "method" : "GET",
            "$ xns" : "Roo.data",
            "* prop" : "proxy"
           },
             "render" : "function (_self)\n{\n    _this._applyDiscount = _self;\n}"
            },
            "xtype" : "TextField",
-           "width" : 40,
-           "$ xns" : "Roo.form"
+           "$ xns" : "Roo.form",
+           "width" : 40
           },
           {
            "listeners" : {
         },
         {
          "xtype" : "ColumnModel",
-         "width" : 40,
          "header" : "Item#",
+         "width" : 40,
          "$ renderer" : "function(v,x,r) {\n\n    if (r.data.coitem_subnumber * 1 > 0) {\n         return String.format('{0}.{1}', v,r.data.coitem_subnumber);\n     }\n     return String.format('{0}', v);\n  }",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
         },
         {
          "xtype" : "ColumnModel",
-         "width" : 75,
          "header" : "Item Code",
+         "width" : 75,
          "$ renderer" : "function(v) { return String.format('{0}', v); }",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
                "items" : [
                 {
                  "$ url" : "baseURL + '/Roo/itemsite.php'",
-                 "method" : "GET",
                  "xtype" : "HttpProxy",
+                 "method" : "GET",
                  "$ xns" : "Roo.data",
                  "* prop" : "proxy"
                 },
         },
         {
          "xtype" : "ColumnModel",
-         "width" : 75,
          "header" : "From",
+         "width" : 75,
          "$ renderer" : "function(v,x,r) { \n    return String.format('{0}', r.data.coitem_location_src_location_name); \n}",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
                "items" : [
                 {
                  "$ url" : "baseURL + '/Roo/location.php'",
-                 "method" : "GET",
                  "xtype" : "HttpProxy",
+                 "method" : "GET",
                  "$ xns" : "Roo.data",
                  "* prop" : "proxy"
                 },
         },
         {
          "xtype" : "ColumnModel",
-         "width" : 75,
          "header" : "To",
+         "width" : 75,
          "$ renderer" : "function(v,x,r) { \n    return String.format('{0}:{1}', v, r.data.coitem_shipto_id_shipto_name); \n}",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
                "items" : [
                 {
                  "$ url" : "baseURL + '/Roo/shiptoinfo.php'",
-                 "method" : "GET",
                  "xtype" : "HttpProxy",
+                 "method" : "GET",
                  "$ xns" : "Roo.data",
                  "* prop" : "proxy"
                 },
         },
         {
          "xtype" : "ColumnModel",
-         "width" : 150,
          "header" : "Item Description",
+         "width" : 150,
          "$ renderer" : "function(v,x,r) { \n\n    if (r.data.coitem_memo && r.data.coitem_memo.length) {\n        return String.format('{0}', r.data.coitem_memo);\n        if (r.data.coitem_memo != v) {\n            r.set('item_descrip1', r.data.coitem_memo);\n        }\n        \n    }\n    if (v && v.length > 49) {\n        return String.format('<span style=\"color:orange\" qtip=\"line may be too long to print\">{0}</span>', v);\n    }\n    \n    return String.format('{0}', v); \n    \n}",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
               "focus" : "function (_self)\n{\n    if (this.value == 0) {\n        this.el.dom.value = '';\n    }\n}"
              },
              "minValue" : 1,
-             "xtype" : "NumberField",
              "style" : "text-align:right",
+             "xtype" : "NumberField",
              "allowDecimals" : false,
              "decimalPrecision" : 0,
              "$ xns" : "Roo.form",
               "focus" : "function (_self)\n{\n    if (this.value == 0.0) {\n        this.el.dom.value = '';\n    }\n}"
              },
              "minValue" : 0,
-             "xtype" : "NumberField",
              "style" : "text-align:right",
+             "xtype" : "NumberField",
              "decimalPrecision" : 3,
              "$ xns" : "Roo.form",
              "* prop" : "field"
               "focus" : "function (_self)\n{\n    if (this.value == 0.0) {\n        this.el.dom.value = '';\n    }\n}"
              },
              "minValue" : 0,
-             "xtype" : "NumberField",
              "style" : "text-align:right",
+             "xtype" : "NumberField",
              "decimalPrecision" : 3,
              "$ xns" : "Roo.form",
              "* prop" : "field"
               "focus" : "function (_self)\n{\n    if (this.value == 0.0) {\n        this.el.dom.value = '';\n    }\n}"
              },
              "minValue" : 0,
-             "xtype" : "NumberField",
              "style" : "text-align:right",
+             "xtype" : "NumberField",
              "decimalPrecision" : 2,
              "$ xns" : "Roo.form",
              "maxValue" : 100,
               "focus" : "function (_self)\n{\n    if (this.value == 0.0) {\n        this.el.dom.value = '';\n    }\n}"
              },
              "minValue" : 0,
-             "xtype" : "NumberField",
              "style" : "text-align:right",
+             "xtype" : "NumberField",
              "decimalPrecision" : 3,
              "$ xns" : "Roo.form",
              "* prop" : "field"
               "focus" : "function (_self)\n{\n    if (this.value == 0.0) {\n        this.el.dom.value = '';\n    }\n}"
              },
              "minValue" : 0,
-             "xtype" : "NumberField",
              "style" : "text-align:right",
+             "xtype" : "NumberField",
              "decimalPrecision" : 3,
              "$ xns" : "Roo.form",
              "* prop" : "field"
                "items" : [
                 {
                  "$ url" : "baseURL + '/Roo/taxtype.php'",
-                 "method" : "GET",
                  "xtype" : "HttpProxy",
+                 "method" : "GET",
                  "$ xns" : "Roo.data",
                  "* prop" : "proxy"
                 },
       "activate" : "function (_self)\n{\n    _this.shipinvtab = _self;\n}"
      },
      "region" : "center",
-     "title" : "Shipments / Invoices",
      "xtype" : "NestedLayoutPanel",
+     "title" : "Shipments / Invoices",
      "$ xns" : "Roo",
      "items" : [
       {
          "listeners" : {
           "|activate" : "function() {\n    _this.shippanel = this;\n    if (_this.shipgrid) {\n        _this.shipgrid.ds.load({});\n    }\n}"
          },
+         "fitToframe" : true,
          "region" : "north",
          "background" : false,
-         "fitToframe" : true,
          "title" : "shiphead",
          "xtype" : "GridPanel",
          "fitContainer" : true,
              "items" : [
               {
                "$ url" : "baseURL + '/Roo/shiphead.php'",
-               "xtype" : "HttpProxy",
                "method" : "GET",
+               "xtype" : "HttpProxy",
                "$ xns" : "Roo.data",
                "* prop" : "proxy"
               },
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 80,
              "header" : "number",
+             "width" : 80,
              "$ renderer" : "function(v,x,r) {\n    if (r.json.shiphead_shipdate.length) {\n         return String.format('{0}', v); \n     }\n     return String.format('<s>{0}</s>', v); \n }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 100,
              "header" : "From Location",
+             "width" : 100,
              "$ renderer" : "function(v) { return String.format('{0}', v); }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 100,
              "header" : "Ship to",
+             "width" : 100,
              "$ renderer" : "function(v) { return String.format('{0}', v); }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 75,
              "header" : "shipdate",
+             "width" : 75,
              "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 50,
              "header" : "Status",
+             "width" : 50,
              "$ renderer" : "function(v,x,r) { \n\n\n\n  \n    if (r.json.shiphead_shipdate.length) {\n    \n        if (r.json.shiphead_shipped) {\n            return \"Confirmed\";\n        }\n    \n         return '<span style=\"color:red\">Draft</span>';\n    }\n     \n    return 'VOID';\n   \n\n}",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 200,
              "header" : "shipvia",
+             "width" : 200,
              "$ renderer" : "function(v) { return String.format('{0}', v); }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 200,
              "header" : "tracknum",
+             "width" : 200,
              "$ renderer" : "function(v) { return String.format('{0}', v); }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
          "listeners" : {
           "|activate" : "function() {\n    _this.invpanel = this;\n    if (_this.invgrid) {\n        _this.invgrid.ds.load({});\n    }\n}"
          },
+         "background" : false,
          "region" : "center",
          "fitToframe" : true,
-         "background" : false,
          "title" : "Invoices",
          "xtype" : "GridPanel",
          "fitContainer" : true,
              "items" : [
               {
                "$ url" : "baseURL + '/Roo/cobmisc.php'",
-               "method" : "GET",
                "xtype" : "HttpProxy",
+               "method" : "GET",
                "$ xns" : "Roo.data",
                "* prop" : "proxy"
               },
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 100,
              "header" : "Invoice #",
+             "width" : 100,
              "$ renderer" : "function(v,x,r) { \n       if (v && \n             r.data.cobmisc_invchead_id_invchead_id * 1 && \n            !r.data.cobmisc_invchead_id_invchead_posted) {\n           return  '<span style=\"color:red\">' + \n                \"NEEDS Voiding then re-posted: \" + \n                String.format('{0}', v) +\n                '</span>'; \n       }\n\n       if(v && r.data.cobmisc_id == -2){\n            return String.format('<span style=\"margin-left: 10px;\"> - {0} (Credit Memo)</span>', v); \n       }\n       if(v && r.data.cobmisc_id == -3){\n            return String.format('<span style=\"margin-left: 20px;\"> - {0} (Miscellaneous Check)</span>', v); \n       }\n      if(v && r.data.cobmisc_id == -4){\n            return String.format('<span style=\"margin-left: 10px;\"> - {0} (Receive Payment to {2}) [ {1} ]</span>', \n                    v, r.data.cobmisc_cashrcpt_amount, r.json.cashrcpt_bankaccnt_id_bankaccnt_bankname); \n       }\n       \n        return v ? String.format('{0}', v) : \n                '<span style=\"color:red\">' + \"Not Posted\" + '</span>'; \n}",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 75,
              "header" : "invcdate",
+             "width" : 75,
              "$ renderer" : "function(v,x,r) { \n    \n    return String.format('{0}', v && v.format ? v.format('d/M/Y') : ''); \n}",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
      "listeners" : {
       "|activate" : "function() {\n    _this.hpanel = this;\n    if (_this.hgrid) {\n        _this.hgrid.footer.onClick('first');\n    }\n}"
      },
+     "fitToframe" : true,
      "region" : "center",
      "background" : true,
-     "fitToframe" : true,
      "title" : "History",
      "xtype" : "GridPanel",
      "fitContainer" : true,
          "items" : [
           {
            "$ url" : "baseURL + '/Roo/events.php'",
-           "xtype" : "HttpProxy",
            "method" : "GET",
+           "xtype" : "HttpProxy",
            "$ xns" : "Roo.data",
            "* prop" : "proxy"
           },
         },
         {
          "xtype" : "ColumnModel",
-         "width" : 120,
          "header" : "Changed",
+         "width" : 120,
          "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); }",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
         },
         {
          "xtype" : "ColumnModel",
-         "width" : 120,
          "header" : "action",
+         "width" : 120,
          "$ renderer" : "function(v,x,r) { return String.format('{0} - {1}', v, r.data.on_table); }",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
         },
         {
          "xtype" : "ColumnModel",
-         "width" : 120,
          "header" : "IP address",
+         "width" : 120,
          "$ renderer" : "function(v) { return String.format('{0}', v); }",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
         },
         {
          "xtype" : "ColumnModel",
-         "width" : 120,
          "header" : "Who",
+         "width" : 120,
          "$ renderer" : "function(v) { return String.format('{0}', v); }",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
         },
         {
          "xtype" : "ColumnModel",
-         "width" : 200,
          "header" : "Notes",
+         "width" : 200,
          "$ renderer" : "function(v) { return String.format('{0}', v); }",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
     },
     {
      "region" : "center",
-     "title" : "Stock Tx",
      "xtype" : "NestedLayoutPanel",
+     "title" : "Stock Tx",
      "$ xns" : "Roo",
      "items" : [
       {
         },
         {
          "xtype" : "LayoutRegion",
-         "$ xns" : "Roo",
          "width" : 500,
+         "$ xns" : "Roo",
          "split" : true,
          "* prop" : "east"
         },
          "listeners" : {
           "|activate" : "function() {\n    _this.txpanel = this;\n    if (_this.txgrid) {\n        _this.txgrid.footer.onClick('first');\n    }\n}"
          },
+         "background" : false,
          "region" : "center",
          "fitToframe" : true,
-         "background" : false,
          "title" : "invdetail",
          "xtype" : "GridPanel",
          "fitContainer" : true,
              "items" : [
               {
                "$ url" : "baseURL + '/Roo/invdetail.php'",
-               "method" : "GET",
                "xtype" : "HttpProxy",
+               "method" : "GET",
                "$ xns" : "Roo.data",
                "* prop" : "proxy"
               },
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 75,
              "header" : "Item",
+             "width" : 75,
              "$ renderer" : "function(v) { return String.format('{0}', v); }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
          "listeners" : {
           "|activate" : "function() {\n    _this.txdpanel = this;\n    if (_this.txdgrid) {\n        _this.txdgrid.footer.onClick('first');\n    }\n}"
          },
+         "background" : false,
          "region" : "east",
          "fitToframe" : true,
-         "background" : false,
          "title" : "invdetail",
          "xtype" : "GridPanel",
          "fitContainer" : true,
              "items" : [
               {
                "$ url" : "baseURL + '/Roo/invdetail.php'",
-               "method" : "GET",
                "xtype" : "HttpProxy",
+               "method" : "GET",
                "$ xns" : "Roo.data",
                "* prop" : "proxy"
               },
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 60,
              "header" : "TX#",
+             "width" : 60,
              "$ renderer" : "function(v) { return String.format('{0}', v); }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 75,
              "header" : "Date",
+             "width" : 75,
              "$ renderer" : "function(v) { return String.format('{0}', v); }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 75,
              "header" : "Ref#",
+             "width" : 75,
              "$ renderer" : "function(v,x,r) {\n    if (r.data.invfifo_void *1 != 0) {\n        return String.format('<s>{0}</s>', v); \n    }\n\n     return String.format('{0}', v); \n }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 60,
              "header" : "TX#",
+             "width" : 60,
              "$ renderer" : "function(v) { return String.format('{0}', v); }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 75,
              "header" : "Notes",
+             "width" : 75,
              "$ renderer" : "function(v) { return String.format('{0}', v); }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 40,
              "header" : "Posted",
+             "width" : 40,
              "$ renderer" : "function(v,x,r) { \n    \n    var state = v   ?  '-checked' : '';\n                                    \n    return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
     },
     {
      "region" : "center",
-     "title" : "GL Tx",
      "xtype" : "NestedLayoutPanel",
+     "title" : "GL Tx",
      "$ xns" : "Roo",
      "items" : [
       {
         },
         {
          "xtype" : "LayoutRegion",
-         "$ xns" : "Roo",
          "width" : 500,
+         "$ xns" : "Roo",
          "split" : true,
          "* prop" : "east"
         },
          "listeners" : {
           "|activate" : "function() {\n    _this.gltxpanel = this;\n    if (_this.gltxgrid) {\n        _this.gltxgrid.footer.onClick('first');\n    }\n}"
          },
+         "background" : false,
          "region" : "center",
          "fitToframe" : true,
-         "background" : false,
          "title" : "invdetail",
          "xtype" : "GridPanel",
          "fitContainer" : true,
          "items" : [
           {
            "listeners" : {
-            "|render" : "function() \n{\n    _this.gltxgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.gltxpanel.active) {\n       this.footer.onClick('first');\n    }\n}",
-            "cellclick" : "function (_self, rowIndex, columnIndex, e)\n{\n    if (columnIndex > 0) {\n        return;\n    }\n    var rec = this.ds.getAt(rowIndex);\n    rec.set('gltrans_as_summary', rec.data.gltrans_as_summary *1 ? 0 : 1);\n    _this.gltxdgrid.footer.onClick('first');\n}"
+            "cellclick" : "function (_self, rowIndex, columnIndex, e)\n{\n    if (columnIndex > 0) {\n        return;\n    }\n    var rec = this.ds.getAt(rowIndex);\n    rec.set('gltrans_as_summary', rec.data.gltrans_as_summary *1 ? 0 : 1);\n    _this.gltxdgrid.footer.onClick('first');\n}",
+            "|render" : "function() \n{\n    _this.gltxgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.gltxpanel.active) {\n       this.footer.onClick('first');\n    }\n}"
            },
            "autoExpandColumn" : "gltrans_accnt_id_accnt_descrip",
            "xtype" : "Grid",
              "items" : [
               {
                "$ url" : "baseURL + '/Roo/gltrans.php'",
-               "method" : "GET",
                "xtype" : "HttpProxy",
+               "method" : "GET",
                "$ xns" : "Roo.data",
                "* prop" : "proxy"
               },
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 50,
              "header" : "Summary",
+             "width" : 50,
              "$ renderer" : "function(v,x,r) { \n    \n    var state = v*1   ?  '-checked' : '';\n                                    \n    return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 75,
              "header" : "Account",
+             "width" : 75,
              "$ renderer" : "function(v) { return String.format('{0}', v); }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
          "listeners" : {
           "|activate" : "function() {\n    _this.gltxdpanel = this;\n    if (_this.gltxdgrid) {\n        _this.gltxdgrid.footer.onClick('first');\n    }\n}"
          },
+         "background" : false,
          "region" : "east",
          "fitToframe" : true,
-         "background" : false,
          "title" : "invdetail",
          "xtype" : "GridPanel",
          "fitContainer" : true,
          "items" : [
           {
            "listeners" : {
-            "|render" : "function() \n{\n    _this.gltxdgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.gltxdpanel.active) {\n       this.footer.onClick('first');\n    }\n}",
-            "cellclick" : "function (_self, ri, ci, e)\n{\n    \n      var deleteSel = function() {\n    \n        new Pman.Request({\n            mask : \"Reversing\",\n            url : baseURL + '/Roo/gltrans',\n            method : 'POST',\n            params : {  \n                _void : 1,\n                gltrans_id : rec.data.gltrans_id\n                \n            }, \n            success : function() {\n                rec.set('gltrans_posted', false);\n                rec.set('gltrans_deleted', true);\n                rec.set('gltrans_docnumber', rec.data.gltrans_docnumber);\n               _this.gltxgrid.footer.onClick('first');\n            }\n        });\n    \n    }\n    var undeleteSel = function() {\n    \n        new Pman.Request({\n            mask : \"Reversing\",\n            url : baseURL + '/Roo/gltrans',\n            method : 'POST',\n            params : {  \n                _unvoid : 1,\n                gltrans_id : rec.data.gltrans_id\n                \n            }, \n            success : function() {\n                rec.set('gltrans_posted', true);\n                rec.set('gltrans_deleted', false);\n                rec.set('gltrans_docnumber', rec.data.gltrans_docnumber);\n               _this.gltxgrid.footer.onClick('first');\n            }\n        });\n    \n    }\n    \n    var di = this.colModel.config[ci].dataIndex;\n    if (di != 'gltrans_posted') {\n        return;\n    }\n    \n    \n    \n    var rec = this.ds.getAt(ri);\n    if (rec.data.gltrans_deleted) {\n    \n         Roo.MessageBox.confirm(\n            \"Confirm\", \n            \"This should only be used by System Administrators - are you sure you know what you are doing!\",\n            function(x) {\n                if (x != 'yes') {\n                    return;\n                }\n                undeleteSel();\n            }\n        );\n    \n        return false;\n    }\n\n    \n    \n    if (!rec.data.gltrans_posted) {\n\n        \n        \n        new Pman.Request({\n            method : 'POST',\n            url : baseURL + '/Roo/gltrans',\n            mask : \"Posting\",\n            params : {\n                _post : 1,\n                gltrans_id : rec.data.gltrans_id\n            },\n            success : function (res)\n            {\n                rec.set('gltrans_posted', true);\n                _this.gltxgrid.footer.onClick('first');\n            \n            }\n        \n        \n        });\n        return;\n    }\n    \n    // we have a posted transaction.\n    // only allow recalled to be deleted..\n    if (!rec.data.gltrans_notes.match(/(Recall|Ship Order)/)) {\n        return false;\n    }\n    \n    \n \n    \n    \n\n    Roo.MessageBox.confirm(\n        \"Confirm\", \n        \"This should only be used by System Administrators - are you sure you know what you are doing!\",\n        function(x) {\n            if (x != 'yes') {\n                return;\n            }\n            deleteSel();\n        }\n    );\n          \n    \n    \n}"
+            "cellclick" : "function (_self, ri, ci, e)\n{\n    \n      var deleteSel = function() {\n    \n        new Pman.Request({\n            mask : \"Reversing\",\n            url : baseURL + '/Roo/gltrans',\n            method : 'POST',\n            params : {  \n                _void : 1,\n                gltrans_id : rec.data.gltrans_id\n                \n            }, \n            success : function() {\n                rec.set('gltrans_posted', false);\n                rec.set('gltrans_deleted', true);\n                rec.set('gltrans_docnumber', rec.data.gltrans_docnumber);\n               _this.gltxgrid.footer.onClick('first');\n            }\n        });\n    \n    }\n    var undeleteSel = function() {\n    \n        new Pman.Request({\n            mask : \"Reversing\",\n            url : baseURL + '/Roo/gltrans',\n            method : 'POST',\n            params : {  \n                _unvoid : 1,\n                gltrans_id : rec.data.gltrans_id\n                \n            }, \n            success : function() {\n                rec.set('gltrans_posted', true);\n                rec.set('gltrans_deleted', false);\n                rec.set('gltrans_docnumber', rec.data.gltrans_docnumber);\n               _this.gltxgrid.footer.onClick('first');\n            }\n        });\n    \n    }\n    \n    var di = this.colModel.config[ci].dataIndex;\n    if (di != 'gltrans_posted') {\n        return;\n    }\n    \n    \n    \n    var rec = this.ds.getAt(ri);\n    if (rec.data.gltrans_deleted) {\n    \n         Roo.MessageBox.confirm(\n            \"Confirm\", \n            \"This should only be used by System Administrators - are you sure you know what you are doing!\",\n            function(x) {\n                if (x != 'yes') {\n                    return;\n                }\n                undeleteSel();\n            }\n        );\n    \n        return false;\n    }\n\n    \n    \n    if (!rec.data.gltrans_posted) {\n\n        \n        \n        new Pman.Request({\n            method : 'POST',\n            url : baseURL + '/Roo/gltrans',\n            mask : \"Posting\",\n            params : {\n                _post : 1,\n                gltrans_id : rec.data.gltrans_id\n            },\n            success : function (res)\n            {\n                rec.set('gltrans_posted', true);\n                _this.gltxgrid.footer.onClick('first');\n            \n            }\n        \n        \n        });\n        return;\n    }\n    \n    // we have a posted transaction.\n    // only allow recalled to be deleted..\n    if (!rec.data.gltrans_notes.match(/(Recall|Ship Order)/)) {\n        return false;\n    }\n    \n    \n \n    \n    \n\n    Roo.MessageBox.confirm(\n        \"Confirm\", \n        \"This should only be used by System Administrators - are you sure you know what you are doing!\",\n        function(x) {\n            if (x != 'yes') {\n                return;\n            }\n            deleteSel();\n        }\n    );\n          \n    \n    \n}",
+            "|render" : "function() \n{\n    _this.gltxdgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.gltxdpanel.active) {\n       this.footer.onClick('first');\n    }\n}"
            },
            "autoExpandColumn" : "gltrans_notes",
            "xtype" : "Grid",
              "items" : [
               {
                "$ url" : "baseURL + '/Roo/gltrans.php'",
-               "method" : "GET",
                "xtype" : "HttpProxy",
+               "method" : "GET",
                "$ xns" : "Roo.data",
                "* prop" : "proxy"
               },
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 75,
              "header" : "Date",
+             "width" : 75,
              "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 75,
              "header" : "Doc#",
+             "width" : 75,
              "$ renderer" : "function(v,x,r) { \n    if (r.data.gltrans_deleted) {\n       return String.format('<s>{0}</s>', v);     \n    }\n    return String.format('{0}', v); \n}",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 50,
              "header" : "Source",
+             "width" : 50,
              "$ renderer" : "function(v) { return String.format('{0}', v); }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 75,
              "header" : "Notes",
+             "width" : 75,
              "$ renderer" : "function(v) { return String.format('{0}', v); }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
             },
             {
              "xtype" : "ColumnModel",
-             "width" : 50,
              "header" : "Posted",
+             "width" : 50,
              "$ renderer" : "function(v,x,r) { \n    \n    var state = v   ?  '-checked' : '';\n                                    \n    return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n }",
              "$ xns" : "Roo.grid",
              "* prop" : "colModel[]",
      "listeners" : {
       "|activate" : "function() {\n    _this.profitpanel = this;\n    \n    try { if (MODULE.isBuilder) {\n        return;\n    } } catch(e) { }\n    \n    var id = _this.form.findField('cohead_id').getValue() * 1;\n    if (id < 1) {\n        Roo.MessageBox.alert(\"Save First\", \"Save the order first, before adding items\");\n        _this.dialog.layout.getRegion('center').showPanel(0);\n        return;\n    }\n    \n    if (_this.profitgrid) {\n        _this.profitgrid.footer.onClick('first');\n     }\n    \n}"
      },
+     "background" : true,
      "region" : "center",
      "fitToframe" : true,
-     "background" : true,
      "title" : "Profit",
      "xtype" : "GridPanel",
      "fitContainer" : true,
          "items" : [
           {
            "$ url" : "baseURL + '/Roo/coitem.php'",
-           "method" : "GET",
            "xtype" : "HttpProxy",
+           "method" : "GET",
            "$ xns" : "Roo.data",
            "* prop" : "proxy"
           },
         },
         {
          "xtype" : "ColumnModel",
-         "width" : 75,
          "header" : "Item Code",
+         "width" : 75,
          "$ renderer" : "function(v) { return String.format('{0}', v); }",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
         },
         {
          "xtype" : "ColumnModel",
-         "width" : 200,
          "header" : "SubTotal",
+         "width" : 200,
          "$ renderer" : "function(v) {\n\n\n     return Roo.util.Format.number( v, 2);\n  }",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
         },
         {
          "xtype" : "ColumnModel",
-         "width" : 200,
          "header" : "Cost of goods",
+         "width" : 200,
          "$ renderer" : "function(v) {\n\n    return Roo.util.Format.number( v, 2);\n  }",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
         },
         {
          "xtype" : "ColumnModel",
-         "width" : 200,
          "header" : "Profit",
+         "width" : 200,
          "$ renderer" : "function(v,x,r) {\n        \n   var profit = r.data.calc_subtotal - r.data.calc_cost_total;\n   \n   if(parseInt(profit) < 1){\n       return String.format('<b style=\"color:red;\">{0}</b>', Roo.util.Format.number(profit,2));      \n   }\n        \n        \n    return Roo.util.Format.number( profit, 2);\n}",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
index 3edc969..bdac823 100644 (file)
@@ -178,14 +178,14 @@ Pman.Dialog.XtupleSalesOrder = {
   '1d144309cbdf2536723621bf0eac9f33' :"or enter Address",
   '3d96cc39e5517a284e203ffc8cafcf51' :"Print Bambini Pronto Invoice",
   '9c9745a343efeacc9efe9b7222b27afb' :"Ref#",
-  'c43b0fbe81e21c0a874a155ce528eebf' :"Apply % Discount of : ",
+  '900eb3dcf3a7d639acbd2528ca5bbd52' :"Apply % Discount of : ",
   'e8586011952b0d098b0e568f20ca2b1f' :"Select Currency",
   'fa1cfdb383ea976facbdb20d40d2f811' :"Duplicate Selected",
   '6ac26fe4e9a39ac45fffe6d6920dac3a' :"Print Chinese Invoice",
   '182875b6c36a761f1e459624c1d93638' :"Profit",
   '3ffaf70863d6f46e2719050a37d9ef86' :"Order#",
   '8fb8fbc1c0bc53b2d01121344410e444' :"Split sales",
-  '09466661df2abefeecf849e52fce8fb4' :"Total "
+  '96b0141273eabab320119c467cdcaf17' :"Total "
  },
 
  dialog : false,
@@ -212,6 +212,7 @@ Pman.Dialog.XtupleSalesOrder = {
  {
    var _this = this;
    this.dialog = Roo.factory({
+    xtype : 'LayoutDialog',
     closable : true,
     collapsible : false,
     height : 620,
@@ -219,37 +220,34 @@ Pman.Dialog.XtupleSalesOrder = {
     resizable : true,
     title : _this._strings['57cdc7bcd2ca327f3267e2f5ecfa8c6d'] /* Edit / Create Sales Order */,
     width : 1050,
-    xns : Roo,
-    '|xns' : 'Roo',
-    xtype : 'LayoutDialog',
     listeners : {
      show : function () {
              this.layout.getRegion('center').showPanel(0);
       }
     },
+    xns : Roo,
+    '|xns' : 'Roo',
     center : {
+     xtype : 'LayoutRegion',
      alwaysShowTabs : true,
      tabPosition : 'top',
      xns : Roo,
      '|xns' : 'Roo',
-     xtype : 'LayoutRegion',
      toolbar : {
+      xtype : 'Toolbar',
       xns : Roo,
       '|xns' : 'Roo',
-      xtype : 'Toolbar',
       items  : [
        {
+        xtype : 'Fill',
         xns : Roo.Toolbar,
-        '|xns' : 'Roo.Toolbar',
-        xtype : 'Fill'
+        '|xns' : 'Roo.Toolbar'
        },
        {
+        xtype : 'Button',
         cls : 'x-btn-text-icon',
         icon : rootURL + '/Pman/templates/images/spreadsheet.gif',
         text : _this._strings['160ab8f9d6c5d2819fff11dea08d4ef8'] /* Download Excel */,
-        xns : Roo.Toolbar,
-        '|xns' : 'Roo.Toolbar',
-        xtype : 'Button',
         listeners : {
          click : function ()
           {
@@ -276,15 +274,15 @@ Pman.Dialog.XtupleSalesOrder = {
                       
              
           }
-        }
+        },
+        xns : Roo.Toolbar,
+        '|xns' : 'Roo.Toolbar'
        },
        {
+        xtype : 'Button',
         cls : 'x-btn-text-icon',
         icon : rootURL + '/Pman/templates/images/pdf.gif',
         text : _this._strings['13dba24862cf9128167a59100e154c8d'] /* Print */,
-        xns : Roo.Toolbar,
-        '|xns' : 'Roo.Toolbar',
-        xtype : 'Button',
         listeners : {
          click : function ()
           {
@@ -311,16 +309,16 @@ Pman.Dialog.XtupleSalesOrder = {
                       
              
           }
-        }
+        },
+        xns : Roo.Toolbar,
+        '|xns' : 'Roo.Toolbar'
        },
        {
+        xtype : 'Button',
         cls : 'x-btn-text-icon',
         hidden : true,
         icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
         text : _this._strings['80092f7900d59aab765d0ddd35dc7231'] /* Add Shipment */,
-        xns : Roo.Toolbar,
-        '|xns' : 'Roo.Toolbar',
-        xtype : 'Button',
         listeners : {
          click : function (_self, e)
           {
@@ -328,15 +326,15 @@ Pman.Dialog.XtupleSalesOrder = {
               _this.addShipmentBtn.fireEvent('click');
              
           }
-        }
+        },
+        xns : Roo.Toolbar,
+        '|xns' : 'Roo.Toolbar'
        },
        {
+        xtype : 'Button',
         cls : 'x-btn-text-icon',
         icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
         text : _this._strings['e5d63551ca2d2842661e49a25fd12a67'] /* Edit Customer */,
-        xns : Roo.Toolbar,
-        '|xns' : 'Roo.Toolbar',
-        xtype : 'Button',
         listeners : {
          click : function (_self, e)
           {
@@ -345,16 +343,16 @@ Pman.Dialog.XtupleSalesOrder = {
                    cust_id : _this.form.findField('cohead_cust_id').getValue()
             }); 
           }
-        }
+        },
+        xns : Roo.Toolbar,
+        '|xns' : 'Roo.Toolbar'
        },
        {
+        xtype : 'Button',
         cls : 'x-btn-text-icon',
         hidden : true,
         icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
         text : _this._strings['bdd31bfe5374e3cdc19a10020eae4b49'] /* Add Invoice */,
-        xns : Roo.Toolbar,
-        '|xns' : 'Roo.Toolbar',
-        xtype : 'Button',
         listeners : {
          click : function (_self, e)
           {
@@ -362,13 +360,13 @@ Pman.Dialog.XtupleSalesOrder = {
                   _this.addInvoiceBtn.fireEvent('click');
              
           }
-        }
+        },
+        xns : Roo.Toolbar,
+        '|xns' : 'Roo.Toolbar'
        },
        {
-        text : _this._strings['81ceb48a978444906d80119200aa358d'] /* Void */,
-        xns : Roo.Toolbar,
-        '|xns' : 'Roo.Toolbar',
         xtype : 'Button',
+        text : _this._strings['81ceb48a978444906d80119200aa358d'] /* Void */,
         listeners : {
          click : function (_self, e)
           {
@@ -421,13 +419,13 @@ Pman.Dialog.XtupleSalesOrder = {
           {
               _this.voidBtn = _self;
           }
-        }
+        },
+        xns : Roo.Toolbar,
+        '|xns' : 'Roo.Toolbar'
        },
        {
-        text : _this._strings['07ca5050e697392c9ed47e6453f1453f'] /* Completed */,
-        xns : Roo.Toolbar,
-        '|xns' : 'Roo.Toolbar',
         xtype : 'Button',
+        text : _this._strings['07ca5050e697392c9ed47e6453f1453f'] /* Completed */,
         listeners : {
          click : function (_self, e)
           {
@@ -464,17 +462,17 @@ Pman.Dialog.XtupleSalesOrder = {
           {
              _this.closeBtn = _self;
           }
-        }
+        },
+        xns : Roo.Toolbar,
+        '|xns' : 'Roo.Toolbar'
        }
       ]
      }
     },
     buttons : [
      {
-      text : _this._strings['511b6a78f5503881ba10ff93b7205ade'] /* Create CM reversal */,
-      xns : Roo,
-      '|xns' : 'Roo',
       xtype : 'Button',
+      text : _this._strings['511b6a78f5503881ba10ff93b7205ade'] /* Create CM reversal */,
       listeners : {
        click : function (_self, e)
         {
@@ -509,26 +507,26 @@ Pman.Dialog.XtupleSalesOrder = {
         {
             _this.reversalBtn = _self;
         }
-      }
+      },
+      xns : Roo,
+      '|xns' : 'Roo'
      },
      {
-      text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
-      xns : Roo,
-      '|xns' : 'Roo',
       xtype : 'Button',
+      text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
       listeners : {
        click : function (_self, e)
         {
               if (_this.grid)  _this.grid.stopEditing();
             _this.dialog.hide();
         }
-      }
+      },
+      xns : Roo,
+      '|xns' : 'Roo'
      },
      {
-      text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
-      xns : Roo,
-      '|xns' : 'Roo',
       xtype : 'Button',
+      text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
       listeners : {
        click : function (_self, e)
         {
@@ -543,16 +541,16 @@ Pman.Dialog.XtupleSalesOrder = {
         {
             _this.saveBtn = _self;
         }
-      }
+      },
+      xns : Roo,
+      '|xns' : 'Roo'
      }
     ],
     items  : [
      {
+      xtype : 'ContentPanel',
       region : 'center',
       title : _this._strings['c5c8ac6bbc6d7f5c95d0a888527554d3'] /* Order Details */,
-      xns : Roo,
-      '|xns' : 'Roo',
-      xtype : 'ContentPanel',
       listeners : {
        activate : function (_self)
         {
@@ -578,14 +576,14 @@ Pman.Dialog.XtupleSalesOrder = {
             });
         }
       },
+      xns : Roo,
+      '|xns' : 'Roo',
       items  : [
        {
+        xtype : 'Form',
         method : 'POST',
         style : 'margin:10px;',
         url : baseURL + '/Roo/cohead.php',
-        xns : Roo.form,
-        '|xns' : 'Roo.form',
-        xtype : 'Form',
         listeners : {
          actioncomplete : function(_self,action)
           {
@@ -734,36 +732,39 @@ Pman.Dialog.XtupleSalesOrder = {
               _this.form= form;
           }
         },
+        xns : Roo.form,
+        '|xns' : 'Roo.form',
         items  : [
          {
+          xtype : 'Column',
           width : 435,
           xns : Roo.form,
           '|xns' : 'Roo.form',
-          xtype : 'Column',
           items  : [
            {
+            xtype : 'FieldSet',
             labelWidth : 120,
             legend : _this._strings['a240fa27925a635b08dc28c9e4f9216d'] /* Order */,
             style : 'width:420px',
             xns : Roo.form,
             '|xns' : 'Roo.form',
-            xtype : 'FieldSet',
             items  : [
              {
+              xtype : 'Column',
               labelWidth : 100,
               width : 410,
               xns : Roo.form,
               '|xns' : 'Roo.form',
-              xtype : 'Column',
               items  : [
                {
+                xtype : 'Row',
                 labelWidth : 100,
                 width : 400,
                 xns : Roo.form,
                 '|xns' : 'Roo.form',
-                xtype : 'Row',
                 items  : [
                  {
+                  xtype : 'TextField',
                   allowBlank : true,
                   emptyText : _this._strings['086247a9b57fde6eefee2a0c4752242d'] /* Automatic */,
                   fieldLabel : _this._strings['3ffaf70863d6f46e2719050a37d9ef86'] /* Order# */,
@@ -771,32 +772,32 @@ Pman.Dialog.XtupleSalesOrder = {
                   readOnly : true,
                   width : 120,
                   xns : Roo.form,
-                  '|xns' : 'Roo.form',
-                  xtype : 'TextField'
+                  '|xns' : 'Roo.form'
                  },
                  {
+                  xtype : 'Row',
                   labelWidth : 50,
                   style : 'float:left',
                   width : 150,
                   xns : Roo.form,
                   '|xns' : 'Roo.form',
-                  xtype : 'Row',
                   items  : [
                    {
+                    xtype : 'TextField',
                     allowBlank : true,
                     fieldLabel : _this._strings['6a813cbab5d0c9d33b1a471839935d88'] /* Cust# */,
                     name : 'cohead_cust_id_cust_number',
                     readOnly : true,
                     width : 110,
                     xns : Roo.form,
-                    '|xns' : 'Roo.form',
-                    xtype : 'TextField'
+                    '|xns' : 'Roo.form'
                    }
                   ]
                  }
                 ]
                },
                {
+                xtype : 'TextField',
                 editable : false,
                 fieldLabel : _this._strings['ce26601dac0dea138b7295f02b7620a7'] /* Customer */,
                 forceSelection : true,
@@ -816,57 +817,54 @@ Pman.Dialog.XtupleSalesOrder = {
                 valueField : 'cust_id',
                 width : 300,
                 xns : Roo.form,
-                '|xns' : 'Roo.form',
-                xtype : 'TextField'
+                '|xns' : 'Roo.form'
                },
                {
+                xtype : 'TextField',
                 fieldLabel : _this._strings['986b90fb419e5349dd59b691b0e0e9f6'] /* Customer PO# */,
                 name : 'cohead_custponumber',
                 width : 150,
                 xns : Roo.form,
-                '|xns' : 'Roo.form',
-                xtype : 'TextField'
+                '|xns' : 'Roo.form'
                },
                {
+                xtype : 'DateField',
                 allowBlank : false,
                 fieldLabel : _this._strings['26e09a1ee1517389c7b07f42df65561a'] /* Ordered */,
                 format : 'Y-m-d',
                 name : 'cohead_orderdate',
                 width : 100,
                 xns : Roo.form,
-                '|xns' : 'Roo.form',
-                xtype : 'DateField'
+                '|xns' : 'Roo.form'
                },
                {
+                xtype : 'Row',
                 labelWidth : 100,
                 width : 500,
                 xns : Roo.form,
                 '|xns' : 'Roo.form',
-                xtype : 'Row',
                 items  : [
                  {
+                  xtype : 'DateField',
                   allowBlank : false,
                   fieldLabel : _this._strings['a2fdeac60e3c5b6c51a92e027fb9d533'] /* Target Delivery */,
                   format : 'Y-m-d',
                   name : 'cohead_targetdate',
                   width : 100,
                   xns : Roo.form,
-                  '|xns' : 'Roo.form',
-                  xtype : 'DateField'
+                  '|xns' : 'Roo.form'
                  },
                  {
+                  xtype : 'Row',
                   hideLabels : true,
                   xns : Roo.form,
                   '|xns' : 'Roo.form',
-                  xtype : 'Row',
                   items  : [
                    {
+                    xtype : 'Checkbox',
                     boxLabel : 'same as order',
                     inputValue : 1,
                     name : '_same_as_order',
-                    xns : Roo.form,
-                    '|xns' : 'Roo.form',
-                    xtype : 'Checkbox',
                     listeners : {
                      check : function (_self, checked)
                       {
@@ -874,13 +872,16 @@ Pman.Dialog.XtupleSalesOrder = {
                               _this.form.findField('cohead_targetdate').setValue(_this.form.findField('cohead_orderdate').getValue());
                           }
                       }
-                    }
+                    },
+                    xns : Roo.form,
+                    '|xns' : 'Roo.form'
                    }
                   ]
                  }
                 ]
                },
                {
+                xtype : 'ComboBox',
                 allowBlank : false,
                 displayField : 'location_name',
                 editable : true,
@@ -903,13 +904,10 @@ Pman.Dialog.XtupleSalesOrder = {
                 width : 300,
                 xns : Roo.form,
                 '|xns' : 'Roo.form',
-                xtype : 'ComboBox',
                 store : {
+                 xtype : 'Store',
                  remoteSort : true,
                  sortInfo : { direction : 'ASC', field: 'location_name' },
-                 xns : Roo.data,
-                 '|xns' : 'Roo.data',
-                 xtype : 'Store',
                  listeners : {
                   beforeload : function (_self, o){
                        o.params = o.params || {};
@@ -919,21 +917,23 @@ Pman.Dialog.XtupleSalesOrder = {
                          o.params._notinternalcompany = 1;
                    }
                  },
+                 xns : Roo.data,
+                 '|xns' : 'Roo.data',
                  proxy : {
+                  xtype : 'HttpProxy',
                   method : 'GET',
                   url : baseURL + '/Roo/location.php',
                   xns : Roo.data,
-                  '|xns' : 'Roo.data',
-                  xtype : 'HttpProxy'
+                  '|xns' : 'Roo.data'
                  },
                  reader : {
+                  xtype : 'JsonReader',
                   fields : [{"name":"location_id","type":"int"},"location_name"],
                   id : 'location_id',
                   root : 'data',
                   totalProperty : 'total',
                   xns : Roo.data,
-                  '|xns' : 'Roo.data',
-                  xtype : 'JsonReader'
+                  '|xns' : 'Roo.data'
                  }
                 }
                }
@@ -942,21 +942,22 @@ Pman.Dialog.XtupleSalesOrder = {
             ]
            },
            {
+            xtype : 'FieldSet',
             labelWidth : 100,
             legend : _this._strings['3ec365dd533ddb7ef3d1c111186ce872'] /* Details */,
             style : 'width:420px',
             xns : Roo.form,
             '|xns' : 'Roo.form',
-            xtype : 'FieldSet',
             items  : [
              {
+              xtype : 'Column',
               labelWidth : 100,
               width : 420,
               xns : Roo.form,
               '|xns' : 'Roo.form',
-              xtype : 'Column',
               items  : [
                {
+                xtype : 'ComboBox',
                 allowBlank : false,
                 displayField : 'terms_descrip',
                 editable : false,
@@ -979,38 +980,38 @@ Pman.Dialog.XtupleSalesOrder = {
                 width : 300,
                 xns : Roo.form,
                 '|xns' : 'Roo.form',
-                xtype : 'ComboBox',
                 store : {
+                 xtype : 'Store',
                  remoteSort : true,
                  sortInfo : { direction : 'ASC', field: 'terms_descrip' },
-                 xns : Roo.data,
-                 '|xns' : 'Roo.data',
-                 xtype : 'Store',
                  listeners : {
                   beforeload : function (_self, o){
                        o.params = o.params || {};
                        // set more here
                    }
                  },
+                 xns : Roo.data,
+                 '|xns' : 'Roo.data',
                  proxy : {
+                  xtype : 'HttpProxy',
                   method : 'GET',
                   url : baseURL + '/Roo/terms.php',
                   xns : Roo.data,
-                  '|xns' : 'Roo.data',
-                  xtype : 'HttpProxy'
+                  '|xns' : 'Roo.data'
                  },
                  reader : {
+                  xtype : 'JsonReader',
                   fields : [{"name":"terms_id","type":"int"},"terms_descrip"],
                   id : 'terms_id',
                   root : 'data',
                   totalProperty : 'total',
                   xns : Roo.data,
-                  '|xns' : 'Roo.data',
-                  xtype : 'JsonReader'
+                  '|xns' : 'Roo.data'
                  }
                 }
                },
                {
+                xtype : 'ComboBox',
                 allowBlank : true,
                 alwaysQuery : true,
                 displayField : 'salesrep_name',
@@ -1034,38 +1035,38 @@ Pman.Dialog.XtupleSalesOrder = {
                 width : 300,
                 xns : Roo.form,
                 '|xns' : 'Roo.form',
-                xtype : 'ComboBox',
                 store : {
+                 xtype : 'Store',
                  remoteSort : true,
                  sortInfo : { direction : 'ASC', field: 'salesrep_name' },
-                 xns : Roo.data,
-                 '|xns' : 'Roo.data',
-                 xtype : 'Store',
                  listeners : {
                   beforeload : function (_self, o){
                        o.params = o.params || {};
                        // set more here
                    }
                  },
+                 xns : Roo.data,
+                 '|xns' : 'Roo.data',
                  proxy : {
+                  xtype : 'HttpProxy',
                   method : 'GET',
                   url : baseURL + '/Roo/salesrep.php',
                   xns : Roo.data,
-                  '|xns' : 'Roo.data',
-                  xtype : 'HttpProxy'
+                  '|xns' : 'Roo.data'
                  },
                  reader : {
+                  xtype : 'JsonReader',
                   fields : [{"name":"salesrep_id","type":"int"},"salesrep_name"],
                   id : 'salesrep_id',
                   root : 'data',
                   totalProperty : 'total',
                   xns : Roo.data,
-                  '|xns' : 'Roo.data',
-                  xtype : 'JsonReader'
+                  '|xns' : 'Roo.data'
                  }
                 }
                },
                {
+                xtype : 'ComboBox',
                 allowBlank : false,
                 alwaysQuery : true,
                 displayField : 'salesrep_name',
@@ -1089,65 +1090,65 @@ Pman.Dialog.XtupleSalesOrder = {
                 width : 300,
                 xns : Roo.form,
                 '|xns' : 'Roo.form',
-                xtype : 'ComboBox',
                 store : {
+                 xtype : 'Store',
                  remoteSort : true,
                  sortInfo : { direction : 'ASC', field: 'salesrep_name' },
-                 xns : Roo.data,
-                 '|xns' : 'Roo.data',
-                 xtype : 'Store',
                  listeners : {
                   beforeload : function (_self, o){
                        o.params = o.params || {};
                        // set more here
                    }
                  },
+                 xns : Roo.data,
+                 '|xns' : 'Roo.data',
                  proxy : {
+                  xtype : 'HttpProxy',
                   method : 'GET',
                   url : baseURL + '/Roo/salesrep.php',
                   xns : Roo.data,
-                  '|xns' : 'Roo.data',
-                  xtype : 'HttpProxy'
+                  '|xns' : 'Roo.data'
                  },
                  reader : {
+                  xtype : 'JsonReader',
                   fields : [{"name":"salesrep_id","type":"int"},"salesrep_name"],
                   id : 'salesrep_id',
                   root : 'data',
                   totalProperty : 'total',
                   xns : Roo.data,
-                  '|xns' : 'Roo.data',
-                  xtype : 'JsonReader'
+                  '|xns' : 'Roo.data'
                  }
                 }
                },
                {
+                xtype : 'TextArea',
                 fieldLabel : _this._strings['f4ac45b9eb622dcb26c0d4fc1c93b27c'] /* Order Comments */,
                 height : 80,
                 name : 'cohead_ordercomments',
                 width : 300,
                 xns : Roo.form,
-                '|xns' : 'Roo.form',
-                xtype : 'TextArea'
+                '|xns' : 'Roo.form'
                }
               ]
              }
             ]
            },
            {
+            xtype : 'FieldSet',
             legend : _this._strings['780c462e85ba4399a5d42e88f69a15ca'] /* Billing */,
             style : 'width:420px',
             xns : Roo.form,
             '|xns' : 'Roo.form',
-            xtype : 'FieldSet',
             items  : [
              {
+              xtype : 'Column',
               labelWidth : 50,
               width : 420,
               xns : Roo.form,
               '|xns' : 'Roo.form',
-              xtype : 'Column',
               items  : [
                {
+                xtype : 'ComboBox',
                 allowBlank : false,
                 alwaysQuery : true,
                 displayField : 'cntct_name',
@@ -1169,9 +1170,6 @@ Pman.Dialog.XtupleSalesOrder = {
                 typeAhead : true,
                 valueField : 'cntct_id',
                 width : 300,
-                xns : Roo.form,
-                '|xns' : 'Roo.form',
-                xtype : 'ComboBox',
                 listeners : {
                  add : function (combo)
                   {
@@ -1221,12 +1219,12 @@ Pman.Dialog.XtupleSalesOrder = {
                    
                   }
                 },
+                xns : Roo.form,
+                '|xns' : 'Roo.form',
                 store : {
+                 xtype : 'Store',
                  remoteSort : true,
                  sortInfo : { direction : 'ASC', field: 'cntct_name' },
-                 xns : Roo.data,
-                 '|xns' : 'Roo.data',
-                 xtype : 'Store',
                  listeners : {
                   beforeload : function (_self, o){
                        o.params = o.params || {};
@@ -1234,25 +1232,28 @@ Pman.Dialog.XtupleSalesOrder = {
                        o.params._customer_id = _this.data.cohead_cust_id;
                    }
                  },
+                 xns : Roo.data,
+                 '|xns' : 'Roo.data',
                  proxy : {
+                  xtype : 'HttpProxy',
                   method : 'GET',
                   url : baseURL + '/Roo/cntct.php',
                   xns : Roo.data,
-                  '|xns' : 'Roo.data',
-                  xtype : 'HttpProxy'
+                  '|xns' : 'Roo.data'
                  },
                  reader : {
+                  xtype : 'JsonReader',
                   fields : [{"name":"cntct_id","type":"int"},"cntct_name"],
                   id : 'cntct_id',
                   root : 'data',
                   totalProperty : 'total',
                   xns : Roo.data,
-                  '|xns' : 'Roo.data',
-                  xtype : 'JsonReader'
+                  '|xns' : 'Roo.data'
                  }
                 }
                },
                {
+                xtype : 'TextArea',
                 fieldLabel : _this._strings['1d144309cbdf2536723621bf0eac9f33'] /* or enter Address */,
                 name : 'billto_address',
                 readOnly : true,
@@ -1278,9 +1279,6 @@ Pman.Dialog.XtupleSalesOrder = {
                         _this.form.findField('billto_email').setValue(_this.data.cohead_billto_cntct_id_cntct_email);
                     }
                 },
-                xns : Roo.form,
-                '|xns' : 'Roo.form',
-                xtype : 'TextArea',
                 listeners : {
                  render : function (_self)
                   {
@@ -1322,9 +1320,12 @@ Pman.Dialog.XtupleSalesOrder = {
                           
                        });
                   }
-                }
+                },
+                xns : Roo.form,
+                '|xns' : 'Roo.form'
                },
                {
+                xtype : 'DisplayField',
                 fieldLabel : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
                 name : 'billto_email',
                 valueRenderer : function(v)
@@ -1333,8 +1334,7 @@ Pman.Dialog.XtupleSalesOrder = {
                     return v ? String.format('<a href="mailto:{0}" target="_blank">{0}</a>',v) : '';
                 },
                 xns : Roo.form,
-                '|xns' : 'Roo.form',
-                xtype : 'DisplayField'
+                '|xns' : 'Roo.form'
                }
               ]
              }
@@ -1343,37 +1343,38 @@ Pman.Dialog.XtupleSalesOrder = {
           ]
          },
          {
+          xtype : 'Column',
           style : 'margin-left:10px',
           width : 435,
           xns : Roo.form,
           '|xns' : 'Roo.form',
-          xtype : 'Column',
           items  : [
            {
+            xtype : 'FieldSet',
             labelWidth : 50,
             legend : _this._strings['9f1a342d0197aac60ed73e921dc4c1f5'] /* Price Details */,
             style : 'width:420px',
             xns : Roo.form,
             '|xns' : 'Roo.form',
-            xtype : 'FieldSet',
             items  : [
              {
+              xtype : 'Column',
               labelAlign : 'right',
               labelWidth : 300,
               width : 420,
               xns : Roo.form,
               '|xns' : 'Roo.form',
-              xtype : 'Column',
               items  : [
                {
+                xtype : 'Row',
                 labelAlign : 'top',
                 labelSeparator : '&nbsp;',
                 width : 500,
                 xns : Roo.form,
                 '|xns' : 'Roo.form',
-                xtype : 'Row',
                 items  : [
                  {
+                  xtype : 'ComboBox',
                   allowBlank : false,
                   displayField : 'curr_name',
                   editable : false,
@@ -1394,9 +1395,6 @@ Pman.Dialog.XtupleSalesOrder = {
                   typeAhead : true,
                   valueField : 'curr_id',
                   width : 285,
-                  xns : Roo.form,
-                  '|xns' : 'Roo.form',
-                  xtype : 'ComboBox',
                   listeners : {
                    beforequery : function (combo, query, forceAll, cancel, e)
                     {
@@ -1411,12 +1409,12 @@ Pman.Dialog.XtupleSalesOrder = {
                         }
                     }
                   },
+                  xns : Roo.form,
+                  '|xns' : 'Roo.form',
                   store : {
+                   xtype : 'Store',
                    remoteSort : true,
                    sortInfo : { direction : 'ASC', field: 'curr_symbol' },
-                   xns : Roo.data,
-                   '|xns' : 'Roo.data',
-                   xtype : 'Store',
                    listeners : {
                     beforeload : function (_self, o){
                          o.params = o.params || {};
@@ -1424,25 +1422,28 @@ Pman.Dialog.XtupleSalesOrder = {
                         
                      }
                    },
+                   xns : Roo.data,
+                   '|xns' : 'Roo.data',
                    proxy : {
+                    xtype : 'HttpProxy',
                     method : 'GET',
                     url : baseURL + '/Roo/curr_symbol.php',
                     xns : Roo.data,
-                    '|xns' : 'Roo.data',
-                    xtype : 'HttpProxy'
+                    '|xns' : 'Roo.data'
                    },
                    reader : {
+                    xtype : 'JsonReader',
                     fields : [{"name":"curr_id","type":"int"},"curr_symbol"],
                     id : 'curr_id',
                     root : 'data',
                     totalProperty : 'total',
                     xns : Roo.data,
-                    '|xns' : 'Roo.data',
-                    xtype : 'JsonReader'
+                    '|xns' : 'Roo.data'
                    }
                   }
                  },
                  {
+                  xtype : 'NumberField',
                   allowDecimals : true,
                   cls : 'roo-align-right',
                   decimalPrecision : 3,
@@ -1451,20 +1452,20 @@ Pman.Dialog.XtupleSalesOrder = {
                   readOnly : true,
                   width : 100,
                   xns : Roo.form,
-                  '|xns' : 'Roo.form',
-                  xtype : 'NumberField'
+                  '|xns' : 'Roo.form'
                  }
                 ]
                },
                {
+                xtype : 'Row',
                 labelAlign : 'top',
                 labelSeparator : '&nbsp;',
                 width : 500,
                 xns : Roo.form,
                 '|xns' : 'Roo.form',
-                xtype : 'Row',
                 items  : [
                  {
+                  xtype : 'ComboBox',
                   allowBlank : false,
                   displayField : 'taxzone_descrip',
                   editable : false,
@@ -1485,9 +1486,6 @@ Pman.Dialog.XtupleSalesOrder = {
                   typeAhead : true,
                   valueField : 'taxzone_id',
                   width : 285,
-                  xns : Roo.form,
-                  '|xns' : 'Roo.form',
-                  xtype : 'ComboBox',
                   listeners : {
                    select : function (combo, record, index)
                     {
@@ -1498,12 +1496,12 @@ Pman.Dialog.XtupleSalesOrder = {
                           _this.form.findField('cohead_total').recalc();
                     }
                   },
+                  xns : Roo.form,
+                  '|xns' : 'Roo.form',
                   store : {
+                   xtype : 'Store',
                    remoteSort : true,
                    sortInfo : { direction : 'ASC', field: 'taxzone_descrip' },
-                   xns : Roo.data,
-                   '|xns' : 'Roo.data',
-                   xtype : 'Store',
                    listeners : {
                     beforeload : function (_self, o){
                          o.params = o.params || {};
@@ -1515,25 +1513,28 @@ Pman.Dialog.XtupleSalesOrder = {
                          
                      }
                    },
+                   xns : Roo.data,
+                   '|xns' : 'Roo.data',
                    proxy : {
+                    xtype : 'HttpProxy',
                     method : 'GET',
                     url : baseURL + '/Roo/taxzone.php',
                     xns : Roo.data,
-                    '|xns' : 'Roo.data',
-                    xtype : 'HttpProxy'
+                    '|xns' : 'Roo.data'
                    },
                    reader : {
+                    xtype : 'JsonReader',
                     fields : [{"name":"taxzone_id","type":"int"},"taxzone_descrip"],
                     id : 'taxzone_id',
                     root : 'data',
                     totalProperty : 'total',
                     xns : Roo.data,
-                    '|xns' : 'Roo.data',
-                    xtype : 'JsonReader'
+                    '|xns' : 'Roo.data'
                    }
                   }
                  },
                  {
+                  xtype : 'NumberField',
                   allowDecimals : true,
                   cls : 'roo-align-right',
                   decimalPrecision : 3,
@@ -1542,12 +1543,12 @@ Pman.Dialog.XtupleSalesOrder = {
                   readOnly : true,
                   width : 100,
                   xns : Roo.form,
-                  '|xns' : 'Roo.form',
-                  xtype : 'NumberField'
+                  '|xns' : 'Roo.form'
                  }
                 ]
                },
                {
+                xtype : 'NumberField',
                 allowDecimals : true,
                 cls : 'roo-align-right',
                 decimalPrecision : 3,
@@ -1556,26 +1557,26 @@ Pman.Dialog.XtupleSalesOrder = {
                 readOnly : true,
                 width : 100,
                 xns : Roo.form,
-                '|xns' : 'Roo.form',
-                xtype : 'NumberField'
+                '|xns' : 'Roo.form'
                },
                {
+                xtype : 'Row',
                 labelAlign : 'top',
                 labelSeparator : '&nbsp;',
                 width : 500,
                 xns : Roo.form,
                 '|xns' : 'Roo.form',
-                xtype : 'Row',
                 items  : [
                  {
+                  xtype : 'TextField',
                   fieldLabel : _this._strings['b6dad11e8e2203819164d64fc82b40f1'] /* Discount after Tax  Description */,
                   name : 'cohead_misc_descrip',
                   width : 230,
                   xns : Roo.form,
-                  '|xns' : 'Roo.form',
-                  xtype : 'TextField'
+                  '|xns' : 'Roo.form'
                  },
                  {
+                  xtype : 'NumberField',
                   allowDecimals : true,
                   cls : 'roo-align-right',
                   decimalPrecision : 1,
@@ -1610,9 +1611,6 @@ Pman.Dialog.XtupleSalesOrder = {
                      
                   },
                   width : 35,
-                  xns : Roo.form,
-                  '|xns' : 'Roo.form',
-                  xtype : 'NumberField',
                   listeners : {
                    keyup : function (_self, e)
                     {
@@ -1634,18 +1632,18 @@ Pman.Dialog.XtupleSalesOrder = {
                        
                         
                     }
-                  }
+                  },
+                  xns : Roo.form,
+                  '|xns' : 'Roo.form'
                  },
                  {
+                  xtype : 'NumberField',
                   allowDecimals : true,
                   cls : 'roo-align-right',
                   decimalPrecision : 3,
                   fieldLabel : _this._strings['cc7819055cde3194bb3b136bad5cf58d'] /* &nbsp; */,
                   name : 'cohead_posttax_discount',
                   width : 100,
-                  xns : Roo.form,
-                  '|xns' : 'Roo.form',
-                  xtype : 'NumberField',
                   listeners : {
                    keyup : function (_self, e)
                     {
@@ -1653,11 +1651,14 @@ Pman.Dialog.XtupleSalesOrder = {
                         _this.form.findField('cohead_total').recalc();
                         _this.form.findField('cohead_misc').recalc();
                     }
-                  }
+                  },
+                  xns : Roo.form,
+                  '|xns' : 'Roo.form'
                  }
                 ]
                },
                {
+                xtype : 'NumberField',
                 allowDecimals : true,
                 cls : 'roo-align-right',
                 decimalPrecision : 3,
@@ -1675,27 +1676,27 @@ Pman.Dialog.XtupleSalesOrder = {
                 },
                 width : 100,
                 xns : Roo.form,
-                '|xns' : 'Roo.form',
-                xtype : 'NumberField'
+                '|xns' : 'Roo.form'
                },
                {
+                xtype : 'NumberField',
                 allowDecimals : true,
                 cls : 'roo-align-right',
                 decimalPrecision : 3,
                 fieldLabel : _this._strings['ea9cf7e47ff33b2be14e6dd07cbcefc6'] /* Shipping */,
                 name : 'cohead_freight',
                 width : 100,
-                xns : Roo.form,
-                '|xns' : 'Roo.form',
-                xtype : 'NumberField',
                 listeners : {
                  keyup : function (_self, e)
                   {
                       _this.form.findField('cohead_total').recalc();
                   }
-                }
+                },
+                xns : Roo.form,
+                '|xns' : 'Roo.form'
                },
                {
+                xtype : 'NumberField',
                 allowDecimals : true,
                 cls : 'roo-align-right',
                 decimalPrecision : 3,
@@ -1704,10 +1705,10 @@ Pman.Dialog.XtupleSalesOrder = {
                 readOnly : true,
                 width : 100,
                 xns : Roo.form,
-                '|xns' : 'Roo.form',
-                xtype : 'NumberField'
+                '|xns' : 'Roo.form'
                },
                {
+                xtype : 'NumberField',
                 allowDecimals : true,
                 cls : 'roo-align-right',
                 decimalPrecision : 3,
@@ -1716,39 +1717,36 @@ Pman.Dialog.XtupleSalesOrder = {
                 readOnly : true,
                 width : 100,
                 xns : Roo.form,
-                '|xns' : 'Roo.form',
-                xtype : 'NumberField'
+                '|xns' : 'Roo.form'
                }
               ]
              }
             ]
            },
            {
+            xtype : 'FieldSet',
             legend : _this._strings['ea9cf7e47ff33b2be14e6dd07cbcefc6'] /* Shipping */,
             style : 'width:420px',
             xns : Roo.form,
             '|xns' : 'Roo.form',
-            xtype : 'FieldSet',
             items  : [
              {
+              xtype : 'Column',
               labelWidth : 50,
               width : 420,
               xns : Roo.form,
               '|xns' : 'Roo.form',
-              xtype : 'Column',
               items  : [
                {
+                xtype : 'Row',
                 labelSeparator : '&nbsp;',
                 xns : Roo.form,
                 '|xns' : 'Roo.form',
-                xtype : 'Row',
                 items  : [
                  {
+                  xtype : 'Checkbox',
                   boxLabel : 'Same as Billing',
                   name : '_shipto_same',
-                  xns : Roo.form,
-                  '|xns' : 'Roo.form',
-                  xtype : 'Checkbox',
                   listeners : {
                    check : function (_self, checked)
                     {
@@ -1802,11 +1800,14 @@ Pman.Dialog.XtupleSalesOrder = {
                         }
                         
                     }
-                  }
+                  },
+                  xns : Roo.form,
+                  '|xns' : 'Roo.form'
                  }
                 ]
                },
                {
+                xtype : 'ComboBox',
                 allowBlank : false,
                 alwaysQuery : true,
                 displayField : 'cntct_name',
@@ -1828,9 +1829,6 @@ Pman.Dialog.XtupleSalesOrder = {
                 typeAhead : true,
                 valueField : 'cntct_id',
                 width : 300,
-                xns : Roo.form,
-                '|xns' : 'Roo.form',
-                xtype : 'ComboBox',
                 listeners : {
                  add : function (combo)
                   {
@@ -1872,12 +1870,12 @@ Pman.Dialog.XtupleSalesOrder = {
                    
                   }
                 },
+                xns : Roo.form,
+                '|xns' : 'Roo.form',
                 store : {
+                 xtype : 'Store',
                  remoteSort : true,
                  sortInfo : { direction : 'ASC', field: 'cntct_name' },
-                 xns : Roo.data,
-                 '|xns' : 'Roo.data',
-                 xtype : 'Store',
                  listeners : {
                   beforeload : function (_self, o){
                        o.params = o.params || {};
@@ -1885,25 +1883,28 @@ Pman.Dialog.XtupleSalesOrder = {
                        o.params._customer_id = _this.data.cohead_cust_id;
                    }
                  },
+                 xns : Roo.data,
+                 '|xns' : 'Roo.data',
                  proxy : {
+                  xtype : 'HttpProxy',
                   method : 'GET',
                   url : baseURL + '/Roo/cntct.php',
                   xns : Roo.data,
-                  '|xns' : 'Roo.data',
-                  xtype : 'HttpProxy'
+                  '|xns' : 'Roo.data'
                  },
                  reader : {
+                  xtype : 'JsonReader',
                   fields : [{"name":"cntct_id","type":"int"},"cntct_name"],
                   id : 'cntct_id',
                   root : 'data',
                   totalProperty : 'total',
                   xns : Roo.data,
-                  '|xns' : 'Roo.data',
-                  xtype : 'JsonReader'
+                  '|xns' : 'Roo.data'
                  }
                 }
                },
                {
+                xtype : 'TextArea',
                 fieldLabel : _this._strings['dd7bf230fde8d4836917806aff6a6b27'] /* Address */,
                 name : 'shipto_address',
                 readOnly : true,
@@ -1935,9 +1936,6 @@ Pman.Dialog.XtupleSalesOrder = {
                     this.setValue(v.join("\n"));
                 },
                 width : 300,
-                xns : Roo.form,
-                '|xns' : 'Roo.form',
-                xtype : 'TextArea',
                 listeners : {
                  render : function (_self)
                   {
@@ -1979,15 +1977,17 @@ Pman.Dialog.XtupleSalesOrder = {
                           
                        });
                   }
-                }
+                },
+                xns : Roo.form,
+                '|xns' : 'Roo.form'
                },
                {
+                xtype : 'TextArea',
                 fieldLabel : _this._strings['48e91c2f1cb7b90612ccae2502c7327f'] /* Shipment Comments */,
                 name : 'cohead_shipcomments',
                 width : 300,
                 xns : Roo.form,
-                '|xns' : 'Roo.form',
-                xtype : 'TextArea'
+                '|xns' : 'Roo.form'
                }
               ]
              }
@@ -1996,36 +1996,37 @@ Pman.Dialog.XtupleSalesOrder = {
           ]
          },
          {
+          xtype : 'Hidden',
           name : 'cohead_id',
           xns : Roo.form,
-          '|xns' : 'Roo.form',
-          xtype : 'Hidden'
+          '|xns' : 'Roo.form'
          },
          {
+          xtype : 'Hidden',
           name : 'cohead_shipto_id',
           xns : Roo.form,
-          '|xns' : 'Roo.form',
-          xtype : 'Hidden'
+          '|xns' : 'Roo.form'
          },
          {
+          xtype : 'Hidden',
           name : 'cohead_shipto_id_shipto_name',
           xns : Roo.form,
-          '|xns' : 'Roo.form',
-          xtype : 'Hidden'
+          '|xns' : 'Roo.form'
          },
          {
+          xtype : 'Hidden',
           name : 'cohead_max_linenumber',
           xns : Roo.form,
-          '|xns' : 'Roo.form',
-          xtype : 'Hidden'
+          '|xns' : 'Roo.form'
          },
          {
+          xtype : 'Hidden',
           name : 'cohead_cust_id',
           xns : Roo.form,
-          '|xns' : 'Roo.form',
-          xtype : 'Hidden'
+          '|xns' : 'Roo.form'
          },
          {
+          xtype : 'Hidden',
           name : 'cohead_misc',
           recalc : function() {
               var d = _this.form.getValues();
@@ -2034,29 +2035,26 @@ Pman.Dialog.XtupleSalesOrder = {
                   parseFloat(d.cohead_posttax_discount) );
           },
           xns : Roo.form,
-          '|xns' : 'Roo.form',
-          xtype : 'Hidden'
+          '|xns' : 'Roo.form'
          },
          {
+          xtype : 'Hidden',
           name : 'taxzone_rate',
           xns : Roo.form,
-          '|xns' : 'Roo.form',
-          xtype : 'Hidden'
+          '|xns' : 'Roo.form'
          }
         ]
        }
       ]
      },
      {
+      xtype : 'GridPanel',
       background : true,
       fitContainer : true,
       fitToframe : true,
       region : 'center',
       tableName : 'coitem',
       title : _this._strings['4b84bd35233c0d3d3c36b9a6ce6e0745'] /* Order Items */,
-      xns : Roo,
-      '|xns' : 'Roo',
-      xtype : 'GridPanel',
       listeners : {
        activate : function() {
             _this.panel = this;
@@ -2091,7 +2089,10 @@ Pman.Dialog.XtupleSalesOrder = {
             }
         }
       },
+      xns : Roo,
+      '|xns' : 'Roo',
       grid : {
+       xtype : 'EditorGrid',
        autoExpandColumn : 'item_descrip1',
        clicksToEdit : 1,
        loadAvail : function() {
@@ -2145,9 +2146,6 @@ Pman.Dialog.XtupleSalesOrder = {
                        
        },
        loadMask : true,
-       xns : Roo.grid,
-       '|xns' : 'Roo.grid',
-       xtype : 'EditorGrid',
        listeners : {
         afteredit : function (e)
          {
@@ -2386,7 +2384,10 @@ Pman.Dialog.XtupleSalesOrder = {
          //    shipitem_shipped
          }
        },
+       xns : Roo.grid,
+       '|xns' : 'Roo.grid',
        footer : {
+        xtype : 'PagingToolbar',
         displayInfo : true,
         emptyMsg : _this._strings['158e64bcd08067d26e9c27679eeced88'] /* No Items */,
         pageSize : 100,
@@ -2416,13 +2417,10 @@ Pman.Dialog.XtupleSalesOrder = {
         },
         xns : Roo,
         '|xns' : 'Roo',
-        xtype : 'PagingToolbar',
         items  : [
          {
-          text : _this._strings['806dca90dbeda894ffb258939f9fef9a'] /* Fill empty Ship To */,
-          xns : Roo.Toolbar,
-          '|xns' : 'Roo.Toolbar',
           xtype : 'Button',
+          text : _this._strings['806dca90dbeda894ffb258939f9fef9a'] /* Fill empty Ship To */,
           listeners : {
            click : function (_self, e)
             {
@@ -2437,13 +2435,13 @@ Pman.Dialog.XtupleSalesOrder = {
                     }
                 });
             }
-          }
+          },
+          xns : Roo.Toolbar,
+          '|xns' : 'Roo.Toolbar'
          },
          {
-          text : _this._strings['c4b515058fab313f403ae427ce7e32b3'] /* Update Location to match S/O */,
-          xns : Roo.Toolbar,
-          '|xns' : 'Roo.Toolbar',
           xtype : 'Button',
+          text : _this._strings['c4b515058fab313f403ae427ce7e32b3'] /* Update Location to match S/O */,
           listeners : {
            click : function (_self, e)
             {
@@ -2468,15 +2466,15 @@ Pman.Dialog.XtupleSalesOrder = {
                 });
                 
             }
-          }
+          },
+          xns : Roo.Toolbar,
+          '|xns' : 'Roo.Toolbar'
          },
          {
+          xtype : 'Button',
           enableToggle : true,
           minWidth : 100,
           text : _this._strings['88408722ed9d719c44087292bf8a06cf'] /* Prices with GST */,
-          xns : Roo.Toolbar,
-          '|xns' : 'Roo.Toolbar',
-          xtype : 'Button',
           listeners : {
            render : function (_self)
             {
@@ -2496,22 +2494,22 @@ Pman.Dialog.XtupleSalesOrder = {
                 cm.setHidden(cm.getIndexByDataIndex('coitem_subtotal'), pressed ? true : false);
                 return;
             }
-          }
+          },
+          xns : Roo.Toolbar,
+          '|xns' : 'Roo.Toolbar'
          }
         ]
        },
        toolbar : {
+        xtype : 'Toolbar',
         xns : Roo,
         '|xns' : 'Roo',
-        xtype : 'Toolbar',
         items  : [
          {
+          xtype : 'Button',
           cls : 'x-btn-text-icon',
           icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
           text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
-          xns : Roo.Toolbar,
-          '|xns' : 'Roo.Toolbar',
-          xtype : 'Button',
           listeners : {
            click : function()
             {
@@ -2584,15 +2582,15 @@ Pman.Dialog.XtupleSalesOrder = {
             {
                 _this.addItemBtn = _self;
             }
-          }
+          },
+          xns : Roo.Toolbar,
+          '|xns' : 'Roo.Toolbar'
          },
          {
+          xtype : 'Button',
           cls : 'x-btn-text-icon',
           icon : rootURL + '/Pman/templates/images/search.gif',
           text : _this._strings['9f4f3d35db49c5c2bba70a321a42fa87'] /* Find Products */,
-          xns : Roo.Toolbar,
-          '|xns' : 'Roo.Toolbar',
-          xtype : 'Button',
           listeners : {
            click : function (_self, e)
             {
@@ -2652,16 +2650,16 @@ Pman.Dialog.XtupleSalesOrder = {
             
                }); 
             }
-          }
+          },
+          xns : Roo.Toolbar,
+          '|xns' : 'Roo.Toolbar'
          },
          {
+          xtype : 'Button',
           cls : 'x-btn-text-icon',
           hidden : true,
           icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
           text : _this._strings['a0947dda65e4112f49260243804b6528'] /* Xfer all stock to HK */,
-          xns : Roo.Toolbar,
-          '|xns' : 'Roo.Toolbar',
-          xtype : 'Button',
           listeners : {
            click : function()
             {
@@ -2684,13 +2682,13 @@ Pman.Dialog.XtupleSalesOrder = {
             {
                 _this.xferAll  = _self;
             }
-          }
+          },
+          xns : Roo.Toolbar,
+          '|xns' : 'Roo.Toolbar'
          },
          {
-          text : _this._strings['66b2bba3de9b8c5d6fb94e9458f1b7f5'] /* Show Inventory History */,
-          xns : Roo.Toolbar,
-          '|xns' : 'Roo.Toolbar',
           xtype : 'Button',
+          text : _this._strings['66b2bba3de9b8c5d6fb94e9458f1b7f5'] /* Show Inventory History */,
           listeners : {
            click : function (_self, e)
             {
@@ -2714,36 +2712,36 @@ Pman.Dialog.XtupleSalesOrder = {
                 
                
             }
-          }
+          },
+          xns : Roo.Toolbar,
+          '|xns' : 'Roo.Toolbar'
          },
          {
+          xtype : 'Separator',
           xns : Roo.Toolbar,
-          '|xns' : 'Roo.Toolbar',
-          xtype : 'Separator'
+          '|xns' : 'Roo.Toolbar'
          },
          {
-          text : _this._strings['c43b0fbe81e21c0a874a155ce528eebf'] /* Apply % Discount of :  */,
+          xtype : 'TextItem',
+          text : _this._strings['900eb3dcf3a7d639acbd2528ca5bbd52'] /* Apply % Discount of :  */,
           xns : Roo.Toolbar,
-          '|xns' : 'Roo.Toolbar',
-          xtype : 'TextItem'
+          '|xns' : 'Roo.Toolbar'
          },
          {
-          width : 40,
-          xns : Roo.form,
-          '|xns' : 'Roo.form',
           xtype : 'TextField',
+          width : 40,
           listeners : {
            render : function (_self)
             {
                 _this._applyDiscount = _self;
             }
-          }
+          },
+          xns : Roo.form,
+          '|xns' : 'Roo.form'
          },
          {
-          text : _this._strings['e87de1a5d238411ab34a292be599e9f4'] /* Apply To All */,
-          xns : Roo.Toolbar,
-          '|xns' : 'Roo.Toolbar',
           xtype : 'Button',
+          text : _this._strings['e87de1a5d238411ab34a292be599e9f4'] /* Apply To All */,
           listeners : {
            click : function (_self, e)
             {
@@ -2765,13 +2763,13 @@ Pman.Dialog.XtupleSalesOrder = {
                 
                 
             }
-          }
+          },
+          xns : Roo.Toolbar,
+          '|xns' : 'Roo.Toolbar'
          },
          {
-          text : _this._strings['72d6d7a1885885bb55a565fd1070581a'] /* Import */,
-          xns : Roo.Toolbar,
-          '|xns' : 'Roo.Toolbar',
           xtype : 'Button',
+          text : _this._strings['72d6d7a1885885bb55a565fd1070581a'] /* Import */,
           listeners : {
            click : function (_self, e)
             {
@@ -2796,20 +2794,20 @@ Pman.Dialog.XtupleSalesOrder = {
                    }
                );
             }
-          }
+          },
+          xns : Roo.Toolbar,
+          '|xns' : 'Roo.Toolbar'
          },
          {
+          xtype : 'Fill',
           xns : Roo.Toolbar,
-          '|xns' : 'Roo.Toolbar',
-          xtype : 'Fill'
+          '|xns' : 'Roo.Toolbar'
          },
          {
+          xtype : 'Button',
           cls : 'x-btn-text-icon',
           icon : rootURL + '/Pman/templates/images/trash.gif',
           text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
-          xns : Roo.Toolbar,
-          '|xns' : 'Roo.Toolbar',
-          xtype : 'Button',
           listeners : {
            click : function()
             {
@@ -2867,15 +2865,15 @@ Pman.Dialog.XtupleSalesOrder = {
                 
                 
             }
-          }
+          },
+          xns : Roo.Toolbar,
+          '|xns' : 'Roo.Toolbar'
          },
          {
+          xtype : 'Button',
           cls : 'x-btn-text-icon',
           icon : rootURL + '/Pman/templates/images/trash.gif',
           text : _this._strings['27f2870eaa01c99fc83105240ad15f7f'] /* Delete All */,
-          xns : Roo.Toolbar,
-          '|xns' : 'Roo.Toolbar',
-          xtype : 'Button',
           listeners : {
            click : function()
             {
@@ -2937,16 +2935,16 @@ Pman.Dialog.XtupleSalesOrder = {
                 
                 
             }
-          }
+          },
+          xns : Roo.Toolbar,
+          '|xns' : 'Roo.Toolbar'
          }
         ]
        },
        dataSource : {
+        xtype : 'Store',
         remoteSort : true,
         sortInfo : { field : 'coitem_linenumber,coitem_subnumber', direction: 'ASC' },
-        xns : Roo.data,
-        '|xns' : 'Roo.data',
-        xtype : 'Store',
         listeners : {
          beforeload : function (_self,o) {
           
@@ -3072,14 +3070,17 @@ Pman.Dialog.XtupleSalesOrder = {
               
           }
         },
+        xns : Roo.data,
+        '|xns' : 'Roo.data',
         proxy : {
+         xtype : 'HttpProxy',
          method : 'GET',
          url : baseURL + '/Roo/coitem.php',
          xns : Roo.data,
-         '|xns' : 'Roo.data',
-         xtype : 'HttpProxy'
+         '|xns' : 'Roo.data'
         },
         reader : {
+         xtype : 'JsonReader',
          builderCfg : '{\"cols\":[{\"table\":\"coitem\",\"column\":\"coitem_linenumber\",\"columnshort\":\"coitem_linenumber\",\"ctype\":\"int4\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Item#\"},{\"table\":\"coitem\",\"column\":\"coitem_itemsite_id\",\"columnshort\":\"coitem_itemsite_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"itemsite_id\",\"deps\":[{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_item_id\",\"columnshort\":\"itemsite_item_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_warehous_id\",\"columnshort\":\"itemsite_warehous_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_qtyonhand\",\"columnshort\":\"itemsite_qtyonhand\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_reorderlevel\",\"columnshort\":\"itemsite_reorderlevel\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_ordertoqty\",\"columnshort\":\"itemsite_ordertoqty\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_cyclecountfreq\",\"columnshort\":\"itemsite_cyclecountfreq\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_datelastcount\",\"columnshort\":\"itemsite_datelastcount\",\"ctype\":\"date\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_datelastused\",\"columnshort\":\"itemsite_datelastused\",\"ctype\":\"date\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_loccntrl\",\"columnshort\":\"itemsite_loccntrl\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_safetystock\",\"columnshort\":\"itemsite_safetystock\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_minordqty\",\"columnshort\":\"itemsite_minordqty\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_multordqty\",\"columnshort\":\"itemsite_multordqty\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_leadtime\",\"columnshort\":\"itemsite_leadtime\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_abcclass\",\"columnshort\":\"itemsite_abcclass\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_issuemethod\",\"columnshort\":\"itemsite_issuemethod\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_controlmethod\",\"columnshort\":\"itemsite_controlmethod\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_active\",\"columnshort\":\"itemsite_active\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_plancode_id\",\"columnshort\":\"itemsite_plancode_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_costcat_id\",\"columnshort\":\"itemsite_costcat_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_eventfence\",\"columnshort\":\"itemsite_eventfence\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_sold\",\"columnshort\":\"itemsite_sold\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_stocked\",\"columnshort\":\"itemsite_stocked\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_freeze\",\"columnshort\":\"itemsite_freeze\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_location_id\",\"columnshort\":\"itemsite_location_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_useparams\",\"columnshort\":\"itemsite_useparams\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_useparamsmanual\",\"columnshort\":\"itemsite_useparamsmanual\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_soldranking\",\"columnshort\":\"itemsite_soldranking\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_createpr\",\"columnshort\":\"itemsite_createpr\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_location\",\"columnshort\":\"itemsite_location\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_location_comments\",\"columnshort\":\"itemsite_location_comments\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_notes\",\"columnshort\":\"itemsite_notes\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_perishable\",\"columnshort\":\"itemsite_perishable\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_nnqoh\",\"columnshort\":\"itemsite_nnqoh\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_autoabcclass\",\"columnshort\":\"itemsite_autoabcclass\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_ordergroup\",\"columnshort\":\"itemsite_ordergroup\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_disallowblankwip\",\"columnshort\":\"itemsite_disallowblankwip\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_maxordqty\",\"columnshort\":\"itemsite_maxordqty\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_mps_timefence\",\"columnshort\":\"itemsite_mps_timefence\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_createwo\",\"columnshort\":\"itemsite_createwo\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_warrpurc\",\"columnshort\":\"itemsite_warrpurc\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_autoreg\",\"columnshort\":\"itemsite_autoreg\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_costmethod\",\"columnshort\":\"itemsite_costmethod\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_value\",\"columnshort\":\"itemsite_value\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_ordergroup_first\",\"columnshort\":\"itemsite_ordergroup_first\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_supply_itemsite_id\",\"columnshort\":\"itemsite_supply_itemsite_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_planning_type\",\"columnshort\":\"itemsite_planning_type\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_wosupply\",\"columnshort\":\"itemsite_wosupply\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_posupply\",\"columnshort\":\"itemsite_posupply\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_lsseq_id\",\"columnshort\":\"itemsite_lsseq_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_cosdefault\",\"columnshort\":\"itemsite_cosdefault\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_createsopr\",\"columnshort\":\"itemsite_createsopr\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_createsopo\",\"columnshort\":\"itemsite_createsopo\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_dropship\",\"columnshort\":\"itemsite_dropship\",\"ctype\":\"bool\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"coitem\",\"column\":\"coitem_qtyord\",\"columnshort\":\"coitem_qtyord\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Qty\"},{\"table\":\"coitem\",\"column\":\"coitem_unitcost\",\"columnshort\":\"coitem_unitcost\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Unit Cost\"},{\"table\":\"coitem\",\"column\":\"coitem_price\",\"columnshort\":\"coitem_price\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Price\"},{\"table\":\"coitem\",\"column\":\"coitem_custprice\",\"columnshort\":\"coitem_custprice\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Cust Price\"},{\"table\":\"coitem\",\"column\":\"coitem_qtyreturned\",\"columnshort\":\"coitem_qtyreturned\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"#Returned\"},{\"table\":\"coitem\",\"column\":\"coitem_prcost\",\"columnshort\":\"coitem_prcost\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"prcost?\"},{\"table\":\"coitem\",\"column\":\"coitem_price_uom_id\",\"columnshort\":\"coitem_price_uom_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"uom_id\",\"deps\":[{\"table\":\"uom\",\"column\":\"coitem_price_uom_id_uom_name\",\"columnshort\":\"uom_name\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"uom\",\"column\":\"coitem_price_uom_id_uom_descrip\",\"columnshort\":\"uom_descrip\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"uom\",\"column\":\"coitem_price_uom_id_uom_item_weight\",\"columnshort\":\"uom_item_weight\",\"ctype\":\"bool\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Unit of\"},{\"table\":\"coitem\",\"column\":\"coitem_qtyreserved\",\"columnshort\":\"coitem_qtyreserved\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"#reserved\"}],\"cols_ex\":[\"coitem_price_uom_id_uom_descrip\"],\"table\":\"coitem\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}',
          fields : [
              {
@@ -3120,15 +3121,12 @@ Pman.Dialog.XtupleSalesOrder = {
          root : 'data',
          totalProperty : 'total',
          xns : Roo.data,
-         '|xns' : 'Roo.data',
-         xtype : 'JsonReader'
+         '|xns' : 'Roo.data'
         }
        },
        sm : {
-        enter_is_tab : true,
-        xns : Roo.grid,
-        '|xns' : 'Roo.grid',
         xtype : 'CellSelectionModel',
+        enter_is_tab : true,
         listeners : {
          beforeeditnext : function (eventdata)
           {
@@ -3162,10 +3160,13 @@ Pman.Dialog.XtupleSalesOrder = {
           {
               _this.addItemBtn.fireEvent('click', _this.addItemBtn);
           }
-        }
+        },
+        xns : Roo.grid,
+        '|xns' : 'Roo.grid'
        },
        colModel : [
         {
+         xtype : 'ColumnModel',
          builderCfg : '{\"table\":\"coitem\",\"column\":\"coitem_linenumber\",\"columnshort\":\"coitem_linenumber\",\"ctype\":\"int4\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Item#\"}',
          dataIndex : 'coitem_linenumber',
          header : _this._strings['7a113dee68a51f4c5f71264fd0ce3781'] /* Item# */,
@@ -3178,22 +3179,22 @@ Pman.Dialog.XtupleSalesOrder = {
            },
          width : 40,
          xns : Roo.grid,
-         '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel'
+         '|xns' : 'Roo.grid'
         },
         {
+         xtype : 'ColumnModel',
          dataIndex : 'item_number',
          header : _this._strings['7608203603437f0513ba8203a2d39a4f'] /* Item Code */,
          renderer : function(v) { return String.format('{0}', v); },
          width : 75,
          xns : Roo.grid,
          '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel',
          editor : {
+          xtype : 'GridEditor',
           xns : Roo.grid,
           '|xns' : 'Roo.grid',
-          xtype : 'GridEditor',
           field : {
+           xtype : 'ComboBox',
            allowBlank : false,
            displayField : 'itemsite_item_id_item_number',
            editable : true,
@@ -3212,9 +3213,6 @@ Pman.Dialog.XtupleSalesOrder = {
            triggerAction : 'all',
            typeAhead : false,
            valueField : 'item_number',
-           xns : Roo.form,
-           '|xns' : 'Roo.form',
-           xtype : 'ComboBox',
            listeners : {
             beforeselect : function (combo, record, index)
              {
@@ -3238,12 +3236,12 @@ Pman.Dialog.XtupleSalesOrder = {
                
              }
            },
+           xns : Roo.form,
+           '|xns' : 'Roo.form',
            store : {
+            xtype : 'Store',
             remoteSort : true,
             sortInfo : { direction : 'ASC', field: 'item_number' },
-            xns : Roo.data,
-            '|xns' : 'Roo.data',
-            xtype : 'Store',
             listeners : {
              beforeload : function (_self, o){
                   o.params = o.params || {};
@@ -3253,27 +3251,30 @@ Pman.Dialog.XtupleSalesOrder = {
                   // set more here
               }
             },
+            xns : Roo.data,
+            '|xns' : 'Roo.data',
             proxy : {
+             xtype : 'HttpProxy',
              method : 'GET',
              url : baseURL + '/Roo/itemsite.php',
              xns : Roo.data,
-             '|xns' : 'Roo.data',
-             xtype : 'HttpProxy'
+             '|xns' : 'Roo.data'
             },
             reader : {
+             xtype : 'JsonReader',
              fields : [{"name":"item_id","type":"int"},"item_number"],
              id : 'shipto_id',
              root : 'data',
              totalProperty : 'total',
              xns : Roo.data,
-             '|xns' : 'Roo.data',
-             xtype : 'JsonReader'
+             '|xns' : 'Roo.data'
             }
            }
           }
          }
         },
         {
+         xtype : 'ColumnModel',
          dataIndex : 'coitem_location_src',
          header : _this._strings['5da618e8e4b89c66fe86e32cdafde142'] /* From */,
          renderer : function(v,x,r) { 
@@ -3282,12 +3283,12 @@ Pman.Dialog.XtupleSalesOrder = {
          width : 75,
          xns : Roo.grid,
          '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel',
          editor : {
+          xtype : 'GridEditor',
           xns : Roo.grid,
           '|xns' : 'Roo.grid',
-          xtype : 'GridEditor',
           field : {
+           xtype : 'ComboBox',
            allowBlank : false,
            alwaysQuery : true,
            displayField : 'location_name',
@@ -3307,9 +3308,6 @@ Pman.Dialog.XtupleSalesOrder = {
            triggerAction : 'all',
            typeAhead : false,
            valueField : 'location_id',
-           xns : Roo.form,
-           '|xns' : 'Roo.form',
-           xtype : 'ComboBox',
            listeners : {
             beforeselect : function (combo, record, index)
              {
@@ -3334,12 +3332,12 @@ Pman.Dialog.XtupleSalesOrder = {
                */
              }
            },
+           xns : Roo.form,
+           '|xns' : 'Roo.form',
            store : {
+            xtype : 'Store',
             remoteSort : true,
             sortInfo : { direction : 'ASC', field: 'location_name' },
-            xns : Roo.data,
-            '|xns' : 'Roo.data',
-            xtype : 'Store',
             listeners : {
              beforeload : function (_self, o){
                   o.params = o.params || {};
@@ -3362,27 +3360,30 @@ Pman.Dialog.XtupleSalesOrder = {
                   // set more here
               }
             },
+            xns : Roo.data,
+            '|xns' : 'Roo.data',
             proxy : {
+             xtype : 'HttpProxy',
              method : 'GET',
              url : baseURL + '/Roo/location.php',
              xns : Roo.data,
-             '|xns' : 'Roo.data',
-             xtype : 'HttpProxy'
+             '|xns' : 'Roo.data'
             },
             reader : {
+             xtype : 'JsonReader',
              fields : [{"name":"location_id","type":"int"},"location_name"],
              id : 'shipto_id',
              root : 'data',
              totalProperty : 'total',
              xns : Roo.data,
-             '|xns' : 'Roo.data',
-             xtype : 'JsonReader'
+             '|xns' : 'Roo.data'
             }
            }
           }
          }
         },
         {
+         xtype : 'ColumnModel',
          dataIndex : 'coitem_shipto_id',
          header : _this._strings['e12167aa0a7698e6ebc92b4ce3909b53'] /* To */,
          renderer : function(v,x,r) { 
@@ -3391,12 +3392,12 @@ Pman.Dialog.XtupleSalesOrder = {
          width : 75,
          xns : Roo.grid,
          '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel',
          editor : {
+          xtype : 'GridEditor',
           xns : Roo.grid,
           '|xns' : 'Roo.grid',
-          xtype : 'GridEditor',
           field : {
+           xtype : 'ComboBox',
            allowBlank : false,
            alwaysQuery : true,
            displayField : 'shipto_name',
@@ -3417,9 +3418,6 @@ Pman.Dialog.XtupleSalesOrder = {
            typeAhead : false,
            valueField : 'shipto_id',
            width : 300,
-           xns : Roo.form,
-           '|xns' : 'Roo.form',
-           xtype : 'ComboBox',
            listeners : {
             add : function (combo)
              {
@@ -3440,12 +3438,12 @@ Pman.Dialog.XtupleSalesOrder = {
               
              }
            },
+           xns : Roo.form,
+           '|xns' : 'Roo.form',
            store : {
+            xtype : 'Store',
             remoteSort : true,
             sortInfo : { direction : 'ASC', field: 'shipto_name' },
-            xns : Roo.data,
-            '|xns' : 'Roo.data',
-            xtype : 'Store',
             listeners : {
              beforeload : function (_self, o){
                   o.params = o.params || {};
@@ -3454,27 +3452,30 @@ Pman.Dialog.XtupleSalesOrder = {
                   // set more here
               }
             },
+            xns : Roo.data,
+            '|xns' : 'Roo.data',
             proxy : {
+             xtype : 'HttpProxy',
              method : 'GET',
              url : baseURL + '/Roo/shiptoinfo.php',
              xns : Roo.data,
-             '|xns' : 'Roo.data',
-             xtype : 'HttpProxy'
+             '|xns' : 'Roo.data'
             },
             reader : {
+             xtype : 'JsonReader',
              fields : [{"name":"cntct_id","type":"int"},"cntct_name"],
              id : 'shipto_id',
              root : 'data',
              totalProperty : 'total',
              xns : Roo.data,
-             '|xns' : 'Roo.data',
-             xtype : 'JsonReader'
+             '|xns' : 'Roo.data'
             }
            }
           }
          }
         },
         {
+         xtype : 'ColumnModel',
          builderCfg : '{\"table\":\"coitem\",\"column\":\"coitem_itemsite_id\",\"columnshort\":\"coitem_itemsite_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"itemsite_id\",\"deps\":[{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_item_id\",\"columnshort\":\"itemsite_item_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_warehous_id\",\"columnshort\":\"itemsite_warehous_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_qtyonhand\",\"columnshort\":\"itemsite_qtyonhand\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_reorderlevel\",\"columnshort\":\"itemsite_reorderlevel\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_ordertoqty\",\"columnshort\":\"itemsite_ordertoqty\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_cyclecountfreq\",\"columnshort\":\"itemsite_cyclecountfreq\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_datelastcount\",\"columnshort\":\"itemsite_datelastcount\",\"ctype\":\"date\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_datelastused\",\"columnshort\":\"itemsite_datelastused\",\"ctype\":\"date\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_loccntrl\",\"columnshort\":\"itemsite_loccntrl\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_safetystock\",\"columnshort\":\"itemsite_safetystock\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_minordqty\",\"columnshort\":\"itemsite_minordqty\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_multordqty\",\"columnshort\":\"itemsite_multordqty\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_leadtime\",\"columnshort\":\"itemsite_leadtime\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_abcclass\",\"columnshort\":\"itemsite_abcclass\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_issuemethod\",\"columnshort\":\"itemsite_issuemethod\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_controlmethod\",\"columnshort\":\"itemsite_controlmethod\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_active\",\"columnshort\":\"itemsite_active\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_plancode_id\",\"columnshort\":\"itemsite_plancode_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_costcat_id\",\"columnshort\":\"itemsite_costcat_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_eventfence\",\"columnshort\":\"itemsite_eventfence\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_sold\",\"columnshort\":\"itemsite_sold\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_stocked\",\"columnshort\":\"itemsite_stocked\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_freeze\",\"columnshort\":\"itemsite_freeze\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_location_id\",\"columnshort\":\"itemsite_location_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_useparams\",\"columnshort\":\"itemsite_useparams\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_useparamsmanual\",\"columnshort\":\"itemsite_useparamsmanual\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_soldranking\",\"columnshort\":\"itemsite_soldranking\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_createpr\",\"columnshort\":\"itemsite_createpr\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_location\",\"columnshort\":\"itemsite_location\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_location_comments\",\"columnshort\":\"itemsite_location_comments\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_notes\",\"columnshort\":\"itemsite_notes\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_perishable\",\"columnshort\":\"itemsite_perishable\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_nnqoh\",\"columnshort\":\"itemsite_nnqoh\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_autoabcclass\",\"columnshort\":\"itemsite_autoabcclass\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_ordergroup\",\"columnshort\":\"itemsite_ordergroup\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_disallowblankwip\",\"columnshort\":\"itemsite_disallowblankwip\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_maxordqty\",\"columnshort\":\"itemsite_maxordqty\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_mps_timefence\",\"columnshort\":\"itemsite_mps_timefence\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_createwo\",\"columnshort\":\"itemsite_createwo\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_warrpurc\",\"columnshort\":\"itemsite_warrpurc\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_autoreg\",\"columnshort\":\"itemsite_autoreg\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_costmethod\",\"columnshort\":\"itemsite_costmethod\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_value\",\"columnshort\":\"itemsite_value\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_ordergroup_first\",\"columnshort\":\"itemsite_ordergroup_first\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_supply_itemsite_id\",\"columnshort\":\"itemsite_supply_itemsite_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_planning_type\",\"columnshort\":\"itemsite_planning_type\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_wosupply\",\"columnshort\":\"itemsite_wosupply\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_posupply\",\"columnshort\":\"itemsite_posupply\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_lsseq_id\",\"columnshort\":\"itemsite_lsseq_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_cosdefault\",\"columnshort\":\"itemsite_cosdefault\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_createsopr\",\"columnshort\":\"itemsite_createsopr\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_createsopo\",\"columnshort\":\"itemsite_createsopo\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_dropship\",\"columnshort\":\"itemsite_dropship\",\"ctype\":\"bool\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"\"}',
          dataIndex : 'item_descrip1',
          header : _this._strings['d9db367d7e9d6a3d3ca0346dfa1ff9d2'] /* Item Description */,
@@ -3497,20 +3498,20 @@ Pman.Dialog.XtupleSalesOrder = {
          width : 150,
          xns : Roo.grid,
          '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel',
          editor : {
+          xtype : 'GridEditor',
           xns : Roo.grid,
           '|xns' : 'Roo.grid',
-          xtype : 'GridEditor',
           field : {
+           xtype : 'TextField',
            allowBlank : false,
            xns : Roo.form,
-           '|xns' : 'Roo.form',
-           xtype : 'TextField'
+           '|xns' : 'Roo.form'
           }
          }
         },
         {
+         xtype : 'ColumnModel',
          align : 'right',
          builderCfg : '{\"table\":\"coitem\",\"column\":\"coitem_unitcost\",\"columnshort\":\"coitem_unitcost\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Unit Cost\"}',
          dataIndex : 'coitem_status',
@@ -3518,10 +3519,10 @@ Pman.Dialog.XtupleSalesOrder = {
          renderer : function(v) { return String.format('{0}', v); },
          width : 50,
          xns : Roo.grid,
-         '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel'
+         '|xns' : 'Roo.grid'
         },
         {
+         xtype : 'ColumnModel',
          align : 'right',
          dataIndex : 'coitem_qtyord',
          header : _this._strings['03ab340b3f99e03cff9e84314ead38c0'] /* Qty */,
@@ -3539,19 +3540,16 @@ Pman.Dialog.XtupleSalesOrder = {
          width : 40,
          xns : Roo.grid,
          '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel',
          editor : {
+          xtype : 'GridEditor',
           xns : Roo.grid,
           '|xns' : 'Roo.grid',
-          xtype : 'GridEditor',
           field : {
+           xtype : 'NumberField',
            allowDecimals : false,
            decimalPrecision : 0,
            minValue : 1,
            style : 'text-align:right',
-           xns : Roo.form,
-           '|xns' : 'Roo.form',
-           xtype : 'NumberField',
            listeners : {
             focus : function (_self)
              {
@@ -3559,11 +3557,14 @@ Pman.Dialog.XtupleSalesOrder = {
                      this.el.dom.value = '';
                  }
              }
-           }
+           },
+           xns : Roo.form,
+           '|xns' : 'Roo.form'
           }
          }
         },
         {
+         xtype : 'ColumnModel',
          align : 'right',
          dataIndex : 'coitem_price',
          header : _this._strings['b166cb3a96bdb966f3288b8599594d0d'] /* Sell @ */,
@@ -3585,18 +3586,15 @@ Pman.Dialog.XtupleSalesOrder = {
          width : 70,
          xns : Roo.grid,
          '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel',
          editor : {
+          xtype : 'GridEditor',
           xns : Roo.grid,
           '|xns' : 'Roo.grid',
-          xtype : 'GridEditor',
           field : {
+           xtype : 'NumberField',
            decimalPrecision : 3,
            minValue : 0,
            style : 'text-align:right',
-           xns : Roo.form,
-           '|xns' : 'Roo.form',
-           xtype : 'NumberField',
            listeners : {
             focus : function (_self)
              {
@@ -3604,11 +3602,14 @@ Pman.Dialog.XtupleSalesOrder = {
                      this.el.dom.value = '';
                  }
              }
-           }
+           },
+           xns : Roo.form,
+           '|xns' : 'Roo.form'
           }
          }
         },
         {
+         xtype : 'ColumnModel',
          align : 'right',
          dataIndex : 'coitem_price_tax',
          header : _this._strings['9122d60c0550be8ab070b96d8bbc6358'] /* Sell @w/GST */,
@@ -3624,18 +3625,15 @@ Pman.Dialog.XtupleSalesOrder = {
          width : 70,
          xns : Roo.grid,
          '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel',
          editor : {
+          xtype : 'GridEditor',
           xns : Roo.grid,
           '|xns' : 'Roo.grid',
-          xtype : 'GridEditor',
           field : {
+           xtype : 'NumberField',
            decimalPrecision : 3,
            minValue : 0,
            style : 'text-align:right',
-           xns : Roo.form,
-           '|xns' : 'Roo.form',
-           xtype : 'NumberField',
            listeners : {
             focus : function (_self)
              {
@@ -3643,11 +3641,14 @@ Pman.Dialog.XtupleSalesOrder = {
                      this.el.dom.value = '';
                  }
              }
-           }
+           },
+           xns : Roo.form,
+           '|xns' : 'Roo.form'
           }
          }
         },
         {
+         xtype : 'ColumnModel',
          align : 'right',
          dataIndex : 'coitem_linedisc',
          header : _this._strings['9d4ba8f5211a3ba238b2032be5991c14'] /* Disc% */,
@@ -3673,19 +3674,16 @@ Pman.Dialog.XtupleSalesOrder = {
          width : 50,
          xns : Roo.grid,
          '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel',
          editor : {
+          xtype : 'GridEditor',
           xns : Roo.grid,
           '|xns' : 'Roo.grid',
-          xtype : 'GridEditor',
           field : {
+           xtype : 'NumberField',
            decimalPrecision : 2,
            maxValue : 100,
            minValue : 0,
            style : 'text-align:right',
-           xns : Roo.form,
-           '|xns' : 'Roo.form',
-           xtype : 'NumberField',
            listeners : {
             focus : function (_self)
              {
@@ -3693,11 +3691,14 @@ Pman.Dialog.XtupleSalesOrder = {
                      this.el.dom.value = '';
                  }
              }
-           }
+           },
+           xns : Roo.form,
+           '|xns' : 'Roo.form'
           }
          }
         },
         {
+         xtype : 'ColumnModel',
          align : 'right',
          dataIndex : 'coitem_custprice',
          header : _this._strings['f84e65035f5d2d4a090b8a626c822321'] /* List Price */,
@@ -3733,18 +3734,15 @@ Pman.Dialog.XtupleSalesOrder = {
          width : 70,
          xns : Roo.grid,
          '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel',
          editor : {
+          xtype : 'GridEditor',
           xns : Roo.grid,
           '|xns' : 'Roo.grid',
-          xtype : 'GridEditor',
           field : {
+           xtype : 'NumberField',
            decimalPrecision : 3,
            minValue : 0,
            style : 'text-align:right',
-           xns : Roo.form,
-           '|xns' : 'Roo.form',
-           xtype : 'NumberField',
            listeners : {
             focus : function (_self)
              {
@@ -3752,11 +3750,14 @@ Pman.Dialog.XtupleSalesOrder = {
                      this.el.dom.value = '';
                  }
              }
-           }
+           },
+           xns : Roo.form,
+           '|xns' : 'Roo.form'
           }
          }
         },
         {
+         xtype : 'ColumnModel',
          align : 'right',
          dataIndex : 'coitem_custprice_tax',
          header : _this._strings['4721299f56b6b7d43591156d1d3f3e82'] /* List Price w/GST */,
@@ -3784,18 +3785,15 @@ Pman.Dialog.XtupleSalesOrder = {
          width : 70,
          xns : Roo.grid,
          '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel',
          editor : {
+          xtype : 'GridEditor',
           xns : Roo.grid,
           '|xns' : 'Roo.grid',
-          xtype : 'GridEditor',
           field : {
+           xtype : 'NumberField',
            decimalPrecision : 3,
            minValue : 0,
            style : 'text-align:right',
-           xns : Roo.form,
-           '|xns' : 'Roo.form',
-           xtype : 'NumberField',
            listeners : {
             focus : function (_self)
              {
@@ -3803,11 +3801,14 @@ Pman.Dialog.XtupleSalesOrder = {
                      this.el.dom.value = '';
                  }
              }
-           }
+           },
+           xns : Roo.form,
+           '|xns' : 'Roo.form'
           }
          }
         },
         {
+         xtype : 'ColumnModel',
          align : 'right',
          dataIndex : 'coitem_subtotal',
          header : _this._strings['c5eae6ea505388a73962c635ac821fba'] /* SubTotal */,
@@ -3823,10 +3824,10 @@ Pman.Dialog.XtupleSalesOrder = {
            },
          width : 70,
          xns : Roo.grid,
-         '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel'
+         '|xns' : 'Roo.grid'
         },
         {
+         xtype : 'ColumnModel',
          align : 'right',
          dataIndex : 'coitem_subtotal_tax',
          header : _this._strings['236119342501b1e596bc82013c9cfc42'] /* SubTotal w/GST */,
@@ -3841,10 +3842,10 @@ Pman.Dialog.XtupleSalesOrder = {
          },
          width : 70,
          xns : Roo.grid,
-         '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel'
+         '|xns' : 'Roo.grid'
         },
         {
+         xtype : 'ColumnModel',
          align : 'right',
          builderCfg : '{\"table\":\"coitem\",\"column\":\"coitem_unitcost\",\"columnshort\":\"coitem_unitcost\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Unit Cost\"}',
          dataIndex : 'coitem_unitcost_in_order_cur',
@@ -3852,10 +3853,10 @@ Pman.Dialog.XtupleSalesOrder = {
          renderer : function(v) { return Roo.util.Format.number( v, 2); },
          width : 50,
          xns : Roo.grid,
-         '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel'
+         '|xns' : 'Roo.grid'
         },
         {
+         xtype : 'ColumnModel',
          align : 'right',
          dataIndex : 'coitem_taxtype_id',
          header : _this._strings['13abfee28b4564e3fb059420fbedbec5'] /* Taxed */,
@@ -3863,12 +3864,12 @@ Pman.Dialog.XtupleSalesOrder = {
          width : 50,
          xns : Roo.grid,
          '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel',
          editor : {
+          xtype : 'GridEditor',
           xns : Roo.grid,
           '|xns' : 'Roo.grid',
-          xtype : 'GridEditor',
           field : {
+           xtype : 'ComboBox',
            allowBlank : false,
            displayField : 'taxtype_name',
            editable : false,
@@ -3890,13 +3891,10 @@ Pman.Dialog.XtupleSalesOrder = {
            width : 40,
            xns : Roo.form,
            '|xns' : 'Roo.form',
-           xtype : 'ComboBox',
            store : {
+            xtype : 'Store',
             remoteSort : true,
             sortInfo : { direction : 'ASC', field: 'taxtype_name' },
-            xns : Roo.data,
-            '|xns' : 'Roo.data',
-            xtype : 'Store',
             listeners : {
              beforeload : function (_self, o){
                   o.params = o.params || {};
@@ -3905,27 +3903,30 @@ Pman.Dialog.XtupleSalesOrder = {
                   
               }
             },
+            xns : Roo.data,
+            '|xns' : 'Roo.data',
             proxy : {
+             xtype : 'HttpProxy',
              method : 'GET',
              url : baseURL + '/Roo/taxtype.php',
              xns : Roo.data,
-             '|xns' : 'Roo.data',
-             xtype : 'HttpProxy'
+             '|xns' : 'Roo.data'
             },
             reader : {
+             xtype : 'JsonReader',
              fields : [{"name":"taxtype_id","type":"int"},"taxtype_name"],
              id : 'taxtype_id',
              root : 'data',
              totalProperty : 'total',
              xns : Roo.data,
-             '|xns' : 'Roo.data',
-             xtype : 'JsonReader'
+             '|xns' : 'Roo.data'
             }
            }
           }
          }
         },
         {
+         xtype : 'ColumnModel',
          align : 'right',
          dataIndex : 'avail_qty',
          header : _this._strings['7eb17faabef94701775df7154f30684b'] /* #avail */,
@@ -3949,10 +3950,10 @@ Pman.Dialog.XtupleSalesOrder = {
          },
          width : 50,
          xns : Roo.grid,
-         '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel'
+         '|xns' : 'Roo.grid'
         },
         {
+         xtype : 'ColumnModel',
          align : 'right',
          builderCfg : '{\"table\":\"coitem\",\"column\":\"coitem_qtyreserved\",\"columnshort\":\"coitem_qtyreserved\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"#reserved\"}',
          dataIndex : 'shipitem_shipped',
@@ -3981,10 +3982,10 @@ Pman.Dialog.XtupleSalesOrder = {
          },
          width : 50,
          xns : Roo.grid,
-         '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel'
+         '|xns' : 'Roo.grid'
         },
         {
+         xtype : 'ColumnModel',
          align : 'right',
          builderCfg : '{\"table\":\"coitem\",\"column\":\"coitem_qtyreserved\",\"columnshort\":\"coitem_qtyreserved\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"#reserved\"}',
          dataIndex : 'coitem_qtyshipped',
@@ -4011,10 +4012,10 @@ Pman.Dialog.XtupleSalesOrder = {
          },
          width : 50,
          xns : Roo.grid,
-         '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel'
+         '|xns' : 'Roo.grid'
         },
         {
+         xtype : 'ColumnModel',
          align : 'right',
          dataIndex : 'cobill_billed',
          header : _this._strings['f3d90c6982143029487fb00d4ef19526'] /* #invoiced */,
@@ -4035,43 +4036,43 @@ Pman.Dialog.XtupleSalesOrder = {
          },
          width : 50,
          xns : Roo.grid,
-         '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel'
+         '|xns' : 'Roo.grid'
         }
        ]
       }
      },
      {
+      xtype : 'NestedLayoutPanel',
       region : 'center',
       title : _this._strings['50104a28589c5b6099d3580861c2551a'] /* Shipments / Invoices */,
-      xns : Roo,
-      '|xns' : 'Roo',
-      xtype : 'NestedLayoutPanel',
       listeners : {
        activate : function (_self)
         {
             _this.shipinvtab = _self;
         }
       },
+      xns : Roo,
+      '|xns' : 'Roo',
       layout : {
+       xtype : 'BorderLayout',
        xns : Roo,
        '|xns' : 'Roo',
-       xtype : 'BorderLayout',
        center : {
+        xtype : 'LayoutRegion',
         titlebar : true,
         xns : Roo,
-        '|xns' : 'Roo',
-        xtype : 'LayoutRegion'
+        '|xns' : 'Roo'
        },
        north : {
+        xtype : 'LayoutRegion',
         height : 250,
         title : _this._strings['607ff05a0e4c02c54b2262cd2e381aff'] /* Reserve Stock / Shipments */,
         xns : Roo,
-        '|xns' : 'Roo',
-        xtype : 'LayoutRegion'
+        '|xns' : 'Roo'
        },
        items  : [
         {
+         xtype : 'GridPanel',
          background : false,
          builderCfg : '{\"cols\":[{\"table\":\"shiphead\",\"column\":\"shiphead_number\",\"columnshort\":\"shiphead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_shipvia\",\"columnshort\":\"shiphead_shipvia\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_shipdate\",\"columnshort\":\"shiphead_shipdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_sfstatus\",\"columnshort\":\"shiphead_sfstatus\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_tracknum\",\"columnshort\":\"shiphead_tracknum\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}],\"cols_ex\":[\"shiphead_shipvia\"],\"table\":\"shiphead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}',
          fitContainer : true,
@@ -4079,9 +4080,6 @@ Pman.Dialog.XtupleSalesOrder = {
          region : 'north',
          tableName : 'shiphead',
          title : _this._strings['f4757c5aca5e4410b63c6ec4cd0f2363'] /* shiphead */,
-         xns : Roo,
-         '|xns' : 'Roo',
-         xtype : 'GridPanel',
          listeners : {
           activate : function() {
                _this.shippanel = this;
@@ -4090,13 +4088,13 @@ Pman.Dialog.XtupleSalesOrder = {
                }
            }
          },
+         xns : Roo,
+         '|xns' : 'Roo',
          grid : {
+          xtype : 'Grid',
           autoExpandColumn : 'shiphead_shipvia',
           builderCfg : '{\"cols\":[{\"table\":\"shiphead\",\"column\":\"shiphead_number\",\"columnshort\":\"shiphead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_shipvia\",\"columnshort\":\"shiphead_shipvia\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_shipdate\",\"columnshort\":\"shiphead_shipdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_sfstatus\",\"columnshort\":\"shiphead_sfstatus\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_tracknum\",\"columnshort\":\"shiphead_tracknum\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}],\"cols_ex\":[\"shiphead_shipvia\"],\"table\":\"shiphead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}',
           loadMask : true,
-          xns : Roo.grid,
-          '|xns' : 'Roo.grid',
-          xtype : 'Grid',
           listeners : {
            render : function() 
             {
@@ -4124,18 +4122,18 @@ Pman.Dialog.XtupleSalesOrder = {
                
             }
           },
+          xns : Roo.grid,
+          '|xns' : 'Roo.grid',
           toolbar : {
+           xtype : 'Toolbar',
            xns : Roo,
            '|xns' : 'Roo',
-           xtype : 'Toolbar',
            items  : [
             {
+             xtype : 'Button',
              cls : 'x-btn-text-icon',
              icon : rootURL + '/Pman/templates/images/lock.gif',
              text : _this._strings['813f81532d71077e497863ec9faf16c7'] /* Confirm Shipment */,
-             xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
-             xtype : 'Button',
              listeners : {
               click : function()
                {
@@ -4169,15 +4167,15 @@ Pman.Dialog.XtupleSalesOrder = {
                         
                     
                }
-             }
+             },
+             xns : Roo.Toolbar,
+             '|xns' : 'Roo.Toolbar'
             },
             {
+             xtype : 'Button',
              cls : 'x-btn-text-icon',
              icon : rootURL + '/Pman/templates/images/save.gif',
              text : _this._strings['70c6ddcd97af88d0aaac48268c459727'] /* Download (as xls) */,
-             xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
-             xtype : 'Button',
              listeners : {
               click : function()
                {
@@ -4202,15 +4200,15 @@ Pman.Dialog.XtupleSalesOrder = {
                         
                     
                }
-             }
+             },
+             xns : Roo.Toolbar,
+             '|xns' : 'Roo.Toolbar'
             },
             {
+             xtype : 'Button',
              cls : 'x-btn-text-icon',
              icon : rootURL + '/Pman/templates/images/pdf.gif',
              text : _this._strings['8c6aab77edc5b8e589b36bcf989683e4'] /* Print Picking Slip */,
-             xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
-             xtype : 'Button',
              listeners : {
               click : function ()
                {
@@ -4237,15 +4235,15 @@ Pman.Dialog.XtupleSalesOrder = {
                            
                   
                }
-             }
+             },
+             xns : Roo.Toolbar,
+             '|xns' : 'Roo.Toolbar'
             },
             {
+             xtype : 'Button',
              cls : 'x-btn-text-icon',
              icon : rootURL + '/Pman/templates/images/pdf.gif',
              text : _this._strings['1b7132f58f9ee9de75e5778ff04f7303'] /* Print Delivery Note */,
-             xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
-             xtype : 'Button',
              listeners : {
               click : function ()
                {
@@ -4272,15 +4270,15 @@ Pman.Dialog.XtupleSalesOrder = {
                            
                   
                }
-             }
+             },
+             xns : Roo.Toolbar,
+             '|xns' : 'Roo.Toolbar'
             },
             {
+             xtype : 'Button',
              cls : 'x-btn-text-icon',
              icon : Roo.rootURL + 'images/default/dd/email.gif',
              text : _this._strings['62f0de97dd70387d493350e45bfa5583'] /* Send Delivery Email */,
-             xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
-             xtype : 'Button',
              listeners : {
               click : function()
                {
@@ -4304,20 +4302,20 @@ Pman.Dialog.XtupleSalesOrder = {
                    });
                    
                }
-             }
+             },
+             xns : Roo.Toolbar,
+             '|xns' : 'Roo.Toolbar'
             },
             {
+             xtype : 'Fill',
              xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
-             xtype : 'Fill'
+             '|xns' : 'Roo.Toolbar'
             },
             {
+             xtype : 'Button',
              cls : 'x-btn-text-icon',
              icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
              text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
-             xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
-             xtype : 'Button',
              listeners : {
               click : function()
                {   
@@ -4340,15 +4338,15 @@ Pman.Dialog.XtupleSalesOrder = {
                {
                  _this.addShipmentBtn = _self;
                }
-             }
+             },
+             xns : Roo.Toolbar,
+             '|xns' : 'Roo.Toolbar'
             },
             {
+             xtype : 'Button',
              cls : 'x-btn-text-icon',
              icon : rootURL + '/Pman/templates/images/trash.gif',
              text : _this._strings['9aa6071f39d387792476bd70fed66735'] /* Void / Unconfirm */,
-             xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
-             xtype : 'Button',
              listeners : {
               click : function()
                {
@@ -4391,17 +4389,17 @@ Pman.Dialog.XtupleSalesOrder = {
                    
                    
                }
-             }
+             },
+             xns : Roo.Toolbar,
+             '|xns' : 'Roo.Toolbar'
             }
            ]
           },
           dataSource : {
+           xtype : 'Store',
            builderCfg : '{\"cols\":[{\"table\":\"shiphead\",\"column\":\"shiphead_number\",\"columnshort\":\"shiphead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_shipvia\",\"columnshort\":\"shiphead_shipvia\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_shipdate\",\"columnshort\":\"shiphead_shipdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_sfstatus\",\"columnshort\":\"shiphead_sfstatus\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_tracknum\",\"columnshort\":\"shiphead_tracknum\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}],\"cols_ex\":[\"shiphead_shipvia\"],\"table\":\"shiphead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}',
            remoteSort : true,
            sortInfo : { field : 'shiphead_shipvia', direction: 'ASC' },
-           xns : Roo.data,
-           '|xns' : 'Roo.data',
-           xtype : 'Store',
            listeners : {
             beforeload : function (_self, options)
              {
@@ -4412,14 +4410,17 @@ Pman.Dialog.XtupleSalesOrder = {
                  }
              }
            },
+           xns : Roo.data,
+           '|xns' : 'Roo.data',
            proxy : {
+            xtype : 'HttpProxy',
             method : 'GET',
             url : baseURL + '/Roo/shiphead.php',
             xns : Roo.data,
-            '|xns' : 'Roo.data',
-            xtype : 'HttpProxy'
+            '|xns' : 'Roo.data'
            },
            reader : {
+            xtype : 'JsonReader',
             builderCfg : '{\"cols\":[{\"table\":\"shiphead\",\"column\":\"shiphead_number\",\"columnshort\":\"shiphead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_shipvia\",\"columnshort\":\"shiphead_shipvia\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_shipdate\",\"columnshort\":\"shiphead_shipdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_sfstatus\",\"columnshort\":\"shiphead_sfstatus\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"shiphead\",\"column\":\"shiphead_tracknum\",\"columnshort\":\"shiphead_tracknum\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}],\"cols_ex\":[\"shiphead_shipvia\"],\"table\":\"shiphead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}',
             fields : [
                 {
@@ -4446,18 +4447,18 @@ Pman.Dialog.XtupleSalesOrder = {
             root : 'data',
             totalProperty : 'total',
             xns : Roo.data,
-            '|xns' : 'Roo.data',
-            xtype : 'JsonReader'
+            '|xns' : 'Roo.data'
            }
           },
           sm : {
+           xtype : 'RowSelectionModel',
            singleSelect : true,
            xns : Roo.grid,
-           '|xns' : 'Roo.grid',
-           xtype : 'RowSelectionModel'
+           '|xns' : 'Roo.grid'
           },
           colModel : [
            {
+            xtype : 'ColumnModel',
             builderCfg : '{\"table\":\"shiphead\",\"column\":\"shiphead_number\",\"columnshort\":\"shiphead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}',
             dataIndex : 'shiphead_number',
             header : _this._strings['b1bc248a7ff2b2e95569f56de68615df'] /* number */,
@@ -4469,38 +4470,38 @@ Pman.Dialog.XtupleSalesOrder = {
              },
             width : 80,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             dataIndex : 'shiphead_location_id_location_name',
             header : _this._strings['40e6e8652d174c7ceef48df46f9cf25a'] /* From Location */,
             renderer : function(v) { return String.format('{0}', v); },
             width : 100,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             dataIndex : 'shiphead_shipto_id_shipto_name',
             header : _this._strings['74002cb040b036511b8d031da591364a'] /* Ship to */,
             renderer : function(v) { return String.format('{0}', v); },
             width : 100,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             builderCfg : '{\"table\":\"shiphead\",\"column\":\"shiphead_shipdate\",\"columnshort\":\"shiphead_shipdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}',
             dataIndex : 'shiphead_shipdate',
             header : _this._strings['e963218370d6410e1ee0f8e6128c12d4'] /* shipdate */,
             renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             builderCfg : '{\"table\":\"shiphead\",\"column\":\"shiphead_sfstatus\",\"columnshort\":\"shiphead_sfstatus\",\"ctype\":\"bpchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}',
             dataIndex : 'shiphead_sfstatus',
             header : _this._strings['ec53a8c4f07baed5d8825072c89799be'] /* Status */,
@@ -4524,42 +4525,39 @@ Pman.Dialog.XtupleSalesOrder = {
             },
             width : 50,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             builderCfg : '{\"table\":\"shiphead\",\"column\":\"shiphead_shipvia\",\"columnshort\":\"shiphead_shipvia\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"}',
             dataIndex : 'shiphead_shipvia',
             header : _this._strings['37656f0f6cf5e5befb1ec7abd3db5804'] /* shipvia */,
             renderer : function(v) { return String.format('{0}', v); },
             width : 200,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             builderCfg : '{\"table\":\"shiphead\",\"column\":\"shiphead_tracknum\",\"columnshort\":\"shiphead_tracknum\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}',
             dataIndex : 'shiphead_tracknum',
             header : _this._strings['58ec392a138714456f83d1288f553099'] /* tracknum */,
             renderer : function(v) { return String.format('{0}', v); },
             width : 200,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            }
           ]
          }
         },
         {
+         xtype : 'GridPanel',
          background : false,
          fitContainer : true,
          fitToframe : true,
          region : 'center',
          tableName : 'cobmisc',
          title : _this._strings['fce9a6a1bd2a2050eb86d33103f46fd3'] /* Invoices */,
-         xns : Roo,
-         '|xns' : 'Roo',
-         xtype : 'GridPanel',
          listeners : {
           activate : function() {
                _this.invpanel = this;
@@ -4568,13 +4566,13 @@ Pman.Dialog.XtupleSalesOrder = {
                }
            }
          },
+         xns : Roo,
+         '|xns' : 'Roo',
          grid : {
+          xtype : 'Grid',
           autoExpandColumn : 'invchead_invcnumber',
           builderCfg : '{\"cols\":[{\"table\":\"invchead\",\"column\":\"invchead_invcnumber\",\"columnshort\":\"invchead_invcnumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"},{\"table\":\"invchead\",\"column\":\"invchead_invcdate\",\"columnshort\":\"invchead_invcdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}],\"cols_ex\":[\"invchead_invcnumber\"],\"table\":\"invchead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}',
           loadMask : true,
-          xns : Roo.grid,
-          '|xns' : 'Roo.grid',
-          xtype : 'Grid',
           listeners : {
            render : function() 
             {
@@ -4620,18 +4618,18 @@ Pman.Dialog.XtupleSalesOrder = {
                
             }
           },
+          xns : Roo.grid,
+          '|xns' : 'Roo.grid',
           toolbar : {
+           xtype : 'Toolbar',
            xns : Roo,
            '|xns' : 'Roo',
-           xtype : 'Toolbar',
            items  : [
             {
+             xtype : 'Button',
              cls : 'x-btn-text-icon',
              icon : rootURL + '/Pman/templates/images/lock.gif',
              text : _this._strings['b8feb9ee933bc5cc05615860322e9e7a'] /* Post Invoice */,
-             xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
-             xtype : 'Button',
              listeners : {
               click : function ()
                {
@@ -4667,25 +4665,25 @@ Pman.Dialog.XtupleSalesOrder = {
                            
                   
                }
-             }
+             },
+             xns : Roo.Toolbar,
+             '|xns' : 'Roo.Toolbar'
             },
             {
+             xtype : 'Button',
              cls : 'x-btn-text-icon',
              icon : rootURL + '/Pman/templates/images/pdf.gif',
              text : _this._strings['13dba24862cf9128167a59100e154c8d'] /* Print */,
              xns : Roo.Toolbar,
              '|xns' : 'Roo.Toolbar',
-             xtype : 'Button',
              menu : {
+              xtype : 'Menu',
               xns : Roo.menu,
               '|xns' : 'Roo.menu',
-              xtype : 'Menu',
               items  : [
                {
-                text : _this._strings['f97f673be4e5f66aca62b35280d8bcde'] /* Print Standard Invoice */,
-                xns : Roo.menu,
-                '|xns' : 'Roo.menu',
                 xtype : 'Item',
+                text : _this._strings['f97f673be4e5f66aca62b35280d8bcde'] /* Print Standard Invoice */,
                 listeners : {
                  click : function ()
                   {
@@ -4716,14 +4714,14 @@ Pman.Dialog.XtupleSalesOrder = {
                               
                      
                   }
-                }
+                },
+                xns : Roo.menu,
+                '|xns' : 'Roo.menu'
                },
                {
+                xtype : 'Item',
                 hidden : !(baseURL.match(/(hk\.php|cn\.php)$/)),
                 text : _this._strings['0ee182201463a0ea31cb073b227fbbbe'] /* Print Chinese Invoice With GST in line item */,
-                xns : Roo.menu,
-                '|xns' : 'Roo.menu',
-                xtype : 'Item',
                 listeners : {
                  click : function (_self, e)
                   {
@@ -4754,14 +4752,14 @@ Pman.Dialog.XtupleSalesOrder = {
                               
                             
                   }
-                }
+                },
+                xns : Roo.menu,
+                '|xns' : 'Roo.menu'
                },
                {
+                xtype : 'Item',
                 hidden : !(baseURL.match(/(hk\.php|cn\.php)$/)),
                 text : _this._strings['6ac26fe4e9a39ac45fffe6d6920dac3a'] /* Print Chinese Invoice */,
-                xns : Roo.menu,
-                '|xns' : 'Roo.menu',
-                xtype : 'Item',
                 listeners : {
                  click : function (_self, e)
                   {
@@ -4792,14 +4790,14 @@ Pman.Dialog.XtupleSalesOrder = {
                               
                             
                   }
-                }
+                },
+                xns : Roo.menu,
+                '|xns' : 'Roo.menu'
                },
                {
+                xtype : 'Item',
                 hidden : !(baseURL.match(/au\.php$/)),
                 text : _this._strings['69193f49683ba5a928ae8a27328105ba'] /* Print Aus - GST included Invoice */,
-                xns : Roo.menu,
-                '|xns' : 'Roo.menu',
-                xtype : 'Item',
                 listeners : {
                  click : function (_self, e)
                   {
@@ -4830,14 +4828,14 @@ Pman.Dialog.XtupleSalesOrder = {
                               
                             
                   }
-                }
+                },
+                xns : Roo.menu,
+                '|xns' : 'Roo.menu'
                },
                {
+                xtype : 'Item',
                 hidden : !(baseURL.match(/au\.php$/)),
                 text : _this._strings['3d96cc39e5517a284e203ffc8cafcf51'] /* Print Bambini Pronto Invoice */,
-                xns : Roo.menu,
-                '|xns' : 'Roo.menu',
-                xtype : 'Item',
                 listeners : {
                  click : function (_self, e)
                   {
@@ -4865,14 +4863,14 @@ Pman.Dialog.XtupleSalesOrder = {
                   
                   
                   }
-                }
+                },
+                xns : Roo.menu,
+                '|xns' : 'Roo.menu'
                },
                {
+                xtype : 'Item',
                 hidden : !(baseURL.match(/au\.php$/)),
                 text : _this._strings['c6b4fd215b0cdcb7426519edc0ece828'] /* Print Bambini Pro Forma Invoice */,
-                xns : Roo.menu,
-                '|xns' : 'Roo.menu',
-                xtype : 'Item',
                 listeners : {
                  click : function (_self, e)
                   {
@@ -4903,14 +4901,14 @@ Pman.Dialog.XtupleSalesOrder = {
                               
                             
                   }
-                }
+                },
+                xns : Roo.menu,
+                '|xns' : 'Roo.menu'
                },
                {
+                xtype : 'Item',
                 hidden : !( baseURL.match(/au\.php$/)),
                 text : _this._strings['46fc12727bf2c5cc79988ab857ad73b4'] /* Print Shipping / Commercial Invoice */,
-                xns : Roo.menu,
-                '|xns' : 'Roo.menu',
-                xtype : 'Item',
                 listeners : {
                  click : function (_self, e)
                   {
@@ -4924,30 +4922,30 @@ Pman.Dialog.XtupleSalesOrder = {
                   
                       });
                   }
-                }
+                },
+                xns : Roo.menu,
+                '|xns' : 'Roo.menu'
                }
               ]
              }
             },
             {
+             xtype : 'Button',
              cls : 'x-btn-text-icon',
              icon : Roo.rootURL + 'images/default/tree/leaf.gif',
              text : _this._strings['d682c376c82f68bc65dcd05570d04dfc'] /* Payments / Refunds / Credit Memos */,
              xns : Roo.Toolbar,
              '|xns' : 'Roo.Toolbar',
-             xtype : 'Button',
              menu : {
+              xtype : 'Menu',
               xns : Roo.menu,
               '|xns' : 'Roo.menu',
-              xtype : 'Menu',
               items  : [
                {
+                xtype : 'Item',
                 cls : 'x-btn-text-icon',
                 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
                 text : _this._strings['01d35df7886d24900b1ecb65da6bf21d'] /* Receive Payment */,
-                xns : Roo.menu,
-                '|xns' : 'Roo.menu',
-                xtype : 'Item',
                 listeners : {
                  click : function(_self,e)
                       {
@@ -4988,15 +4986,15 @@ Pman.Dialog.XtupleSalesOrder = {
                           _this.invgrid.ds.load({});
                       }); 
                   }
-                }
+                },
+                xns : Roo.menu,
+                '|xns' : 'Roo.menu'
                },
                {
+                xtype : 'Item',
                 cls : 'x-btn-text-icon',
                 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
                 text : _this._strings['526db6366257755024ed2556000871bc'] /* Issue Refund */,
-                xns : Roo.menu,
-                '|xns' : 'Roo.menu',
-                xtype : 'Item',
                 listeners : {
                  click : function(_self,e)
                   {
@@ -5042,20 +5040,20 @@ Pman.Dialog.XtupleSalesOrder = {
                           _this.invgrid.ds.load({});
                      }); 
                   }
-                }
+                },
+                xns : Roo.menu,
+                '|xns' : 'Roo.menu'
                },
                {
+                xtype : 'Separator',
                 xns : Roo.menu,
-                '|xns' : 'Roo.menu',
-                xtype : 'Separator'
+                '|xns' : 'Roo.menu'
                },
                {
+                xtype : 'Item',
                 cls : 'x-btn-text-icon',
                 icon : rootURL + '/Pman/templates/images/trash.gif',
                 text : _this._strings['2142511303396bd51e0cc25ea8ffe47f'] /* Void Payment */,
-                xns : Roo.menu,
-                '|xns' : 'Roo.menu',
-                xtype : 'Item',
                 listeners : {
                  click : function(_self,e)
                   {
@@ -5089,15 +5087,15 @@ Pman.Dialog.XtupleSalesOrder = {
                       
                        
                   }
-                }
+                },
+                xns : Roo.menu,
+                '|xns' : 'Roo.menu'
                },
                {
+                xtype : 'Item',
                 cls : 'x-btn-text-icon',
                 icon : rootURL + '/Pman/templates/images/trash.gif',
                 text : _this._strings['052fbb9431206b4755090dc53fcef300'] /* Void Refund */,
-                xns : Roo.menu,
-                '|xns' : 'Roo.menu',
-                xtype : 'Item',
                 listeners : {
                  click : function(_self,e)
                   {
@@ -5131,15 +5129,15 @@ Pman.Dialog.XtupleSalesOrder = {
                       
                        
                   }
-                }
+                },
+                xns : Roo.menu,
+                '|xns' : 'Roo.menu'
                },
                {
+                xtype : 'Item',
                 cls : 'x-btn-text-icon',
                 icon : rootURL + '/Pman/templates/images/trash.gif',
                 text : _this._strings['4b5a5a93e13bd338d40cf4bae2ca51cb'] /* Void Credit Memo */,
-                xns : Roo.menu,
-                '|xns' : 'Roo.menu',
-                xtype : 'Item',
                 listeners : {
                  click : function(_self,e)
                   {
@@ -5181,23 +5179,23 @@ Pman.Dialog.XtupleSalesOrder = {
                      })
                        
                   }
-                }
+                },
+                xns : Roo.menu,
+                '|xns' : 'Roo.menu'
                }
               ]
              }
             },
             {
+             xtype : 'Fill',
              xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
-             xtype : 'Fill'
+             '|xns' : 'Roo.Toolbar'
             },
             {
+             xtype : 'Button',
              cls : 'x-btn-text-icon',
              icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
              text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
-             xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
-             xtype : 'Button',
              listeners : {
               click : function ()
                {
@@ -5246,15 +5244,15 @@ Pman.Dialog.XtupleSalesOrder = {
                {
                  _this.addInvoiceBtn = _self;
                }
-             }
+             },
+             xns : Roo.Toolbar,
+             '|xns' : 'Roo.Toolbar'
             },
             {
+             xtype : 'Button',
              cls : 'x-btn-text-icon',
              icon : rootURL + '/Pman/templates/images/trash.gif',
              text : _this._strings['b25f6c965342495f74899e183efe20a4'] /* Void / Unpost */,
-             xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
-             xtype : 'Button',
              listeners : {
               click : function ()
                {
@@ -5298,16 +5296,16 @@ Pman.Dialog.XtupleSalesOrder = {
                            
                   
                }
-             }
+             },
+             xns : Roo.Toolbar,
+             '|xns' : 'Roo.Toolbar'
             }
            ]
           },
           dataSource : {
+           xtype : 'Store',
            remoteSort : true,
            sortInfo : { field : 'invchead_invcnumber', direction: 'ASC' },
-           xns : Roo.data,
-           '|xns' : 'Roo.data',
-           xtype : 'Store',
            listeners : {
             beforeload : function (_self, options)
              {
@@ -5373,14 +5371,17 @@ Pman.Dialog.XtupleSalesOrder = {
                  _this.invgrid.ds.add(nr);
              }
            },
+           xns : Roo.data,
+           '|xns' : 'Roo.data',
            proxy : {
+            xtype : 'HttpProxy',
             method : 'GET',
             url : baseURL + '/Roo/cobmisc.php',
             xns : Roo.data,
-            '|xns' : 'Roo.data',
-            xtype : 'HttpProxy'
+            '|xns' : 'Roo.data'
            },
            reader : {
+            xtype : 'JsonReader',
             builderCfg : '{\"cols\":[{\"table\":\"invchead\",\"column\":\"invchead_invcnumber\",\"columnshort\":\"invchead_invcnumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"},{\"table\":\"invchead\",\"column\":\"invchead_invcdate\",\"columnshort\":\"invchead_invcdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}],\"cols_ex\":[\"invchead_invcnumber\"],\"table\":\"invchead\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}',
             fields : [
                 {
@@ -5396,12 +5397,12 @@ Pman.Dialog.XtupleSalesOrder = {
             root : 'data',
             totalProperty : 'total',
             xns : Roo.data,
-            '|xns' : 'Roo.data',
-            xtype : 'JsonReader'
+            '|xns' : 'Roo.data'
            }
           },
           colModel : [
            {
+            xtype : 'ColumnModel',
             dataIndex : 'cobmisc_invchead_id_invchead_invcnumber',
             header : _this._strings['42f6d99a2dddc4858882ed8e9a210b52'] /* Invoice # */,
             renderer : function(v,x,r) { 
@@ -5430,10 +5431,10 @@ Pman.Dialog.XtupleSalesOrder = {
             },
             width : 100,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             builderCfg : '{\"table\":\"invchead\",\"column\":\"invchead_invcdate\",\"columnshort\":\"invchead_invcdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}',
             dataIndex : 'cobmisc_invcdate',
             header : _this._strings['3a6a3353e3b44ad5359c8e3178b66a54'] /* invcdate */,
@@ -5443,40 +5444,40 @@ Pman.Dialog.XtupleSalesOrder = {
             },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'cobmisc_qty',
             header : _this._strings['03ab340b3f99e03cff9e84314ead38c0'] /* Qty */,
             renderer : function(v) { return String.format('{0}', v ? parseInt(v) : 0); },
             width : 50,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'cobmisc_itemcost',
             header : _this._strings['757989a16207ab23076685118640adf3'] /* Item Cost */,
             renderer : function(v) { return String.format('{0}', v ? (1.0*v).toFixed(2)  : 0); },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'cobmisc_freight',
             header : _this._strings['ea9cf7e47ff33b2be14e6dd07cbcefc6'] /* Shipping */,
             renderer : function(v) { return String.format('{0}', v ? (1.0*v).toFixed(2)  : ''); },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'cobmisc_tax',
             header : _this._strings['4b78ac8eb158840e9638a3aeb26c4a9d'] /* Tax */,
@@ -5501,20 +5502,20 @@ Pman.Dialog.XtupleSalesOrder = {
              },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'cobmisc_cohead_id_cohead_pretax_discount',
             header : _this._strings['a763436d2b30d54e4aff264b1636827a'] /* Discount (Pretax) */,
             renderer : function(v) { return String.format('{0}', v ? (1.0*v).toFixed(2) : 0); },
             width : 100,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'cobmisc_misc',
             header : _this._strings['bb4af85913879b95661b81570a2c2e83'] /* Discount (Posttax) */,
@@ -5526,13 +5527,13 @@ Pman.Dialog.XtupleSalesOrder = {
             },
             width : 100,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'cobmisc_total',
-            header : _this._strings['09466661df2abefeecf849e52fce8fb4'] /* Total  */,
+            header : _this._strings['96b0141273eabab320119c467cdcaf17'] /* Total  */,
             renderer : function(v,x,r) { 
             
             /*    
@@ -5563,10 +5564,10 @@ Pman.Dialog.XtupleSalesOrder = {
             },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'cobmisc_outstanding',
             header : _this._strings['a860ed9926b241b7d4dca2d00610ab2c'] /* Outstanding */,
@@ -5577,8 +5578,7 @@ Pman.Dialog.XtupleSalesOrder = {
             },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            }
           ]
          }
@@ -5587,6 +5587,7 @@ Pman.Dialog.XtupleSalesOrder = {
       }
      },
      {
+      xtype : 'GridPanel',
       background : true,
       builderCfg : '{\"cols\":[{\"table\":\"events\",\"column\":\"event_when\",\"columnshort\":\"event_when\",\"ctype\":\"timestamp\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"action\",\"columnshort\":\"action\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"ipaddr\",\"columnshort\":\"ipaddr\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"person\",\"column\":\"person_id_name\",\"columnshort\":\"name\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"remarks\",\"columnshort\":\"remarks\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"}],\"cols_ex\":[\"remarks\"],\"table\":\"events\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}',
       fitContainer : true,
@@ -5594,9 +5595,6 @@ Pman.Dialog.XtupleSalesOrder = {
       region : 'center',
       tableName : 'events',
       title : _this._strings['16d2b386b2034b9488996466aaae0b57'] /* History */,
-      xns : Roo,
-      '|xns' : 'Roo',
-      xtype : 'GridPanel',
       listeners : {
        activate : function() {
             _this.hpanel = this;
@@ -5605,13 +5603,13 @@ Pman.Dialog.XtupleSalesOrder = {
             }
         }
       },
+      xns : Roo,
+      '|xns' : 'Roo',
       grid : {
+       xtype : 'Grid',
        autoExpandColumn : 'remarks',
        builderCfg : '{\"cols\":[{\"table\":\"events\",\"column\":\"event_when\",\"columnshort\":\"event_when\",\"ctype\":\"timestamp\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"action\",\"columnshort\":\"action\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"ipaddr\",\"columnshort\":\"ipaddr\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"person\",\"column\":\"person_id_name\",\"columnshort\":\"name\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"remarks\",\"columnshort\":\"remarks\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"}],\"cols_ex\":[\"remarks\"],\"table\":\"events\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}',
        loadMask : true,
-       xns : Roo.grid,
-       '|xns' : 'Roo.grid',
-       xtype : 'Grid',
        listeners : {
         render : function() 
          {
@@ -5629,22 +5627,22 @@ Pman.Dialog.XtupleSalesOrder = {
              }); 
          }
        },
+       xns : Roo.grid,
+       '|xns' : 'Roo.grid',
        footer : {
+        xtype : 'PagingToolbar',
         displayInfo : true,
         displayMsg : _this._strings['089ba2b5edc96565fc22c584ecfbb1a6'] /* Displaying events{0} - {1} of {2} */,
         emptyMsg : _this._strings['594f5bdc5e1519ce9934d276e5bf081f'] /* No events found */,
         pageSize : 25,
         xns : Roo,
-        '|xns' : 'Roo',
-        xtype : 'PagingToolbar'
+        '|xns' : 'Roo'
        },
        dataSource : {
+        xtype : 'Store',
         builderCfg : '{\"cols\":[{\"table\":\"events\",\"column\":\"event_when\",\"columnshort\":\"event_when\",\"ctype\":\"timestamp\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"action\",\"columnshort\":\"action\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"ipaddr\",\"columnshort\":\"ipaddr\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"person\",\"column\":\"person_id_name\",\"columnshort\":\"name\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"remarks\",\"columnshort\":\"remarks\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"}],\"cols_ex\":[\"remarks\"],\"table\":\"events\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}',
         remoteSort : true,
         sortInfo : { field : 'event_when', direction: 'DESC' },
-        xns : Roo.data,
-        '|xns' : 'Roo.data',
-        xtype : 'Store',
         listeners : {
          beforeload : function (_self, options)
           {
@@ -5652,14 +5650,17 @@ Pman.Dialog.XtupleSalesOrder = {
               options.params._related_on_id = _this.form.findField('cohead_id').getValue();
           }
         },
+        xns : Roo.data,
+        '|xns' : 'Roo.data',
         proxy : {
+         xtype : 'HttpProxy',
          method : 'GET',
          url : baseURL + '/Roo/events.php',
          xns : Roo.data,
-         '|xns' : 'Roo.data',
-         xtype : 'HttpProxy'
+         '|xns' : 'Roo.data'
         },
         reader : {
+         xtype : 'JsonReader',
          builderCfg : '{\"cols\":[{\"table\":\"events\",\"column\":\"event_when\",\"columnshort\":\"event_when\",\"ctype\":\"timestamp\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"action\",\"columnshort\":\"action\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"ipaddr\",\"columnshort\":\"ipaddr\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"person\",\"column\":\"person_id_name\",\"columnshort\":\"name\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"remarks\",\"columnshort\":\"remarks\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"}],\"cols_ex\":[\"remarks\"],\"table\":\"events\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}',
          fields : [
              {
@@ -5687,97 +5688,94 @@ Pman.Dialog.XtupleSalesOrder = {
          root : 'data',
          totalProperty : 'total',
          xns : Roo.data,
-         '|xns' : 'Roo.data',
-         xtype : 'JsonReader'
+         '|xns' : 'Roo.data'
         }
        },
        colModel : [
         {
+         xtype : 'ColumnModel',
          builderCfg : '{\"table\":\"events\",\"column\":\"event_when\",\"columnshort\":\"event_when\",\"ctype\":\"timestamp\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}',
          dataIndex : 'event_when',
          header : _this._strings['820dbd2b8f606aff866c0bbfb6b737c1'] /* Changed */,
          renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); },
          width : 120,
          xns : Roo.grid,
-         '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel'
+         '|xns' : 'Roo.grid'
         },
         {
+         xtype : 'ColumnModel',
          builderCfg : '{\"table\":\"events\",\"column\":\"action\",\"columnshort\":\"action\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}',
          dataIndex : 'action',
          header : _this._strings['418c5509e2171d55b0aee5c2ea4442b5'] /* action */,
          renderer : function(v,x,r) { return String.format('{0} - {1}', v, r.data.on_table); },
          width : 120,
          xns : Roo.grid,
-         '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel'
+         '|xns' : 'Roo.grid'
         },
         {
+         xtype : 'ColumnModel',
          builderCfg : '{\"table\":\"events\",\"column\":\"ipaddr\",\"columnshort\":\"ipaddr\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}',
          dataIndex : 'ipaddr',
          header : _this._strings['75ba8d70e3692ba200f0e0df37b4d2ae'] /* IP address */,
          renderer : function(v) { return String.format('{0}', v); },
          width : 120,
          xns : Roo.grid,
-         '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel'
+         '|xns' : 'Roo.grid'
         },
         {
+         xtype : 'ColumnModel',
          builderCfg : '{\"table\":\"person\",\"column\":\"person_id_name\",\"columnshort\":\"name\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}',
          dataIndex : 'person_id_name',
          header : _this._strings['4ee972120bcda675f75222c87cb9d356'] /* Who */,
          renderer : function(v) { return String.format('{0}', v); },
          width : 120,
          xns : Roo.grid,
-         '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel'
+         '|xns' : 'Roo.grid'
         },
         {
+         xtype : 'ColumnModel',
          builderCfg : '{\"table\":\"events\",\"column\":\"remarks\",\"columnshort\":\"remarks\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"}',
          dataIndex : 'remarks',
          header : _this._strings['f4c6f851b00d5518bf888815de279aba'] /* Notes */,
          renderer : function(v) { return String.format('{0}', v); },
          width : 200,
          xns : Roo.grid,
-         '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel'
+         '|xns' : 'Roo.grid'
         }
        ]
       }
      },
      {
+      xtype : 'NestedLayoutPanel',
       region : 'center',
       title : _this._strings['47cb03899dc494703b52c37240fa4c17'] /* Stock Tx */,
       xns : Roo,
       '|xns' : 'Roo',
-      xtype : 'NestedLayoutPanel',
       layout : {
+       xtype : 'BorderLayout',
        xns : Roo,
        '|xns' : 'Roo',
-       xtype : 'BorderLayout',
        center : {
+        xtype : 'LayoutRegion',
         xns : Roo,
-        '|xns' : 'Roo',
-        xtype : 'LayoutRegion'
+        '|xns' : 'Roo'
        },
        east : {
+        xtype : 'LayoutRegion',
         split : true,
         width : 500,
         xns : Roo,
-        '|xns' : 'Roo',
-        xtype : 'LayoutRegion'
+        '|xns' : 'Roo'
        },
        items  : [
         {
+         xtype : 'GridPanel',
          background : false,
          fitContainer : true,
          fitToframe : true,
          region : 'center',
          tableName : 'invdetail',
          title : _this._strings['f817f797c422f7ac3404b6223db1a1ee'] /* invdetail */,
-         xns : Roo,
-         '|xns' : 'Roo',
-         xtype : 'GridPanel',
          listeners : {
           activate : function() {
                _this.txpanel = this;
@@ -5786,12 +5784,12 @@ Pman.Dialog.XtupleSalesOrder = {
                }
            }
          },
+         xns : Roo,
+         '|xns' : 'Roo',
          grid : {
+          xtype : 'Grid',
           autoExpandColumn : 'item_number',
           loadMask : true,
-          xns : Roo.grid,
-          '|xns' : 'Roo.grid',
-          xtype : 'Grid',
           listeners : {
            render : function() 
             {
@@ -5802,25 +5800,25 @@ Pman.Dialog.XtupleSalesOrder = {
                 }
             }
           },
+          xns : Roo.grid,
+          '|xns' : 'Roo.grid',
           footer : {
+           xtype : 'PagingToolbar',
            displayInfo : true,
            displayMsg : _this._strings['87813307f6e7498b30c5b3d9b2f65f56'] /* Displaying invdetail{0} - {1} of {2} */,
            emptyMsg : _this._strings['a0d036a1d6a00180df168fa86143e5f8'] /* No invdetail found */,
            pageSize : 9999,
            xns : Roo,
-           '|xns' : 'Roo',
-           xtype : 'PagingToolbar'
+           '|xns' : 'Roo'
           },
           toolbar : {
+           xtype : 'Toolbar',
            xns : Roo,
            '|xns' : 'Roo',
-           xtype : 'Toolbar',
            items  : [
             {
-             text : _this._strings['b80f4ed22929b09103f0c5666ad7a7e1'] /* Run Apply Fifo on order */,
-             xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
              xtype : 'Button',
+             text : _this._strings['b80f4ed22929b09103f0c5666ad7a7e1'] /* Run Apply Fifo on order */,
              listeners : {
               click : function (_self, e)
                {
@@ -5836,13 +5834,13 @@ Pman.Dialog.XtupleSalesOrder = {
                        }
                    });
                }
-             }
+             },
+             xns : Roo.Toolbar,
+             '|xns' : 'Roo.Toolbar'
             },
             {
-             text : _this._strings['d179a904ac10a39ab574fe803cc29fa3'] /* Run Void flagger */,
-             xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
              xtype : 'Button',
+             text : _this._strings['d179a904ac10a39ab574fe803cc29fa3'] /* Run Void flagger */,
              listeners : {
               click : function (_self, e)
                {
@@ -5858,13 +5856,13 @@ Pman.Dialog.XtupleSalesOrder = {
                        }
                    });
                }
-             }
+             },
+             xns : Roo.Toolbar,
+             '|xns' : 'Roo.Toolbar'
             },
             {
-             text : _this._strings['26453198f2ddac444702879a8f6d61a5'] /* Auto Reverse */,
-             xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
              xtype : 'Button',
+             text : _this._strings['26453198f2ddac444702879a8f6d61a5'] /* Auto Reverse */,
              listeners : {
               click : function (_self, e)
                {
@@ -5883,16 +5881,16 @@ Pman.Dialog.XtupleSalesOrder = {
                        }
                    });
                }
-             }
+             },
+             xns : Roo.Toolbar,
+             '|xns' : 'Roo.Toolbar'
             }
            ]
           },
           dataSource : {
+           xtype : 'Store',
            remoteSort : true,
            sortInfo : { field : 'item_number', direction: 'ASC' },
-           xns : Roo.data,
-           '|xns' : 'Roo.data',
-           xtype : 'Store',
            listeners : {
             beforeload : function (_self, o)
              {
@@ -5903,14 +5901,17 @@ Pman.Dialog.XtupleSalesOrder = {
                  }
              }
            },
+           xns : Roo.data,
+           '|xns' : 'Roo.data',
            proxy : {
+            xtype : 'HttpProxy',
             method : 'GET',
             url : baseURL + '/Roo/invdetail.php',
             xns : Roo.data,
-            '|xns' : 'Roo.data',
-            xtype : 'HttpProxy'
+            '|xns' : 'Roo.data'
            },
            reader : {
+            xtype : 'JsonReader',
             fields : [
                 {
                     'name': 'invdetail_id',
@@ -5967,83 +5968,83 @@ Pman.Dialog.XtupleSalesOrder = {
             root : 'data',
             totalProperty : 'total',
             xns : Roo.data,
-            '|xns' : 'Roo.data',
-            xtype : 'JsonReader'
+            '|xns' : 'Roo.data'
            }
           },
           sm : {
-           singleSelect : true,
-           xns : Roo.grid,
-           '|xns' : 'Roo.grid',
            xtype : 'RowSelectionModel',
+           singleSelect : true,
            listeners : {
             selectionchange : function (_self)
              {
                  _this.txdgrid.footer.onClick('first');;
              }
-           }
+           },
+           xns : Roo.grid,
+           '|xns' : 'Roo.grid'
           },
           colModel : [
            {
+            xtype : 'ColumnModel',
             dataIndex : 'item_number',
             header : _this._strings['7d74f3b92b19da5e606d737d339a9679'] /* Item */,
             renderer : function(v) { return String.format('{0}', v); },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'rec_shipped',
             header : _this._strings['53896265ad28c11cb4997b3c3e3e122d'] /* #Ship */,
             renderer : function(v) { return String.format('{0}',  Roo.util.Format.number(v,0)); },
             width : 50,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'rec_returned',
             header : _this._strings['d323a19bad62ff427d0b75dc52674c81'] /* #Ret */,
             renderer : function(v) { return String.format('{0}', Roo.util.Format.number(v,0)); },
             width : 50,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'tx_shipped',
             header : _this._strings['51e07f52ae2192d23a1b43922e5beb90'] /* #TX ship */,
             renderer : function(v) { return String.format('{0}',  Roo.util.Format.number(v,0)); },
             width : 50,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'tx_returned',
             header : _this._strings['5e33fc1550a56738da96fbaaf57e72f0'] /* #TX ret */,
             renderer : function(v) { return String.format('{0}',  Roo.util.Format.number(v,0)); },
             width : 50,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'tx_total',
             header : _this._strings['1abe972d603f3bd61eefc9ac39fb7522'] /* #TX Tot */,
             renderer : function(v) { return String.format('{0}', Roo.util.Format.number(v,0)); },
             width : 50,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'total_value',
             header : _this._strings['689202409e48743b914713f96d93947c'] /* Value */,
@@ -6053,10 +6054,10 @@ Pman.Dialog.XtupleSalesOrder = {
             },
             width : 50,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'tx_total',
             header : _this._strings['56d56144d4e4a42ce450446518c4fc00'] /* #Diff */,
@@ -6073,22 +6074,19 @@ Pman.Dialog.XtupleSalesOrder = {
                 },
             width : 50,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            }
           ]
          }
         },
         {
+         xtype : 'GridPanel',
          background : false,
          fitContainer : true,
          fitToframe : true,
          region : 'east',
          tableName : 'invdetail',
          title : _this._strings['f817f797c422f7ac3404b6223db1a1ee'] /* invdetail */,
-         xns : Roo,
-         '|xns' : 'Roo',
-         xtype : 'GridPanel',
          listeners : {
           activate : function() {
                _this.txdpanel = this;
@@ -6097,12 +6095,12 @@ Pman.Dialog.XtupleSalesOrder = {
                }
            }
          },
+         xns : Roo,
+         '|xns' : 'Roo',
          grid : {
+          xtype : 'Grid',
           autoExpandColumn : 'invhist_comments',
           loadMask : true,
-          xns : Roo.grid,
-          '|xns' : 'Roo.grid',
-          xtype : 'Grid',
           listeners : {
            render : function() 
             {
@@ -6120,25 +6118,25 @@ Pman.Dialog.XtupleSalesOrder = {
                 _this.dateSel.setValue(new Date(dt[0]));
             }
           },
+          xns : Roo.grid,
+          '|xns' : 'Roo.grid',
           footer : {
+           xtype : 'PagingToolbar',
            displayInfo : true,
            displayMsg : _this._strings['87813307f6e7498b30c5b3d9b2f65f56'] /* Displaying invdetail{0} - {1} of {2} */,
            emptyMsg : _this._strings['a0d036a1d6a00180df168fa86143e5f8'] /* No invdetail found */,
            pageSize : 9999,
            xns : Roo,
-           '|xns' : 'Roo',
-           xtype : 'PagingToolbar'
+           '|xns' : 'Roo'
           },
           toolbar : {
+           xtype : 'Toolbar',
            xns : Roo,
            '|xns' : 'Roo',
-           xtype : 'Toolbar',
            items  : [
             {
-             text : _this._strings['fa1cfdb383ea976facbdb20d40d2f811'] /* Duplicate Selected */,
-             xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
              xtype : 'Button',
+             text : _this._strings['fa1cfdb383ea976facbdb20d40d2f811'] /* Duplicate Selected */,
              listeners : {
               click : function (_self, e)
                {
@@ -6182,40 +6180,40 @@ Pman.Dialog.XtupleSalesOrder = {
                    
                    
                }
-             }
+             },
+             xns : Roo.Toolbar,
+             '|xns' : 'Roo.Toolbar'
             },
             {
+             xtype : 'Fill',
              xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
-             xtype : 'Fill'
+             '|xns' : 'Roo.Toolbar'
             },
             {
+             xtype : 'TextItem',
              text : _this._strings['72bb7a9ea8714c52b0c0b8369d6a8dc3'] /* Issue Date */,
              xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
-             xtype : 'TextItem'
+             '|xns' : 'Roo.Toolbar'
             },
             {
+             xtype : 'DateField',
              allowBlank : false,
              fieldLabel : _this._strings['72bb7a9ea8714c52b0c0b8369d6a8dc3'] /* Issue Date */,
              format : 'Y-m-d',
              name : 'issue_date',
              width : 150,
-             xns : Roo.form,
-             '|xns' : 'Roo.form',
-             xtype : 'DateField',
              listeners : {
               render : function (_self)
                {
                    _this.dateSel = _self;
                }
-             }
+             },
+             xns : Roo.form,
+             '|xns' : 'Roo.form'
             },
             {
-             text : _this._strings['8156649b9de8783c15c822b592c3bac6'] /* Reverse Selected */,
-             xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
              xtype : 'Button',
+             text : _this._strings['8156649b9de8783c15c822b592c3bac6'] /* Reverse Selected */,
              listeners : {
               click : function (_self, e)
                {
@@ -6283,16 +6281,16 @@ Pman.Dialog.XtupleSalesOrder = {
                    
                    
                }
-             }
+             },
+             xns : Roo.Toolbar,
+             '|xns' : 'Roo.Toolbar'
             }
            ]
           },
           dataSource : {
+           xtype : 'Store',
            remoteSort : true,
            sortInfo : { field : 'invdetail_id', direction: 'ASC' },
-           xns : Roo.data,
-           '|xns' : 'Roo.data',
-           xtype : 'Store',
            listeners : {
             beforeload : function (_self, o)
              {
@@ -6306,14 +6304,17 @@ Pman.Dialog.XtupleSalesOrder = {
                  
              }
            },
+           xns : Roo.data,
+           '|xns' : 'Roo.data',
            proxy : {
+            xtype : 'HttpProxy',
             method : 'GET',
             url : baseURL + '/Roo/invdetail.php',
             xns : Roo.data,
-            '|xns' : 'Roo.data',
-            xtype : 'HttpProxy'
+            '|xns' : 'Roo.data'
            },
            reader : {
+            xtype : 'JsonReader',
             fields : [
                 {
                     'name': 'invdetail_id',
@@ -6370,30 +6371,30 @@ Pman.Dialog.XtupleSalesOrder = {
             root : 'data',
             totalProperty : 'total',
             xns : Roo.data,
-            '|xns' : 'Roo.data',
-            xtype : 'JsonReader'
+            '|xns' : 'Roo.data'
            }
           },
           colModel : [
            {
+            xtype : 'ColumnModel',
             dataIndex : 'invdetail_id',
             header : _this._strings['fd216b286b94577ac68c112c0dcaf341'] /* TX# */,
             renderer : function(v) { return String.format('{0}', v); },
             width : 60,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             dataIndex : 'invhist_transdate',
             header : _this._strings['44749712dbec183e983dcd78a7736c41'] /* Date */,
             renderer : function(v) { return String.format('{0}', v); },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             dataIndex : 'invhist_ordnumber',
             header : _this._strings['9c9745a343efeacc9efe9b7222b27afb'] /* Ref# */,
             renderer : function(v,x,r) {
@@ -6405,28 +6406,28 @@ Pman.Dialog.XtupleSalesOrder = {
              },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             dataIndex : 'location_name',
             header : _this._strings['fd216b286b94577ac68c112c0dcaf341'] /* TX# */,
             renderer : function(v) { return String.format('{0}', v); },
             width : 60,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             dataIndex : 'invhist_comments',
             header : _this._strings['f4c6f851b00d5518bf888815de279aba'] /* Notes */,
             renderer : function(v) { return String.format('{0}', v); },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'invdetail_qty',
             header : _this._strings['c4a0f4ddf926328daa2a350db9f9ca00'] /* Qty Changed */,
@@ -6442,10 +6443,10 @@ Pman.Dialog.XtupleSalesOrder = {
             },
             width : 50,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'invhist_value_before',
             header : _this._strings['c4a0f4ddf926328daa2a350db9f9ca00'] /* Qty Changed */,
@@ -6462,10 +6463,10 @@ Pman.Dialog.XtupleSalesOrder = {
             },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             dataIndex : 'invhist_posted',
             header : _this._strings['16cd452dda9d4398bf6240603eee40a9'] /* Posted */,
             renderer : function(v,x,r) { 
@@ -6476,8 +6477,7 @@ Pman.Dialog.XtupleSalesOrder = {
              },
             width : 40,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            }
           ]
          }
@@ -6486,38 +6486,36 @@ Pman.Dialog.XtupleSalesOrder = {
       }
      },
      {
+      xtype : 'NestedLayoutPanel',
       region : 'center',
       title : _this._strings['99575a08540e6ee585a7b389e8bde351'] /* GL Tx */,
       xns : Roo,
       '|xns' : 'Roo',
-      xtype : 'NestedLayoutPanel',
       layout : {
+       xtype : 'BorderLayout',
        xns : Roo,
        '|xns' : 'Roo',
-       xtype : 'BorderLayout',
        center : {
+        xtype : 'LayoutRegion',
         xns : Roo,
-        '|xns' : 'Roo',
-        xtype : 'LayoutRegion'
+        '|xns' : 'Roo'
        },
        east : {
+        xtype : 'LayoutRegion',
         split : true,
         width : 500,
         xns : Roo,
-        '|xns' : 'Roo',
-        xtype : 'LayoutRegion'
+        '|xns' : 'Roo'
        },
        items  : [
         {
+         xtype : 'GridPanel',
          background : false,
          fitContainer : true,
          fitToframe : true,
          region : 'center',
          tableName : 'invdetail',
          title : _this._strings['f817f797c422f7ac3404b6223db1a1ee'] /* invdetail */,
-         xns : Roo,
-         '|xns' : 'Roo',
-         xtype : 'GridPanel',
          listeners : {
           activate : function() {
                _this.gltxpanel = this;
@@ -6526,12 +6524,12 @@ Pman.Dialog.XtupleSalesOrder = {
                }
            }
          },
+         xns : Roo,
+         '|xns' : 'Roo',
          grid : {
+          xtype : 'Grid',
           autoExpandColumn : 'gltrans_accnt_id_accnt_descrip',
           loadMask : true,
-          xns : Roo.grid,
-          '|xns' : 'Roo.grid',
-          xtype : 'Grid',
           listeners : {
            cellclick : function (_self, rowIndex, columnIndex, e)
             {
@@ -6551,22 +6549,22 @@ Pman.Dialog.XtupleSalesOrder = {
                 }
             }
           },
+          xns : Roo.grid,
+          '|xns' : 'Roo.grid',
           footer : {
+           xtype : 'PagingToolbar',
            displayInfo : true,
            displayMsg : _this._strings['87813307f6e7498b30c5b3d9b2f65f56'] /* Displaying invdetail{0} - {1} of {2} */,
            emptyMsg : _this._strings['a0d036a1d6a00180df168fa86143e5f8'] /* No invdetail found */,
            pageSize : 9999,
            xns : Roo,
            '|xns' : 'Roo',
-           xtype : 'PagingToolbar',
            items  : [
             {
+             xtype : 'Button',
              enableToggle : true,
              pressed : true,
              text : _this._strings['8fb8fbc1c0bc53b2d01121344410e444'] /* Split sales */,
-             xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
-             xtype : 'Button',
              listeners : {
               click : function (_self, e)
                {
@@ -6576,16 +6574,16 @@ Pman.Dialog.XtupleSalesOrder = {
                {
                    _this.glsalesbtn = _self;
                }
-             }
+             },
+             xns : Roo.Toolbar,
+             '|xns' : 'Roo.Toolbar'
             }
            ]
           },
           dataSource : {
+           xtype : 'Store',
            remoteSort : true,
            sortInfo : { field : 'item_number', direction: 'ASC' },
-           xns : Roo.data,
-           '|xns' : 'Roo.data',
-           xtype : 'Store',
            listeners : {
             beforeload : function (_self, o)
              {
@@ -6597,14 +6595,17 @@ Pman.Dialog.XtupleSalesOrder = {
                  o.params._split_sales = _this.glsalesbtn.pressed ? 1 : 0;
              }
            },
+           xns : Roo.data,
+           '|xns' : 'Roo.data',
            proxy : {
+            xtype : 'HttpProxy',
             method : 'GET',
             url : baseURL + '/Roo/gltrans.php',
             xns : Roo.data,
-            '|xns' : 'Roo.data',
-            xtype : 'HttpProxy'
+            '|xns' : 'Roo.data'
            },
            reader : {
+            xtype : 'JsonReader',
             fields : [
                 {
                     'name': 'invdetail_id',
@@ -6661,24 +6662,24 @@ Pman.Dialog.XtupleSalesOrder = {
             root : 'data',
             totalProperty : 'total',
             xns : Roo.data,
-            '|xns' : 'Roo.data',
-            xtype : 'JsonReader'
+            '|xns' : 'Roo.data'
            }
           },
           sm : {
-           singleSelect : true,
-           xns : Roo.grid,
-           '|xns' : 'Roo.grid',
            xtype : 'RowSelectionModel',
+           singleSelect : true,
            listeners : {
             selectionchange : function (_self)
              {
                  _this.gltxdgrid.footer.onClick('first');;
              }
-           }
+           },
+           xns : Roo.grid,
+           '|xns' : 'Roo.grid'
           },
           colModel : [
            {
+            xtype : 'ColumnModel',
             dataIndex : 'gltrans_as_summary',
             header : _this._strings['290612199861c31d1036b185b4e69b75'] /* Summary */,
             renderer : function(v,x,r) { 
@@ -6689,71 +6690,68 @@ Pman.Dialog.XtupleSalesOrder = {
              },
             width : 50,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             dataIndex : 'gltrans_accnt_id_accnt_descrip',
             header : _this._strings['08bd40c7543007ad06e4fce31618f6ec'] /* Account */,
             renderer : function(v) { return String.format('{0}', v); },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'gltrans_amount_credit',
             header : _this._strings['0a90b1bc4078f74b6f0d117ec7df65af'] /* Credit */,
             renderer : function(v) { return String.format('{0}',  Roo.util.Format.number(v,3)); },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'gltrans_amount_debit',
             header : _this._strings['009534719f8c8221440a5629f497a784'] /* Debit */,
             renderer : function(v) { return String.format('{0}', Roo.util.Format.number(v,3)); },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'gltrans_amount_total',
             header : _this._strings['a0ec87054b5e5b7847d0d8780a01a3d5'] /* Sum */,
             renderer : function(v) { return String.format('<b>{0}</b>', Roo.util.Format.number(v,3)); },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'gltrans_amount_total_unposted',
             header : _this._strings['58733ee735e3160c5c9fa5739fb4d056'] /* Unposted */,
             renderer : function(v) { return String.format('<span style="color:red">{0}</span>', Roo.util.Format.number(v,3)); },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            }
           ]
          }
         },
         {
+         xtype : 'GridPanel',
          background : false,
          fitContainer : true,
          fitToframe : true,
          region : 'east',
          tableName : 'invdetail',
          title : _this._strings['f817f797c422f7ac3404b6223db1a1ee'] /* invdetail */,
-         xns : Roo,
-         '|xns' : 'Roo',
-         xtype : 'GridPanel',
          listeners : {
           activate : function() {
                _this.gltxdpanel = this;
@@ -6762,12 +6760,12 @@ Pman.Dialog.XtupleSalesOrder = {
                }
            }
          },
+         xns : Roo,
+         '|xns' : 'Roo',
          grid : {
+          xtype : 'Grid',
           autoExpandColumn : 'gltrans_notes',
           loadMask : true,
-          xns : Roo.grid,
-          '|xns' : 'Roo.grid',
-          xtype : 'Grid',
           listeners : {
            cellclick : function (_self, ri, ci, e)
             {
@@ -6897,20 +6895,20 @@ Pman.Dialog.XtupleSalesOrder = {
                 }
             }
           },
+          xns : Roo.grid,
+          '|xns' : 'Roo.grid',
           footer : {
+           xtype : 'PagingToolbar',
            displayInfo : true,
            displayMsg : _this._strings['87813307f6e7498b30c5b3d9b2f65f56'] /* Displaying invdetail{0} - {1} of {2} */,
            emptyMsg : _this._strings['a0d036a1d6a00180df168fa86143e5f8'] /* No invdetail found */,
            pageSize : 9999,
            xns : Roo,
            '|xns' : 'Roo',
-           xtype : 'PagingToolbar',
            items  : [
             {
-             text : _this._strings['801ab24683a4a8c433c6eb40c48bcd9d'] /* Download */,
-             xns : Roo.Toolbar,
-             '|xns' : 'Roo.Toolbar',
              xtype : 'Button',
+             text : _this._strings['801ab24683a4a8c433c6eb40c48bcd9d'] /* Download */,
              listeners : {
               click : function (_self, e)
                {
@@ -6919,16 +6917,16 @@ Pman.Dialog.XtupleSalesOrder = {
                    
                    });
                }
-             }
+             },
+             xns : Roo.Toolbar,
+             '|xns' : 'Roo.Toolbar'
             }
            ]
           },
           dataSource : {
+           xtype : 'Store',
            remoteSort : true,
            sortInfo : { field : 'gltrans_docnumber', direction: 'ASC' },
-           xns : Roo.data,
-           '|xns' : 'Roo.data',
-           xtype : 'Store',
            listeners : {
             beforeload : function (_self, o)
              {
@@ -6945,14 +6943,17 @@ Pman.Dialog.XtupleSalesOrder = {
                  
              }
            },
+           xns : Roo.data,
+           '|xns' : 'Roo.data',
            proxy : {
+            xtype : 'HttpProxy',
             method : 'GET',
             url : baseURL + '/Roo/gltrans.php',
             xns : Roo.data,
-            '|xns' : 'Roo.data',
-            xtype : 'HttpProxy'
+            '|xns' : 'Roo.data'
            },
            reader : {
+            xtype : 'JsonReader',
             fields : [
                 {
                     'name': 'invdetail_id',
@@ -7009,31 +7010,31 @@ Pman.Dialog.XtupleSalesOrder = {
             root : 'data',
             totalProperty : 'total',
             xns : Roo.data,
-            '|xns' : 'Roo.data',
-            xtype : 'JsonReader'
+            '|xns' : 'Roo.data'
            }
           },
           colModel : [
            {
+            xtype : 'ColumnModel',
             dataIndex : 'gltrans_id',
             header : _this._strings['9c9745a343efeacc9efe9b7222b27afb'] /* Ref# */,
             renderer : function(v) { return String.format('{0}', v ); },
             sortable : true,
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             dataIndex : 'gltrans_date',
             header : _this._strings['44749712dbec183e983dcd78a7736c41'] /* Date */,
             renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             dataIndex : 'gltrans_docnumber',
             header : _this._strings['cb02c723b8a159fea3cd7913d3df7fbc'] /* Doc# */,
             renderer : function(v,x,r) { 
@@ -7044,38 +7045,38 @@ Pman.Dialog.XtupleSalesOrder = {
             },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             dataIndex : 'gltrans_source',
             header : _this._strings['f31bbdd1b3e85bccd652680e16935819'] /* Source */,
             renderer : function(v) { return String.format('{0}', v); },
             width : 50,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             dataIndex : 'gltrans_notes',
             header : _this._strings['f4c6f851b00d5518bf888815de279aba'] /* Notes */,
             renderer : function(v) { return String.format('{0}', v); },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             align : 'right',
             dataIndex : 'gltrans_amount',
             header : _this._strings['b2f40690858b404ed10e62bdf422c704'] /* Amount */,
             renderer : function(v) { return String.format('{0}', Roo.util.Format.number(v,3)); },
             width : 75,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            },
            {
+            xtype : 'ColumnModel',
             dataIndex : 'gltrans_posted',
             header : _this._strings['16cd452dda9d4398bf6240603eee40a9'] /* Posted */,
             renderer : function(v,x,r) { 
@@ -7086,8 +7087,7 @@ Pman.Dialog.XtupleSalesOrder = {
              },
             width : 50,
             xns : Roo.grid,
-            '|xns' : 'Roo.grid',
-            xtype : 'ColumnModel'
+            '|xns' : 'Roo.grid'
            }
           ]
          }
@@ -7096,15 +7096,13 @@ Pman.Dialog.XtupleSalesOrder = {
       }
      },
      {
+      xtype : 'GridPanel',
       background : true,
       fitContainer : true,
       fitToframe : true,
       region : 'center',
       tableName : 'coitem',
       title : _this._strings['182875b6c36a761f1e459624c1d93638'] /* Profit */,
-      xns : Roo,
-      '|xns' : 'Roo',
-      xtype : 'GridPanel',
       listeners : {
        activate : function() {
             _this.profitpanel = this;
@@ -7126,12 +7124,12 @@ Pman.Dialog.XtupleSalesOrder = {
             
         }
       },
+      xns : Roo,
+      '|xns' : 'Roo',
       grid : {
+       xtype : 'Grid',
        autoExpandColumn : 'item_number',
        loadMask : true,
-       xns : Roo.grid,
-       '|xns' : 'Roo.grid',
-       xtype : 'Grid',
        listeners : {
         render : function() 
          {
@@ -7142,21 +7140,21 @@ Pman.Dialog.XtupleSalesOrder = {
              }
          }
        },
+       xns : Roo.grid,
+       '|xns' : 'Roo.grid',
        footer : {
+        xtype : 'PagingToolbar',
         displayInfo : true,
         displayMsg : _this._strings['d0cc96be641673ad48fc74374fda8137'] /* Displaying coitem{0} - {1} of {2} */,
         emptyMsg : _this._strings['c04b33241cc5478500daf178e3720b63'] /* No coitem found */,
         pageSize : 25,
         xns : Roo,
-        '|xns' : 'Roo',
-        xtype : 'PagingToolbar'
+        '|xns' : 'Roo'
        },
        dataSource : {
+        xtype : 'Store',
         remoteSort : true,
         sortInfo : { field : 'coitem_linenumber,coitem_subnumber', direction: 'ASC' },
-        xns : Roo.data,
-        '|xns' : 'Roo.data',
-        xtype : 'Store',
         listeners : {
          beforeload : function (_self,o) {
           
@@ -7176,14 +7174,17 @@ Pman.Dialog.XtupleSalesOrder = {
               
           }
         },
+        xns : Roo.data,
+        '|xns' : 'Roo.data',
         proxy : {
+         xtype : 'HttpProxy',
          method : 'GET',
          url : baseURL + '/Roo/coitem.php',
          xns : Roo.data,
-         '|xns' : 'Roo.data',
-         xtype : 'HttpProxy'
+         '|xns' : 'Roo.data'
         },
         reader : {
+         xtype : 'JsonReader',
          fields : [
              {
                  'name': 'id',
@@ -7322,21 +7323,21 @@ Pman.Dialog.XtupleSalesOrder = {
          root : 'data',
          totalProperty : 'total',
          xns : Roo.data,
-         '|xns' : 'Roo.data',
-         xtype : 'JsonReader'
+         '|xns' : 'Roo.data'
         }
        },
        colModel : [
         {
+         xtype : 'ColumnModel',
          dataIndex : 'item_number',
          header : _this._strings['7608203603437f0513ba8203a2d39a4f'] /* Item Code */,
          renderer : function(v) { return String.format('{0}', v); },
          width : 75,
          xns : Roo.grid,
-         '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel'
+         '|xns' : 'Roo.grid'
         },
         {
+         xtype : 'ColumnModel',
          dataIndex : 'calc_subtotal',
          header : _this._strings['c5eae6ea505388a73962c635ac821fba'] /* SubTotal */,
          renderer : function(v) {
@@ -7346,10 +7347,10 @@ Pman.Dialog.XtupleSalesOrder = {
            },
          width : 200,
          xns : Roo.grid,
-         '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel'
+         '|xns' : 'Roo.grid'
         },
         {
+         xtype : 'ColumnModel',
          dataIndex : 'calc_cost_total',
          header : _this._strings['81dffdb31b9576e343d3f7ffcf721d7e'] /* Cost of goods */,
          renderer : function(v) {
@@ -7358,10 +7359,10 @@ Pman.Dialog.XtupleSalesOrder = {
            },
          width : 200,
          xns : Roo.grid,
-         '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel'
+         '|xns' : 'Roo.grid'
         },
         {
+         xtype : 'ColumnModel',
          dataIndex : 'profit',
          header : _this._strings['182875b6c36a761f1e459624c1d93638'] /* Profit */,
          renderer : function(v,x,r) {
@@ -7377,8 +7378,7 @@ Pman.Dialog.XtupleSalesOrder = {
          },
          width : 200,
          xns : Roo.grid,
-         '|xns' : 'Roo.grid',
-         xtype : 'ColumnModel'
+         '|xns' : 'Roo.grid'
         }
        ]
       }