SU2-33 | Фикс критических и серьёзных ошибок, удаление/перезагрузка организации, пагинация, favicon
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user