dojo.provide("parus.balanceCheckReportCheckDialog");dojo.require("dijit.Dialog");dojo.require("dijit.form.Button");dojo.require("dijit.form.RadioButton");dojo.require("parus.parus8");dojo.require("parus.dialog");dojo.require("parus.dictEdit");dojo.declare("parus.balanceCheckReportCheckDialog",[parus.Dialog],{grid:null,kind:null,isSubReport:null,rn:null,formedRn:null,reportRn:null,checks:null,_lastValues:null,onShow:function(){this._lastValues=parus.userdata.get(this.declaredClass)||{};this.checkResults.attr("checked",this._lastValues.checkResults);this.useAgnCheckLists.attr("checked",this._lastValues.useAgnCheckLists);this.userSize=this._lastValues.userSize||null},onApply:function(){var c="checkReport";if(this.isSubReport){c="checkSubReport"}var b=true;for(var a=0;a<this.rn.length;a++){if(b){if(!parus.database.execute(c,{RN:this.rn[a],RESULT:(this.checkResults.checked?"1":"0"),USE_AGNCHKLST:(this.useAgnCheckLists.checked?"1":"0"),CHECKS:this.checks})){b=false}}}this._lastValues.checkResults=this.checkResults.attr("checked");this._lastValues.useAgnCheckLists=this.useAgnCheckLists.attr("checked");this._lastValues.userSize=this.userSize;parus.userdata.set(this.declaredClass,this._lastValues);if(b){parus.parus8.notificationMessage("Проверка завершена.")}if(this.grid){parus.balance.refreshGrid(this.grid,"RN",this.rn[0])}return true},selectCheckList:function(){var b;var a=parus.dictionaries.BalanceReportsChecks;dojo.mixin(a,{multiselect:true,dictionary:a,gridConditions:{REPORTS:this.reportRn.join(";"),BLREPFORMED:this.formedRn.join(";"),USE_AGNCHKLST:(this.useAgnCheckLists.checked?"1":"0"),onComplete:dojo.hitch(this,function(){setTimeout(function(){b.grid.selection.selectRange(0,b.grid.rowCount-1)},1)})},onApply:dojo.hitch(this,function(c){this.checks=c.getValue();return true})});b=new parus.dictionaryDialog(a);b.show()}});