<%= form_for(@available_product, url: available_product_update_price_path(@available_product), :remote => true, :html => {:class=>"form-horizontal"}) do |f| %>
<div class="portlet-body form">
	<% if @available_product.errors.any? %>
		<div class="alert alert-danger">
			<strong>Tiene <%= pluralize(@available_product.errors.count, "error") %> no se puede guardar el producto</strong><br>
		</div>
	<% end %>
	<div class="form-body">
		<div class="row">
			
			<div class="col-md-12">
				<% if current_user.usertype == "A" %>
				<p> Punto de venta: <%= @available_product.pointsale.name %></p>
				<% end %>
				<p> Producto: <%= @product.name %> con precio de venta (base) de $<%= @product.price_sale %>
					<% unless @product.attributes_json.nil? %>
					<small><br><%= @product.display_attributes %></small>
					<% end %>
				</p>
				<div class="form-group">
					<%= f.label :price_sale, "Precio de venta", {:class=>"col-md-3 control-label"} %>
					<div class="col-md-9">
						<div class="input-group">
							<span class="input-group-addon"> $ </span>
							<%= f.number_field :price_sale, :class=>"form-control input-small mask_decimal" %>
						</div>
						<span class="help-block">Se modificará el precio de venta del producto en punto de venta</span>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="form-actions">
	    
		<div class="row">
			<div class="col-md-offset-3 col-md-9">
				<%= f.submit 'Actualizar precio', {:class=>"btn green"} %> 
				<button type="button" data-dismiss="modal" class="btn">Cancelar</button>
			</div>
		</div>
	</div>
</div>
<% end %>