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 F02300;
(function (F02300) {
    var FDocument = (function (_super) {
        __extends(FDocument, _super);
        function FDocument(id, version, oldVersion) {
            var _this = _super.call(this, id, version, oldVersion) || this;
            _this._p1Sheet = null;
            _this._npaSheet = null;
            _this._p1TotalTable = null;
            _this._indexTransposedTable = null;
            _this._indexationSheet = null;
            _this._p2InfoSheet = null;
            _this._p2Sp1Sheet = null;
            _this._p2Sp1DataTable = null;
            _this._p2Sp1RowsTable = null;
            _this._p2ExpenseDataTable = null;
            _this._p2Sp2Sheet = null;
            _this._p2ExpenseSheet = null;
            _this._p3Sp1DataTable = null;
            _this._p3Sp1RowsTable = null;
            _this._p3ExpenseDataTable = null;
            _this._p3Sp1Sheet = null;
            _this._p3ExpenseSheet = null;
            _this._p4Sp1RowsTable = null;
            _this._p4Sp1DataTable = null;
            _this._p4ExpenseDataTable = null;
            _this._p4Sp1Sheet = null;
            _this._p4ExpenseSheet = null;
            _this._indexationTable = null;
            _this._npaTable = null;
            _this._analyticsDataTable = null;
            _this._analyticSheet = null;
            _this._p6RefObjTable = null;
            _this._p6RefOkpdTable = null;
            _this._p6RefKosguTable = null;
            _this._p6RefObjDescTable = null;
            _this._p6RefObjDescNpaTable = null;
            _this._p6Sp1Sheet = null;
            _this._addYearsCount = 4;
            _this._initYear = _this.Settings.StartYear - _this._addYearsCount;
            _this._curYear = _this.Settings.StartYear - 1;
            _this._fullYearsCount = _this.Settings.YearsCount + _this._addYearsCount;
            _this._tableRules = new F02300.TableRules(_this);
            _this._interfaceRules = new F02300.InterfaceRules(_this);
            _this._updateRules = new F02300.UpdateRules(_this);
            _this._exportRules = new F02300.ExportRules(_this);
            return _this;
        }
        Object.defineProperty(FDocument.prototype, "P1TotalTable", {
            get: function () {
                if (this._p1TotalTable == null) {
                    this._p1TotalTable = new F02300.P1TotalTable("F02_300_R1_Values", this);
                }
                return this._p1TotalTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P1Sheet", {
            get: function () {
                if (this._p1Sheet == null) {
                    this._p1Sheet = new F02300.P1Sheet("SHT_R1", this);
                }
                return this._p1Sheet;
            },
            enumerable: true,
            configurable: true
        });

        Object.defineProperty(FDocument.prototype, "P2Sp1RowsTable", {
            get: function () {
                if (this._p2Sp1RowsTable == null) {
                    this._p2Sp1RowsTable = new F02300.RowsTable("F02_300_R2_1_Rows");
                }
                return this._p2Sp1RowsTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P2Sp1DataTable", {
            get: function () {
                if (this._p2Sp1DataTable == null) {
                    this._p2Sp1DataTable = new F02300.P2Sp1DataTable("F02_300_R2_1_Values", this, this.P2Sp1RowsTable, this.P2ExpenseDataTable, this.IndexationTable);
                }
                return this._p2Sp1DataTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P2ExpenseDataTable", {
            get: function () {
                if (this._p2ExpenseDataTable == null) {
                    this._p2ExpenseDataTable = new F02300.ExpenseDataTable("F02_300_R2_Expense_Values", this, this.P1TotalTable, F02300.P1TableStrKeys.P2);
                }
                return this._p2ExpenseDataTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "IndexationTable", {
            get: function () {
                if (this._indexationTable == null) {
                    this._indexationTable = new F02300.IndexationTable("Indexation", this);
                }
                return this._indexationTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "IndexTransposedTable", {
            get: function () {
                if (this._indexTransposedTable == null) {
                    this._indexTransposedTable = new F02300.IndexTransposedTable("tIndexation", this.FullYearsCount, this.InitYear, this);
                }
                return this._indexTransposedTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P2Sp1Sheet", {
            get: function () {
                if (this._p2Sp1Sheet == null) {
                    this._p2Sp1Sheet = new F02300.P2Sp1Sheet("SHT_R2_1", this, this.P2Sp1RowsTable);
                }
                return this._p2Sp1Sheet;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P2Sp2Sheet", {
            get: function () {
                if (this._p2Sp2Sheet == null) {
                    this._p2Sp2Sheet = new F02300.P2Sp2Sheet("SHT_R2_2", this);
                }
                return this._p2Sp2Sheet;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P2InfoSheet", {
            get: function () {
                if (this._p2InfoSheet == null) {
                    this._p2InfoSheet = new F02300.P2InfoSheet("SHT_Info", false);
                }
                return this._p2InfoSheet;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P2ExpenseSheet", {
            get: function () {
                if (this._p2ExpenseSheet == null) {
                    this._p2ExpenseSheet = new F02300.ExpenseSheet("SHT_R2_2_2", this);
                }
                return this._p2ExpenseSheet;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "IndexationSheet", {
            get: function () {
                if (this._indexationSheet == null) {
                    this._indexationSheet = new F02300.IndexationSheet("SHT_Indexation", this);
                }
                return this._indexationSheet;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P3Sp1RowsTable", {
            get: function () {
                if (this._p3Sp1RowsTable == null) {
                    this._p3Sp1RowsTable = new F02300.RowsTable("F02_300_R3_1_Rows");
                }
                return this._p3Sp1RowsTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P3Sp1DataTable", {
            get: function () {
                if (this._p3Sp1DataTable == null) {
                    this._p3Sp1DataTable = new F02300.P3Sp1DataTable("F02_300_R3_1_Values", this, this.P3Sp1RowsTable, this.P3ExpenseDataTable);
                }
                return this._p3Sp1DataTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P3ExpenseDataTable", {
            get: function () {
                if (this._p3ExpenseDataTable == null) {
                    this._p3ExpenseDataTable = new F02300.ExpenseDataTable("F02_300_R3_Expense_Values", this, this.P1TotalTable, F02300.P1TableStrKeys.P3);
                }
                return this._p3ExpenseDataTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P3Sp1Sheet", {
            get: function () {
                if (this._p3Sp1Sheet == null) {
                    this._p3Sp1Sheet = new F02300.ExpenseInfoSheet("SHT_R3_1", this, this.P3Sp1RowsTable);
                }
                return this._p3Sp1Sheet;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P3ExpenseSheet", {
            get: function () {
                if (this._p3ExpenseSheet == null) {
                    this._p3ExpenseSheet = new F02300.ExpenseSheet("SHT_R3_2", this);
                }
                return this._p3ExpenseSheet;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P4Sp1RowsTable", {
            get: function () {
                if (this._p4Sp1RowsTable == null) {
                    this._p4Sp1RowsTable = new F02300.RowsTable("F02_300_R4_1_Rows");
                }
                return this._p4Sp1RowsTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P4Sp1DataTable", {
            get: function () {
                if (this._p4Sp1DataTable == null) {
                    this._p4Sp1DataTable = new F02300.P3Sp1DataTable("F02_300_R4_1_Values", this, this.P4Sp1RowsTable, this.P4ExpenseDataTable);
                }
                return this._p4Sp1DataTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P4Sp1Sheet", {
            get: function () {
                if (this._p4Sp1Sheet == null) {
                    this._p4Sp1Sheet = new F02300.ExpenseInfoSheet("SHT_R4_1", this, this.P4Sp1RowsTable);
                }
                return this._p4Sp1Sheet;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P4ExpenseSheet", {
            get: function () {
                if (this._p4ExpenseSheet == null) {
                    this._p4ExpenseSheet = new F02300.ExpenseSheet("SHT_R4_2", this);
                }
                return this._p4ExpenseSheet;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P4ExpenseDataTable", {
            get: function () {
                if (this._p4ExpenseDataTable == null) {
                    this._p4ExpenseDataTable = new F02300.ExpenseDataTable("F02_300_R4_Expense_Values", this, this.P1TotalTable, F02300.P1TableStrKeys.P4);
                }
                return this._p4ExpenseDataTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "NpaTable", {
            get: function () {
                if (this._npaTable == null) {
                    this._npaTable = new NpaObasTable("F02_300_NPA");
                }
                return this._npaTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "NpaSheet", {
            get: function () {
                if (this._npaSheet == null) {
                    this._npaSheet = new F02300.NpaSheet("SHT_NPA", false);
                }
                return this._npaSheet;
            },
            enumerable: true,
            configurable: true
        });
        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.AnalyticsNonEditableSheet("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, "P6RefObjTable", {
            get: function () {
                if (this._p6RefObjTable == null) {
                    this._p6RefObjTable = new F01XXXBase.PartObjectDataTable("F02_300_R6_Ref_Object", this, this.P6RefObjDescTable);
                }
                return this._p6RefObjTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P6RefOkpdTable", {
            get: function () {
                if (this._p6RefOkpdTable == null) {
                    this._p6RefOkpdTable = new F01XXXBase.PartOkpdTable("F02_300_R6_Ref_Okpd", this, this.P6RefObjTable);
                }
                return this._p6RefOkpdTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P6RefKosguTable", {
            get: function () {
                if (this._p6RefKosguTable == null) {
                    this._p6RefKosguTable = new F01XXXBase.PartKosguTable("F02_300_R6_Ref_Kosgu", this, this.P6RefOkpdTable);
                }
                return this._p6RefKosguTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P6RefObjDescTable", {
            get: function () {
                if (this._p6RefObjDescTable == null) {
                    this._p6RefObjDescTable = new F01XXXBase.ObjectDescTable("F02_300_R6_Ref_ObjectDesc", this);
                }
                return this._p6RefObjDescTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P6RefObjDescNpaTable", {
            get: function () {
                if (this._p6RefObjDescNpaTable == null) {
                    this._p6RefObjDescNpaTable = new F01XXXBase.ObjectDescNpaTable("F02_300_R6_Ref_Npa", this, this.P6RefObjDescTable);
                }
                return this._p6RefObjDescNpaTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "P6Sp1Sheet", {
            get: function () {
                if (this._p6Sp1Sheet == null) {
                    this._p6Sp1Sheet = new F01XXXBase.PurchaseObjectHierarchySheet(this);
                }
                return this._p6Sp1Sheet;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "TotalTable", {
            get: function () {
                return this.P1TotalTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "AddYearsCount", {
            get: function () {
                return this._addYearsCount;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "InitYear", {
            get: function () {
                return this._initYear;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "CurYear", {
            get: function () {
                return this._curYear;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FDocument.prototype, "FullYearsCount", {
            get: function () {
                return this._fullYearsCount;
            },
            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
        });
        return FDocument;
    }(BaseDocumentObject));
    F02300.FDocument = FDocument;
})(F02300 || (F02300 = {}));
