	<!-- BEGIN CONTAINER -->
	<div class="page-container">
		<!-- BEGIN CONTENT -->
		<div class="page-content-wrapper">
			<!-- BEGIN CONTENT BODY -->
			<!-- BEGIN PAGE HEAD-->
			<div class="page-head">
				<div class="container-fluid">
					<!-- BEGIN PAGE TITLE -->
					<div class="page-title">
						<h1>Productos </h1>
					</div>
					<!-- END PAGE TITLE -->
				</div>
			</div>
			<!-- END PAGE HEAD-->
			<!-- BEGIN PAGE CONTENT BODY -->
			<div class="page-content">
				<div class="container-fluid">
					<div class="pull-right margin-bottom-10 ">
						<%= link_to  products_path(:filter => @filter, :current_page => @current_page), {:class=>"fr-space btn blue-hoki "} do %>
							<i class="fa fa-angle-left "></i>
							Regresar
						<% end %>
						<% if @current_user.usertype == 'A' %>
							<%= link_to  edit_product_path(@product), {:class=>"btn btn-primary "} do %>
								<i class="fa fa-edit"></i> Modificar
							<% end %>
						<% end %>
					</div>
					<!-- BEGIN PAGE BREADCRUMBS -->
					<ul class="page-breadcrumb breadcrumb">
						<%= render_breadcrumbs :tag => :li, :separator => ' <i class="fa fa-circle"></i> ' %>
					</ul>
					<!-- END PAGE BREADCRUMBS -->
					<!-- BEGIN PAGE CONTENT INNER -->
					<div class="page-content-inner">
						<div class="row">
							<div class="col-md-12">
								<!-- BEGIN PROFILE SIDEBAR -->
								<div class="profile-sidebar">
									<!-- PORTLET MAIN -->
									<div class="portlet light profile-sidebar-portlet ">
										<!-- SIDEBAR USERPIC -->
										<div class="profile-userpic">
											<%= image(@product, {:class=>"img-responsive"}) %>
										</div>
										<!-- END SIDEBAR USERPIC -->
										<!-- SIDEBAR USER TITLE -->
										<div class="profile-usertitle">
											<div class="profile-usertitle-name"> <%= @product.name %> </div>
											<div class="profile-usertitle-job"> <%= @product.sku %> </div>
											<br>
										</div>
										<!-- END SIDEBAR USER TITLE -->
										<!-- SIDEBAR BUTTONS -->
										<div class="profile-userbuttons">
												<!-- <button type="button" class="btn btn-circle green btn-sm">Follow</button>
												<button type="button" class="btn btn-circle red btn-sm">Message</button>-->
										</div>
										<!-- END SIDEBAR BUTTONS -->
										<!-- SIDEBAR MENU -->
										<!-- <div class="profile-usermenu">
												<ul class="nav">
														<li class="active">
																<a href="page_user_profile_1.html">
																		<i class="icon-home"></i> Overview </a>
														</li>
														<li>
																<a href="page_user_profile_1_account.html">
																		<i class="icon-settings"></i> Account Settings </a>
														</li>
														<li>
																<a href="page_user_profile_1_help.html">
																		<i class="icon-info"></i> Help </a>
														</li>
												</ul>
										</div> -->
										<!-- END MENU -->
									</div>
									<!-- END PORTLET MAIN -->

								</div>
								<!-- END BEGIN PROFILE SIDEBAR -->
								<!-- BEGIN PROFILE CONTENT -->
								<div class="profile-content">
									<div class="row">
										<div class="col-md-6">
											<!-- BEGIN PORTLET -->
											<div class="portlet light ">
												<div class="portlet-title">
													<div class="caption caption-md">
														<i class="fa fa-bar-chart theme-font hide"></i>
														<span class="caption-subject font-blue-madison bold uppercase">Información General</span>
														<span class="caption-helper hide"></span>
													</div>
												</div>
												<div class="portlet-body">
													<div class="row static-info">
														<div class="col-md-4 name"> SKU: </div>
														<div class="col-md-8 value"> <%= @product.sku %></div>
													</div>
													<div class="row static-info">
														<div class="col-md-4 name"> Producto: </div>
														<div class="col-md-8 value"> <%= @product.name %> </div>
													</div>
													<% unless @product.parent_id.nil? %>
													<div class="row static-info">
														<div class="col-md-4 name"> Presentacion: </div>
														<div class="col-md-8 value"> <%= @product.display_attributes %> </div>
													</div>
													<% end %>
													<div class="row static-info">
														<div class="col-md-4 name"> Descripcion: </div>
														<div class="col-md-8 value"> <%= @product.description %> </div>
													</div>
													<div class="row static-info">
														<div class="col-md-4 name"> Unidad de medida: </div>
														<div class="col-md-8 value"> <%= @product.unit.unit %> </div>
													</div>
													<div class="row static-info">
														<div class="col-md-4 name"> Status: </div>
														<div class="col-md-8 value"> <% if @product.status == "active" %> <span class="badge badge-success"> Activo</span>  <% else %> <span class="badge badge-danger"> Inactivo</span> <% end %></div>
													</div>
												</div>
											</div>
										</div>
										<div class="col-md-6">
											<!-- BEGIN PORTLET -->
											<div class="portlet light ">
												<div class="portlet-title">
													<div class="caption caption-md">
														<i class="fa fa-bar-chart theme-font hide"></i>
														<span class="caption-subject font-blue-madison bold uppercase">Información de Producto</span>
														<span class="caption-helper hide"></span>
													</div>
												</div>
												<div class="portlet-body">
													<div class="row static-info">
														<div class="col-md-4 name"> Inventariado: </div>
														<div class="col-md-8 value"> <% if @product.inventory %> <span class="label label-success"> Si</span>  <% else %> <span class="label label-danger"> No</span> <% end %> </div>
													</div>
													<div class="row static-info">
														<div class="col-md-4 name"> Categorías: </div>
														<div class="col-md-8 value">
															<%  @product.categories.each_with_index do | cat, index | %>
																<% if index > 0 %>  <br> <% end %>
																<span class="badge badge-default badge-roundless" > <%= cat.category %> </span>
															<% end %>
														</div>
													</div>
													<% if current_user.usertype == "A" %>
													<div class="row static-info">
														<div class="col-md-4 name"> Precio compra: </div>
														<div class="col-md-8 value"><%= (@product.is_in_dollars? ? "#{number_to_currency(@product.price_base_dollars, precision: 2)} USD" : "#{number_to_currency(@product.price_base, precision: 2)} MXN") %> </div>
													</div>
													<% end %>
													<div class="row static-info">
														<div class="col-md-4 name"> Precio venta base: </div>
														<div class="col-md-8 value"> $ <%= @product.price_sale %> </div>
													</div>
													<% if @product.get_price_sale(current_user.pointsale_id) != @product.price_sale %>
													<div class="row static-info">
														<div class="col-md-4 name"> Precio venta: </div>
														<div class="col-md-8 value"> $ <%= @product.get_price_sale(current_user.pointsale_id) %> </div>
													</div>
													<% end %>
													<% if @product.parent_id.nil? %>
													<div class="row static-info">
														<div class="col-md-4 name"> Variantes: </div>
														<div class="col-md-8 value"> <% if @product.is_parent %> <span class="label label-success"> Si</span>  <% else %> <span class="label label-danger"> No</span> <% end %></div>
													</div>
													<% end %>
												</div>
											</div>
										</div>
									</div>
									<% if current_user.usertype == "A" %>
									<div class="row">
										<div class="col-md-6">
											<!-- BEGIN PORTLET -->
											<div class="portlet light ">
												<div class="portlet-title">
													<div class="caption caption-md">
														<i class="fa fa-bar-chart theme-font hide"></i>
														<span class="caption-subject font-green bold uppercase">Puntos de venta</span>
														<span class="caption-helper hide"></span>
													</div>
												</div>
												<div class="portlet-body">
													<table class="table table-hover table-light">
                                                    <thead>
                                                        <tr class="uppercase">
                                                            <th> punto de<br>venta </th>
                                                            <th> existencia<br>de producto </th>
                                                            <th> Ultima<br>venta </th>

                                                        </tr>
                                                    </thead>
                                                    <tbody>
                                                    	<% @product.pointsales.each_with_index do |pointsale, key|  %>
                                                    	<tr>
	                                                        <td>
	                                                        	<%= pointsale.name %>
	                                                        </td>
	                                                        <td class="text-center">
	                                                        	<%= @product.stock_in_pointsale(pointsale.id).round %>
	                                                        </td>
	                                                        <td>
	                                                        	<% last_sale =  @product.last_sale(pointsale.id) %>
	                                                        	<%= l(last_sale.created_at, :format => '%d/%m/%Y') unless last_sale.blank? %>
	                                                        </td>
	                                                    </tr>
	                                                    <% end %>
                                                    </tbody>
                                                	</table>
												</div>
											</div>
										</div>
										<div class="col-md-6">
											<!-- BEGIN PORTLET -->
											<!-- <div class="portlet light ">
												<div class="portlet-title">
													<div class="caption caption-md">
														<i class="fa fa-bar-chart theme-font hide"></i>
														<span class="caption-subject font-green bold uppercase">Ventas del mes</span>
														<span class="caption-helper hide"></span>
													</div>
												</div>
												<div class="portlet-body">

												</div>
											</div> -->
										</div>

									</div>
									<% end %>
								</div>
							</div>

						</div>
						<% if @product.presentation && @product.is_parent %>
						<div class="row ">
							<div class="col-md-12">
								<div class="portlet light ">
									<div class="portlet-title">
										<div class="caption caption-md">
											<i class="fa fa-bar-chart theme-font hide"></i>
											<span class="caption-subject font-blue-madison bold uppercase">Variantes</span>
											<span class="caption-helper hide"></span>
										</div>
									</div>
									<div class="portlet-body">
										<%= render 'products_children' %>
									</div>
								</div>
							</div>
						</div>
						<% end %>
					</div>
					<!-- END PAGE CONTENT INNER -->
				</div>
			</div>
			<!-- END PAGE CONTENT BODY -->
			<!-- END CONTENT BODY -->
		</div>
		<!-- END CONTENT -->
	</div>
	<!-- END CONTAINER -->
