mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Add order cycle selection to Order Cycles Report
This commit is contained in:
@@ -347,6 +347,8 @@ Spree::Admin::ReportsController.class_eval do
|
||||
#payments = orders.map { |o| o.payments.select { |payment| payment.completed? } }.flatten # Only select completed payments
|
||||
|
||||
@distributors = Enterprise.is_distributor
|
||||
#@suppliers = Enterprise.is_primary_producer
|
||||
@order_cycles = OrderCycle.all
|
||||
@report_type = params[:report_type]
|
||||
|
||||
case params[:report_type]
|
||||
|
||||
@@ -13,6 +13,12 @@
|
||||
%br
|
||||
= label_tag nil, "Distributor: "
|
||||
= f.collection_select(:distributor_id_eq, @distributors, :id, :name, :include_blank => @include_blank)
|
||||
/%br
|
||||
=# label_tag nil, "Supplier: "
|
||||
=# f.collection_select(:supplier_id_eq, @suppliers, :id, :name, :include_blank => @include_blank)
|
||||
%br
|
||||
= label_tag nil, "Order Cycle: "
|
||||
= f.collection_select(:order_cycle_id_eq, @order_cycles, :id, :name, :include_blank => @include_blank)
|
||||
%br
|
||||
= label_tag nil, "Report Type: "
|
||||
= select_tag(:report_type, options_for_select([['Order Cycle Supplier Totals',:order_cycle_supplier_totals], ['Order Cycle Supplier Totals by Distributor',:order_cycle_supplier_totals_by_distributor], ['Order Cycle Distributor Totals by Supplier',:order_cycle_distributor_totals_by_supplier], ['Order Cycle Customer Totals',:order_cycle_customer_totals]], @report_type))
|
||||
|
||||
Reference in New Issue
Block a user