dojo.provide("parus.balanceSubReportDialog");dojo.require("dijit.Dialog");dojo.require("dijit.form.Button");dojo.require("parus.parus8");dojo.require("parus.dialog");dojo.declare("parus.balanceSubReportDialog",[parus.Dialog],{formCode:null,edition:null,_docprops:null,postCreate:function(){this.inherited(arguments);this.noteEdit.attr("value",null);this._docprops={};if(parus.balance._detailDocprops.length){this.requsitesPane.domNode.style.margin="0";var c=new dijit.layout.TabContainer({region:"center","class":"balanceInternalPages"});c.addChild(this.requsitesPane);var b=new dijit.layout.ContentPane({title:"Свойства","class":"dialogContentPane",style:"overflow-y:scroll"});var a=document.createElement("table");a.cellSpacing="5";a.width="100%";dojo.forEach(parus.balance._detailDocprops,dojo.hitch(this,function(i){var h=a.insertRow(-1);var g=h.insertCell(-1);g.appendChild(document.createElement("b")).appendChild(document.createTextNode(parus.parus8.nodeField(i,"PROMPT")+":"));var f=h.insertCell(-1);f.align="right";var e=parus.customEditProperties(parus.parus8.nodeField(i,"DICTIONARY"),parus.parus8.nodeField(i,"DATATYPE")=="3"?"4":parus.parus8.nodeField(i,"DATATYPE"),parus.parus8.nodeField(i,"SUBTYPE"),parus.parus8.nodeField(i,"REQUIRE")=="1",parus.parus8.nodeField(i,"STRLEN"),parus.parus8.nodeField(i,"INTPART"),parus.parus8.nodeField(i,"FRACPART"));dojo.mixin(e.params,{disabled:parus.parus8.nodeField(i,"READONLY")=="1"});var d=new (e.constructor())(e.params,f.appendChild(document.createElement("div")));this._docprops[parus.parus8.nodeField(i,"RN")]=d}));b.containerNode.appendChild(a);c.addChild(b);this.mainContainer.addChild(c);dojo.style(this.mainContainer.domNode,{height:(parus.parus8.styleSize(this.mainContainer.domNode.style.height)+30)+"px"})}},selectSection:function(){var d=[];if(this.sectionCodeEdit.value){var c={UNITCODE:this.formCode+this.edition};c.CODE=this.sectionCodeEdit.value;var b=parus.database.query("BalanceReportFormsSectionsHierPath",c);dojo.forEach(parus.parus8.rowNodes(b),function(e){d.push(parus.parus8.nodeField(e,"RN"))})}var a=new parus.treeDialog({title:"Разрезы отчетности",value:d.length?d.join(";"):null,validate:function(){return(a.catalogTree.model.isValid(a.catalogTree.selectedItem)&&(a.catalogTree.model.getIdentity(a.catalogTree.selectedItem)!=-1))},key:"BalanceReportFormsSections",model:new parus.catalogTreeModel({queryid:"BalanceReportFormsSectionsHier",onGetConditions:dojo.hitch(this,function(g,f){var e={UNITCODE:this.formCode+this.edition};e.CRN=f?g.getIdentity(f):"!*";return e})}),onPerform:dojo.hitch(this,function(f,e){this.sectionCodeEdit.attr("value",e);return true})});a.show();return true},propValues:function(){var b={};for(var a in this._docprops){b["P"+a]=parus._docPropsValueValueFromWidget(this._docprops[a])}return{DOCPROPS:b}}});