!!!
%html
  %head

    %meta{:"http-equiv" => "Content-Type", :content=>"text/html; charset=UTF-8"}
    %meta{:name=>"viewport", :content=>"width=device-width,initial-scale=1"}
    :css
      body{
        font-size:11pt;
        padding :0px;
        margin:0px;
        background-color: transparent; 
        
        font-family:"Arial" ;
      }
      #main{
        //margin-left:4.2cm;
        
      }
      td, th{
          //border:1px solid black;
          padding:5px;
          vertical-align:top;
      
        }
      th{
        font-weight:normal;
        border-bottom:1px solid gray;
        text-align:right;
      }
        
      table{
        border-collapse:collapse;
    
      }
      
      tr{
        page-break-inside:avoid; 
      
      }
      
      #bottom{
      page-break-inside:avoid; 
      
      }
      .right{
        text-align:right;
        
      }
      .line p{
        margin:0px;
      }
      .description{
        padding-top:2pt;
        display:block;
      
      }
      
      .bot_separate{
        height:50pt;
      
      }
      

      
   
      

      
    
  
  %body
    #main
      %div{:style => "height:2cm;"}

      
      #document_info{:style => "position:absolute;top:2cm;left:12cm;"}
        ="Facture n°#{@order.bill_number}"
        %br
        ="Le #{l(@order.paid_at, :format => :date)}"
      #recipient_address{:style => "position:absolute;top:5cm;left:12cm;"}
        -if @order.organisation?
          =@order.organisation
          
        -else
          =@order.firstname
          =@order.annonce_account.name
        
        %br
        =@order.address
        %br
        -if @order.address2?
          =@order.address2
          %br
        
        =@order.cp
        =@order.city
        %br
        =@order.country
        
        
     
      #header{:style => ""}
      
        
      
      %div{:style => "margin-top:8cm;margin-left:1cm;margin-right:1cm;margin-bottom:0cm;position:relative;"}
        %table.document_elements{:style => "width:100%"}
          %tr
            %th{:style => "text-align:left;"} Description
            %th{:style => "width:17%"} Prix HT

      
          %tr.line
            %td
              %strong
                =qit("orders-bill-achat", "Achat d'un coffret de")
                =@order.nbr_credits
                =qit("orders-bill-crédit", "crédits sur Sideplace.com") 
               
            
            %td.right
              =number_to_currency @order.amount_ht




        %table#bottom{:style => "width:5cm;position:absolute;right:1cm;margin-top:1cm;"}
          


          %tr.bot
        
            %td.white

              Total HT
            %td.white{:style => "text-align:right;"}
              %strong
                =number_to_currency @order.amount_ht
            




        
          %tr.bot

            %td.white
              TVA
              (
              20%
              )
            %td.white{:style => "text-align:right;"}
              =number_to_currency @order.amount_ttc - @order.amount_ht



          %tr
      
    
            %td

              =qit("orders-bill-total-ttc", "Total TTC")
            %td{:style => "text-align:right;"}
              %strong
                =number_to_currency @order.amount_ttc
              
              
 
      #footer{:style => "margin:1cm 1cm;margin-top:5cm"}
        %p
          =qit("orders-bill-p1", "Date et heure de paiement (Carte bancaire) :")
          =l @order.paid_at
        %br
        %br

        =qit "orders-bill-p2" do
          %p   
            Conditions de règlement : paiement comptant.
            Pas d'escompte pour paiement anticipé.
          %p
            Pénalités de retard : 3 fois le taux d’intérêt légal, majorées d’une indemnité forfaitaire de 40 € pour fais de recouvrement
          
      
      
      