<tr class=<%= (sale.cancelled? ? 'danger' : '') %>>
	<td><%= sale.id %></td>
	<td><%= sale.sale_code %> </td>
	<% if current_user.usertype == 'A' %>
		<td> <%= sale.get_pointsale.name %> </td>
	<% end %>
	<td><%= sale.customer.nick_name %> </td>
	<td><%= sale.seller.name %> </td>
	<td><%= l(sale.date_sale, format: '%d/%B/%Y') %></td>
	<td><%= sale_type(sale) %><br>
			<!-- Cuando sea apartado, mostrar la fecha de vencimiento -->
			<%= l(sale.date_sale + @pos_config.days_cancel_reserved.days, format: '%d/%B/%Y') %>
	</td>
	<td><%= sale.sales_details.sum(:quantity).to_i %></td>
	<td><%= sale_status(sale) %></td>
	<td><%= number_to_currency(sale.total, precision: 2) %>
		<% if sale.reserved? %>
			<br><%= number_to_currency(sale.reserve_debt, precision: 2) %>
		<% end %>
	</td>
	<td class="text-center hide_c">
		<%= link_to sale, { class: "btn btn-icon-only default", title: "Ver venta" } do %>
			<i class="fa fa-search"></i>
		<% end %>
		<%= link_to print_receipt_path(sale.id, format: 'pdf'), { class: "btn btn-icon-only default", target: "blank" } do %>
			<i class="fa fa-print"></i>
		<% end %>
    <% if (can? :delete, Sale) && sale.can_be_cancelled?(@pos_config) %>
      <%= link_to sale, method: :delete, class: "btn btn-icon-only btn-danger", title: "Cancelar venta", data: { confirm: '¿Está seguro que desea cancelar la venta?' } do %> <i class="fa fa-ban"></i><% end %>
    <% end %>
  </td>
</tr>