mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-28 01:53:25 +00:00
Update reports
This commit is contained in:
@@ -23,8 +23,8 @@ module Reporting
|
||||
reflect query.join(association(Spree::Product, :supplier, supplier_alias))
|
||||
end
|
||||
|
||||
def joins_product_shipping_category
|
||||
reflect query.join(association(Spree::Product, :shipping_category))
|
||||
def joins_variant_shipping_category
|
||||
reflect query.join(association(Spree::Variant, :shipping_category))
|
||||
end
|
||||
|
||||
def joins_order_and_distributor
|
||||
|
||||
@@ -26,7 +26,7 @@ module Reporting
|
||||
|
||||
def has_temperature_controlled_items?(order)
|
||||
order.line_items.any? { |line_item|
|
||||
line_item.product.shipping_category&.temperature_controlled
|
||||
line_item.variant.shipping_category&.temperature_controlled
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -19,7 +19,7 @@ module Reporting
|
||||
joins_variant.
|
||||
joins_variant_product.
|
||||
joins_product_supplier.
|
||||
joins_product_shipping_category.
|
||||
joins_variant_shipping_category.
|
||||
selecting(select_fields).
|
||||
ordered_by(ordering_fields)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user