%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= t(:invoice_column_weight_volume)
      %th{:align => "right", :width => "15%"}
        %h5= t(:invoice_column_price_per_unit_without_taxes)
      %th{:align => "right", :width => "15%"}
        %h5= t(:invoice_column_price_without_taxes)
      %th{:align => "right", :width => "15%"}
        %h5= t(:invoice_column_tax_rate)
      %th{:align => "right", :width => "15%"}
        %h5= t(:invoice_column_price_with_taxes)
  %tbody
    - @order.sorted_line_items.each do |item|
      %tr
        %td
          = render 'spree/admin/orders/_invoice/line_item_name', line_item: item
          %br
          %small
            %em= item.variant.product.supplier.name
        %td{:align => "right"}
          = item.quantity
        %td{:align => "right"}
          = item.unit_presentation
        %td{:align => "right"}
          = item.single_display_amount_with_adjustments
        %td{:align => "right"}
          = item.display_amount_with_adjustments_without_taxes
        %td{:align => "right"}
          = @order.display_line_item_tax_rate(item)
        %td{:align => "right"}
          = item.display_amount_with_adjustments_and_with_taxes
    %tr
      %td
        %strong= "#{@order.shipping_method.category} "
        = "(#{@order.shipping_method.name})"
      %td{:align => "right"}
      %td{:align => "right"}
      %td{:align => "right"}
      %td{:align => "right"}
        = @order.display_shipment_amount_without_taxes
      %td{:align => "right"}
        = @order.display_shipment_tax_rates
      %td{:align => "right"}
        = @order.display_shipment_amount_with_taxes
    - @order.checkout_adjustments(exclude: [:line_item, :shipment]).reverse_each do |adjustment|
      %tr
        %td
          %strong= adjustment.label
        %td{:align => "right"}
        %td{:align => "right"}
        %td{:align => "right"}
        %td{:align => "right"}
          = adjustment.display_amount_without_taxes
        %td{:align => "right"}
          = adjustment.display_adjustment_tax_rates
        %td{:align => "right"}
          = adjustment.display_amount_with_taxes
  %tfoot
    %tr
      %td{:align => "right", :colspan => "5"}
        %strong= t(:total_excl_tax)
      %td{:align => "right", :colspan => "2"}
        %strong= @order.display_checkout_total_less_tax
    - @order.display_checkout_taxes_hash.each do |tax|
      %tr
        %td{:align => "right", :colspan => "5"}
          = t(:tax_total, rate: tax[:percentage])
        %td{:align => "right", :colspan => "2"}
          = tax[:amount]
    %tr
      %td{:align => "right", :colspan => "5"}
        = t(:total_all_tax)
      %td{:align => "right", :colspan => "2"}
        =  @order.display_tax_adjustment_total
      
    %tr
      %td{:align => "right", :colspan => "5"}
        %strong= t(:total_incl_tax)
      %td{:align => "right", :colspan => "2"}
        %strong=  @order.display_total
%p
  &nbsp;
