SU2-33 | Фикс критических и серьёзных ошибок, удаление/перезагрузка организации, пагинация, favicon

This commit is contained in:
Dmitry
2026-04-21 07:54:59 +00:00
parent a1cbddf4e2
commit 136de5f238
12 changed files with 127 additions and 28 deletions
+9 -7
View File
@@ -33,17 +33,19 @@ class ReportParser
parsed_forms = parse_forms
save_aggregated_statements(parsed_forms)
end
ensure
@tempfile&.close!
end
private
def spreadsheet
@spreadsheet ||= begin
tempfile = Tempfile.new(['report', '.xlsx'])
tempfile.binmode
@yearly_file.file.download { |chunk| tempfile.write(chunk) }
tempfile.rewind
Roo::Excelx.new(tempfile.path)
@tempfile = Tempfile.new(['report', '.xlsx'])
@tempfile.binmode
@yearly_file.file.download { |chunk| @tempfile.write(chunk) }
@tempfile.rewind
Roo::Excelx.new(@tempfile.path)
end
end
@@ -202,7 +204,7 @@ class ReportParser
end
def report_codes
@report_codes ||= ReportCode.select(:code, :name).to_a
@report_codes ||= ReportCode.select(:code, :name).order(:id).to_a
end
def report_codes_for_form(form_code, codes)
@@ -229,7 +231,7 @@ class ReportParser
.where(sheet_number: year)
.where(yearly_files: { organization_id: @yearly_file.organization_id })
.where.not(id: keeper_id)
.delete_all
.destroy_all
end
end