Cortes de caja

<% if success %>

<%= success %>

<% elsif warning %>

<%= warning %>

<% end %>
<%= hidden_field_tag 'title_for_print' %>
Lista de cortes de caja
<% if can? :create, OpenCashRegister && !session[:open_cash_register_id].present? %> <%= link_to new_open_cash_register_path, remote: true, class: 'btn btn bold green margin-top pull-right', title: "Abrir caja registradora" do %> Abrir caja <% end %>
<% end %> <% if can? :get_open_cash_registers, CashOut %> <%= link_to get_open_cash_registers_path, remote: true, data: { toggle: "modal", target: "#get_open_cash_register" }, class: "btn bold green pull-right", title: "Realizar corte de caja", style: "margin-top:10px" do %> Realizar corte de caja <% end %> <% end %> <% if can? :opened_cash_registers, CashOut %> <%= link_to opened_cash_registers_path, { class: "btn bold green pull-right" } do %>   Ver cajas abiertas <% end %> <% end %>
<%= label_tag :pointsale, "pointsale", {:class=>"col-md-2 control-label"} do %> Punto de venta <% end %>
<%= select_tag "pointsale", options_from_collection_for_select(Pointsale.vigentes, :id, :name, :selected => current_user.pointsale_id), :include_blank => "Todas", :disabled => (true unless current_user.usertype == "A" || current_user.usertype == "SS"), class: "form-control select2 col-md-3" %>
<%= 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 %>
<% if current_user.usertype == "A" || current_user.usertype == "SS" %> <% end %> <% @cash_outs.each_with_index do |cash_out, key| %> <% horas_transcurridas = ((DateTime.now.to_time - cash_out.created_at.to_time).to_i/60)/60 %> <% if current_user.usertype == "A" || current_user.usertype == "SS" %> <% end %> <% end %>
#Punto de ventaCaja registradora Ingresos Egresos Total Fecha Usuario Recibió Acciones
<%= cash_out.id %> <%= OpenCashRegister.get_pointsale(cash_out.open_cash_register_id, "open_cash_register").name %> <%= cash_out.open_cash_register.cash_register.name %> <%= number_to_currency(cash_out.amount_in, precision: 2) %> <%= number_to_currency(cash_out.amount_out, precision: 2) %> <%= number_to_currency(cash_out.amount_in - cash_out.amount_out, precision: 2) %> <%= l(cash_out.created_at, :format => '%d/%B/%Y') %> <%= cash_out.user.first_name %> <%= (cash_out.received_by.blank? ? "" : cash_out.received_by.first_name) %> <%= link_to cash_out, {:class=>"btn btn-icon-only default filtros", :title=>"Ver corte de caja"} do %> <% end %> <%= link_to print_cash_out_receipt_path(cash_out.id, format: 'pdf'), {:class=>"btn btn-icon-only default", :target => "blank"} do %> <% end %> <% if can? :general_public_invoice, CashOut %> <% if cash_out.invoice_num.blank? && (cash_out.amount_in - cash_out.amount_out) > 0.0 && horas_transcurridas < 72 %> <%= link_to general_public_invoice_path(cash_out.id), remote: true, class: "btn btn-icon-only green", title: "Generar factura a público general" do %> <% end %> <% elsif cash_out.invoice_num.present? %> <%= link_to print_gpi_path(cash_out.id), remote: true, class: "btn btn-icon-only default blue-madison", target: "blank", title: "Reimprimir factura" do %> <% end %> <% end %> <% end %>