<%= form_for(@seller, :html => {:class=>"form-horizontal"}) do |f| %>
	<div class="portlet-body form">
		<% if @seller.errors.any? %>
			<div class="alert alert-danger">
				<strong>Tiene <%= pluralize(@seller.errors.count, "error") %> no se puede guardar el vendedor</strong><br>
			</div>
		<% end %>
		<div class="form-body">
			<div class="row">
				<!-- nombre del vendedor -->
				<div class="form-group">
					<%= f.label :name, "Nombre", {:class=>"col-md-2 control-label"} do %> Nombre <span class="required">*</span>
					<% end %>
					<div class="col-md-3" style="padding-left: 0px;padding-right: 0px">
						<%= f.text_field :name, {:class=>"form-control"} %>
					</div>
				</div>
				<!-- apellido vendedor -->
				<div class="form-group">
					<%= f.label :last_name, "Apellidos", {:class=>"col-md-2 control-label"} do %> Apellido <span class="required">*</span>
					<% end %>
					<div class="col-md-3" style="padding-left: 0px;padding-right: 0px">
						<%= f.text_field :last_name, {:class=>"form-control"} %>
					</div>
				</div>
				<!-- punto de venta -->
				<div class=<%= (current_user.usertype == "A" ? "form-group" : "form-group hidden") %>>
					<%= f.label :pointsale_id, "Punto de venta", {:class=>"col-md-2 control-label"} do %> Punto de venta
					<span class="required">*</span>
					<% end %>
					<div class="input-group col-md-3 select2-bootstrap-prepend">
						<%= f.collection_select :pointsale_id, @pointsales, :id, :name, {:prompt => "Seleccione", :selected => @pointsale_id.blank? ? '' : @pointsale_id.to_i}, {:class => "form-control select2"} %>
					</div>
				</div>
			</div>
		</div>
		<div class="form-actions">
			<div class="row">
				<div class="col-md-offset-2 col-md-10">
					<%= f.submit 'Guardar', {:class=>"btn green"} %>
					<%= link_to 'Cancelar', sellers_path(:filter => @filter, :current_page => @current_page), {:class=>"btn default"} %>
				</div>
			</div>
		</div>
	</div>
<% end %>
<script type="text/javascript">
	$(document).ready(function() {
		App.init();
	});
</script>
