

.qi_row
  .qi_pannel.qi_plain.padding
    %p Générer un nouvel export des achats
    =form_tag "", :method => "get",  :onsubmit => "" do
      
      
      %td.search_label
        Début
      %td
        .input-group
          =text_field_tag :start_at, params[:start],:class => "form-control datepicker", :placeholder => "Début", :autocomplete => 'off',  :autocorrect => 'off', :autocapitalize => 'off', :spellcheck =>'false' 
          %span.input-group-addon.btn{:onclick => "$(this).prev('input').val('');"}
            =ic(:times)
      %td.search_label
        Fin
      %td
        .input-group
          =text_field_tag :stop_at, params[:stop],:class => "form-control datepicker", :placeholder => "Fin", :autocomplete => 'off',  :autocorrect => 'off', :autocapitalize => 'off', :spellcheck =>'false'
          %span.input-group-addon.btn{:onclick => "$(this).prev('input').val('');"}
            =ic(:times)
      
      
      
      =submit_tag "Générer"
  
.qi_row
  .qi_pannel.qi_plain.padding
    
  
  
    %table.table.table-striped
      %tr
        %th Type
        %th Nom du fichier
        %th Date du fichier
        %th nombre de lignes
      -Dir["private_medias/exports/*.xlsx"].sort.reverse.each do |dir|
        -if File.basename(dir).split(".")[0].split("----")[0].split("-")[0] == "Achats"
          %tr
            %td
              =File.basename(dir).split(".")[0].split("----")[0].split("-")[0]
            %td
              =link_to File.basename(dir).split(".")[0].split("----")[0], "/admin/navision/file?id="+File.basename(dir).split(".")[0]
            %td
              -t = File.basename(dir).split(".")[0].split("----")[0].split("--")[1].split("2019-")[0]+"2019 "+File.basename(dir).split(".")[0].split("----")[0].split("--")[1].split("2019-")[1].sub("-", ":").sub("-", ":") 
              = l(Time.parse( t ) ) #, admin_export_path(:id => File.basename(dir).split(".")[0])
            %td
              =File.basename(dir).split("----")[1].split(".")[0].split('-')[1]
              lignes
  