Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleRecvGrp.js
index a43b47a..d4020bf 100644 (file)
@@ -30,6 +30,12 @@ Pman.Dialog.XtupleRecvGrp = {
         this.dialog = Roo.factory({
             xtype: 'LayoutDialog',
             xns: Roo,
+            listeners : {
+                show : function (_self)
+                {
+                    _this.dialog.layout.getRegion('center').showPanel(0);
+                }
+            },
             closable : false,
             collapsible : false,
             height : 600,
@@ -39,1057 +45,1207 @@ Pman.Dialog.XtupleRecvGrp = {
             width : 900,
             items : [
                 {
-                    xtype: 'ContentPanel',
+                    xtype: 'NestedLayoutPanel',
                     xns: Roo,
-                    region : 'north',
-                    items : [
-                        {
-                            xtype: 'Form',
-                            xns: Roo.form,
-                            listeners : {
-                                actioncomplete : function(_self,action)
-                                {
-                                    if (action.type == 'setdata') {
-                                       //_this.dialog.el.mask("Loading");
-                                       
-                                       if (_this.data.recvgrp_id) {
-                                           this.load({ method: 'GET', params: { '_id' : _this.data.recvgrp_id }});
-                                           return;
-                                       }
-                                       
-                                       if (!_this.data.recv_id) {
-                                           _this.data.recv_date = new Date();
-                                       }
-                                       _this.form.setValues(_this.data);
-                                
-                                        _this.grid.ds.load({});
-                                       //this.load({ method: 'GET', params: { '_id' : _this.data.id }});
-                                       return;
-                                    }
-                                    if (action.type == 'load') {
-                                        _this.grid.ds.load({});
-                                        
-                                        
-                                        
-                                        
-                                        
-                                        return;
+                    region : 'center',
+                    title : "Details",
+                    layout : {
+                        xtype: 'BorderLayout',
+                        xns: Roo,
+                        items : [
+                            {
+                                xtype: 'ContentPanel',
+                                xns: Roo,
+                                region : 'north',
+                                items : [
+                                    {
+                                        xtype: 'Form',
+                                        xns: Roo.form,
+                                        listeners : {
+                                            actioncomplete : function(_self,action)
+                                            {
+                                                if (action.type == 'setdata') {
+                                                   //_this.dialog.el.mask("Loading");
+                                                   
+                                                   if (_this.data.recvgrp_id) {
+                                                       this.load({ method: 'GET', params: { '_id' : _this.data.recvgrp_id }});
+                                                       return;
+                                                   }
+                                                   
+                                                   if (!_this.data.recv_id) {
+                                                       _this.data.recv_date = new Date();
+                                                   }
+                                                   _this.form.setValues(_this.data);
+                                            
+                                                    _this.grid.ds.load({});
+                                                   //this.load({ method: 'GET', params: { '_id' : _this.data.id }});
+                                                   return;
+                                                }
+                                                if (action.type == 'load') {
+                                                    _this.grid.ds.load({});
+                                                    
+                                                    
+                                                    
+                                                    
+                                                    
+                                                    return;
+                                                }
+                                                if (action.type =='submit') {
+                                                
+                                                     
+                                                    _this.dialog.hide();
+                                                
+                                                     if (_this.callback) {
+                                                        _this.callback.call(_this, _this.form.getValues());
+                                                     }
+                                                     _this.form.reset();
+                                                     return;
+                                                }
+                                            },
+                                            rendered : function (form)
+                                            {
+                                                _this.form= form;
+                                            }
+                                        },
+                                        method : 'POST',
+                                        style : 'margin:10px;',
+                                        timeout : 120000,
+                                        url : baseURL + '/Roo/recvgrp.php',
+                                        items : [
+                                            {
+                                                xtype: 'FieldSet',
+                                                xns: Roo.form,
+                                                legend : "Receipt Details",
+                                                items : [
+                                                    {
+                                                        xtype: 'Row',
+                                                        xns: Roo.form,
+                                                        width : 800,
+                                                        items : [
+                                                            {
+                                                                xtype: 'Column',
+                                                                xns: Roo.form,
+                                                                width : 450,
+                                                                items : [
+                                                                    {
+                                                                        xtype: 'TextField',
+                                                                        xns: Roo.form,
+                                                                        fieldLabel : 'Order number',
+                                                                        name : 'recvgrp_pohead_id_pohead_number',
+                                                                        readOnly : true,
+                                                                        width : 200
+                                                                    },
+                                                                    {
+                                                                        xtype: 'DateField',
+                                                                        xns: Roo.form,
+                                                                        allowBlank : false,
+                                                                        altFormats : 'Y-m-d',
+                                                                        fieldLabel : 'Recv date',
+                                                                        format : 'd/M/Y',
+                                                                        name : 'recvgrp_date',
+                                                                        width : 100,
+                                                                        useIso : true
+                                                                    },
+                                                                    {
+                                                                        xtype: 'ComboBox',
+                                                                        xns: Roo.form,
+                                                                        allowBlank : false,
+                                                                        displayField : 'location_name',
+                                                                        editable : true,
+                                                                        emptyText : "Select location",
+                                                                        fieldLabel : 'Delivered to',
+                                                                        forceSelection : true,
+                                                                        hiddenName : 'recvgrp_location_id',
+                                                                        listWidth : 400,
+                                                                        loadingText : "Searching...",
+                                                                        minChars : 2,
+                                                                        name : 'recvgrp_location_id_location_name',
+                                                                        pageSize : 200,
+                                                                        qtip : "Select terms",
+                                                                        queryParam : 'query[location_name]',
+                                                                        selectOnFocus : true,
+                                                                        tpl : '<div class="x-grid-cell-text x-btn button"><b>{location_name}</b> </div>',
+                                                                        triggerAction : 'all',
+                                                                        typeAhead : false,
+                                                                        valueField : 'location_id',
+                                                                        width : 300,
+                                                                        store : {
+                                                                            xtype: 'Store',
+                                                                            xns: Roo.data,
+                                                                            listeners : {
+                                                                                beforeload : function (_self, o){
+                                                                                    o.params = o.params || {};
+                                                                                    
+                                                                                    o.params.location_netable = 1;
+                                                                                    o.params._notinternalcompany = 1; 
+                                                                                }
+                                                                            },
+                                                                            remoteSort : true,
+                                                                            sortInfo : { direction : 'ASC', field: 'location_name' },
+                                                                            proxy : {
+                                                                                xtype: 'HttpProxy',
+                                                                                xns: Roo.data,
+                                                                                method : 'GET',
+                                                                                url : baseURL + '/Roo/location.php'
+                                                                            },
+                                                                            reader : {
+                                                                                xtype: 'JsonReader',
+                                                                                xns: Roo.data,
+                                                                                id : 'location_id',
+                                                                                root : 'data',
+                                                                                totalProperty : 'total',
+                                                                                fields : [{"name":"location_id","type":"int"},"location_name"]
+                                                                            }
+                                                                        }
+                                                                    },
+                                                                    {
+                                                                        xtype: 'TextField',
+                                                                        xns: Roo.form,
+                                                                        fieldLabel : 'Notes',
+                                                                        name : 'recv_notes',
+                                                                        width : 300
+                                                                    }
+                                                                ]
+                                                            },
+                                                            {
+                                                                xtype: 'Column',
+                                                                xns: Roo.form,
+                                                                labelAlign : 'top',
+                                                                width : 350,
+                                                                items : [
+                                                                    {
+                                                                        xtype: 'TextArea',
+                                                                        xns: Roo.form,
+                                                                        allowBlank : false,
+                                                                        fieldLabel : 'Goods Receipt Number',
+                                                                        name : 'recvgrp_receipt_number',
+                                                                        width : 300
+                                                                    }
+                                                                ]
+                                                            }
+                                                        ]
+                                                    }
+                                                ]
+                                            },
+                                            {
+                                                xtype: 'Hidden',
+                                                xns: Roo.form,
+                                                name : 'recvgrp_pohead_id'
+                                            },
+                                            {
+                                                xtype: 'Hidden',
+                                                xns: Roo.form,
+                                                name : 'recvgrp_id',
+                                                value : 0
+                                            },
+                                            {
+                                                xtype: 'Hidden',
+                                                xns: Roo.form,
+                                                name : 'recvgrp_void'
+                                            },
+                                            {
+                                                xtype: 'Hidden',
+                                                xns: Roo.form,
+                                                name : 'recv_qtys',
+                                                value : 0
+                                            }
+                                        ]
                                     }
-                                    if (action.type =='submit') {
-                                    
+                                ]
+                            },
+                            {
+                                xtype: 'GridPanel',
+                                xns: Roo,
+                                listeners : {
+                                    activate : function() {
+                                        _this.panel = this;
                                          
-                                        _this.dialog.hide();
-                                    
-                                         if (_this.callback) {
-                                            _this.callback.call(_this, _this.form.getValues());
-                                         }
-                                         _this.form.reset();
-                                         return;
                                     }
                                 },
-                                rendered : function (form)
-                                {
-                                    _this.form= form;
-                                }
-                            },
-                            method : 'POST',
-                            style : 'margin:10px;',
-                            timeout : 120000,
-                            url : baseURL + '/Roo/recvgrp.php',
-                            items : [
-                                {
-                                    xtype: 'FieldSet',
-                                    xns: Roo.form,
-                                    legend : "Receipt Details",
-                                    items : [
+                                background : false,
+                                fitContainer : true,
+                                fitToframe : true,
+                                region : 'center',
+                                tableName : 'poitem',
+                                title : "poitem",
+                                grid : {
+                                    xtype: 'EditorGrid',
+                                    xns: Roo.grid,
+                                    listeners : {
+                                        render : function() 
+                                        {
+                                            _this.grid = this; 
+                                            //_this.dialog = Pman.Dialog.FILL_IN
+                                             
+                                        },
+                                        rowdblclick : function (_self, rowIndex, e)
                                         {
-                                            xtype: 'Row',
-                                            xns: Roo.form,
-                                            width : 800,
-                                            items : [
+                                            if (!_this.dialog) return;
+                                            _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
+                                                _this.grid.footer.onClick('first');
+                                            }); 
+                                        },
+                                        beforeedit : function (e)
+                                        {
+                                             if (_this.form.findField('recvgrp_id').getValue() * 1 > 0) {
+                                                Roo.MessageBox.alert("Error", "you can not modify the stock");
+                                                e.cancel = true;
+                                            }
+                                        }
+                                    },
+                                    autoExpandColumn : 'item_descrip1',
+                                    clicksToEdit : 1,
+                                    loadMask : true,
+                                    dataSource : {
+                                        xtype: 'Store',
+                                        xns: Roo.data,
+                                        listeners : {
+                                            beforeload : function (_self, o)
+                                            {
+                                                if (!_this.form ) {
+                                                    return false;
+                                                }
+                                                 o.params=  o.params || {};
+                                                 
+                                                o.params.poitem_pohead_id = _this.form.findField('recvgrp_pohead_id').getValue();
+                                                o.params._with_item = 1;
+                                                o.params.item_type = 'P';    
+                                                o.params.recvgrp_id = _this.form.findField('recvgrp_id').getValue();
+                                                o.params.limit = 3000;
+                                            }
+                                        },
+                                        remoteSort : true,
+                                        sortInfo : { field : 'poitem_linenumber', direction: 'ASC' },
+                                        proxy : {
+                                            xtype: 'HttpProxy',
+                                            xns: Roo.data,
+                                            method : 'GET',
+                                            timeout : 90000,
+                                            url : baseURL + '/Roo/poitem.php'
+                                        },
+                                        reader : {
+                                            xtype: 'JsonReader',
+                                            xns: Roo.data,
+                                            totalProperty : 'total',
+                                            root : 'data',
+                                            id : 'id',
+                                            fields : [
                                                 {
-                                                    xtype: 'Column',
-                                                    xns: Roo.form,
-                                                    width : 450,
-                                                    items : [
-                                                        {
-                                                            xtype: 'TextField',
-                                                            xns: Roo.form,
-                                                            fieldLabel : 'Order number',
-                                                            name : 'recvgrp_pohead_id_pohead_number',
-                                                            readOnly : true,
-                                                            width : 200
-                                                        },
-                                                        {
-                                                            xtype: 'DateField',
-                                                            xns: Roo.form,
-                                                            allowBlank : false,
-                                                            altFormats : 'Y-m-d',
-                                                            fieldLabel : 'Recv date',
-                                                            format : 'd/M/Y',
-                                                            name : 'recvgrp_date',
-                                                            width : 100,
-                                                            useIso : true
-                                                        },
-                                                        {
-                                                            xtype: 'ComboBox',
-                                                            xns: Roo.form,
-                                                            allowBlank : false,
-                                                            displayField : 'location_name',
-                                                            editable : true,
-                                                            emptyText : "Select location",
-                                                            fieldLabel : 'Delivered to',
-                                                            forceSelection : true,
-                                                            hiddenName : 'recvgrp_location_id',
-                                                            listWidth : 400,
-                                                            loadingText : "Searching...",
-                                                            minChars : 2,
-                                                            name : 'recvgrp_location_id_location_name',
-                                                            pageSize : 200,
-                                                            qtip : "Select terms",
-                                                            queryParam : 'query[location_name]',
-                                                            selectOnFocus : true,
-                                                            tpl : '<div class="x-grid-cell-text x-btn button"><b>{location_name}</b> </div>',
-                                                            triggerAction : 'all',
-                                                            typeAhead : false,
-                                                            valueField : 'location_id',
-                                                            width : 300,
-                                                            store : {
-                                                                xtype: 'Store',
-                                                                xns: Roo.data,
-                                                                listeners : {
-                                                                    beforeload : function (_self, o){
-                                                                        o.params = o.params || {};
-                                                                        
-                                                                        o.params.location_netable = 1;
-                                                                        o.params._notinternalcompany = 1; 
-                                                                    }
-                                                                },
-                                                                remoteSort : true,
-                                                                sortInfo : { direction : 'ASC', field: 'location_name' },
-                                                                proxy : {
-                                                                    xtype: 'HttpProxy',
-                                                                    xns: Roo.data,
-                                                                    method : 'GET',
-                                                                    url : baseURL + '/Roo/location.php'
-                                                                },
-                                                                reader : {
-                                                                    xtype: 'JsonReader',
-                                                                    xns: Roo.data,
-                                                                    id : 'location_id',
-                                                                    root : 'data',
-                                                                    totalProperty : 'total',
-                                                                    fields : [{"name":"location_id","type":"int"},"location_name"]
-                                                                }
-                                                            }
-                                                        },
-                                                        {
-                                                            xtype: 'TextField',
-                                                            xns: Roo.form,
-                                                            fieldLabel : 'Notes',
-                                                            name : 'recv_notes',
-                                                            width : 300
-                                                        }
-                                                    ]
+                                                    'name': 'poitem_id',
+                                                    'type': 'int'
                                                 },
                                                 {
-                                                    xtype: 'Column',
-                                                    xns: Roo.form,
-                                                    labelAlign : 'top',
-                                                    width : 350,
-                                                    items : [
-                                                        {
-                                                            xtype: 'TextArea',
-                                                            xns: Roo.form,
-                                                            allowBlank : false,
-                                                            fieldLabel : 'Goods Receipt Number',
-                                                            name : 'recvgrp_receipt_number',
-                                                            width : 300
-                                                        }
-                                                    ]
-                                                }
-                                            ]
-                                        }
-                                    ]
-                                },
-                                {
-                                    xtype: 'Hidden',
-                                    xns: Roo.form,
-                                    name : 'recvgrp_pohead_id'
-                                },
-                                {
-                                    xtype: 'Hidden',
-                                    xns: Roo.form,
-                                    name : 'recvgrp_id',
-                                    value : 0
-                                },
-                                {
-                                    xtype: 'Hidden',
-                                    xns: Roo.form,
-                                    name : 'recvgrp_void'
-                                },
-                                {
-                                    xtype: 'Hidden',
-                                    xns: Roo.form,
-                                    name : 'recv_qtys',
-                                    value : 0
-                                }
-                            ]
-                        }
-                    ]
-                },
-                {
-                    xtype: 'GridPanel',
-                    xns: Roo,
-                    listeners : {
-                        activate : function() {
-                            _this.panel = this;
-                             
-                        }
-                    },
-                    background : false,
-                    fitContainer : true,
-                    fitToframe : true,
-                    region : 'center',
-                    tableName : 'poitem',
-                    title : "poitem",
-                    grid : {
-                        xtype: 'EditorGrid',
-                        xns: Roo.grid,
-                        listeners : {
-                            render : function() 
-                            {
-                                _this.grid = this; 
-                                //_this.dialog = Pman.Dialog.FILL_IN
-                                 
-                            },
-                            rowdblclick : function (_self, rowIndex, e)
-                            {
-                                if (!_this.dialog) return;
-                                _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
-                                    _this.grid.footer.onClick('first');
-                                }); 
-                            },
-                            beforeedit : function (e)
-                            {
-                                 if (_this.form.findField('recvgrp_id').getValue() * 1 > 0) {
-                                    Roo.MessageBox.alert("Error", "you can not modify the stock");
-                                    e.cancel = true;
-                                }
-                            }
-                        },
-                        autoExpandColumn : 'item_descrip1',
-                        clicksToEdit : 1,
-                        loadMask : true,
-                        dataSource : {
-                            xtype: 'Store',
-                            xns: Roo.data,
-                            listeners : {
-                                beforeload : function (_self, o)
-                                {
-                                    if (!_this.form ) {
-                                        return false;
-                                    }
-                                     o.params=  o.params || {};
-                                     
-                                    o.params.poitem_pohead_id = _this.form.findField('recvgrp_pohead_id').getValue();
-                                    o.params._with_item = 1;
-                                    o.params.item_type = 'P';    
-                                    o.params.recvgrp_id = _this.form.findField('recvgrp_id').getValue();
-                                    o.params.limit = 3000;
-                                }
-                            },
-                            remoteSort : true,
-                            sortInfo : { field : 'poitem_linenumber', direction: 'ASC' },
-                            proxy : {
-                                xtype: 'HttpProxy',
-                                xns: Roo.data,
-                                method : 'GET',
-                                timeout : 90000,
-                                url : baseURL + '/Roo/poitem.php'
-                            },
-                            reader : {
-                                xtype: 'JsonReader',
-                                xns: Roo.data,
-                                totalProperty : 'total',
-                                root : 'data',
-                                id : 'id',
-                                fields : [
-                                    {
-                                        'name': 'poitem_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_status',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_pohead_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_linenumber',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_duedate',
-                                        'type': 'date',
-                                        'dateFormat': 'Y-m-d'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_vend_item_descrip',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_vend_uom',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_invvenduomratio',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_qty_ordered',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_qty_received',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_qty_returned',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_qty_vouchered',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_unitprice',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_vend_item_number',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_comments',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_qty_toreceive',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_expcat_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_freight',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_freight_received',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_freight_vouchered',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_soitem_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_prj_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_stdcost',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_bom_rev_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_boo_rev_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_manuf_name',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_manuf_item_number',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_manuf_item_descrip',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_taxtype_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_tax_recoverable',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_rlsd_duedate',
-                                        'type': 'date',
-                                        'dateFormat': 'Y-m-d'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_number',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_subnumber',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_status',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_itemsite_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_startdate',
-                                        'type': 'date'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_duedate',
-                                        'type': 'date'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_ordtype',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_ordid',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_qtyord',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_qtyrcv',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_adhoc',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_itemcfg_series',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_imported',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_wipvalue',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_postedvalue',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_prodnotes',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_prj_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_priority',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_brdvalue',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_bom_rev_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_boo_rev_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_cosmethod',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_womatl_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_wohead_id_wo_username',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_taxtype_id_taxtype_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_taxtype_id_taxtype_name',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_taxtype_id_taxtype_descrip',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_taxtype_id_taxtype_sys',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_prj_id_prj_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_prj_id_prj_number',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_prj_id_prj_name',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_prj_id_prj_descrip',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_prj_id_prj_status',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_prj_id_prj_so',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_prj_id_prj_wo',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_prj_id_prj_po',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_prj_id_prj_owner_username',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_prj_id_prj_start_date',
-                                        'type': 'date'
-                                    },
-                                    {
-                                        'name': 'poitem_prj_id_prj_due_date',
-                                        'type': 'date'
-                                    },
-                                    {
-                                        'name': 'poitem_prj_id_prj_assigned_date',
-                                        'type': 'date'
-                                    },
-                                    {
-                                        'name': 'poitem_prj_id_prj_completed_date',
-                                        'type': 'date'
-                                    },
-                                    {
-                                        'name': 'poitem_prj_id_prj_username',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_prj_id_prj_recurring_prj_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_item_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_item_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_vend_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_vend_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_vend_item_number',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_vend_item_descrip',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_comments',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_vend_uom',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_invvendoruomratio',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_minordqty',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_multordqty',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_leadtime',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_ranking',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_active',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_manuf_name',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_manuf_item_number',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_manuf_item_descrip',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_default',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsrc_id_itemsrc_upccode',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_item_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_warehous_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_qtyonhand',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_reorderlevel',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_ordertoqty',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_cyclecountfreq',
-                                        'type': 'int'
+                                                    'name': 'poitem_status',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_pohead_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_linenumber',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_duedate',
+                                                    'type': 'date',
+                                                    'dateFormat': 'Y-m-d'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_vend_item_descrip',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_vend_uom',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_invvenduomratio',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_qty_ordered',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_qty_received',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_qty_returned',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_qty_vouchered',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_unitprice',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_vend_item_number',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_comments',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_qty_toreceive',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_expcat_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_freight',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_freight_received',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_freight_vouchered',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_soitem_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_prj_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_stdcost',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_bom_rev_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_boo_rev_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_manuf_name',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_manuf_item_number',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_manuf_item_descrip',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_taxtype_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_tax_recoverable',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_rlsd_duedate',
+                                                    'type': 'date',
+                                                    'dateFormat': 'Y-m-d'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_number',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_subnumber',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_status',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_itemsite_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_startdate',
+                                                    'type': 'date'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_duedate',
+                                                    'type': 'date'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_ordtype',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_ordid',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_qtyord',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_qtyrcv',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_adhoc',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_itemcfg_series',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_imported',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_wipvalue',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_postedvalue',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_prodnotes',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_prj_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_priority',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_brdvalue',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_bom_rev_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_boo_rev_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_cosmethod',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_womatl_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_wohead_id_wo_username',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_taxtype_id_taxtype_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_taxtype_id_taxtype_name',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_taxtype_id_taxtype_descrip',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_taxtype_id_taxtype_sys',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_prj_id_prj_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_prj_id_prj_number',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_prj_id_prj_name',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_prj_id_prj_descrip',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_prj_id_prj_status',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_prj_id_prj_so',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_prj_id_prj_wo',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_prj_id_prj_po',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_prj_id_prj_owner_username',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_prj_id_prj_start_date',
+                                                    'type': 'date'
+                                                },
+                                                {
+                                                    'name': 'poitem_prj_id_prj_due_date',
+                                                    'type': 'date'
+                                                },
+                                                {
+                                                    'name': 'poitem_prj_id_prj_assigned_date',
+                                                    'type': 'date'
+                                                },
+                                                {
+                                                    'name': 'poitem_prj_id_prj_completed_date',
+                                                    'type': 'date'
+                                                },
+                                                {
+                                                    'name': 'poitem_prj_id_prj_username',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_prj_id_prj_recurring_prj_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_item_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_item_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_vend_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_vend_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_vend_item_number',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_vend_item_descrip',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_comments',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_vend_uom',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_invvendoruomratio',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_minordqty',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_multordqty',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_leadtime',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_ranking',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_active',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_manuf_name',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_manuf_item_number',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_manuf_item_descrip',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_default',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsrc_id_itemsrc_upccode',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_item_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_warehous_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_qtyonhand',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_reorderlevel',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_ordertoqty',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_cyclecountfreq',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_datelastcount',
+                                                    'type': 'date'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_datelastused',
+                                                    'type': 'date'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_loccntrl',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_safetystock',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_minordqty',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_multordqty',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_leadtime',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_abcclass',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_issuemethod',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_controlmethod',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_active',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_plancode_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_costcat_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_eventfence',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_sold',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_stocked',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_freeze',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_location_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_useparams',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_useparamsmanual',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_soldranking',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_createpr',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_location',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_location_comments',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_notes',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_perishable',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_nnqoh',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_autoabcclass',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_ordergroup',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_disallowblankwip',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_maxordqty',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_mps_timefence',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_createwo',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_warrpurc',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_autoreg',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_costmethod',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_value',
+                                                    'type': 'float'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_ordergroup_first',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_supply_itemsite_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_planning_type',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_wosupply',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_posupply',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_lsseq_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_cosdefault',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_createsopr',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_createsopo',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_itemsite_id_itemsite_dropship',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_expcat_id_expcat_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_expcat_id_expcat_code',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_expcat_id_expcat_descrip',
+                                                    'type': 'string'
+                                                },
+                                                {
+                                                    'name': 'poitem_expcat_id_expcat_exp_accnt_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_expcat_id_expcat_liability_accnt_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_expcat_id_expcat_active',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_expcat_id_expcat_purchprice_accnt_id',
+                                                    'type': 'int'
+                                                },
+                                                {
+                                                    'name': 'poitem_expcat_id_expcat_freight_accnt_id',
+                                                    'type': 'int'
+                                                }
+                                            ]
+                                        }
                                     },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_datelastcount',
-                                        'type': 'date'
+                                    toolbar : {
+                                        xtype: 'Toolbar',
+                                        xns: Roo,
+                                        items : [
+                                            {
+                                                xtype: 'Button',
+                                                xns: Roo.Toolbar,
+                                                listeners : {
+                                                    click : function()
+                                                    {
+                                                         // reset..
+                                                         _this.grid.load({});
+                                                    }
+                                                },
+                                                text : "Reset"
+                                            },
+                                            {
+                                                xtype: 'Fill',
+                                                xns: Roo.Toolbar
+                                            },
+                                            {
+                                                xtype: 'Button',
+                                                xns: Roo.Toolbar,
+                                                listeners : {
+                                                    click : function()
+                                                    {
+                                                         if (_this.form.findField('recvgrp_id').getValue() * 1 > 0) {
+                                                            Roo.MessageBox.alert("Error", "you can not modify the stock");
+                                                            return;
+                                                        }
+                                                         // reset..
+                                                         _this.grid.ds.each(function(r) {
+                                                            r.set('recv_qty',  r.data.poitem_qty_ordered - 
+                                                              r.data.poitem_qty_received + r.data.poitem_qty_returned
+                                                            );
+                                                        });
+                                                        
+                                                    }
+                                                },
+                                                cls : 'x-btn-text-icon',
+                                                text : "Recieve All",
+                                                icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
+                                            }
+                                        ]
                                     },
+                                    colModel : [
+                                        {
+                                            xtype: 'ColumnModel',
+                                            xns: Roo.grid,
+                                            dataIndex : 'poitem_linenumber',
+                                            header : 'Line#',
+                                            width : 50,
+                                            renderer : function(v) { return String.format('{0}', v); }
+                                        },
+                                        {
+                                            xtype: 'ColumnModel',
+                                            xns: Roo.grid,
+                                            dataIndex : 'item_number',
+                                            header : 'Item No.',
+                                            width : 75,
+                                            renderer : function(v) { return String.format('{0}', v); }
+                                        },
+                                        {
+                                            xtype: 'ColumnModel',
+                                            xns: Roo.grid,
+                                            dataIndex : 'item_descrip1',
+                                            header : 'Description',
+                                            width : 150,
+                                            renderer : function(v) { return String.format('{0}', v); }
+                                        },
+                                        {
+                                            xtype: 'ColumnModel',
+                                            xns: Roo.grid,
+                                            align : 'right',
+                                            dataIndex : 'poitem_qty_ordered',
+                                            header : 'Ordered',
+                                            width : 75,
+                                            renderer : function(v) { return String.format('{0}', v); }
+                                        },
+                                        {
+                                            xtype: 'ColumnModel',
+                                            xns: Roo.grid,
+                                            align : 'right',
+                                            dataIndex : 'poitem_qty_received',
+                                            header : 'Remaining',
+                                            width : 75,
+                                            renderer : function(v,x,r) {
+                                            
+                                                 var vv = r.data.poitem_qty_ordered - 
+                                                    r.data.poitem_qty_received + r.data.poitem_qty_returned;
+                                                 return String.format('{0}', parseInt(vv)); 
+                                                      
+                                             }
+                                        },
+                                        {
+                                            xtype: 'ColumnModel',
+                                            xns: Roo.grid,
+                                            align : 'right',
+                                            dataIndex : 'recv_qty',
+                                            header : 'Recieved',
+                                            width : 75,
+                                            renderer : function(v) { 
+                                            
+                                                var voided = _this.form.findField('recvgrp_void').getValue() * 1;
+                                                var format = voided ? '<s>{0}</s>' : '{0}';
+                                                return String.format(format , parseInt(v)); 
+                                            },
+                                            editor : {
+                                                xtype: 'GridEditor',
+                                                xns: Roo.grid,
+                                                field : {
+                                                    xtype: 'NumberField',
+                                                    xns: Roo.form,
+                                                    cls : 'align-right',
+                                                    decimalPrecision : 0
+                                                }
+                                            }
+                                        }
+                                    ]
+                                }
+                            }
+                        ],
+                        center : {
+                            xtype: 'LayoutRegion',
+                            xns: Roo
+                        },
+                        north : {
+                            xtype: 'LayoutRegion',
+                            xns: Roo,
+                            height : 160
+                        }
+                    }
+                },
+                {
+                    xtype: 'GridPanel',
+                    xns: Roo,
+                    listeners : {
+                        activate : function() {
+                            _this.hpanel = this;
+                            if (_this.hgrid) {
+                                _this.hgrid.footer.onClick('first');
+                            }
+                        }
+                    },
+                    background : true,
+                    fitContainer : true,
+                    fitToframe : true,
+                    region : 'center',
+                    tableName : 'events',
+                    title : "History",
+                    grid : {
+                        xtype: 'Grid',
+                        xns: Roo.grid,
+                        listeners : {
+                            render : function() 
+                            {
+                                _this.hgrid = this; 
+                                if (_this.hpanel.active) {
+                                   this.footer.onClick('first');
+                                }
+                            }
+                        },
+                        autoExpandColumn : 'remarks',
+                        loadMask : true,
+                        dataSource : {
+                            xtype: 'Store',
+                            xns: Roo.data,
+                            listeners : {
+                                beforeload : function (_self, options)
+                                {
+                                    options.params = options.params || {};
+                                    
+                                    options.params.on_table = 'recvgrp';
+                                    options.params.on_id = _this.form.findField('recvgrp_id').getValue();
+                                }
+                            },
+                            remoteSort : true,
+                            sortInfo : { field : 'event_when', direction: 'DESC' },
+                            proxy : {
+                                xtype: 'HttpProxy',
+                                xns: Roo.data,
+                                method : 'GET',
+                                url : baseURL + '/Roo/events.php'
+                            },
+                            reader : {
+                                xtype: 'JsonReader',
+                                xns: Roo.data,
+                                id : 'id',
+                                root : 'data',
+                                totalProperty : 'total',
+                                fields : [
                                     {
-                                        'name': 'poitem_itemsite_id_itemsite_datelastused',
+                                        'name': 'event_when',
                                         'type': 'date'
                                     },
                                     {
-                                        'name': 'poitem_itemsite_id_itemsite_loccntrl',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_safetystock',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_minordqty',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_multordqty',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_leadtime',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_abcclass',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_issuemethod',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_controlmethod',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_active',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_plancode_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_costcat_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_eventfence',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_sold',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_stocked',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_freeze',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_location_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_useparams',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_useparamsmanual',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_soldranking',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_createpr',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_location',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_location_comments',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_notes',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_perishable',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_nnqoh',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_autoabcclass',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_ordergroup',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_disallowblankwip',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_maxordqty',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_mps_timefence',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_createwo',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_warrpurc',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_autoreg',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_costmethod',
-                                        'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_value',
-                                        'type': 'float'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_ordergroup_first',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_supply_itemsite_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_planning_type',
+                                        'name': 'action',
                                         'type': 'string'
                                     },
                                     {
-                                        'name': 'poitem_itemsite_id_itemsite_wosupply',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_posupply',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_lsseq_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_cosdefault',
+                                        'name': 'ipaddr',
                                         'type': 'string'
                                     },
                                     {
-                                        'name': 'poitem_itemsite_id_itemsite_createsopr',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_createsopo',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_itemsite_id_itemsite_dropship',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_expcat_id_expcat_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_expcat_id_expcat_code',
+                                        'name': 'person_id_name',
                                         'type': 'string'
                                     },
                                     {
-                                        'name': 'poitem_expcat_id_expcat_descrip',
+                                        'name': 'remarks',
                                         'type': 'string'
-                                    },
-                                    {
-                                        'name': 'poitem_expcat_id_expcat_exp_accnt_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_expcat_id_expcat_liability_accnt_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_expcat_id_expcat_active',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_expcat_id_expcat_purchprice_accnt_id',
-                                        'type': 'int'
-                                    },
-                                    {
-                                        'name': 'poitem_expcat_id_expcat_freight_accnt_id',
-                                        'type': 'int'
                                     }
                                 ]
                             }
                         },
-                        toolbar : {
-                            xtype: 'Toolbar',
+                        footer : {
+                            xtype: 'PagingToolbar',
                             xns: Roo,
-                            items : [
-                                {
-                                    xtype: 'Button',
-                                    xns: Roo.Toolbar,
-                                    listeners : {
-                                        click : function()
-                                        {
-                                             // reset..
-                                             _this.grid.load({});
-                                        }
-                                    },
-                                    text : "Reset"
-                                },
-                                {
-                                    xtype: 'Fill',
-                                    xns: Roo.Toolbar
-                                },
-                                {
-                                    xtype: 'Button',
-                                    xns: Roo.Toolbar,
-                                    listeners : {
-                                        click : function()
-                                        {
-                                             if (_this.form.findField('recvgrp_id').getValue() * 1 > 0) {
-                                                Roo.MessageBox.alert("Error", "you can not modify the stock");
-                                                return;
-                                            }
-                                             // reset..
-                                             _this.grid.ds.each(function(r) {
-                                                r.set('recv_qty',  r.data.poitem_qty_ordered - 
-                                                  r.data.poitem_qty_received + r.data.poitem_qty_returned
-                                                );
-                                            });
-                                            
-                                        }
-                                    },
-                                    cls : 'x-btn-text-icon',
-                                    text : "Recieve All",
-                                    icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
-                                }
-                            ]
+                            displayInfo : true,
+                            displayMsg : "Displaying events{0} - {1} of {2}",
+                            emptyMsg : "No Events found",
+                            pageSize : 25
                         },
                         colModel : [
                             {
                                 xtype: 'ColumnModel',
                                 xns: Roo.grid,
-                                dataIndex : 'poitem_linenumber',
-                                header : 'Line#',
-                                width : 50,
-                                renderer : function(v) { return String.format('{0}', v); }
+                                dataIndex : 'event_when',
+                                header : 'Changed',
+                                width : 120,
+                                renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); }
                             },
                             {
                                 xtype: 'ColumnModel',
                                 xns: Roo.grid,
-                                dataIndex : 'item_number',
-                                header : 'Item No.',
-                                width : 75,
-                                renderer : function(v) { return String.format('{0}', v); }
+                                dataIndex : 'action',
+                                header : 'Action',
+                                width : 200,
+                                renderer : function(v,x,r) { return String.format('{0} - {1}', v, r.data.on_table); }
                             },
                             {
                                 xtype: 'ColumnModel',
                                 xns: Roo.grid,
-                                dataIndex : 'item_descrip1',
-                                header : 'Description',
-                                width : 150,
+                                dataIndex : 'ipaddr',
+                                header : 'IP Address',
+                                width : 200,
                                 renderer : function(v) { return String.format('{0}', v); }
                             },
                             {
                                 xtype: 'ColumnModel',
                                 xns: Roo.grid,
-                                align : 'right',
-                                dataIndex : 'poitem_qty_ordered',
-                                header : 'Ordered',
+                                dataIndex : 'person_id_name',
+                                header : 'Who',
                                 width : 75,
                                 renderer : function(v) { return String.format('{0}', v); }
                             },
                             {
                                 xtype: 'ColumnModel',
                                 xns: Roo.grid,
-                                align : 'right',
-                                dataIndex : 'poitem_qty_received',
-                                header : 'Remaining',
-                                width : 75,
-                                renderer : function(v,x,r) {
-                                
-                                     var vv = r.data.poitem_qty_ordered - 
-                                        r.data.poitem_qty_received + r.data.poitem_qty_returned;
-                                     return String.format('{0}', parseInt(vv)); 
-                                          
-                                 }
-                            },
-                            {
-                                xtype: 'ColumnModel',
-                                xns: Roo.grid,
-                                align : 'right',
-                                dataIndex : 'recv_qty',
-                                header : 'Recieved',
-                                width : 75,
-                                renderer : function(v) { 
-                                
-                                    var voided = _this.form.findField('recvgrp_void').getValue() * 1;
-                                    var format = voided ? '<s>{0}</s>' : '{0}';
-                                    return String.format(format , parseInt(v)); 
-                                },
-                                editor : {
-                                    xtype: 'GridEditor',
-                                    xns: Roo.grid,
-                                    field : {
-                                        xtype: 'NumberField',
-                                        xns: Roo.form,
-                                        cls : 'align-right',
-                                        decimalPrecision : 0
-                                    }
-                                }
+                                dataIndex : 'remarks',
+                                header : 'Notes',
+                                width : 200,
+                                renderer : function(v) { return String.format('{0}', v); }
                             }
                         ]
                     }
                 }
             ],
             center : {
-                xtype: 'LayoutRegion',
-                xns: Roo
-            },
-            north : {
                 xtype: 'LayoutRegion',
                 xns: Roo,
-                height : 150
+                tabPosition : 'top'
             },
             buttons : [
                 {
@@ -1098,36 +1254,15 @@ Pman.Dialog.XtupleRecvGrp = {
                     listeners : {
                         click : function (_self, e)
                         {
-                            if (!_this.form.findField('recvgrp_id').getValue()) {
-                                Roo.MessageBox.alert("Error", "Can not void this as it has not been saved");
-                                return;
-                            }
-                           
-                             if (1 * _this.form.findField('recvgrp_void').getValue()) {
-                                Roo.MessageBox.alert("Error", "This record is already void.");
-                                return;
-                            }
-                            new Pman.Request({
-                                mask : 'Voiding',
-                                method : 'POST',
-                                url : baseURL + '/Roo/Recvgrp',
-                                params : {
-                                    recvgrp_id : _this.form.findField('recvgrp_id').getValue(),
-                                    _void : 1
-                                },
-                                success : function() {
-                                      if (_this.callback) {
-                                        _this.callback.call(_this, _this.form.getValues());
-                                     }
-                                    _this.dialog.hide();
-                                }
-                            });
+                             new Pman.Download({
+                                grid : _this.grid
+                             });
                             
                            
                         
                         }
                     },
-                    text : "VOID"
+                    text : "Download"
                 },
                 {
                     xtype: 'Button',
@@ -1148,6 +1283,7 @@ Pman.Dialog.XtupleRecvGrp = {
                                 mask : 'Voiding',
                                 method : 'POST',
                                 url : baseURL + '/Roo/Recvgrp',
+                                timeout: 90000,
                                 params : {
                                     recvgrp_id : _this.form.findField('recvgrp_id').getValue(),
                                     _void : 1