=link_to new_public_order_path(:credit_product_id => credit_product.id), :remote => true do
  #credit_product.credit_product.panel.panel-warning{:id => credit_product.id}

    .panel-heading
      %h3.panel-title
        =image_tag "/credit.png"
        = credit_product.nbr_credits_final(current_customer)
        crédits
    %p.price
  
      %strong
        =number_to_currency credit_product.price_ttc_final(current_customer)
        TTC
      %br
      %span.ht
        =number_to_currency credit_product.price_ht_final(current_customer)
        HT

    %p
      Soit 
      =number_to_currency (credit_product.price_ttc_final(current_customer) / credit_product.nbr_credits_final(current_customer).to_f)
      ="TTC / crédit"
    
    -callif_credits = current_customer.callif_credits(current_customer.credits_boughts(Date.today) + credit_product.nbr_credits)
    
    
    -callif_credits = current_customer.callif_credits(current_customer.credits_boughts(Date.today) +  credit_product.nbr_credits_final(current_customer))
      
    .btn.btn-primary
      Commander
    %br
    %br
    
    .panel-footer
      
    
    
      %h4 Affiliation
    
      %p 
        en achetant ces crédits supplémentaires vous aurez le statut
        %strong='"'+callif_credits[0]+'"'
        =":"
        %ul
          %li
            =callif_credits[3] 
            parts de participations
            
          %li
            Commissions sur les achats de crédits effectués par vos affiliés directs et indirects :
            %table.table
              -i = 0

              -while i < callif_credits[5]
                -i += 1
                %tr
                  %td
                    Génération
                    =i
                  %td
                    =callif_credits[4][i]
                    ="%"
            %p
          
              Et si vous avez au moins 5 affiliés ayant effectué des achats de crédits d'annonce :
            %table.table
   

              -while i < callif_credits[6]
                -i += 1
                %tr
                  %td
                    Génération
                    =i
                  %td
                    =callif_credits[4][i]
                    ="%"
    
  
    
  