=form_tag (@p_customer ? etat_admin_p_customer_path(@p_customer) : etat_admin_p_customers_path), :method => "get", :remote => false, :autocomplete => "off" do
  
  %table
    %tr
      %td.search_label
        Début
      %td
        .input-group
          =text_field_tag :start, params[:start],:class => "form-control datepicker", :placeholder => "Début"
          %span.input-group-addon.btn{:onclick => "$(this).prev('input').val('');"}
            =ic(:times)
      %td.search_label
        Fin
      %td
        .input-group
          =text_field_tag :stop, params[:stop],:class => "form-control datepicker", :placeholder => "Fin"
          %span.input-group-addon.btn{:onclick => "$(this).prev('input').val('');"}
            =ic(:times)
    
      %td.search_label
        Soldé ? :
        
        
        
        
      %td
        =select_tag :ok, options_for_select([["Non","0"], ["Oui","1"]], params[:ok]), :include_blank => true

  %br
  %center
    -if @p_customer
      =submit_tag "Générer un état", :class => "btn btn-default", :style => "margin-bottom: 10px;"
    -else
      =submit_tag "Générer un état pour tous les clients avec un encours (#{PCustomer.where('cache_encours != 0.0').count})", :class => "btn btn-default", :style => "margin-bottom: 10px;"