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 FProcurementsPlanAttach;
(function (FProcurementsPlanAttach) {
    var InterfaceRules = (function () {
        function InterfaceRules(_document) {
            this._document = _document;
        }
        return InterfaceRules;
    }());
    FProcurementsPlanAttach.InterfaceRules = InterfaceRules;
    var ProcurementsSheet = (function (_super) {
        __extends(ProcurementsSheet, _super);
        function ProcurementsSheet(id, _document) {
            var _this = _super.call(this, id, false) || this;
            _this._document = _document;
            return _this;
        }
        ProcurementsSheet.prototype.CalcEventHandler = function (sheetId, row, column, fieldId) {
            if (this._document.CommonRules.IsFooterRow(sheetId, row)) {
                if (column === 5) {
                    return "\u0418\u0442\u043E\u0433\u043E";
                }
                else if ((column > 5) && (column < 11)) {
                    return this._document.CommonRules.GetFooterSum(sheetId, row, column);
                }
                else {
                    return undefined;
                }
            }
            else {
                if (column === 0) {
                    return ObasHelper.FillWithCharacter((row + 1).toString(), 4);
                }
            }
        };
        return ProcurementsSheet;
    }(YearGroupSheet));
    FProcurementsPlanAttach.ProcurementsSheet = ProcurementsSheet;
    var ProcurementSumbyKBKSheet = (function (_super) {
        __extends(ProcurementSumbyKBKSheet, _super);
        function ProcurementSumbyKBKSheet(id, _document) {
            var _this = _super.call(this, id, false) || this;
            _this._document = _document;
            return _this;
        }
        ProcurementSumbyKBKSheet.prototype.CalcEventHandler = function (sheetId, row, column, fieldId) {
            if (this.Document.CommonRules.IsFooterRow(sheetId, row)) {
                if (column === 0) {
                    return "\u0418\u0442\u043E\u0433\u043E";
                }
                else if (column > 0) {
                    return this.Document.CommonRules.GetFooterSum(sheetId, row, column);
                }
                else {
                    return undefined;
                }
            }
        };
        return ProcurementSumbyKBKSheet;
    }(YearGroupSheet));
    FProcurementsPlanAttach.ProcurementSumbyKBKSheet = ProcurementSumbyKBKSheet;
    var ProcurementsReasonsSheet = (function (_super) {
        __extends(ProcurementsReasonsSheet, _super);
        function ProcurementsReasonsSheet(id, _document) {
            var _this = _super.call(this, id, false) || this;
            _this._document = _document;
            return _this;
        }
        ProcurementsReasonsSheet.prototype.CalcEventHandler = function (sheetId, row, column, fieldId) {
            if (column === 0) {
                return ObasHelper.FillWithCharacter((row + 1).toString(), 4);
            }
        };
        return ProcurementsReasonsSheet;
    }(Sheet));
    FProcurementsPlanAttach.ProcurementsReasonsSheet = ProcurementsReasonsSheet;
})(FProcurementsPlanAttach || (FProcurementsPlanAttach = {}));
