Draft PR with potential fix to the reports S1. Untested.

This commit is contained in:
lin-d-hop
2022-05-25 22:08:05 +01:00
parent cb6cb05eca
commit fb2279d26d
5 changed files with 24 additions and 6 deletions

View File

@@ -21,12 +21,6 @@ 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_id]
}.values
end
private
def order_permissions

View File

@@ -95,6 +95,12 @@ module Reporting
:user, :distributor, :shipments] }]
end
def query_result
report_line_items.list(line_item_includes).group_by { |e|
[e.variant_id, e.price, e.order_id]
}.values
end
private
def row_header(row)

View File

@@ -44,6 +44,12 @@ 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

View File

@@ -35,6 +35,12 @@ 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

View File

@@ -42,6 +42,12 @@ 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