%tr#order{:id => order.id}
  %td
    =link_to order.annonce_account.pseudo_admin, [:admin, order.annonce_account]
  %td
    =l order.created_at
  %td
    =l order.paid_at if order.paid_at?
  %td
    -if order.payment_type_id == 1
      Offert
    -if order.payment_type_id == 2
      Carte bancaire
  %td
    =order.nbr_credits
  %td
    = order.binary_points
  
  %td
    = order.nbr_parts

  %td
    =number_to_currency order.amount_ttc
    
  %td
    =number_to_currency order.amount_ht
  
  %td
    -com = Commission.where(:order_id => order.id).where("canceled is null").sum(:amount)
    =number_to_currency(com )
  %td
    -delta = order.amount_ht.to_f - com.to_f
    %strong{:style => ("color:red"if delta <= 0)}=number_to_currency delta
  %td
    -if order.unpaid
      Remboursée le 
      =l order.unpaid_at, :format => :date if order.unpaid_at
    -elsif order.paid
      Payée
    -else
      N'a pas abouti
      -if current_admin.super_admin
        =link_to "Forcer le paiement", force_pref_admin_order_path(order), :remote => true
  
  %td
    =link_to i(:eye), [:admin, order]
    =link_to "rembourser", cancel_admin_order_path(order), :data => {:confirm => "Voulez-vous vraiment signaler cette commande comme remboursée ?"}, :class => "btn btn-default" if current_admin.super_admin