{ "name" : "Pman.Tab.XtupleApAging", "parent" : "Pman.Tab.XtupleAccountsTab", "title" : "", "path" : "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleApAging.bjs", "permname" : "", "modOrder" : "500", "items" : [ { "fitToFrame" : true, "background" : true, "region" : "center", "title" : "Accounts Payable", "xtype" : "NestedLayoutPanel", "fitContainer" : true, "$ xns" : "Roo", "items" : [ { "xtype" : "BorderLayout", "$ xns" : "Roo", "* prop" : "layout", "items" : [ { "xtype" : "LayoutRegion", "$ xns" : "Roo", "* prop" : "center" }, { "listeners" : { "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" }, "fitToframe" : true, "background" : true, "region" : "center", "title" : "ApAging", "xtype" : "GridPanel", "fitContainer" : true, "$ xns" : "Roo", "tableName" : "apopen", "items" : [ { "listeners" : { "|render" : "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}" }, "autoExpandColumn" : "araging_cust_name", "xtype" : "Grid", "loadMask" : true, "$ xns" : "Roo.grid", "* prop" : "grid", "items" : [ { "xtype" : "RowSelectionModel", "singleSelect" : true, "$ xns" : "Roo.grid", "* prop" : "sm" }, { "listeners" : { "beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n \n\n \n var dt = _this.relDate.getValue();\n \n var params = {\n _group : 'apAging',\n _name : 'bydate',\n 'relDate:text' : typeof(dt) == 'string' ? dt : dt.format('Y-m-d'),\n 'useDocDate:text' : false\n };\n \n var vend = _this.vendSel.getValue();\n if (vend*1) {\n params['vend_id:number'] = vend;\n \n }\n \n \n Roo.apply(o.params,params);\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" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n {\n 'name': 'apaging_doctype',\n 'type': 'string'\n }\n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] }, { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "listeners" : { "render" : "function (_self)\n{\n _this.vendSel = _self;\n}", "select" : "function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n}" }, "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "cust_name", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "vend_name", "emptyText" : "Select Vendor", "hiddenName" : "vend_id", "minChars" : 2, "valueField" : "vend_id", "xtype" : "ComboBox", "allowBlank" : true, "typeAhead" : true, "editable" : true, "width" : 300, "$ xns" : "Roo.form", "name" : "vend_name", "qtip" : "Select Vendor", "queryParam" : "vend_name:text", "tpl" : "
{vend_name}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n\n if (!_this.relDate) {\n return false;\n }\n var dt = _this.relDate.getValue(); \n // set more here\n o.params['_group'] = 'apAging';\n o.params['_name'] = 'vendors';\n o.params['relDate:text'] = typeof(dt) == 'string' ? dt : dt.format('Y-m-d');\n o.params['useDocDate:text'] = false \n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'cust_name' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/metasql.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "cust_id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[{\"name\":\"vend_id\",\"type\":\"int\"},\"vend_name\"]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "text" : "as Of:", "xtype" : "TextItem", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "render" : "function (_self)\r\n{\r\n _this.relDate = _self;\r\n _self.setValue( new Date() );\r\n}", "select" : "function (combo, date)\n{\n _this.grid.footer.onClick('first');\n}" }, "format" : "Y-m-d", "xtype" : "DateField", "allowBlank" : false, "width" : 100, "$ xns" : "Roo.form" }, { "xtype" : "Fill", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "|click" : "function ()\n{\n var s = _this.grid.getSelectionModel().getSelected();\n \n if(!s || s.data.apopen_id * 1 < 1){\n Roo.MessageBox.alert('Error', 'Please select a row');\n return;\n }\n \n if(s.data.apaging_doctype != 'V'){\n Roo.MessageBox.alert('Error', 'We just can handle voucher at the time being');\n return;\n }\n \n Roo.MessageBox.confirm(\"Are you sure\", \"Are you sure you want to VOID that?\",\n function(r) {\n if (r != 'yes') {\n return;\n }\n new Pman.Request({\n mask : 'Voiding',\n url : baseURL + '/Roo/Apopen',\n method : 'POST',\n params : {\n apopen_id : s.data.apopen_id,\n _void : 1\n },\n success : function() {\n _this.grid.footer.onClick('first');\n }\n })\n \n }\n );\n \n \n \n}" }, "text" : "Void", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'", "$ xns" : "Roo.Toolbar" } ] }, { "pageSize" : 25, "xtype" : "PagingToolbar", "emptyMsg" : "Nothing found", "$ xns" : "Roo", "displayMsg" : "Displaying araging{0} - {1} of {2}", "displayInfo" : true, "* prop" : "footer" }, { "xtype" : "ColumnModel", "header" : "Date", "width" : 100, "$ renderer" : "function(v) { \n var d = Date.parseDate(v, 'Y-m-d');\n\n return String.format('{0}', d.format('d/M/Y')); \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "apaging_docdate" }, { "xtype" : "ColumnModel", "header" : "Vendor", "width" : 200, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "apaging_vend_name" }, { "xtype" : "ColumnModel", "header" : "Doc Type", "width" : 120, "$ renderer" : "function(v) {\n switch(v) {\n case 'I':\n return \"Invoice\";\n case 'C':\n return \"Credit Memo\"; \n case 'D':\n return \"Debit Memo\"; \n case 'R':\n return \"Cash Receipt\"; \n case 'V':\n return \"Voucher\"; \n default:\n return String.format('{0}', v); \n }\n }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "apaging_doctype" }, { "xtype" : "ColumnModel", "header" : "Docnumber", "width" : 120, "$ renderer" : "function(v) {\n \n return String.format('{0}', v); \n \n }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "apaging_docnumber" }, { "xtype" : "ColumnModel", "header" : "Currency", "width" : 120, "$ renderer" : "function(v) {\n \n return String.format('{0}', v); \n \n }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "apaging_curr_symbol" }, { "align" : "right", "xtype" : "ColumnModel", "header" : "Value", "width" : 100, "$ renderer" : "function(v) { \n\n return String.format(v*1 < 0 ? '{0}' : '{0}', \n Roo.util.Format.usMoney(v)); \n }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "apaging_apopen_amount" }, { "align" : "right", "xtype" : "ColumnModel", "header" : "30 Days", "width" : 100, "$ renderer" : "function(v) { \n\n return String.format(v*1 < 0 ? '{0}' : '{0}', \n Roo.util.Format.usMoney(v)); \n }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "apaging_cur_val" }, { "align" : "right", "xtype" : "ColumnModel", "header" : "60 Days", "width" : 100, "$ renderer" : "function(v) { \n\n return String.format(v*1 < 0 ? '{0}' : '{0}', \n Roo.util.Format.usMoney(v)); \n }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "apaging_sixty_val" }, { "align" : "right", "xtype" : "ColumnModel", "header" : "90 Days", "width" : 100, "$ renderer" : "function(v) { \n\n return String.format(v*1 < 0 ? '{0}' : '{0}', \n Roo.util.Format.usMoney(v)); \n }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "apaging_ninety_val" }, { "align" : "right", "xtype" : "ColumnModel", "header" : "Over 90 days", "width" : 150, "$ renderer" : "function(v) { \n\n return String.format(v*1 < 0 ? '{0}' : '{0}', \n Roo.util.Format.usMoney(v)); \n }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "apaging_plus_val" }, { "align" : "right", "xtype" : "ColumnModel", "header" : "Total", "width" : 150, "$ renderer" : "function(v) { \n\n return String.format(v*1 < 0 ? '{0}' : '{0}', \n Roo.util.Format.usMoney(v)); \n }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "apaging_total_val" }, { "align" : "right", "xtype" : "ColumnModel", "header" : "Total (BASE)", "width" : 150, "$ renderer" : "function(v) { \n\n return String.format(v*1 < 0 ? '{0}' : '{0}', \n Roo.util.Format.usMoney(v)); \n }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "apaging_base_total" } ] } ] } ] } ] } ] }