%tr#price_document_row{:id => price_document.id}
  -tr = {}

  -tr[:p_customer_code] = capture do
    %td
      = price_document.p_customer.code if price_document.p_customer
  
  -tr[:p_commercial] = capture do
    %td
      = price_document.p_customer.p_commercial.long_name if price_document.p_customer and price_document.p_customer.p_commercial
  -tr[:p_customer] = capture do
    %td
      = price_document.p_customer.show_name if price_document.p_customer
  -tr[:com_counter] = capture do
    %td
      =link_to price_document.ref_element.com_counter, [:admin, price_document.ref_element] if price_document.ref_element and price_document.ref_element_type == "PCustomerSheet"
  -tr[:label] = capture do
    %td
      =price_document.label
  -tr[:d_number] = capture do
    %td
      =price_document.d_number
  
  -tr[:date] = capture do
    %td
      =l price_document.date, :format => :date
  -tr[:tot_amount_ht] = capture do
    %td.numeraire=number_to_currency price_document.tot_amount_ht
  -tr[:tot_amount_tva] = capture do
    %td.numeraire=number_to_currency price_document.tot_amount_tva
  -tr[:tot_amount_ttc] = capture do
    %td.numeraire=number_to_currency price_document.tot_amount_ttc
  -tr[:solded] = capture do
    %td
      ="oui" if price_document.solded if price_document.price_document_type and price_document.price_document_type.accounting
  -tr[:to_paid_ttc] = capture do
    %td
      =number_to_currency price_document.to_paid_ttc if price_document.price_document_type and price_document.price_document_type.accounting
  
  
  -tr[:actions] = capture do
    %td.actions
      -if !price_document.d_number?
        = link_to i(:"trash-o"), [:admin, price_document], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
        = link_to i(:pencil), edit_admin_price_document_path(price_document)
      =# link_to i(:eye), admin_price_document_path(price_document), :remote => true
      = link_to i(:download), print_admin_price_document_path(price_document.token), :remote => false, :target => "_blank"

  =render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => price_document}
  