mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge pull request #9268 from jibees/9267-Wrong-report-when-selecting-multiple-shops
Split orders across several shops of same order cycle instead of aggregating in several Orders and Fulfilment reports
This commit is contained in:
@@ -21,6 +21,12 @@ module Reporting
|
||||
report_line_items.orders
|
||||
end
|
||||
|
||||
def query_result
|
||||
report_line_items.list(line_item_includes).group_by { |e|
|
||||
[e.variant_id, e.price, e.order.distributor_id]
|
||||
}.values
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def order_permissions
|
||||
|
||||
@@ -44,12 +44,6 @@ module Reporting
|
||||
variant: [{ option_values: :option_type }, { product: :supplier }]
|
||||
}]
|
||||
end
|
||||
|
||||
def query_result
|
||||
report_line_items.list(line_item_includes).group_by { |e|
|
||||
[e.variant_id, e.price]
|
||||
}.values
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -35,12 +35,6 @@ module Reporting
|
||||
def line_item_includes
|
||||
[{ variant: [{ option_values: :option_type }, { product: :supplier }] }]
|
||||
end
|
||||
|
||||
def query_result
|
||||
report_line_items.list(line_item_includes).group_by { |e|
|
||||
[e.variant_id, e.price]
|
||||
}.values
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -42,12 +42,6 @@ module Reporting
|
||||
[{ order: :distributor,
|
||||
variant: [{ option_values: :option_type }, { product: :supplier }] }]
|
||||
end
|
||||
|
||||
def query_result
|
||||
report_line_items.list(line_item_includes).group_by { |e|
|
||||
[e.variant_id, e.price]
|
||||
}.values
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user