%table.order-summary{:width => "100%"}
  %thead
    %tr
      %th{:align => "left"}
        %h5= t(:invoice_column_item)
      %th{:align => "right", :width => "15%"}
        %h5= t(:invoice_column_qty)
      %th{:align => "right", :width => "15%"}
        %h5= @order.has_taxes_included ? t(:invoice_column_unit_price_with_taxes) : t(:invoice_column_unit_price_without_taxes)
      %th{:align => "right", :width => "15%"}
        %h5= @order.has_taxes_included ? t(:invoice_column_price_with_taxes) : t(:invoice_column_price_without_taxes)
      - if @order.total_tax > 0
        %th{:align => "right", :width => "15%"}
          %h5= t(:invoice_column_tax_rate)
  %tbody
    - @order.line_items.sort_by{ |li| li.product.name }.each do |item|
      %tr
        %td
          = render 'spree/shared/line_item_name', line_item: item
          %br
          %small
            %em= raw(item.variant.product.supplier.name)
        %td{:align => "right"}
          = item.quantity
        %td{:align => "right"}
          = item.single_display_amount_with_adjustments
        %td{:align => "right"}
          = item.display_amount_with_adjustments
        - if @order.total_tax > 0
          %td{:align => "right"}
            = display_line_item_tax_rates(item)
    - checkout_adjustments_for(@order, exclude: [:line_item]).reject{ |a| a.amount == 0 }.reverse_each do |adjustment|
      %tr
        %td
          %strong= "#{raw(adjustment.label)}"
        %td{:align => "right"}
        %td{:align => "right"}
        %td{:align => "right"}
          = adjustment.display_amount
        - if @order.total_tax > 0
          %td{:align => "right"}
            = display_adjustment_tax_rates(adjustment)
  %tfoot
    %tr
      %td{:align => "right", :colspan => "3"}
        %strong= @order.has_taxes_included ? t(:total_incl_tax) : t(:total_excl_tax)
      %td{:align => "right", :colspan => "2"}
        %strong= @order.has_taxes_included ? @order.display_total : display_checkout_total_less_tax(@order)
    - display_checkout_taxes_hash(@order).each do |tax_rate, tax_value|
      %tr
        %td{:align => "right", :colspan => "3"}
          = t(:tax_total, rate: tax_rate)
        %td{:align => "right", :colspan => "2"}
          = tax_value
    %tr
      %td{:align => "right", :colspan => "3"}
        = @order.has_taxes_included ? t(:total_excl_tax) : t(:total_incl_tax)
      %td{:align => "right", :colspan => "2"}
        = @order.has_taxes_included ? display_checkout_total_less_tax(@order) : @order.display_total
%p
  &nbsp;
