diff --git a/dokogen/ui.py b/dokogen/ui.py index 009447f..d4b0596 100644 --- a/dokogen/ui.py +++ b/dokogen/ui.py @@ -2052,6 +2052,11 @@ class DokoGenApp: messagebox.showerror("Ошибка", f"Не удалось загрузить таблицу ПП 127: {e}") return + # Текущий объект КИИ (для авторасчёта п. 8/9: доходы, ущерб, балансовая стоимость) + isys = None + if self._current_is_idx is not None and self._current_is_idx < len(self.model.information_systems): + isys = self.model.information_systems[self._current_is_idx] + # Применимость показателей по сфере объекта (Распоряжение ПРФ № 360-р) applicable = None # None = все показатели применимы try: @@ -2516,10 +2521,10 @@ class DokoGenApp: e_profit = e_tax = None # Доходы за 5 лет — из данных организации (поля «Доходы за 5 лет») - _incs = [_num2(getattr(self.model, f'income_year_{i}', '') or '') for i in range(1, 6)] + _incs = [_num(getattr(self.model, f'income_year_{i}', '') or '') for i in range(1, 6)] _incs = [x for x in _incs if x is not None] _d_avg = (sum(_incs) / len(_incs)) if _incs else None - _d_loss = _num2(getattr(self.model, 'income_loss', '') or '') + _d_loss = _num(getattr(self.model, 'income_loss', '') or '') e_dincome = _row("Суммарный экономический ущерб от нарушения критических процессов (руб.):", 'dincome', f"{_d_loss:,.0f}" if _d_loss else '') e_budget = _row("Доходы субъекта КИИ, усреднённые за 5 лет (руб.):",