Clientes deudores
<%= link_to debtors_path(filter: @filter, current_page: @current_page), { class: "btn blue-hoki pull-right margin-bottom-10" } do %> Regresar
<% end %>
<% if success %>
<% elsif warning %>
<% end %>
<%= success %>
<%= warning %>
Ventas al cliente <%= @customer.nick_name %>
<%= 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 %>
| # | Código de venta | <% if current_user.usertype == "A" || current_user.usertype == "SS" %>Punto de venta | <% end %>Vendedor | Fecha | Tipo | Productos | Status | Total | Abonado | Restante | Acciones | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| <%= sale.id %> | <%= sale.sale_code %> | <% if current_user.usertype == "A" || current_user.usertype == "SS" %><%= sale.get_pointsale.name %> | <% end %><%= sale.user.first_name %> | <%= l(sale.date_sale, :format => '%d/%m/%Y') %> | <% if sale.saletype == "credit" && sale.credit_note.blank? %> Crédito <% elsif sale.saletype == "credit" && sale.credit_note.present? %> Crédito/vale <% else %> Contado <% end %> | <%= sale.products.count %> | <%= sale_status(sale) %> | <%= number_to_currency(sale.total, precision: 2) %> | <% if sale.credit.present? %><%= number_to_currency(sale.credit.credit_payments.activos.sum(:quantity), precision: 2) %> | <%= number_to_currency(sale.credit.rest, precision: 2) %> | <% else %><% end %> | <%= link_to sale, { class: "btn btn-icon-only default", title: "Ver venta" } do %> <% end %> <% if can? :destroy, Sale %> <% daysToCancel = @pos_config.days_cancel_sale %> <% if (sale.date_sale + daysToCancel.days >= Date.today) && !sale.cancelled? %> <%= 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 %> <% end %> <% end %> <% end %> |
| Folio | Fecha | Deuda | Abono | Restante | Status | Acciones |
|---|---|---|---|---|---|---|
| <%= credit.sale.sale_code %> | <%= l(abono.date_payment, :format => '%d/%m/%Y') %> | <%= number_to_currency(credit.total, precision: 2) %> | <%= number_to_currency(abono.quantity, precision: 2) %> | <%= number_to_currency(credit.rest, precision: 2) %> | <% case abono.status %> <% when "cancelled"%> CANCELADO <% when "active"%> ACTIVO <% end %> | <% if !abono.cancelled? && abono.cash_registers_move.present? && abono.cash_registers_move.open_cash_register.open? %> <%= link_to cash_move_delete_payment_path(:credit_payment_id => abono.id, :credit => credit.id) , method: :delete_credit_payment, :class => "btn btn-icon-only btn-danger", :title=>"Cancelar abono", data: { confirm: '¿Está seguro que desea cancelar el abono?' } do %> <% end %> <% end %> | <% credit.total -= abono.quantity %>