<% @invoices.each do |invoice| %>

<%= invoice.supplier.title %>

<% invoice.items.each do |item| %> <% end %> <% @delivery = Delivery.find(:all, :conditions => { :order_id => @order.id, :supplier_id => invoice.supplier_id}) %> <% if @delivery.first.pick_up == true %> <% else %> <% end %>
Product Name Product price Quantity Totals
<%= item.product.name %> <%= "(" + variant_options(item.line_item.variant) + ")" unless item.line_item.variant.option_values.empty? %> <%= number_to_currency(item.line_item.variant.price) %> <%= item.quantity %> <%= number_to_currency(item.line_item.variant.price * item.quantity) %>
Order-total <%= number_to_currency(invoice.invoice_total) %>
-(fee) <%= number_to_currency(invoice.invoice_total * @fee) %>
Sub-total <%= number_to_currency(invoice.invoice_total * (1 - @fee)) %>
Delivery type:Pickup <%= Pickup.find_by_id(@delivery.first.pickup_id).name %> <%= Pickup.find_by_id(@delivery.first.pickup_id).pickup_location.address1 %>, <%= Pickup.find_by_id(@delivery.first.pickup_id).pickup_location.address2 %> - <%= Pickup.find_by_id(@delivery.first.pickup_id).pickup_location.city %>, <%= State.find_by_id(Pickup.find_by_id(@delivery.first.pickup_id).pickup_location.state_id).abbr %> <%= Pickup.find_by_id(@delivery.first.pickup_id).pickup_location.zipcode %> Shipping <%= @delivery.first.shipping_method.name %>
<% end %>