

.qi_header
  %h1
    Primes
    %span
      Factures
    %span Modifier une facture
      


%hr
Historique des factures

-params[:search][:per_page] = params[:search][:per_page] || 50
-per_page = params[:search][:per_page]
-page = (params[:page] and params[:page] != "") ? params[:page] : 1 
-@m_odr_files = @m_odr_file.p_customer.m_odr_files.where("id != ?", @m_odr_file.id).where(:m_odr_file_type_id => @m_odr_file.m_odr_file_type_id )
-@m_odr_files = sort_by_sorting(@m_odr_files, "created_at DESC")
-@m_odr_files = @m_odr_files.page(page).per(per_page)

=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @m_odr_files}

.clear

.left{:style => "float:left;width:30%;"}
  =render :partial => "form"

#show{:style => "margin-left:31%;"}
  =link_to ic(:download)+" Télécharger le document", download_admin_m_odr_file_path(@m_odr_file, :disposition => "attachment")


  -if File.extname(@m_odr_file.file.path) == ".pdf" || File.extname(@m_odr_file.file.path) == ".PDF"
    
    %iframe{:src => @m_odr_file.file.url, :style => "width:100%;height:800px;border:1px solid gray;"}

  -else
    &nbsp;&nbsp;
    =link_to ic(:"rotate-left"), rotate_admin_m_odr_file_path(:id => @m_odr_file.id, :direction => "right"), :remote => true
    &nbsp;&nbsp;
    =link_to ic(:"rotate-right"), rotate_admin_m_odr_file_path(@m_odr_file), :remote => true
    #image_previ{:style => "width:100%;height:800px;border:1px solid gray;overflow:auto;"}
      =render :partial => "admin/m_odr_files/image", :locals => {:file => @m_odr_file}




