%tr#p_customer_sheet{:id => p_customer_sheet.id}
  %td="##{p_customer_sheet.id}"
  %td=l p_customer_sheet.created_at, :format => :date
  -if !@p_customer
    %td= p_customer_sheet.p_customer.show_name if p_customer_sheet.p_customer
  %td= p_customer_sheet.sheet_lines_not_shiped.count
  %td= p_customer_sheet.sheet_lines_shiped.count
  
  
  %td
    -totals =  PSheetLine.totals(p_customer_sheet.p_sheet_lines)
    -if p_customer_sheet.state_ok?
      =number_to_currency totals[:ok_total]
    -else
      =number_to_currency totals[:total]
  
    
  %td=raw p_customer_sheet.state_html

  
  %td.actions
    -if p_customer_sheet.state == "brouillon"
      = link_to i(:"trash-o"), [:admin, p_customer_sheet], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet auteur ? ' } , :remote => true
    = link_to i(:pencil), edit_admin_p_customer_sheet_path(p_customer_sheet), :remote => false
    = link_to i(:eye), admin_p_customer_sheet_path(p_customer_sheet), :remote => false

