%table.order-summary{:width => "100%"}
  %thead
    %tr
      %th{:align => "left"}
        %h4= t(:invoice_column_item)
      %th{:align => "right", :width => "15%"}
        %h4= t(:invoice_column_qty)
      %th{:align => "right", :width => "15%"}
        %h4= @order.total_tax > 0 ? t(:invoice_column_tax) : ""
      %th{:align => "right", :width => "15%"}
        %h4= t(:invoice_column_price)
  %tbody
    - @order.sorted_line_items.each do |item|
      %tr
        %td
          = render 'spree/shared/line_item_name', line_item: item
          %br
          %small
            %em= item.variant.supplier.name
        %td{:align => "right"}
          = item.quantity
        %td{:align => "right"}
          = display_line_items_taxes(item)
        %td{:align => "right"}
          = item.display_amount_with_adjustments
      
    - checkout_adjustments_for(@order, exclude: [:line_item]).reverse_each do |adjustment|
      - taxable = adjustment.adjustable_type == "Spree::Shipment" ? adjustment.adjustable : adjustment
      %tr
        %td
          %strong= adjustment.label
        %td{:align => "right"}
          1
        %td{:align => "right"}
          = display_taxes(taxable, display_zero: false)
        %td{:align => "right"}
          = adjustment.display_amount
  %tfoot
    %tr
      %td{:align => "right", :colspan => "2"}
        %strong= t(:invoice_tax_total)
      %td{:align => "right", :colspan => "2"}
        %strong= display_checkout_tax_total(@order)
    %tr
      %td{:align => "right", :colspan => "2"}
        %strong= t(:total_excl_tax)
      %td{:align => "right", :colspan => "2"}
        %strong= display_checkout_total_less_tax(@order)
    %tr
      %td{:align => "right", :colspan => "2"}
        %strong= t(:total_incl_tax)
      %td{:align => "right", :colspan => "2"}
        %strong= @order.display_total
%p
  &nbsp;
