dojo.provide("parus.designerReportEditionDialog");dojo.require("dijit.Dialog");dojo.require("dijit.form.Button");dojo.require("dijit.form.ValidationTextBox");dojo.require("dijit.form.SimpleTextarea");dojo.require("parus.parus8");dojo.require("parus.dialog");dojo.require("parus.dictEdit");dojo.require("parus.formats");dojo.require("parus.editDictionaryDialog");dojo.require("parus.designerReportPeriodDialog");dojo.require("parus.designerReportPeriodDateDialog");dojo.require("parus.designerRecalculateTypeDialog");dojo.declare("parus.designerReportEditionDialog",[parus.editDictionaryDialog],{onLoadParams:function(c,b,a){this.inherited(arguments);if(c&&b){this.dateFromEdit.attr("value",parus.formats.stringToDate(c.getValue(b,"BEGDATE")));this.dateToEdit.attr("value",parus.formats.stringToDate(c.getValue(b,"ENDDATE")));this.recalculateTypeEdit.attr("value",c.getValue(b,"CALC_CODE"));this.calculateResultSubReportsCheckBox.attr("checked",c.getValue(b,"RESULTS")=="1");this.periodEdit.attr("value",c.getValue(b,"PERIOD_CODE"));this.autoRecalculateCheckBox.attr("checked",c.getValue(b,"AUTOCALC")=="1");this.noteEdit.attr("value",c.getValue(b,"NOTES"));this.subscriptToTextEdit.attr("value",c.getValue(b,"EXPORTFOOTER"));this.uploadWithSubReportsCheckBox.attr("checked",c.getValue(b,"EXPORTSUBREPORTS")=="1");this.ignoreWarningsCheckBox.attr("checked",c.getValue(b,"IGNORE_WARNINGS")=="1")}},executeInsert:function(b){var a=parus.database.execute(b?"duplicateDesignerReportEdition":"insertDesignerReportEdition",{RN:b?this.rn:null,PRN:this.prn,BEGDATE:parus.formats.dateToString(this.dateFromEdit.attr("value")),ENDDATE:parus.formats.dateToString(this.dateToEdit.attr("value")),CALCTYPE:this.recalculateTypeEdit.attr("value"),RESULTS:(this.calculateResultSubReportsCheckBox.attr("checked")?"1":"0"),PERIOD:this.periodEdit.attr("value"),AUTOCALC:(this.autoRecalculateCheckBox.attr("checked")?"1":"0"),NOTES:this.noteEdit.attr("value"),EXPORTFOOTER:this.subscriptToTextEdit.attr("value"),EXPORTSUBREPORTS:(this.uploadWithSubReportsCheckBox.attr("checked")?"1":"0"),IGNORE_WARNINGS:(this.ignoreWarningsCheckBox.attr("checked")?"1":"0")});if(a){return parus.parus8.nodeField(parus.parus8.rowNodes(a)[0],"NRN")}},executeUpdate:function(){var a=parus.database.execute("updateDesignerReportEdition",{RN:this.rn,BEGDATE:parus.formats.dateToString(this.dateFromEdit.attr("value")),ENDDATE:parus.formats.dateToString(this.dateToEdit.attr("value")),CALCTYPE:this.recalculateTypeEdit.attr("value"),RESULTS:(this.calculateResultSubReportsCheckBox.attr("checked")?"1":"0"),PERIOD:this.periodEdit.attr("value"),AUTOCALC:(this.autoRecalculateCheckBox.attr("checked")?"1":"0"),NOTES:this.noteEdit.attr("value"),EXPORTFOOTER:this.subscriptToTextEdit.attr("value"),EXPORTSUBREPORTS:(this.uploadWithSubReportsCheckBox.attr("checked")?"1":"0"),IGNORE_WARNINGS:(this.ignoreWarningsCheckBox.attr("checked")?"1":"0")});return !!a},executeDelete:function(c,b){var a=parus.database.execute("deleteDesignerReportEdition",{RN:c.getValue(b,"RN")});return !!a}});