Packing Report: use field name as columns headers in spreadsheet export

This commit is contained in:
Sebastian Castro
2022-04-27 07:50:27 +02:00
committed by Jean-Baptiste Bellet
parent 2008c10c6f
commit b7991e5ae8

View File

@@ -35,6 +35,13 @@ module Reporting
{ price: :currency, quantity: :quantity }
end
def custom_headers
return {} if html_render?
# Use non translated headers to avoid breaking changes
@custom_headers ||= report_data.columns.index_by(&:itself).symbolize_keys
end
private
def select_fields