

-price_line_block = @p_customer_sheet.price_line_block

.price_line_block_recap
  %table{:style => "width:100%;"}
    %thead
      %tr
        %th
        %th Désignation
        %th Quantité


        %th TVA

        %th
          Montant HT
        %th
          Montant TTC
    %tbody
      -price_line_block.price_lines.each do |price_line|
        %tr
          %td.td_img
            -if price_line.img
              =image_tag("http#{("s" if Rails.env.production?)}://"+HOSTNAME+price_line.img.file.square.url, :style => "width:120px;")
          %td
            =price_line.title
            -if price_line.p_vourchers.count > 0
              %br
              Numéros de bon d'achat générés :
              =price_line.p_vourchers.map{|v| v.token}.join(", ")



          %td.numeraire
            =price_line.qte



          %td.numeraire
            =price_line.tva_account_value.to_s+"%"

          %td.numeraire
            =number_to_currency price_line.tot_amount_ht, :unit => price_line_block.p_devise.symbol

          %td.numeraire
            =number_to_currency price_line.tot_amount_ttc, :unit => price_line_block.p_devise.symbol


    %table.table{:style => "width:auto;float:right;"}


      -if price_line_block.tot_discount_ht != 0.0
        %tr
          %th
            Remise commerciale exceptionnelle (HT
            ="(#{price_line_block.ct_tot_discount_percent}%)"
          %td.numeraire
            =number_to_currency price_line_block.tot_discount_ht, :unit => price_line_block.p_devise.symbol

      %tr
        %th
          Frais de port TTC

        %td.numeraire
          =number_to_currency price_line_block.tot_fdp_ttc, :unit => price_line_block.p_devise.symbol


      %tr
        %th
          Total TTC
        %td.numeraire
          =number_to_currency price_line_block.tot_amount_ttc, :unit => price_line_block.p_devise.symbol

%p{:style => "clear:both;"}

