Apartados
<% if success %>
<% elsif warning %>
<% end %>
<%= success %>
<%= warning %>
Lista de apartados
<%= hidden_field_tag 'title_for_print' %>
<%= label_tag :begin_date, "Fecha", { class: "col-md-1 control-label" } do %> Desde<% end %>
<%= label_tag :end_date, "Fecha", { class: "col-md-1 control-label" } do %> Hasta<% end %>
| # | Folio | <% if current_user.usertype == "A" || current_user.usertype == "SS" %>Punto de venta | <% end %>Cliente | Vendedor | Fecha | Vence | Productos | Status | Total | Adeudo | Acciones |
|---|---|---|---|---|---|---|---|---|---|---|---|
| <%= sale.id %> | <%= sale.sale_code %> | <% if current_user.usertype == "A" || current_user.usertype == "SS" %><%= sale.get_pointsale.name %> | <% end %><%= sale.customer.nick_name %> | <%= sale.seller.name %> | <%= l(sale.date_sale, :format => '%d/%m/%Y') %> | <%= l(sale.expiration_date, :format => '%d/%B/%Y') %> | <%= sale.sales_details.sum(:quantity) %> | <% if sale.reserve_is_expired? && !sale.paid? && !sale.cancelled? %> VENCIDO <% elsif sale.cancelled? %> CANCELADO <% elsif sale.parcial? %> VIGENTE <% elsif sale.paid? %> PAGADO <% end %> | <%= number_to_currency(sale.total, precision: 2) %> | <%= number_to_currency(sale.reserve_debt, precision: 2) %> | <%= link_to sale, { class: "btn btn-icon-only default filtros", title: "Ver apartado" } do %> <% end %> <% if sale.reserve_is_expired? && !sale.cancelled_by_expiration? && !sale.paid?&& !sale.cancelled? %> <%= link_to sale_return_expired_path(sale), class: "btn btn-icon-only btn-info", title: "Regresar producto(s) a inventario", data: { confirm: '¿Está seguro que desea reingresar los productos a inventario?', method: 'post' } do %> <% end %> <% end %> <% if !sale.reserve_is_expired? && !sale.cancelled? && !sale.paid?%> <%= link_to cancel_reserved_sale_path(sale), :remote => true, :class => "btn btn-icon-only btn-danger", title: "Cancelar apartado" do %> <% end %> <% end %> <% if (can? :liquidate_reserve, Sale) && !sale.cancelled_by_expiration? && sale.parcial? %> <%= link_to sale_liquidate_reserve_path(sale), :remote => true, class: "btn btn-icon-only green-dark", title: "Liquidar apartado" do %> <% end %> <% end %> |