import * as i0 from '@angular/core';
import { Injectable, Input, Component, ViewChild, Inject, NgModule } from '@angular/core';
import * as i4$1 from '@angular/forms';
import { NgForm } from '@angular/forms';
import * as i1 from '@angular/material/dialog';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import * as i3 from '@sellan/core';
import { Utility, CoreClientGrid, CoreMatModule, CoreBaseModule, CoreControlModule, CoreDialogModule, CoreModule } from '@sellan/core';
import * as i4 from '@angular/material/paginator';
import * as i5 from '@angular/material/sort';
import * as i6 from '@angular/material/table';
import * as i7 from '@angular/material/tabs';
import * as i8 from '@angular/material/tooltip';
import { of } from 'rxjs';

class FiancialBalance {
    constructor() {
        this.lines = new Array();
    }
}
// данные финансового отчета с серверной стороны
class FinancialReport {
    constructor() {
        this.periods = new Array();
    }
}

var FinancialStatementPeriod;
(function (FinancialStatementPeriod) {
    FinancialStatementPeriod[FinancialStatementPeriod["Current"] = 0] = "Current";
    FinancialStatementPeriod[FinancialStatementPeriod["Past"] = 1] = "Past";
    FinancialStatementPeriod[FinancialStatementPeriod["Last"] = 2] = "Last";
})(FinancialStatementPeriod || (FinancialStatementPeriod = {}));
class FinancialPeriod {
    constructor(type, y, q) {
        this.year = y;
        this.quarter = q;
        this.type = type;
    }
    description() {
        const desc = this.quarter === 4 || Utility.isEmpty(this.quarter)
            ? 'Годовая отчетность за ' + this.year + ' год'
            : 'По итогам ' + this._queterDesc() + ' квартала ' + this.year + ' года';
        return desc;
    }
    _queterDesc() {
        switch (this.quarter) {
            case 1: return '1-ого';
            case 2: return '2-ого';
            case 3: return '3-его';
        }
    }
}

