Files
finreport-analyzer/app/views/organisations/show.html.slim
T

57 lines
3.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
.header
.header-title
= "Организация"
.main-container
- unless @info_about_organisation.any?
= 'У данной организации пока не загружена отчетность'
- else
- min_max_data = prepare_data(@current_doc_info1)
- comparsion_data = prepare_data(@current_doc_info1, type_data: 'comparsion')
.informations-data
h2
= "Сведения об организации"
.information-data
- @info_about_organisation["Сведения об организации"].each do |key, value|
.information-elem
= "#{key}: #{value}"
.organisation-actions
= link_to "/organisations/#{@org.id}/reload",
class: 'link-action',
data: { turbo_method: :post, turbo_confirm: 'Перекачать данные с nalog.gov.ru?' } do
i.bi.bi-arrow-clockwise
|  Обновить данные
= link_to "/organisations/#{@org.id}",
class: 'link-action link-action--danger',
data: { turbo_method: :delete, turbo_confirm: 'Удалить организацию и все её данные? Это действие необратимо.' } do
i.bi.bi-trash
|  Удалить
= render 'organisations/templates/type_doc', target: "type_doc_#{@type_doc}", org_id: "#{@org.id}"
h2
= "#{@doc_name}"
- if @current_doc_info.present?
.information-table
table
thead
tr
- @current_doc_info.each do |header|
th = header
tbody
- @current_doc_info1.keys.each do |key|
tr
td = key[0]
td = 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])
- min_value = min_max_data[key_group][index + 1][:min]
- max_value = min_max_data[key_group][index + 1][:max]
- p50 = min_max_data[key_group][index + 1][:p50]
- color = get_color_for_cell(value, min: min_value, median: p50, max: max_value)
td style="background-color: #{color}" = value
- elsif comparsion_data.has_key?(key[1]) && keep_code?(key[1], type_data: 'comparsion')
- condition = comparsion_data[key[1]][index]
= get_arrow_for_cell(value, condition)
- else
td = value
- else
h3 = "Нет данных"