{ "name" : "Pman.Tab.XtupleGeneralLedger", "parent" : "Pman.Tab.XtupleAccountsTab", "title" : "", "path" : "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleGeneralLedger.bjs", "permname" : "", "modOrder" : "100", "items" : [ { "fitToFrame" : true, "background" : true, "region" : "center", "title" : "General Ledger", "xtype" : "NestedLayoutPanel", "fitContainer" : true, "$ xns" : "Roo", "items" : [ { "xtype" : "BorderLayout", "$ xns" : "Roo", "* prop" : "layout", "items" : [ { "xtype" : "LayoutRegion", "tabPosition" : "top", "$ xns" : "Roo", "* prop" : "center" }, { "xtype" : "LayoutRegion", "tabPosition" : "top", "width" : 600, "$ xns" : "Roo", "split" : true, "* prop" : "west" }, { "listeners" : { "|activate" : "function() {\n _this.wpanel = this;\n if (_this.wgrid) {\n _this.wgrid.ds.load({});\n }\n}" }, "fitToframe" : true, "background" : false, "region" : "west", "title" : "Account", "xtype" : "GridPanel", "fitContainer" : true, "$ xns" : "Roo", "tableName" : "accnt", "items" : [ { "listeners" : { "rowdblclick" : "function (_self, rowIndex, e)\n{\n var ret = _this.wgrid.ds.getAt(rowIndex).data;\n if(ret.accnt_id * 1 < 1){\n Roo.MessageBox.alert(\"Error\", \"Error occur on getting the account id!\");\n return;\n }\n Pman.Dialog.XtupleGLAccountNameEdit.show( {accnt_id : ret.accnt_id}, function() {\n _this.wgrid.ds.load({});\n }); \n}", "|render" : "function() \n{\n _this.wgrid = this; \n _this.active = 1;\n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.wpanel.active) {\n this.ds.load({});\n }\n}", "rowclick" : "function (_self, rowIndex, e)\n{\n var s = _this.wgrid.ds.getAt(rowIndex);\n \n if(s.data.accnt_id * 1 < 1){\n return;\n }\n \n _this.grid.footer.onClick('first');\n \n \n}" }, "autoExpandColumn" : "accnt_descrip", "xtype" : "Grid", "loadMask" : true, "$ xns" : "Roo.grid", "* prop" : "grid", "items" : [ { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "listeners" : { "specialkey" : "function (_self, e)\n{\n _this.wgrid.ds.load({});\n}", "render" : "function (_self)\n{\n _this.searchBox = _self;\n}" }, "xtype" : "TextField", "$ xns" : "Roo.form", "width" : 100 }, { "listeners" : { "click" : "function (_self, e)\n{\n _this.wgrid.ds.load({});\n}" }, "xtype" : "Button", "cls" : "x-btn-icon", "$ icon" : "rootURL + '/Pman/templates/images/search.gif'", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "click" : "function (_self, e)\n{\n _this.searchBox.setValue('');\r\n _this.wgrid.ds.load({});\r\n}" }, "xtype" : "Button", "cls" : "x-btn-icon", "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "render" : "function (_self)\r\n{\r\n _this.dateSel = _self;\r\n _self.setValue( new Date() );\r\n}", "select" : "function (combo, date)\n{\n _this.wgrid.ds.load({});\n}" }, "format" : "d/M/Y", "xtype" : "DateField", "allowBlank" : false, "width" : 100, "$ xns" : "Roo.form" }, { "xtype" : "Fill", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "render" : "function (_self)\n{\n _this.orderBox = _self;\n}" }, "xtype" : "TextField", "$ xns" : "Roo.form", "width" : 80 }, { "text" : "Download / Upload", "xtype" : "Button", "$ xns" : "Roo.Toolbar", "items" : [ { "xtype" : "Menu", "$ xns" : "Roo.menu", "* prop" : "menu", "items" : [ { "listeners" : { "click" : "function (_self, e)\n{\n _this.active = (_this.active) ? 0 : 1;\n this.setText(_this.active ? \"Show Inactive\" : \"Hide Inactive\");\n _this.wgrid.ds.load({});\n}" }, "text" : "Show Inactive", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "xtype" : "Separator", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n \n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n method : 'GET',\n timeout: 60000,\n newWindow : true,\n params : {\n _group : 'accnt',\n _name : 'export',\n csvCols : '*',\n csvTitles : '*', \n limit : 9999 \n \n }\n });;\n Roo.MessageBox.alert(\"Notice\", \"Downloading\");\n}" }, "text" : "Export Account Details", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n \n new Pman.download({\n url : baseURL + '/Roo/accnt.php',\n method : 'GET',\n params : {\n 'start' : 0,\n 'limit' : 9999,\n _with_xt_balances : 1,\n 'csvTitles[0]' : 'Name', 'csvCols[0]' : 'accnt_name',\n 'csvTitles[1]' : 'Description', 'csvCols[1]' : 'accnt_descrip',\n 'csvTitles[2]' : 'Alternative Code', 'csvCols[2]' : 'accnt_code_alt',\n 'csvTitles[3]' : 'Alternative Description', 'csvCols[3]' : 'accnt_code_descrip',\n 'csvTitles[4]' : 'ADJUST', 'csvCols[4]' : 'balance_base'\n }\n \n });\n}" }, "text" : "Download Balances", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "xtype" : "Separator", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n Pman.Dialog.XtupleUploadBalances.show( {} , function(res) {\n Pman.Dialog.Image.show({\n _url : baseURL + '/Xtuple/Import/JournalEntry?' + Roo.urlEncode(res)\n }, function(data) {\n _this.wgrid.ds.load({});\n });\n }); \n}" }, "text" : "Upload JE adjustment", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n Pman.Dialog.Image.show(\n {\n _url : baseURL+'/Xtuple/Import/Accounts',\n timeout : 90000\n \n },\n function (data) {\n Roo.MessageBox.alert(\"Notice\", data); \n _this.grid.footer.onClick('first');\n\n }\n );\n}" }, "text" : "Upload Account Details", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "xtype" : "Separator", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n \n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n method : 'GET',\n timeout: 60000,\n newWindow : true,\n params : {\n _group : 'apopen',\n _name : 'bydate',\n csvCols : '*',\n csvTitles : '*', \n limit : 9999 \n \n }\n });;\n Roo.MessageBox.alert(\"Notice\", \"This may take some time to calculate\");\n}" }, "text" : "Download AP - Day by Day Comparison", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n \n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n method : 'GET',\n timeout: 90000,\n params : {\n _group : 'apopen',\n _name : 'bydatesummary',\n csvCols : '*',\n csvTitles : '*', \n limit : 9999 \n \n }\n });;\n Roo.MessageBox.alert(\"Notice\", \"This may take some time to calculate\");\n}" }, "text" : "Download AP open vs GL - summary of bad days", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n \n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n method : 'GET',\n timeout: 90000,\n params : {\n 'startDate:text' : _this.dateSel.getValue().format('Y-m-d'),\n 'endDate:text' : _this.dateSel.getValue().add(Date.DAY,1).format('Y-m-d'),\n \n _group : 'apopen',\n _name : 'all',\n csvCols : '*',\n csvTitles : '*', \n limit : 9999 \n \n }\n });;\n Roo.MessageBox.alert(\"Notice\", \"This may take some time to calculate\");\n}" }, "text" : "Download AP - Transactions on a single day", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n \n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n method : 'GET',\n timeout: 90000,\n newWindow : 1,\n params : {\n 'relDate:text' : _this.dateSel.getValue().format('Y-m-d'),\n 'useDocDate:text' : 'FALSE',\n \n _group : 'apAging',\n _name : 'bydate',\n csvCols : '*',\n csvTitles : '*', \n limit : 9999 \n \n }\n });;\n Roo.MessageBox.alert(\"Notice\", \"This may take some time to calculate\");\n}\n " }, "text" : "Download AP Aging at this date", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n \n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n method : 'GET',\n timeout: 90000,\n params : {\n 'relDate:text' : _this.dateSel.getValue().format('Y-m-d'),\n \n _group : 'apopen',\n _name : 'history',\n csvCols : '*',\n csvTitles : '*', \n limit : 9999 \n \n }\n });\n Roo.MessageBox.alert(\"Notice\", \"This may take some time to calculate\");\n}\n " }, "text" : "Download AP Aging Comparison back from this date", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "xtype" : "Separator", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n \n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n method : 'GET',\n params : {\n _group : 'aropen',\n _name : 'all',\n 'startDate:text' : _this.dateSel.getValue().format('Y-m-d'),\n 'endDate:text' : _this.dateSel.getValue().add(Date.DAY,1).format('Y-m-d'),\n csvCols : '*',\n csvTitles : '*', \n limit : 9999 \n \n }\n });;\n}" }, "text" : "Download AR - Transactions on a day", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n \n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n method : 'GET',\n params : {\n _group : 'aropen',\n _name : 'bydate',\n csvCols : '*',\n csvTitles : '*', \n limit : 9999 \n \n }\n });;\n}" }, "text" : "Download AR - Day by Day Comparison", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "xtype" : "Separator", "$ xns" : "Roo.menu" }, { "text" : "Gltrans vs Stock (COHEAD)", "xtype" : "Item", "$ xns" : "Roo.menu", "items" : [ { "xtype" : "Menu", "$ xns" : "Roo.menu", "* prop" : "menu", "items" : [ { "listeners" : { "click" : "function (_self, e)\n{\n \n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n method : 'GET',\n timeout: 600000,\n params : {\n _group : 'gltrans_stock',\n _name : 'bydate',\n csvCols : '*',\n csvTitles : '*', \n limit : 9999 \n }\n });\n}" }, "text" : "Download Gltrans vs Stock By Date", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n \n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n method : 'GET',\n timeout: 600000,\n params : {\n _group : 'gltrans_stock',\n _name : 'bycohead',\n csvCols : '*',\n csvTitles : '*', \n limit : 9999 \n }\n });\n}" }, "text" : "Download Gltrans vs Sales Order", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n var dt = _this.dateSel.getValue();\n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n method : 'GET',\n params : {\n _group : 'gltrans_stock',\n _name : 'gltrans',\n '_as_of:text' : typeof(dt) == 'string' ? dt : dt.format('Y-m-d'),\n csvCols : '*',\n csvTitles : '*', \n limit : 9999 \n }\n });\n}" }, "text" : "Download Gltrans", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n var dt = _this.dateSel.getValue();\n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n method : 'GET',\n params : {\n _group : 'gltrans_stock',\n _name : 'stock',\n '_as_of:text' : typeof(dt) == 'string' ? dt : dt.format('Y-m-d'),\n csvCols : '*',\n csvTitles : '*', \n limit : 9999 \n }\n });\n}" }, "text" : "Download Stock", "xtype" : "Item", "$ xns" : "Roo.menu" } ] } ] }, { "xtype" : "Separator", "$ xns" : "Roo.menu" }, { "text" : "Gltrans vs Stock (PO)", "xtype" : "Item", "$ xns" : "Roo.menu", "items" : [ { "xtype" : "Menu", "$ xns" : "Roo.menu", "* prop" : "menu", "items" : [ { "listeners" : { "click" : "function (_self, e)\n{\n \n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n method : 'GET',\n timeout: 600000,\n params : {\n _group : 'gltrans_stock',\n _name : 'byorder',\n csvCols : '*',\n csvTitles : '*', \n limit : 9999 \n }\n });\n}" }, "text" : "Download Gltrans vs Stock By PO", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n var ord = _this.orderBox.getValue();\n \n if(!ord.length){\n Roo.MessageBox.alert('Error','Please enter a PO number');\n return;\n }\n \n \n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n method : 'GET',\n params : {\n _group : 'gltrans_stock',\n _name : 'byordergltrans',\n 'docnumber:text' : ord,\n csvCols : '*',\n csvTitles : '*', \n limit : 9999 \n }\n });\n}" }, "text" : "Download Gltrans", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n var ord = _this.orderBox.getValue();\n \n if(!ord.length){\n Roo.MessageBox.alert('Error','Please enter a PO number');\n return;\n }\n \n \n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n method : 'GET',\n params : {\n _group : 'gltrans_stock',\n _name : 'byorderstock',\n 'docnumber:text' : ord,\n csvCols : '*',\n csvTitles : '*', \n limit : 9999 \n }\n });\n}" }, "text" : "Download Stock", "xtype" : "Item", "$ xns" : "Roo.menu" } ] } ] }, { "xtype" : "Separator", "$ xns" : "Roo.menu" }, { "text" : "Kingdee", "xtype" : "Item", "$ xns" : "Roo.menu", "items" : [ { "xtype" : "Menu", "$ xns" : "Roo.menu", "* prop" : "menu", "items" : [ { "listeners" : { "click" : "function (_self, e)\n{\n \n new Pman.Download({\n url : baseURL+'/Xtuple/Kingdee/Currency',\n method : 'GET',\n timeout: 600000\n });\n Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}" }, "text" : "Currency", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n \n new Pman.Download({\n url : baseURL+'/Xtuple/Kingdee/Rate',\n method : 'GET',\n timeout: 600000\n });\n Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}" }, "text" : "Exchange Rate", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n \n new Pman.Download({\n url : baseURL+'/Xtuple/Kingdee/Account',\n method : 'GET',\n timeout: 600000\n });\n Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}" }, "text" : "Accounts", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n new Pman.Download({\n url : baseURL+'/Xtuple/Kingdee/VoucherGroup',\n method : 'GET',\n timeout: 600000\n });\n Roo.MessageBox.alert(\"Notice\", \"Report will download shortly\");\n}" }, "text" : "Voucher Category", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n var dt = _this.dateSel.getValue();\n new Pman.Download({\n url : baseURL+'/Xtuple/Kingdee/Voucher',\n method : 'GET',\n timeout: 600000,\n params : {\n _as_of : (typeof(dt) == 'string') ? dt : dt.format('Y-m-d')\n }\n });\n Roo.MessageBox.alert(\"Notice\", \"Report will download shortly - If you wanna import again, please delete all the exist!\");\n}" }, "text" : "Transactions", "xtype" : "Item", "$ xns" : "Roo.menu" } ] } ] } ] } ] } ] }, { "listeners" : { "beforeload" : "function (_self, options)\n{\n options.params = options.params || {};\n \n options.params.limit = 9999;\n \n options.params._general_ledger = 1;\n \n options.params['search[name]'] = _this.searchBox.getValue();\n \n if (_this.active) {\r\n options.params.accnt_active = 1;\n options.params._with_balances = 1;\r\n }\n \n \n \r var dt = _this.dateSel.getValue();\r\n options.params._as_of = typeof(dt) == 'string' ? dt : dt.format('Y-m-d');\n \n\n}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field : 'accnt_name', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "dataSource", "items" : [ { "listeners" : { "loadexception" : "function (This, o, arg, e)\n{\n\n}" }, "$ url" : "baseURL + '/Roo/accnt.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "accnt_id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n {\n 'name': 'accnt_id',\n 'type': 'int'\n },\n {\n 'name': 'accnt_name',\n 'type': 'string'\n },\n {\n 'name': 'accnt_descrip',\n 'type': 'string'\n },\n {\n 'name': 'accnt_type',\n 'type': 'string'\n },\n {\n 'name': 'accnt_subaccnttype_code',\n 'type': 'string'\n },\n {\n 'name': 'accnt_curr_id_curr_name',\n 'type': 'string'\n },\n {\n 'name': 'accnt_curr_id_curr_id',\n 'type': 'int'\n }\n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] }, { "xtype" : "ColumnModel", "sortable" : true, "header" : "Name", "width" : 100, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "accnt_name" }, { "hidden" : true, "xtype" : "ColumnModel", "sortable" : true, "header" : "Alternative Code", "width" : 50, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "accnt_code_alt" }, { "hidden" : true, "xtype" : "ColumnModel", "sortable" : true, "header" : "Alternative Description", "width" : 50, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "accnt_descrip_alt" }, { "xtype" : "ColumnModel", "sortable" : true, "header" : "Type", "width" : 50, "$ renderer" : "function(v,x,r) {\n return String.format('{0}-{1}', v,r.data.accnt_subaccnttype_code); \n }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "accnt_type" }, { "xtype" : "ColumnModel", "sortable" : true, "header" : "Description", "width" : 200, "$ renderer" : "function(v,x,r) \n{ \n if(r.data.accnt_descrip_alt){\n return String.format('{0} ({1})', v, r.data.accnt_descrip_alt); \n }\n \n return String.format('{0}', v); \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "accnt_descrip" }, { "align" : "right", "xtype" : "ColumnModel", "sortable" : true, "header" : "Currency", "width" : 50, "$ renderer" : "function(v) { \n var base = baseURL.match(/sg\\.php$/) ? 'SGD' : 'HKD';\n if (v != base) {\n return String.format('{0}', v); \n }\n\n return String.format('{0}', v); \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "accnt_curr_id_curr_name" }, { "xtype" : "ColumnModel", "sortable" : true, "header" : "Balance", "width" : 100, "$ renderer" : "function(v) { \r\n return String.format('{0}',\r\n Roo.util.Format.usMoney(v) ); \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "balance" } ] } ] }, { "listeners" : { "|activate" : "function() {\n _this.panel = this;\n /* if (_this.grid) {\n _this.grid.ds.load({});\n } */\n}" }, "fitToframe" : true, "background" : false, "region" : "center", "title" : "Transactions", "xtype" : "GridPanel", "fitContainer" : true, "$ xns" : "Roo", "tableName" : "gltrans", "items" : [ { "listeners" : { "|render" : "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n /* if (_this.panel.active) {\n this.ds.load({});\n } */\n}", "celldblclick" : "function (_self, rowIndex, columnIndex, e)\n{\n var cm = this.colModel.config[columnIndex].dataIndex;\n var r = this.ds.getAt(rowIndex);\n if (cm != 'gltrans_date') {\n return;\n }\n new Pman.Download({\n url : baseURL+ '/Roo/Metasql',\n method : 'GET',\n params : {\n _group : 'gltrans',\n _name : 'sequence',\n 'gltrans_sequence:number' : r.data.gltrans_sequence,\n limit : 9999\n }\n });\n \n}", "cellclick" : "function (_self, rowIndex, columnIndex, e)\n{\n if (!Roo.get(e.getTarget()).hasClass('dragon-ref-accounts')) {\n return;\n }\n var r = this.ds.getAt(rowIndex);\n Pman.Dialog.XtupleJournalEntry.show({\n gltrans_id : r.data.gltrans_id\n }, function()\n {\n // no need to refresh as it's viewed only?\n });\n \n \n}", "rowclass" : "function (gridview, rowcfg)\n{\n rowcfg.rowClass = 'dragon-gl-fixedheight';\n}", "afteredit" : "function (e)\n{ \n var r = _this.grid.ds.getAt(e.row);\n \n if(e.value == e.originalValue || !r){\n return;\n }\n\n new Pman.Request({\n url : baseURL + '/Roo/Gltrans.php',\n method :'POST',\n params : {\n gltrans_id : r.data.gltrans_id,\n gltrans_notes : e.value,\n _update_notes : 1\n \n },\n success : function() {\n \n _this.grid.footer.onClick('refresh');\n \n }\n });\n \n}" }, "autoExpandColumn" : "gltrans_notes", "xtype" : "EditorGrid", "loadMask" : true, "clicksToEdit" : 2, "$ xns" : "Roo.grid", "* prop" : "grid", "items" : [ { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "listeners" : { "specialkey" : "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}", "render" : "function (_self)\n{\n _this.gltransBox = _self;\n}" }, "xtype" : "TextField", "$ xns" : "Roo.form" }, { "listeners" : { "render" : "function (_self)\n{\n _this.sourceCombo = _self;\n}", "select" : "function (combo, record, index)\n{\n Roo.log('select');\n _this.grid.footer.onClick('first');\n}" }, "listWidth" : 200, "triggerAction" : "all", "displayField" : "gltrans_source_name", "hiddenName" : "gltrans_source", "value" : "ALL", "valueField" : "gltrans_source", "xtype" : "ComboBox", "allowBlank" : false, "editable" : false, "width" : 150, "$ xns" : "Roo.form", "mode" : "local", "name" : "gltrans_source_name", "tpl" : "
{gltrans_source_name}
", "items" : [ { "xtype" : "SimpleStore", "$ data" : "[ \n [ 'ALL', \"All Transactions\"],\n [ 'S/R' , \"Sales Return\"],\n [ 'S/O', \"Sales Orders\"] ,\n [ 'A/P', \"Accounts Payable\"] ,\n [ 'A/R', \"Accounts Recievable\"] ,\n [ 'I/M', \"Inventory \"] ,\n [ 'G/L', \"General Ledger \"] \n \n \n]\n", "$ fields" : "[ 'gltrans_source', 'gltrans_source_name']", "$ xns" : "Roo.data", "* prop" : "store" } ] }, { "listeners" : { "click" : "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}" }, "xtype" : "Button", "cls" : "x-btn-icon", "$ icon" : "rootURL + '/Pman/templates/images/search.gif'", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "click" : "function (_self, e)\n{\n _this.gltransBox.setValue('');\r\n _this.grid.footer.onClick('first');\r\n}" }, "xtype" : "Button", "cls" : "x-btn-icon", "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'", "$ xns" : "Roo.Toolbar" }, { "xtype" : "Fill", "$ xns" : "Roo.Toolbar" }, { "text" : "Download", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ icon" : "rootURL + '/Pman/templates/images/spreadsheet.gif'", "$ xns" : "Roo.Toolbar", "items" : [ { "xtype" : "Menu", "$ xns" : "Roo.menu", "* prop" : "menu", "items" : [ { "listeners" : { "click" : "function (_self, e)\n{\n \n new Pman.Download({\n grid : _this.grid,\n csvCols : '*',\n csvTitles : '*',\n method : 'GET'\n });\n \n Roo.MessageBox.alert(\"Notice\", \"Search Transactions Report for \" + s.data.accnt_descrip + \" will download shortly\");\n}" }, "text" : "Transactions from search result", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "xtype" : "Separator", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n var s = _this.wgrid.getSelectionModel().getSelected();\n \n if(!s){\n Roo.MessageBox.alert(\"Error\", \"Please select a account\"); \n return false;\n }\n \n var dt = _this.dateSel.getValue();\n \n if(!dt){\n Roo.MessageBox.alert(\"Error\", \"Please select a date on the right\"); \n return false;\n } \n \n var g = _this.gltransBox.getValue();\n \n var params = {\n '_group' : 'account',\n '_name' : 'summary',\n 'limit' : 99999,\n 'accnt_id:number' : s.data.accnt_id,\n 'endDate:text' : typeof(dt) == 'string' ? dt : dt.format('Y-m-d'),\n 'csvTitles' : '*',\n 'csvCols' : '*'\n };\n \n if(g.length){\n params['search:text'] = g;\n }\n \n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n params : params,\n method : 'GET'\n });\n \n Roo.MessageBox.alert(\"Notice\", \"All Transactions Report for \" + s.data.accnt_descrip + \" will download shortly\");\n}" }, "text" : "All Transactions", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{\n var s = _this.wgrid.getSelectionModel().getSelected();\n \n if(!s){\n Roo.MessageBox.alert(\"Error\", \"Please select a account\"); \n return false;\n }\n \n var dt = _this.dateSel.getValue();\n \n if(!dt){\n Roo.MessageBox.alert(\"Error\", \"Please select a date on the right\"); \n return false;\n } \n \n new Pman.Download({\n url : baseURL + '/Roo/Gltrans.php',\n method :'GET',\n params : {\n gltrans_accnt_id : s.data.accnt_id,\n _as_of : typeof(dt) == 'string' ? dt : dt.format('Y-m-d'),\n _download : 1\n }\n });\n \n Roo.MessageBox.alert(\"Notice\", \"Financial Year Report for \" + s.data.accnt_descrip + \" will download shortly\");\n}" }, "text" : "All Transactions (Selected Financial Year)", "xtype" : "Item", "$ xns" : "Roo.menu" }, { "listeners" : { "click" : "function (_self, e)\n{ \n var dt = _this.dateSel.getValue();\n \n if(!dt){\n Roo.MessageBox.alert(\"Error\", \"Please select a date on the right\"); \n return false;\n } \n \n new Pman.Download({\n url : baseURL + '/Roo/Gltrans.php',\n method :'GET',\n timeout : 900000,\n params : {\n _as_of : typeof(dt) == 'string' ? dt : dt.format('Y-m-d'),\n _download : 1\n }\n });\n \n Roo.MessageBox.alert(\"Notice\", \"Financial Year Report for all accounts will download shortly! it might take several minutes\");\n}" }, "text" : "All Transactions / All Accounts (Selected Financial Year)", "xtype" : "Item", "$ xns" : "Roo.menu" } ] } ] } ] }, { "listeners" : { "beforeload" : "function (_self, options)\n{\n options.params = options.params || {};\n \n var s = _this.wgrid.getSelectionModel().getSelected();\n \n if(!s){\n return;\n }\n \n var dt = _this.dateSel.getValue();\n var g = _this.gltransBox.getValue();\n \n var params = {\n _group : 'account',\n _name : 'summary',\n 'accnt_id:number' : s.data.accnt_id,\n 'endDate:text' : typeof(dt) == 'string' ? dt : dt.format('Y-m-d')\n };\n \n // can not do source + search..\n var source = _this.sourceCombo.getValue();\n if (source != 'ALL') {\n params['search:text'] = source;\n }\n \n if(g.length){\n params['search:text'] = g;\n }\n \n Roo.apply(options.params,params);\n \n var cm = _this.grid.getColumnModel();\n var hide = (g.length) ? true : false;\n \n cm.setHidden(cm.getIndexByDataIndex('gltrans_balance'), hide);\n \n \n}" }, "xtype" : "Store", "remoteSort" : true, "$ xns" : "Roo.data", "* prop" : "dataSource", "items" : [ { "$ url" : "baseURL + '/Roo/Metasql.php'", "method" : "GET", "xtype" : "HttpProxy", "timeout" : 600000, "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "gltrans_id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n {\n 'name': 'gltrans_id',\n 'type': 'int'\n },\n {\n 'name': 'gltrans_accnt_id',\n 'type': 'int'\n },\n {\n 'name': 'gltrans_source',\n 'type': 'string'\n },\n {\n 'name': 'gltrans_amount',\n 'type': 'int'\n },\n {\n 'name': 'gltrans_notes',\n 'type': 'string'\n }\n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] }, { "pageSize" : 100, "xtype" : "PagingToolbar", "$ xns" : "Roo", "* prop" : "footer", "items" : [ { "text" : "Double Click To Edit", "xtype" : "TextItem", "$ xns" : "Roo.Toolbar" } ] }, { "xtype" : "ColumnModel", "sortable" : true, "header" : "Date", "width" : 100, "$ renderer" : "function(v,x,r) { \n return String.format('{0}
{1}',\n v ? v : '', r.data.gltrans_sequence\n ); \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "gltrans_date" }, { "hidden" : true, "xtype" : "ColumnModel", "sortable" : true, "header" : "Date", "width" : 100, "$ renderer" : "function(v,x,r) { \n return String.format('{0}', v); \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "gltrans_created" }, { "xtype" : "ColumnModel", "sortable" : true, "header" : "Source / Who", "width" : 100, "$ renderer" : "function(v,x,r) { \n return String.format('{0} - {1}
{2} {3}',\n \n v,r.data.gltrans_doctype, \n r.data.gltrans_username,\n r.data.gltrans_created);\n }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "gltrans_source" }, { "hidden" : true, "xtype" : "ColumnModel", "sortable" : true, "header" : "Doc Number", "width" : 100, "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "gltrans_docnumber" }, { "xtype" : "ColumnModel", "header" : "Account / Notes", "width" : 200, "$ renderer" : "function(v,x,r) \n{ \n return String.format(\n '{3} - {0}' + \"\\n\" + '{1}', \n r.data.gltrans_docnumber,\n v, \n v.split('\\n').join('
'),\n r.data.related_accounts\n \n ).split('\\n').join('
');\n \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "gltrans_notes", "items" : [ { "xtype" : "GridEditor", "$ xns" : "Roo.grid", "* prop" : "editor", "items" : [ { "xtype" : "TextArea", "$ xns" : "Roo.form", "* prop" : "field" } ] } ] }, { "align" : "right", "xtype" : "ColumnModel", "sortable" : true, "header" : "Currency", "width" : 75, "$ renderer" : "function(v) { \n return String.format('{0}', v); \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "gltrans_base_curr" }, { "align" : "right", "xtype" : "ColumnModel", "sortable" : true, "header" : "Credit", "width" : 100, "$ renderer" : "function(v,x,r) { \n return String.format('{0}', v ? Roo.util.Format.number(v*1,2) : '' );\n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "gltrans_credit_amount" }, { "align" : "right", "xtype" : "ColumnModel", "sortable" : true, "header" : "Debit", "width" : 100, "$ renderer" : "function(v,x,r) { \n return String.format('{0}', v ? Roo.util.Format.number(v*1,2) : '' );\n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "gltrans_debit_amount" }, { "align" : "right", "xtype" : "ColumnModel", "sortable" : true, "header" : "Amount", "width" : 100, "$ renderer" : "function(v) { \n var c =v >= 0.0 ? 'black' : 'red';\n\r\n return String.format('{0}',\r\n Roo.util.Format.number(v,2) ); \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "gltrans_balance" } ] } ] } ] } ] } ] }