class FinancialStatementSerivce {
    constructor(_startUp, _ajaxM) {
        this._startUp = _startUp;
        this._ajaxM = _ajaxM;
    }
    recalculate(period, rows) {
        const b = this._fromRows(period, rows);
        rows.forEach(item => {
            let value;
            // пересчитываем значение
            switch (item.rowCode) {
                case '1100': {
                    value = this._getValue('1110', b.lines) + this._getValue('1120', b.lines) + this._getValue('1130', b.lines)
                        + this._getValue('1140', b.lines) + this._getValue('1150', b.lines) + this._getValue('1160', b.lines)
                        + this._getValue('1170', b.lines) + this._getValue('1180', b.lines) + this._getValue('1190', b.lines);
                    break;
                }
                case '1200': {
                    value = this._getValue('1210', b.lines) + this._getValue('1220', b.lines) + this._getValue('1230', b.lines)
                        + this._getValue('1240', b.lines) + this._getValue('1250', b.lines) + this._getValue('1260', b.lines);
                    break;
                }
                case '1600': {
                    value = this._getValue('1210', b.lines) + this._getValue('1220', b.lines) + this._getValue('1230', b.lines)
                        + this._getValue('1240', b.lines) + this._getValue('1250', b.lines) + this._getValue('1260', b.lines)
                        + this._getValue('1110', b.lines) + this._getValue('1120', b.lines) + this._getValue('1130', b.lines)
                        + this._getValue('1140', b.lines) + this._getValue('1150', b.lines) + this._getValue('1160', b.lines)
                        + this._getValue('1170', b.lines) + this._getValue('1180', b.lines) + this._getValue('1190', b.lines);
                    break;
                }
                case '1300': {
                    value = this._getValue('1310', b.lines) + this._getValue('1320', b.lines) + this._getValue('1340', b.lines)
                        + this._getValue('1350', b.lines) + this._getValue('1360', b.lines) + this._getValue('1370', b.lines);
                    break;
                }
                case '1400': {
                    value = this._getValue('1410', b.lines) + this._getValue('1420', b.lines) + this._getValue('1430', b.lines)
                        + this._getValue('1450', b.lines);
                    break;
                }
                case '1500': {
                    value = this._getValue('1510', b.lines) + this._getValue('1520', b.lines) + this._getValue('1530', b.lines)
                        + this._getValue('1540', b.lines) + this._getValue('1550', b.lines);
                    break;
                }
                case '1700': {
                    value = this._getValue('1310', b.lines) + this._getValue('1320', b.lines) + this._getValue('1340', b.lines)
                        + this._getValue('1350', b.lines) + this._getValue('1360', b.lines) + this._getValue('1370', b.lines)
                        + this._getValue('1410', b.lines) + this._getValue('1420', b.lines) + this._getValue('1430', b.lines)
                        + this._getValue('1450', b.lines) + this._getValue('1510', b.lines) + this._getValue('1520', b.lines)
                        + this._getValue('1530', b.lines) + this._getValue('1540', b.lines) + this._getValue('1550', b.lines);
                    break;
                }
                case '2100': {
                    value = this._getValue('2110', b.lines) - Math.abs(this._getValue('2120', b.lines));
                    break;
                }
                case '2200': {
                    value = this._getValue('2110', b.lines) - Math.abs(this._getValue('2120', b.lines))
                        - Math.abs(this._getValue('2220', b.lines)) - Math.abs(this._getValue('2210', b.lines));
                    break;
                }
                case '2300': {
                    value = this._getValue('2110', b.lines) - Math.abs(this._getValue('2120', b.lines)) - Math.abs(this._getValue('2220', b.lines))
                        - Math.abs(this._getValue('2210', b.lines)) + this._getValue('2310', b.lines) + this._getValue('2320', b.lines)
                        - Math.abs(this._getValue('2330', b.lines)) + this._getValue('2340', b.lines) - Math.abs(this._getValue('2350', b.lines));
                    break;
                }
                case '2400': {
                    value = this._getValue('2110', b.lines) - Math.abs(this._getValue('2120', b.lines)) - Math.abs(this._getValue('2220', b.lines))
                        - Math.abs(this._getValue('2210', b.lines)) + this._getValue('2310', b.lines) + this._getValue('2320', b.lines)
                        - Math.abs(this._getValue('2330', b.lines)) + this._getValue('2340', b.lines) - Math.abs(this._getValue('2350', b.lines))
                        - Math.abs(this._getValue('2410', b.lines)) - Math.abs(this._getValue('2430', b.lines)) + this._getValue('2450', b.lines)
                        - Math.abs(this._getValue('2460', b.lines));
                    break;
                }
            }
            if (value !== undefined) {
                switch (period.type) {
                    case FinancialStatementPeriod.Current: {
                        item.currentPeriod = value;
                        break;
                    }
                    case FinancialStatementPeriod.Past: {
                        item.pastPeriod = value;
                        break;
                    }
                    case FinancialStatementPeriod.Last: {
                        item.lastPriod = value;
                        break;
                    }
                }
            }
        });
    }
    valueSubstitution(rows) {
        let rowsOne = rows.filter(z => z.rowCode === '1370')[0];
        let rowsTwo = rows.filter(z => z.rowCode === '1300')[0];
        if (rowsOne.lastPriod != rowsTwo.lastPriod || rowsOne.pastPeriod != rowsTwo.pastPeriod) {
            rowsOne.lastPriod = rowsTwo.lastPriod;
            rowsOne.pastPeriod = rowsTwo.pastPeriod;
        }
    }
    initReport(report) {
        const periods = new Array();
        const financeRows = this._getLocalisationConfiguration('ru-RU');
        periods.push(this._toRows(FinancialStatementPeriod.Current, financeRows, report.periods[Number(FinancialStatementPeriod.Current)]));
        periods.push(this._toRows(FinancialStatementPeriod.Past, financeRows, report.periods[Number(FinancialStatementPeriod.Past)]));
        periods.push(this._toRows(FinancialStatementPeriod.Last, financeRows, report.periods[Number(FinancialStatementPeriod.Last)]));
        return {
            isFilledCorrectly: report.isFilledCorrectly,
            isSimplifiedFinancialBalance: report.isSimplifiedFinancialBalance,
            unit: report.unit,
            periods: periods,
            rows: financeRows,
            isFromExternalSource: report.isFromExternalSource,
        };
    }
    loadFinancialReport(inn, fileId, multiOrganizationId) {
        let multi = '/';
        if (!Utility.isEmpty(multiOrganizationId)) {
            multi = '/multi/' + multiOrganizationId + '/';
        }
        const fileIdString = fileId ?? "";
        const url = this._startUp.apiRoot('statements' + '/' + inn + multi + 'file/' + fileIdString, 'financial');
        return this._ajaxM.get({ url: url });
    }
    saveFinancialReport(report) {
        const dto = new FinancialReport();
        dto.isFilledCorrectly = true;
        dto.isSimplifiedFinancialBalance = report.isSimplifiedFinancialBalance;
        dto.unit = report.unit;
        for (let i = 0; i < report.periods.length; i++) {
            dto.periods.push(this._fromRows(report.periods[i], report.rows));
        }
        const url = this._startUp.apiRoot('statements', 'financial');
        return this._ajaxM.post({ url: url, data: dto });
    }
    _getValue(code, cells) {
        let value = 0;
        cells.forEach(item => {
            if (item.line.toString() === code) {
                value = Utility.isEmpty(item.value) ? 0 : item.value;
            }
        });
        return value;
    }
    _getLocalisationConfiguration(culture) {
        switch (culture) {
            case 'ru-RU':
                return this._defaultGet();
            default:
                return this._defaultGet();
        }
    }
    _toRows(period, rows, report) {
        rows.forEach(item => {
            if (!item.isSection) {
                const balance = this._getValue(item.rowCode, report.lines);
                switch (period) {
                    case FinancialStatementPeriod.Current: {
                        item.currentPeriod = balance;
                        break;
                    }
                    case FinancialStatementPeriod.Past: {
                        item.pastPeriod = balance;
                        break;
                    }
                    case FinancialStatementPeriod.Last: {
                        item.lastPriod = balance;
                        break;
                    }
                }
            }
        });
        return new FinancialPeriod(period, report.year, report.quarter);
    }
    _fromRows(period, rows) {
        const balance = new FiancialBalance();
        balance.quarter = period.quarter;
        balance.year = period.year;
        rows.forEach(item => {
            if (!item.isSection) {
                switch (period.type) {
                    case FinancialStatementPeriod.Current: {
                        balance.lines.push({ line: Number(item.rowCode), value: item.currentPeriod });
                        break;
                    }
                    case FinancialStatementPeriod.Past: {
                        balance.lines.push({ line: Number(item.rowCode), value: item.pastPeriod });
                        break;
                    }
                    case FinancialStatementPeriod.Last: {
                        balance.lines.push({ line: Number(item.rowCode), value: item.lastPriod });
                        break;
                    }
                }
            }
        });
        return balance;
    }
    getTabConfig() {
        return [
            { title: 'Актив', sectionCodes: ['I', 'II'] },
            { title: 'Пассив', sectionCodes: ['III', 'IV', 'V'] },
            { title: 'ОФР', sectionCodes: ['VI'] },
            { title: 'Амортизация', sectionCodes: ['VII'] }
        ];
    }
    _defaultGet() {
        const defaultRows = [
            { sectionCode: 'I', isSection: true, sectionDescription: 'I. ВНЕОБОРОТНЫЕ АКТИВЫ' },
            { sectionCode: 'I', description: 'Нематериальные активы', rowCode: '1110' },
            { sectionCode: 'I', description: 'Результаты исследований и разработок', rowCode: '1120' },
            { sectionCode: 'I', description: 'Нематериальные поисковые активы', rowCode: '1130' },
            { sectionCode: 'I', description: 'Материальные поисковые активы', rowCode: '1140' },
            { sectionCode: 'I', description: 'Основные средства', rowCode: '1150', isSimplified: true },
            { sectionCode: 'I', description: 'Доходные вложения в материальные ценности', rowCode: '1160' },
            { sectionCode: 'I', description: 'Финансовые вложения', rowCode: '1170', isSimplified: true },
            { sectionCode: 'I', description: 'Отложенные налоговые активы', rowCode: '1180' },
            { sectionCode: 'I', description: 'Прочие внеоборотные активы', rowCode: '1190' },
            { sectionCode: 'I', description: 'Итого по разделу I', rowCode: '1100', isReadonly: true },
            { sectionCode: 'II', isSection: true, sectionDescription: 'II. ОБОРОТНЫЕ АКТИВЫ' },
            { sectionCode: 'II', description: 'Запасы', rowCode: '1210', isSimplified: true },
            { sectionCode: 'II', description: 'Налог на добавленную стоимость по приобретённым ценностям', rowCode: '1220' },
            { sectionCode: 'II', description: 'Дебиторская задолженность', rowCode: '1230', isSimplified: true },
            { sectionCode: 'II', description: 'в т.ч. просроченная', rowCode: '1231' },
            { sectionCode: 'II', description: 'Финансовые вложения (за исключением денежных эквивалентов)', rowCode: '1240' },
            { sectionCode: 'II', description: 'Денежные средства и денежные эквиваленты', rowCode: '1250', isSimplified: true },
            { sectionCode: 'II', description: 'Прочие оборотные активы', rowCode: '1260' },
            { sectionCode: 'II', description: 'Итого по разделу II', rowCode: '1200', isReadonly: true },
            { sectionCode: 'II', description: 'БАЛАНС', rowCode: '1600', isReadonly: true, isSimplified: true },
            { sectionCode: 'III', isSection: true, sectionDescription: 'III. КАПИТАЛ И РЕЗЕРВЫ' },
            { sectionCode: 'III', description: 'Уставный капитал (складочный капитал, уставный фонд, вклады товарищей)', rowCode: '1310' },
            { sectionCode: 'III', description: 'Собственные акции, выкупленные у акционеров', rowCode: '1320' },
            { sectionCode: 'III', description: 'Переоценка внеоборотных активов', rowCode: '1340' },
            { sectionCode: 'III', description: 'Добавочный капитал (без переоценки)', rowCode: '1350' },
            { sectionCode: 'III', description: 'Резервный капитал', rowCode: '1360' },
            { sectionCode: 'III', description: 'Нераспределённая прибыль (непокрытый убыток)', rowCode: '1370', isSimplified: true },
            { sectionCode: 'III', description: 'Итого по разделу III', rowCode: '1300', isReadonly: true, isSimplified: true },
            { sectionCode: 'IV', isSection: true, sectionDescription: 'IV. ДОЛГОСРОЧНЫЕ ОБЯЗАТЕЛЬСТВА' },
            { sectionCode: 'IV', description: 'Заёмные средства', rowCode: '1410', isSimplified: true },
            { sectionCode: 'IV', description: 'Отложенные налоговые обязательства', rowCode: '1420' },
            { sectionCode: 'IV', description: 'Оценочные обязательства', rowCode: '1430' },
            { sectionCode: 'IV', description: 'Прочие обязательства', rowCode: '1450', isSimplified: true },
            { sectionCode: 'IV', description: 'Итого по разделу IV', rowCode: '1400', isReadonly: true },
            { sectionCode: 'V', isSection: true, sectionDescription: 'V. КРАТКОСРОЧНЫЕ ОБЯЗАТЕЛЬСТВА' },
            { sectionCode: 'V', description: 'Заемные средства', rowCode: '1510', isSimplified: true },
            { sectionCode: 'V', description: 'Кредиторская задолженность', rowCode: '1520', isSimplified: true },
            { sectionCode: 'V', description: 'в т.ч. просроченная', rowCode: '1521' },
            { sectionCode: 'V', description: 'Доходы будущих периодов', rowCode: '1530' },
            { sectionCode: 'V', description: 'Оценочные обязательства', rowCode: '1540' },
            { sectionCode: 'V', description: 'Прочие обязательства', rowCode: '1550', isSimplified: true },
            { sectionCode: 'V', description: 'Итого по разделу V', rowCode: '1500', isReadonly: true },
            { sectionCode: 'V', description: 'БАЛАНС', rowCode: '1700', isReadonly: true, isSimplified: true },
            { sectionCode: 'VI', isSection: true, sectionDescription: 'ОТЧЕТ О ФИНАНСОВЫХ РЕЗУЛЬТАТАХ' },
            { sectionCode: 'VI', description: 'Выручка', rowCode: '2110', isSimplified: true },
            { sectionCode: 'VI', description: 'Себестоимость продаж', rowCode: '2120', isSimplified: true },
            { sectionCode: 'VI', description: 'Валовая прибыль (убыток)', rowCode: '2100', isReadonly: true },
            { sectionCode: 'VI', description: 'Коммерческие расходы', rowCode: '2210' },
            { sectionCode: 'VI', description: 'Управленческие расходы', rowCode: '2220' },
            { sectionCode: 'VI', description: 'Прибыль (убыток) от продаж', rowCode: '2200', isReadonly: true },
            { sectionCode: 'VI', description: 'Доходы от участия в других организациях', rowCode: '2310' },
            { sectionCode: 'VI', description: 'Проценты к получению', rowCode: '2320' },
            { sectionCode: 'VI', description: 'Проценты к уплате', rowCode: '2330', isSimplified: true },
            { sectionCode: 'VI', description: 'Прочие доходы', rowCode: '2340', isSimplified: true },
            { sectionCode: 'VI', description: 'Прочие расходы', rowCode: '2350', isSimplified: true },
            { sectionCode: 'VI', description: 'Прибыль (убыток) до налогообложения', rowCode: '2300', isReadonly: true },
            { sectionCode: 'VI', description: 'Текущий налог на прибыль', rowCode: '2410', isSimplified: true },
            { sectionCode: 'VI', description: 'Изменение отложенных налоговых обязательств', rowCode: '2430' },
            { sectionCode: 'VI', description: 'Изменение отложенных налоговых активов', rowCode: '2450' },
            { sectionCode: 'VI', description: 'Прочее', rowCode: '2460' },
            { sectionCode: 'VI', description: 'Чистая прибыль (убыток)', rowCode: '2400', isReadonly: true, isSimplified: true },
            { sectionCode: 'VII', isSection: true, sectionDescription: 'АМОРТИЗАЦИЯ' },
            { sectionCode: 'VII', description: 'Амортизация', rowCode: '5640', isSimplified: true },
        ];
        return defaultRows;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: FinancialStatementSerivce, deps: [{ token: i3.Startup }, { token: i3.AjaxService }], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: FinancialStatementSerivce }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: FinancialStatementSerivce, decorators: [{
            type: Injectable
        }], ctorParameters: () => [{ type: i3.Startup }, { type: i3.AjaxService }] });

