var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var F02110;
(function (F02110) {
    var InterfaceRules = (function (_super) {
        __extends(InterfaceRules, _super);
        function InterfaceRules() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InterfaceRules.prototype.ObjectDescSheetFormatEventHandler = function (sheetId, row, column, groupIndex) {
            switch (column) {
                case 0:
                case 1:
                case 2:
                    return SheetFormatCollection.Related;
                case 8:
                    return SheetFormatCollection.Default;
                case 9:
                case 13:
                    return SheetFormatCollection.Spr;
                default:
                    return SheetFormatCollection.Free;
            }
        };
        InterfaceRules.prototype.ObjectDescSheetCalcEventHandler = function (sheetId, row, column, fieldId) {
            if (BaseObasTableFields.StrCodeField.Equal(fieldId)) {
                return ObasHelper.FillWithCharacter(row + 1, 6);
            }
            return undefined;
        };
        InterfaceRules.prototype.ObjectDescSheetCanAddEventHandler = function (sheetId, row, column, fieldId, rowLevel) {
            return column > 7;
        };
        InterfaceRules.prototype.ObjectDescSheetCanEditEventHandler = function (sheetId, row, column, fieldId, rowLevel) {
            var table = this._document.Sheets.getValue(sheetId).Table;
            if (column > 7) {
                return table.GetKeyBySourceTable(this._document.P3RefObjDescNpaTable) != null;
            }
            else {
                return table.GetKeyBySourceTable(this._document.P3RefObjDescNpaTable.ParentTable) != null;
            }
        };
        InterfaceRules.prototype.ObjectDescSheetCanDeleteEventHandler = function (sheetId, row, column, fieldId, rowLevel) {
            var table = this._document.Sheets.getValue(sheetId).Table;
            if (column > 7) {
                return table.GetKeyBySourceTable(this._document.P3RefObjDescNpaTable) != null;
            }
            else {
                return false;
            }
        };
        InterfaceRules.prototype.FilterOKPD = function () {
            var okpdCode = ObasTableCollection.OkpdSprTable.Code.Value || "";
            return okpdCode.length >= 5;
        };
        InterfaceRules.prototype.FilterNPAStatuses = function () {
            var npaStatusesTable = ObasTableCollection.NpaStatusesSprTable;
            return npaStatusesTable.RecordKey.Value === 1 || npaStatusesTable.RecordKey.Value === 2;
        };
        InterfaceRules.prototype.LoadDataFromProcurementMenuItemClickEventHandler = function () {
            this.ImportProcurementList();
            if (this._document.ShowEditor("ImportedProcurementListEditor")) {
                this.LoadDataFromProcurement();
            }
            this._document.ImportedProcurementTable.DeleteAllRow();
        };
        InterfaceRules.prototype.ImportedProcurementSprSheetCanEditEventHandler = function (sheetId, row, column, fieldId, rowLevel) {
            return (column === 0);
        };
        InterfaceRules.prototype.ImportProcurementList = function () {
            var procurementPlanTable = ObasTableCollection.RroProcurementPlanTable;
            procurementPlanTable.Last();
            var procurementTable = ObasTableCollection.RroProcurementTable;
            var procurementKeys = new Array();
            while (procurementTable.Locate(procurementTable.ProcurementPlanKey.Id, procurementPlanTable.RecordKey.Value, true)) {
                procurementKeys.push(procurementTable.RecordKey.Value);
            }
            procurementTable.ClearLocateFlag();
            var procurementKBKTable = ObasTableCollection.RroProcurementKBKTable;
            var importedProcurementTable = this._document.ImportedProcurementTable;
            importedProcurementTable.DeleteAllRow();
            for (var i = 0; i < procurementKeys.length; i++) {
                var keyValues = this._document.MainParametersTable.GetKbkKeyFieldsValue();
                keyValues.push(procurementKeys[i]);
                var keyFieldIds = procurementKBKTable.GetKbkKeyFieldsId();
                keyFieldIds.push(procurementKBKTable.ProcurementKey.Id);
                while (procurementKBKTable.Locate(keyFieldIds, keyValues, true)) {
                    importedProcurementTable.AddRow();
                    importedProcurementTable.IsMarked.Value = false;
                    importedProcurementTable.ProcurementKBK.ForeignKey.Value = procurementKBKTable.RecordKey.Value;
                    importedProcurementTable.FullKBKCode.Value = procurementKBKTable.CalcFullKBKCode();
                    importedProcurementTable.PostRow();
                }
                procurementKBKTable.ClearLocateFlag();
            }
        };
        InterfaceRules.prototype.LoadDataFromProcurement = function () {
            var okvRubKey = ObasTableCollection.OkvSprTable.RubleKey;
            var procurementId = "Procurement_ID";
            var importedProcurementTable = this._document.ImportedProcurementTable;
            var reader = importedProcurementTable.CreateReader();
            while (reader.Read()) {
                if (importedProcurementTable.IsMarked.Value) {
                    var procurementKBKTable = ObasTableCollection.RroProcurementKBKTable;
                    procurementKBKTable.Locate(procurementKBKTable.RecordKey.Id, importedProcurementTable.ProcurementKBK.ForeignKey.Value);
                    var purchaseObjectsSprTable = this._document.PurchaseObjectsSprTable;
                    if (!purchaseObjectsSprTable.Locate([purchaseObjectsSprTable.Name.Id, procurementId], [procurementKBKTable.ObjectName.Value, procurementKBKTable.ProcurementKey.Value])) {
                        purchaseObjectsSprTable.AddRow();
                        purchaseObjectsSprTable.Name.Value = procurementKBKTable.ObjectName.Value;
                        purchaseObjectsSprTable.SetFieldValue(procurementId, procurementKBKTable.ProcurementKey.Value);
                        purchaseObjectsSprTable.PostRow();
                    }
                    if (!procurementKBKTable.IsForeignProcurement.Value) {
                        var p2sp1RefObjTable = this._document.P2sp1RefObjTable;
                        if (!p2sp1RefObjTable.Locate(p2sp1RefObjTable.ObjectKey.Id, purchaseObjectsSprTable.RecordKey.Value)) {
                            p2sp1RefObjTable.AddRow();
                            p2sp1RefObjTable.ObjectKey.Value = purchaseObjectsSprTable.RecordKey.Value;
                            p2sp1RefObjTable.PostRow();
                        }
                        var p2sp1RefOkpdTable = this._document.P2sp1RefOkpdTable;
                        if (!p2sp1RefOkpdTable.Locate([p2sp1RefOkpdTable.OwnerKey.Id, p2sp1RefOkpdTable.OKPDKey.Id], [p2sp1RefObjTable.RecordKey.Value, procurementKBKTable.OKPDKey.Value])) {
                            p2sp1RefOkpdTable.AddRow();
                            p2sp1RefOkpdTable.OwnerKey.Value = p2sp1RefObjTable.RecordKey.Value;
                            p2sp1RefOkpdTable.OKPDKey.Value = procurementKBKTable.OKPDKey.Value;
                            p2sp1RefOkpdTable.PostRow();
                        }
                        var p2sp1RefKosguTable = this._document.P2sp1RefKosguTable;
                        p2sp1RefKosguTable.AddRow();
                        p2sp1RefKosguTable.OwnerKey.Value = p2sp1RefOkpdTable.RecordKey.Value;
                        p2sp1RefKosguTable.Year.Value = procurementKBKTable.GetProcurementPlacementYear();
                        p2sp1RefKosguTable.PostRow();
                        for (var i = 0; i <= ObasStageSettings.YearsCount - 1; i++) {
                            var fieldId = "Y" + (i + 1);
                            p2sp1RefKosguTable.SetFieldValue(F02110.ObasTableFields.FnYearField.GenerateId(fieldId), procurementKBKTable.GetFieldValue(fieldId));
                        }
                    }
                    else {
                        var p2UniqueOrgs = this._document.P2UniqueOrgs;
                        if (!p2UniqueOrgs.Locate(procurementId, procurementKBKTable.ProcurementKey.Value)) {
                            p2UniqueOrgs.AddRow();
                            p2UniqueOrgs.SetFieldValue(procurementId, procurementKBKTable.ProcurementKey.Value);
                            p2UniqueOrgs.PostRow();
                        }
                        var p2sp2RefObjTable = this._document.P2sp2RefObjTable;
                        if (!p2sp2RefObjTable.Locate(p2sp2RefObjTable.ObjectKey.Id, purchaseObjectsSprTable.RecordKey.Value)) {
                            p2sp2RefObjTable.AddRow();
                            p2sp2RefObjTable.OwnerKey.Value = p2UniqueOrgs.RecordKey.Value;
                            p2sp2RefObjTable.ObjectKey.Value = purchaseObjectsSprTable.RecordKey.Value;
                            p2sp2RefObjTable.PostRow();
                        }
                        var p2sp2RefOkpdTable = this._document.P2sp2RefOkpdTable;
                        if (!p2sp2RefOkpdTable.Locate([p2sp2RefOkpdTable.OwnerKey.Id, p2sp2RefOkpdTable.OKPDKey.Id], [p2sp2RefObjTable.RecordKey.Value, procurementKBKTable.OKPDKey.Value])) {
                            p2sp2RefOkpdTable.AddRow();
                            p2sp2RefOkpdTable.OwnerKey.Value = p2sp2RefObjTable.RecordKey.Value;
                            p2sp2RefOkpdTable.OKPDKey.Value = procurementKBKTable.OKPDKey.Value;
                            p2sp2RefOkpdTable.PostRow();
                        }
                        var p2sp2RefKosguTable = this._document.P2sp2RefKosguTable;
                        p2sp2RefKosguTable.AddRow();
                        p2sp2RefKosguTable.OwnerKey.Value = p2sp2RefOkpdTable.RecordKey.Value;
                        p2sp2RefKosguTable.Year.Value = procurementKBKTable.GetProcurementPlacementYear();
                        p2sp2RefKosguTable.PostRow();
                        if (okvRubKey === procurementKBKTable.OKVKey.Value) {
                            for (var i = 0; i <= ObasStageSettings.YearsCount - 1; i++) {
                                var fieldId = "Y" + (i + 1);
                                p2sp2RefKosguTable.SetFieldValue(F02110.ObasTableFields.FnOtherRubField.GenerateId(fieldId), procurementKBKTable.GetFieldValue(fieldId));
                            }
                        }
                        else {
                            for (var i = 0; i <= ObasStageSettings.YearsCount - 1; i++) {
                                var fieldId = "Usd_Y" + (i + 1);
                                p2sp2RefKosguTable.SetFieldValue(F02110.ObasTableFields.FnUsdField.GenerateId(fieldId), procurementKBKTable.GetFieldValue(fieldId));
                            }
                        }
                    }
                    var procurementTable = ObasTableCollection.RroProcurementTable;
                    procurementTable.Locate(procurementTable.RecordKey.Id, procurementKBKTable.ProcurementKey.Value);
                    var p3RefObjDescTable = this._document.P3RefObjDescTable;
                    p3RefObjDescTable.Locate(p3RefObjDescTable.ObjectKey.Id, purchaseObjectsSprTable.RecordKey.Value);
                    p3RefObjDescTable.Program.Value = procurementTable.GetFieldValue("MainStateProgram");
                    p3RefObjDescTable.Action.Value = procurementTable.GetFieldValue("MainEventStateProgram");
                    p3RefObjDescTable.Rationale.Value = procurementTable.GetFieldValue("JustificationConformityObject");
                    if (procurementTable.ProcurementTypeKey.Value === 1) {
                        p3RefObjDescTable.Result.Value = procurementTable.GetFieldValue("ExpectedResult");
                        p3RefObjDescTable.Info.Value = procurementTable.GetFieldValue("IsInfoTechDifficulties_Name");
                    }
                    var procurementNPATable = ObasTableCollection.RroProcurementNPATable;
                    var p3RefObjDescNpaTable = this._document.P3RefObjDescNpaTable;
                    while (procurementNPATable.Locate(procurementNPATable.ProcurementKey.Id, procurementKBKTable.ProcurementKey.Value, true)) {
                        var objDescNpaIds = [];
                        objDescNpaIds.push(p3RefObjDescNpaTable.OwnerKey.Id);
                        objDescNpaIds.push(p3RefObjDescNpaTable.NpaType.ForeignKey.Id);
                        objDescNpaIds.push(p3RefObjDescNpaTable.NpaNumber.Id);
                        objDescNpaIds.push(p3RefObjDescNpaTable.NpaDate.Id);
                        objDescNpaIds.push(p3RefObjDescNpaTable.NpaName.Id);
                        objDescNpaIds.push(p3RefObjDescNpaTable.NpaStatus.ForeignKey.Id);
                        objDescNpaIds.push(p3RefObjDescNpaTable.NpaStatusChangeDate.Id);
                        var objDescNpaValues = [];
                        objDescNpaValues.push(p3RefObjDescTable.RecordKey.Value);
                        objDescNpaValues.push(procurementNPATable.NpaType.ForeignKey.Value);
                        objDescNpaValues.push(procurementNPATable.NpaNumber.Value);
                        objDescNpaValues.push(procurementNPATable.NpaDate.Value);
                        objDescNpaValues.push(procurementNPATable.NpaName.Value);
                        objDescNpaValues.push(procurementNPATable.NpaStatus.ForeignKey.Value);
                        objDescNpaValues.push(procurementNPATable.NpaStatusChangeDate.Value);
                        if (!p3RefObjDescNpaTable.Locate(objDescNpaIds, objDescNpaValues)) {
                            p3RefObjDescNpaTable.AddRow();
                            for (var i = 0; i < objDescNpaIds.length; i++) {
                                p3RefObjDescNpaTable.SetFieldValue(objDescNpaIds[i], objDescNpaValues[i]);
                            }
                            p3RefObjDescNpaTable.PostRow();
                        }
                    }
                    procurementNPATable.ClearLocateFlag();
                }
            }
        };
        return InterfaceRules;
    }(BaseInterfaceRules));
    F02110.InterfaceRules = InterfaceRules;
    var AddYearsHelper = (function (_super) {
        __extends(AddYearsHelper, _super);
        function AddYearsHelper() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AddYearsHelper.prototype.GetAddDollarRateYearsFieldRangeEventHandler = function (sheetId) {
            if (sheetId === void 0) { sheetId = ""; }
            var result = [];
            var yearsCount = ObasStageSettings.YearsCount;
            for (var i = yearsCount; i < yearsCount + this._document.AddDataYearsCount; i++) {
                result.push(i);
            }
            return result;
        };
        AddYearsHelper.prototype.GetAddYearsFieldRangeEventHandler = function (sheetId) {
            if (sheetId === void 0) { sheetId = ""; }
            var result = [];
            var yearsCount = ObasStageSettings.YearsCount;
            for (var i = yearsCount; i < yearsCount + this._document.AddDataYearsCount; i++) {
                result.push(i);
            }
            return result;
        };
        return AddYearsHelper;
    }(AddYearsDocumentHelper));
    F02110.AddYearsHelper = AddYearsHelper;
    var P1SheetRelRows;
    (function (P1SheetRelRows) {
        P1SheetRelRows[P1SheetRelRows["Federal"] = 0] = "Federal";
        P1SheetRelRows[P1SheetRelRows["Foreign"] = 1] = "Foreign";
        P1SheetRelRows[P1SheetRelRows["Total"] = 2] = "Total";
    })(P1SheetRelRows = F02110.P1SheetRelRows || (F02110.P1SheetRelRows = {}));
    var P1Sheet = (function (_super) {
        __extends(P1Sheet, _super);
        function P1Sheet(id, _document) {
            var _this = _super.call(this, id, false) || this;
            _this._document = _document;
            return _this;
        }
        P1Sheet.prototype.IsFooterRow = function (row) {
            return this._document.CommonRules.IsFooterRow(this, row, P1Sheet._relRowCount);
        };
        P1Sheet.prototype.CalcRelRow = function (row) {
            return row % P1Sheet._relRowCount;
        };
        P1Sheet.prototype.IsDataColumn = function (column) {
            return column > P1Sheet._rowCodeColumn;
        };
        P1Sheet.prototype.FormatEventHandler = function (sheetId, row, column, groupIndex) {
            if (!this.IsDataColumn(column)) {
                return SheetFormatCollection.Default;
            }
            else if (this.IsDataColumn(column) && (row === this.RowCount - 2)) {
                return SheetFormatCollection.Free;
            }
            else {
                return SheetFormatCollection.Calc;
            }
        };
        P1Sheet.prototype.EditingCellEventHandler = function (sheetId, row, column, fieldId, rowLevel) {
            return (this.IsDataColumn(column) && (row === this.RowCount - 2));
        };
        return P1Sheet;
    }(Sheet));
    P1Sheet._relRowCount = ObasHelper.GetEnumLength(P1SheetRelRows);
    P1Sheet._rowCodeColumn = 1;
    P1Sheet._rowNameColumn = P1Sheet._rowCodeColumn - 1;
    P1Sheet._rowCodeLength = 3;
    F02110.P1Sheet = P1Sheet;
    var BaseHierarchySheet = (function (_super) {
        __extends(BaseHierarchySheet, _super);
        function BaseHierarchySheet() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        BaseHierarchySheet._totalRowName = "\u0412\u0441\u0435\u0433\u043E";
        BaseHierarchySheet._totalObjRowName = "\u0418\u0442\u043E\u0433\u043E \u043F\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u0443 \u0437\u0430\u043A\u0443\u043F\u043A\u0438";
        BaseHierarchySheet._totalRowInfo = {
            IsCalculated: false,
            Name: BaseHierarchySheet._totalRowName,
            Format: SheetFormatCollection.Default
        };
        BaseHierarchySheet._totalObjRowInfo = {
            IsCalculated: false,
            Name: BaseHierarchySheet._totalObjRowName,
            Format: SheetFormatCollection.Default
        };
        BaseHierarchySheet._subTotalRowInfos = [
            BaseHierarchySheet._totalObjRowInfo
        ];
        BaseHierarchySheet.SprColConstAll = {
            Cell: { Type: SheetCellTypes.Spr },
            SubTotalRow: BaseHierarchySheet._subTotalRowInfos,
            TotalRow: BaseHierarchySheet._totalRowInfo
        };
        BaseHierarchySheet.RelatedColConstAll = {
            Cell: { Type: SheetCellTypes.Related },
            SubTotalRow: BaseHierarchySheet._subTotalRowInfos,
            TotalRow: BaseHierarchySheet._totalRowInfo
        };
        BaseHierarchySheet.FreeColConstAll = {
            Cell: { Type: SheetCellTypes.Free },
            SubTotalRow: BaseHierarchySheet._subTotalRowInfos,
            TotalRow: BaseHierarchySheet._totalRowInfo
        };
        BaseHierarchySheet.DefaultColConstAll = {
            Cell: { Type: SheetCellTypes.Default },
            SubTotalRow: BaseHierarchySheet._subTotalRowInfos,
            TotalRow: BaseHierarchySheet._totalRowInfo
        };
        BaseHierarchySheet._CodeInfo = {
            Column: 8,
            Length: 6,
            LevelIncs: [1000, 1],
            CalcTotalCode: function () {
                return "010000";
            }
        };
        return BaseHierarchySheet;
    }(HierarchyYearGroupSheet));
    F02110.BaseHierarchySheet = BaseHierarchySheet;
    var PurchaseObjectHierarchySheet = (function (_super) {
        __extends(PurchaseObjectHierarchySheet, _super);
        function PurchaseObjectHierarchySheet() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        PurchaseObjectHierarchySheet.prototype.GetYearsSumCaptionEventHandler = function (tableId, index, defaultCaption, fieldCaption) {
            return this.Document.CommonRules.CalcColumnCaption(index, 13, 2);
        };
        Object.defineProperty(PurchaseObjectHierarchySheet.prototype, "SheetInfo", {
            get: function () {
                return PurchaseObjectHierarchySheet._sheetInfo;
            },
            enumerable: true,
            configurable: true
        });
        PurchaseObjectHierarchySheet._sheetInfo = {
            MaxLevel: 2,
            CodeInfo: PurchaseObjectHierarchySheet._CodeInfo,
            ColumnsInfo: [
                SheetColumnInfoCollection.SprColDefaultTotal,
                SheetColumnInfoCollection.SprColDefaultTotal,
                SheetColumnInfoCollection.SprColDefaultTotal,
                SheetColumnInfoCollection.SprColAllDefault,
                SheetColumnInfoCollection.SprColAllDefault,
                SheetColumnInfoCollection.SprColAllDefault,
                SheetColumnInfoCollection.SprColAllDefault,
                PurchaseObjectHierarchySheet.FreeColConstAll,
                PurchaseObjectHierarchySheet.DefaultColConstAll,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc
            ]
        };
        return PurchaseObjectHierarchySheet;
    }(BaseHierarchySheet));
    F02110.PurchaseObjectHierarchySheet = PurchaseObjectHierarchySheet;

    var BaseHierarchySheet2 = (function (_super) {
        __extends(BaseHierarchySheet2, _super);
        function BaseHierarchySheet2() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        BaseHierarchySheet2.prototype.EditCellEventHandler = function (sheetId, row, column, fieldId, rowLevel) {
            return column > 0;
        };
        BaseHierarchySheet2.TotalRecBudgFundRowName = "\u0418\u0442\u043E\u0433\u043E \u043F\u043E \u0441\u0442\u0440\u0430\u043D\u0435";
        BaseHierarchySheet2._totalRowName = "\u0412\u0441\u0435\u0433\u043E";
        BaseHierarchySheet2._totalObjRowName = "\u0418\u0442\u043E\u0433\u043E \u043F\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u0443 \u0437\u0430\u043A\u0443\u043F\u043A\u0438";
        BaseHierarchySheet2._totalRowInfo = {
            IsCalculated: false,
            Name: BaseHierarchySheet2._totalRowName,
            Format: SheetFormatCollection.Default
        };
        BaseHierarchySheet2._totalObjRowInfo = {
            IsCalculated: false,
            Name: BaseHierarchySheet2._totalObjRowName,
            Format: SheetFormatCollection.Default
        };
        BaseHierarchySheet2._totalRecBudgFundRowInfo = {
            IsCalculated: false,
            Name: BaseHierarchySheet2.TotalRecBudgFundRowName,
            Format: SheetFormatCollection.Default
        };
        BaseHierarchySheet2._subTotalRowInfos = [
            BaseHierarchySheet2._totalRecBudgFundRowInfo, BaseHierarchySheet2._totalObjRowInfo
        ];
        BaseHierarchySheet2.SprDefaultTotalFirstSubtotal = {
            Cell: { Type: SheetCellTypes.Spr },
            SubTotalRow: [SheetRowInfoCollection.Default, SheetRowInfoCollection.SprOnlyFormatRow],
            TotalRow: SheetRowInfoCollection.Default
        };
        BaseHierarchySheet2.RelatedDefaultTotalFirstSubtotal = {
            Cell: { Type: SheetCellTypes.Related },
            SubTotalRow: [SheetRowInfoCollection.Default, SheetRowInfoCollection.SprOnlyFormatRow],
            TotalRow: SheetRowInfoCollection.Default
        };
        BaseHierarchySheet2.SprColConstAll = {
            Cell: { Type: SheetCellTypes.Spr },
            SubTotalRow: BaseHierarchySheet2._subTotalRowInfos,
            TotalRow: BaseHierarchySheet2._totalRowInfo
        };
        BaseHierarchySheet2.RelatedColConstAll = {
            Cell: { Type: SheetCellTypes.Related },
            SubTotalRow: BaseHierarchySheet2._subTotalRowInfos,
            TotalRow: BaseHierarchySheet2._totalRowInfo
        };
        BaseHierarchySheet2.FreeColConstAll = {
            Cell: { Type: SheetCellTypes.Free },
            SubTotalRow: BaseHierarchySheet2._subTotalRowInfos,
            TotalRow: BaseHierarchySheet2._totalRowInfo
        };
        BaseHierarchySheet2.DefaultColConstAll = {
            Cell: { Type: SheetCellTypes.Default },
            SubTotalRow: BaseHierarchySheet2._subTotalRowInfos,
            TotalRow: BaseHierarchySheet2._totalRowInfo
        };
        BaseHierarchySheet2._CodeInfo = {
            Column: 10,
            Length: 6,
            LevelIncs: [10000, 100, 1],
            CalcTotalCode: function () {
                return 900000;
            }
        };
        return BaseHierarchySheet2;
    }(HierarchyYearGroupSheet));
    F02110.BaseHierarchySheet2 = BaseHierarchySheet2;
    var PurchaseObjectUsdHierarchySheet = (function (_super) {
        __extends(PurchaseObjectUsdHierarchySheet, _super);
        function PurchaseObjectUsdHierarchySheet(document) {
            return _super.call(this, document, 10) || this;
        }
        Object.defineProperty(PurchaseObjectUsdHierarchySheet.prototype, "SheetInfo", {
            get: function () {
                return PurchaseObjectUsdHierarchySheet._sheetInfo;
            },
            enumerable: true,
            configurable: true
        });
        PurchaseObjectUsdHierarchySheet.prototype.GetYearsSumUsdCaptionEventHandler = function (tableId, index, defaultCaption, fieldCaption) {
            return this.Document.CommonRules.CalcColumnCaption(index, 15, 2);
        };
        PurchaseObjectUsdHierarchySheet.prototype.GetYearsSumRubCaptionEventHandler = function (tableId, index, defaultCaption, fieldCaption) {
            return this.Document.CommonRules.CalcColumnCaption(index, 24, 2);
        };
        PurchaseObjectUsdHierarchySheet.prototype.GetYearsSumOtherRubCaptionEventHandler = function (tableId, index, defaultCaption, fieldCaption) {
            return this.Document.CommonRules.CalcColumnCaption(index, 33, 2);
        };
        PurchaseObjectUsdHierarchySheet.prototype.GetYearsTotalSumUsdCaptionEventHandler = function (tableId, index, defaultCaption, fieldCaption) {
            return this.Document.CommonRules.CalcColumnCaption(index, 42, 2);
        };
        PurchaseObjectUsdHierarchySheet._sheetInfo = {
            MaxLevel: 3,
            CodeInfo: PurchaseObjectUsdHierarchySheet._CodeInfo,
            ColumnsInfo: [
                SheetColumnInfoCollection.SprColDefaultTotal,
                SheetColumnInfoCollection.SprColDefaultTotal,
                PurchaseObjectUsdHierarchySheet.SprDefaultTotalFirstSubtotal,
                PurchaseObjectUsdHierarchySheet.SprDefaultTotalFirstSubtotal,
                PurchaseObjectUsdHierarchySheet.SprDefaultTotalFirstSubtotal,
                SheetColumnInfoCollection.SprColAllDefault,
                SheetColumnInfoCollection.SprColAllDefault,
                SheetColumnInfoCollection.SprColAllDefault,
                SheetColumnInfoCollection.SprColAllDefault,
                PurchaseObjectUsdHierarchySheet.FreeColConstAll,
                PurchaseObjectUsdHierarchySheet.DefaultColConstAll,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc,
                SheetColumnInfoCollection.FreeColAllCalc,
                SheetColumnInfoCollection.CalcColAllCalc
            ]
        };
        return PurchaseObjectUsdHierarchySheet;
    }(BaseHierarchySheet2));
    F02110.PurchaseObjectUsdHierarchySheet = PurchaseObjectUsdHierarchySheet;
})(F02110 || (F02110 = {}));
