=semantic_form_for [:admin, @p_remise], :remote => false do |f|

  .content
    =f.inputs do
      %table
        %tr
          %td{:style => "width:33.33%;padding-right:5px;"}
            = f.input :date, :label => "Date", :as => :date
          
          =#%td{:style => "width:33.33%"}
          =# f.input :p_payment_type_id, :label => "Type de paiement :", :collection => PPaymentType.order(:name).all, :as => :select, :include_blank => false
          
          %td{:style => "width:33.33%"}
            = f.input :p_bank_account_id, :label => "Compte :", :collection => PBankAccount.all, :as => :select, :member_label => :member_label, :include_blank => false
            
          %td{:style => "width:33.33%;padding-left:5px;"}
            %label
              Type de paiements :
            %div
            -p_payment_types = []
            -@p_remise.p_payments.each do |ppt|
              -p_payment_types << ppt.p_payment_type.name
            
            =raw p_payment_types.uniq.join("<br />")
            
    
    -@p_remise.p_payments.each do |pp|
      =hidden_field_tag "p_remise[p_payment_ids][]", pp.id
    
    %table.table
      %tr
        %th
        %th Type de paiement
        %th Date de paiement
        %th Date théorique

        %th Client
        %th Montant
        %th Montant à affecter
        %th
        %th
       
      
      =render @p_remise.p_payments
      
   
      
  .actions=f.submit "sauvegarder", :class => "btn btn-primary"
  