%tr#p_payment_row{:id => p_payment.id}
  %td
    -params[:p_payment_type_ids] = params[:p_payment_type_ids] || []
    -if !@p_remise_form and params[:p_payment_type_ids].size > 0
    
      =check_box_tag "p_payment_ids[]", p_payment.id if !p_payment.remise
  %td
    = ic(:bank) if p_payment.remise
    =# ic(:check) if p_payment.paid
    =# ic :history if p_payment.i_archive
  %td= p_payment.p_payment_type.name if p_payment.p_payment_type
  %td= l(p_payment.paid_at, :format => :date) if p_payment.paid_at
  %td= l(p_payment.received_at, :format => :date) if p_payment.received_at
  %td=link_to(p_payment.p_customer.show_name, [:admin, p_payment.p_customer]) if p_payment.p_customer
  %td= number_to_currency p_payment.amount
  
  %td
    - if p_payment.i_archive
      Affectation forcée
    -elsif (p_payment.amount.to_f-p_payment.total_affected.to_f) != 0
      = number_to_currency(p_payment.reste_to_affect)
    
  
  %td= p_payment.label
  %td= p_payment.piece
  
  
  
  -if !@p_remise_form
    %td.actions
      -if !p_payment.compta_locked
        = link_to i(:"trash-o"), [:admin, p_payment], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer ce paiement ? ' } , :remote => true
        = link_to i(:pencil), edit_admin_p_payment_path(p_payment), :remote => true
      -else
        =ic :lock
        = link_to i(:pencil), edit_admin_p_payment_path(p_payment), :remote => true

