mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-11 23:17:48 +00:00
16 lines
453 B
Ruby
16 lines
453 B
Ruby
# frozen_string_literal: true
|
|
|
|
module ReportsHelper
|
|
def report_order_cycle_options(order_cycles)
|
|
order_cycles.map do |oc|
|
|
orders_open_at = oc.orders_open_at&.to_s(:short) || 'NA'
|
|
orders_close_at = oc.orders_close_at&.to_s(:short) || 'NA'
|
|
["#{oc.name} (#{orders_open_at} - #{orders_close_at})".html_safe, oc.id]
|
|
end
|
|
end
|
|
|
|
def report_subtypes(report)
|
|
Reporting::ReportLoader.new(report).report_subtypes
|
|
end
|
|
end
|