%tr#m_odr_prime_row{:id => m_odr_prime.id}
  -tr = {}
  
  -tr[:particular_name] = capture do
    %td
      =link_to m_odr_prime.particular.name, [:admin, m_odr_prime.p_customer] if m_odr_prime.particular

  -tr[:particular_firstname] = capture do
    %td
      =link_to m_odr_prime.particular.firstname, [:admin, m_odr_prime.p_customer] if m_odr_prime.particular
      
  
  -tr[:p_customer_created_at] = capture do
    %td
      =l m_odr_prime.p_customer.created_at if m_odr_prime.p_customer

  -tr[:state] = capture do
    %td
      =state_helper(m_odr_prime.state)
      
  -tr[:date_roulage] = capture do
    %td
      =l m_odr_prime.m_odr_file_roulage.date if m_odr_prime.m_odr_file_roulage
      
   
  
  
  -tr[:pneu_gamme] = capture do
    %td
      =m_odr_prime.m_odr_products.uniq.map{ |u| (u.name)}.join(" | ")
  
  -tr[:m_odr_place_name] = capture do
    %td
      =m_odr_prime.m_odr_places.uniq.map{ |u| u.name}.join(" | ")
      
  -tr[:m_odr_place_cp] = capture do
    %td
      =m_odr_prime.m_odr_places.uniq.map{ |u| u.cp}.join(" | ")
      
  -tr[:m_odr_place_city] = capture do
    %td
      =m_odr_prime.m_odr_places.uniq.map{ |u| u.city}.join(" | ")
      
   
  -tr[:organisateur_name] = capture do
    %td
      =m_odr_prime.m_odr_file_roulage.m_event.organisateur.name if m_odr_prime.m_odr_file_roulage and  m_odr_prime.m_odr_file_roulage.m_event and m_odr_prime.m_odr_file_roulage.m_event.organisateur
  
      
  -tr[:date_virement] = capture do
    %td
      -virement = m_odr_prime.m_odr_virements.where(:refused => 0, :sended => 1).order('id DESC').first
      -if virement and virement.m_odr_remise
        =l virement.m_odr_remise.created_at, :format => :date
      
   
  
  
      

  -tr[:actions] = capture do
    %td.actions
      = link_to i(:"trash-o"), [:admin, m_odr_prime], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cette prime ? ' } , :remote => true
      =# link_to i(:pencil), edit_admin_m_odr_prime_path(m_odr_prime), :remote => true
      = link_to i(:eye), admin_m_odr_prime_path(m_odr_prime), :remote => false



  =render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => m_odr_prime}
    
  
  
  