SU2-33 | Отображение пояснений
This commit is contained in:
@@ -34,9 +34,9 @@ a.link:hover {
|
|||||||
.informations-data {
|
.informations-data {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 90%;
|
width: 95%;
|
||||||
min-width: 300px;
|
min-width: 300px;
|
||||||
max-width: 1400px;
|
max-width: 1500px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding-bottom: inherit;
|
padding-bottom: inherit;
|
||||||
}
|
}
|
||||||
@@ -85,6 +85,10 @@ a.link:hover {
|
|||||||
width: 35%;
|
width: 35%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.description {
|
||||||
|
width: 15%;
|
||||||
|
}
|
||||||
|
|
||||||
.type_doc_header#tabs {
|
.type_doc_header#tabs {
|
||||||
width: 75%;
|
width: 75%;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class OrganisationsController < ApplicationController
|
class OrganisationsController < ApplicationController
|
||||||
before_action :set_organisation, only: [:show, :destroy, :reload]
|
before_action :set_organisation, :set_report_codes, only: [:show, :destroy, :reload]
|
||||||
|
|
||||||
DOC_TYPES = {
|
DOC_TYPES = {
|
||||||
0 => { title: 'Бухгалтерский баланс', form_code: '1.1' },
|
0 => { title: 'Бухгалтерский баланс', form_code: '1.1' },
|
||||||
@@ -37,7 +37,9 @@ class OrganisationsController < ApplicationController
|
|||||||
@doc_name = selected_doc[:title]
|
@doc_name = selected_doc[:title]
|
||||||
@current_doc_info1 = grouped_rows[@doc_name]
|
@current_doc_info1 = grouped_rows[@doc_name]
|
||||||
if !@current_doc_info1.values.first.nil?
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -59,6 +61,10 @@ class OrganisationsController < ApplicationController
|
|||||||
@org = Organization.find(params[:id])
|
@org = Organization.find(params[:id])
|
||||||
end
|
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)
|
def build_organization_payload(years)
|
||||||
russian_names = {
|
russian_names = {
|
||||||
'inn' => 'ИНН',
|
'inn' => 'ИНН',
|
||||||
@@ -77,7 +83,9 @@ class OrganisationsController < ApplicationController
|
|||||||
}
|
}
|
||||||
|
|
||||||
DOC_TYPES.each_value do |doc_type|
|
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)
|
column_header_for(doc_type[:form_code], year)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -40,6 +40,8 @@
|
|||||||
tr
|
tr
|
||||||
td = key[0]
|
td = key[0]
|
||||||
td = key[1]
|
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|
|
- @current_doc_info1[key].each_with_index do |value, index|
|
||||||
- key_group = key[1].nil? ? nil : group_key(key[1])
|
- key_group = key[1].nil? ? nil : group_key(key[1])
|
||||||
- if min_max_data.has_key?(key_group) && keep_code?(key[1])
|
- if min_max_data.has_key?(key_group) && keep_code?(key[1])
|
||||||
|
|||||||
Reference in New Issue
Block a user