<div class='pdf-body'>
	<h3 style="margin-top:20px" class="text-center">Traspaso de <strong><%= origin %></strong> a <strong><%= destiny %></strong></h3> 

	<div class="resume" style="border-bottom:1px solid black;">
		<h4 style="margin-top:5px;margin-bottom:5px">Información general</h4>

		<strong>Fecha:</strong>&nbsp;&nbsp;
			<%= l(transfer.transfer_date, :format => '%d/%m/%y') %><br>

		<strong>Capturó:</strong>&nbsp;&nbsp;
			<%= transfer.user.first_name %><br>

		<strong>Productos:</strong>&nbsp;&nbsp;
			<%= transfer.products.count %><br>

		<strong>Status:</strong>&nbsp;&nbsp;
	        <% case transfer.status %>
	          <% when "cancelled" %>
	            CANCELADO <br>	
	          <% when "pending" %>
	            PENDIENTE <br>	
	          <% when "received" %>
	            RECIBIDO <br>	
	        <% end %>

		<% if transfer.received? %>
			<strong>Status de recepción:</strong>&nbsp;&nbsp;
				<%= reception_status %><br>

			<strong>Fecha de recepción:</strong>&nbsp;&nbsp;
				<%= l(transfer.reception_date, :format => '%d/%m/%y') %><br>

			<strong>Recibió:</strong>&nbsp;&nbsp;
				<%= transfer.received_by.first_name %>
							
			<% if transfer.observations.present? %>
				<br> <strong>Observaciones:</strong>&nbsp;&nbsp;
					<%= transfer.observations %>			
			<% end %>
		<% end %>		
	</div>

	<div class="products">
		<table cellspacing="0">
			<thead>
				<tr>
					<th style="text-align:left;font-weight:normal">Cant. Enviado</th>
					<th style="text-align:center;font-weight:normal">Cant. Recibido</th>
					<th style="text-align:right;font-weight:normal">Status recepción</th>
				</tr>
			</thead>
			<tbody style="border-top:1px solid black">
				<% transfer.transfer_details.each do |detail| %>
					<tr>
						<td colspan="3">
							<strong><%= truncate(detail.product.name.upcase, :length => 30, :separator => ' ', :omission => '') %> &nbsp; <%= truncate(detail.product.display_attributes_receipt.upcase, :length => 20, :separator => ' ', :omission => '') %></strong>
						</td>
					</tr>
					<tr>
						<td style="text-align:center"> 
							<%= detail.quantity.round %>  
						</td>
						<td style="text-align:center">
							<%= detail.adjustment if transfer.received? %>
						</td>
						<td style="text-align:right">
							<% if detail.has_looses? %>
								CON PERDIDA
							<% elsif detail.has_surplus? %>
								CON EXCEDENTE
							<% end %>
						</td>						
					</tr>				
				<% end %>			
			</tbody>
		</table>
	</div>		

</div>




