=semantic_form_for [:admin, @p_fournisseur_doc], :remote => false do |form|

  .qi_row
    .qi_pannel.qi_plain.padding
      
  
      =form.inputs do
        %table
          %tr
            %td
              =form.input :p_fournisseur_doc_type_id, :label => "Type de document :", :collection => PFournisseurDocType.all, :as => :select, :include_blank => false
            
            %td
              =form.input :p_fournisseur_id, :label => "Fournisseur :", :collection => PFournisseur.all, :as => :select, :include_blank => false, :input_html => {:id => "p_fournisseur_id"}
              
            %td
              -if @p_fournisseur_doc.p_fournisseur
                -p_fournisseur_orders = @p_fournisseur_doc.p_fournisseur.p_fournisseur_orders
              -else
                -p_fournisseur_orders = PFournisseurOrder.all
              =form.input :p_fournisseur_order_id, :label => "Commande fournisseur :", :collection => p_fournisseur_orders, :as => :select, :include_blank => false, :member_label => :id
            
            %td
              = form.input :ref, :label => "Référence :" 
              
            
      
      %hr
  

  
  =form.semantic_fields_for :price_line_block do |f|
    .qi_row
      .qi_pannel.qi_plain.padding
        .price_line_block_form
          =render :partial => "admin/price_line_blocks/fournisseur_order_form", :locals => {:f => f}
        
          
        

    
    .qi_row
      .qi_pannel.qi_plain.padding
        %h4 Paiements
      
        = f.input :p_payment_type_id, :label => "Type de paiement :", :include_blank => false, :collection => PPaymentType.order(:name).all, :as => :select, :input_html => {:id => "payment_type_id_select"}


        = f.input :ct_payment_comptant, :label => "Paiement comptant nécessaire ?" 

        -if false
          = f.input :ct_acompte, :label => "Acompte nécessaire ?" 
          = f.input :ct_acompte_percent, :label => "Pourcentage d'acompte :" 

        = f.input :ct_payment_delais, :label => "Délais jour de paiement :"

        = f.input :ct_payment_month_end, :label => "Fin de mois ?"
  
      
  .large_actions
    .actions
      =form.submit "sauvegarder", :class => "btn btn-primary btn-ap-add"