<!-- 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>Traspaso</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 transfers_path(:filter => @filter, :current_page => @current_page), {:class=>"fr-space btn blue-hoki "} do %>
						<i class="fa fa-angle-left "></i>
						Regresar
					<% 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 margin-top-10">
					<div class="row">
						<div class="col-md-4 col-sm-12">
							<div class="portlet light bordered ">
								<div class="portlet-title">
									<div class="caption"> <i class="fa fa-info-circle"></i>Información general </div>
								</div>
								<div class="portlet-body">
									<div class="row static-info">
										<div class="col-md-5 name"> <i class="fa fa-flag"></i>
										&nbsp Origen:</div>
										<div class="col-md-7 value"> <%= @transfer.origin_is_pointsale? ? Pointsale.find(@transfer.origin_id).name : Warehouse.find(@transfer.origin_id).name %> </div>
									</div>
									<div class="row static-info">
										<div class="col-md-5 name"> <i class="fa fa-plane"></i>
										&nbsp Destino:</div>
										<div class="col-md-7 value"> <%= @transfer.destiny_is_pointsale? ? Pointsale.find(@transfer.destiny_id).name : Warehouse.find(@transfer.destiny_id).name %> </div>
									</div>
									<div class="row static-info">
										<div class="col-md-5 name"> <i class="fa fa-calendar"></i>
										&nbsp Fecha envío: </div>
										<div class="col-md-7 value"> <%= l(@transfer.transfer_date, :format => '%d/%B/%Y') %> </div>
									</div>
									<div class="row static-info">
										<div class="col-md-5 name"> <i class="fa fa-odnoklassniki"></i>
										&nbsp Capturó: </div>
										<div class="col-md-7 value"> <%= @transfer.user.first_name %> </div>
									</div>
									<div class="row static-info">
										<div class="col-md-5 name"> <i class="fa fa-calendar"></i>
										&nbsp Status: </div>
										<div class="col-md-7 value">
			                <%= transfer_status(@transfer) %>
										</div>
									</div>
									<% if @transfer.received? %>
										<div class="row static-info">
											<div class="col-md-5 name"> <i class="fa fa-calendar"></i>
											&nbsp Fecha recepcion:</div>
											<div class="col-md-7 value"> <%= l(@transfer.reception_date, :format => '%d/%B/%Y') %>  </div>
										</div>
										<div class="row static-info">
											<div class="col-md-5 name"> <i class="fa fa-smile-o"></i>
											&nbsp Recibió:</div>
											<div class="col-md-7 value"> <%= @transfer.received_by.first_name %> </div>
										</div>
										<div class="row static-info">
											<div class="col-md-5 name"> <i class="fa fa-comments"></i>
											&nbsp Observaciones:</div>
											<div class="col-md-70 value"> <%= @transfer.observations %> </div>
										</div>
									<% end %>
								</div>
							</div>
						</div>
						<div class="col-md-8 col-sm-12">
							<div class="portlet light bordered">
								<div class="portlet-title">
									<div class="caption"> <i class="fa fa-fw fa-cubes"></i>Lista de productos </div>
								</div>
								<div class="portlet-body">
									<div class="table-scrollable">
						        <table class="table table-hover table-bordered">
					            <thead>
				                <tr class="uppercase">
			                    <th> # </th>
			                    <th> Producto </th>
			                    <th> Cantidad enviada </th>
			                    <th> Cantidad recibida </th>
			                    <th> Status de recepción</th>
				                </tr>
					            </thead>
					            <tbody>
					              <% @transfer.transfer_details.each_with_index do |detail, key| %>
					                <tr>
				                  	<td> <%= key + 1 %> </td>
				                  	<td>
				                  		<%= detail.product.name %><br>
    													<%= detail.product.display_attributes %>
				                  	</td>
				                  	<td> <%= detail.quantity %> </td>
				                  	<td> <%= detail.adjustment if @transfer.received? %> </td>
						            		<td class="text-center"><%= transfer_details_status(detail) if @transfer.received? %></td>
					                </tr>
					              <% end %>
					            </tbody>
                  	</table>
									</div>
              	</div>
							</div>
						</div>
					</div>
				</div>
				<!-- END PAGE CONTENT INNER -->
			</div>
		</div>
		<!-- END PAGE CONTENT BODY -->
		<!-- END CONTENT BODY -->
	</div>
	<!-- END CONTENT -->
</div>
<!-- END CONTAINER -->
