Clientes

<% if success %>

<%= success %>

<% elsif warning %>

<%= warning %>

<% end %>
Lista de clientes
<% if can? :create, Customer %> <%= link_to new_customer_path, {:class=>"btn bold green pull-right filtros"} do %> Nuevo Cliente <% end %> <% end %>
<% @customers.each_with_index do |customer, key| %> <% end %>
# Cliente RFC Teléfono Inf. crédito Status Acciones
<%= key + 1 %> <%= customer.nick_name %> <% if !customer.billing_information.nil? %> <%= customer.billing_information.name %> <% end %> <%= customer.phone %> <% if customer.credit %> Crédito
$ <%= customer.credit_limit %>, <%= customer.time_limit %> día(s) <% else %> Crédito no otorgado <% end %>
<% if customer.status == "inactive" %> <% else %> <% end %> <%= link_to customer, {:class=>"btn btn-icon-only default filtros", :title=>"Ver cliente"} do %> <% end %> <% if can? :update, Customer %> <%= link_to edit_customer_path(customer), {:class=>"btn btn-icon-only btn-primary filtros", :title=>"Editar cliente"} do %> <% end %> <% end %> <% if customer.active? && customer.is_public == 0 %> <%= link_to customer_update_status_path(customer), :class=>"btn btn-icon-only default", :title=>"Desactivar cliente", data: { confirm: '¿Esta seguro de desactivar el cliente?', method: 'post'} do %> <% end %> <% elsif customer.inactive? %> <%= link_to customer_update_status_path(customer), :class=>"btn btn-icon-only green-jungle", :title=>"Activar cliente", data: { confirm: '¿Esta seguro de activar el cliente?', method: 'post'} do %> <% end %> <% end %> <% if can? :destroy, Customer %> <% unless customer.get_debiting > 0 || customer.is_public == 1 %> <%= link_to customer , method: :delete, :class => "btn btn-icon-only btn-danger", :title=>"Eliminar cliente", data: { confirm: '¿Esta seguro de eliminar al cliente?'} do %> <% end %> <% end %> <% end %>