mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
List each order only once in report
This commit is contained in:
@@ -34,7 +34,9 @@ module OpenFoodNetwork
|
||||
end
|
||||
|
||||
def search
|
||||
@permissions.visible_orders.complete.not_state(:canceled).search(@params[:q])
|
||||
@permissions.visible_orders.select("DISTINCT spree_orders.*").
|
||||
complete.not_state(:canceled).
|
||||
search(@params[:q])
|
||||
end
|
||||
|
||||
def table
|
||||
|
||||
@@ -73,14 +73,12 @@ module OpenFoodNetwork
|
||||
end
|
||||
|
||||
it "prints one row per line item" do
|
||||
pending "Each line item is shown multiple times when there is more than one item in the order"
|
||||
|
||||
create(:line_item_with_shipment, order: order)
|
||||
|
||||
subject = OrderAndDistributorReport.new(create(:admin_user), {}, true)
|
||||
|
||||
table = subject.table
|
||||
expect(table.size).to eq 2 # currently 4
|
||||
expect(table.size).to eq 2
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user