Fix order_cycle_management_report shipping methods filter

The original fix to adapt to v2 was wrong and still using deprecated order.shipping_method_id, this new version is now filtering the correct shipping_method_id in shipping_rates
This commit is contained in:
luisramos0
2019-01-23 16:43:17 +00:00
parent d8710d283a
commit 40014b83bd

View File

@@ -107,7 +107,7 @@ module OpenFoodNetwork
def filter_to_shipping_method(orders)
if params[:shipping_method_in].present?
orders.joins(shipments: :shipping_methods).where(shipping_method_id: params[:shipping_method_in])
orders.joins(shipments: :shipping_rates).where(spree_shipping_rates: { shipping_method_id: params[:shipping_method_in] })
else
orders
end