dojo.provide("parus.balancePreparedConsolidationDialog");dojo.require("dijit.Dialog");dojo.require("dijit.form.Button");dojo.require("parus.parus8");dojo.require("parus.dialog");dojo.declare("parus.balancePreparedConsolidationDialog",[parus.Dialog],{data:null,_attrDescriptors:null,postCreate:function(){this.inherited(arguments);this._attrDescriptors=parus.parus8._attrDescriptors?parus.parus8.rowNodes(parus.database.execute("attrDescriptors",{UNITCODE:"BalanceReportsConstition"}).documentElement.childNodes[0].childNodes[0].childNodes[0])||[]:[];var b=dojo.clone(this.grid.structure);dojo.forEach(this._attrDescriptors,dojo.hitch(this,function(c){b[0].cells[0].push({colSpan:1,attrRN:parus.parus8.nodeField(c,"RN"),dataType:parus.parus8.nodeField(c,"DATATYPE"),dataSubType:0,field:"attr"+parus.parus8.nodeField(c,"RN"),name:parus.parus8.nodeField(c,"NAME"),formatter:parus.balance.formatAttrValue,width:(parus.parus8.nodeField(c,"ACTIVE")=="1")?"121px":"0px",hidden:(parus.parus8.nodeField(c,"ACTIVE")!="1"),styles:"text-align:"+((parus.parus8.nodeField(c,"DATATYPE")==0)?"left":"right")+";",sortField:(parus.parus8.nodeField(c,"PARAMCOUNT")=="2")?(parus.parus8.nodeField(c,"STOREDPROC")+"(T.COMPANY, T.RN)"):(parus.parus8.nodeField(c,"STOREDPROC")+"(T.RN)")})}));this.grid.attr("structure",b);this.grid.rowsPerPage=this.data.length+25;this.grid.attr("store",new parus.gridData({persistent:true,_data:this.data,onComplete:dojo.hitch(this,function(){this.grid.selection.selectRange(0,this.data.length-1)})}));this.grid.setQuery({});this.popupMenu.bindDomNode(this.grid.viewsNode);parus.balance._createActionsButton(this.popupMenu,this.headerPane);var a=parus.userdata.get(this.declaredClass);if(a){parus.gridSettingsDialog.mergeGridSettings(this.grid,a.gridSettings);parus.gridSettingsDialog.mergeColorConditions(this.grid,a.colorConditions);parus.gridSettingsDialog.mergeMenuSettings(this.popupMenu,a.actionSettings,a.userProcsActions,a.userReportsActions,a.userAppsActions);parus.gridSettingsDialog.mergeFilterBar(this.grid,a.showFilterBar,a.filterValues,a.sortInfo)}}});