From e682897dcef6c33b0a81ebab4ea381618efe09f6 Mon Sep 17 00:00:00 2001 From: ARLakhin Date: Mon, 27 Apr 2026 13:43:54 +0300 Subject: [PATCH] =?UTF-8?q?SU2-33=20|=20=D0=9E=D1=82=D0=BE=D0=B1=D1=80?= =?UTF-8?q?=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=D1=8F=D1=81?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/stylesheets/main.scss | 8 ++++++-- app/controllers/organisations_controller.rb | 14 +++++++++++--- app/views/organisations/show.html.slim | 2 ++ 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/main.scss b/app/assets/stylesheets/main.scss index 5fcbdcc..a6a9903 100644 --- a/app/assets/stylesheets/main.scss +++ b/app/assets/stylesheets/main.scss @@ -34,9 +34,9 @@ a.link:hover { .informations-data { display: flex; flex-direction: column; - width: 90%; + width: 95%; min-width: 300px; - max-width: 1400px; + max-width: 1500px; margin: 0 auto; padding-bottom: inherit; } @@ -85,6 +85,10 @@ a.link:hover { width: 35%; } +.description { + width: 15%; +} + .type_doc_header#tabs { width: 75%; margin: 0 auto; diff --git a/app/controllers/organisations_controller.rb b/app/controllers/organisations_controller.rb index a6b00d4..a4e1160 100644 --- a/app/controllers/organisations_controller.rb +++ b/app/controllers/organisations_controller.rb @@ -1,5 +1,5 @@ class OrganisationsController < ApplicationController - before_action :set_organisation, only: [:show, :destroy, :reload] + before_action :set_organisation, :set_report_codes, only: [:show, :destroy, :reload] DOC_TYPES = { 0 => { title: 'Бухгалтерский баланс', form_code: '1.1' }, @@ -37,7 +37,9 @@ class OrganisationsController < ApplicationController @doc_name = selected_doc[:title] @current_doc_info1 = grouped_rows[@doc_name] if !@current_doc_info1.values.first.nil? - @current_doc_info = @info_about_organisation[@doc_name][0..@current_doc_info1.values.first.size + 1] + number_of_columns = @current_doc_info1.values.first.size + 1 + number_of_columns += 1 if @type_doc < 2 + @current_doc_info = @info_about_organisation[@doc_name][0..number_of_columns] end end @@ -59,6 +61,10 @@ class OrganisationsController < ApplicationController @org = Organization.find(params[:id]) end + def set_report_codes + @report_codes = ReportCode.all.filter_map { |report_code| [report_code.code, report_code.description] if report_code.code.match?(/\A[12]/) }.to_h + end + def build_organization_payload(years) russian_names = { 'inn' => 'ИНН', @@ -77,7 +83,9 @@ class OrganisationsController < ApplicationController } DOC_TYPES.each_value do |doc_type| - payload[doc_type[:title]] = ['Наименование показателя', 'Код'] + years.map do |year| + first_headers = ['Наименование показателя', 'Код'] + first_headers << 'Пояснения' if ['Бухгалтерский баланс', 'Отчёт о финансовых результатах'].include?(doc_type[:title]) + payload[doc_type[:title]] = first_headers + years.map do |year| column_header_for(doc_type[:form_code], year) end end diff --git a/app/views/organisations/show.html.slim b/app/views/organisations/show.html.slim index ad5e286..d7bf58d 100644 --- a/app/views/organisations/show.html.slim +++ b/app/views/organisations/show.html.slim @@ -40,6 +40,8 @@ tr td = key[0] td = key[1] + -if @report_codes.has_key?(key[1]) + td.description = @report_codes[key[1]] - @current_doc_info1[key].each_with_index do |value, index| - key_group = key[1].nil? ? nil : group_key(key[1]) - if min_max_data.has_key?(key_group) && keep_code?(key[1])