-if @order
  
  .clear
  %h2 Vos coordonnées
  -if !current_customer.pro
    =current_customer.firstname
    =current_customer.name
  -else
    =current_customer.organisation
  
  %p
    =current_customer.address
    -if current_customer.address2?
      %br
      current_customer.address2
    %br
    =current_customer.cp
    =current_customer.city
    %br
    =current_customer.country
  
  =link_to "modifier mes infos de facturation", billing_public_orders_path(:credit_product_id => params[:credit_product_id]), :remote => true
  
  %h3 Récapitulatif
  
  %p
    Commande de 
    = @order.credit_product.nbr_credits_final(current_customer)
    crédits
  
    pour un montant de 
    %strong
      =number_to_currency @order.credit_product.price_ttc_final(current_customer)
      TTC
    (
    =number_to_currency @order.credit_product.price_ht_final(current_customer)
    HT
    )
  

  -if current_customer.commissions.sum(:amount) > 0.0 and !@order.with_com
    %p=link_to "Utiliser mon solde de commission (#{number_to_currency(current_customer.commissions.sum(:amount))}) et re-calculer le total", new_public_order_path(:credit_product_id => @order.credit_product.id, :with_com => true), :class => "btn btn-primary", :remote => true
  

  -if @order.with_com
    %p
      Utilisation de mes commissions :
      %strong=number_to_currency @order.evaluate_use_coms
      (
      votre solde de commission passera à 
      =number_to_currency @order.evaluate_solde_coms
      )
    %p
      Il vous restera à payer : 
      %strong
        =number_to_currency @order.evaluate_price_with_coms_ttc
        TTC
      (
      =number_to_currency @order.evaluate_price_with_coms_ht
      HT
      )
    %p 
      -if @order.with_com
        %p=link_to "Ne pas utiliser mon solde de commissions", new_public_order_path(:credit_product_id => @order.credit_product.id), :class => "btn btn-primary", :remote => true
  
    
  %p
    Il vous restera à payer : 
    %strong
      =number_to_currency @order.evaluate_price_with_coms_ttc
      TTC
    (
    =number_to_currency @order.evaluate_price_with_coms_ht
    HT
    )

    
    

    
  %h3 Valider ma commande
  =semantic_form_for [:public, @order], :remote => true do |f|
    =hidden_field_tag :credit_product_id, params[:credit_product_id]
    =hidden_field_tag :with_com, params[:with_com]
    =f.input :cgv, :as => :boolean, :label => "J'ai lu et j'accepte les conditions générales de vente."
    =f.input :retractation, :as => :boolean, :label => "Comme indiqué dans les conditions générales de vente, j'accepte de renoncer à mon droit de rétractation, mon compte étant crédité dès la validation de mon paiement."
    =f.submit "Valider ma commande et payer par Carte Bancaire", :commit => "cb", :class => "btn btn-primary btn-large"
  