%table.table.table-striped.table-hover.table-bordered
  %tr
    %td{:style => "width:200px;"} Marque :
    %td
      =@m_odr_rep.product_brand
      

  %tr
    %td Produit
    %td
      =@m_odr_rep.product_name
      
  %tr
    %td Quantité
    %td
      =@m_odr_rep.qte

  %tr
    %td Date d'achat
    %td
      =l @m_odr_rep.buy_at if @m_odr_rep.buy_at






      

%table.table.table-striped.table-hover.table-bordered
  %tr
    %td{:style => "width:200px;"} Remise :
    %td
      =number_to_currency @m_odr_rep.remise
      = link_to i(:pencil), edit_admin_m_odr_rep_path(@m_odr_rep), :remote => true

Fichier
-@m_odr_rep.m_odr_files.order("id DESC").each do |file|
  %table.table.table-striped.table-hover.table-bordered
    %tr
      %td Etat
      %td
        -if file.admin_ok == true
          =state_helper "Validé"
        -elsif file.admin_ok == false
          =state_helper "Refusé"
        
        =link_to i(:pencil), edit_admin_m_odr_file_path(file), :remote => true
    
    
    %tr
      
      %td{:style => "width:200px;"} Fichier 
      %td
        =File.basename file.file.path

    %tr
      %td Lien
      %td
        =link_to ic(:download)+" Télécharger ce fichier", download_admin_m_odr_file_path(file, :disposition => "attachment")
        
        
    %tr
      %td Validation
      %td
        -if file.admin_ok == false
          =file.reject_reason
          =simple_format file.reject_reason_description if file.reject_reason_description?
          
     
    -if file.admin_ok == false
      %tr
        %td Envois de mail
        
        %td
          Envoyer un mail de notification :
          -[["facture-illisible", "Facture illisible"]].each do |key|
            %br
            =link_to ic(:envelope)+" #{key[1]}", send_mail_admin_m_odr_file_path(file, :slug => key[0]), :remote => false, :class => "btn btn-primary", :style => "margin-bottom:4px;"
        
      

RIB : 
-@m_odr_rep.m_odr_rep_ribs.order("id DESC").each do |m_odr_rep_rib|
  %table.table.table-striped.table-hover.table-bordered
    %tr
      %td Etat
      %td
        -if m_odr_rep_rib.admin_ok == true
          =state_helper "Validé"
        -elsif m_odr_rep_rib.admin_ok == false
          =state_helper "Refusé"
        
        
        =link_to i(:pencil), edit_admin_m_odr_rep_rib_path(m_odr_rep_rib), :remote => true
  
  
    %tr
      %td{:style => "width:200px;"} ID Rib
      %td
        =m_odr_rep_rib.id

    %tr
      %td IBAN
      %td
        =m_odr_rep_rib.iban

    %tr
      %td BIC
      %td
        =m_odr_rep_rib.bic
    

    %tr
      %td Validation
      %td
        -if m_odr_rep_rib.admin_ok == false
          
          %br
          =m_odr_rep_rib.reject_reason
          =simple_format m_odr_rep_rib.reject_reason_description if m_odr_rep_rib.reject_reason_description?
    
    -if m_odr_rep_rib.admin_ok == false
      %tr
        %td Envois de mail
       
        %td
          Envoyer un mail de notification :
          -if true or m_odr_rep_rib.mail_hists.count == 0
            %br
            =link_to ic(:envelope)+" Demander un nouveau RIB", send_mail_admin_m_odr_rep_rib_path(m_odr_rep_rib), :remote => false, :class => "btn btn-primary", :style => "margin-bottom:4px;"
            
  
        
    
%br
-if @m_odr_rep.state == "Refusée"
  .red Demande refusée
  Envoyer un mail de notification :
  -[["document-non-valide", "Document non valide"], ["mauvais-titulaire", "Mauvais titulaire"], ["achat-hors-delais", "Achat hors délais"],["pneus-non-porteurs-de-l-offre", "Pneus invalides"],["dossier-deja-enregistre", "Dossier déjà enregistré"]].each do |key|
    %br
    =link_to ic(:envelope)+" #{key[1]}", send_mail_admin_m_odr_rep_path(@m_odr_rep, :slug => key[0]), :remote => false, :class => "btn btn-primary", :style => "margin-bottom:4px;"

-else
  =link_to "Refuser cette demande", refuse_admin_m_odr_rep_path(@m_odr_rep), :class => "btn btn-danger"

  -if @m_odr_rep.admin_ok_to_send and @m_odr_rep.m_odr_virements.where(:refused => false).count == 0
    %br
    %br
    =link_to "Générer le virement", generate_virement_admin_m_odr_rep_path(@m_odr_rep), :class => "btn btn-primary"
    
  