mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Merge pull request #4162 from okriuchykhin/ok_SCI_6907
Fix repository export with enabled stock management [SCI-6907]
This commit is contained in:
commit
49f05f3df9
1 changed files with 3 additions and 3 deletions
|
@ -31,15 +31,15 @@ module RepositoryZipExport
|
|||
zip = ZipExport.create(user: current_user)
|
||||
zip.generate_exportable_zip(
|
||||
current_user,
|
||||
to_csv(rows, params[:header_ids], current_user, repository),
|
||||
to_csv(rows, params[:header_ids], current_user, repository, nil, params[:my_module_id].present?),
|
||||
:repositories
|
||||
)
|
||||
end
|
||||
|
||||
def self.to_csv(rows, column_ids, user, repository, handle_file_name_func = nil)
|
||||
def self.to_csv(rows, column_ids, user, repository, handle_file_name_func = nil, in_module = false)
|
||||
# Parse column names
|
||||
csv_header = []
|
||||
add_consumption = !repository.is_a?(RepositorySnapshot) && repository.has_stock_management?
|
||||
add_consumption = in_module && !repository.is_a?(RepositorySnapshot) && repository.has_stock_management?
|
||||
column_ids.each do |c_id|
|
||||
csv_header << case c_id.to_i
|
||||
when -1, -2
|
||||
|
|
Loading…
Reference in a new issue