diff --git a/lib/open_food_web/order_and_distributor_report.rb b/lib/open_food_web/order_and_distributor_report.rb index 1e104ee88d..9ed4ad39a9 100644 --- a/lib/open_food_web/order_and_distributor_report.rb +++ b/lib/open_food_web/order_and_distributor_report.rb @@ -9,7 +9,7 @@ module OpenFoodWeb def header ["Order date", "Order Id", "Customer Name","Customer Email", "Customer Phone", "Customer City", - "SKU", "Item name", "Variant", "Quantity", "Cost", "Shipping cost", + "SKU", "Item name", "Variant", "Quantity", "Max Quantity", "Cost", "Shipping cost", "Payment method", "Distributor", "Distributor address", "Distributor city", "Distributor postcode", "Shipping instructions"] end @@ -20,7 +20,7 @@ module OpenFoodWeb order.line_items.each do |line_item| order_and_distributor_details << [order.created_at, order.id, order.bill_address.full_name, order.email, order.bill_address.phone, order.bill_address.city, - line_item.product.sku, line_item.product.name, line_item.variant.options_text, line_item.quantity, line_item.price * line_item.quantity, line_item.itemwise_shipping_cost, + line_item.product.sku, line_item.product.name, line_item.variant.options_text, line_item.quantity, line_item.max_quantity, line_item.price * line_item.quantity, line_item.itemwise_shipping_cost, order.payments.first.payment_method.name, order.distributor.name, order.distributor.pickup_address.address1, order.distributor.pickup_address.city, order.distributor.pickup_address.zipcode, order.special_instructions ] end diff --git a/spec/lib/open_food_web/order_and_distributor_report_spec.rb b/spec/lib/open_food_web/order_and_distributor_report_spec.rb index 5daa89cfad..c79506563e 100644 --- a/spec/lib/open_food_web/order_and_distributor_report_spec.rb +++ b/spec/lib/open_food_web/order_and_distributor_report_spec.rb @@ -27,7 +27,7 @@ module OpenFoodWeb header = subject.header header.should == ["Order date", "Order Id", "Customer Name","Customer Email", "Customer Phone", "Customer City", - "SKU", "Item name", "Variant", "Quantity", "Cost", "Shipping cost", + "SKU", "Item name", "Variant", "Quantity", "Max Quantity", "Cost", "Shipping cost", "Payment method", "Distributor", "Distributor address", "Distributor city", "Distributor postcode", "Shipping instructions"] end @@ -39,7 +39,7 @@ module OpenFoodWeb table[0].should == [@order.created_at, @order.id, @bill_address.full_name, @order.email, @bill_address.phone, @bill_address.city, - @line_item.product.sku, @line_item.product.name, @line_item.variant.options_text, @line_item.quantity, @line_item.price * @line_item.quantity, @line_item.itemwise_shipping_cost, + @line_item.product.sku, @line_item.product.name, @line_item.variant.options_text, @line_item.quantity, @line_item.max_quantity, @line_item.price * @line_item.quantity, @line_item.itemwise_shipping_cost, @payment_method.name, @distributor.name, @distributor.pickup_address.address1, @distributor.pickup_address.city, @distributor.pickup_address.zipcode, @shipping_instructions ] end @@ -48,4 +48,4 @@ module OpenFoodWeb end end -end \ No newline at end of file +end