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 F08600;
(function (F08600) {
    var FDocument = (function (_super) {
        __extends(FDocument, _super);
        function FDocument(id, version, oldVersion) {
            var _this = _super.call(this, id, version, oldVersion) || this;
            _this._analyticsDataTable = null;
            _this._analyticSheet = null;
            _this._p2RefObjTable = null;
            _this._p2RefOkpdTable = null;
            _this._p2RefKosguTable = null;
            _this._p2RefObjDescTable = null;
            _this._p2RefObjDescNpaTable = null;
            _this._p2Sp1Sheet = null;
            _this._tableRules = new F08600.TableRules(_this);
            _this._interfaceRules = new F08600.InterfaceRules(_this);
            _this._updateRules = new F08600.UpdateRules(_this);
            _this._exportRules = new F08600.ExportRules(_this);
            return _this;
        }
        Object.defineProperty(FDocument.prototype, "TotalTable", {
            get: function () {
                return this.P1Table;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "TableRules", {
            get: function () {
                return this._tableRules;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "InterfaceRules", {
            get: function () {
                return this._interfaceRules;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "UpdateRules", {
            get: function () {
                return this._updateRules;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "ExportRules", {
            get: function () {
                return this._exportRules;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P1Table", {
            get: function () {
                if (this._p1Table == null) {
                    this._p1Table = new F08600.P1Table("F08_600_R1_SumValues", this);
                }
                return this._p1Table;
            },
            enumerable: true,
            configurable: true
        });
        FDocument.prototype.GetPartIndicateBudgetData = function (PartKey) {
            var result = [];
            var fieldId = PartKey == PartIndicateBudgetTypes.Part1 ? "Part1_Y" : "Part3_Y";
            for (var i = 0; i < this.Settings.YearsCount; i++) {
                result[i] = this.P1Table.GetFieldValue(fieldId + ("" + (i + 1)));
            }
            return result;
        };
        Object.defineProperty(FDocument.prototype, "AnalyticsDataTable", {
            get: function () {
                if (this._analyticsDataTable == null) {
                    this._analyticsDataTable = new AnalyticsKosgu.AnalyticsDataTable("AnalyticsData", this);
                }
                return this._analyticsDataTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "AnalyticSheet", {
            get: function () {
                if (this._analyticSheet == null) {
                    this._analyticSheet = new AnalyticsKosgu.AnalyticsSheet("SHT_RA", this);
                }
                return this._analyticSheet;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "PurchaseObjectsSprTable", {
            get: function () {
                if (this._purchaseObjectsSprTable == null) {
                    this._purchaseObjectsSprTable = new F01XXXBase.PurchaseObjectsSprTable();
                }
                return this._purchaseObjectsSprTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P2RefObjTable", {
            get: function () {
                if (this._p2RefObjTable == null) {
                    this._p2RefObjTable = new F01XXXBase.PartObjectDataTable("F08_600_R2_Ref_Object", this, this.P2RefObjDescTable);
                }
                return this._p2RefObjTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P2RefOkpdTable", {
            get: function () {
                if (this._p2RefOkpdTable == null) {
                    this._p2RefOkpdTable = new F01XXXBase.PartOkpdTable("F08_600_R2_Ref_Okpd", this, this.P2RefObjTable);
                }
                return this._p2RefOkpdTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P2RefKosguTable", {
            get: function () {
                if (this._p2RefKosguTable == null) {
                    this._p2RefKosguTable = new F01XXXBase.PartKosguTable("F08_600_R2_Ref_Kosgu", this, this.P2RefOkpdTable);
                }
                return this._p2RefKosguTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P2RefObjDescTable", {
            get: function () {
                if (this._p2RefObjDescTable == null) {
                    this._p2RefObjDescTable = new F01XXXBase.ObjectDescTable("F08_600_R2_Ref_ObjectDesc", this);
                }
                return this._p2RefObjDescTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P2RefObjDescNpaTable", {
            get: function () {
                if (this._p2RefObjDescNpaTable == null) {
                    this._p2RefObjDescNpaTable = new F01XXXBase.ObjectDescNpaTable("F08_600_R2_Ref_Npa", this, this.P2RefObjDescTable);
                }
                return this._p2RefObjDescNpaTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P2Sp1Sheet", {
            get: function () {
                if (this._p2Sp1Sheet == null) {
                    this._p2Sp1Sheet = new F01XXXBase.PurchaseObjectHierarchySheet(this);
                }
                return this._p2Sp1Sheet;
            },
            enumerable: true,
            configurable: true
        });
        return FDocument;
    }(BasePartIndicateBudgetDocumentObject));
    F08600.FDocument = FDocument;
})(F08600 || (F08600 = {}));
