%table.form-table.field{:style => "width:100%;"}
  %tr
    %td{:style => "width:200px;"}
      
      %label
        Client :
      %div
        %input.p_customer_autocomplete_input.form-control{:type => "text", :value => (form.object.p_customer.show_name_extend if form.object.p_customer), :name => "customer_text"}


        = form.hidden_field :p_customer_id, :class => "p_customer_id"

        :javascript
          $( function() {
      
      

              $('.p_customer_autocomplete_input').autocomplete({
                 source: function( request, response ) {
                         $.ajax( {
                   
                   
                           url: "/admin/p_customers/autocomplete.json",
                           dataType: "json",
                           data: {
                             search: request.term,
                    
                           },
                           success: function(data){
                   
                             arr = jQuery.map( data, function( item ) {
                                                 return {
                                                     label: item.show_name,
                                                     value: item.show_name,
                                                     id: item.id
                                                 }
                             });
                     
                             response(arr)
           
                           }
                   
                         } );
                       },
                 minLength: 2,
                 select: function( event, ui ) {
   
                   $(this).next(".p_customer_id").val(ui.item.id)
           
           
           
           
                   //return false
                 }
              });
      
      
      
            } );
  
      
      
      
    %td{:style => "width:150px;"}
      = form.input :price, :label => "Prix spécifique :" 

    %td
      %br
      = form.input :no_remise, :label => "N'appliquer aucune remises ?" 
      
    %td{:style => "width:30px;"}
      =link_to_remove_fields ic(:"trash-o"), form

        