Add order cycle selection to Order Cycles Report

This commit is contained in:
David Cook
2013-08-13 15:45:15 +10:00
parent 886ac4a892
commit 6bad6e2675
2 changed files with 8 additions and 0 deletions

View File

@@ -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]

View File

@@ -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))