Merge pull request #9945 from jibees/9944-translate-columns-in-packing-and-xero-reports

Packing reports: translate columns name in the columns selector component
This commit is contained in:
Konrad
2022-11-09 09:55:21 +01:00
committed by GitHub
2 changed files with 1 additions and 8 deletions

View File

@@ -15,7 +15,7 @@ module Reporting
end
def html_render?
@report.params[:report_format].in?(['', 'pdf'])
@report.params[:report_format].in?([nil, '', 'pdf'])
end
def display_header_row?

View File

@@ -29,13 +29,6 @@ module Reporting
{ 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
def default_params
# Prevent breaking change in this report by hidding new columns by default
{ fields_to_hide: ["phone", "price"],