class EconomicFinancialFormComponent extends CoreClientGrid {
    constructor(dialog, _financeStatementService, _cdRef, _popupM) {
        super();
        this.dialog = dialog;
        this._financeStatementService = _financeStatementService;
        this._cdRef = _cdRef;
        this._popupM = _popupM;
        this.reliabilityReport = false;
        this.autoCalculatedRowCodes = ['1100', '1200', '1600', '1300', '1400', '1500', '1700', '2100', '2200', '2300', '2400'];
        this._displayedColumns = ['description', 'rowCode', 'currentPeriod', 'pastPeriod', 'lastPriod'];
    }
    isAutoCalculatedRow(row) {
        return this.autoCalculatedRowCodes.some(x => x == row.rowCode);
    }
    getMaxContentHeight() {
        return { height: 600 + 'px' };
    }
    ngOnInit() {
        super.ngOnInit();
        this.tabConfig = this._financeStatementService.getTabConfig();
        this._financeStatementService
            .loadFinancialReport(this.inn, this.fileId, this.multiOrganizationId)
            .pipe(this.takeUntilDestroyed())
            .subscribe((response) => this._popupM.HandleIEntityResponse({
            response: response,
            successCallback: (report) => {
                this.report = this._financeStatementService.initReport(report);
                this._gridConfig.paginator.pageSize = 65;
                this.filterDataSourceBySectionCodes({ index: 0 });
                if (report.isSimplifiedFinancialBalance) {
                    this._financeStatementService.valueSubstitution(this.report.rows);
                }
                for (let period of this.report.periods) {
                    this._financeStatementService.recalculate(period, this.report.rows);
                }
                this._cdRef.detectChanges();
            }
        }));
    }
    dataSource() {
        if (Utility.isEmpty(this.report) || Utility.isEmpty(this.report.rows) || this.report.rows.length === 0) {
            return new Array();
        }
        let intersection = this.report.rows.filter(x => this.selectedSectionCode.includes(x.sectionCode));
        if (this.report?.isSimplifiedFinancialBalance === true) {
            intersection = intersection.filter(x => x.isSimplified === true);
        }
        return intersection;
    }
    sortingLogic(sort) {
        this.report.rows = this.report.rows.sort((a, b) => {
            const isAsc = sort.direction === 'asc';
            switch (sort.active) {
                case 'rowCode': return this.compare(a.rowCode, b.rowCode, isAsc);
                default: return 0;
            }
        });
    }
    onValuesChange(rowCode, period, $event) {
        this._financeStatementService.recalculate(period, this.report.rows);
    }
    onSimplifiedChange($event) {
        this._dataSource.loadDataSourceItems(this.dataSource());
    }
    filterDataSourceBySectionCodes($event) {
        this.selectedSectionCode = this.tabConfig[$event.index].sectionCodes;
        this.onSimplifiedChange(null);
        this._cdRef.detectChanges();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EconomicFinancialFormComponent, deps: [{ token: i1.MatDialog }, { token: FinancialStatementSerivce }, { token: i0.ChangeDetectorRef }, { token: i3.PopupResults }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: EconomicFinancialFormComponent, isStandalone: false, selector: "economic-financial-form", inputs: { fileId: "fileId", multiOrganizationId: "multiOrganizationId", inn: "inn" }, usesInheritance: true, ngImport: i0, template: "<div provideParentForm class=\"sln-financial-form-dialog\">\n  @if (report) {\n    <div class=\"row\">\n      <div class=\"col-md-6 sln-core-field-bool\">\n        <core-field-bool [(ngModel)]=\"report.isSimplifiedFinancialBalance\" name=\"isSimplifiedFinancialBalance\" fieldName=\"isSimplifiedFinancialBalance\" placeholder=\"\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0443\u043F\u0440\u043E\u0449\u0435\u043D\u043D\u044B\u0439 \u0444\u043E\u0440\u043C\u0430\u0442\" [disabled]=\"disabled\" [settings]=\"{ mode: 'Slide' }\" (valueChange)=\"onSimplifiedChange($event)\"></core-field-bool>\n      </div>\n      <div class=\"col-md-6 core-field-combobox\">\n        <core-field-combobox [(ngModel)]=\"report.unit\" name=\"unit\" fieldName=\"unit\" placeholder=\"\u0415\u0434\u0438\u043D\u0438\u0446\u044B \u0438\u0437\u043C\u0435\u0440\u0435\u043D\u0438\u044F\" [settings]=\"{ sourceCode:'EconomicUnits' }\" [disabled]=\"true\"></core-field-combobox>\n      </div>\n    </div>\n  }\n  <div class=\"row sln-financial-form\">\n    <div class=\"col-md-12\">\n      <div class=\"grid mini-grid\">\n        <mat-tab-group class=\"sln-mat-tab tabConfig\" (selectedTabChange)=\"filterDataSourceBySectionCodes($event)\">\n          @for (item of tabConfig; track item) {\n            <mat-tab>\n              <ng-template mat-tab-label>\n                <span class=\"mat-tab-span\" >{{item.title}}</span>\n              </ng-template>\n              <div class=\"ibox\">\n                <div class=\"ibox-content\">\n                  <section style=\"height:50vh;\">\n                    <table mat-table [dataSource]=\"_dataSource\" multiTemplateDataRows matSort (matSortChange)=\"sortData($event)\" matSortActive=\"rowCode\" matSortDisableClear>\n                      <ng-container matColumnDef=\"description\">\n                        <th mat-header-cell *matHeaderCellDef style=\"width: 27%;\">\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044F</th>\n                        <td mat-cell *matCellDef=\"let row\">\n                          @if (row.isSection) {\n                            <strong>{{ row.sectionDescription }}</strong>\n                          }\n                          @if (!row.isSection) {\n                            <span>{{ row.description }}</span>\n                          }\n                        </td>\n                      </ng-container>\n                      <ng-container matColumnDef=\"rowCode\">\n                        <th mat-header-cell *matHeaderCellDef>\u041A\u043E\u0434 \u0441\u0442\u0440\u043E\u043A\u0438</th>\n                        <td mat-cell *matCellDef=\"let row\">\n                          {{ row.rowCode }}\n                        </td>\n                      </ng-container>\n                      <ng-container matColumnDef=\"currentPeriod\">\n                        <th mat-header-cell *matHeaderCellDef>\n                          {{ report?.periods[0]?.description() }}\n                        </th>\n                        <td mat-cell *matCellDef=\"let row\">\n                          @if (!row.isSection) {\n                            <core-field-number [(ngModel)]=\"row.currentPeriod\" name=\"{{ 'currentPeriod' + row.rowCode }}\" fieldName=\"{{ 'currentPeriod' + row.rowCode }}\" [settings]=\"{  decimals:2 }\" (valueChange)=\"onValuesChange(row.rowCode, report?.periods[0], $event)\"\n                            [disabled]=\"row.isReadonly\" labelClass=\"background-auto-calculate\"></core-field-number>\n                          }\n                        </td>\n                      </ng-container>\n                      <ng-container matColumnDef=\"pastPeriod\">\n                        <th mat-header-cell *matHeaderCellDef class=\"cell-with-button\">\n                          @if (report?.isFromExternalSource !== true) {\n                            <span>{{ report?.periods[1]?.description() }}</span>\n                          }\n                          @if (report?.isFromExternalSource === true) {\n                            <span>\n                              <div matTooltip=\"\u041F\u0435\u0440\u0438\u043E\u0434 \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u043D\u0430 \u043E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u0438 \u0434\u0430\u043D\u043D\u044B\u0445 \u0424\u041D\u0421\" matTooltipPosition=\"above\"  >\n                                {{ report?.periods[1]?.description() }} <strong style=\"color:red;\">!</strong>\n                              </div>\n                            </span>\n                          }\n                        </th>\n                        <td mat-cell *matCellDef=\"let row\">\n                          @if (!row.isSection) {\n                            <core-field-number [(ngModel)]=\"row.pastPeriod\" name=\"{{ 'pastPeriod' + row.rowCode }}\" fieldName=\"{{ 'pastPeriod' + row.rowCode }}\" [settings]=\"{ decimals:2 }\" (valueChange)=\"onValuesChange(row.rowCode, report?.periods[1], $event)\"\n                            [disabled]=\"row.isReadonly\" labelClass=\"background-auto-calculate\"></core-field-number>\n                          }\n                        </td>\n                      </ng-container>\n                      <ng-container matColumnDef=\"lastPriod\">\n                        <th mat-header-cell *matHeaderCellDef class=\"cell-with-button\">\n                          @if (report?.isFromExternalSource !== true) {\n                            <span>{{ report?.periods[2]?.description() }}</span>\n                          }\n                          @if (report?.isFromExternalSource === true) {\n                            <span>\n                              <div matTooltip=\"\u041F\u0435\u0440\u0438\u043E\u0434 \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u043D\u0430 \u043E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u0438 \u0434\u0430\u043D\u043D\u044B\u0445 \u0424\u041D\u0421\" matTooltipPosition=\"above\"  >\n                                {{ report?.periods[2]?.description() }} <strong style=\"color:red;\">!</strong>\n                              </div>\n                            </span>\n                          }\n                        </th>\n                        <td mat-cell *matCellDef=\"let row\">\n                          @if (!row.isSection) {\n                            <core-field-number [(ngModel)]=\"row.lastPriod\" name=\"{{ 'lastPriod' + row.rowCode }}\" fieldName=\"{{ 'lastPriod' + row.rowCode }}\" [settings]=\"{ decimals:2 }\" (valueChange)=\"onValuesChange(row.rowCode, report?.periods[2], $event)\"\n                            [disabled]=\"row.isReadonly\" labelClass=\"background-auto-calculate\"></core-field-number>\n                          }\n                        </td>\n                      </ng-container>\n                      <tr mat-header-row *matHeaderRowDef=\"_displayedColumns; sticky: true\"></tr>\n                      <tr mat-row *matRowDef=\"let row; columns: _displayedColumns;\" class=\"grid-element-row\" [class.background-auto-calculate]=\"isAutoCalculatedRow(row)\"></tr>\n                    </table>\n                  </section>\n                </div>\n              </div>\n            </mat-tab>\n          }\n        </mat-tab-group>\n        <mat-paginator style=\"display: none;\" [length]=\"_gridConfig.paginator.total\" [pageSize]=\"_gridConfig.paginator.pageSize\" [pageSizeOptions]=\"[10, 25, 65]\"></mat-paginator>\n      </div>\n    </div>\n  </div>\n</div>\n\n", styles: [".sln-financial-form table strong{color:var(--GRAY-SOFT);font-size:13px}.sln-financial-form table th:after{content:\"\";height:15px;width:1px;padding:0 5px!important}.sln-financial-form table th:last-child{border-right:none}.grid table th{font-size:10px}.mat-mdc-header-cell{background:var(--WHITE)!important}.mat-tab-span{min-width:100%;width:100px;height:39px;text-align:center;padding-top:12px}.sln-container-checkbox{display:flex;flex-direction:column;margin-top:10px;padding:0 23px}.sln-financial-form-dialog .sln-core-field-bool{margin-top:5px;padding-left:0;padding-right:6px;padding-top:0}.sln-financial-form-dialog .core-field-combobox{padding-right:1px;padding-left:6px;margin-top:5px}.sln-financial-form-dialog .mdc-label{font-size:13px}.sln-financial-form-dialog .col-md-12{padding:0}\n", ".background-auto-calculate{background-color:#e2e8ea75}\n"], dependencies: [{ kind: "component", type: i4.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "directive", type: i5.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i6.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i6.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i6.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i6.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i6.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i6.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i6.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i6.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i6.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i6.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i7.MatTabLabel, selector: "[mat-tab-label], [matTabLabel]" }, { kind: "component", type: i7.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass", "id"], exportAs: ["matTab"] }, { kind: "component", type: i7.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "mat-align-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: i4$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.ProvideParentFormDirective, selector: "[provideParentForm]" }, { kind: "component", type: i3.CoreFieldTypeBoolComponent, selector: "core-field-bool" }, { kind: "component", type: i3.CoreFieldTypeComboboxComponent, selector: "core-field-combobox", inputs: ["multiple", "master", "dataSource", "excludedValues"] }, { kind: "component", type: i3.CoreFieldTypeNumberComponent, selector: "core-field-number", inputs: ["isInt"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EconomicFinancialFormComponent, decorators: [{
            type: Component,
            args: [{ selector: 'economic-financial-form', standalone: false, template: "<div provideParentForm class=\"sln-financial-form-dialog\">\n  @if (report) {\n    <div class=\"row\">\n      <div class=\"col-md-6 sln-core-field-bool\">\n        <core-field-bool [(ngModel)]=\"report.isSimplifiedFinancialBalance\" name=\"isSimplifiedFinancialBalance\" fieldName=\"isSimplifiedFinancialBalance\" placeholder=\"\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0443\u043F\u0440\u043E\u0449\u0435\u043D\u043D\u044B\u0439 \u0444\u043E\u0440\u043C\u0430\u0442\" [disabled]=\"disabled\" [settings]=\"{ mode: 'Slide' }\" (valueChange)=\"onSimplifiedChange($event)\"></core-field-bool>\n      </div>\n      <div class=\"col-md-6 core-field-combobox\">\n        <core-field-combobox [(ngModel)]=\"report.unit\" name=\"unit\" fieldName=\"unit\" placeholder=\"\u0415\u0434\u0438\u043D\u0438\u0446\u044B \u0438\u0437\u043C\u0435\u0440\u0435\u043D\u0438\u044F\" [settings]=\"{ sourceCode:'EconomicUnits' }\" [disabled]=\"true\"></core-field-combobox>\n      </div>\n    </div>\n  }\n  <div class=\"row sln-financial-form\">\n    <div class=\"col-md-12\">\n      <div class=\"grid mini-grid\">\n        <mat-tab-group class=\"sln-mat-tab tabConfig\" (selectedTabChange)=\"filterDataSourceBySectionCodes($event)\">\n          @for (item of tabConfig; track item) {\n            <mat-tab>\n              <ng-template mat-tab-label>\n                <span class=\"mat-tab-span\" >{{item.title}}</span>\n              </ng-template>\n              <div class=\"ibox\">\n                <div class=\"ibox-content\">\n                  <section style=\"height:50vh;\">\n                    <table mat-table [dataSource]=\"_dataSource\" multiTemplateDataRows matSort (matSortChange)=\"sortData($event)\" matSortActive=\"rowCode\" matSortDisableClear>\n                      <ng-container matColumnDef=\"description\">\n                        <th mat-header-cell *matHeaderCellDef style=\"width: 27%;\">\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044F</th>\n                        <td mat-cell *matCellDef=\"let row\">\n                          @if (row.isSection) {\n                            <strong>{{ row.sectionDescription }}</strong>\n                          }\n                          @if (!row.isSection) {\n                            <span>{{ row.description }}</span>\n                          }\n                        </td>\n                      </ng-container>\n                      <ng-container matColumnDef=\"rowCode\">\n                        <th mat-header-cell *matHeaderCellDef>\u041A\u043E\u0434 \u0441\u0442\u0440\u043E\u043A\u0438</th>\n                        <td mat-cell *matCellDef=\"let row\">\n                          {{ row.rowCode }}\n                        </td>\n                      </ng-container>\n                      <ng-container matColumnDef=\"currentPeriod\">\n                        <th mat-header-cell *matHeaderCellDef>\n                          {{ report?.periods[0]?.description() }}\n                        </th>\n                        <td mat-cell *matCellDef=\"let row\">\n                          @if (!row.isSection) {\n                            <core-field-number [(ngModel)]=\"row.currentPeriod\" name=\"{{ 'currentPeriod' + row.rowCode }}\" fieldName=\"{{ 'currentPeriod' + row.rowCode }}\" [settings]=\"{  decimals:2 }\" (valueChange)=\"onValuesChange(row.rowCode, report?.periods[0], $event)\"\n                            [disabled]=\"row.isReadonly\" labelClass=\"background-auto-calculate\"></core-field-number>\n                          }\n                        </td>\n                      </ng-container>\n                      <ng-container matColumnDef=\"pastPeriod\">\n                        <th mat-header-cell *matHeaderCellDef class=\"cell-with-button\">\n                          @if (report?.isFromExternalSource !== true) {\n                            <span>{{ report?.periods[1]?.description() }}</span>\n                          }\n                          @if (report?.isFromExternalSource === true) {\n                            <span>\n                              <div matTooltip=\"\u041F\u0435\u0440\u0438\u043E\u0434 \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u043D\u0430 \u043E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u0438 \u0434\u0430\u043D\u043D\u044B\u0445 \u0424\u041D\u0421\" matTooltipPosition=\"above\"  >\n                                {{ report?.periods[1]?.description() }} <strong style=\"color:red;\">!</strong>\n                              </div>\n                            </span>\n                          }\n                        </th>\n                        <td mat-cell *matCellDef=\"let row\">\n                          @if (!row.isSection) {\n                            <core-field-number [(ngModel)]=\"row.pastPeriod\" name=\"{{ 'pastPeriod' + row.rowCode }}\" fieldName=\"{{ 'pastPeriod' + row.rowCode }}\" [settings]=\"{ decimals:2 }\" (valueChange)=\"onValuesChange(row.rowCode, report?.periods[1], $event)\"\n                            [disabled]=\"row.isReadonly\" labelClass=\"background-auto-calculate\"></core-field-number>\n                          }\n                        </td>\n                      </ng-container>\n                      <ng-container matColumnDef=\"lastPriod\">\n                        <th mat-header-cell *matHeaderCellDef class=\"cell-with-button\">\n                          @if (report?.isFromExternalSource !== true) {\n                            <span>{{ report?.periods[2]?.description() }}</span>\n                          }\n                          @if (report?.isFromExternalSource === true) {\n                            <span>\n                              <div matTooltip=\"\u041F\u0435\u0440\u0438\u043E\u0434 \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u043D\u0430 \u043E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u0438 \u0434\u0430\u043D\u043D\u044B\u0445 \u0424\u041D\u0421\" matTooltipPosition=\"above\"  >\n                                {{ report?.periods[2]?.description() }} <strong style=\"color:red;\">!</strong>\n                              </div>\n                            </span>\n                          }\n                        </th>\n                        <td mat-cell *matCellDef=\"let row\">\n                          @if (!row.isSection) {\n                            <core-field-number [(ngModel)]=\"row.lastPriod\" name=\"{{ 'lastPriod' + row.rowCode }}\" fieldName=\"{{ 'lastPriod' + row.rowCode }}\" [settings]=\"{ decimals:2 }\" (valueChange)=\"onValuesChange(row.rowCode, report?.periods[2], $event)\"\n                            [disabled]=\"row.isReadonly\" labelClass=\"background-auto-calculate\"></core-field-number>\n                          }\n                        </td>\n                      </ng-container>\n                      <tr mat-header-row *matHeaderRowDef=\"_displayedColumns; sticky: true\"></tr>\n                      <tr mat-row *matRowDef=\"let row; columns: _displayedColumns;\" class=\"grid-element-row\" [class.background-auto-calculate]=\"isAutoCalculatedRow(row)\"></tr>\n                    </table>\n                  </section>\n                </div>\n              </div>\n            </mat-tab>\n          }\n        </mat-tab-group>\n        <mat-paginator style=\"display: none;\" [length]=\"_gridConfig.paginator.total\" [pageSize]=\"_gridConfig.paginator.pageSize\" [pageSizeOptions]=\"[10, 25, 65]\"></mat-paginator>\n      </div>\n    </div>\n  </div>\n</div>\n\n", styles: [".sln-financial-form table strong{color:var(--GRAY-SOFT);font-size:13px}.sln-financial-form table th:after{content:\"\";height:15px;width:1px;padding:0 5px!important}.sln-financial-form table th:last-child{border-right:none}.grid table th{font-size:10px}.mat-mdc-header-cell{background:var(--WHITE)!important}.mat-tab-span{min-width:100%;width:100px;height:39px;text-align:center;padding-top:12px}.sln-container-checkbox{display:flex;flex-direction:column;margin-top:10px;padding:0 23px}.sln-financial-form-dialog .sln-core-field-bool{margin-top:5px;padding-left:0;padding-right:6px;padding-top:0}.sln-financial-form-dialog .core-field-combobox{padding-right:1px;padding-left:6px;margin-top:5px}.sln-financial-form-dialog .mdc-label{font-size:13px}.sln-financial-form-dialog .col-md-12{padding:0}\n", ".background-auto-calculate{background-color:#e2e8ea75}\n"] }]
        }], ctorParameters: () => [{ type: i1.MatDialog }, { type: FinancialStatementSerivce }, { type: i0.ChangeDetectorRef }, { type: i3.PopupResults }], propDecorators: { fileId: [{
                type: Input
            }], multiOrganizationId: [{
                type: Input
            }], inn: [{
                type: Input
            }] } });

class EconomicFinancialStatementWindowOption {
}
class EconomicFinancialStatementWindow {
    constructor(dialogRef, data, _service, _popUp) {
        this.dialogRef = dialogRef;
        this.data = data;
        this._service = _service;
        this._popUp = _popUp;
        this.showCloseConfirmDialog = false;
    }
    save() {
        this._service.saveFinancialReport(this.financialStatement.report).subscribe((response) => this._popUp.HandleIEntityResponse({
            response: response,
            successCallback: (entity) => {
                this.dialogRef.close(entity);
            }
        }));
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EconomicFinancialStatementWindow, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: FinancialStatementSerivce }, { token: i3.PopupResults }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: EconomicFinancialStatementWindow, isStandalone: false, selector: "economic-financial-form-dialog", inputs: { showCloseConfirmDialog: "showCloseConfirmDialog" }, viewQueries: [{ propertyName: "newForm", first: true, predicate: NgForm, descendants: true }, { propertyName: "financialStatement", first: true, predicate: EconomicFinancialFormComponent, descendants: true }], ngImport: i0, template: "<core-dialog [dialogTitle]=\"'\u0424\u0438\u043D\u0430\u043D\u0441\u043E\u0432\u0430\u044F \u043E\u0442\u0447\u0435\u0442\u043D\u043E\u0441\u0442\u044C'\" width=\"1000\" [showCloseConfirmDialog]=\"true\">\n    <div body class=\"sln-financial-body\">\n        <form #newForm=\"ngForm\" novalidate>\n            <economic-financial-form [fileId]=\"data.fileId\" [multiOrganizationId]=\"data.multiOrganizationId\" [inn]=\"data.inn\"></economic-financial-form>\n        </form>\n    </div>\n    <div class=\"sln-max-width sln-economic-approve-container\" footer>\n        <button type=\"button\" class=\"btn-primary sln-economic-approve-button\" (click)=\"save()\" [disabled]=\"newForm.invalid\">\u0421\u0444\u043E\u0440\u043C\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u0435\u0447\u0430\u0442\u043D\u0443\u044E \u0444\u043E\u0440\u043C\u0443</button>\n    </div>\n</core-dialog>\n", styles: [".sln-economic-approve-container{position:relative;margin:10px 0}.sln-economic-approve-items{position:absolute}.sln-economic-approve-button{float:right}\n"], dependencies: [{ kind: "directive", type: i4$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3.CoreDialogWindow, selector: "core-dialog", inputs: ["dialogTitle", "hasCansel", "canselText", "hasFooter", "fullScreen", "width", "minWidth", "hasTitle", "leftMenu", "resizeble", "showTicketsVersions", "showCloseConfirmDialog", "beforeClosed", "cdkDragDisabled"] }, { kind: "component", type: EconomicFinancialFormComponent, selector: "economic-financial-form", inputs: ["fileId", "multiOrganizationId", "inn"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EconomicFinancialStatementWindow, decorators: [{
            type: Component,
            args: [{ selector: 'economic-financial-form-dialog', standalone: false, template: "<core-dialog [dialogTitle]=\"'\u0424\u0438\u043D\u0430\u043D\u0441\u043E\u0432\u0430\u044F \u043E\u0442\u0447\u0435\u0442\u043D\u043E\u0441\u0442\u044C'\" width=\"1000\" [showCloseConfirmDialog]=\"true\">\n    <div body class=\"sln-financial-body\">\n        <form #newForm=\"ngForm\" novalidate>\n            <economic-financial-form [fileId]=\"data.fileId\" [multiOrganizationId]=\"data.multiOrganizationId\" [inn]=\"data.inn\"></economic-financial-form>\n        </form>\n    </div>\n    <div class=\"sln-max-width sln-economic-approve-container\" footer>\n        <button type=\"button\" class=\"btn-primary sln-economic-approve-button\" (click)=\"save()\" [disabled]=\"newForm.invalid\">\u0421\u0444\u043E\u0440\u043C\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u0435\u0447\u0430\u0442\u043D\u0443\u044E \u0444\u043E\u0440\u043C\u0443</button>\n    </div>\n</core-dialog>\n", styles: [".sln-economic-approve-container{position:relative;margin:10px 0}.sln-economic-approve-items{position:absolute}.sln-economic-approve-button{float:right}\n"] }]
        }], ctorParameters: () => [{ type: i1.MatDialogRef }, { type: EconomicFinancialStatementWindowOption, decorators: [{
                    type: Inject,
                    args: [MAT_DIALOG_DATA]
                }] }, { type: FinancialStatementSerivce }, { type: i3.PopupResults }], propDecorators: { showCloseConfirmDialog: [{
                type: Input
            }], newForm: [{
                type: ViewChild,
                args: [NgForm]
            }], financialStatement: [{
                type: ViewChild,
                args: [EconomicFinancialFormComponent]
            }] } });

class FinancialStatementReport {
}
class FinancialStatementRowItem {
}

class EconomicComboboxUriDescriptionService {
    constructor(_startUp) {
        this._startUp = _startUp;
    }
    getUri(code) {
        const urls = [
            { code: 'EconomicUnits', url: () => this._startUp.apiRoot('statements/units/combobox', 'financial') },
            { code: 'TransactionType', url: () => this._startUp.apiRoot('transactions/combobox', 'financial') },
            { code: 'TimeMeasures', url: () => this._startUp.apiRoot('packages/combobox/time-measure', 'financial') },
            { code: 'PaidServices', url: () => this._startUp.apiRoot('paid-services/combobox', 'financial') }
        ];
        const url = urls.filter(x => x.code === code)[0]?.url();
        return url;
    }
    getLocalSourse(code) {
        switch (code) {
            default: {
                return of({ isSuccess: true, message: '', entity: [] });
            }
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EconomicComboboxUriDescriptionService, deps: [{ token: i3.Startup }], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EconomicComboboxUriDescriptionService }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EconomicComboboxUriDescriptionService, decorators: [{
            type: Injectable
        }], ctorParameters: () => [{ type: i3.Startup }] });

class EconomicModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EconomicModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.18", ngImport: i0, type: EconomicModule, declarations: [EconomicFinancialFormComponent,
            EconomicFinancialStatementWindow], imports: [CoreMatModule,
            CoreBaseModule,
            CoreControlModule,
            CoreDialogModule,
            CoreModule], exports: [EconomicFinancialFormComponent,
            EconomicFinancialStatementWindow] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EconomicModule, providers: [
            FinancialStatementSerivce
        ], imports: [CoreMatModule,
            CoreBaseModule,
            CoreControlModule,
            CoreDialogModule,
            CoreModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EconomicModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [
                        CoreMatModule,
                        CoreBaseModule,
                        CoreControlModule,
                        CoreDialogModule,
                        CoreModule
                    ],
                    declarations: [
                        EconomicFinancialFormComponent,
                        EconomicFinancialStatementWindow,
                    ],
                    providers: [
                        FinancialStatementSerivce
                    ],
                    exports: [
                        EconomicFinancialFormComponent,
                        EconomicFinancialStatementWindow
                    ]
                }]
        }] });

/*
 * Public API Surface of sellan-economic
 */

/**
 * Generated bundle index. Do not edit.
 */

export { EconomicComboboxUriDescriptionService, EconomicFinancialFormComponent, EconomicFinancialStatementWindow, EconomicFinancialStatementWindowOption, EconomicModule, FiancialBalance, FinancialPeriod, FinancialReport, FinancialStatementPeriod, FinancialStatementReport, FinancialStatementRowItem, FinancialStatementSerivce };
//# sourceMappingURL=sellan-economic.mjs.map
