Pman.Dialog.XtupleRecvGrp.bjs
authorAlan Knowles <alan@roojs.com>
Mon, 9 Dec 2013 10:49:14 +0000 (18:49 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 9 Dec 2013 10:49:14 +0000 (18:49 +0800)
Pman.Dialog.XtupleRecvGrp.js

Pman.Dialog.XtupleRecvGrp.bjs
Pman.Dialog.XtupleRecvGrp.js

index 12a1472..436b423 100644 (file)
                                     "*prop": "north",
                                     "xtype": "LayoutRegion",
                                     "|xns": "Roo"
+                                },
+                                {
+                                    "region": "north",
+                                    "xtype": "ContentPanel",
+                                    "|xns": "Roo",
+                                    "items": [
+                                        {
+                                            "listeners": {
+                                                "|actioncomplete": "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       //_this.dialog.el.mask(\"Loading\");\n       \n       if (_this.data.recvgrp_id) {\n           this.load({ method: 'GET', params: { '_id' : _this.data.recvgrp_id }});\n           return;\n       }\n       \n       if (!_this.data.recv_id) {\n           _this.data.recv_date = new Date();\n       }\n       _this.form.setValues(_this.data);\n\n        _this.grid.ds.load({});\n       //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n       return;\n    }\n    if (action.type == 'load') {\n        _this.grid.ds.load({});\n        \n        \n        \n        \n        \n        return;\n    }\n    if (action.type =='submit') {\n    \n         \n        _this.dialog.hide();\n    \n         if (_this.callback) {\n            _this.callback.call(_this, _this.form.getValues());\n         }\n         _this.form.reset();\n         return;\n    }\n}\n",
+                                                "|rendered": "function (form)\n{\n    _this.form= form;\n}\n"
+                                            },
+                                            "method": "POST",
+                                            "style": "margin:10px;",
+                                            "timeout": 120000,
+                                            "xtype": "Form",
+                                            "|url": "baseURL + '/Roo/recvgrp.php'",
+                                            "|xns": "Roo.form",
+                                            "items": [
+                                                {
+                                                    "legend": "Receipt Details",
+                                                    "xtype": "FieldSet",
+                                                    "|xns": "Roo.form",
+                                                    "items": [
+                                                        {
+                                                            "width": 800,
+                                                            "xtype": "Row",
+                                                            "|xns": "Roo.form",
+                                                            "items": [
+                                                                {
+                                                                    "width": 450,
+                                                                    "xtype": "Column",
+                                                                    "|xns": "Roo.form",
+                                                                    "items": [
+                                                                        {
+                                                                            "fieldLabel": "Order number",
+                                                                            "name": "recvgrp_pohead_id_pohead_number",
+                                                                            "readOnly": true,
+                                                                            "width": 200,
+                                                                            "xtype": "TextField",
+                                                                            "|xns": "Roo.form"
+                                                                        },
+                                                                        {
+                                                                            "allowBlank": false,
+                                                                            "altFormats": "Y-m-d",
+                                                                            "fieldLabel": "Recv date",
+                                                                            "format": "d/M/Y",
+                                                                            "name": "recvgrp_date",
+                                                                            "width": 100,
+                                                                            "xtype": "DateField",
+                                                                            "|useIso": "true",
+                                                                            "|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,
+                                                                            "xtype": "ComboBox",
+                                                                            "|xns": "Roo.form",
+                                                                            "items": [
+                                                                                {
+                                                                                    "listeners": {
+                                                                                        "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    \n    o.params.location_netable = 1;\n    o.params._notinternalcompany = 1; \n}\n"
+                                                                                    },
+                                                                                    "*prop": "store",
+                                                                                    "remoteSort": true,
+                                                                                    "xtype": "Store",
+                                                                                    "|sortInfo": "{ direction : 'ASC', field: 'location_name' }",
+                                                                                    "|xns": "Roo.data",
+                                                                                    "items": [
+                                                                                        {
+                                                                                            "*prop": "proxy",
+                                                                                            "method": "GET",
+                                                                                            "xtype": "HttpProxy",
+                                                                                            "|url": "baseURL + '/Roo/location.php'",
+                                                                                            "|xns": "Roo.data"
+                                                                                        },
+                                                                                        {
+                                                                                            "*prop": "reader",
+                                                                                            "id": "location_id",
+                                                                                            "root": "data",
+                                                                                            "totalProperty": "total",
+                                                                                            "xtype": "JsonReader",
+                                                                                            "|fields": "[{\"name\":\"location_id\",\"type\":\"int\"},\"location_name\"]",
+                                                                                            "|xns": "Roo.data"
+                                                                                        }
+                                                                                    ]
+                                                                                }
+                                                                            ]
+                                                                        },
+                                                                        {
+                                                                            "fieldLabel": "Notes",
+                                                                            "name": "recv_notes",
+                                                                            "width": 300,
+                                                                            "xtype": "TextField",
+                                                                            "|xns": "Roo.form"
+                                                                        }
+                                                                    ]
+                                                                },
+                                                                {
+                                                                    "labelAlign": "top",
+                                                                    "width": 350,
+                                                                    "xtype": "Column",
+                                                                    "|xns": "Roo.form",
+                                                                    "items": [
+                                                                        {
+                                                                            "allowBlank": false,
+                                                                            "fieldLabel": "Goods Receipt Number",
+                                                                            "name": "recvgrp_receipt_number",
+                                                                            "width": 300,
+                                                                            "xtype": "TextArea",
+                                                                            "|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": "Hidden",
+                                                    "|xns": "Roo.form"
+                                                }
+                                            ]
+                                        }
+                                    ]
                                 }
                             ]
                         }
index 585ae3c..f9ff80c 100644 (file)
@@ -44,6 +44,208 @@ Pman.Dialog.XtupleRecvGrp = {
                     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
+                                            }
+                                        ]
+                                    }
+                                ]
+                            }
+                        ],
                         center : {
                             xtype: 'LayoutRegion',
                             xns: Roo