<tr id="sale_<%=sale.id%>">
  <td><%= sale.id %></td>
  <td><%= sale.sale_code %> </td>
  <td><%= sale.customer.nick_name %> </td>
  <td><%= sale.seller.name %> </td>
  <td><%= l(sale.date_sale, :format => '%d/%m/%Y') %></td>
  <td>
    <% if sale.saletype == "credit" && sale.credit_note.blank? %>
    Crédito
    <% elsif sale.saletype == "credit" && sale.credit_note.present? %>
    Crédito/vale
    <% elsif sale.saletype == "cash" %>
    Contado
    <% else %>
    Apartado
    <% end %>
  </td>
  <td><%= sale.products.count %></td>
  <td>
    <%= sale_status(sale) %>
  </td>
  <td><%= number_to_currency(sale.total, precision: 2) %></td>
</tr>